@secretstache/wordpress-gutenberg 0.5.13 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/editor-canvas.css +1 -0
- package/build/editor-ui.css +1 -0
- package/build/index.js +7955 -3
- package/build/index.js.map +1 -1
- package/package.json +13 -13
- package/src/components/DataQueryControls.jsx +365 -0
- package/src/components/{EmptyBlockAppender.js → EmptyBlockAppender.jsx} +2 -1
- package/src/components/{IconPicker.js → IconPicker.jsx} +2 -1
- package/src/components/{MediaControl.js → MediaControl.jsx} +1 -1
- package/src/components/{MediaTypeControl.js → MediaTypeControl.jsx} +1 -1
- package/src/components/{MediaWithFocalPointControl.js → MediaWithFocalPointControl.jsx} +1 -1
- package/src/components/{ResponsiveSpacingControl.js → ResponsiveSpacingControl.jsx} +1 -1
- package/src/components/{SpacingControl.js → SpacingControl.jsx} +6 -5
- package/src/components/index.js +16 -16
- package/src/hooks/index.js +4 -5
- package/src/hooks/useAccordionItem.js +8 -8
- package/src/hooks/{usePreviewControl.js → usePreviewControl.jsx} +1 -1
- package/src/hooks/{useTabs.js → useTabs.jsx} +2 -2
- package/src/icons/index.jsx +38 -0
- package/src/index.js +3 -5
- package/src/styles/_empty-block-appender.scss +26 -9
- package/src/styles/editor-canvas.scss +59 -0
- package/src/styles/editor-ui.scss +28 -0
- package/src/styles/styles.scss +1 -1
- package/src/utils/filters.jsx +40 -0
- package/src/utils/helpers.js +18 -3
- package/src/utils/index.js +1 -0
- package/build/styles.css +0 -291
- package/src/components/DataQueryControls.js +0 -53
- package/src/hooks/useColorChange.js +0 -22
- /package/src/components/{ColorPaletteControl.js → ColorPaletteControl.jsx} +0 -0
- /package/src/components/{DividersControl.js → DividersControl.jsx} +0 -0
- /package/src/components/{ImageActions.js → ImageActions.jsx} +0 -0
- /package/src/components/{InsertBlockToolbar.js → InsertBlockToolbar.jsx} +0 -0
- /package/src/components/{LinkControl.js → LinkControl.jsx} +0 -0
- /package/src/components/{PreviewControl.js → PreviewControl.jsx} +0 -0
- /package/src/components/{ResourcesWrapper.js → ResourcesWrapper.jsx} +0 -0
- /package/src/components/{SortableSelect.js → SortableSelect.jsx} +0 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
export const editIcon = () => (
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
3
|
+
<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"></path>
|
4
|
+
</svg>
|
5
|
+
);
|
6
|
+
|
7
|
+
export const trashIcon = () => (
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
9
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"></path>
|
10
|
+
</svg>
|
11
|
+
);
|
12
|
+
|
13
|
+
export const pageIcon = () => (
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
15
|
+
<path d="M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"></path>
|
16
|
+
<path d="M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"></path>
|
17
|
+
</svg>
|
18
|
+
);
|
19
|
+
|
20
|
+
export const plusIcon = () => (
|
21
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
22
|
+
<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"></path>
|
23
|
+
</svg>
|
24
|
+
);
|
25
|
+
|
26
|
+
export const sidesBottomIcon = () => (
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
28
|
+
<path d="m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z" style={{ opacity: 0.25 }}></path>
|
29
|
+
<path d="m16.5 19.5h-9v-1.5h9z"></path>
|
30
|
+
</svg>
|
31
|
+
);
|
32
|
+
|
33
|
+
export const sidesTopIcon = () => (
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
35
|
+
<path d="m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z" style={{ opacity: 0.25 }}></path>
|
36
|
+
<path d="m16.5 6h-9v-1.5h9z"></path>
|
37
|
+
</svg>
|
38
|
+
);
|
package/src/index.js
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
.empty-block-appender {
|
2
2
|
--button-color: #192f5f;
|
3
|
-
--button-
|
4
|
-
--button-
|
5
|
-
--button-hover
|
3
|
+
--button-color-hover: var(--wp-admin-theme-color);
|
4
|
+
--button-border: #192f5f;
|
5
|
+
--button-border-hover: var(--wp-admin-theme-color);
|
6
|
+
--button-background: transparent;
|
7
|
+
--button-background-hover: transparent;
|
8
|
+
--text-color: #192f5f;
|
6
9
|
--tr: .3s;
|
7
10
|
|
8
11
|
display: flex;
|
@@ -11,14 +14,27 @@
|
|
11
14
|
justify-content: center;
|
12
15
|
padding: 32px;
|
13
16
|
|
17
|
+
&--light {
|
18
|
+
--button-color: #fff;
|
19
|
+
--button-color-hover: #192f5f;
|
20
|
+
--button-border: #fff;
|
21
|
+
--button-border-hover: #fff;
|
22
|
+
--button-background: transparent;
|
23
|
+
--button-background-hover: #fff;
|
24
|
+
--text-color: #fff;
|
25
|
+
}
|
26
|
+
|
14
27
|
&__content {
|
28
|
+
display: flex;
|
29
|
+
flex-direction: column;
|
30
|
+
align-items: center;
|
15
31
|
text-align: center;
|
16
32
|
}
|
17
33
|
|
18
34
|
&__icon {
|
19
35
|
width: 48px;
|
20
36
|
height:48px;
|
21
|
-
color: var(--
|
37
|
+
color: var(--text-color);
|
22
38
|
margin-bottom: 16px;
|
23
39
|
}
|
24
40
|
|
@@ -26,14 +42,14 @@
|
|
26
42
|
font-size: 32px;
|
27
43
|
font-weight: 600;
|
28
44
|
line-height: 110%;
|
29
|
-
color: var(--
|
45
|
+
color: var(--text-color);
|
30
46
|
margin-bottom: 0.5rem;
|
31
47
|
}
|
32
48
|
|
33
49
|
&__text {
|
34
50
|
font-size: 1rem;
|
35
51
|
font-weight: 400;
|
36
|
-
color: var(--
|
52
|
+
color: var(--text-color);
|
37
53
|
margin-bottom: 1.5rem;
|
38
54
|
}
|
39
55
|
|
@@ -49,7 +65,7 @@
|
|
49
65
|
border: 2px solid var(--button-border) !important;
|
50
66
|
box-shadow: none;
|
51
67
|
border-radius: 10px;
|
52
|
-
background:
|
68
|
+
background: var(--button-background) !important;
|
53
69
|
padding: 12px 24px;
|
54
70
|
min-height: 50px;
|
55
71
|
min-width: 200px;
|
@@ -59,10 +75,11 @@
|
|
59
75
|
|
60
76
|
&:hover,
|
61
77
|
&:focus {
|
62
|
-
color: var(--button-hover
|
63
|
-
border-color: var(--button-hover
|
78
|
+
color: var(--button-color-hover) !important;
|
79
|
+
border-color: var(--button-border-hover) !important;
|
64
80
|
outline: none !important;
|
65
81
|
box-shadow: none !important;
|
82
|
+
background: var(--button-background-hover) !important;
|
66
83
|
}
|
67
84
|
|
68
85
|
&::before,
|
@@ -0,0 +1,59 @@
|
|
1
|
+
.editor-styles-wrapper {
|
2
|
+
// Hide default appender clickable area
|
3
|
+
&::after {
|
4
|
+
display: none;
|
5
|
+
}
|
6
|
+
|
7
|
+
.editor-visual-editor__post-title-wrapper {
|
8
|
+
margin-top: 10px !important;
|
9
|
+
margin-bottom: 10px !important;
|
10
|
+
|
11
|
+
h1.editor-post-title {
|
12
|
+
margin: 0;
|
13
|
+
border-bottom: 1px dashed #ddd;
|
14
|
+
padding-bottom: 10px;
|
15
|
+
font-weight: normal;
|
16
|
+
font-size: 30px;
|
17
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
18
|
+
text-align: center;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
.block-editor-block-list__layout.is-root-container {
|
24
|
+
@import "root-block-appender";
|
25
|
+
@import "empty-block-appender";
|
26
|
+
@import "new-child-btn";
|
27
|
+
@import "image-wrapper";
|
28
|
+
|
29
|
+
margin-bottom: 0;
|
30
|
+
padding-bottom: 0;
|
31
|
+
|
32
|
+
&:has(.root-block-appender) {
|
33
|
+
margin-bottom: 3rem;
|
34
|
+
padding-bottom: 200px;
|
35
|
+
}
|
36
|
+
|
37
|
+
&.has-background {
|
38
|
+
transition:
|
39
|
+
background 1s,
|
40
|
+
color 1s;
|
41
|
+
}
|
42
|
+
|
43
|
+
& > .block-list-appender.wp-block:only-child {
|
44
|
+
p {
|
45
|
+
margin-top: 0;
|
46
|
+
margin-bottom: 0;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
& > .block-list-appender.wp-block:only-child,
|
51
|
+
& > p.wp-block:only-child {
|
52
|
+
margin: 2rem 0;
|
53
|
+
}
|
54
|
+
|
55
|
+
.components-notice {
|
56
|
+
color: #000;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.editor-sidebar {
|
2
|
+
@import "link-control";
|
3
|
+
@import "animation-file-renderer";
|
4
|
+
@import "icon-picker";
|
5
|
+
@import "media-picker";
|
6
|
+
@import "sortable-select";
|
7
|
+
@import "responsive-spacing";
|
8
|
+
@import "image-wrapper";
|
9
|
+
}
|
10
|
+
|
11
|
+
.editor-visual-editor {
|
12
|
+
z-index: 1;
|
13
|
+
|
14
|
+
// Hide metaboxes in Pattern editor
|
15
|
+
&.is-resizable {
|
16
|
+
& + .edit-post-layout__metaboxes {
|
17
|
+
display: none;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.block-editor-block-types-list > [role=presentation] {
|
23
|
+
justify-content: center;
|
24
|
+
}
|
25
|
+
|
26
|
+
.block-editor-inserter__insertable-blocks-at-selection + .block-editor-inserter__all-blocks {
|
27
|
+
display: none;
|
28
|
+
}
|
package/src/styles/styles.scss
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
import { createHigherOrderComponent } from '@wordpress/compose';
|
2
|
+
import { dispatch, select, useSelect } from '@wordpress/data';
|
3
|
+
import { useEffect } from '@wordpress/element';
|
4
|
+
import { addFilter } from '@wordpress/hooks';
|
5
|
+
|
6
|
+
export const addInnerBlocksCleanupFilter = (blockName) => {
|
7
|
+
// eslint-disable-next-line
|
8
|
+
const withInnerBlocksCleanup = createHigherOrderComponent((BlockEdit) => (props) => {
|
9
|
+
const { clientId, attributes, name } = props;
|
10
|
+
|
11
|
+
if (name !== blockName) {
|
12
|
+
return <BlockEdit {...props} />;
|
13
|
+
}
|
14
|
+
|
15
|
+
const innerBlocks = useSelect(
|
16
|
+
(select) => select('core/block-editor').getBlock(clientId)?.innerBlocks || [],
|
17
|
+
[]
|
18
|
+
);
|
19
|
+
|
20
|
+
useEffect(() => {
|
21
|
+
if (
|
22
|
+
attributes.dataSource !== 'none' &&
|
23
|
+
innerBlocks.length > 0
|
24
|
+
) {
|
25
|
+
dispatch('core/block-editor').updateBlock(clientId, {
|
26
|
+
...select('core/block-editor').getBlock(clientId),
|
27
|
+
innerBlocks: [],
|
28
|
+
});
|
29
|
+
}
|
30
|
+
}, [ attributes.dataSource, clientId, innerBlocks.length ]);
|
31
|
+
|
32
|
+
return <BlockEdit {...props} />;
|
33
|
+
}, 'withInnerBlocksCleanup');
|
34
|
+
|
35
|
+
addFilter(
|
36
|
+
'editor.BlockEdit',
|
37
|
+
'ssm/with-inner-blocks-cleanup',
|
38
|
+
withInnerBlocksCleanup
|
39
|
+
);
|
40
|
+
};
|
package/src/utils/helpers.js
CHANGED
@@ -11,18 +11,33 @@ import { getBlockType, registerBlockType, unregisterBlockType } from '@wordpress
|
|
11
11
|
* @param {string} inputValue - Search term to filter posts
|
12
12
|
* @param {string} postType - WordPress post type to query
|
13
13
|
* @param {Function|null} [mapper=null] - Optional function to transform API response items
|
14
|
+
* @param {Object} [extraParams={}] - Additional query parameters
|
14
15
|
* @returns {Promise<Array<{value: number, label: string}>>} Array of select options
|
15
16
|
*/
|
16
|
-
export const loadSelectOptions = async (inputValue, postType, mapper = null) => {
|
17
|
+
export const loadSelectOptions = async (inputValue, postType, mapper = null, extraParams = {}) => {
|
18
|
+
const defaultParams = {
|
19
|
+
per_page: -1,
|
20
|
+
status: 'publish',
|
21
|
+
orderby: 'title',
|
22
|
+
order: 'asc'
|
23
|
+
};
|
24
|
+
|
25
|
+
const queryParams = { ...defaultParams, ...extraParams };
|
26
|
+
|
27
|
+
if (inputValue && inputValue.trim()) {
|
28
|
+
queryParams.search = inputValue;
|
29
|
+
}
|
30
|
+
|
31
|
+
const queryString = new URLSearchParams(queryParams).toString();
|
32
|
+
|
17
33
|
const response = await apiFetch({
|
18
|
-
path: `/wp/v2/${postType}
|
34
|
+
path: `/wp/v2/${postType}?${queryString}`,
|
19
35
|
});
|
20
36
|
|
21
37
|
if (mapper) {
|
22
38
|
return response?.map(mapper);
|
23
39
|
} else {
|
24
40
|
return response?.map((post) => {
|
25
|
-
// Create a temporary DOM element to decode HTML entities
|
26
41
|
const tempElement = document.createElement('div');
|
27
42
|
tempElement.innerHTML = post?.title?.rendered;
|
28
43
|
|
package/src/utils/index.js
CHANGED
package/build/styles.css
DELETED
@@ -1,291 +0,0 @@
|
|
1
|
-
.editor-visual-editor__post-title-wrapper {
|
2
|
-
margin-top: 10px !important;
|
3
|
-
margin-bottom: 10px !important; }
|
4
|
-
.editor-visual-editor__post-title-wrapper h1.editor-post-title {
|
5
|
-
margin: 0;
|
6
|
-
border-bottom: 1px dashed #ddd;
|
7
|
-
padding-bottom: 10px;
|
8
|
-
font-weight: normal;
|
9
|
-
font-size: 30px;
|
10
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
11
|
-
text-align: center; }
|
12
|
-
|
13
|
-
.editor-visual-editor {
|
14
|
-
z-index: 1; }
|
15
|
-
.editor-visual-editor.is-resizable + .edit-post-layout__metaboxes {
|
16
|
-
display: none; }
|
17
|
-
.editor-visual-editor:not(.is-resizable) .editor-styles-wrapper::after {
|
18
|
-
display: none; }
|
19
|
-
|
20
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container {
|
21
|
-
margin-bottom: 0;
|
22
|
-
padding-bottom: 0; }
|
23
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .root-block-appender {
|
24
|
-
position: absolute;
|
25
|
-
bottom: 30px;
|
26
|
-
left: 50%;
|
27
|
-
transform: translateX(-50%);
|
28
|
-
width: calc(100% - var(--content-padding) * 2); }
|
29
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .root-block-appender::after {
|
30
|
-
content: attr(data-tooltip);
|
31
|
-
position: absolute;
|
32
|
-
left: 50%;
|
33
|
-
bottom: -30px;
|
34
|
-
transform: translateX(-50%);
|
35
|
-
z-index: 1;
|
36
|
-
visibility: hidden;
|
37
|
-
opacity: 0;
|
38
|
-
transition: opacity 0.3s;
|
39
|
-
width: max-content;
|
40
|
-
max-width: 200px;
|
41
|
-
white-space: nowrap;
|
42
|
-
background: #000;
|
43
|
-
border-radius: 2px;
|
44
|
-
color: #f0f0f0;
|
45
|
-
font-size: 12px;
|
46
|
-
line-height: 1.4;
|
47
|
-
padding: 4px 8px;
|
48
|
-
text-align: center;
|
49
|
-
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif; }
|
50
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .root-block-appender:hover::after {
|
51
|
-
visibility: visible;
|
52
|
-
opacity: 1; }
|
53
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .root-block-appender ~ .block-list-appender.wp-block {
|
54
|
-
display: none; }
|
55
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender {
|
56
|
-
--button-color: #192f5f;
|
57
|
-
--button-border: var(--button-color);
|
58
|
-
--button-hover-color: var(--wp-admin-theme-color);
|
59
|
-
--button-hover-border: var(--wp-admin-theme-color);
|
60
|
-
--tr: .3s;
|
61
|
-
display: flex;
|
62
|
-
flex-direction: column;
|
63
|
-
align-items: center;
|
64
|
-
justify-content: center;
|
65
|
-
padding: 32px; }
|
66
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__content {
|
67
|
-
text-align: center; }
|
68
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__icon {
|
69
|
-
width: 48px;
|
70
|
-
height: 48px;
|
71
|
-
color: var(--button-color);
|
72
|
-
margin-bottom: 16px; }
|
73
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__title {
|
74
|
-
font-size: 32px;
|
75
|
-
font-weight: 600;
|
76
|
-
line-height: 110%;
|
77
|
-
color: var(--button-color);
|
78
|
-
margin-bottom: 0.5rem; }
|
79
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__text {
|
80
|
-
font-size: 1rem;
|
81
|
-
font-weight: 400;
|
82
|
-
color: var(--button-color);
|
83
|
-
margin-bottom: 1.5rem; }
|
84
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__button .block-editor-button-block-appender {
|
85
|
-
display: inline-flex;
|
86
|
-
justify-content: center;
|
87
|
-
align-items: center;
|
88
|
-
transition: color var(--tr), border-color var(--tr);
|
89
|
-
cursor: pointer;
|
90
|
-
border: 2px solid var(--button-border) !important;
|
91
|
-
box-shadow: none;
|
92
|
-
border-radius: 10px;
|
93
|
-
background: transparent !important;
|
94
|
-
padding: 12px 24px;
|
95
|
-
min-height: 50px;
|
96
|
-
min-width: 200px;
|
97
|
-
color: var(--button-color);
|
98
|
-
font-weight: 600;
|
99
|
-
font-size: 22px; }
|
100
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__button .block-editor-button-block-appender:hover, .editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__button .block-editor-button-block-appender:focus {
|
101
|
-
color: var(--button-hover-color);
|
102
|
-
border-color: var(--button-hover-border) !important;
|
103
|
-
outline: none !important;
|
104
|
-
box-shadow: none !important; }
|
105
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__button .block-editor-button-block-appender::before, .editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__button .block-editor-button-block-appender::after {
|
106
|
-
display: none !important; }
|
107
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .empty-block-appender__button .block-editor-button-block-appender .block-editor-button-block-appender__content {
|
108
|
-
display: flex;
|
109
|
-
align-items: center;
|
110
|
-
justify-content: center;
|
111
|
-
width: 24px;
|
112
|
-
height: 24px; }
|
113
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-add-new-child-btn {
|
114
|
-
display: flex;
|
115
|
-
margin: 20px auto !important;
|
116
|
-
align-items: center;
|
117
|
-
flex-direction: column;
|
118
|
-
height: 50px;
|
119
|
-
justify-content: center;
|
120
|
-
width: 100%;
|
121
|
-
user-select: text;
|
122
|
-
font-family: inherit;
|
123
|
-
font-size: 100%;
|
124
|
-
padding: 12px !important;
|
125
|
-
box-shadow: inset 0 0 0 1px #1e1e1e;
|
126
|
-
color: #1e1e1e; }
|
127
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container:has(.root-block-appender) {
|
128
|
-
margin-bottom: 3rem;
|
129
|
-
padding-bottom: 200px; }
|
130
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container.has-background {
|
131
|
-
transition: background 1s, color 1s; }
|
132
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .block-list-appender.wp-block:only-child p {
|
133
|
-
margin-top: 0;
|
134
|
-
margin-bottom: 0; }
|
135
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .block-list-appender.wp-block:only-child,
|
136
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > p.wp-block:only-child {
|
137
|
-
margin: 2rem 0; }
|
138
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .components-notice {
|
139
|
-
color: #000; }
|
140
|
-
|
141
|
-
.editor-sidebar .bc-url-input {
|
142
|
-
min-width: 100%; }
|
143
|
-
.editor-sidebar .bc-url-input input {
|
144
|
-
width: 100%;
|
145
|
-
border: 1px solid #949494; }
|
146
|
-
.editor-sidebar .bc-url-input__suggestions {
|
147
|
-
max-width: 245px; }
|
148
|
-
|
149
|
-
.editor-sidebar .components-base-control .block-editor-link-control .block-editor-url-input {
|
150
|
-
margin-top: 0; }
|
151
|
-
|
152
|
-
.editor-sidebar .components-base-control .block-editor-link-control .block-editor-link-control__search-item {
|
153
|
-
padding-top: 0; }
|
154
|
-
|
155
|
-
.editor-sidebar .block-editor-link-control {
|
156
|
-
min-width: 100%;
|
157
|
-
width: 100%; }
|
158
|
-
.editor-sidebar .block-editor-link-control .block-editor-url-input {
|
159
|
-
min-width: 100%; }
|
160
|
-
.editor-sidebar .block-editor-link-control .block-editor-url-input__input {
|
161
|
-
width: 100%; }
|
162
|
-
.editor-sidebar .block-editor-link-control .components-base-control {
|
163
|
-
margin-left: 0;
|
164
|
-
margin-right: 0; }
|
165
|
-
.editor-sidebar .block-editor-link-control .block-editor-link-control__search-enter {
|
166
|
-
right: 5px; }
|
167
|
-
.editor-sidebar .block-editor-link-control .components-spinner {
|
168
|
-
top: 50%;
|
169
|
-
transform: translateY(-50%); }
|
170
|
-
.editor-sidebar .block-editor-link-control .block-editor-link-control__tools,
|
171
|
-
.editor-sidebar .block-editor-link-control .block-editor-link-control__search-actions,
|
172
|
-
.editor-sidebar .block-editor-link-control .block-editor-link-control__search-results,
|
173
|
-
.editor-sidebar .block-editor-link-control .block-editor-link-control__search-item {
|
174
|
-
padding-left: 0;
|
175
|
-
padding-right: 0; }
|
176
|
-
.editor-sidebar .block-editor-link-control .components-menu-item__item {
|
177
|
-
min-width: unset; }
|
178
|
-
.editor-sidebar .block-editor-link-control .components-button.block-editor-link-control__drawer-toggle {
|
179
|
-
box-shadow: none;
|
180
|
-
outline: none; }
|
181
|
-
|
182
|
-
.editor-sidebar .bc-animation-block-json-file {
|
183
|
-
display: flex;
|
184
|
-
align-items: center;
|
185
|
-
cursor: pointer; }
|
186
|
-
|
187
|
-
.editor-sidebar .bc-remove-btn {
|
188
|
-
margin-top: 15px;
|
189
|
-
margin-bottom: 15px;
|
190
|
-
display: flex; }
|
191
|
-
|
192
|
-
.editor-sidebar .svg-container {
|
193
|
-
width: 100%;
|
194
|
-
height: auto; }
|
195
|
-
|
196
|
-
.editor-sidebar .bc-selected-media-wrapper {
|
197
|
-
max-width: 200px;
|
198
|
-
cursor: pointer;
|
199
|
-
background: rgba(0, 0, 0, 0.3); }
|
200
|
-
|
201
|
-
.editor-sidebar .bc-selected-media {
|
202
|
-
display: block;
|
203
|
-
width: 100%; }
|
204
|
-
.editor-sidebar .bc-selected-media--image {
|
205
|
-
max-height: 300px; }
|
206
|
-
|
207
|
-
.editor-sidebar .bc-select-btn,
|
208
|
-
.editor-sidebar .bc-remove-btn {
|
209
|
-
margin-top: 15px;
|
210
|
-
margin-bottom: 15px;
|
211
|
-
display: flex; }
|
212
|
-
|
213
|
-
.editor-sidebar .react-select__input {
|
214
|
-
box-shadow: none !important; }
|
215
|
-
|
216
|
-
.editor-sidebar .bc-responsive-spacing-tab:last-child {
|
217
|
-
margin-bottom: 2rem; }
|
218
|
-
|
219
|
-
.editor-sidebar .bc-spacing-control-wrapper {
|
220
|
-
margin-bottom: 35px; }
|
221
|
-
|
222
|
-
.editor-sidebar .bc-spacing-range-control {
|
223
|
-
padding: 0 6px; }
|
224
|
-
.editor-sidebar .bc-spacing-range-control .components-base-control__label {
|
225
|
-
margin-left: -9px; }
|
226
|
-
.editor-sidebar .bc-spacing-range-control .components-range-control__root .components-range-control__wrapper {
|
227
|
-
margin-bottom: 0; }
|
228
|
-
.editor-sidebar .bc-spacing-range-control .components-range-control__root .components-range-control__wrapper .components-range-control__marks .components-range-control__mark-label {
|
229
|
-
left: 8px !important;
|
230
|
-
margin-top: 7px !important; }
|
231
|
-
.editor-sidebar .bc-spacing-range-control .components-base-control__help {
|
232
|
-
margin-left: -11px; }
|
233
|
-
|
234
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper,
|
235
|
-
.editor-sidebar .bc-image-wrapper {
|
236
|
-
position: relative;
|
237
|
-
height: auto;
|
238
|
-
align-self: start; }
|
239
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper__actions,
|
240
|
-
.editor-sidebar .bc-image-wrapper__actions {
|
241
|
-
display: none;
|
242
|
-
position: absolute;
|
243
|
-
top: 0;
|
244
|
-
left: 0;
|
245
|
-
right: 0;
|
246
|
-
bottom: 0;
|
247
|
-
flex-wrap: nowrap;
|
248
|
-
justify-content: center;
|
249
|
-
align-items: center;
|
250
|
-
gap: 20px;
|
251
|
-
padding: 5px 15px;
|
252
|
-
z-index: 20; }
|
253
|
-
@media screen and (max-width: 768px) {
|
254
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper__actions,
|
255
|
-
.editor-sidebar .bc-image-wrapper__actions {
|
256
|
-
gap: 15px; } }
|
257
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper__btn,
|
258
|
-
.editor-sidebar .bc-image-wrapper__btn {
|
259
|
-
font-size: 14px !important;
|
260
|
-
backdrop-filter: blur(16px) saturate(180%);
|
261
|
-
background: rgba(255, 255, 255, 0.75);
|
262
|
-
flex-grow: 1;
|
263
|
-
justify-content: center;
|
264
|
-
max-width: 130px; }
|
265
|
-
@media screen and (max-width: 768px) {
|
266
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper__btn,
|
267
|
-
.editor-sidebar .bc-image-wrapper__btn {
|
268
|
-
padding: 5px; } }
|
269
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper__overlay,
|
270
|
-
.editor-sidebar .bc-image-wrapper__overlay {
|
271
|
-
display: none;
|
272
|
-
position: absolute;
|
273
|
-
top: 0;
|
274
|
-
left: 0;
|
275
|
-
right: 0;
|
276
|
-
bottom: 0;
|
277
|
-
z-index: 10;
|
278
|
-
background: rgba(255, 255, 255, 0.3);
|
279
|
-
backdrop-filter: blur(3px); }
|
280
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper:hover .bc-image-wrapper__actions,
|
281
|
-
.editor-sidebar .bc-image-wrapper:hover .bc-image-wrapper__actions {
|
282
|
-
display: flex; }
|
283
|
-
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container .bc-image-wrapper:hover .bc-image-wrapper__overlay,
|
284
|
-
.editor-sidebar .bc-image-wrapper:hover .bc-image-wrapper__overlay {
|
285
|
-
display: block; }
|
286
|
-
|
287
|
-
.block-editor-block-types-list > [role=presentation] {
|
288
|
-
justify-content: center; }
|
289
|
-
|
290
|
-
.block-editor-inserter__insertable-blocks-at-selection + .block-editor-inserter__all-blocks {
|
291
|
-
display: none; }
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import { RadioControl } from '@wordpress/components';
|
2
|
-
|
3
|
-
// TODO: 1. add support of curated posts, categories
|
4
|
-
// TODO: 2. consider merging with the useDataQuery hook
|
5
|
-
// TODO: 3. can't pass disabled prop to RadioControl
|
6
|
-
export const DataQueryControls = (props) => {
|
7
|
-
const {
|
8
|
-
dataSourceLabel = 'Data Source',
|
9
|
-
dataSource,
|
10
|
-
onDataSourceChange,
|
11
|
-
|
12
|
-
queryTypeLabel = 'Query',
|
13
|
-
queryType,
|
14
|
-
onQueryTypeChange,
|
15
|
-
|
16
|
-
settings,
|
17
|
-
} = props;
|
18
|
-
|
19
|
-
const sourcesList = settings
|
20
|
-
.filter((source) => source?.value && source?.label)
|
21
|
-
.map((source) => ({ label: source.label, value: source.value }));
|
22
|
-
|
23
|
-
const queriesList = settings.find((source) => source.value === dataSource)?.queries || [];
|
24
|
-
|
25
|
-
const hasSources = sourcesList && sourcesList?.length > 0;
|
26
|
-
const hasQueries = queriesList && queriesList?.length > 0;
|
27
|
-
|
28
|
-
return (
|
29
|
-
<>
|
30
|
-
{
|
31
|
-
hasSources && (
|
32
|
-
<RadioControl
|
33
|
-
label={dataSourceLabel}
|
34
|
-
selected={dataSource}
|
35
|
-
options={sourcesList}
|
36
|
-
onChange={onDataSourceChange}
|
37
|
-
/>
|
38
|
-
)
|
39
|
-
}
|
40
|
-
|
41
|
-
{
|
42
|
-
hasQueries && (
|
43
|
-
<RadioControl
|
44
|
-
label={queryTypeLabel}
|
45
|
-
selected={queryType}
|
46
|
-
options={queriesList}
|
47
|
-
onChange={onQueryTypeChange}
|
48
|
-
/>
|
49
|
-
)
|
50
|
-
}
|
51
|
-
</>
|
52
|
-
)
|
53
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { deprecationWarning } from '../utils/internal/helpers.js';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @deprecated since 0.5.3
|
5
|
-
*/
|
6
|
-
export const useColorChange = (colors, setAttributes) => (colorValue, property) => {
|
7
|
-
deprecationWarning('Warning: useColorChange is deprecated since version 0.5.3 and will be removed in future versions.');
|
8
|
-
|
9
|
-
const selectedColor = colors.find(color => color.color === colorValue);
|
10
|
-
|
11
|
-
setAttributes({
|
12
|
-
[property]: selectedColor
|
13
|
-
? {
|
14
|
-
value: colorValue,
|
15
|
-
slug: selectedColor.slug,
|
16
|
-
}
|
17
|
-
: {
|
18
|
-
value: '',
|
19
|
-
slug: '',
|
20
|
-
},
|
21
|
-
});
|
22
|
-
};
|
File without changes
|