@wordpress/block-library 9.15.1 → 9.16.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/CHANGELOG.md +2 -0
- package/build/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/columns/edit.js +1 -1
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/comment-template/edit.js +2 -2
- package/build/comment-template/edit.js.map +1 -1
- package/build/comments-pagination-next/index.js +7 -6
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +7 -6
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/cover/deprecated.js +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/details/edit.js +12 -17
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +3 -0
- package/build/details/index.js.map +1 -1
- package/build/embed/util.js +1 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.js +7 -4
- package/build/file/edit.js.map +1 -1
- package/build/file/transforms.js +1 -1
- package/build/file/transforms.js.map +1 -1
- package/build/file/utils/index.js +1 -1
- package/build/file/utils/index.js.map +1 -1
- package/build/form-input/edit.js +1 -1
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/transforms.js +2 -2
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-new-images.js +1 -1
- package/build/gallery/use-get-new-images.js.map +1 -1
- package/build/list-item/edit.native.js +2 -2
- package/build/list-item/edit.native.js.map +1 -1
- package/build/media-text/edit.native.js +2 -2
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +4 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js +8 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +15 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +9 -18
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/index.js +11 -0
- package/build/page-list/index.js.map +1 -1
- package/build/post-author-name/edit.js +41 -12
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-comments-link/index.js +7 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-featured-image/overlay-controls.js +2 -1
- package/build/post-featured-image/overlay-controls.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +1 -1
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +110 -61
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/query-title/edit.js +39 -14
- package/build/query-title/edit.js.map +1 -1
- package/build/query-total/index.js +7 -1
- package/build/query-total/index.js.map +1 -1
- package/build/quote/transforms.js +1 -1
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +1 -0
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +6 -0
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +2 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +26 -35
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/edit.js +2 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +24 -8
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/video/edit.native.js +3 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/button/edit.js +3 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/columns/edit.js +1 -1
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +1 -1
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/comment-template/edit.js +2 -2
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +7 -6
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +7 -6
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/cover/deprecated.js +1 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/details/edit.js +13 -18
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +3 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/embed/util.js +1 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.js +7 -4
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/transforms.js +1 -1
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/file/utils/index.js +1 -1
- package/build-module/file/utils/index.js.map +1 -1
- package/build-module/form-input/edit.js +1 -1
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/transforms.js +2 -2
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-new-images.js +1 -1
- package/build-module/gallery/use-get-new-images.js.map +1 -1
- package/build-module/list-item/edit.native.js +2 -2
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/media-text/edit.native.js +2 -2
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +4 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +8 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +15 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +9 -18
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/index.js +11 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +42 -13
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-comments-link/index.js +7 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-featured-image/overlay-controls.js +2 -1
- package/build-module/post-featured-image/overlay-controls.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +111 -62
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-title/edit.js +40 -15
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-total/index.js +7 -1
- package/build-module/query-total/index.js.map +1 -1
- package/build-module/quote/transforms.js +1 -1
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +1 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +6 -0
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +3 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +27 -36
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-links/edit.js +2 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +25 -9
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/video/edit.native.js +3 -3
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/editor-rtl.css +6 -43
- package/build-style/editor.css +6 -43
- package/build-style/freeform/editor-rtl.css +2 -4
- package/build-style/freeform/editor.css +2 -4
- package/build-style/gallery/editor-rtl.css +2 -4
- package/build-style/gallery/editor.css +2 -4
- package/build-style/image/style-rtl.css +24 -10
- package/build-style/image/style.css +24 -10
- package/build-style/navigation/style-rtl.css +8 -6
- package/build-style/navigation/style.css +8 -6
- package/build-style/query/editor-rtl.css +0 -27
- package/build-style/query/editor.css +0 -27
- package/build-style/site-logo/editor-rtl.css +2 -8
- package/build-style/site-logo/editor.css +2 -8
- package/build-style/social-links/style-rtl.css +2 -5
- package/build-style/social-links/style.css +2 -5
- package/build-style/style-rtl.css +34 -21
- package/build-style/style.css +34 -21
- package/package.json +35 -35
- package/src/audio/test/transforms.native.js +4 -3
- package/src/button/edit.js +6 -2
- package/src/columns/edit.js +1 -1
- package/src/columns/edit.native.js +1 -1
- package/src/comment-template/edit.js +2 -2
- package/src/comments-pagination-next/block.json +0 -5
- package/src/comments-pagination-next/index.js +6 -0
- package/src/comments-pagination-previous/block.json +0 -5
- package/src/comments-pagination-previous/index.js +6 -0
- package/src/cover/deprecated.js +1 -1
- package/src/cover/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/cover/test/edit.js +7 -7
- package/src/cover/test/edit.native.js +2 -2
- package/src/cover/test/transforms.native.js +9 -5
- package/src/details/block.json +3 -0
- package/src/details/edit.js +12 -23
- package/src/editor.scss +1 -1
- package/src/embed/test/index.js +1 -1
- package/src/embed/util.js +1 -1
- package/src/file/edit.js +4 -3
- package/src/file/test/transforms.native.js +4 -3
- package/src/file/transforms.js +1 -1
- package/src/file/utils/index.js +1 -1
- package/src/form-input/edit.js +1 -1
- package/src/freeform/editor.scss +4 -3
- package/src/gallery/edit.js +1 -1
- package/src/gallery/editor.scss +4 -2
- package/src/gallery/test/transforms.native.js +4 -3
- package/src/gallery/transforms.js +2 -2
- package/src/gallery/use-get-new-images.js +1 -1
- package/src/image/block.json +8 -1
- package/src/image/editor.scss +1 -1
- package/src/image/index.php +9 -13
- package/src/image/style.scss +17 -7
- package/src/image/test/edit.native.js +1 -1
- package/src/image/test/transforms.native.js +4 -3
- package/src/list/test/edit.native.js +1 -1
- package/src/list-item/edit.native.js +2 -2
- package/src/media-text/edit.native.js +2 -2
- package/src/media-text/media-container.native.js +4 -4
- package/src/media-text/test/transforms.native.js +9 -5
- package/src/navigation/edit/index.js +4 -0
- package/src/navigation/index.js +20 -0
- package/src/navigation/style.scss +7 -4
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-link/link-ui.js +7 -13
- package/src/navigation-submenu/edit.js +1 -1
- package/src/page-list/block.json +11 -0
- package/src/paragraph/style.scss +1 -1
- package/src/post-author-name/edit.js +53 -15
- package/src/post-comments-link/block.json +7 -1
- package/src/post-content/block.json +1 -1
- package/src/post-featured-image/overlay-controls.js +1 -0
- package/src/query/edit/inspector-controls/author-control.js +1 -1
- package/src/query/edit/inspector-controls/index.js +148 -88
- package/src/query/editor.scss +0 -31
- package/src/query/utils.js +1 -1
- package/src/query-title/edit.js +60 -19
- package/src/query-total/block.json +7 -1
- package/src/quote/transforms.js +1 -1
- package/src/rss/block.json +6 -0
- package/src/rss/edit.js +1 -0
- package/src/search/edit.js +6 -2
- package/src/separator/deprecated.scss +1 -1
- package/src/site-logo/edit.js +34 -47
- package/src/site-logo/editor.scss +3 -6
- package/src/social-link/index.php +2 -2
- package/src/social-links/edit.js +1 -0
- package/src/social-links/style.scss +3 -3
- package/src/table-of-contents/edit.js +38 -19
- package/src/video/edit.native.js +3 -3
- package/src/video/test/transforms.native.js +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.16.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -41,39 +41,39 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/runtime": "7.25.7",
|
|
44
|
-
"@wordpress/a11y": "^4.
|
|
45
|
-
"@wordpress/api-fetch": "^7.
|
|
46
|
-
"@wordpress/autop": "^4.
|
|
47
|
-
"@wordpress/blob": "^4.
|
|
48
|
-
"@wordpress/block-editor": "^14.
|
|
49
|
-
"@wordpress/blocks": "^14.
|
|
50
|
-
"@wordpress/components": "^29.
|
|
51
|
-
"@wordpress/compose": "^7.
|
|
52
|
-
"@wordpress/core-data": "^7.
|
|
53
|
-
"@wordpress/data": "^10.
|
|
54
|
-
"@wordpress/date": "^5.
|
|
55
|
-
"@wordpress/deprecated": "^4.
|
|
56
|
-
"@wordpress/dom": "^4.
|
|
57
|
-
"@wordpress/element": "^6.
|
|
58
|
-
"@wordpress/escape-html": "^3.
|
|
59
|
-
"@wordpress/hooks": "^4.
|
|
60
|
-
"@wordpress/html-entities": "^4.
|
|
61
|
-
"@wordpress/i18n": "^5.
|
|
62
|
-
"@wordpress/icons": "^10.
|
|
63
|
-
"@wordpress/interactivity": "^6.
|
|
64
|
-
"@wordpress/interactivity-router": "^2.
|
|
65
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
66
|
-
"@wordpress/keycodes": "^4.
|
|
67
|
-
"@wordpress/notices": "^5.
|
|
68
|
-
"@wordpress/patterns": "^2.
|
|
69
|
-
"@wordpress/primitives": "^4.
|
|
70
|
-
"@wordpress/private-apis": "^1.
|
|
71
|
-
"@wordpress/reusable-blocks": "^5.
|
|
72
|
-
"@wordpress/rich-text": "^7.
|
|
73
|
-
"@wordpress/server-side-render": "^5.
|
|
74
|
-
"@wordpress/url": "^4.
|
|
75
|
-
"@wordpress/viewport": "^6.
|
|
76
|
-
"@wordpress/wordcount": "^4.
|
|
44
|
+
"@wordpress/a11y": "^4.16.0",
|
|
45
|
+
"@wordpress/api-fetch": "^7.16.0",
|
|
46
|
+
"@wordpress/autop": "^4.16.0",
|
|
47
|
+
"@wordpress/blob": "^4.16.0",
|
|
48
|
+
"@wordpress/block-editor": "^14.11.0",
|
|
49
|
+
"@wordpress/blocks": "^14.5.0",
|
|
50
|
+
"@wordpress/components": "^29.2.0",
|
|
51
|
+
"@wordpress/compose": "^7.16.0",
|
|
52
|
+
"@wordpress/core-data": "^7.16.0",
|
|
53
|
+
"@wordpress/data": "^10.16.0",
|
|
54
|
+
"@wordpress/date": "^5.16.0",
|
|
55
|
+
"@wordpress/deprecated": "^4.16.0",
|
|
56
|
+
"@wordpress/dom": "^4.16.0",
|
|
57
|
+
"@wordpress/element": "^6.16.0",
|
|
58
|
+
"@wordpress/escape-html": "^3.16.0",
|
|
59
|
+
"@wordpress/hooks": "^4.16.0",
|
|
60
|
+
"@wordpress/html-entities": "^4.16.0",
|
|
61
|
+
"@wordpress/i18n": "^5.16.0",
|
|
62
|
+
"@wordpress/icons": "^10.16.0",
|
|
63
|
+
"@wordpress/interactivity": "^6.16.0",
|
|
64
|
+
"@wordpress/interactivity-router": "^2.16.0",
|
|
65
|
+
"@wordpress/keyboard-shortcuts": "^5.16.0",
|
|
66
|
+
"@wordpress/keycodes": "^4.16.0",
|
|
67
|
+
"@wordpress/notices": "^5.16.0",
|
|
68
|
+
"@wordpress/patterns": "^2.16.0",
|
|
69
|
+
"@wordpress/primitives": "^4.16.0",
|
|
70
|
+
"@wordpress/private-apis": "^1.16.0",
|
|
71
|
+
"@wordpress/reusable-blocks": "^5.16.0",
|
|
72
|
+
"@wordpress/rich-text": "^7.16.0",
|
|
73
|
+
"@wordpress/server-side-render": "^5.16.0",
|
|
74
|
+
"@wordpress/url": "^4.16.0",
|
|
75
|
+
"@wordpress/viewport": "^6.16.0",
|
|
76
|
+
"@wordpress/wordcount": "^4.16.0",
|
|
77
77
|
"change-case": "^4.1.2",
|
|
78
78
|
"clsx": "^2.1.1",
|
|
79
79
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "f48b9f56629e400891abb5ae491504de475237ff"
|
|
95
95
|
}
|
|
@@ -15,8 +15,8 @@ const initialHtml = `
|
|
|
15
15
|
<figure class="wp-block-audio"><audio controls src="https://cldup.com/59IrU0WJtq.mp3"></audio></figure>
|
|
16
16
|
<!-- /wp:audio -->`;
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
const blockTransforms = [ 'File', ...
|
|
18
|
+
const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
|
|
19
|
+
const blockTransforms = [ 'File', ...transformsWithInnerBlocks ];
|
|
20
20
|
|
|
21
21
|
setupCoreBlocks();
|
|
22
22
|
|
|
@@ -25,7 +25,8 @@ describe( `${ block } block transformations`, () => {
|
|
|
25
25
|
const screen = await initializeEditor( { initialHtml } );
|
|
26
26
|
const newBlock = await transformBlock( screen, block, blockTransform, {
|
|
27
27
|
isMediaBlock: false,
|
|
28
|
-
hasInnerBlocks:
|
|
28
|
+
hasInnerBlocks:
|
|
29
|
+
transformsWithInnerBlocks.includes( blockTransform ),
|
|
29
30
|
} );
|
|
30
31
|
expect( newBlock ).toBeVisible();
|
|
31
32
|
expect( getEditorHtml() ).toMatchSnapshot();
|
package/src/button/edit.js
CHANGED
|
@@ -14,7 +14,7 @@ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
|
14
14
|
/**
|
|
15
15
|
* WordPress dependencies
|
|
16
16
|
*/
|
|
17
|
-
import { __ } from '@wordpress/i18n';
|
|
17
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
18
18
|
import { useEffect, useState, useRef, useMemo } from '@wordpress/element';
|
|
19
19
|
import {
|
|
20
20
|
TextControl,
|
|
@@ -148,7 +148,11 @@ function WidthPanel( { selectedWidth, setAttributes } ) {
|
|
|
148
148
|
<ToggleGroupControlOption
|
|
149
149
|
key={ widthValue }
|
|
150
150
|
value={ widthValue }
|
|
151
|
-
label={
|
|
151
|
+
label={ sprintf(
|
|
152
|
+
/* translators: Percentage value. */
|
|
153
|
+
__( '%d%%' ),
|
|
154
|
+
widthValue
|
|
155
|
+
) }
|
|
152
156
|
/>
|
|
153
157
|
);
|
|
154
158
|
} ) }
|
package/src/columns/edit.js
CHANGED
|
@@ -242,7 +242,7 @@ function ColumnsEditContainer( { attributes, setAttributes, clientId } ) {
|
|
|
242
242
|
/**
|
|
243
243
|
* Update all child Column blocks with a new vertical alignment setting
|
|
244
244
|
* based on whatever alignment is passed in. This allows change to parent
|
|
245
|
-
* to
|
|
245
|
+
* to override anything set on a individual column basis.
|
|
246
246
|
*
|
|
247
247
|
* @param {string} newVerticalAlignment The vertical alignment setting.
|
|
248
248
|
*/
|
|
@@ -287,7 +287,7 @@ const ColumnsEditContainerWrapper = withDispatch(
|
|
|
287
287
|
/**
|
|
288
288
|
* Update all child Column blocks with a new vertical alignment setting
|
|
289
289
|
* based on whatever alignment is passed in. This allows change to parent
|
|
290
|
-
* to
|
|
290
|
+
* to override anything set on a individual column basis.
|
|
291
291
|
*
|
|
292
292
|
* @param {string} verticalAlignment the vertical alignment setting
|
|
293
293
|
*/
|
|
@@ -168,7 +168,7 @@ const CommentTemplatePreview = ( {
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
// We have to hide the preview block if the `comment` props points to
|
|
171
|
-
// the
|
|
171
|
+
// the currently active block!
|
|
172
172
|
|
|
173
173
|
// Or, to put it differently, every preview block is visible unless it is the
|
|
174
174
|
// currently active block - in this case we render its inner blocks.
|
|
@@ -222,7 +222,7 @@ const CommentsList = ( {
|
|
|
222
222
|
// "placeholder" and that the block is most likely being used in the
|
|
223
223
|
// site editor. In this case, we have to set the commentId to `null`
|
|
224
224
|
// because otherwise the (non-existent) comment with a negative ID
|
|
225
|
-
// would be
|
|
225
|
+
// would be requested from the REST API.
|
|
226
226
|
commentId: commentId < 0 ? null : commentId,
|
|
227
227
|
} }
|
|
228
228
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { queryPaginationNext as icon } from '@wordpress/icons';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -16,6 +17,11 @@ export { metadata, name };
|
|
|
16
17
|
export const settings = {
|
|
17
18
|
icon,
|
|
18
19
|
edit,
|
|
20
|
+
example: {
|
|
21
|
+
attributes: {
|
|
22
|
+
label: __( 'Newer Comments' ),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
export const init = () => initBlock( { name, metadata, settings } );
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { queryPaginationPrevious as icon } from '@wordpress/icons';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -16,6 +17,11 @@ export { metadata, name };
|
|
|
16
17
|
export const settings = {
|
|
17
18
|
icon,
|
|
18
19
|
edit,
|
|
20
|
+
example: {
|
|
21
|
+
attributes: {
|
|
22
|
+
label: __( 'Older Comments' ),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/cover/deprecated.js
CHANGED
|
@@ -885,7 +885,7 @@ const v11 = {
|
|
|
885
885
|
migrate: migrateTag,
|
|
886
886
|
};
|
|
887
887
|
|
|
888
|
-
// Deprecation for blocks that renders fixed background as
|
|
888
|
+
// Deprecation for blocks that renders fixed background as background from the main block container.
|
|
889
889
|
const v10 = {
|
|
890
890
|
attributes: v8ToV11BlockAttributes,
|
|
891
891
|
supports: v7toV11BlockSupports,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`color settings clears the selected overlay color and
|
|
3
|
+
exports[`color settings clears the selected overlay color and maintains the inner blocks 1`] = `
|
|
4
4
|
"<!-- wp:cover {"isUserOverlayColor":true,"isDark":false} -->
|
|
5
5
|
<div class="wp-block-cover is-light"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…"} -->
|
|
6
6
|
<p class="has-text-align-center"></p>
|
package/src/cover/test/edit.js
CHANGED
|
@@ -48,7 +48,7 @@ async function setup( attributes, useCoreBlocks, customSettings ) {
|
|
|
48
48
|
async function createAndSelectBlock() {
|
|
49
49
|
await userEvent.click(
|
|
50
50
|
screen.getByRole( 'option', {
|
|
51
|
-
name: '
|
|
51
|
+
name: 'Black',
|
|
52
52
|
} )
|
|
53
53
|
);
|
|
54
54
|
await userEvent.click(
|
|
@@ -73,7 +73,7 @@ describe( 'Cover block', () => {
|
|
|
73
73
|
test( 'can set overlay color using color picker on block placeholder', async () => {
|
|
74
74
|
const { container } = await setup();
|
|
75
75
|
const colorPicker = screen.getByRole( 'option', {
|
|
76
|
-
name: '
|
|
76
|
+
name: 'Black',
|
|
77
77
|
} );
|
|
78
78
|
await userEvent.click( colorPicker );
|
|
79
79
|
const color = colorPicker.style.backgroundColor;
|
|
@@ -97,7 +97,7 @@ describe( 'Cover block', () => {
|
|
|
97
97
|
|
|
98
98
|
await userEvent.click(
|
|
99
99
|
screen.getByRole( 'option', {
|
|
100
|
-
name: '
|
|
100
|
+
name: 'Black',
|
|
101
101
|
} )
|
|
102
102
|
);
|
|
103
103
|
|
|
@@ -390,7 +390,7 @@ describe( 'Cover block', () => {
|
|
|
390
390
|
test( 'should toggle is-light class if background changed from light to dark', async () => {
|
|
391
391
|
await setup();
|
|
392
392
|
const colorPicker = screen.getByRole( 'option', {
|
|
393
|
-
name: '
|
|
393
|
+
name: 'White',
|
|
394
394
|
} );
|
|
395
395
|
await userEvent.click( colorPicker );
|
|
396
396
|
|
|
@@ -406,7 +406,7 @@ describe( 'Cover block', () => {
|
|
|
406
406
|
);
|
|
407
407
|
await userEvent.click( screen.getByText( 'Overlay' ) );
|
|
408
408
|
const popupColorPicker = screen.getByRole( 'option', {
|
|
409
|
-
name: '
|
|
409
|
+
name: 'Black',
|
|
410
410
|
} );
|
|
411
411
|
await userEvent.click( popupColorPicker );
|
|
412
412
|
expect( coverBlock ).not.toHaveClass( 'is-light' );
|
|
@@ -414,7 +414,7 @@ describe( 'Cover block', () => {
|
|
|
414
414
|
test( 'should remove is-light class if overlay color is removed', async () => {
|
|
415
415
|
await setup();
|
|
416
416
|
const colorPicker = screen.getByRole( 'option', {
|
|
417
|
-
name: '
|
|
417
|
+
name: 'White',
|
|
418
418
|
} );
|
|
419
419
|
await userEvent.click( colorPicker );
|
|
420
420
|
const coverBlock = screen.getByLabelText( 'Block: Cover' );
|
|
@@ -429,7 +429,7 @@ describe( 'Cover block', () => {
|
|
|
429
429
|
// The default color is black, so clicking the black color option will remove the background color,
|
|
430
430
|
// which should remove the isDark setting and assign the is-light class.
|
|
431
431
|
const popupColorPicker = screen.getByRole( 'option', {
|
|
432
|
-
name: '
|
|
432
|
+
name: 'White',
|
|
433
433
|
} );
|
|
434
434
|
await userEvent.click( popupColorPicker );
|
|
435
435
|
expect( coverBlock ).not.toHaveClass( 'is-light' );
|
|
@@ -101,7 +101,7 @@ const attributes = {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
beforeAll( () => {
|
|
104
|
-
// Mock Image.getSize to avoid failed attempt to size non-
|
|
104
|
+
// Mock Image.getSize to avoid failed attempt to size non-existent image.
|
|
105
105
|
const getSizeSpy = jest.spyOn( Image, 'getSize' );
|
|
106
106
|
getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) );
|
|
107
107
|
|
|
@@ -541,7 +541,7 @@ describe( 'color settings', () => {
|
|
|
541
541
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
542
542
|
} );
|
|
543
543
|
|
|
544
|
-
it( 'clears the selected overlay color and
|
|
544
|
+
it( 'clears the selected overlay color and maintains the inner blocks', async () => {
|
|
545
545
|
const screen = await initializeEditor( {
|
|
546
546
|
initialHtml: COVER_BLOCK_SOLID_COLOR_HTML,
|
|
547
547
|
} );
|
|
@@ -23,16 +23,16 @@ const initialHtmlWithVideo = `
|
|
|
23
23
|
<!-- /wp:paragraph --></div></div>
|
|
24
24
|
<!-- /wp:cover -->`;
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
|
|
27
27
|
const blockTransformsWithImage = [
|
|
28
28
|
'Image',
|
|
29
29
|
'Media & Text',
|
|
30
|
-
...
|
|
30
|
+
...transformsWithInnerBlocks,
|
|
31
31
|
];
|
|
32
32
|
const blockTransformsWithVideo = [
|
|
33
33
|
'Video',
|
|
34
34
|
'Media & Text',
|
|
35
|
-
...
|
|
35
|
+
...transformsWithInnerBlocks,
|
|
36
36
|
];
|
|
37
37
|
|
|
38
38
|
setupCoreBlocks();
|
|
@@ -52,7 +52,9 @@ describe( `${ block } block transformations`, () => {
|
|
|
52
52
|
{
|
|
53
53
|
isMediaBlock: true,
|
|
54
54
|
hasInnerBlocks:
|
|
55
|
-
|
|
55
|
+
transformsWithInnerBlocks.includes(
|
|
56
|
+
blockTransform
|
|
57
|
+
),
|
|
56
58
|
}
|
|
57
59
|
);
|
|
58
60
|
expect( newBlock ).toBeVisible();
|
|
@@ -88,7 +90,9 @@ describe( `${ block } block transformations`, () => {
|
|
|
88
90
|
{
|
|
89
91
|
isMediaBlock: true,
|
|
90
92
|
hasInnerBlocks:
|
|
91
|
-
|
|
93
|
+
transformsWithInnerBlocks.includes(
|
|
94
|
+
blockTransform
|
|
95
|
+
),
|
|
92
96
|
}
|
|
93
97
|
);
|
|
94
98
|
expect( newBlock ).toBeVisible();
|
package/src/details/block.json
CHANGED
package/src/details/edit.js
CHANGED
|
@@ -5,16 +5,15 @@ import {
|
|
|
5
5
|
RichText,
|
|
6
6
|
useBlockProps,
|
|
7
7
|
useInnerBlocksProps,
|
|
8
|
-
store as blockEditorStore,
|
|
9
8
|
InspectorControls,
|
|
10
9
|
} from '@wordpress/block-editor';
|
|
11
|
-
import { useSelect } from '@wordpress/data';
|
|
12
10
|
import {
|
|
13
11
|
ToggleControl,
|
|
14
12
|
__experimentalToolsPanel as ToolsPanel,
|
|
15
13
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
16
14
|
} from '@wordpress/components';
|
|
17
15
|
import { __ } from '@wordpress/i18n';
|
|
16
|
+
import { useState } from '@wordpress/element';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Internal dependencies
|
|
@@ -30,29 +29,17 @@ const TEMPLATE = [
|
|
|
30
29
|
],
|
|
31
30
|
];
|
|
32
31
|
|
|
33
|
-
function DetailsEdit( { attributes, setAttributes
|
|
34
|
-
const { showContent, summary } = attributes;
|
|
32
|
+
function DetailsEdit( { attributes, setAttributes } ) {
|
|
33
|
+
const { showContent, summary, allowedBlocks } = attributes;
|
|
35
34
|
const blockProps = useBlockProps();
|
|
36
35
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
37
36
|
template: TEMPLATE,
|
|
38
37
|
__experimentalCaptureToolbars: true,
|
|
38
|
+
allowedBlocks,
|
|
39
39
|
} );
|
|
40
|
+
const [ isOpen, setIsOpen ] = useState( showContent );
|
|
40
41
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
41
42
|
|
|
42
|
-
// Check if either the block or the inner blocks are selected.
|
|
43
|
-
const hasSelection = useSelect(
|
|
44
|
-
( select ) => {
|
|
45
|
-
const { isBlockSelected, hasSelectedInnerBlock } =
|
|
46
|
-
select( blockEditorStore );
|
|
47
|
-
/* Sets deep to true to also find blocks inside the details content block. */
|
|
48
|
-
return (
|
|
49
|
-
hasSelectedInnerBlock( clientId, true ) ||
|
|
50
|
-
isBlockSelected( clientId )
|
|
51
|
-
);
|
|
52
|
-
},
|
|
53
|
-
[ clientId ]
|
|
54
|
-
);
|
|
55
|
-
|
|
56
43
|
return (
|
|
57
44
|
<>
|
|
58
45
|
<InspectorControls>
|
|
@@ -88,11 +75,13 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
|
|
|
88
75
|
</ToolsPanelItem>
|
|
89
76
|
</ToolsPanel>
|
|
90
77
|
</InspectorControls>
|
|
91
|
-
<details
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
78
|
+
<details { ...innerBlocksProps } open={ isOpen }>
|
|
79
|
+
<summary
|
|
80
|
+
onClick={ ( event ) => {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
setIsOpen( ! isOpen );
|
|
83
|
+
} }
|
|
84
|
+
>
|
|
96
85
|
<RichText
|
|
97
86
|
identifier="summary"
|
|
98
87
|
aria-label={ __( 'Write summary' ) }
|
package/src/editor.scss
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
// Font sizes (not used now, kept because of backward compatibility).
|
|
66
66
|
//
|
|
67
67
|
// The reason we add the editor class wrapper here is
|
|
68
|
-
// to avoid
|
|
68
|
+
// to avoid enqueuing the classes twice: here and in ./editor.scss
|
|
69
69
|
:where(.editor-styles-wrapper) .has-regular-font-size {
|
|
70
70
|
font-size: 16px;
|
|
71
71
|
}
|
package/src/embed/test/index.js
CHANGED
|
@@ -69,7 +69,7 @@ describe( 'utils', () => {
|
|
|
69
69
|
expect( getClassNames( html, '', false ) ).toEqual( expected );
|
|
70
70
|
} );
|
|
71
71
|
|
|
72
|
-
it( 'should preserve
|
|
72
|
+
it( 'should preserve existing class names when removing responsive classes', () => {
|
|
73
73
|
const html = '<iframe height="9" width="16"></iframe>';
|
|
74
74
|
const expected = 'lovely';
|
|
75
75
|
expect(
|
package/src/embed/util.js
CHANGED
|
@@ -42,7 +42,7 @@ export const getEmbedInfoByProvider = ( provider ) =>
|
|
|
42
42
|
* Returns true if any of the regular expressions match the URL.
|
|
43
43
|
*
|
|
44
44
|
* @param {string} url The URL to test.
|
|
45
|
-
* @param {Array} patterns The list of regular expressions to test
|
|
45
|
+
* @param {Array} patterns The list of regular expressions to test against.
|
|
46
46
|
* @return {boolean} True if any of the regular expressions match the URL.
|
|
47
47
|
*/
|
|
48
48
|
export const matchesPatterns = ( url, patterns = [] ) =>
|
package/src/file/edit.js
CHANGED
|
@@ -255,11 +255,12 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
255
255
|
<div { ...blockProps }>
|
|
256
256
|
{ displayPreviewInEditor && (
|
|
257
257
|
<ResizableBox
|
|
258
|
-
size={ { height: previewHeight } }
|
|
258
|
+
size={ { height: previewHeight, width: '100%' } }
|
|
259
259
|
minHeight={ MIN_PREVIEW_HEIGHT }
|
|
260
260
|
maxHeight={ MAX_PREVIEW_HEIGHT }
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
// The horizontal grid value must be 1 or else the width may snap during a
|
|
262
|
+
// resize even though only vertical resizing is enabled.
|
|
263
|
+
grid={ [ 1, 10 ] }
|
|
263
264
|
enable={ {
|
|
264
265
|
top: false,
|
|
265
266
|
right: false,
|
|
@@ -15,8 +15,8 @@ const initialHtml = `
|
|
|
15
15
|
<div class="wp-block-file"><a href="https://wordpress.org/latest.zip">WordPress.zip</a><a href="https://wordpress.org/latest.zip" class="wp-block-file__button wp-element-button" download>Download</a></div>
|
|
16
16
|
<!-- /wp:file -->`;
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
const blockTransforms = [ ...
|
|
18
|
+
const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
|
|
19
|
+
const blockTransforms = [ ...transformsWithInnerBlocks ];
|
|
20
20
|
|
|
21
21
|
setupCoreBlocks();
|
|
22
22
|
|
|
@@ -25,7 +25,8 @@ describe( `${ block } block transformations`, () => {
|
|
|
25
25
|
const screen = await initializeEditor( { initialHtml } );
|
|
26
26
|
const newBlock = await transformBlock( screen, block, blockTransform, {
|
|
27
27
|
isMediaBlock: false,
|
|
28
|
-
hasInnerBlocks:
|
|
28
|
+
hasInnerBlocks:
|
|
29
|
+
transformsWithInnerBlocks.includes( blockTransform ),
|
|
29
30
|
} );
|
|
30
31
|
expect( newBlock ).toBeVisible();
|
|
31
32
|
expect( getEditorHtml() ).toMatchSnapshot();
|
package/src/file/transforms.js
CHANGED
|
@@ -14,7 +14,7 @@ const transforms = {
|
|
|
14
14
|
isMatch( files ) {
|
|
15
15
|
return files.length > 0;
|
|
16
16
|
},
|
|
17
|
-
// We define a lower
|
|
17
|
+
// We define a lower priority (higher number) than the default of 10. This
|
|
18
18
|
// ensures that the File block is only created as a fallback.
|
|
19
19
|
priority: 15,
|
|
20
20
|
transform: ( files ) => {
|
package/src/file/utils/index.js
CHANGED
package/src/form-input/edit.js
CHANGED
|
@@ -77,7 +77,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
77
77
|
} );
|
|
78
78
|
} }
|
|
79
79
|
help={ __(
|
|
80
|
-
'Affects the "name"
|
|
80
|
+
'Affects the "name" attribute of the input element, and is used as a name for the form submission results.'
|
|
81
81
|
) }
|
|
82
82
|
/>
|
|
83
83
|
</InspectorControls>
|
package/src/freeform/editor.scss
CHANGED
|
@@ -240,12 +240,13 @@
|
|
|
240
240
|
|
|
241
241
|
div[data-type="core/freeform"] {
|
|
242
242
|
&::before {
|
|
243
|
-
transition: border-color 0.1s linear, box-shadow 0.1s linear;
|
|
244
|
-
@include reduce-motion("transition");
|
|
245
243
|
border: $border-width solid $gray-300;
|
|
246
|
-
|
|
247
244
|
// Windows High Contrast mode will show this outline.
|
|
248
245
|
outline: $border-width solid transparent;
|
|
246
|
+
|
|
247
|
+
@media not (prefers-reduced-motion) {
|
|
248
|
+
transition: border-color 0.1s linear, box-shadow 0.1s linear;
|
|
249
|
+
}
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
&.is-selected::before {
|
package/src/gallery/edit.js
CHANGED
|
@@ -80,7 +80,7 @@ const LINK_OPTIONS = [
|
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
icon: fullscreen,
|
|
83
|
-
label: __( '
|
|
83
|
+
label: __( 'Enlarge on click' ),
|
|
84
84
|
value: LINK_DESTINATION_LIGHTBOX,
|
|
85
85
|
noticeText: __( 'Lightbox effect' ),
|
|
86
86
|
infoText: __( 'Scale images with a lightbox effect' ),
|
package/src/gallery/editor.scss
CHANGED
|
@@ -137,12 +137,14 @@
|
|
|
137
137
|
top: -2px;
|
|
138
138
|
margin: $grid-unit-10;
|
|
139
139
|
z-index: z-index(".block-library-gallery-item__inline-menu");
|
|
140
|
-
transition: box-shadow 0.2s ease-out;
|
|
141
|
-
@include reduce-motion("transition");
|
|
142
140
|
border-radius: $radius-small;
|
|
143
141
|
background: $white;
|
|
144
142
|
border: $border-width solid $gray-900;
|
|
145
143
|
|
|
144
|
+
@media not (prefers-reduced-motion) {
|
|
145
|
+
transition: box-shadow 0.2s ease-out;
|
|
146
|
+
}
|
|
147
|
+
|
|
146
148
|
&:hover {
|
|
147
149
|
box-shadow: $elevation-x-small;
|
|
148
150
|
}
|
|
@@ -25,8 +25,8 @@ const initialHtml = `
|
|
|
25
25
|
<!-- /wp:image --></figure>
|
|
26
26
|
<!-- /wp:gallery -->`;
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
const blockTransforms = [ 'Image', ...
|
|
28
|
+
const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
|
|
29
|
+
const blockTransforms = [ 'Image', ...transformsWithInnerBlocks ];
|
|
30
30
|
|
|
31
31
|
setupCoreBlocks();
|
|
32
32
|
|
|
@@ -35,7 +35,8 @@ describe( `${ block } block transformations`, () => {
|
|
|
35
35
|
const screen = await initializeEditor( { initialHtml } );
|
|
36
36
|
const newBlock = await transformBlock( screen, block, blockTransform, {
|
|
37
37
|
isMediaBlock: true,
|
|
38
|
-
hasInnerBlocks:
|
|
38
|
+
hasInnerBlocks:
|
|
39
|
+
transformsWithInnerBlocks.includes( blockTransform ),
|
|
39
40
|
} );
|
|
40
41
|
expect( newBlock ).toBeVisible();
|
|
41
42
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
@@ -25,7 +25,7 @@ const parseShortcodeIds = ( ids ) => {
|
|
|
25
25
|
/**
|
|
26
26
|
* Third party block plugins don't have an easy way to detect if the
|
|
27
27
|
* innerBlocks version of the Gallery is running when they run a
|
|
28
|
-
* 3rdPartyBlock -> GalleryBlock transform so this
|
|
28
|
+
* 3rdPartyBlock -> GalleryBlock transform so this transform filter
|
|
29
29
|
* will handle this. Once the innerBlocks version is the default
|
|
30
30
|
* in a core release, this could be deprecated and removed after
|
|
31
31
|
* plugin authors have been given time to update transforms.
|
|
@@ -189,7 +189,7 @@ const transforms = {
|
|
|
189
189
|
// When created by drag and dropping multiple files on an insertion point. Because multiple
|
|
190
190
|
// files must not be transformed to a gallery when dropped within a gallery there is another transform
|
|
191
191
|
// within the image block to handle that case. Therefore this transform has to have priority 1
|
|
192
|
-
// set so that it
|
|
192
|
+
// set so that it overrides the image block transformation when multiple images are dropped outside
|
|
193
193
|
// of a gallery block.
|
|
194
194
|
type: 'files',
|
|
195
195
|
priority: 1,
|