@wordpress/block-library 7.3.0 → 7.3.3
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/audio/edit.js +1 -1
- package/build/audio/edit.js.map +1 -1
- package/build/comment-template/edit.js +3 -1
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/hooks.js +14 -4
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comments-pagination/edit.js +18 -1
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-query-loop/edit.js +2 -2
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-title/edit.js +149 -0
- package/build/comments-title/edit.js.map +1 -0
- package/build/comments-title/index.js +101 -0
- package/build/comments-title/index.js.map +1 -0
- package/build/cover/transforms.js +33 -32
- package/build/cover/transforms.js.map +1 -1
- package/build/index.js +6 -4
- package/build/index.js.map +1 -1
- package/build/list/index.js +13 -2
- package/build/list/index.js.map +1 -1
- package/build/navigation/edit/index.js +17 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +7 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/post-comments/edit.js +141 -35
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments/index.js +6 -4
- package/build/post-comments/index.js.map +1 -1
- package/build/post-comments-form/edit.js +22 -1
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-featured-image/edit.js +19 -7
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/query/edit/index.js +84 -22
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/query-placeholder.js +7 -14
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +6 -1
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query-no-results/edit.js +1 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/quote/index.js +13 -2
- package/build/quote/index.js.map +1 -1
- package/build-module/audio/edit.js +1 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/comment-template/edit.js +3 -1
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/hooks.js +14 -4
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comments-pagination/edit.js +19 -2
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-query-loop/edit.js +2 -2
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +133 -0
- package/build-module/comments-title/edit.js.map +1 -0
- package/build-module/comments-title/index.js +88 -0
- package/build-module/comments-title/index.js.map +1 -0
- package/build-module/cover/transforms.js +33 -32
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/index.js +5 -4
- package/build-module/index.js.map +1 -1
- package/build-module/list/index.js +9 -3
- package/build-module/list/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +17 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/post-comments/edit.js +143 -38
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments/index.js +6 -4
- package/build-module/post-comments/index.js.map +1 -1
- package/build-module/post-comments-form/edit.js +21 -1
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +19 -7
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/query/edit/index.js +87 -26
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +8 -15
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +6 -1
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query-no-results/edit.js +1 -1
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/quote/index.js +9 -3
- package/build-module/quote/index.js.map +1 -1
- package/build-style/comments-title/editor-rtl.css +79 -0
- package/build-style/comments-title/editor.css +79 -0
- package/build-style/editor-rtl.css +51 -0
- package/build-style/editor.css +51 -0
- package/build-style/post-comments/editor-rtl.css +79 -0
- package/build-style/post-comments/editor.css +79 -0
- package/build-style/post-comments/style-rtl.css +1 -3
- package/build-style/post-comments/style.css +1 -3
- package/build-style/post-comments-form/editor-rtl.css +79 -0
- package/build-style/post-comments-form/editor.css +79 -0
- package/build-style/post-comments-form/style-rtl.css +9 -0
- package/build-style/post-comments-form/style.css +9 -0
- package/build-style/query/editor-rtl.css +39 -0
- package/build-style/query/editor.css +39 -0
- package/build-style/style-rtl.css +10 -3
- package/build-style/style.css +10 -3
- package/package.json +28 -28
- package/src/audio/edit.js +1 -1
- package/src/comment-edit-link/index.php +1 -4
- package/src/comment-reply-link/index.php +1 -4
- package/src/comment-template/edit.js +5 -2
- package/src/comment-template/hooks.js +15 -2
- package/src/comment-template/index.php +23 -2
- package/src/comments-pagination/edit.js +23 -0
- package/src/comments-query-loop/edit.js +2 -0
- package/src/comments-title/block.json +70 -0
- package/src/comments-title/edit.js +197 -0
- package/src/comments-title/editor.scss +4 -0
- package/src/comments-title/index.js +18 -0
- package/src/comments-title/index.php +68 -0
- package/src/cover/transforms.js +51 -28
- package/src/editor.scss +3 -0
- package/src/index.js +8 -2
- package/src/list/index.js +7 -3
- package/src/navigation/edit/index.js +24 -0
- package/src/navigation/edit/navigation-menu-selector.js +15 -9
- package/src/post-comments/block.json +6 -4
- package/src/post-comments/edit.js +204 -44
- package/src/post-comments/editor.scss +3 -0
- package/src/post-comments/style.scss +1 -5
- package/src/post-comments-form/block.json +1 -0
- package/src/post-comments-form/edit.js +39 -2
- package/src/post-comments-form/editor.scss +3 -0
- package/src/post-comments-form/index.php +12 -4
- package/src/post-comments-form/style.scss +11 -0
- package/src/post-featured-image/edit.js +24 -12
- package/src/query/edit/index.js +125 -26
- package/src/query/edit/query-placeholder.js +3 -13
- package/src/query/edit/query-toolbar.js +6 -0
- package/src/query/editor.scss +38 -0
- package/src/query-no-results/edit.js +1 -1
- package/src/quote/index.js +7 -3
|
@@ -5,7 +5,6 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
5
5
|
import {
|
|
6
6
|
useBlockProps,
|
|
7
7
|
__experimentalBlockVariationPicker,
|
|
8
|
-
__experimentalGetMatchingVariation as getMatchingVariation,
|
|
9
8
|
store as blockEditorStore,
|
|
10
9
|
} from '@wordpress/block-editor';
|
|
11
10
|
import {
|
|
@@ -13,13 +12,8 @@ import {
|
|
|
13
12
|
store as blocksStore,
|
|
14
13
|
} from '@wordpress/blocks';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
blockType,
|
|
19
|
-
defaultVariation,
|
|
20
|
-
scopeVariations,
|
|
21
|
-
allVariations,
|
|
22
|
-
} = useSelect(
|
|
15
|
+
function QueryPlaceholder( { clientId, name, setAttributes, icon, label } ) {
|
|
16
|
+
const { defaultVariation, scopeVariations } = useSelect(
|
|
23
17
|
( select ) => {
|
|
24
18
|
const {
|
|
25
19
|
getBlockVariations,
|
|
@@ -31,16 +25,12 @@ const QueryPlaceholder = ( { clientId, name, attributes, setAttributes } ) => {
|
|
|
31
25
|
blockType: getBlockType( name ),
|
|
32
26
|
defaultVariation: getDefaultBlockVariation( name, 'block' ),
|
|
33
27
|
scopeVariations: getBlockVariations( name, 'block' ),
|
|
34
|
-
allVariations: getBlockVariations( name ),
|
|
35
28
|
};
|
|
36
29
|
},
|
|
37
30
|
[ name ]
|
|
38
31
|
);
|
|
39
32
|
const { replaceInnerBlocks } = useDispatch( blockEditorStore );
|
|
40
33
|
const blockProps = useBlockProps();
|
|
41
|
-
const matchingVariation = getMatchingVariation( attributes, allVariations );
|
|
42
|
-
const icon = matchingVariation?.icon || blockType?.icon?.src;
|
|
43
|
-
const label = matchingVariation?.title || blockType?.title;
|
|
44
34
|
return (
|
|
45
35
|
<div { ...blockProps }>
|
|
46
36
|
<__experimentalBlockVariationPicker
|
|
@@ -64,6 +54,6 @@ const QueryPlaceholder = ( { clientId, name, attributes, setAttributes } ) => {
|
|
|
64
54
|
/>
|
|
65
55
|
</div>
|
|
66
56
|
);
|
|
67
|
-
}
|
|
57
|
+
}
|
|
68
58
|
|
|
69
59
|
export default QueryPlaceholder;
|
|
@@ -16,6 +16,7 @@ export default function QueryToolbar( {
|
|
|
16
16
|
attributes: { query, displayLayout },
|
|
17
17
|
setQuery,
|
|
18
18
|
setDisplayLayout,
|
|
19
|
+
openPatternSelectionModal,
|
|
19
20
|
} ) {
|
|
20
21
|
const maxPageInputId = useInstanceId(
|
|
21
22
|
QueryToolbar,
|
|
@@ -128,6 +129,11 @@ export default function QueryToolbar( {
|
|
|
128
129
|
/>
|
|
129
130
|
</ToolbarGroup>
|
|
130
131
|
) }
|
|
132
|
+
<ToolbarGroup className="wp-block-template-part__block-control-group">
|
|
133
|
+
<ToolbarButton onClick={ openPatternSelectionModal }>
|
|
134
|
+
{ __( 'Replace' ) }
|
|
135
|
+
</ToolbarButton>
|
|
136
|
+
</ToolbarGroup>
|
|
131
137
|
<ToolbarGroup controls={ displayLayoutControls } />
|
|
132
138
|
</>
|
|
133
139
|
);
|
package/src/query/editor.scss
CHANGED
|
@@ -5,3 +5,41 @@
|
|
|
5
5
|
.wp-block-query__create-new-link {
|
|
6
6
|
padding: 0 $grid-unit-20 $grid-unit-20 56px;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
.block-library-query__pattern-selection-content .block-editor-block-patterns-list {
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
12
|
+
grid-gap: $grid-unit-10;
|
|
13
|
+
|
|
14
|
+
.block-editor-block-patterns-list__list-item {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
.block-editor-block-preview__container {
|
|
17
|
+
max-height: 250px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.block-editor-query-pattern__selection-modal .components-modal__content {
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
padding: 0;
|
|
25
|
+
&::before {
|
|
26
|
+
margin-bottom: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.block-editor-query-pattern__selection-modal {
|
|
31
|
+
// To keep modal dimensions consistent as subsections are navigated, width
|
|
32
|
+
// and height are used instead of max-(width/height).
|
|
33
|
+
@include break-small() {
|
|
34
|
+
width: calc(100% - #{ $grid-unit-20 * 2 });
|
|
35
|
+
height: calc(100% - #{ $header-height * 2 });
|
|
36
|
+
}
|
|
37
|
+
@include break-medium() {
|
|
38
|
+
width: $break-medium - $grid-unit-20 * 2;
|
|
39
|
+
}
|
|
40
|
+
@include break-large() {
|
|
41
|
+
height: 80%;
|
|
42
|
+
width: 80%;
|
|
43
|
+
max-height: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/quote/index.js
CHANGED
|
@@ -53,6 +53,10 @@ export const settingsV1 = {
|
|
|
53
53
|
deprecated,
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
let settings = settingsV1;
|
|
57
|
+
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
58
|
+
settings = window?.__experimentalEnableQuoteBlockV2
|
|
59
|
+
? settingsV2
|
|
60
|
+
: settingsV1;
|
|
61
|
+
}
|
|
62
|
+
export { settings };
|