Version Description
Download this release
Release Info
Developer | creativethemeshq |
Plugin | Blocksy Companion |
Version | 1.7.55 |
Comparing to | |
See all releases |
Code changes from version 1.7.54 to 1.7.55
- blocksy-companion.php +1 -1
- framework/extensions/cookies-consent/static/bundle/main.css +1 -1
- framework/extensions/mailchimp/static/bundle/main.css +1 -1
- framework/extensions/product-reviews/static/bundle/main-admin.css +1 -1
- framework/extensions/product-reviews/static/bundle/main.css +2 -2
- framework/extensions/product-reviews/static/sass/slider.scss +27 -20
- framework/extensions/product-reviews/views/single-top.php +6 -13
- framework/extensions/widgets/static/bundle/main.css +1 -1
- framework/features/customizer-options-manager.php +10 -1
- framework/features/demo-install/options-import.php +57 -2
- framework/features/header/items/account/view.php +5 -3
- framework/views/blocksy-posts.php +3 -3
- readme.txt +12 -1
- static/bundle/dashboard.css +1 -1
- static/bundle/options.css +2 -2
- static/bundle/options.js +1 -1
- static/js/options/ConditionsManager.js +1 -0
- static/sass/options/display-conditions.scss +12 -0
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.
|
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.7.55
|
7 |
Author: CreativeThemes
|
8 |
Author URI: https://creativethemes.com
|
9 |
Text Domain: blc
|
framework/extensions/cookies-consent/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/mailchimp/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/product-reviews/static/bundle/main-admin.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/product-reviews/static/bundle/main.css
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
6 |
*/
|
7 |
|
8 |
-
.ct-product-hero .flexy-
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
6 |
*/
|
7 |
|
8 |
+
.ct-product-hero .flexy-container{overflow:hidden}@media (max-width: 999.98px){.ct-product-hero .flexy-pills{--thumbs-spacing: 10px}}@media (min-width: 1000px){.ct-product-hero .flexy-pills{max-width:70%;margin:-8% auto 0 auto;--thumbs-spacing: 20px}}.ct-product-hero .flexy-pills ol{margin:0 calc(var(--thumbs-spacing) * -1)}.ct-product-hero .flexy-pills li{padding-top:var(--thumbs-spacing);padding-left:var(--thumbs-spacing);padding-right:var(--thumbs-spacing)}.ct-product-hero .flexy-pills li img{width:100%;border-radius:3px;border-radius:2px;border:3px solid #fff}.ct-product-hero .hero-section{margin-top:var(--margin-bottom)}.ct-product-scores{display:grid;grid-column-gap:25px;grid-row-gap:25px;margin:0 auto;max-width:800px}@media (min-width: 690px){.ct-product-scores{grid-template-columns:2fr 1fr}}.ct-product-scores:not(:last-child){margin-bottom:60px}.ct-product-scores li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:10px 20px;background:rgba(243,243,243,0.5);border-radius:2px}.ct-product-scores li:hover{background:#f3f3f3}.ct-product-scores li>span{font-size:15px;font-weight:500}.ct-overall-score{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;color:#fff;border-radius:2px;background:#1A202C}.ct-overall-score .ct-average-score{font-size:55px;font-weight:800;line-height:normal;margin-bottom:10px}.ct-overall-score .ct-score-label{font-size:15px;font-weight:700;text-transform:uppercase;letter-spacing:0.02em;color:#fff;margin:15px 0 0 0}.ct-overall-score-layer{display:flex;flex-wrap:wrap;align-items:center}.ct-overall-score-layer .ct-score-label,.ct-overall-score-layer .ct-average-score{font-size:14px;font-weight:600}.ct-overall-score-layer .ct-average-score{margin:0 5px}.ct-overall-score-layer .star-rating{margin-left:auto}.ct-product-actions{display:flex;align-items:center;justify-content:center}.ct-product-actions:not(:last-child){margin-bottom:60px}.ct-product-actions .ct-button:not(:last-child){margin-right:25px}.ct-product-actions .ct-icon-container{color:inherit;margin-left:10px}.ct-product-description:not(:last-child){margin-bottom:60px}.ct-product-info{display:grid;grid-template-columns:var(--grid-template-columns);grid-column-gap:40px;grid-row-gap:40px;border-top:1px solid #ececec;padding-top:var(--content-vertical-spacing, 60px)}@media (min-width: 1000px){.ct-product-info{--grid-template-columns: 1.5fr 1fr 1fr}}@media (min-width: 690px) and (max-width: 999.98px){.ct-product-info{--grid-template-columns: 1fr 1fr}}@media (min-width: 690px) and (max-width: 999.98px){.ct-specs{grid-column:1/-1}}.ct-specs ul{display:grid;grid-column-gap:40px}@media (min-width: 690px){.ct-specs ul{grid-template-columns:repeat(2, 1fr)}}.ct-product-hero{padding-top:var(--content-vertical-spacing, 60px)}.ct-product-hero .ct-container{padding-bottom:var(--content-vertical-spacing, 60px);border-bottom:1px solid #ececec}.ct-product-hero ul{--listIndent: 0;--listStyleType: none;--contentSpacing: 0}
|
framework/extensions/product-reviews/static/sass/slider.scss
CHANGED
@@ -1,29 +1,36 @@
|
|
1 |
.ct-product-hero {
|
2 |
|
3 |
-
.flexy-
|
4 |
-
|
5 |
-
width: 80%;
|
6 |
-
margin: -7.5% auto 0 auto;
|
7 |
-
|
8 |
-
.ct-image-container {
|
9 |
-
border-radius: 2px;
|
10 |
-
border: 3px solid #fff;
|
11 |
-
}
|
12 |
}
|
13 |
|
14 |
.flexy-pills {
|
15 |
-
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
}
|
22 |
-
}
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
-
}
|
1 |
.ct-product-hero {
|
2 |
|
3 |
+
.flexy-container {
|
4 |
+
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
|
7 |
.flexy-pills {
|
8 |
+
@include media-breakpoint-down (md) {
|
9 |
+
--thumbs-spacing: 10px;
|
10 |
+
}
|
11 |
|
12 |
+
@include media-breakpoint-up (lg) {
|
13 |
+
max-width: 70%;
|
14 |
+
margin: -8% auto 0 auto;
|
15 |
+
|
16 |
+
--thumbs-spacing: 20px;
|
17 |
}
|
|
|
18 |
|
19 |
+
ol {
|
20 |
+
margin: 0 calc(var(--thumbs-spacing) * -1);
|
21 |
+
}
|
22 |
+
|
23 |
+
li {
|
24 |
+
padding-top: var(--thumbs-spacing);
|
25 |
+
padding-left: var(--thumbs-spacing);
|
26 |
+
padding-right: var(--thumbs-spacing);
|
27 |
+
|
28 |
+
img {
|
29 |
+
width: 100%;
|
30 |
+
border-radius: 3px;
|
31 |
+
border-radius: 2px;
|
32 |
+
border: 3px solid #fff;
|
33 |
+
}
|
34 |
+
}
|
35 |
}
|
36 |
+
}
|
framework/extensions/product-reviews/views/single-top.php
CHANGED
@@ -57,24 +57,17 @@ if (count($gallery_images) > 1) {
|
|
57 |
'images_ratio' => '2/1'
|
58 |
];
|
59 |
|
|
|
|
|
60 |
if (count($gallery_images) <= 5) {
|
61 |
-
$args['pills_images'] = $gallery_images;
|
62 |
} else {
|
63 |
-
$args['
|
|
|
|
|
|
|
64 |
}
|
65 |
|
66 |
echo blocksy_flexy($args);
|
67 |
-
|
68 |
-
if (count($gallery_images) > 5) {
|
69 |
-
echo blocksy_flexy([
|
70 |
-
'images' => $gallery_images,
|
71 |
-
'size' => 'thumb',
|
72 |
-
'has_pills' => false,
|
73 |
-
'images_ratio' => '1/1',
|
74 |
-
'class' => 'flexy-draggable-pills',
|
75 |
-
'first_item_class' => 'active'
|
76 |
-
]);
|
77 |
-
}
|
78 |
}
|
79 |
|
80 |
echo blocksy_output_hero_section([
|
57 |
'images_ratio' => '2/1'
|
58 |
];
|
59 |
|
60 |
+
$args['pills_images'] = $gallery_images;
|
61 |
+
|
62 |
if (count($gallery_images) <= 5) {
|
|
|
63 |
} else {
|
64 |
+
$args['pills_have_arrows'] = true;
|
65 |
+
$args['pills_container_attr'] = [
|
66 |
+
'data-flexy' => 'no'
|
67 |
+
];
|
68 |
}
|
69 |
|
70 |
echo blocksy_flexy($args);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
echo blocksy_output_hero_section([
|
framework/extensions/widgets/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/features/customizer-options-manager.php
CHANGED
@@ -52,7 +52,15 @@ class CustomizerOptionsManager {
|
|
52 |
'has_streaming' => false
|
53 |
]);
|
54 |
|
55 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
if (isset($data['blocksy_widgets'])) {
|
@@ -126,6 +134,7 @@ class CustomizerOptionsManager {
|
|
126 |
$mods = $this->get_theme_mods($theme_slug);
|
127 |
$data = [
|
128 |
'template' => $theme_slug,
|
|
|
129 |
'mods' => $mods ? $mods : array(),
|
130 |
'options' => array()
|
131 |
];
|
52 |
'has_streaming' => false
|
53 |
]);
|
54 |
|
55 |
+
$demo_data = null;
|
56 |
+
|
57 |
+
if (isset($data['site_url'])) {
|
58 |
+
$demo_data = [
|
59 |
+
'url' => $data['site_url']
|
60 |
+
];
|
61 |
+
}
|
62 |
+
|
63 |
+
$importer->import_options($data, $demo_data);
|
64 |
}
|
65 |
|
66 |
if (isset($data['blocksy_widgets'])) {
|
134 |
$mods = $this->get_theme_mods($theme_slug);
|
135 |
$data = [
|
136 |
'template' => $theme_slug,
|
137 |
+
'site_url' => get_site_url(),
|
138 |
'mods' => $mods ? $mods : array(),
|
139 |
'options' => array()
|
140 |
];
|
framework/features/demo-install/options-import.php
CHANGED
@@ -6,6 +6,8 @@ class DemoInstallOptionsInstaller {
|
|
6 |
protected $has_streaming = true;
|
7 |
protected $demo_name = null;
|
8 |
|
|
|
|
|
9 |
public function __construct($args = []) {
|
10 |
$args = wp_parse_args($args, [
|
11 |
'has_streaming' => true,
|
@@ -205,7 +207,7 @@ class DemoInstallOptionsInstaller {
|
|
205 |
}
|
206 |
|
207 |
private function import_images($demo_content, $mods) {
|
208 |
-
foreach (
|
209 |
if ($this->is_image_url($val)) {
|
210 |
$data = $this->sideload_image($val);
|
211 |
|
@@ -225,7 +227,52 @@ class DemoInstallOptionsInstaller {
|
|
225 |
}
|
226 |
}
|
227 |
|
228 |
-
if ($key === '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
$maybe_url = $this->sideload_image_for_url(
|
230 |
$demo_content['url'],
|
231 |
$val
|
@@ -284,6 +331,10 @@ class DemoInstallOptionsInstaller {
|
|
284 |
}
|
285 |
|
286 |
private function sideload_image($file) {
|
|
|
|
|
|
|
|
|
287 |
$data = new \stdClass();
|
288 |
|
289 |
if (! function_exists('media_handle_sideload')) {
|
@@ -320,6 +371,8 @@ class DemoInstallOptionsInstaller {
|
|
320 |
return $id;
|
321 |
}
|
322 |
|
|
|
|
|
323 |
// Build the object to return.
|
324 |
$meta = wp_get_attachment_metadata($id);
|
325 |
$data->attachment_id = $id;
|
@@ -328,6 +381,8 @@ class DemoInstallOptionsInstaller {
|
|
328 |
$data->height = $meta['height'];
|
329 |
$data->width = $meta['width'];
|
330 |
|
|
|
|
|
331 |
return $data;
|
332 |
}
|
333 |
|
6 |
protected $has_streaming = true;
|
7 |
protected $demo_name = null;
|
8 |
|
9 |
+
protected $sideloaded_images = [];
|
10 |
+
|
11 |
public function __construct($args = []) {
|
12 |
$args = wp_parse_args($args, [
|
13 |
'has_streaming' => true,
|
207 |
}
|
208 |
|
209 |
private function import_images($demo_content, $mods) {
|
210 |
+
foreach ($mods as $key => $val) {
|
211 |
if ($this->is_image_url($val)) {
|
212 |
$data = $this->sideload_image($val);
|
213 |
|
227 |
}
|
228 |
}
|
229 |
|
230 |
+
if ($key === 'header_placements') {
|
231 |
+
foreach ($val['sections'] as $section_index => $section) {
|
232 |
+
foreach ($section['items'] as $item_index => $item) {
|
233 |
+
$mods['header_placements']['sections'][$section_index][
|
234 |
+
'items'
|
235 |
+
][$item_index]['values'] = $this->import_images(
|
236 |
+
$demo_content,
|
237 |
+
$item['values']
|
238 |
+
);
|
239 |
+
}
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
if ($key === 'custom_logo' && is_array($val) && isset($val['desktop'])) {
|
244 |
+
$maybe_url = $this->sideload_image_for_url(
|
245 |
+
$demo_content['url'],
|
246 |
+
$val['desktop']
|
247 |
+
);
|
248 |
+
|
249 |
+
if ($maybe_url) {
|
250 |
+
$data = $this->sideload_image($maybe_url);
|
251 |
+
$mods[$key]['desktop'] = $data->attachment_id;
|
252 |
+
}
|
253 |
+
|
254 |
+
$maybe_url = $this->sideload_image_for_url(
|
255 |
+
$demo_content['url'],
|
256 |
+
$val['tablet']
|
257 |
+
);
|
258 |
+
|
259 |
+
if ($maybe_url) {
|
260 |
+
$data = $this->sideload_image($maybe_url);
|
261 |
+
$mods[$key]['tablet'] = $data->attachment_id;
|
262 |
+
}
|
263 |
+
|
264 |
+
$maybe_url = $this->sideload_image_for_url(
|
265 |
+
$demo_content['url'],
|
266 |
+
$val['mobile']
|
267 |
+
);
|
268 |
+
|
269 |
+
if ($maybe_url) {
|
270 |
+
$data = $this->sideload_image($maybe_url);
|
271 |
+
$mods[$key]['mobile'] = $data->attachment_id;
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
if ($key === 'custom_logo' && is_numeric($val)) {
|
276 |
$maybe_url = $this->sideload_image_for_url(
|
277 |
$demo_content['url'],
|
278 |
$val
|
331 |
}
|
332 |
|
333 |
private function sideload_image($file) {
|
334 |
+
if (isset($this->sideloaded_images[$file])) {
|
335 |
+
return $this->sideloaded_images[$file];
|
336 |
+
}
|
337 |
+
|
338 |
$data = new \stdClass();
|
339 |
|
340 |
if (! function_exists('media_handle_sideload')) {
|
371 |
return $id;
|
372 |
}
|
373 |
|
374 |
+
update_post_meta($id, 'blocksy_demos_imported_post', true);
|
375 |
+
|
376 |
// Build the object to return.
|
377 |
$meta = wp_get_attachment_metadata($id);
|
378 |
$data->attachment_id = $id;
|
381 |
$data->height = $meta['height'];
|
382 |
$data->width = $meta['width'];
|
383 |
|
384 |
+
$this->sideloaded_images[$file] = $data;
|
385 |
+
|
386 |
return $data;
|
387 |
}
|
388 |
|
framework/features/header/items/account/view.php
CHANGED
@@ -83,7 +83,11 @@ if ($current_user_id) {
|
|
83 |
}
|
84 |
|
85 |
if ($loggedin_media === 'avatar') {
|
86 |
-
$avatar_size = intval(
|
|
|
|
|
|
|
|
|
87 |
|
88 |
$media_html = blocksy_simple_image(
|
89 |
get_avatar_url(
|
@@ -104,8 +108,6 @@ if ($current_user_id) {
|
|
104 |
if ($loggedin_media === 'icon') {
|
105 |
$account_loggedin_icon = blocksy_akg('account_loggedin_icon', $atts, 'type-1');
|
106 |
$icon_position = blocksy_akg('account_loggedin_icon_position', $atts, 'left');
|
107 |
-
$avatar_size = intval(blocksy_akg('accountHeaderAvatarSize', $atts, 18));
|
108 |
-
|
109 |
$media_html = $icon[$account_loggedin_icon];
|
110 |
}
|
111 |
}
|
83 |
}
|
84 |
|
85 |
if ($loggedin_media === 'avatar') {
|
86 |
+
$avatar_size = intval(
|
87 |
+
blocksy_expand_responsive_value(
|
88 |
+
blocksy_akg('accountHeaderAvatarSize', $atts, 18)
|
89 |
+
)['desktop']
|
90 |
+
);
|
91 |
|
92 |
$media_html = blocksy_simple_image(
|
93 |
get_avatar_url(
|
108 |
if ($loggedin_media === 'icon') {
|
109 |
$account_loggedin_icon = blocksy_akg('account_loggedin_icon', $atts, 'type-1');
|
110 |
$icon_position = blocksy_akg('account_loggedin_icon_position', $atts, 'left');
|
|
|
|
|
111 |
$media_html = $icon[$account_loggedin_icon];
|
112 |
}
|
113 |
}
|
framework/views/blocksy-posts.php
CHANGED
@@ -15,7 +15,7 @@ if (get_query_var('paged')) {
|
|
15 |
$query_args = [
|
16 |
'order' => $args['order'],
|
17 |
'ignore_sticky_posts' => true,
|
18 |
-
'post_type' => $args['post_type'],
|
19 |
'orderby' => $args['orderby'],
|
20 |
'posts_per_page' => $args['limit'],
|
21 |
'paged' => $paged,
|
@@ -56,8 +56,8 @@ $prefix = 'blog';
|
|
56 |
$custom_post_types = blocksy_manager()->post_types->get_supported_post_types();
|
57 |
|
58 |
foreach ($custom_post_types as $cpt) {
|
59 |
-
if ($cpt === $args['post_type']) {
|
60 |
-
$prefix = $
|
61 |
}
|
62 |
}
|
63 |
|
15 |
$query_args = [
|
16 |
'order' => $args['order'],
|
17 |
'ignore_sticky_posts' => true,
|
18 |
+
'post_type' => explode(',', $args['post_type']),
|
19 |
'orderby' => $args['orderby'],
|
20 |
'posts_per_page' => $args['limit'],
|
21 |
'paged' => $paged,
|
56 |
$custom_post_types = blocksy_manager()->post_types->get_supported_post_types();
|
57 |
|
58 |
foreach ($custom_post_types as $cpt) {
|
59 |
+
if ($cpt === explode(',', $args['post_type'])[0]) {
|
60 |
+
$prefix = $cpt . '_archive';
|
61 |
}
|
62 |
}
|
63 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Requires PHP: 7.0
|
|
5 |
Tested up to: 5.6
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
-
Stable tag: 1.7.
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -23,6 +23,17 @@ It runs and adds its enhancements only if the Blocksy theme is installed and act
|
|
23 |
2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
|
24 |
|
25 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
1.7.54: 2021-01-28
|
27 |
- Improvement: Improve search box when it is placed inside the middle column
|
28 |
- Improvement: Flush permalinks after starter site install finish
|
5 |
Tested up to: 5.6
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
Stable tag: 1.7.55
|
9 |
|
10 |
== Description ==
|
11 |
|
23 |
2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
|
24 |
|
25 |
== Changelog ==
|
26 |
+
1.7.55: 2021-02-07
|
27 |
+
- New: Allow multiple post_type entries in blocksy_posts shortcode
|
28 |
+
- Improvement: Correctly handle images export/import in customizer
|
29 |
+
- Improvement: WooCommerce: 3 new mini-cart icons
|
30 |
+
- Fix: Account header element avatar size
|
31 |
+
|
32 |
+
1.7.54.2: 2021-02-02
|
33 |
+
- New: Allow multiple post_type entries in blocksy_posts shortcode
|
34 |
+
- Improvement: Correctly handle images export/import in customizer
|
35 |
+
- Improvement: WooCommerce: 3 new mini-cart icons
|
36 |
+
|
37 |
1.7.54: 2021-01-28
|
38 |
- Improvement: Improve search box when it is placed inside the middle column
|
39 |
- Improvement: Flush permalinks after starter site install finish
|
static/bundle/dashboard.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
static/bundle/options.css
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
6 |
*/
|
7 |
|
8 |
-
.ct-condition-location{display:grid;grid-template-columns:1fr 100px;grid-column-gap:10px;padding-bottom:20px;border-bottom:1px dashed rgba(0,0,0,0.1);--x-select-dropdown-width: calc(100% + 110px)}.ct-new-condition-location{--options-vertical-spacing: 20px;padding:var(--options-horizontal-spacing, 0 14px)}.ct-new-condition-location .ct-new-location{--options-horizontal-spacing: 0}.ct-new-condition-location .ct-new-location .ct-control{padding-bottom:20px;border-bottom:1px dashed rgba(0,0,0,0.1)}.ct-new-condition-location .ct-new-location button{right:-24px;width:24px}.ct-new-condition-location .button{width:100%;margin-top:20px}.ct-display-conditions{padding:30px 0;margin:10px 0 0 0;border-top:1px dashed rgba(0,0,0,0.1)}.ct-condition-group{display:grid;grid-template-columns:var(--grid-template-columns);grid-column-gap:10px;grid-row-gap:10px;padding-bottom:20px;margin-bottom:20px;border-bottom:1px dashed rgba(0,0,0,0.1)}.ct-condition-group.ct-cols-2{--grid-template-columns: 110px 1fr}.ct-condition-group.ct-cols-2 .ct-select-input:nth-child(2):before{content:'ref-width'}.ct-condition-group.ct-cols-3{--grid-template-columns: 110px 1fr 1fr}.ct-condition-group.ct-cols-3 .ct-select-input:nth-child(2):before{content:'ref-width:right'}.ct-condition-group.ct-cols-3 .ct-select-input:nth-child(3):before{content:'ref-width:left'}.ct-condition-group .ct-select-dropdown{box-shadow:0 10px 15px rgba(0,0,0,0.08),0px 0px 0px 1px rgba(221,221,221,0.5)}.ct-condition-type span{position:absolute;top:6px;left:6px;display:flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:3px;background:#eee}.ct-condition-type span:before,.ct-condition-type span:after{position:absolute;content:'';width:6px;height:1px;background:currentColor}.ct-condition-type .ct-include:after{transform:rotate(90deg)}.ct-condition-type .ct-exclude:after{display:none}.ct-condition-type input{--padding: 0 0 0 30px}.ct-new-location,.ct-condition-group{position:relative}.ct-new-location button,.ct-condition-group button{position:absolute;top:0;right:-30px;font-size:18px;line-height:18px;width:30px;height:30px;padding:0;border:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0.5;background:transparent}.ct-new-location button:focus,.ct-condition-group button:focus{outline:none}.ct-new-location button:hover,.ct-condition-group button:hover{opacity:1;color:#a00}.ct-conditions-actions{display:grid;grid-template-columns:repeat(2, 1fr);grid-column-gap:15px}.blocksy-code-editor-trigger{display:inline-flex;align-items:center;margin:0 8px}.ct-checkbox-container{--checkMarkColor: #fff;--background: rgba(179, 189, 201, 0.8);--backgroundActive: #0e8ecc;display:flex;align-items:center;justify-content:space-between;padding:10px 0;transition:color 0.15s ease}.ct-checkbox-container:not(.activated){cursor:pointer}.ct-checkbox-container:not(.activated):hover{color:#0e8ecc}.ct-checkbox-container:not(.activated):hover .ct-checkbox:not(.active){--background: var(--backgroundActive)}.ct-checkbox-container.activated{--checkMarkColor: rgba(104, 124, 147, 0.6);--backgroundActive: rgba(179, 189, 201, 0.3)}.ct-checkbox{display:inline-flex;align-items:center;justify-content:center;position:relative;width:18px;height:18px;flex:0 0 18px}.ct-checkbox:before{position:absolute;z-index:1;content:'';width:18px;height:18px;margin:auto;border-radius:100%;box-shadow:inset 0px 0px 0px 2px var(--background);transition:all 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955)}.ct-checkbox svg{position:relative;z-index:2}.ct-checkbox.active:before{width:22px;height:22px;box-shadow:inset 0px 0px 0px 12px var(--backgroundActive)}.ct-checkbox .check{fill:none;stroke:var(--checkMarkColor);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:15;stroke-dashoffset:16;transition:stroke 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955),stroke-dashoffset 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955)}.ct-checkbox.active .check{stroke-dashoffset:0}.ct-import-export input[type="file"]{display:none}.ct-import-export .button{width:100%}.ct-import-export .button:not(:last-child){margin-bottom:20px}.toplevel_page_ct-dashboard .wp-menu-image img{max-width:18px;height:auto}.toplevel_page_ct-dashboard a[href*='ct-dashboard-pricing']{display:none !important}[data-slug="blocksy-companion"] .upgrade{display:none}.fs-field-beta_program{display:none}
|
1 |
/**
|
2 |
+
* - v1.7.55
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
6 |
*/
|
7 |
|
8 |
+
.ct-condition-location{display:grid;grid-template-columns:1fr 100px;grid-column-gap:10px;padding-bottom:20px;border-bottom:1px dashed rgba(0,0,0,0.1);--x-select-dropdown-width: calc(100% + 110px)}.ct-new-condition-location{--options-vertical-spacing: 20px;padding:var(--options-horizontal-spacing, 0 14px)}.ct-new-condition-location .ct-new-location{--options-horizontal-spacing: 0}.ct-new-condition-location .ct-new-location .ct-control{padding-bottom:20px;border-bottom:1px dashed rgba(0,0,0,0.1)}.ct-new-condition-location .ct-new-location button{right:-24px;width:24px}.ct-new-condition-location .button{width:100%;margin-top:20px}.ct-control[data-location]{--options-vertical-spacing: 20px}.ct-control[data-location][data-design="inline"] input{text-align:center;--width: 100px}.ct-control[data-location]:after{border-bottom-style:dashed}.ct-display-conditions{padding:30px 0;margin:10px 0 0 0;border-top:1px dashed rgba(0,0,0,0.1)}.ct-condition-group{display:grid;grid-template-columns:var(--grid-template-columns);grid-column-gap:10px;grid-row-gap:10px;padding-bottom:20px;margin-bottom:20px;border-bottom:1px dashed rgba(0,0,0,0.1)}.ct-condition-group.ct-cols-2{--grid-template-columns: 110px 1fr}.ct-condition-group.ct-cols-2 .ct-select-input:nth-child(2):before{content:'ref-width'}.ct-condition-group.ct-cols-3{--grid-template-columns: 110px 1fr 1fr}.ct-condition-group.ct-cols-3 .ct-select-input:nth-child(2):before{content:'ref-width:right'}.ct-condition-group.ct-cols-3 .ct-select-input:nth-child(3):before{content:'ref-width:left'}.ct-condition-group .ct-select-dropdown{box-shadow:0 10px 15px rgba(0,0,0,0.08),0px 0px 0px 1px rgba(221,221,221,0.5)}.ct-condition-type span{position:absolute;top:6px;left:6px;display:flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:3px;background:#eee}.ct-condition-type span:before,.ct-condition-type span:after{position:absolute;content:'';width:6px;height:1px;background:currentColor}.ct-condition-type .ct-include:after{transform:rotate(90deg)}.ct-condition-type .ct-exclude:after{display:none}.ct-condition-type input{--padding: 0 0 0 30px}.ct-new-location,.ct-condition-group{position:relative}.ct-new-location button,.ct-condition-group button{position:absolute;top:0;right:-30px;font-size:18px;line-height:18px;width:30px;height:30px;padding:0;border:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0.5;background:transparent}.ct-new-location button:focus,.ct-condition-group button:focus{outline:none}.ct-new-location button:hover,.ct-condition-group button:hover{opacity:1;color:#a00}.ct-conditions-actions{display:grid;grid-template-columns:repeat(2, 1fr);grid-column-gap:15px}.blocksy-code-editor-trigger{display:inline-flex;align-items:center;margin:0 8px}.ct-checkbox-container{--checkMarkColor: #fff;--background: rgba(179, 189, 201, 0.8);--backgroundActive: #0e8ecc;display:flex;align-items:center;justify-content:space-between;padding:10px 0;transition:color 0.15s ease}.ct-checkbox-container:not(.activated){cursor:pointer}.ct-checkbox-container:not(.activated):hover{color:#0e8ecc}.ct-checkbox-container:not(.activated):hover .ct-checkbox:not(.active){--background: var(--backgroundActive)}.ct-checkbox-container.activated{--checkMarkColor: rgba(104, 124, 147, 0.6);--backgroundActive: rgba(179, 189, 201, 0.3)}.ct-checkbox{display:inline-flex;align-items:center;justify-content:center;position:relative;width:18px;height:18px;flex:0 0 18px}.ct-checkbox:before{position:absolute;z-index:1;content:'';width:18px;height:18px;margin:auto;border-radius:100%;box-shadow:inset 0px 0px 0px 2px var(--background);transition:all 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955)}.ct-checkbox svg{position:relative;z-index:2}.ct-checkbox.active:before{width:22px;height:22px;box-shadow:inset 0px 0px 0px 12px var(--backgroundActive)}.ct-checkbox .check{fill:none;stroke:var(--checkMarkColor);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:15;stroke-dashoffset:16;transition:stroke 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955),stroke-dashoffset 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955)}.ct-checkbox.active .check{stroke-dashoffset:0}.ct-import-export input[type="file"]{display:none}.ct-import-export .button{width:100%}.ct-import-export .button:not(:last-child){margin-bottom:20px}.toplevel_page_ct-dashboard .wp-menu-image img{max-width:18px;height:auto}.toplevel_page_ct-dashboard a[href*='ct-dashboard-pricing']{display:none !important}[data-slug="blocksy-companion"] .upgrade{display:none}.fs-field-beta_program{display:none}
|
static/bundle/options.js
CHANGED
@@ -3,4 +3,4 @@
|
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===c)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=ctEvents},function(e,t){e.exports=window.React},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r="object"===("undefined"==typeof window?"undefined":n(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":n(self))&&self.self===self?self:"object"===(void 0===t?"undefined":n(t))&&t.global===t?t:this;function o(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"!==("undefined"==typeof window?"undefined":n(window))||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var i=r.URL||r.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin!==location.origin?c(l.href)?o(e,t,n):a(l,l.target="_blank"):a(l)):(l.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(l.href)}),4e4),setTimeout((function(){a(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download","string"==typeof e)if(c(e))o(e,t,r);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){a(i)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==n(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,r),t)}:function(e,t,c,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return o(e,t,c);var i="application/octet-stream"===e.type,l=/constructor/i.test(r.HTMLElement)||r.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||i&&l)&&"object"===("undefined"==typeof FileReader?"undefined":n(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},s.readAsDataURL(e)}else{var d=r.URL||r.webkitURL,p=d.createObjectURL(e);a?a.location=p:location.href=p,a=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}};e.exports=i}).call(this,n(12))},function(e,t){e.exports=window.wp.hooks},function(e,t,n){var r=n(13);function o(e,t,n,r,c){var a=new Error(n,r,c);return a.name="UseFetchError",a.status=e,a.statusText=t,Object.setPrototypeOf(a,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(a,o),a}o.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(o,Error),e.exports=function(e,t,n){var c=(n&&n.depends||t&&t.depends||[]).reduce((function(e,t){return e||!t}),!1);return r(!c&&function(e,t,n){return fetch(e,t).then(n&&n.formatter||t&&t.formatter||function(e){if(!e.ok)throw new o(e.status,e.statusText,"Fetch error");return e.json()})},e,t||{},n||{})}},function(e,t,n){var r=n(15);e.exports=function(){var e=function(){e.id=r(),e.subscribers.forEach((function(e){e()}))};return e.id=r(),e.subscribers=[],e.subscribe=function(t){e.subscribers.push(t)},e.unsubscribe=function(t){e.subscribers.indexOf(t)>=0&&e.subscribers.splice(e.subscribers.indexOf(t),1)},e}},function(e,t,n){var r=n(6);e.exports=function(e){var t=r.useState(e.id),n=function(){return t[1](e.id)};return r.useEffect((function(){return e.subscribe(n),function(){return e.unsubscribe(n)}}),[]),t[0]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(6),o=n(14);e.exports=function(e){var t=Array.prototype.slice.call(arguments,[1]),n=r.useState({isLoading:!!e});return r.useEffect((function(){e&&(!n[0].isLoading&&n[1]({data:n[0].data,isLoading:!0}),e.apply(null,t).then((function(e){n[1]({data:e,isLoading:!1})})).catch((function(e){n[1]({error:e,isLoading:!1})})))}),o(t)),n[0]}},function(e,t){e.exports=function e(){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(r instanceof Array)for(var o=0;o<r.length;o++)t=t.concat(e(r[o]));else if("undefined"!=typeof URL&&r instanceof URL)t=t.concat(r.toJSON());else if(r instanceof Object)for(var c=Object.keys(r),a=0;a<c.length;a++){var i=c[a];t=t.concat([i]).concat(e(r[i]))}else t=t.concat(r)}return t}},function(e,t,n){for(var r=self.crypto||self.msCrypto,o="-_",c=36;c--;)o+=c.toString(36);for(c=36;c---10;)o+=c.toString(36).toUpperCase();e.exports=function(e){var t="",n=r.getRandomValues(new Uint8Array(e||21));for(c=e||21;c--;)t+=o[63&n[c]];return t}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(4),c=n(1),a=n(2),i=n(3),l=n.n(i);function u(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||m(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 s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(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 m(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function y(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}var O=[],j=[],h=function(e){var t=e.value,n=e.onChange,o=blocksy_admin.all_condition_rules.reduce((function(e,t){var n=t.rules,r=t.title;return[].concat(f(e),f(n.map((function(e){return p(p({},e),{},{group:r})}))))}),[]).reduce((function(e,t){var n=t.title,r=t.id,o=s(t,["title","id"]);return[].concat(f(e),[p({key:r,value:n},o)])}),[]),i=u(Object(r.useState)(O),2),d=i[0],b=i[1],m=u(Object(r.useState)(j),2),y=m[0],h=m[1],v=function(e){return"post_ids"===e.rule||"page_ids"===e.rule||"custom_post_type_ids"===e.rule||"taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule};return Object(r.useEffect)((function(){Promise.all(["posts","pages","ct_cpt"].map((function(e){return fetch("".concat(blocksy_admin.rest_url,"wp/v2/").concat("ct_cpt"===e?"posts":e).concat(blocksy_admin.rest_url.indexOf("?")>-1?"&":"?","_embed&per_page=100").concat("ct_cpt"===e?"&post_type=ct_cpt":"")).then((function(e){return e.json()}))}))).then((function(e){var t=e.reduce((function(e,t){return[].concat(f(e),f(t))}),[]);b(t),O=t})),fetch("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_taxonomies"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data.taxonomies;h(t),j=t}))}),[]),Object(r.createElement)("div",{className:"ct-display-conditions"},t.map((function(e,i){return Object(r.createElement)("div",{className:l()("ct-condition-group",{"ct-cols-3":v(e),"ct-cols-2":!v(e)}),key:i},Object(r.createElement)(a.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return Object(r.createElement)("span",{className:"ct-".concat(e.type)})},placeholder:Object(c.__)("Select variation","blc"),choices:{include:Object(c.__)("Include","blc"),exclude:Object(c.__)("Exclude","blc")}},value:e.type,onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{type:r}):t)})))}}),Object(r.createElement)(a.Select,{key:"second",option:{appendToBody:!0,placeholder:Object(c.__)("Select rule","blc"),choices:"user"===e.category?o.filter((function(e){return 0===e.key.indexOf("user_")})):o.filter((function(e){return-1===e.key.indexOf("user_")})),search:!0},value:e.rule,onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{rule:r}):t)})))}}),("post_ids"===e.rule||"custom_post_type_ids"===e.rule||"page_ids"===e.rule)&&Object(r.createElement)(a.Select,{key:"third",option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:"post_ids"===e.rule?Object(c.__)("Select post","blc"):"page_ids"===e.rule?Object(c.__)("Select page","blc"):Object(c.__)("Custom Post Type ID","blc"),choices:d.filter((function(t){var n=t.type;return"post_ids"===e.rule?"post"===n:"page_ids"===e.rule?"page"===n:"post"!==n&&"page"!==n})).map((function(e){return{key:e.id,value:e.title.rendered}})),search:!0},value:(e.payload||{}).post_id||"",onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{payload:p(p({},e.payload),{},{post_id:r})}):t)})))}}),("taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule)&&Object(r.createElement)(a.Select,{option:{defaultToFirstItem:!1,placeholder:Object(c.__)("Select taxonomy","blc"),choices:y.map((function(e){return p({key:e.id,value:e.name},e.group?{group:e.group}:{})})),search:!0},value:e.payload.taxonomy_id||"",onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{payload:p(p({},e.payload),{},{taxonomy_id:r})}):t)})))}}),Object(r.createElement)("button",{type:"button",onClick:function(e){e.preventDefault();var r=f(t);r.splice(i,1),n(r)}},"×"))})),Object(r.createElement)("div",{className:"ct-conditions-actions"},Object(r.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(f(t),[{type:"include",rule:"everywhere",payload:{}}]))}},Object(c.__)("Add Display Condition","blc")),Object(r.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(f(t),[{type:"include",rule:"user_logged_in",payload:{},category:"user"}]))}},Object(c.__)("Add User Condition","blc"))))};function v(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(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 _(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}var g=function(e){var t=e.option.display,n=void 0===t?"inline":t,o=e.value,i=e.onChange,l=v(Object(r.useState)(!1),2),u=l[0],s=l[1],d=v(Object(r.useState)(null),2),p=d[0],b=d[1];return"inline"===n?Object(r.createElement)(h,{value:o,onChange:i}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),s(!0),b(null)}},Object(c.__)("Add/Edit Conditions","blc")),Object(r.createElement)(a.Overlay,{items:u,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){s(!1),b(null)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",null,Object(c.__)("Transparent Header Display Conditions","blc")),Object(r.createElement)("p",null,Object(c.__)("Add one or more conditions to display the transparent header.","blc")),Object(r.createElement)("div",{className:"ct-modal-scroll"},Object(r.createElement)(h,{value:p||o,onChange:function(e){b(e)}})),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:!p,onClick:function(){i(p),s(!1)}},Object(c.__)("Save Conditions","blc"))))}}))},E=n(7),w=n.n(E);function S(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||C(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 x(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||C(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 C(e,t){if(e){if("string"==typeof e)return k(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)?k(e,t):void 0}}function k(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}var N=function(){var e=x(Object(r.useState)(null),2),t=e[0],n=e[1],o=x(Object(r.useState)(null),2),i=o[0],u=o[1],s=x(Object(r.useState)(!1),2),d=s[0],p=s[1],b=x(Object(r.useState)(["options"]),2),f=b[0],m=b[1],y=Object(r.useRef)();return Object(r.createElement)("div",{className:"ct-import-export"},Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Export","blc")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Click the button below to export the customization settings for this theme.","blc"))),Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),p(!0)}},Object(c.__)("Export Customizations","blc")))),Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Import","blc")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Upload a file to import customization settings for this theme.","blc"))),Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("div",{className:"ct-file-upload"},Object(r.createElement)("button",{type:"button",className:"button ct-upload-button",onClick:function(){y.current.click()}},t?t.name:Object(c.__)("Click to upload a file...","blc")),Object(r.createElement)("input",{ref:y,type:"file",onChange:function(e){var t=x(e.target.files,1)[0];n(t)}}),Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault();var n=new FileReader;n.readAsText(t,"UTF-8"),n.onload=function(e){var t=new FormData;t.append("action","blocksy_customizer_import"),t.append("wp_customize","on"),t.append("data",e.target.result);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}}},Object(c.__)("Import Customizations","blc"))))),ct_customizer_localizations.has_child_theme&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Copy Options","blc")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Copy and import your customizations from parent or child theme.","blc"))),ct_customizer_localizations.is_parent_theme&&Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("child")}},Object(c.__)("Copy From Child Theme","blc")))),!ct_customizer_localizations.is_parent_theme&&Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("parent")}},Object(c.__)("Copy From Parent Theme","blc"))))),Object(r.createElement)(a.Overlay,{items:i,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return u(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("svg",{width:"40",height:"40",viewBox:"0 0 66 66"},Object(r.createElement)("path",{d:"M66 33.1c0 2.8-.4 5.5-1.1 8.2 0 0-1.7-.6-1.9-.6 3.4-13.1-2.2-27.4-14.5-34.5C41.3 2 33 .9 25 3.1c-3.5.9-6.7 2.4-9.5 4.4L20 12 6 15 9 1l5 5c3.1-2.2 6.6-3.9 10.5-4.9 2.7-.7 5.4-1.1 8-1.1 5.9-.1 11.7 1.4 17 4.4C60.1 10.5 66 21.7 66 33.1zm-49 6.3l2.4-3c-.3-1.2-.4-2.3-.4-3.4s.1-2.2.4-3.3l-2.4-3 2.5-4.3 3.8.5c1.6-1.6 3.6-2.7 5.8-3.3l1.4-3.6h5l1.4 3.6c2.2.6 4.2 1.8 5.8 3.3l3.8-.5 2.5 4.3-2.4 3c.3 1.1.4 2.2.4 3.3s-.1 2.2-.4 3.3l2.4 3-2.5 4.3-3.8-.5c-1.6 1.6-3.6 2.7-5.8 3.3L35.4 50h-5L29 46.4c-2.2-.6-4.2-1.8-5.8-3.3l-3.8.5-2.4-4.2zm8-6.4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8-8 3.6-8 8zm25.9 25.3c-3 2.1-6.3 3.7-9.9 4.7-8 2.1-16.4 1-23.5-3.1C5.2 52.8-.4 38.5 3 25.4c-.7-.1-1.3-.3-2-.5-.7 2.7-1 5.3-1 8 0 11.4 5.9 22.5 16.5 28.6 7.6 4.4 16.5 5.6 25 3.3 4-1.1 7.6-2.8 10.8-5.2l4.6 4.6 3-14-14 3 5 5.1z"})),Object(r.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Parent Theme","blc"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Child Theme","blc")),Object(r.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blc"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blc")),Object(r.createElement)("div",{className:"ct-modal-actions"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),u(!1)},className:"ct-button"},Object(c.__)("Cancel","blc")),Object(r.createElement)("button",{className:"ct-button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_copy_options"),t.append("wp_customize","on"),t.append("strategy",i);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}},Object(c.__)("Yes, I am sure","blc"))))}}),Object(r.createElement)(a.Overlay,{items:d,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return p(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",{className:"ct-modal-title"},Object(c.__)("Export Settings","blc")),Object(r.createElement)("p",null,Object(c.__)("Choose what set of settings you want to export.","blc")),Object(r.createElement)("div",{className:"ct-export-options"},["options","widgets"].map((function(e){return Object(r.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===f.length&&f[0]===e||m((function(t){return t.includes(e)?t.filter((function(t){return t!==e})):[].concat(S(t),[e])}))}},{options:Object(c.__)("Customizer settings","blc"),widgets:Object(c.__)("Widgets settings","blc")}[e],Object(r.createElement)("span",{className:l()("ct-checkbox",{active:f.includes(e)})},Object(r.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},Object(r.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))))}))),Object(r.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),p(!1)},className:"button"},Object(c.__)("Cancel","blc")),Object(r.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_export"),t.append("strategy",f.join(":")),t.append("wp_customize","on");try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){var t=e.success,n=e.data;if(t){var r=new Blob([n.data],{type:"application/octet-stream;charset=utf-8"});w()(r,"blocksy-export.dat"),p(!1)}}))}))}catch(e){}}},Object(c.__)("Export","blc"))))}}))},A=n(5),P=n.n(A),T=n(8),D=n(9),z=n.n(D),I=n(10),L=n.n(I),R=n(11),F=n.n(R);function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||V(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 B(e,t,n,r,o,c,a){try{var i=e[c](a),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,o)}function H(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||V(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 V(e,t){if(e){if("string"==typeof e)return G(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)?G(e,t):void 0}}function G(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}var $=L()(),Y=function(e){e.forcedEdit;var t,n,o=e.headerId,i=H(Object(r.useState)(!1),2),l=i[0],u=i[1],s=H(Object(r.useState)(null),2),d=s[0],p=s[1],b=Object(r.useContext)(a.PlacementsDragDropContext),f=(b.builderValueCollection,b.builderValueDispatch,Object(r.useRef)()),m=F()($),y=z()("".concat(blocksy_admin.ajax_url,"?action=blocksy_header_get_all_conditions"),{method:"POST",formatter:(t=regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(n=e.sent,r=n.success,o=n.data,r&&o.conditions){e.next=7;break}throw new Error;case 7:return e.abrupt("return",o.conditions);case 8:case"end":return e.stop()}}),e)})),n=function(){var e=this,n=arguments;return new Promise((function(r,o){var c=t.apply(e,n);function a(e){B(c,r,o,a,i,"next",e)}function i(e){B(c,r,o,a,i,"throw",e)}a(void 0)}))},function(e){return n.apply(this,arguments)}),depends:[m]}),O=y.data,j=y.isLoading;y.error;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){j||(e.preventDefault(),e.stopPropagation(),u(!0))}},Object(c.__)("Add/Edit Conditions","blc")),Object(r.createElement)(a.Overlay,{items:l,initialFocusRef:f,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){u(!1),p(null)},render:function(){var e;return Object(r.createElement)("div",{className:"ct-modal-content",ref:f},Object(r.createElement)("h2",null,sprintf(Object(c.__)("Display Conditions","blc"))),Object(r.createElement)("p",null,Object(c.__)("Add one or more conditions in order to display your header.","blc")),Object(r.createElement)("div",{className:"ct-modal-scroll"},Object(r.createElement)(a.OptionsPanel,{onChange:function(e,t){p((function(e){return[].concat(M((e||O).filter((function(e){return e.id!==o}))),[{id:o,conditions:t}])}))},options:{conditions:(e={type:"blocksy-display-condition",design:"none",value:[]},U(e,"design","none"),U(e,"label",!1),e)},value:{conditions:((d||O).find((function(e){return e.id===o}))||{conditions:[]}).conditions},hasRevertButton:!1})),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:!d,onClick:function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_header_update_all_conditions"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(d)}).then((function(e){return e.json()})).then((function(){$(),u(!1)}))}},Object(c.__)("Save Conditions","blc"))))}}))};function q(){return(q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function J(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 W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(){ct_customizer_localizations.header_builder_data.secondary_items.header,ct_customizer_localizations.header_builder_data.header;var e=Object(r.useContext)(a.PlacementsDragDropContext),t=e.builderValueDispatch,n=e.builderValue,i=(e.option,e.builderValueCollection),u=e.panelsActions,s=Object(T.applyFilters)("blocksy.header.available-sections",null,i.sections)||i.sections.filter((function(e){var t=e.id;return"type-2"!==t&&"type-3"!==t&&-1===t.indexOf("ct-custom")}));return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("ul",{className:l()("ct-panels-manager")},s.map((function(e){var o=e.name,i=e.id,s=o||{"type-1":Object(c.__)("Global Header","blocksy")}[i]||i,d="builder_header_panel_".concat(i),p=ct_customizer_localizations.header_builder_data.header_data.header_options,b={label:s,"inner-options":W(W({},i.indexOf("ct-custom")>-1?{conditions_button:{label:Object(c.__)("Edit Conditions","blc"),type:"jsx",design:"block",render:function(){return Object(r.createElement)(Y,{headerId:i})}}}:{}),p)};return Object(r.createElement)(a.PanelMetaWrapper,q({id:d,key:i,option:b},u,{getActualOption:function(e){var o=e.open;return Object(r.createElement)(r.Fragment,null,i===n.id&&Object(r.createElement)(a.Panel,{id:d,getValues:function(){return W({id:i},n.settings||{})},option:b,onChangeFor:function(e,r){t({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:e,optionValue:r,values:Object(a.getValueFromInput)(p,Array.isArray(n.settings)?{}:n.settings||{})}})},view:"simple"}),Object(r.createElement)("li",{className:l()({active:i===n.id,"ct-global":"type-1"===i}),onClick:function(){i===n.id?o():t({type:"PICK_BUILDER_SECTION",payload:{id:i}})}},Object(r.createElement)("span",{className:"ct-panel-name"},s),i.indexOf("ct-custom")>-1&&i!==n.id&&Object(r.createElement)("span",{className:"ct-remove-instance",onClick:function(e){e.preventDefault(),e.stopPropagation(),t({type:"REMOVE_BUILDER_SECTION",payload:{id:i}})}},Object(r.createElement)("i",{className:"ct-tooltip-top"},Object(c.__)("Remove header","blc")),Object(r.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})))))}}))}))),Object(r.createElement)(o.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},(function(e){return 0===e.length?null:e})))};P.a.on("blocksy:options:before-option",(function(e){if(e.option&&"ct-header-builder"===e.option.type){var t=e.content;e.content=Object(r.createElement)(r.Fragment,null,t,Object(r.createElement)(o.Fill,{name:"PlacementsBuilderPanelsManager"},Object(r.createElement)(K,null)))}})),P.a.on("blocksy:options:register",(function(e){e["blocksy-display-condition"]=g,e["blocksy-customizer-options-manager"]=N}))}]);
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===c)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=ctEvents},function(e,t){e.exports=window.React},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r="object"===("undefined"==typeof window?"undefined":n(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":n(self))&&self.self===self?self:"object"===(void 0===t?"undefined":n(t))&&t.global===t?t:this;function o(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"!==("undefined"==typeof window?"undefined":n(window))||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var i=r.URL||r.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin!==location.origin?c(l.href)?o(e,t,n):a(l,l.target="_blank"):a(l)):(l.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(l.href)}),4e4),setTimeout((function(){a(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download","string"==typeof e)if(c(e))o(e,t,r);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){a(i)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==n(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,r),t)}:function(e,t,c,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return o(e,t,c);var i="application/octet-stream"===e.type,l=/constructor/i.test(r.HTMLElement)||r.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||i&&l)&&"object"===("undefined"==typeof FileReader?"undefined":n(FileReader))){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},s.readAsDataURL(e)}else{var d=r.URL||r.webkitURL,p=d.createObjectURL(e);a?a.location=p:location.href=p,a=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}};e.exports=i}).call(this,n(12))},function(e,t){e.exports=window.wp.hooks},function(e,t,n){var r=n(13);function o(e,t,n,r,c){var a=new Error(n,r,c);return a.name="UseFetchError",a.status=e,a.statusText=t,Object.setPrototypeOf(a,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(a,o),a}o.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(o,Error),e.exports=function(e,t,n){var c=(n&&n.depends||t&&t.depends||[]).reduce((function(e,t){return e||!t}),!1);return r(!c&&function(e,t,n){return fetch(e,t).then(n&&n.formatter||t&&t.formatter||function(e){if(!e.ok)throw new o(e.status,e.statusText,"Fetch error");return e.json()})},e,t||{},n||{})}},function(e,t,n){var r=n(15);e.exports=function(){var e=function(){e.id=r(),e.subscribers.forEach((function(e){e()}))};return e.id=r(),e.subscribers=[],e.subscribe=function(t){e.subscribers.push(t)},e.unsubscribe=function(t){e.subscribers.indexOf(t)>=0&&e.subscribers.splice(e.subscribers.indexOf(t),1)},e}},function(e,t,n){var r=n(6);e.exports=function(e){var t=r.useState(e.id),n=function(){return t[1](e.id)};return r.useEffect((function(){return e.subscribe(n),function(){return e.unsubscribe(n)}}),[]),t[0]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(6),o=n(14);e.exports=function(e){var t=Array.prototype.slice.call(arguments,[1]),n=r.useState({isLoading:!!e});return r.useEffect((function(){e&&(!n[0].isLoading&&n[1]({data:n[0].data,isLoading:!0}),e.apply(null,t).then((function(e){n[1]({data:e,isLoading:!1})})).catch((function(e){n[1]({error:e,isLoading:!1})})))}),o(t)),n[0]}},function(e,t){e.exports=function e(){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(r instanceof Array)for(var o=0;o<r.length;o++)t=t.concat(e(r[o]));else if("undefined"!=typeof URL&&r instanceof URL)t=t.concat(r.toJSON());else if(r instanceof Object)for(var c=Object.keys(r),a=0;a<c.length;a++){var i=c[a];t=t.concat([i]).concat(e(r[i]))}else t=t.concat(r)}return t}},function(e,t,n){for(var r=self.crypto||self.msCrypto,o="-_",c=36;c--;)o+=c.toString(36);for(c=36;c---10;)o+=c.toString(36).toUpperCase();e.exports=function(e){var t="",n=r.getRandomValues(new Uint8Array(e||21));for(c=e||21;c--;)t+=o[63&n[c]];return t}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(4),c=n(1),a=n(2),i=n(3),l=n.n(i);function u(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||m(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 s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(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 m(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function y(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}var O=[],j=[],h=function(e){var t=e.value,n=e.onChange,o=blocksy_admin.all_condition_rules.reduce((function(e,t){var n=t.rules,r=t.title;return[].concat(f(e),f(n.map((function(e){return p(p({},e),{},{group:r})}))))}),[]).reduce((function(e,t){var n=t.title,r=t.id,o=s(t,["title","id"]);return[].concat(f(e),[p({key:r,value:n},o)])}),[]),i=u(Object(r.useState)(O),2),d=i[0],b=i[1],m=u(Object(r.useState)(j),2),y=m[0],h=m[1],v=function(e){return"post_ids"===e.rule||"page_ids"===e.rule||"custom_post_type_ids"===e.rule||"taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule};return Object(r.useEffect)((function(){Promise.all(["posts","pages","ct_cpt"].map((function(e){return fetch("".concat(blocksy_admin.rest_url,"wp/v2/").concat("ct_cpt"===e?"posts":e).concat(blocksy_admin.rest_url.indexOf("?")>-1?"&":"?","_embed&per_page=100").concat("ct_cpt"===e?"&post_type=ct_cpt":"")).then((function(e){return e.json()}))}))).then((function(e){var t=e.reduce((function(e,t){return[].concat(f(e),f(t))}),[]);b(t),O=t})),fetch("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_taxonomies"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data.taxonomies;h(t),j=t}))}),[]),Object(r.createElement)("div",{className:"ct-display-conditions"},t.map((function(e,i){return Object(r.createElement)("div",{className:l()("ct-condition-group",{"ct-cols-3":v(e),"ct-cols-2":!v(e)}),key:i},Object(r.createElement)(a.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return Object(r.createElement)("span",{className:"ct-".concat(e.type)})},placeholder:Object(c.__)("Select variation","blc"),choices:{include:Object(c.__)("Include","blc"),exclude:Object(c.__)("Exclude","blc")}},value:e.type,onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{type:r}):t)})))}}),Object(r.createElement)(a.Select,{key:"second",option:{appendToBody:!0,placeholder:Object(c.__)("Select rule","blc"),choices:"user"===e.category?o.filter((function(e){return 0===e.key.indexOf("user_")})):o.filter((function(e){return-1===e.key.indexOf("user_")})),search:!0},value:e.rule,onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{rule:r}):t)})))}}),("post_ids"===e.rule||"custom_post_type_ids"===e.rule||"page_ids"===e.rule)&&Object(r.createElement)(a.Select,{key:"third",option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:"post_ids"===e.rule?Object(c.__)("Select post","blc"):"page_ids"===e.rule?Object(c.__)("Select page","blc"):Object(c.__)("Custom Post Type ID","blc"),choices:d.filter((function(t){var n=t.type;return"post_ids"===e.rule?"post"===n:"page_ids"===e.rule?"page"===n:"post"!==n&&"page"!==n})).map((function(e){return{key:e.id,value:e.title.rendered}})),search:!0},value:(e.payload||{}).post_id||"",onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{payload:p(p({},e.payload),{},{post_id:r})}):t)})))}}),("taxonomy_ids"===e.rule||"post_with_taxonomy_ids"===e.rule)&&Object(r.createElement)(a.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:Object(c.__)("Select taxonomy","blc"),choices:y.map((function(e){return p({key:e.id,value:e.name},e.group?{group:e.group}:{})})),search:!0},value:e.payload.taxonomy_id||"",onChange:function(r){n(t.map((function(t,n){return p({},n===i?p(p({},e),{},{payload:p(p({},e.payload),{},{taxonomy_id:r})}):t)})))}}),Object(r.createElement)("button",{type:"button",onClick:function(e){e.preventDefault();var r=f(t);r.splice(i,1),n(r)}},"×"))})),Object(r.createElement)("div",{className:"ct-conditions-actions"},Object(r.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(f(t),[{type:"include",rule:"everywhere",payload:{}}]))}},Object(c.__)("Add Display Condition","blc")),Object(r.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),n([].concat(f(t),[{type:"include",rule:"user_logged_in",payload:{},category:"user"}]))}},Object(c.__)("Add User Condition","blc"))))};function v(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(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 _(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}var g=function(e){var t=e.option.display,n=void 0===t?"inline":t,o=e.value,i=e.onChange,l=v(Object(r.useState)(!1),2),u=l[0],s=l[1],d=v(Object(r.useState)(null),2),p=d[0],b=d[1];return"inline"===n?Object(r.createElement)(h,{value:o,onChange:i}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),s(!0),b(null)}},Object(c.__)("Add/Edit Conditions","blc")),Object(r.createElement)(a.Overlay,{items:u,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){s(!1),b(null)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",null,Object(c.__)("Transparent Header Display Conditions","blc")),Object(r.createElement)("p",null,Object(c.__)("Add one or more conditions to display the transparent header.","blc")),Object(r.createElement)("div",{className:"ct-modal-scroll"},Object(r.createElement)(h,{value:p||o,onChange:function(e){b(e)}})),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:!p,onClick:function(){i(p),s(!1)}},Object(c.__)("Save Conditions","blc"))))}}))},E=n(7),w=n.n(E);function S(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||C(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 x(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||C(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 C(e,t){if(e){if("string"==typeof e)return k(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)?k(e,t):void 0}}function k(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}var N=function(){var e=x(Object(r.useState)(null),2),t=e[0],n=e[1],o=x(Object(r.useState)(null),2),i=o[0],u=o[1],s=x(Object(r.useState)(!1),2),d=s[0],p=s[1],b=x(Object(r.useState)(["options"]),2),f=b[0],m=b[1],y=Object(r.useRef)();return Object(r.createElement)("div",{className:"ct-import-export"},Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Export","blc")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Click the button below to export the customization settings for this theme.","blc"))),Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),p(!0)}},Object(c.__)("Export Customizations","blc")))),Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Import","blc")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Upload a file to import customization settings for this theme.","blc"))),Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("div",{className:"ct-file-upload"},Object(r.createElement)("button",{type:"button",className:"button ct-upload-button",onClick:function(){y.current.click()}},t?t.name:Object(c.__)("Click to upload a file...","blc")),Object(r.createElement)("input",{ref:y,type:"file",onChange:function(e){var t=x(e.target.files,1)[0];n(t)}}),Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault();var n=new FileReader;n.readAsText(t,"UTF-8"),n.onload=function(e){var t=new FormData;t.append("action","blocksy_customizer_import"),t.append("wp_customize","on"),t.append("data",e.target.result);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}}},Object(c.__)("Import Customizations","blc"))))),ct_customizer_localizations.has_child_theme&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"ct-title","data-type":"simple"},Object(r.createElement)("h3",null,Object(c.__)("Copy Options","blc")),Object(r.createElement)("div",{className:"ct-option-description"},Object(c.__)("Copy and import your customizations from parent or child theme.","blc"))),ct_customizer_localizations.is_parent_theme&&Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("child")}},Object(c.__)("Copy From Child Theme","blc")))),!ct_customizer_localizations.is_parent_theme&&Object(r.createElement)("div",{className:"ct-control","data-design":"block"},Object(r.createElement)("header",null),Object(r.createElement)("section",null,Object(r.createElement)("button",{className:"button",onClick:function(e){e.preventDefault(),u("parent")}},Object(c.__)("Copy From Parent Theme","blc"))))),Object(r.createElement)(a.Overlay,{items:i,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return u(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("svg",{width:"40",height:"40",viewBox:"0 0 66 66"},Object(r.createElement)("path",{d:"M66 33.1c0 2.8-.4 5.5-1.1 8.2 0 0-1.7-.6-1.9-.6 3.4-13.1-2.2-27.4-14.5-34.5C41.3 2 33 .9 25 3.1c-3.5.9-6.7 2.4-9.5 4.4L20 12 6 15 9 1l5 5c3.1-2.2 6.6-3.9 10.5-4.9 2.7-.7 5.4-1.1 8-1.1 5.9-.1 11.7 1.4 17 4.4C60.1 10.5 66 21.7 66 33.1zm-49 6.3l2.4-3c-.3-1.2-.4-2.3-.4-3.4s.1-2.2.4-3.3l-2.4-3 2.5-4.3 3.8.5c1.6-1.6 3.6-2.7 5.8-3.3l1.4-3.6h5l1.4 3.6c2.2.6 4.2 1.8 5.8 3.3l3.8-.5 2.5 4.3-2.4 3c.3 1.1.4 2.2.4 3.3s-.1 2.2-.4 3.3l2.4 3-2.5 4.3-3.8-.5c-1.6 1.6-3.6 2.7-5.8 3.3L35.4 50h-5L29 46.4c-2.2-.6-4.2-1.8-5.8-3.3l-3.8.5-2.4-4.2zm8-6.4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8-8 3.6-8 8zm25.9 25.3c-3 2.1-6.3 3.7-9.9 4.7-8 2.1-16.4 1-23.5-3.1C5.2 52.8-.4 38.5 3 25.4c-.7-.1-1.3-.3-2-.5-.7 2.7-1 5.3-1 8 0 11.4 5.9 22.5 16.5 28.6 7.6 4.4 16.5 5.6 25 3.3 4-1.1 7.6-2.8 10.8-5.2l4.6 4.6 3-14-14 3 5 5.1z"})),Object(r.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Parent Theme","blc"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("Copy From Child Theme","blc")),Object(r.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blc"),ct_customizer_localizations.is_parent_theme&&Object(c.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blc")),Object(r.createElement)("div",{className:"ct-modal-actions"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),u(!1)},className:"ct-button"},Object(c.__)("Cancel","blc")),Object(r.createElement)("button",{className:"ct-button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_copy_options"),t.append("wp_customize","on"),t.append("strategy",i);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}},Object(c.__)("Yes, I am sure","blc"))))}}),Object(r.createElement)(a.Overlay,{items:d,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return p(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content"},Object(r.createElement)("h2",{className:"ct-modal-title"},Object(c.__)("Export Settings","blc")),Object(r.createElement)("p",null,Object(c.__)("Choose what set of settings you want to export.","blc")),Object(r.createElement)("div",{className:"ct-export-options"},["options","widgets"].map((function(e){return Object(r.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===f.length&&f[0]===e||m((function(t){return t.includes(e)?t.filter((function(t){return t!==e})):[].concat(S(t),[e])}))}},{options:Object(c.__)("Customizer settings","blc"),widgets:Object(c.__)("Widgets settings","blc")}[e],Object(r.createElement)("span",{className:l()("ct-checkbox",{active:f.includes(e)})},Object(r.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},Object(r.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))))}))),Object(r.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},Object(r.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),p(!1)},className:"button"},Object(c.__)("Cancel","blc")),Object(r.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_export"),t.append("strategy",f.join(":")),t.append("wp_customize","on");try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){var t=e.success,n=e.data;if(t){var r=new Blob([n.data],{type:"application/octet-stream;charset=utf-8"});w()(r,"blocksy-export.dat"),p(!1)}}))}))}catch(e){}}},Object(c.__)("Export","blc"))))}}))},A=n(5),P=n.n(A),T=n(8),D=n(9),z=n.n(D),I=n(10),L=n.n(I),R=n(11),F=n.n(R);function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||V(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 B(e,t,n,r,o,c,a){try{var i=e[c](a),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,o)}function H(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 a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw c}}return n}(e,t)||V(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 V(e,t){if(e){if("string"==typeof e)return G(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)?G(e,t):void 0}}function G(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}var $=L()(),Y=function(e){e.forcedEdit;var t,n,o=e.headerId,i=H(Object(r.useState)(!1),2),l=i[0],u=i[1],s=H(Object(r.useState)(null),2),d=s[0],p=s[1],b=Object(r.useContext)(a.PlacementsDragDropContext),f=(b.builderValueCollection,b.builderValueDispatch,Object(r.useRef)()),m=F()($),y=z()("".concat(blocksy_admin.ajax_url,"?action=blocksy_header_get_all_conditions"),{method:"POST",formatter:(t=regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(n=e.sent,r=n.success,o=n.data,r&&o.conditions){e.next=7;break}throw new Error;case 7:return e.abrupt("return",o.conditions);case 8:case"end":return e.stop()}}),e)})),n=function(){var e=this,n=arguments;return new Promise((function(r,o){var c=t.apply(e,n);function a(e){B(c,r,o,a,i,"next",e)}function i(e){B(c,r,o,a,i,"throw",e)}a(void 0)}))},function(e){return n.apply(this,arguments)}),depends:[m]}),O=y.data,j=y.isLoading;y.error;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){j||(e.preventDefault(),e.stopPropagation(),u(!0))}},Object(c.__)("Add/Edit Conditions","blc")),Object(r.createElement)(a.Overlay,{items:l,initialFocusRef:f,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){u(!1),p(null)},render:function(){var e;return Object(r.createElement)("div",{className:"ct-modal-content",ref:f},Object(r.createElement)("h2",null,sprintf(Object(c.__)("Display Conditions","blc"))),Object(r.createElement)("p",null,Object(c.__)("Add one or more conditions in order to display your header.","blc")),Object(r.createElement)("div",{className:"ct-modal-scroll"},Object(r.createElement)(a.OptionsPanel,{onChange:function(e,t){p((function(e){return[].concat(M((e||O).filter((function(e){return e.id!==o}))),[{id:o,conditions:t}])}))},options:{conditions:(e={type:"blocksy-display-condition",design:"none",value:[]},U(e,"design","none"),U(e,"label",!1),e)},value:{conditions:((d||O).find((function(e){return e.id===o}))||{conditions:[]}).conditions},hasRevertButton:!1})),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:!d,onClick:function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_header_update_all_conditions"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(d)}).then((function(e){return e.json()})).then((function(){$(),u(!1)}))}},Object(c.__)("Save Conditions","blc"))))}}))};function q(){return(q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function J(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 W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=function(){ct_customizer_localizations.header_builder_data.secondary_items.header,ct_customizer_localizations.header_builder_data.header;var e=Object(r.useContext)(a.PlacementsDragDropContext),t=e.builderValueDispatch,n=e.builderValue,i=(e.option,e.builderValueCollection),u=e.panelsActions,s=Object(T.applyFilters)("blocksy.header.available-sections",null,i.sections)||i.sections.filter((function(e){var t=e.id;return"type-2"!==t&&"type-3"!==t&&-1===t.indexOf("ct-custom")}));return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("ul",{className:l()("ct-panels-manager")},s.map((function(e){var o=e.name,i=e.id,s=o||{"type-1":Object(c.__)("Global Header","blocksy")}[i]||i,d="builder_header_panel_".concat(i),p=ct_customizer_localizations.header_builder_data.header_data.header_options,b={label:s,"inner-options":W(W({},i.indexOf("ct-custom")>-1?{conditions_button:{label:Object(c.__)("Edit Conditions","blc"),type:"jsx",design:"block",render:function(){return Object(r.createElement)(Y,{headerId:i})}}}:{}),p)};return Object(r.createElement)(a.PanelMetaWrapper,q({id:d,key:i,option:b},u,{getActualOption:function(e){var o=e.open;return Object(r.createElement)(r.Fragment,null,i===n.id&&Object(r.createElement)(a.Panel,{id:d,getValues:function(){return W({id:i},n.settings||{})},option:b,onChangeFor:function(e,r){t({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:e,optionValue:r,values:Object(a.getValueFromInput)(p,Array.isArray(n.settings)?{}:n.settings||{})}})},view:"simple"}),Object(r.createElement)("li",{className:l()({active:i===n.id,"ct-global":"type-1"===i}),onClick:function(){i===n.id?o():t({type:"PICK_BUILDER_SECTION",payload:{id:i}})}},Object(r.createElement)("span",{className:"ct-panel-name"},s),i.indexOf("ct-custom")>-1&&i!==n.id&&Object(r.createElement)("span",{className:"ct-remove-instance",onClick:function(e){e.preventDefault(),e.stopPropagation(),t({type:"REMOVE_BUILDER_SECTION",payload:{id:i}})}},Object(r.createElement)("i",{className:"ct-tooltip-top"},Object(c.__)("Remove header","blc")),Object(r.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})))))}}))}))),Object(r.createElement)(o.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},(function(e){return 0===e.length?null:e})))};P.a.on("blocksy:options:before-option",(function(e){if(e.option&&"ct-header-builder"===e.option.type){var t=e.content;e.content=Object(r.createElement)(r.Fragment,null,t,Object(r.createElement)(o.Fill,{name:"PlacementsBuilderPanelsManager"},Object(r.createElement)(K,null)))}})),P.a.on("blocksy:options:register",(function(e){e["blocksy-display-condition"]=g,e["blocksy-customizer-options-manager"]=N}))}]);
|
static/js/options/ConditionsManager.js
CHANGED
@@ -197,6 +197,7 @@ const ConditionsManager = ({ value, onChange }) => {
|
|
197 |
condition.rule === 'post_with_taxonomy_ids') && (
|
198 |
<Select
|
199 |
option={{
|
|
|
200 |
defaultToFirstItem: false,
|
201 |
placeholder: __('Select taxonomy', 'blc'),
|
202 |
choices: allTaxonomies.map((taxonomy) => ({
|
197 |
condition.rule === 'post_with_taxonomy_ids') && (
|
198 |
<Select
|
199 |
option={{
|
200 |
+
appendToBody: true,
|
201 |
defaultToFirstItem: false,
|
202 |
placeholder: __('Select taxonomy', 'blc'),
|
203 |
choices: allTaxonomies.map((taxonomy) => ({
|
static/sass/options/display-conditions.scss
CHANGED
@@ -32,6 +32,18 @@
|
|
32 |
}
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
|
37 |
// display conditions
|
32 |
}
|
33 |
}
|
34 |
|
35 |
+
.ct-control[data-location] {
|
36 |
+
--options-vertical-spacing: 20px;
|
37 |
+
|
38 |
+
&[data-design="inline"] input {
|
39 |
+
text-align: center;
|
40 |
+
--width: 100px;
|
41 |
+
}
|
42 |
+
|
43 |
+
&:after {
|
44 |
+
border-bottom-style: dashed;
|
45 |
+
}
|
46 |
+
}
|
47 |
|
48 |
|
49 |
// display conditions
|