Blocksy Companion - Version 1.8.1

Version Description

Download this release

Release Info

Developer creativethemeshq
Plugin Icon wp plugin Blocksy Companion
Version 1.8.1
Comparing to
See all releases

Code changes from version 1.7.63 to 1.8.1

Files changed (97) hide show
  1. blocksy-companion.php +1 -1
  2. framework/cache-reset-manager.php +2 -2
  3. framework/dashboard.php +9 -2
  4. framework/extensions-manager.php +2 -2
  5. framework/extensions/cookies-consent/extension.php +3 -3
  6. framework/extensions/cookies-consent/readme.php +1 -17
  7. framework/extensions/cookies-consent/static/bundle/{main.css → main.min.css} +1 -1
  8. framework/extensions/mailchimp/extension.php +21 -9
  9. framework/extensions/mailchimp/mailchimp-manager.php +12 -7
  10. framework/extensions/mailchimp/static/bundle/main.js +1 -1
  11. framework/extensions/mailchimp/static/bundle/{main.css → main.min.css} +2 -2
  12. framework/extensions/mailchimp/static/js/main.js +50 -64
  13. framework/extensions/mailchimp/static/sass/main.scss +4 -5
  14. framework/extensions/mailchimp/static/sass/single-block.scss +1 -1
  15. framework/extensions/product-reviews/extension.php +2 -2
  16. framework/extensions/product-reviews/metabox.php +9 -3
  17. framework/extensions/product-reviews/pre-boot.php +1 -1
  18. framework/extensions/product-reviews/static/bundle/{main-admin.css → main-admin.min.css} +1 -1
  19. framework/extensions/product-reviews/static/bundle/{main.css → main.min.css} +1 -1
  20. framework/extensions/product-reviews/views/single-top.php +7 -1
  21. framework/extensions/trending/config.php +1 -1
  22. framework/extensions/trending/customizer.php +118 -79
  23. framework/extensions/trending/extension.php +76 -73
  24. framework/extensions/trending/global.php +14 -14
  25. framework/extensions/trending/helpers.php +31 -12
  26. framework/extensions/trending/static/bundle/main.js +1 -1
  27. framework/extensions/trending/static/bundle/main.min.css +8 -0
  28. framework/extensions/trending/static/js/main.js +12 -13
  29. framework/extensions/trending/static/js/trending-block.js +1 -19
  30. framework/extensions/trending/static/sass/main.scss +184 -0
  31. framework/extensions/widgets/extension.php +1 -1
  32. framework/extensions/widgets/static/bundle/main.css +0 -8
  33. framework/extensions/widgets/static/bundle/main.min.css +8 -0
  34. framework/extensions/widgets/static/sass/posts.scss +4 -4
  35. framework/extensions/widgets/widgets/ct-advertisement/options.php +7 -0
  36. framework/extensions/widgets/widgets/ct-advertisement/view.php +5 -1
  37. framework/extensions/widgets/widgets/ct-posts/view.php +13 -11
  38. framework/features/conditions-manager.php +132 -3
  39. framework/features/customizer-options-manager.php +4 -13
  40. framework/features/demo-install.php +1 -0
  41. framework/features/demo-install/content-installer.php +17 -0
  42. framework/features/demo-install/install-finish.php +27 -1
  43. framework/features/demo-install/options-import.php +0 -2
  44. framework/features/demo-install/wp-importer.php +0 -26
  45. framework/features/dynamic-css.php +2 -6
  46. framework/features/google-analytics.php +2 -4
  47. framework/features/header.php +61 -55
  48. framework/features/header/account-modal.php +28 -97
  49. framework/features/header/items/account/config.php +2 -1
  50. framework/features/header/items/account/dynamic-styles.php +6 -6
  51. framework/features/header/items/account/options.php +21 -16
  52. framework/features/header/items/account/sync.js +28 -0
  53. framework/features/header/items/account/view.php +6 -5
  54. framework/features/header/items/account/views/login.php +5 -1
  55. framework/features/header/items/account/views/logout.php +7 -1
  56. framework/features/header/modal/login.php +41 -0
  57. framework/features/header/modal/lostpassword.php +19 -0
  58. framework/features/header/modal/register.php +32 -0
  59. framework/helpers/helpers.php +44 -0
  60. framework/theme-integration.php +190 -23
  61. freemius/assets/img/blocksy-companion.jpg +0 -0
  62. readme.txt +58 -1
  63. static/bundle/account.js +1 -0
  64. static/bundle/dark-mode.js +1 -0
  65. static/bundle/dashboard.css +0 -8
  66. static/bundle/dashboard.js +1 -1
  67. static/bundle/dashboard.min.css +8 -0
  68. static/bundle/main.css +0 -7
  69. static/bundle/main.js +0 -1
  70. static/bundle/main.min.css +7 -0
  71. static/bundle/options.js +1 -1
  72. static/bundle/{options.css → options.min.css} +2 -2
  73. static/bundle/sticky.js +1 -0
  74. static/bundle/sync.js +1 -1
  75. static/js/account.js +46 -0
  76. static/js/dark-mode.js +15 -0
  77. static/js/frontend/account.js +17 -44
  78. static/js/frontend/sticky.js +49 -30
  79. static/js/header/EditConditions.js +3 -3
  80. static/js/header/PanelsManager.js +2 -0
  81. static/js/helpers/SubmitSupport.js +11 -3
  82. static/js/main.js +0 -14
  83. static/js/options/ConditionsManager.js +44 -48
  84. static/js/options/ConditionsManager/PostIdPicker.js +102 -0
  85. static/js/options/CustomizerOptionsManager.js +80 -6
  86. static/js/options/DisplayCondition.js +13 -12
  87. static/js/screens/DemoInstall/DemosList.js +10 -6
  88. static/js/screens/DemoInstall/Wizzard/ModifyDemo.js +11 -11
  89. static/js/screens/DemoInstall/Wizzard/Plugins.js +9 -8
  90. static/js/sticky.js +9 -0
  91. static/js/sync/header.js +13 -30
  92. static/sass/beta.scss +12 -0
  93. static/sass/demo-install/builders.scss +1 -1
  94. static/sass/demo-install/installer.scss +1 -1
  95. static/sass/demo-install/main.scss +1 -1
  96. static/sass/extensions/main.scss +4 -56
  97. static/sass/options/animated-checkbox.scss +1 -1
blocksy-companion.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
- Version: 1.7.63
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blc
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
+ Version: 1.8.1
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blc
framework/cache-reset-manager.php CHANGED
@@ -26,7 +26,7 @@ class CacheResetManager {
26
  if ($options['type'] === 'theme') {
27
  if (in_array('blocksy', $options['themes'])) {
28
  $this->run_cache_purge();
29
- do_action('blocksy:dynamic-css:regenere_css_files');
30
  }
31
  }
32
 
@@ -39,7 +39,7 @@ class CacheResetManager {
39
 
40
  if (in_array(BLOCKSY_PLUGIN_BASE, $plugins)) {
41
  $this->run_cache_purge();
42
- do_action('blocksy:dynamic-css:regenere_css_files');
43
  }
44
  }
45
  }
26
  if ($options['type'] === 'theme') {
27
  if (in_array('blocksy', $options['themes'])) {
28
  $this->run_cache_purge();
29
+ do_action('blocksy:dynamic-css:refresh-caches');
30
  }
31
  }
32
 
39
 
40
  if (in_array(BLOCKSY_PLUGIN_BASE, $plugins)) {
41
  $this->run_cache_purge();
42
+ do_action('blocksy:dynamic-css:refresh-caches');
43
  }
44
  }
45
  }
framework/dashboard.php CHANGED
@@ -110,7 +110,14 @@ class Dashboard {
110
  'connect_template' => $connect_template
111
  ];
112
 
113
- if (Plugin::instance()->premium) {
 
 
 
 
 
 
 
114
  $result['has_beta_consent'] = Plugin::instance()->premium->user_wants_beta_updates();
115
  }
116
 
@@ -141,7 +148,7 @@ class Dashboard {
141
 
142
  wp_enqueue_style(
143
  'blocksy-dashboard-styles',
144
- BLOCKSY_URL . 'static/bundle/dashboard.css',
145
  [],
146
  $data['Version']
147
  );
110
  'connect_template' => $connect_template
111
  ];
112
 
113
+ if (
114
+ Plugin::instance()->premium
115
+ &&
116
+ is_callable([
117
+ Plugin::instance()->premium,
118
+ 'user_wants_beta_updates'
119
+ ])
120
+ ) {
121
  $result['has_beta_consent'] = Plugin::instance()->premium->user_wants_beta_updates();
122
  }
123
 
148
 
149
  wp_enqueue_style(
150
  'blocksy-dashboard-styles',
151
+ BLOCKSY_URL . 'static/bundle/dashboard.min.css',
152
  [],
153
  $data['Version']
154
  );
framework/extensions-manager.php CHANGED
@@ -146,7 +146,7 @@ class ExtensionsManager
146
 
147
  $activated[] = strtolower( $id );
148
  update_option( $this->get_option_name(), array_unique( $activated ) );
149
- Plugin::instance()->dynamic_css->generate_css_files();
150
  }
151
 
152
  public function deactivate_extension( $id )
@@ -164,7 +164,7 @@ class ExtensionsManager
164
  }
165
  }
166
  update_option( $this->get_option_name(), array_diff( $activated, [ $id ] ) );
167
- Plugin::instance()->dynamic_css->generate_css_files();
168
  }
169
 
170
  private function read_installed_extensions()
146
 
147
  $activated[] = strtolower( $id );
148
  update_option( $this->get_option_name(), array_unique( $activated ) );
149
+ do_action( 'blocksy:dynamic-css:refresh-caches' );
150
  }
151
 
152
  public function deactivate_extension( $id )
164
  }
165
  }
166
  update_option( $this->get_option_name(), array_diff( $activated, [ $id ] ) );
167
+ do_action( 'blocksy:dynamic-css:refresh-caches' );
168
  }
169
 
170
  private function read_installed_extensions()
framework/extensions/cookies-consent/extension.php CHANGED
@@ -35,7 +35,7 @@ class BlocksyExtensionCookiesConsent {
35
  wp_enqueue_script(
36
  'blocksy-cookies-consent-customizer-sync',
37
  BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/sync.js',
38
- [ 'ct-events', 'customize-preview' ],
39
  $data['Version'],
40
  true
41
  );
@@ -55,7 +55,7 @@ class BlocksyExtensionCookiesConsent {
55
 
56
  wp_enqueue_style(
57
  'blocksy-ext-cookies-consent-styles',
58
- BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.css',
59
  ['ct-main-styles'],
60
  $data['Version']
61
  );
@@ -63,7 +63,7 @@ class BlocksyExtensionCookiesConsent {
63
  wp_enqueue_script(
64
  'blocksy-ext-cookies-consent-scripts',
65
  BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.js',
66
- ['ct-events', 'ct-scripts'],
67
  $data['Version'],
68
  true
69
  );
35
  wp_enqueue_script(
36
  'blocksy-cookies-consent-customizer-sync',
37
  BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/sync.js',
38
+ [ 'ct-scripts', 'customize-preview' ],
39
  $data['Version'],
40
  true
41
  );
55
 
56
  wp_enqueue_style(
57
  'blocksy-ext-cookies-consent-styles',
58
+ BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.min.css',
59
  ['ct-main-styles'],
60
  $data['Version']
61
  );
63
  wp_enqueue_script(
64
  'blocksy-ext-cookies-consent-scripts',
65
  BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.js',
66
+ ['ct-scripts'],
67
  $data['Version'],
68
  true
69
  );
framework/extensions/cookies-consent/readme.php CHANGED
@@ -19,20 +19,4 @@
19
  ?>
20
  </i>
21
  </li>
22
- </ul>
23
-
24
- <div class="extension-notice">
25
- <h4><?php echo __('Known problems with caching plugins', 'blc'); ?></h4>
26
-
27
- <p>
28
- <?php
29
- echo sprintf(
30
- __('Please read %s to find out more information.', 'blc'),
31
- sprintf(
32
- '<a href="https://creativethemes.com/blocksy/docs/extensions/cookies-consent/#cache/">%s</a>',
33
- __('this article', 'blc')
34
- )
35
- );
36
- ?>
37
- </p>
38
- </div>
19
  ?>
20
  </i>
21
  </li>
22
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
framework/extensions/cookies-consent/static/bundle/{main.css → main.min.css} RENAMED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.63
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.1
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/mailchimp/extension.php CHANGED
@@ -78,18 +78,30 @@ class BlocksyExtensionMailchimp {
78
 
79
  wp_enqueue_style(
80
  'blocksy-ext-newsletter-subscribe-styles',
81
- BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.css',
82
  ['ct-main-styles'],
83
  $data['Version']
84
  );
 
85
 
86
- wp_enqueue_script(
87
- 'blocksy-ext-newsletter-subscribe-scripts',
88
- BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.js',
89
- ['ct-scripts'],
90
- $data['Version'],
91
- true
92
- );
 
 
 
 
 
 
 
 
 
 
 
93
  });
94
 
95
  add_filter('blocksy_widgets_paths', function ($all_widgets) {
@@ -132,7 +144,7 @@ class BlocksyExtensionMailchimp {
132
  wp_enqueue_script(
133
  'blocksy-newsletter-subscribe-customizer-sync',
134
  BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/sync.js',
135
- [ 'customize-preview', 'ct-events' ],
136
  $data['Version'],
137
  true
138
  );
78
 
79
  wp_enqueue_style(
80
  'blocksy-ext-newsletter-subscribe-styles',
81
+ BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.min.css',
82
  ['ct-main-styles'],
83
  $data['Version']
84
  );
85
+ });
86
 
87
+ add_filter('blocksy:frontend:dynamic-js-chunks', function ($chunks) {
88
+ $chunks[] = [
89
+ 'id' => 'blocksy_ext_mailchimp',
90
+ 'selector' => implode(', ', [
91
+ '.ct-mailchimp-widget-form:not([data-skip-submit])',
92
+ '.ct-mailchimp-block-form:not([data-skip-submit])'
93
+ ]),
94
+ 'url' => blc_call_fn(
95
+ [
96
+ 'fn' => 'blocksy_cdn_url',
97
+ 'default' => BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.js'
98
+ ],
99
+ BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.js'
100
+ ),
101
+ 'trigger' => 'submit'
102
+ ];
103
+
104
+ return $chunks;
105
  });
106
 
107
  add_filter('blocksy_widgets_paths', function ($all_widgets) {
144
  wp_enqueue_script(
145
  'blocksy-newsletter-subscribe-customizer-sync',
146
  BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/sync.js',
147
+ [ 'customize-preview', 'ct-scripts' ],
148
  $data['Version'],
149
  true
150
  );
framework/extensions/mailchimp/mailchimp-manager.php CHANGED
@@ -51,18 +51,23 @@ class BlocksyMailchimpManager {
51
 
52
  $region = explode('-', $api_key);
53
 
54
- $response = wp_remote_get('https://' . $region[1] . '.api.mailchimp.com/3.0/lists', [
55
- 'headers' => [
56
- 'Authorization' => 'Basic ' . base64_encode('asd:' . $api_key)
 
 
 
 
 
57
  ]
58
- ]);
59
 
60
- if ( ! is_wp_error( $response ) ) {
61
- if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
62
  return 'api_key_invalid';
63
  }
64
 
65
- $body = json_decode(wp_remote_retrieve_body( $response ), true);
66
 
67
  if (! $body) {
68
  return 'api_key_invalid';
51
 
52
  $region = explode('-', $api_key);
53
 
54
+ $response = wp_remote_get(
55
+ 'https://' . $region[1] . '.api.mailchimp.com/3.0/lists',
56
+ [
57
+ 'headers' => [
58
+ 'Authorization' => 'Basic ' . base64_encode(
59
+ 'asd:' . $api_key
60
+ )
61
+ ]
62
  ]
63
+ );
64
 
65
+ if (! is_wp_error($response)) {
66
+ if (200 !== wp_remote_retrieve_response_code($response)) {
67
  return 'api_key_invalid';
68
  }
69
 
70
+ $body = json_decode(wp_remote_retrieve_body($response), true);
71
 
72
  if (! $body) {
73
  return 'api_key_invalid';
framework/extensions/mailchimp/static/bundle/main.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=window.ctFrontend},function(e,t,r){"use strict";r.r(t);var n=r(0);function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}Object(n.onDocumentLoaded)((function(){o(document.querySelectorAll(".ct-mailchimp-widget-form, .ct-mailchimp-block-form")).map((function(e){e.matches("[data-skip-submit]")||e.addEventListener("submit",(function(e){e.preventDefault();var t=e.target;if(t.querySelector('[type="email"]').value.trim()){if(document.getElementById("js-validate-robot")&&""!==document.getElementById("js-validate-robot").value)return!1;for(var r=t.action.replace("subscribe","subscribe/post-json"),n="",o="mailchimpCallback",i=t.querySelectorAll("input"),c=0;c<i.length;c++)n+="&"+i[c].name+"="+encodeURIComponent(i[c].value);n+="&c=".concat(o);var u=document.createElement("script");u.src=r+n,document.body.appendChild(u),t.classList.remove("subscribe-error","subscribe-success"),t.classList.add("subscribe-loading"),window[o]=function(e){delete window[o],document.body.removeChild(u),t.classList.remove("subscribe-loading"),e&&(t.classList.add("error"===e.result?"subscribe-error":"subscribe-success"),t.querySelector(".ct-mailchimp-message").innerHTML=e.msg.replace("0 - ",""))}}}))}))}))}]);
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=window.ctFrontend},function(e,t,r){"use strict";r.r(t);var n=r(0);Object(n.registerDynamicChunk)("blocksy_ext_mailchimp",{mount:function(e,t){var r=t.event.target;if(r.querySelector('[type="email"]').value.trim()){if(document.getElementById("js-validate-robot")&&""!==document.getElementById("js-validate-robot").value)return!1;for(var n=r.action.replace("subscribe","subscribe/post-json"),o="",c="mailchimpCallback",i=r.querySelectorAll("input"),u=0;u<i.length;u++)o+="&"+i[u].name+"="+encodeURIComponent(i[u].value);o+="&c=".concat(c);var s=document.createElement("script");s.src=n+o,document.body.appendChild(s),r.classList.remove("subscribe-error","subscribe-success"),r.classList.add("subscribe-loading"),window[c]=function(e){delete window[c],document.body.removeChild(s),r.classList.remove("subscribe-loading"),e&&(r.classList.add("error"===e.result?"subscribe-error":"subscribe-success"),r.querySelector(".ct-mailchimp-message").innerHTML=e.msg.replace("0 - ",""))}}}})}]);
framework/extensions/mailchimp/static/bundle/{main.css → main.min.css} RENAMED
@@ -1,8 +1,8 @@
1
  /**
2
- * - v1.7.63
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
6
  */
7
 
8
- .ct-widget-inner[data-alignment="center"]{text-align:center}.ct-widget-inner[data-alignment="right"]{text-align:right}.ct-widget-inner[data-container="boxed"]{padding:30px;background:#fff;border-radius:3px;box-shadow:0px 12px 18px -6px rgba(34,56,101,0.04)}.ct-mailchimp-widget-form .ct-mailchimp-description:not(:empty){margin-bottom:10px}.ct-mailchimp-widget-form>*:not(:first-child){margin-top:10px}.ct-mailchimp-widget-form button{width:100%}.ct-mailchimp-widget-form .gdpr-confirm-policy{--display: inline-flex;--contentSpacing: 0;margin-top:20px}.ct-mailchimp-block{margin-top:60px;text-align:center;color:var(--color);padding:var(--padding);background:var(--backgroundColor);box-shadow:var(--box-shadow);--linkInitialColor: var(--color)}.ct-mailchimp-block>*:first-child{margin-top:20px}.ct-mailchimp-block>*:last-child{margin-bottom:20px}.ct-mailchimp-block>h3{--fontSize: 25px}.ct-mailchimp-block .ct-mailchimp-description:not(:empty){margin-bottom:30px}.ct-mailchimp-block form{max-width:550px;margin:0 auto}@media (min-width: 690px){.ct-mailchimp-block form{width:85%}}.ct-mailchimp-block form button{--buttonMinHeight: var(--formInputHeight);--padding: 0 15px;width:100%}.ct-mailchimp-block form [data-fields]{display:grid;grid-column-gap:15px;grid-row-gap:15px}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="1"]{grid-template-columns:65% 1fr}}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="2"]{grid-template-columns:32.5% 32.5% 1fr}}.ct-mailchimp-block .ct-mailchimp-message,.ct-mailchimp-block .gdpr-confirm-policy{margin-top:15px;--contentSpacing: 0}form[class*="ct-mailchimp"] .button{--buttonFontWeight: 600}.ct-mailchimp-message{display:none;font-size:16px}.ct-mailchimp-message a{text-decoration:underline}.subscribe-error .ct-mailchimp-message{display:block;font-size:14px;color:#e42b2b}.subscribe-success button.button,.subscribe-success input[type="text"],.subscribe-success input[type="email"],.subscribe-success .gdpr-confirm-policy,.subscribe-success .ct-mailchimp-description{display:none}.subscribe-success .ct-mailchimp-message{display:block}
1
  /**
2
+ * - v1.8.1
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
6
  */
7
 
8
+ .ct-widget-inner[data-alignment="center"]{text-align:center}.ct-widget-inner[data-alignment="right"]{text-align:right}.ct-widget-inner[data-container="boxed"]{padding:30px;background:#fff;border-radius:3px;box-shadow:0px 12px 18px -6px rgba(34,56,101,0.04)}.ct-mailchimp-widget-form .ct-mailchimp-description:not(:empty){margin-bottom:10px}.ct-mailchimp-widget-form>*:not(:first-child){margin-top:10px}.ct-mailchimp-widget-form button{width:100%}.ct-mailchimp-widget-form .gdpr-confirm-policy{--display: inline-flex;--contentSpacing: 0;margin-top:20px}.ct-mailchimp-block{margin-top:60px;text-align:center;color:var(--color);padding:var(--padding);background:var(--backgroundColor);box-shadow:var(--box-shadow);--linkInitialColor: var(--color)}.ct-mailchimp-block>*:first-child{margin-top:20px}.ct-mailchimp-block>*:last-child{margin-bottom:20px}.ct-mailchimp-block>h3{--fontSize: 25px}.ct-mailchimp-block .ct-mailchimp-description:not(:empty){margin-bottom:30px}.ct-mailchimp-block form{max-width:550px;margin:0 auto}@media (min-width: 690px){.ct-mailchimp-block form{width:85%}}.ct-mailchimp-block form button{--buttonMinHeight: var(--form-field-height, 40px);--padding: 0 15px;width:100%}.ct-mailchimp-block form [data-fields]{display:grid;grid-column-gap:15px;grid-row-gap:15px}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="1"]{grid-template-columns:65% 1fr}}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="2"]{grid-template-columns:32.5% 32.5% 1fr}}.ct-mailchimp-block .ct-mailchimp-message,.ct-mailchimp-block .gdpr-confirm-policy{margin-top:15px;--contentSpacing: 0}form[class*='ct-mailchimp'] .button{--buttonFontWeight: 600}.ct-mailchimp-message{display:none;font-size:16px}.ct-mailchimp-message a{text-decoration:underline}.subscribe-error .ct-mailchimp-message{display:block;font-size:14px;color:#e42b2b}.subscribe-success button.button,.subscribe-success input[type='text'],.subscribe-success input[type='email'],.subscribe-success .gdpr-confirm-policy,.subscribe-success .ct-mailchimp-description{display:none}.subscribe-success .ct-mailchimp-message{display:block}
framework/extensions/mailchimp/static/js/main.js CHANGED
@@ -1,82 +1,68 @@
1
- import { onDocumentLoaded } from 'blocksy-frontend'
2
-
3
- onDocumentLoaded(() => {
4
- ;[
5
- ...document.querySelectorAll(
6
- '.ct-mailchimp-widget-form, .ct-mailchimp-block-form'
7
- ),
8
- ].map((el) => {
9
- if (el.matches('[data-skip-submit]')) {
10
- return
11
- }
12
 
13
- el.addEventListener('submit', (e) => {
14
- e.preventDefault()
15
- const form = e.target
16
 
17
- if (!form.querySelector('[type="email"]').value.trim()) {
18
- return
19
- }
20
 
21
- // Check for spam
22
- if (
23
- document.getElementById('js-validate-robot') &&
24
- document.getElementById('js-validate-robot').value !== ''
25
- ) {
26
- return false
27
- }
28
 
29
- // Get url for mailchimp
30
- var url = form.action.replace('subscribe', 'subscribe/post-json')
31
 
32
- // Add form data to object
33
- var data = ''
34
 
35
- var callback = 'mailchimpCallback'
36
 
37
- var inputs = form.querySelectorAll('input')
38
 
39
- for (var i = 0; i < inputs.length; i++) {
40
- data +=
41
- '&' +
42
- inputs[i].name +
43
- '=' +
44
- encodeURIComponent(inputs[i].value)
45
- }
46
 
47
- data += `&c=${callback}`
48
 
49
- // Create & add post script to the DOM
50
- var script = document.createElement('script')
51
- script.src = url + data
52
 
53
- document.body.appendChild(script)
54
 
55
- form.classList.remove('subscribe-error', 'subscribe-success')
56
- form.classList.add('subscribe-loading')
57
 
58
- // Callback function
59
- window[callback] = function (data) {
60
- // Remove post script from the DOM
61
- delete window[callback]
62
- document.body.removeChild(script)
63
 
64
- form.classList.remove('subscribe-loading')
65
 
66
- if (!data) {
67
- return
68
- }
69
 
70
- form.classList.add(
71
- data.result === 'error'
72
- ? 'subscribe-error'
73
- : 'subscribe-success'
74
- )
75
 
76
- form.querySelector(
77
- '.ct-mailchimp-message'
78
- ).innerHTML = data.msg.replace('0 - ', '')
79
- }
80
- })
81
- })
82
  })
1
+ import { registerDynamicChunk } from 'blocksy-frontend'
 
 
 
 
 
 
 
 
 
 
2
 
3
+ registerDynamicChunk('blocksy_ext_mailchimp', {
4
+ mount: (el, { event }) => {
5
+ const form = event.target
6
 
7
+ if (!form.querySelector('[type="email"]').value.trim()) {
8
+ return
9
+ }
10
 
11
+ // Check for spam
12
+ if (
13
+ document.getElementById('js-validate-robot') &&
14
+ document.getElementById('js-validate-robot').value !== ''
15
+ ) {
16
+ return false
17
+ }
18
 
19
+ // Get url for mailchimp
20
+ var url = form.action.replace('subscribe', 'subscribe/post-json')
21
 
22
+ // Add form data to object
23
+ var data = ''
24
 
25
+ var callback = 'mailchimpCallback'
26
 
27
+ var inputs = form.querySelectorAll('input')
28
 
29
+ for (var i = 0; i < inputs.length; i++) {
30
+ data +=
31
+ '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value)
32
+ }
 
 
 
33
 
34
+ data += `&c=${callback}`
35
 
36
+ // Create & add post script to the DOM
37
+ var script = document.createElement('script')
38
+ script.src = url + data
39
 
40
+ document.body.appendChild(script)
41
 
42
+ form.classList.remove('subscribe-error', 'subscribe-success')
43
+ form.classList.add('subscribe-loading')
44
 
45
+ // Callback function
46
+ window[callback] = function (data) {
47
+ // Remove post script from the DOM
48
+ delete window[callback]
49
+ document.body.removeChild(script)
50
 
51
+ form.classList.remove('subscribe-loading')
52
 
53
+ if (!data) {
54
+ return
55
+ }
56
 
57
+ form.classList.add(
58
+ data.result === 'error'
59
+ ? 'subscribe-error'
60
+ : 'subscribe-success'
61
+ )
62
 
63
+ form.querySelector(
64
+ '.ct-mailchimp-message'
65
+ ).innerHTML = data.msg.replace('0 - ', '')
66
+ }
67
+ },
 
68
  })
framework/extensions/mailchimp/static/sass/main.scss CHANGED
@@ -2,8 +2,7 @@
2
  @import 'widget';
3
  @import 'single-block';
4
 
5
-
6
- form[class*="ct-mailchimp"] {
7
  .button {
8
  --buttonFontWeight: 600;
9
  }
@@ -27,8 +26,8 @@ form[class*="ct-mailchimp"] {
27
 
28
  .subscribe-success {
29
  button.button,
30
- input[type="text"],
31
- input[type="email"],
32
  .gdpr-confirm-policy,
33
  .ct-mailchimp-description {
34
  display: none;
@@ -37,4 +36,4 @@ form[class*="ct-mailchimp"] {
37
  .ct-mailchimp-message {
38
  display: block;
39
  }
40
- }
2
  @import 'widget';
3
  @import 'single-block';
4
 
5
+ form[class*='ct-mailchimp'] {
 
6
  .button {
7
  --buttonFontWeight: 600;
8
  }
26
 
27
  .subscribe-success {
28
  button.button,
29
+ input[type='text'],
30
+ input[type='email'],
31
  .gdpr-confirm-policy,
32
  .ct-mailchimp-description {
33
  display: none;
36
  .ct-mailchimp-message {
37
  display: block;
38
  }
39
+ }
framework/extensions/mailchimp/static/sass/single-block.scss CHANGED
@@ -37,7 +37,7 @@
37
  }
38
 
39
  button {
40
- --buttonMinHeight: var(--formInputHeight);
41
  --padding: 0 15px;
42
  width: 100%;
43
  }
37
  }
38
 
39
  button {
40
+ --buttonMinHeight: var(--form-field-height, 40px);
41
  --padding: 0 15px;
42
  width: 100%;
43
  }
framework/extensions/product-reviews/extension.php CHANGED
@@ -94,7 +94,7 @@ class BlocksyExtensionProductReviews {
94
  }, 10, 2);
95
 
96
  add_action(
97
- 'blocksy:content:top',
98
  function () {
99
  if (! is_singular('blc-product-review')) {
100
  return;
@@ -121,7 +121,7 @@ class BlocksyExtensionProductReviews {
121
 
122
  wp_enqueue_style(
123
  'blocksy-ext-product-reviews-styles',
124
- BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/main.css',
125
  ['ct-main-styles'],
126
  $data['Version']
127
  );
94
  }, 10, 2);
95
 
96
  add_action(
97
+ 'blocksy:template:before',
98
  function () {
99
  if (! is_singular('blc-product-review')) {
100
  return;
121
 
122
  wp_enqueue_style(
123
  'blocksy-ext-product-reviews-styles',
124
+ BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/main.min.css',
125
  ['ct-main-styles'],
126
  $data['Version']
127
  );
framework/extensions/product-reviews/metabox.php CHANGED
@@ -3,7 +3,7 @@
3
  $options = [
4
 
5
  blocksy_rand_md5() => [
6
- 'title' => __( 'General', 'blocksy' ),
7
  'type' => 'tab',
8
  'options' => [
9
 
@@ -32,6 +32,12 @@ $options = [
32
  'value' => '#'
33
  ],
34
 
 
 
 
 
 
 
35
  /*
36
  'product_button_icon' => [
37
  'type' => 'icon-picker',
@@ -80,7 +86,7 @@ $options = [
80
  ],
81
 
82
  blocksy_rand_md5() => [
83
- 'title' => __( 'Rating', 'blocksy' ),
84
  'type' => 'tab',
85
  'options' => [
86
 
@@ -188,7 +194,7 @@ $options = [
188
  ],
189
 
190
  // blocksy_rand_md5() => [
191
- // 'title' => __( 'Design', 'blocksy' ),
192
  // 'type' => 'tab',
193
  // 'options' => [
194
 
3
  $options = [
4
 
5
  blocksy_rand_md5() => [
6
+ 'title' => __( 'General', 'blc' ),
7
  'type' => 'tab',
8
  'options' => [
9
 
32
  'value' => '#'
33
  ],
34
 
35
+ 'product_link_target' => [
36
+ 'label' => __( 'Open Link In New Tab', 'blc' ),
37
+ 'type' => 'ct-switch',
38
+ 'value' => 'no',
39
+ ],
40
+
41
  /*
42
  'product_button_icon' => [
43
  'type' => 'icon-picker',
86
  ],
87
 
88
  blocksy_rand_md5() => [
89
+ 'title' => __( 'Rating', 'blc' ),
90
  'type' => 'tab',
91
  'options' => [
92
 
194
  ],
195
 
196
  // blocksy_rand_md5() => [
197
+ // 'title' => __( 'Design', 'blc' ),
198
  // 'type' => 'tab',
199
  // 'options' => [
200
 
framework/extensions/product-reviews/pre-boot.php CHANGED
@@ -21,7 +21,7 @@ class BlocksyExtensionProductReviewsPreBoot {
21
 
22
  wp_enqueue_style(
23
  'blocksy-ext-product-reviews-admin-dashboard-styles',
24
- BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/main-admin.css',
25
  [],
26
  $data['Version']
27
  );
21
 
22
  wp_enqueue_style(
23
  'blocksy-ext-product-reviews-admin-dashboard-styles',
24
+ BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/main-admin.min.css',
25
  [],
26
  $data['Version']
27
  );
framework/extensions/product-reviews/static/bundle/{main-admin.css → main-admin.min.css} RENAMED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.63
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.1
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/{main.css → main.min.css} RENAMED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.63
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.1
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/product-reviews/views/single-top.php CHANGED
@@ -16,6 +16,12 @@ if ($thumb_id) {
16
  $gallery_images = [];
17
  }
18
 
 
 
 
 
 
 
19
  echo '<section class="ct-product-hero">';
20
  echo '<div class="ct-container">';
21
  if (count($gallery_images) === 1) {
@@ -147,7 +153,7 @@ if (! empty($product_button_label)) {
147
  }
148
 
149
  if (! empty($product_button_label) && ! empty($product_link)) {
150
- echo '<a href="' . esc_url($product_link) . '" class="ct-button">';
151
  echo $product_button_label;
152
 
153
  /*
16
  $gallery_images = [];
17
  }
18
 
19
+ $target_output = '';
20
+
21
+ if (blocksy_akg('product_link_target', $atts, 'no') === 'yes') {
22
+ $target_output = 'target="_blank" rel="noopener noreferrer"';
23
+ }
24
+
25
  echo '<section class="ct-product-hero">';
26
  echo '<div class="ct-container">';
27
  if (count($gallery_images) === 1) {
153
  }
154
 
155
  if (! empty($product_button_label) && ! empty($product_link)) {
156
+ echo '<a href="' . esc_url($product_link) . '" class="ct-button" ' . wp_kses_post($target_output) . '>';
157
  echo $product_button_label;
158
 
159
  /*
framework/extensions/trending/config.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
  $config = [
4
- 'title' => __('Trending Block', 'blc'),
5
  'description' => __('Display a trending list of posts, products or custom post types at the bottom of your website.', 'blc')
6
  ];
1
  <?php
2
 
3
  $config = [
4
+ 'name' => __('Trending Posts', 'blc'),
5
  'description' => __('Display a trending list of posts, products or custom post types at the bottom of your website.', 'blc')
6
  ];
framework/extensions/trending/customizer.php CHANGED
@@ -39,98 +39,121 @@ $options = [
39
  'title' => __( 'General', 'blc' ),
40
  'type' => 'tab',
41
  'options' => [
42
- 'trending_block_post_type' => count($all_post_types) > 1 ? [
43
- 'label' => __( 'Post Type', 'blc' ),
44
- 'type' => 'ct-select',
45
- 'value' => 'post',
46
- 'design' => 'inline',
47
- 'setting' => [ 'transport' => 'postMessage' ],
48
- 'choices' => blocksy_ordered_keys($all_post_types),
49
-
50
- 'sync' => [
51
- 'selector' => '.ct-trending-block',
52
- 'render' => function () {
53
- echo blc_get_trending_block();
54
- }
 
 
 
 
 
 
 
55
  ],
56
- ] : [
57
- 'label' => __('Post Type', 'blc'),
58
- 'type' => 'hidden',
59
- 'value' => 'post',
60
- 'design' => 'none',
61
- 'setting' => ['transport' => 'postMessage'],
62
- ],
63
 
64
- 'trending_block_filter' => [
65
- 'label' => __( 'Trending From', 'blc' ),
66
- 'type' => 'ct-select',
67
- 'value' => 'all_time',
68
- 'view' => 'text',
69
- 'design' => 'inline',
70
- 'setting' => [ 'transport' => 'postMessage' ],
71
- 'choices' => blocksy_ordered_keys(
72
- [
73
- 'all_time' => __( 'All Time', 'blc' ),
74
- 'last_24_hours' => __( 'Last 24 Hours', 'blc' ),
75
- 'last_7_days' => __( 'Last 7 Days', 'blc' ),
76
- 'last_month' => __( 'Last Month', 'blc' ),
77
- ]
78
- ),
 
 
 
 
 
 
 
 
 
79
 
80
- 'sync' => [
81
- 'selector' => '.ct-trending-block',
82
- 'render' => function () {
83
- echo blocksy_get_trending_block();
84
- }
85
  ],
86
- ],
87
 
88
- blocksy_rand_md5() => [
89
- 'type' => 'ct-divider',
90
- ],
 
 
91
 
92
- 'trendingBlockContainerSpacing' => [
93
- 'label' => __( 'Container Inner Spacing', 'blc' ),
94
- 'type' => 'ct-slider',
95
- 'value' => [
96
- 'mobile' => '30px',
97
- 'tablet' => '30px',
98
- 'desktop' => '30px',
99
- ],
100
- 'units' => blocksy_units_config([
101
- [
102
- 'unit' => 'px',
103
- 'min' => 0,
104
- 'max' => 100,
105
  ],
106
- ]),
107
- 'responsive' => true,
108
- 'sync' => 'live',
109
- ],
110
 
111
- blocksy_rand_md5() => [
112
- 'type' => 'ct-divider',
 
 
 
 
113
  ],
114
 
115
- 'trending_block_visibility' => [
116
- 'label' => __( 'Container Visibility', 'blc' ),
117
- 'type' => 'ct-visibility',
118
- 'design' => 'block',
119
- 'sync' => 'live',
 
 
 
 
 
 
 
 
120
 
121
- 'value' => [
122
- 'desktop' => true,
123
- 'tablet' => true,
124
- 'mobile' => false,
 
 
 
 
 
 
125
  ],
126
 
127
- 'choices' => blocksy_ordered_keys([
128
- 'desktop' => __( 'Desktop', 'blc' ),
129
- 'tablet' => __( 'Tablet', 'blc' ),
130
- 'mobile' => __( 'Mobile', 'blc' ),
131
- ]),
132
- ],
 
 
 
 
 
133
 
 
 
 
 
 
 
134
  ],
135
  ],
136
 
@@ -191,12 +214,28 @@ $options = [
191
  'value' => blocksy_background_default_value([
192
  'backgroundColor' => [
193
  'default' => [
194
- 'color' => '#e0e3e8',
195
  ],
196
  ],
197
  ])
198
  ],
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  ],
201
  ],
202
  ]
39
  'title' => __( 'General', 'blc' ),
40
  'type' => 'tab',
41
  'options' => [
42
+ [
43
+ 'trending_block_post_type' => count($all_post_types) > 1 ? [
44
+ 'label' => __( 'Post Type', 'blc' ),
45
+ 'type' => 'ct-select',
46
+ 'value' => 'post',
47
+ 'design' => 'inline',
48
+ 'setting' => [ 'transport' => 'postMessage' ],
49
+ 'choices' => blocksy_ordered_keys($all_post_types),
50
+ 'sync' => [
51
+ 'selector' => '.ct-trending-block',
52
+ 'render' => function () {
53
+ echo blc_get_trending_block();
54
+ }
55
+ ],
56
+ ] : [
57
+ 'label' => __('Post Type', 'blc'),
58
+ 'type' => 'hidden',
59
+ 'value' => 'post',
60
+ 'design' => 'none',
61
+ 'setting' => ['transport' => 'postMessage'],
62
  ],
 
 
 
 
 
 
 
63
 
64
+ 'trending_block_filter' => [
65
+ 'label' => __( 'Trending From', 'blc' ),
66
+ 'type' => 'ct-select',
67
+ 'divider' => 'top',
68
+ 'value' => 'all_time',
69
+ 'view' => 'text',
70
+ 'design' => 'inline',
71
+ 'setting' => [ 'transport' => 'postMessage' ],
72
+ 'choices' => blocksy_ordered_keys(
73
+ [
74
+ 'all_time' => __( 'All Time', 'blc' ),
75
+ 'last_24_hours' => __( 'Last 24 Hours', 'blc' ),
76
+ 'last_7_days' => __( 'Last 7 Days', 'blc' ),
77
+ 'last_month' => __( 'Last Month', 'blc' ),
78
+ ]
79
+ ),
80
+
81
+ 'sync' => [
82
+ 'selector' => '.ct-trending-block',
83
+ 'render' => function () {
84
+ echo blocksy_get_trending_block();
85
+ }
86
+ ],
87
+ ],
88
 
89
+ blocksy_rand_md5() => [
90
+ 'type' => 'ct-divider',
 
 
 
91
  ],
 
92
 
93
+ 'trending_block_visibility' => [
94
+ 'label' => __( 'Container Visibility', 'blc' ),
95
+ 'type' => 'ct-visibility',
96
+ 'design' => 'block',
97
+ 'sync' => 'live',
98
 
99
+ 'value' => [
100
+ 'desktop' => true,
101
+ 'tablet' => true,
102
+ 'mobile' => false,
 
 
 
 
 
 
 
 
 
103
  ],
 
 
 
 
104
 
105
+ 'choices' => blocksy_ordered_keys([
106
+ 'desktop' => __( 'Desktop', 'blc' ),
107
+ 'tablet' => __( 'Tablet', 'blc' ),
108
+ 'mobile' => __( 'Mobile', 'blc' ),
109
+ ]),
110
+ ],
111
  ],
112
 
113
+ blc_fs()->is__premium_only() ? [
114
+
115
+ 'trending_block_location' => [
116
+ 'label' => __('Display Location', 'blc'),
117
+ 'type' => 'ct-select',
118
+ 'design' => 'inline',
119
+ 'divider' => 'top',
120
+ 'value' => 'blocksy:content:bottom',
121
+ 'choices' => [
122
+ [
123
+ 'key' => 'blocksy:content:bottom',
124
+ 'value' => __('Before Footer', 'blc')
125
+ ],
126
 
127
+ [
128
+ 'key' => 'blocksy:footer:after',
129
+ 'value' => __('After Footer', 'blc')
130
+ ],
131
+
132
+ [
133
+ 'key' => 'blocksy:header:after',
134
+ 'value' => __('After Header', 'blc')
135
+ ]
136
+ ]
137
  ],
138
 
139
+ 'trending_block_conditions' => [
140
+ 'label' => __('Display Conditions', 'blc'),
141
+ 'type' => 'blocksy-display-condition',
142
+ 'divider' => 'top',
143
+ 'value' => [
144
+ [
145
+ 'type' => 'include',
146
+ 'rule' => 'everywhere',
147
+ ]
148
+ ],
149
+ 'display' => 'modal',
150
 
151
+ 'modalTitle' => __('Trending Block Display Conditions', 'blc'),
152
+ 'modalDescription' => __('Add one or more conditions to display the trending block.', 'blc'),
153
+ 'design' => 'block',
154
+ 'sync' => 'live'
155
+ ],
156
+ ] : [],
157
  ],
158
  ],
159
 
214
  'value' => blocksy_background_default_value([
215
  'backgroundColor' => [
216
  'default' => [
217
+ 'color' => 'var(--paletteColor5)',
218
  ],
219
  ],
220
  ])
221
  ],
222
 
223
+ 'trendingBlockContainerSpacing' => [
224
+ 'label' => __( 'Container Inner Spacing', 'blc' ),
225
+ 'type' => 'ct-slider',
226
+ 'divider' => 'top',
227
+ 'value' => '30px',
228
+ 'units' => blocksy_units_config([
229
+ [
230
+ 'unit' => 'px',
231
+ 'min' => 0,
232
+ 'max' => 100,
233
+ ],
234
+ ]),
235
+ 'responsive' => true,
236
+ 'sync' => 'live',
237
+ ],
238
+
239
  ],
240
  ],
241
  ]
framework/extensions/trending/extension.php CHANGED
@@ -1,76 +1,79 @@
1
  <?php
2
 
3
- require_once dirname(__FILE__) . '/helpers.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- class BlocksyExtensionTrending {
6
- public function __construct() {
7
- add_action('wp_enqueue_scripts', function () {
8
- if (! function_exists('get_plugin_data')) {
9
- require_once(ABSPATH . 'wp-admin/includes/plugin.php');
10
- }
11
-
12
- $data = get_plugin_data(BLOCKSY__FILE__);
13
-
14
- if (is_admin()) {
15
- return;
16
- }
17
-
18
- wp_enqueue_script(
19
- 'blocksy-ext-trending-scripts',
20
- BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js',
21
- ['ct-events', 'ct-scripts'],
22
- $data['Version'],
23
- true
24
- );
25
- });
26
-
27
- add_filter(
28
- 'blocksy_extensions_customizer_options',
29
- function ($opts) {
30
- $opts['trending_posts_ext'] = blc_call_fn(
31
- [
32
- 'fn' => 'blocksy_get_options',
33
- 'default' => 'array'
34
- ],
35
- dirname( __FILE__ ) . '/customizer.php',
36
- [], false
37
- );
38
-
39
- return $opts;
40
- }
41
- );
42
-
43
- add_action(
44
- 'blocksy:template:after',
45
- function () {
46
- echo blc_get_trending_block();
47
- }
48
- );
49
-
50
- add_action(
51
- 'customize_preview_init',
52
- function () {
53
- if (! function_exists('get_plugin_data')) {
54
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
55
- }
56
-
57
- $data = get_plugin_data(BLOCKSY__FILE__);
58
-
59
- wp_enqueue_script(
60
- 'blocksy-trending-customizer-sync',
61
- BLOCKSY_URL . 'framework/extensions/trending/static/bundle/sync.js',
62
- ['customize-preview', 'ct-events', 'ct-customizer'],
63
- $data['Version'],
64
- true
65
- );
66
- }
67
- );
68
-
69
- add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
70
- blocksy_theme_get_dynamic_styles(array_merge([
71
- 'path' => dirname( __FILE__ ) . '/global.php',
72
- 'chunk' => 'global'
73
- ], $args));
74
- }, 10, 3);
75
- }
76
- }
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/helpers.php';
4
+ class BlocksyExtensionTrending
5
+ {
6
+ public function __construct()
7
+ {
8
+ add_action( 'wp_enqueue_scripts', function () {
9
+ if ( !function_exists( 'get_plugin_data' ) ) {
10
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
11
+ }
12
+ $data = get_plugin_data( BLOCKSY__FILE__ );
13
+ if ( is_admin() ) {
14
+ return;
15
+ }
16
+ wp_enqueue_style(
17
+ 'blocksy-ext-trending-styles',
18
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.min.css',
19
+ [ 'ct-main-styles' ],
20
+ $data['Version']
21
+ );
22
+ } );
23
+ add_filter( 'blocksy:frontend:dynamic-js-chunks', function ( $chunks ) {
24
+ $chunks[] = [
25
+ 'id' => 'blocksy_ext_trending',
26
+ 'selector' => '.ct-trending-block [class*="ct-arrow"]',
27
+ 'url' => blc_call_fn( [
28
+ 'fn' => 'blocksy_cdn_url',
29
+ 'default' => BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js',
30
+ ], BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js' ),
31
+ 'trigger' => 'click',
32
+ ];
33
+ return $chunks;
34
+ } );
35
+ add_filter( 'blocksy_extensions_customizer_options', function ( $opts ) {
36
+ $opts['trending_posts_ext'] = blc_call_fn(
37
+ [
38
+ 'fn' => 'blocksy_get_options',
39
+ 'default' => 'array',
40
+ ],
41
+ dirname( __FILE__ ) . '/customizer.php',
42
+ [],
43
+ false
44
+ );
45
+ return $opts;
46
+ } );
47
+ add_action( 'wp', function () {
48
+ $location = 'blocksy:template:after';
49
+ add_action( $location, function () {
50
+ echo blc_get_trending_block() ;
51
+ }, 50 );
52
+ } );
53
+ add_action( 'customize_preview_init', function () {
54
+ if ( !function_exists( 'get_plugin_data' ) ) {
55
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
56
+ }
57
+ $data = get_plugin_data( BLOCKSY__FILE__ );
58
+ wp_enqueue_script(
59
+ 'blocksy-trending-customizer-sync',
60
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/sync.js',
61
+ [ 'customize-preview', 'ct-scripts', 'ct-customizer' ],
62
+ $data['Version'],
63
+ true
64
+ );
65
+ } );
66
+ add_action(
67
+ 'blocksy:global-dynamic-css:enqueue',
68
+ function ( $args ) {
69
+ blocksy_theme_get_dynamic_styles( array_merge( [
70
+ 'path' => dirname( __FILE__ ) . '/global.php',
71
+ 'chunk' => 'global',
72
+ ], $args ) );
73
+ },
74
+ 10,
75
+ 3
76
+ );
77
+ }
78
 
79
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
framework/extensions/trending/global.php CHANGED
@@ -26,7 +26,7 @@ blc_call_fn(['fn' => 'blocksy_output_background_css'], [
26
  ], [
27
  'backgroundColor' => [
28
  'default' => [
29
- 'color' => '#e0e3e8'
30
  ],
31
  ],
32
  ])
@@ -34,19 +34,19 @@ blc_call_fn(['fn' => 'blocksy_output_background_css'], [
34
  'responsive' => true,
35
  ]);
36
 
37
- blc_call_fn(['fn' => 'blocksy_output_responsive'], [
38
- 'css' => $css,
39
- 'tablet_css' => $tablet_css,
40
- 'mobile_css' => $mobile_css,
41
- 'selector' => ".ct-trending-block",
42
- 'variableName' => 'padding',
43
- 'value' => get_theme_mod('trendingBlockContainerSpacing', [
44
- 'mobile' => '30px',
45
- 'tablet' => '30px',
46
- 'desktop' => '30px',
47
- ]),
48
- 'unit' => ''
49
- ]);
50
 
51
  blc_call_fn(['fn' => 'blocksy_output_colors'], [
52
  'value' => get_theme_mod('trendingBlockFontColor'),
26
  ], [
27
  'backgroundColor' => [
28
  'default' => [
29
+ 'color' => 'var(--paletteColor5)'
30
  ],
31
  ],
32
  ])
34
  'responsive' => true,
35
  ]);
36
 
37
+ $container_inner_spacing = get_theme_mod( 'trendingBlockContainerSpacing', '30px' );
38
+
39
+ if ($container_inner_spacing !== '30px') {
40
+ blc_call_fn(['fn' => 'blocksy_output_responsive'], [
41
+ 'css' => $css,
42
+ 'tablet_css' => $tablet_css,
43
+ 'mobile_css' => $mobile_css,
44
+ 'selector' => ".ct-trending-block",
45
+ 'variableName' => 'padding',
46
+ 'value' => $container_inner_spacing,
47
+ 'unit' => ''
48
+ ]);
49
+ }
50
 
51
  blc_call_fn(['fn' => 'blocksy_output_colors'], [
52
  'value' => get_theme_mod('trendingBlockFontColor'),
framework/extensions/trending/helpers.php CHANGED
@@ -66,11 +66,12 @@ if (! function_exists('blc_get_trending_posts_value')) {
66
 
67
  $post_type = get_theme_mod('trending_block_post_type', 'post');
68
 
69
- if ($post_type === 'product' && !class_exists('WooCommerce')) {
70
  $post_type = 'post';
71
  }
72
 
73
- $query = new WP_Query(
 
74
  [
75
  'post_type' => $post_type,
76
  'order' => 'DESC',
@@ -81,7 +82,7 @@ if (! function_exists('blc_get_trending_posts_value')) {
81
  'ignore_sticky_posts' => true,
82
  'post_status' => 'publish'
83
  ]
84
- );
85
 
86
  if (! $query->have_posts()) {
87
  return [
@@ -95,18 +96,27 @@ if (! function_exists('blc_get_trending_posts_value')) {
95
  while ($query->have_posts()) {
96
  $query->the_post();
97
 
98
- $result[] = [
99
  'id' => get_the_ID(),
100
  'attachment_id' => get_post_thumbnail_id(),
101
  'title' => get_the_title(),
102
  'url' => get_permalink(),
103
- 'image' => blc_call_fn(['fn' => 'blocksy_image'], [
104
- 'attachment_id' => get_post_thumbnail_id(),
105
- 'size' => 'thumbnail',
106
- 'ratio' => '1/1',
107
- 'tag_name' => 'div',
108
- ])
109
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  $is_last = intval($query->max_num_pages) === intval($args['paged']);
@@ -147,9 +157,18 @@ function blc_get_trending_block($forced = false) {
147
  ])
148
  );
149
 
 
 
 
 
 
 
 
 
 
150
  ?>
151
 
152
- <section class="<?php echo $class ?>">
153
  <div class="ct-container" <?php echo $data_page ?>>
154
  <h5 class="ct-block-title">
155
  <?php echo __('Trending now', 'blc') ?>
@@ -170,7 +189,7 @@ function blc_get_trending_block($forced = false) {
170
  echo blocksy_html_tag(
171
  'a',
172
  [
173
- 'href' => $post['url']
174
  ],
175
 
176
  $post['image'] . blocksy_html_tag(
66
 
67
  $post_type = get_theme_mod('trending_block_post_type', 'post');
68
 
69
+ if ($post_type === 'product' && ! class_exists('WooCommerce')) {
70
  $post_type = 'post';
71
  }
72
 
73
+ $query = new WP_Query(apply_filters(
74
+ 'blocksy:trending-posts:query-args',
75
  [
76
  'post_type' => $post_type,
77
  'order' => 'DESC',
82
  'ignore_sticky_posts' => true,
83
  'post_status' => 'publish'
84
  ]
85
+ ));
86
 
87
  if (! $query->have_posts()) {
88
  return [
96
  while ($query->have_posts()) {
97
  $query->the_post();
98
 
99
+ $individual_entry = [
100
  'id' => get_the_ID(),
101
  'attachment_id' => get_post_thumbnail_id(),
102
  'title' => get_the_title(),
103
  'url' => get_permalink(),
104
+ 'image' => ''
 
 
 
 
 
105
  ];
106
+
107
+ if (get_post_thumbnail_id()) {
108
+ $individual_entry['image'] = blc_call_fn(
109
+ ['fn' => 'blocksy_image'],
110
+ [
111
+ 'attachment_id' => get_post_thumbnail_id(),
112
+ 'size' => 'thumbnail',
113
+ 'ratio' => '1/1',
114
+ 'tag_name' => 'div',
115
+ ]
116
+ );
117
+ }
118
+
119
+ $result[] = $individual_entry;
120
  }
121
 
122
  $is_last = intval($query->max_num_pages) === intval($args['paged']);
157
  ])
158
  );
159
 
160
+ $attr = [
161
+ 'class' => $class
162
+ ];
163
+
164
+ if (is_customize_preview()) {
165
+ $attr['data-shortcut'] = 'border';
166
+ $attr['data-location'] = 'trending_posts_ext';
167
+ }
168
+
169
  ?>
170
 
171
+ <section <?php echo blocksy_attr_to_html($attr) ?>>
172
  <div class="ct-container" <?php echo $data_page ?>>
173
  <h5 class="ct-block-title">
174
  <?php echo __('Trending now', 'blc') ?>
189
  echo blocksy_html_tag(
190
  'a',
191
  [
192
+ 'href' => $post['url'],
193
  ],
194
 
195
  $post['image'] . blocksy_html_tag(
framework/extensions/trending/static/bundle/main.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=window.ctFrontend},function(e,t){e.exports=window.ctEvents},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1),c=n.n(o);function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p={},y=function(e){return p[e]?new Promise((function(t){t(p[e]),window.ct_customizer_localizations||(p[e]=p[e].clone())})):new Promise((function(t){return fetch(e).then((function(n){t(n),window.ct_customizer_localizations||(p[e]=n.clone())}))}))},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((e=f({el:null,action:null},e)).el&&e.action&&!e.el.classList.contains("ct-loading")){var t=parseInt(e.el.dataset.page,10);if(("prev"!==e.action||1!==t)&&!(e.el.querySelectorAll(".ct-container > a").length<4&&1===t||e.el.dataset.page.indexOf("last")>-1&&"next"===e.action)){e.el.classList.add("ct-loading");var n="prev"===e.action?t-1:t+1;Promise.all([new Promise((function(t){e.el.classList.add("ct-leave-active"),requestAnimationFrame((function(){e.el.classList.remove("ct-leave-active"),e.el.classList.add("ct-leave"),setTimeout((function(){return t()}),650)}))})),y("".concat(ct_localizations.ajax_url,"?action=blocksy_get_trending_posts&page=").concat(n)).then((function(e){return e.json()}))]).then((function(t){var o=a(t,2),c=(o[0],o[1]),l=c.success,u=c.data;if(l){var s=u.posts,f=s.is_last_page,d=s.posts;e.el.dataset.page="".concat(n).concat(f?":last":""),i(e.el.querySelectorAll("a")).map((function(e){return e.remove()})),d.map((function(t){return e.el.insertAdjacentHTML("beforeend",'<a href="'.concat(t.url,'">\n ').concat(t.image,'\n <span class="ct-item-title">\n ').concat(t.title,"\n </span>\n </a>"))})),setTimeout((function(){e.el.classList.remove("ct-leave"),e.el.classList.add("ct-enter-active"),requestAnimationFrame((function(){e.el.classList.remove("ct-enter-active"),e.el.classList.add("ct-active"),setTimeout((function(){e.el.classList.remove("ct-active"),e.el.classList.remove("ct-loading")}),650)}))}),50),Object(r.markImagesAsLoaded)(e.el)}}))}}},b=function(){Array.from(document.querySelectorAll(".ct-trending-block [data-page]")).map((function(e){return function(e){e.hasListeners||(e.hasListeners=!0,e.querySelector(".ct-arrow-left").addEventListener("click",(function(t){t.preventDefault(),m({el:e,action:"prev"})})),e.querySelector(".ct-arrow-right").addEventListener("click",(function(t){t.preventDefault(),m({el:e,action:"next"})})))}(e)}))};Object(r.onDocumentLoaded)((function(){b()})),c.a.on("blocksy:frontend:init",(function(){b()}))}]);
1
+ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){t.exports=window.ctFrontend},function(t,e,n){"use strict";n.r(e);var r=n(0);function o(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={},d=function(t){return f[t]?new Promise((function(e){e(f[t]),window.ct_customizer_localizations||(f[t]=f[t].clone())})):new Promise((function(e){return fetch(t).then((function(n){e(n),window.ct_customizer_localizations||(f[t]=n.clone())}))}))},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((t=s({el:null,action:null},t)).el&&t.action&&!t.el.classList.contains("ct-loading")){var e=parseInt(t.el.dataset.page,10);if(("prev"!==t.action||1!==e)&&!(t.el.querySelectorAll(".ct-container > a").length<4&&1===e||t.el.dataset.page.indexOf("last")>-1&&"next"===t.action)){t.el.classList.add("ct-loading");var n="prev"===t.action?e-1:e+1;Promise.all([new Promise((function(e){t.el.classList.add("ct-leave-active"),requestAnimationFrame((function(){t.el.classList.remove("ct-leave-active"),t.el.classList.add("ct-leave"),setTimeout((function(){return e()}),650)}))})),d("".concat(ct_localizations.ajax_url,"?action=blocksy_get_trending_posts&page=").concat(n)).then((function(t){return t.json()}))]).then((function(e){var i=a(e,2),c=(i[0],i[1]),l=c.success,s=c.data;if(l){var u=s.posts,f=u.is_last_page,d=u.posts;t.el.dataset.page="".concat(n).concat(f?":last":""),o(t.el.querySelectorAll("a")).map((function(t){return t.remove()})),d.map((function(e){return t.el.insertAdjacentHTML("beforeend",'<a href="'.concat(e.url,'">\n ').concat(e.image,'\n <span class="ct-item-title">\n ').concat(e.title,"\n </span>\n </a>"))})),setTimeout((function(){t.el.classList.remove("ct-leave"),t.el.classList.add("ct-enter-active"),requestAnimationFrame((function(){t.el.classList.remove("ct-enter-active"),t.el.classList.add("ct-active"),setTimeout((function(){t.el.classList.remove("ct-active"),t.el.classList.remove("ct-loading")}),650)}))}),50),Object(r.markImagesAsLoaded)(t.el)}}))}}};Object(r.registerDynamicChunk)("blocksy_ext_trending",{mount:function(t,e){e.event;var n=t.closest("[data-page]");t.classList.contains("ct-arrow-left")&&p({el:n,action:"prev"}),t.classList.contains("ct-arrow-right")&&p({el:n,action:"next"})}})}]);
framework/extensions/trending/static/bundle/main.min.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.8.1
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-trending-block{padding:var(--padding, 30px) 0}.ct-trending-block>div{display:grid;grid-template-columns:var(--grid-template-columns);grid-column-gap:30px;grid-row-gap:20px;margin-bottom:5px}@media (min-width: 690px) and (max-width: 999.98px){.ct-trending-block>div{--grid-template-columns: repeat(2, 1fr)}}@media (min-width: 1000px){.ct-trending-block>div{--grid-template-columns: repeat(4, 1fr)}}.ct-trending-block>div.ct-leave-active>a,.ct-trending-block>div.ct-leave>a{transition:opacity 0.3s ease, transform 0.3s ease}.ct-trending-block>div.ct-leave-active>a:nth-of-type(1),.ct-trending-block>div.ct-leave>a:nth-of-type(1){transition-delay:0s}.ct-trending-block>div.ct-leave-active>a:nth-of-type(2),.ct-trending-block>div.ct-leave>a:nth-of-type(2){transition-delay:0.15s}.ct-trending-block>div.ct-leave-active>a:nth-of-type(3),.ct-trending-block>div.ct-leave>a:nth-of-type(3){transition-delay:0.25s}.ct-trending-block>div.ct-leave-active>a:nth-of-type(4),.ct-trending-block>div.ct-leave>a:nth-of-type(4){transition-delay:0.35s}.ct-trending-block>div.ct-leave-active>a{opacity:1;transform:translateY(0)}.ct-trending-block>div.ct-leave>a{opacity:0;transform:translateY(3px)}.ct-trending-block>div.ct-enter-active>a,.ct-trending-block>div.ct-active>a{transition:opacity 0.3s ease, transform 0.3s ease}.ct-trending-block>div.ct-enter-active>a:nth-of-type(1),.ct-trending-block>div.ct-active>a:nth-of-type(1){transition-delay:0s}.ct-trending-block>div.ct-enter-active>a:nth-of-type(2),.ct-trending-block>div.ct-active>a:nth-of-type(2){transition-delay:0.15s}.ct-trending-block>div.ct-enter-active>a:nth-of-type(3),.ct-trending-block>div.ct-active>a:nth-of-type(3){transition-delay:0.25s}.ct-trending-block>div.ct-enter-active>a:nth-of-type(4),.ct-trending-block>div.ct-active>a:nth-of-type(4){transition-delay:0.35s}.ct-trending-block>div.ct-enter-active>a{opacity:0;transform:translateY(3px)}.ct-trending-block>div.ct-active>a{opacity:1;transform:translateY(0)}.ct-trending-block .ct-block-title{--fontSize: 15px;grid-column:1/-1;display:flex;align-items:center;margin-bottom:10px;--headings-color: var(--color)}.ct-trending-block .ct-block-title>svg{margin-top:4px;margin-left:10px}.ct-trending-block a{display:flex;align-items:center;--linkInitialColor: var(--color)}.ct-trending-block .ct-image-container{flex:0 0 60px;border-radius:100%;-webkit-margin-end:20px;margin-inline-end:20px;-webkit-mask-image:-webkit-radial-gradient(white, black)}.ct-trending-block .ct-item-title{word-break:break-word}.ct-trending-block [class*='ct-arrow']{display:flex;align-items:center;justify-content:center;width:23px;height:23px;cursor:pointer;background:transparent;border-radius:2px;opacity:0.5;border:1px solid var(--color);transition:var(--transition)}.ct-trending-block [class*='ct-arrow']:before{content:'';width:5px;height:5px;border:1px solid currentColor;border-right:none;border-bottom:none}.ct-trending-block [class*='ct-arrow']:hover{opacity:1;color:#fff;border-color:var(--paletteColor1);background:var(--paletteColor1)}.ct-trending-block .ct-arrow-left{margin-left:auto;margin-right:8px;padding-left:1px}.ct-trending-block .ct-arrow-left:before{transform:rotate(-45deg)}.ct-trending-block .ct-arrow-right{padding-right:1px}.ct-trending-block .ct-arrow-right:before{transform:rotate(135deg)}.ct-trending-block [data-page='1'] .ct-arrow-left,.ct-trending-block [data-page*="last"] .ct-arrow-right{opacity:0.2;pointer-events:none}
framework/extensions/trending/static/js/main.js CHANGED
@@ -1,17 +1,16 @@
1
- import { onDocumentLoaded } from 'blocksy-frontend'
2
- import ctEvents from 'ct-events'
3
- import { mount } from './trending-block'
4
 
5
- const initTrending = () => {
6
- Array.from(
7
- document.querySelectorAll('.ct-trending-block [data-page]')
8
- ).map((el) => mount(el))
9
- }
10
 
11
- onDocumentLoaded(() => {
12
- initTrending()
13
- })
14
 
15
- ctEvents.on('blocksy:frontend:init', () => {
16
- initTrending()
 
 
17
  })
1
+ import { loadPage } from './trending-block'
2
+ import { registerDynamicChunk } from 'blocksy-frontend'
 
3
 
4
+ registerDynamicChunk('blocksy_ext_trending', {
5
+ mount: (el, { event }) => {
6
+ const loadingEl = el.closest('[data-page]')
 
 
7
 
8
+ if (el.classList.contains('ct-arrow-left')) {
9
+ loadPage({ el: loadingEl, action: 'prev' })
10
+ }
11
 
12
+ if (el.classList.contains('ct-arrow-right')) {
13
+ loadPage({ el: loadingEl, action: 'next' })
14
+ }
15
+ },
16
  })
framework/extensions/trending/static/js/trending-block.js CHANGED
@@ -20,7 +20,7 @@ const cachedFetch = (url) =>
20
  })
21
  )
22
 
23
- const loadPage = (args = {}) => {
24
  args = {
25
  el: null,
26
  // prev | next
@@ -119,21 +119,3 @@ const loadPage = (args = {}) => {
119
  markImagesAsLoaded(args.el)
120
  })
121
  }
122
-
123
- export const mount = (el) => {
124
- if (el.hasListeners) {
125
- return
126
- }
127
-
128
- el.hasListeners = true
129
-
130
- el.querySelector('.ct-arrow-left').addEventListener('click', (e) => {
131
- e.preventDefault()
132
- loadPage({ el, action: 'prev' })
133
- })
134
-
135
- el.querySelector('.ct-arrow-right').addEventListener('click', (e) => {
136
- e.preventDefault()
137
- loadPage({ el, action: 'next' })
138
- })
139
- }
20
  })
21
  )
22
 
23
+ export const loadPage = (args = {}) => {
24
  args = {
25
  el: null,
26
  // prev | next
119
  markImagesAsLoaded(args.el)
120
  })
121
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
framework/extensions/trending/static/sass/main.scss ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+
3
+ .ct-trending-block {
4
+ padding: var(--padding, 30px) 0;
5
+
6
+ > div {
7
+ display: grid;
8
+ grid-template-columns: var(--grid-template-columns);
9
+ grid-column-gap: 30px;
10
+ grid-row-gap: 20px;
11
+ margin-bottom: 5px;
12
+
13
+ @include media-breakpoint-only(md) {
14
+ --grid-template-columns: repeat(2, 1fr);
15
+ }
16
+
17
+ @include media-breakpoint-up(lg) {
18
+ --grid-template-columns: repeat(4, 1fr);
19
+ }
20
+
21
+ &.ct-leave-active,
22
+ &.ct-leave {
23
+ > a {
24
+ transition: opacity 0.3s ease,
25
+ transform 0.3s ease;
26
+
27
+ &:nth-of-type(1) {
28
+ transition-delay: 0s;
29
+ }
30
+
31
+ &:nth-of-type(2) {
32
+ transition-delay: 0.15s;
33
+ }
34
+
35
+ &:nth-of-type(3) {
36
+ transition-delay: 0.25s;
37
+ }
38
+
39
+ &:nth-of-type(4) {
40
+ transition-delay: 0.35s;
41
+ }
42
+ }
43
+ }
44
+
45
+ &.ct-leave-active {
46
+ > a {
47
+ opacity: 1;
48
+ transform: translateY(0);
49
+ }
50
+ }
51
+
52
+ &.ct-leave {
53
+ > a {
54
+ opacity: 0;
55
+ transform: translateY(3px);
56
+ }
57
+ }
58
+
59
+ &.ct-enter-active,
60
+ &.ct-active {
61
+ > a {
62
+ transition: opacity 0.3s ease,
63
+ transform 0.3s ease;
64
+
65
+ &:nth-of-type(1) {
66
+ transition-delay: 0s;
67
+ }
68
+
69
+ &:nth-of-type(2) {
70
+ transition-delay: 0.15s;
71
+ }
72
+
73
+ &:nth-of-type(3) {
74
+ transition-delay: 0.25s;
75
+ }
76
+
77
+ &:nth-of-type(4) {
78
+ transition-delay: 0.35s;
79
+ }
80
+ }
81
+ }
82
+
83
+ &.ct-enter-active {
84
+ > a {
85
+ opacity: 0;
86
+ transform: translateY(3px);
87
+ }
88
+ }
89
+
90
+ &.ct-active {
91
+ > a {
92
+ opacity: 1;
93
+ transform: translateY(0);
94
+ }
95
+ }
96
+ }
97
+
98
+ .ct-block-title {
99
+ --fontSize: 15px;
100
+ grid-column: 1/-1;
101
+ display: flex;
102
+ align-items: center;
103
+ margin-bottom: 10px;
104
+ --headings-color: var(--color);
105
+
106
+ > svg {
107
+ margin-top: 4px;
108
+ margin-left: 10px;
109
+ }
110
+ }
111
+
112
+ a {
113
+ display: flex;
114
+ align-items: center;
115
+ --linkInitialColor: var(--color);
116
+ }
117
+
118
+ .ct-image-container {
119
+ flex: 0 0 60px;
120
+ border-radius: 100%;
121
+ margin-inline-end: 20px;
122
+ -webkit-mask-image: -webkit-radial-gradient(white, black);
123
+ }
124
+
125
+ .ct-item-title {
126
+ word-break: break-word;
127
+ }
128
+
129
+ // arrows
130
+ [class*='ct-arrow'] {
131
+ display: flex;
132
+ align-items: center;
133
+ justify-content: center;
134
+ width: 23px;
135
+ height: 23px;
136
+ cursor: pointer;
137
+ background: transparent;
138
+ border-radius: 2px;
139
+ opacity: 0.5;
140
+ border: 1px solid var(--color);
141
+ transition: var(--transition);
142
+
143
+ &:before {
144
+ content: '';
145
+ width: 5px;
146
+ height: 5px;
147
+ border: 1px solid currentColor;
148
+ border-right: none;
149
+ border-bottom: none;
150
+ }
151
+
152
+ &:hover {
153
+ opacity: 1;
154
+ color: #fff;
155
+ border-color: var(--paletteColor1);
156
+ background: var(--paletteColor1);
157
+ }
158
+ }
159
+
160
+ .ct-arrow-left {
161
+ margin-left: auto;
162
+ margin-right: 8px;
163
+ padding-left: 1px;
164
+
165
+ &:before {
166
+ transform: rotate(-45deg);
167
+ }
168
+ }
169
+
170
+ .ct-arrow-right {
171
+ padding-right: 1px;
172
+
173
+ &:before {
174
+ transform: rotate(135deg);
175
+ }
176
+ }
177
+
178
+ // disable arrows
179
+ [data-page='1'] .ct-arrow-left,
180
+ [data-page*="last"] .ct-arrow-right {
181
+ opacity: 0.2;
182
+ pointer-events: none;
183
+ }
184
+ }
framework/extensions/widgets/extension.php CHANGED
@@ -25,7 +25,7 @@ class BlocksyExtensionWidgets {
25
 
26
  wp_enqueue_style(
27
  'blocksy-ext-widgets-styles',
28
- BLOCKSY_URL . 'framework/extensions/widgets/static/bundle/main.css',
29
  [
30
  'ct-main-styles'
31
  ],
25
 
26
  wp_enqueue_style(
27
  'blocksy-ext-widgets-styles',
28
+ BLOCKSY_URL . 'framework/extensions/widgets/static/bundle/main.min.css',
29
  [
30
  'ct-main-styles'
31
  ],
framework/extensions/widgets/static/bundle/main.css DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * - v1.7.63
3
- *
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- .ct-posts-widget ul{--listItemSpacing: 20px}.ct-posts-widget ul a{display:var(--display, grid)}.ct-posts-widget ul .ct-image-container{align-self:start}.ct-posts-widget ul .ct-entry-content{align-self:center}.ct-posts-widget ul .ct-post-title{--fontSize: 15px;--lineHeight: 1.5;--fontWeight: 500;word-break:break-word}.ct-posts-widget ul .ct-entry-excerpt{margin-top:5px;font-size:13px;color:var(--color)}.ct-posts-widget ul .ct-entry-meta{color:var(--color)}.ct-posts-widget ul .ct-entry-meta span:not(:last-child):after{content:'/';margin:0 3px}.ct-posts-widget ul[data-type="rounded"] a,.ct-posts-widget ul[data-type="large-small"] a,.ct-posts-widget ul[data-type="small-thumbs"] a{grid-template-columns:25% 1fr;grid-column-gap:20px}.ct-posts-widget ul[data-type="no-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"]{--listItemSpacing: 25px}.ct-posts-widget ul[data-type="large-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-image-container{margin-bottom:12px}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="large-small"] li:first-child{--listItemSpacing: 30px}.ct-posts-widget ul[data-type="large-small"] li:first-child a{--display: block}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-image-container{margin-bottom:20px}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="rounded"] .ct-image-container{overflow:hidden;border-radius:100%;-webkit-mask-image:-webkit-radial-gradient(white, black)}.ct-posts-widget ul[data-type="numbered"]{counter-reset:ct-counter}.ct-posts-widget ul[data-type="numbered"] a{grid-template-columns:34px 1fr;grid-column-gap:15px}.ct-posts-widget ul[data-type="numbered"] a:before{counter-increment:ct-counter;content:counter(ct-counter);display:flex;align-items:center;justify-content:center;width:34px;height:34px;font-size:12px;font-weight:700;border-radius:100%;border:1px solid #E5E5E5;transition:var(--transition)}.ct-posts-widget ul[data-type="numbered"] a:hover:before{color:#fff;border-color:var(--paletteColor1);background:var(--paletteColor1)}.ct-posts-widget ul[data-type="numbered"] .ct-post-title::before{content:'';display:block;height:0;width:0;margin-top:calc((1 - 1.65) * 0.5em)}.ct-quote-widget{--color: #fff;position:relative;min-height:250px;border-radius:7px;padding:70px 40px 60px 60px !important;background:var(--paletteColor1) !important}.ct-quote-widget:before{position:absolute;top:50px;left:35px;content:"”";font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-weight:bold;font-size:200px;line-height:150px;opacity:0.3;width:80px;height:80px;display:flex;justify-content:center;transform:rotate(180deg)}.ct-quote-widget .ct-quote-author{display:grid;grid-template-columns:40px 1fr;grid-column-gap:15px;align-items:center;margin-top:25px;--fontWeight: 500}.ct-quote-widget .ct-quote-author figure{max-width:40px;border-radius:100%}.ct-about-me-widget figure{margin-bottom:15px}.ct-about-me-widget figure[data-size="small"]{max-width:90px}.ct-about-me-widget figure[data-size="medium"]{max-width:140px}.ct-about-me-widget figure[data-shape="square"]{border-radius:2px}.ct-about-me-widget figure[data-shape="rounded"]{border-radius:100%}.ct-about-me-widget .ct-about-me-name{display:flex;flex-direction:column}.ct-about-me-widget .ct-about-me-name:not(:last-child){margin-bottom:15px}.ct-about-me-widget .ct-about-me-text:not(:last-child){margin-bottom:25px}.ct-about-me-widget .ct-about-me-link{font-size:13px;font-weight:normal}.ct-about-me-widget [data-alignment="center"]{text-align:center}.ct-about-me-widget [data-alignment="center"] .ct-social-box{justify-content:center}.ct-about-me-widget [data-alignment="right"]{text-align:right}.ct-about-me-widget [data-alignment="right"] .ct-social-box{justify-content:flex-end}.ct-about-me-widget [data-type="bordered"]{padding:35px 25px;border-radius:7px;background:#fff;border:1px dashed rgba(0,0,0,0.1)}.ct-facebook-like-box{overflow:hidden;--fbHeader: 0px;--fbFacepile: 0px}.ct-facebook-like-box .fb-page{display:flex;justify-content:center}.ct-facebook-like-box .fb-page[data-small-header="false"]{--fbHeader: 130px}.ct-facebook-like-box .fb-page[data-small-header="true"]{--fbHeader: 70px}.ct-facebook-like-box .fb-page[data-show-facepile="true"]{--fbFacepile: 84px}.ct-facebook-like-box .fb-page:not([data-tabs="timeline"]){min-height:calc(var(--fbHeader) + var(--fbFacepile))}.ct-facebook-like-box .fb-page[data-tabs="timeline"]{min-height:500px}.ct-facebook-like-box iframe{max-width:500px;margin:0 auto}.ct-socials-widget [data-icons-type*="solid"],.ct-about-me-widget [data-icons-type*="solid"],.ct-contact-info-widget [data-icons-type*="solid"]{--icon-hover-color: #fff;--background-color: rgba(218, 222, 228, 0.3);--background-hover-color: var(--paletteColor1)}.ct-socials-widget [data-icons-type*="outline"],.ct-about-me-widget [data-icons-type*="outline"],.ct-contact-info-widget [data-icons-type*="outline"]{--icon-hover-color: var(--paletteColor1);--background-color: rgba(218, 222, 228, 1);--background-hover-color: var(--paletteColor1)}
 
 
 
 
 
 
 
 
framework/extensions/widgets/static/bundle/main.min.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.8.1
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-posts-widget ul{--listItemSpacing: 20px}.ct-posts-widget ul a{display:var(--display, flex)}.ct-posts-widget ul .ct-image-container{align-self:start}.ct-posts-widget ul .ct-entry-content{align-self:center}.ct-posts-widget ul .ct-post-title{--fontSize: 15px;--lineHeight: 1.5;--fontWeight: 500;word-break:break-word}.ct-posts-widget ul .ct-entry-excerpt{margin-top:5px;font-size:13px;color:var(--color)}.ct-posts-widget ul .ct-entry-meta{color:var(--color)}.ct-posts-widget ul .ct-entry-meta span:not(:last-child):after{content:'/';margin:0 3px}.ct-posts-widget ul[data-type="rounded"] .ct-image-container,.ct-posts-widget ul[data-type="large-small"] .ct-image-container,.ct-posts-widget ul[data-type="small-thumbs"] .ct-image-container{flex:0 0 25%;-webkit-margin-end:20px;margin-inline-end:20px}.ct-posts-widget ul[data-type="no-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"]{--listItemSpacing: 25px}.ct-posts-widget ul[data-type="large-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-image-container{margin-bottom:12px}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="large-small"] li:first-child{--listItemSpacing: 30px}.ct-posts-widget ul[data-type="large-small"] li:first-child a{--display: block}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-image-container{margin-bottom:20px}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="rounded"] .ct-image-container{overflow:hidden;border-radius:100%;-webkit-mask-image:-webkit-radial-gradient(white, black)}.ct-posts-widget ul[data-type="numbered"]{counter-reset:ct-counter}.ct-posts-widget ul[data-type="numbered"] a{grid-template-columns:34px 1fr;grid-column-gap:15px}.ct-posts-widget ul[data-type="numbered"] a:before{counter-increment:ct-counter;content:counter(ct-counter);display:flex;align-items:center;justify-content:center;width:34px;height:34px;font-size:12px;font-weight:700;border-radius:100%;border:1px solid #E5E5E5;transition:var(--transition)}.ct-posts-widget ul[data-type="numbered"] a:hover:before{color:#fff;border-color:var(--paletteColor1);background:var(--paletteColor1)}.ct-posts-widget ul[data-type="numbered"] .ct-post-title::before{content:'';display:block;height:0;width:0;margin-top:calc((1 - 1.65) * 0.5em)}.ct-quote-widget{--color: #fff;position:relative;min-height:250px;border-radius:7px;padding:70px 40px 60px 60px !important;background:var(--paletteColor1) !important}.ct-quote-widget:before{position:absolute;top:50px;left:35px;content:"”";font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-weight:bold;font-size:200px;line-height:150px;opacity:0.3;width:80px;height:80px;display:flex;justify-content:center;transform:rotate(180deg)}.ct-quote-widget .ct-quote-author{display:grid;grid-template-columns:40px 1fr;grid-column-gap:15px;align-items:center;margin-top:25px;--fontWeight: 500}.ct-quote-widget .ct-quote-author figure{max-width:40px;border-radius:100%}.ct-about-me-widget figure{margin-bottom:15px}.ct-about-me-widget figure[data-size="small"]{max-width:90px}.ct-about-me-widget figure[data-size="medium"]{max-width:140px}.ct-about-me-widget figure[data-shape="square"]{border-radius:2px}.ct-about-me-widget figure[data-shape="rounded"]{border-radius:100%}.ct-about-me-widget .ct-about-me-name{display:flex;flex-direction:column}.ct-about-me-widget .ct-about-me-name:not(:last-child){margin-bottom:15px}.ct-about-me-widget .ct-about-me-text:not(:last-child){margin-bottom:25px}.ct-about-me-widget .ct-about-me-link{font-size:13px;font-weight:normal}.ct-about-me-widget [data-alignment="center"]{text-align:center}.ct-about-me-widget [data-alignment="center"] .ct-social-box{justify-content:center}.ct-about-me-widget [data-alignment="right"]{text-align:right}.ct-about-me-widget [data-alignment="right"] .ct-social-box{justify-content:flex-end}.ct-about-me-widget [data-type="bordered"]{padding:35px 25px;border-radius:7px;background:#fff;border:1px dashed rgba(0,0,0,0.1)}.ct-facebook-like-box{overflow:hidden;--fbHeader: 0px;--fbFacepile: 0px}.ct-facebook-like-box .fb-page{display:flex;justify-content:center}.ct-facebook-like-box .fb-page[data-small-header="false"]{--fbHeader: 130px}.ct-facebook-like-box .fb-page[data-small-header="true"]{--fbHeader: 70px}.ct-facebook-like-box .fb-page[data-show-facepile="true"]{--fbFacepile: 84px}.ct-facebook-like-box .fb-page:not([data-tabs="timeline"]){min-height:calc(var(--fbHeader) + var(--fbFacepile))}.ct-facebook-like-box .fb-page[data-tabs="timeline"]{min-height:500px}.ct-facebook-like-box iframe{max-width:500px;margin:0 auto}.ct-socials-widget [data-icons-type*="solid"],.ct-about-me-widget [data-icons-type*="solid"],.ct-contact-info-widget [data-icons-type*="solid"]{--icon-hover-color: #fff;--background-color: rgba(218, 222, 228, 0.3);--background-hover-color: var(--paletteColor1)}.ct-socials-widget [data-icons-type*="outline"],.ct-about-me-widget [data-icons-type*="outline"],.ct-contact-info-widget [data-icons-type*="outline"]{--icon-hover-color: var(--paletteColor1);--background-color: rgba(218, 222, 228, 1);--background-hover-color: var(--paletteColor1)}
framework/extensions/widgets/static/sass/posts.scss CHANGED
@@ -2,7 +2,7 @@
2
  --listItemSpacing: 20px;
3
 
4
  a {
5
- display: var(--display, grid);
6
  }
7
 
8
  .ct-image-container {
@@ -41,9 +41,9 @@
41
  &[data-type="rounded"],
42
  &[data-type="large-small"],
43
  &[data-type="small-thumbs"] {
44
- a {
45
- grid-template-columns: 25% 1fr;
46
- grid-column-gap: 20px;
47
  }
48
  }
49
 
2
  --listItemSpacing: 20px;
3
 
4
  a {
5
+ display: var(--display, flex);
6
  }
7
 
8
  .ct-image-container {
41
  &[data-type="rounded"],
42
  &[data-type="large-small"],
43
  &[data-type="small-thumbs"] {
44
+ .ct-image-container {
45
+ flex: 0 0 25%;
46
+ margin-inline-end: 20px;
47
  }
48
  }
49
 
framework/extensions/widgets/widgets/ct-advertisement/options.php CHANGED
@@ -63,6 +63,13 @@ $options = [
63
  'filledLabel' => __('Change Image', 'blc'),
64
  ],
65
 
 
 
 
 
 
 
 
66
  'ad_link' => [
67
  'type' => 'text',
68
  'label' => __( 'Ad URL', 'blc' ),
63
  'filledLabel' => __('Change Image', 'blc'),
64
  ],
65
 
66
+ 'ad_image_ratio' => [
67
+ 'label' => __( 'Image Ratio', 'blocksy' ),
68
+ 'type' => 'ct-ratio',
69
+ 'value' => 'original',
70
+ 'design' => 'inline',
71
+ ],
72
+
73
  'ad_link' => [
74
  'type' => 'text',
75
  'label' => __( 'Ad URL', 'blc' ),
framework/extensions/widgets/widgets/ct-advertisement/view.php CHANGED
@@ -29,7 +29,11 @@ $ad_link_target = blocksy_default_akg( 'ad_link_target', $atts, 'yes' );
29
 
30
  $image_output = blc_call_fn(['fn' => 'blocksy_image'], [
31
  'attachment_id' => blocksy_default_akg( 'ad_image/attachment_id', $atts, null ),
32
- 'ratio' => 'original',
 
 
 
 
33
  'tag_name' => 'a',
34
  'size' => 'large',
35
  'html_atts' => array_merge([
29
 
30
  $image_output = blc_call_fn(['fn' => 'blocksy_image'], [
31
  'attachment_id' => blocksy_default_akg( 'ad_image/attachment_id', $atts, null ),
32
+ 'ratio' => blocksy_default_akg(
33
+ 'ad_image_ratio',
34
+ $atts,
35
+ 'original'
36
+ ),
37
  'tag_name' => 'a',
38
  'size' => 'large',
39
  'html_atts' => array_merge([
framework/extensions/widgets/widgets/ct-posts/view.php CHANGED
@@ -165,17 +165,19 @@ echo $before_title . wp_kses_post( $title ) . $after_title;
165
  $ratio = '4/3';
166
  }
167
 
168
- echo wp_kses_post(
169
- blc_call_fn(
170
- ['fn' => 'blocksy_image'],
171
- [
172
- 'attachment_id' => get_post_thumbnail_id(),
173
- 'ratio' => $ratio,
174
- 'tag_name' => 'div',
175
- 'size' => $size,
176
- ]
177
- )
178
- );
 
 
179
  }
180
  ?>
181
 
165
  $ratio = '4/3';
166
  }
167
 
168
+ if (get_post_thumbnail_id()) {
169
+ echo wp_kses_post(
170
+ blc_call_fn(
171
+ ['fn' => 'blocksy_image'],
172
+ [
173
+ 'attachment_id' => get_post_thumbnail_id(),
174
+ 'ratio' => $ratio,
175
+ 'tag_name' => 'div',
176
+ 'size' => $size,
177
+ ]
178
+ )
179
+ );
180
+ }
181
  }
182
  ?>
183
 
framework/features/conditions-manager.php CHANGED
@@ -6,7 +6,11 @@ class ConditionsManager {
6
  public function __construct() {
7
  }
8
 
9
- public function condition_matches($rules = []) {
 
 
 
 
10
  if (empty($rules)) {
11
  return false;
12
  }
@@ -38,7 +42,16 @@ class ConditionsManager {
38
 
39
  if (! empty($all_includes)) {
40
  // If at least one inclusion is true - return true
41
- if (! empty($resolved_includes)) {
 
 
 
 
 
 
 
 
 
42
  return true;
43
  }
44
  }
@@ -196,6 +209,16 @@ class ConditionsManager {
196
  }
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
199
  if ($rule['rule'] === 'taxonomy_ids') {
200
  if (is_tax() || is_category() || is_tag()) {
201
  $tax_id = get_queried_object_id();
@@ -291,6 +314,7 @@ class ConditionsManager {
291
  ]
292
  ]
293
  ],
 
294
  [
295
  'title' => __('Basic', 'blc'),
296
  'rules' => [
@@ -467,8 +491,113 @@ class ConditionsManager {
467
  [
468
  'title' => __('User Roles', 'blc'),
469
  'rules' => $this->get_user_roles_rules()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  ]
471
- ]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  }
473
 
474
  private function get_user_roles_rules() {