@wordpress/block-library 7.17.0 → 7.19.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 +4 -0
- package/build/audio/edit.js +44 -4
- package/build/audio/edit.js.map +1 -1
- package/build/button/deprecated.js +16 -2
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +14 -8
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +4 -1
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +2 -0
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.native.js +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/columns/transforms.js +5 -0
- package/build/columns/transforms.js.map +1 -1
- package/build/comment-template/index.js +6 -2
- package/build/comment-template/index.js.map +1 -1
- package/build/cover/edit/index.js +3 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +3 -7
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/embed/deprecated.js +43 -4
- package/build/embed/deprecated.js.map +1 -1
- package/build/file/deprecated.js +108 -4
- package/build/file/deprecated.js.map +1 -1
- package/build/file/transforms.js +3 -9
- package/build/file/transforms.js.map +1 -1
- package/build/gallery/deprecated.js +148 -23
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/gallery.js +3 -2
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/use-image-sizes.js +2 -1
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/v1/edit.js +6 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/edit.js +105 -48
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +3 -0
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +168 -0
- package/build/group/placeholder.js.map +1 -0
- package/build/group/variations.js +3 -3
- package/build/group/variations.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +6 -9
- package/build/image/image.js.map +1 -1
- package/build/latest-comments/edit.js +2 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +5 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +13 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/index.js +13 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/utils.js +4 -8
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +2 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +5 -7
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/navigation/edit/index.js +94 -103
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/manage-menus-button.js +36 -0
- package/build/navigation/edit/manage-menus-button.js.map +1 -0
- package/build/navigation/edit/navigation-menu-selector.js +12 -5
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +2 -6
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +5 -17
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation-link/edit.js +14 -3
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -4
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +29 -10
- package/build/page-list/edit.js.map +1 -1
- package/build/post-author/edit.js +35 -20
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comments-count/index.js +4 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +4 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +4 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +14 -6
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -6
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/search/edit.js +1 -3
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +2 -2
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +21 -9
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-title/edit/index.js +20 -8
- package/build/site-title/edit/index.js.map +1 -1
- package/build/social-link/edit.js +11 -2
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +3 -0
- package/build/social-link/index.js.map +1 -1
- package/build/spacer/controls.js +3 -7
- package/build/spacer/controls.js.map +1 -1
- package/build/table/deprecated.js +282 -27
- package/build/table/deprecated.js.map +1 -1
- package/build/table/state.js +1 -1
- package/build/table/state.js.map +1 -1
- package/build/template-part/variations.js +5 -0
- package/build/template-part/variations.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -4
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build/video/deprecated.js +159 -0
- package/build/video/deprecated.js.map +1 -0
- package/build/video/edit.js +41 -5
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +3 -0
- package/build/video/index.js.map +1 -1
- package/build/video/tracks-editor.js +3 -28
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/audio/edit.js +46 -7
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/button/deprecated.js +16 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +16 -10
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +4 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -0
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/edit.native.js +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/columns/transforms.js +5 -0
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/comment-template/index.js +6 -2
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/cover/edit/index.js +3 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +4 -8
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/embed/deprecated.js +44 -5
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/file/deprecated.js +108 -4
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/transforms.js +3 -8
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/gallery/deprecated.js +147 -25
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/gallery.js +3 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +3 -2
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/v1/edit.js +7 -4
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/group/edit.js +101 -48
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +3 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +154 -0
- package/build-module/group/placeholder.js.map +1 -0
- package/build-module/group/variations.js +3 -3
- package/build-module/group/variations.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +8 -11
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-comments/edit.js +2 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +5 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +13 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/index.js +13 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/utils.js +5 -9
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +2 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +5 -6
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/navigation/edit/index.js +96 -105
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/manage-menus-button.js +26 -0
- package/build-module/navigation/edit/manage-menus-button.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-selector.js +13 -6
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +2 -6
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +7 -18
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation-link/edit.js +14 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -4
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +29 -10
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-author/edit.js +35 -21
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +4 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +4 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +4 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +14 -6
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +7 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/search/edit.js +1 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +3 -3
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +23 -11
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-title/edit/index.js +22 -10
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/social-link/edit.js +11 -2
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +3 -0
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/spacer/controls.js +4 -8
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/deprecated.js +282 -27
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/state.js +1 -1
- package/build-module/table/state.js.map +1 -1
- package/build-module/template-part/variations.js +5 -0
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +5 -5
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-module/video/deprecated.js +147 -0
- package/build-module/video/deprecated.js.map +1 -0
- package/build-module/video/edit.js +45 -9
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +2 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/tracks-editor.js +4 -29
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/button/style-rtl.css +1 -0
- package/build-style/button/style.css +1 -0
- package/build-style/comment-template/style-rtl.css +1 -0
- package/build-style/comment-template/style.css +1 -0
- package/build-style/editor-rtl.css +80 -5
- package/build-style/editor.css +80 -5
- package/build-style/group/editor-rtl.css +44 -0
- package/build-style/group/editor.css +44 -0
- package/build-style/latest-comments/style-rtl.css +1 -0
- package/build-style/latest-comments/style.css +1 -0
- package/build-style/latest-posts/style-rtl.css +3 -0
- package/build-style/latest-posts/style.css +3 -0
- package/build-style/navigation/editor-rtl.css +27 -4
- package/build-style/navigation/editor.css +27 -4
- package/build-style/navigation/style-rtl.css +13 -1
- package/build-style/navigation/style.css +13 -1
- package/build-style/navigation-link/editor-rtl.css +8 -1
- package/build-style/navigation-link/editor.css +8 -1
- package/build-style/post-comments-form/style-rtl.css +3 -0
- package/build-style/post-comments-form/style.css +3 -0
- package/build-style/query/editor-rtl.css +1 -1
- package/build-style/query/editor.css +1 -1
- package/build-style/query-pagination/style-rtl.css +1 -1
- package/build-style/query-pagination/style.css +1 -1
- package/build-style/style-rtl.css +28 -2
- package/build-style/style.css +28 -2
- package/build-style/table/editor-rtl.css +1 -0
- package/build-style/table/editor.css +1 -0
- package/build-style/table/style-rtl.css +5 -0
- package/build-style/table/style.css +5 -0
- package/build-style/table/theme-rtl.css +1 -3
- package/build-style/table/theme.css +1 -3
- package/build-style/theme-rtl.css +1 -3
- package/build-style/theme.css +1 -3
- package/package.json +29 -28
- package/src/audio/edit.js +79 -24
- package/src/avatar/index.php +1 -1
- package/src/block/test/edit.native.js +8 -8
- package/src/button/block.json +4 -1
- package/src/button/deprecated.js +18 -2
- package/src/button/edit.js +12 -10
- package/src/button/save.js +12 -2
- package/src/button/style.scss +2 -0
- package/src/buttons/edit.native.js +1 -1
- package/src/buttons/test/edit.native.js +19 -19
- package/src/columns/test/edit.native.js +32 -32
- package/src/columns/transforms.js +8 -0
- package/src/comment-template/block.json +6 -2
- package/src/comment-template/style.scss +2 -0
- package/src/cover/edit/index.js +3 -1
- package/src/cover/edit/inspector-controls.js +11 -13
- package/src/cover/test/edit.native.js +26 -26
- package/src/embed/deprecated.js +53 -26
- package/src/embed/test/index.native.js +43 -43
- package/src/file/deprecated.js +130 -2
- package/src/file/transforms.js +3 -8
- package/src/gallery/deprecated.js +129 -4
- package/src/gallery/gallery.js +2 -0
- package/src/gallery/index.php +19 -10
- package/src/gallery/test/index.native.js +11 -11
- package/src/gallery/use-image-sizes.js +3 -2
- package/src/gallery/v1/edit.js +21 -25
- package/src/group/block.json +3 -0
- package/src/group/edit.js +105 -46
- package/src/group/editor.scss +48 -0
- package/src/group/placeholder.js +187 -0
- package/src/group/test/edit.native.js +3 -3
- package/src/group/test/placeholder.js +78 -0
- package/src/group/variations.js +3 -3
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +22 -10
- package/src/image/test/edit.native.js +17 -17
- package/src/latest-comments/block.json +5 -1
- package/src/latest-comments/edit.js +1 -0
- package/src/latest-comments/style.scss +3 -0
- package/src/latest-posts/block.json +13 -0
- package/src/latest-posts/edit.js +2 -2
- package/src/latest-posts/style.scss +3 -0
- package/src/list/test/edit.native.js +36 -36
- package/src/list/utils.js +3 -11
- package/src/list-item/edit.js +1 -0
- package/src/list-item/hooks/use-outdent-list-item.js +3 -6
- package/src/missing/test/edit-integration.native.js +5 -5
- package/src/navigation/edit/index.js +186 -161
- package/src/navigation/edit/manage-menus-button.js +21 -0
- package/src/navigation/edit/navigation-menu-selector.js +20 -5
- package/src/navigation/edit/responsive-wrapper.js +2 -10
- package/src/navigation/edit/unsaved-inner-blocks.js +5 -22
- package/src/navigation/editor.scss +29 -4
- package/src/navigation/style.scss +19 -1
- package/src/navigation-link/edit.js +13 -4
- package/src/navigation-link/editor.scss +8 -0
- package/src/navigation-submenu/edit.js +7 -5
- package/src/page-list/edit.js +36 -22
- package/src/post-author/edit.js +44 -20
- package/src/post-comments-count/block.json +4 -0
- package/src/post-comments-form/block.json +4 -0
- package/src/post-comments-form/style.scss +3 -0
- package/src/post-comments-link/block.json +4 -0
- package/src/post-content/block.json +3 -0
- package/src/post-content/edit.js +8 -4
- package/src/pullquote/deprecated.js +7 -7
- package/src/query/editor.scss +1 -1
- package/src/query-pagination/style.scss +1 -1
- package/src/read-more/index.php +9 -2
- package/src/search/edit.js +1 -1
- package/src/shortcode/test/edit.native.js +5 -5
- package/src/site-logo/edit.js +3 -3
- package/src/site-tagline/edit.js +25 -18
- package/src/site-title/edit/index.js +26 -12
- package/src/social-link/block.json +3 -0
- package/src/social-link/edit.js +8 -1
- package/src/social-link/index.php +11 -7
- package/src/social-link/test/index.native.js +10 -10
- package/src/social-links/test/edit.native.js +4 -4
- package/src/spacer/controls.js +10 -12
- package/src/spacer/test/index.native.js +17 -17
- package/src/table/deprecated.js +587 -348
- package/src/table/editor.scss +1 -0
- package/src/table/state.js +1 -1
- package/src/table/style.scss +7 -0
- package/src/table/theme.scss +1 -3
- package/src/template-part/index.php +5 -0
- package/src/template-part/variations.js +4 -0
- package/src/utils/clean-empty-object.js +5 -6
- package/src/video/deprecated.js +57 -0
- package/src/video/edit.js +71 -23
- package/src/video/index.js +2 -0
- package/src/video/tracks-editor.js +12 -28
package/build-style/theme.css
CHANGED
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
.wp-block-table {
|
|
210
|
-
margin:
|
|
210
|
+
margin: 0 0 1em 0;
|
|
211
211
|
}
|
|
212
212
|
.wp-block-table thead {
|
|
213
213
|
border-bottom: 3px solid;
|
|
@@ -217,8 +217,6 @@
|
|
|
217
217
|
}
|
|
218
218
|
.wp-block-table td,
|
|
219
219
|
.wp-block-table th {
|
|
220
|
-
padding: 0.5em;
|
|
221
|
-
border: 1px solid;
|
|
222
220
|
word-break: normal;
|
|
223
221
|
}
|
|
224
222
|
.wp-block-table figcaption {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,35 +31,36 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/autop": "^3.
|
|
37
|
-
"@wordpress/blob": "^3.
|
|
38
|
-
"@wordpress/block-editor": "^10.
|
|
39
|
-
"@wordpress/blocks": "^11.
|
|
40
|
-
"@wordpress/components": "^
|
|
41
|
-
"@wordpress/compose": "^5.
|
|
42
|
-
"@wordpress/core-data": "^5.
|
|
43
|
-
"@wordpress/data": "^7.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^4.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/keycodes": "^3.
|
|
53
|
-
"@wordpress/notices": "^3.
|
|
54
|
-
"@wordpress/primitives": "^3.
|
|
55
|
-
"@wordpress/reusable-blocks": "^3.
|
|
56
|
-
"@wordpress/rich-text": "^5.
|
|
57
|
-
"@wordpress/server-side-render": "^3.
|
|
58
|
-
"@wordpress/url": "^3.
|
|
59
|
-
"@wordpress/viewport": "^4.
|
|
34
|
+
"@wordpress/a11y": "^3.22.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.19.0",
|
|
36
|
+
"@wordpress/autop": "^3.22.0",
|
|
37
|
+
"@wordpress/blob": "^3.22.0",
|
|
38
|
+
"@wordpress/block-editor": "^10.5.0",
|
|
39
|
+
"@wordpress/blocks": "^11.21.0",
|
|
40
|
+
"@wordpress/components": "^22.1.0",
|
|
41
|
+
"@wordpress/compose": "^5.20.0",
|
|
42
|
+
"@wordpress/core-data": "^5.5.0",
|
|
43
|
+
"@wordpress/data": "^7.6.0",
|
|
44
|
+
"@wordpress/date": "^4.22.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.22.0",
|
|
46
|
+
"@wordpress/dom": "^3.22.0",
|
|
47
|
+
"@wordpress/element": "^4.20.0",
|
|
48
|
+
"@wordpress/hooks": "^3.22.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.22.0",
|
|
50
|
+
"@wordpress/i18n": "^4.22.0",
|
|
51
|
+
"@wordpress/icons": "^9.13.0",
|
|
52
|
+
"@wordpress/keycodes": "^3.22.0",
|
|
53
|
+
"@wordpress/notices": "^3.22.0",
|
|
54
|
+
"@wordpress/primitives": "^3.20.0",
|
|
55
|
+
"@wordpress/reusable-blocks": "^3.20.0",
|
|
56
|
+
"@wordpress/rich-text": "^5.20.0",
|
|
57
|
+
"@wordpress/server-side-render": "^3.20.0",
|
|
58
|
+
"@wordpress/url": "^3.23.0",
|
|
59
|
+
"@wordpress/viewport": "^4.20.0",
|
|
60
60
|
"change-case": "^4.1.2",
|
|
61
61
|
"classnames": "^2.3.1",
|
|
62
62
|
"colord": "^2.7.0",
|
|
63
|
+
"escape-html": "^1.0.3",
|
|
63
64
|
"fast-average-color": "^9.1.1",
|
|
64
65
|
"lodash": "^4.17.21",
|
|
65
66
|
"memize": "^1.1.0",
|
|
@@ -73,5 +74,5 @@
|
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public"
|
|
75
76
|
},
|
|
76
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
|
|
77
78
|
}
|
package/src/audio/edit.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
SelectControl,
|
|
14
14
|
Spinner,
|
|
15
15
|
ToggleControl,
|
|
16
|
+
ToolbarButton,
|
|
16
17
|
} from '@wordpress/components';
|
|
17
18
|
import {
|
|
18
19
|
BlockControls,
|
|
@@ -25,12 +26,13 @@ import {
|
|
|
25
26
|
store as blockEditorStore,
|
|
26
27
|
__experimentalGetElementClassName,
|
|
27
28
|
} from '@wordpress/block-editor';
|
|
28
|
-
import { useEffect } from '@wordpress/element';
|
|
29
|
+
import { useEffect, useState, useCallback } from '@wordpress/element';
|
|
29
30
|
import { __, _x } from '@wordpress/i18n';
|
|
30
31
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
31
|
-
import { audio as icon } from '@wordpress/icons';
|
|
32
|
+
import { audio as icon, caption as captionIcon } from '@wordpress/icons';
|
|
32
33
|
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
33
34
|
import { store as noticesStore } from '@wordpress/notices';
|
|
35
|
+
import { usePrevious } from '@wordpress/compose';
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* Internal dependencies
|
|
@@ -48,6 +50,8 @@ function AudioEdit( {
|
|
|
48
50
|
insertBlocksAfter,
|
|
49
51
|
} ) {
|
|
50
52
|
const { id, autoplay, caption, loop, preload, src } = attributes;
|
|
53
|
+
const prevCaption = usePrevious( caption );
|
|
54
|
+
const [ showCaption, setShowCaption ] = useState( !! caption );
|
|
51
55
|
const isTemporaryAudio = ! id && isBlobURL( src );
|
|
52
56
|
const mediaUpload = useSelect( ( select ) => {
|
|
53
57
|
const { getSettings } = select( blockEditorStore );
|
|
@@ -69,6 +73,30 @@ function AudioEdit( {
|
|
|
69
73
|
}
|
|
70
74
|
}, [] );
|
|
71
75
|
|
|
76
|
+
// We need to show the caption when changes come from
|
|
77
|
+
// history navigation(undo/redo).
|
|
78
|
+
useEffect( () => {
|
|
79
|
+
if ( caption && ! prevCaption ) {
|
|
80
|
+
setShowCaption( true );
|
|
81
|
+
}
|
|
82
|
+
}, [ caption, prevCaption ] );
|
|
83
|
+
|
|
84
|
+
// Focus the caption when we click to add one.
|
|
85
|
+
const captionRef = useCallback(
|
|
86
|
+
( node ) => {
|
|
87
|
+
if ( node && ! caption ) {
|
|
88
|
+
node.focus();
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
[ caption ]
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
useEffect( () => {
|
|
95
|
+
if ( ! isSelected && ! caption ) {
|
|
96
|
+
setShowCaption( false );
|
|
97
|
+
}
|
|
98
|
+
}, [ isSelected, caption ] );
|
|
99
|
+
|
|
72
100
|
function toggleAttribute( attribute ) {
|
|
73
101
|
return ( newValue ) => {
|
|
74
102
|
setAttributes( { [ attribute ]: newValue } );
|
|
@@ -106,12 +134,20 @@ function AudioEdit( {
|
|
|
106
134
|
if ( ! media || ! media.url ) {
|
|
107
135
|
// In this case there was an error and we should continue in the editing state
|
|
108
136
|
// previous attributes should be removed because they may be temporary blob urls.
|
|
109
|
-
setAttributes( {
|
|
137
|
+
setAttributes( {
|
|
138
|
+
src: undefined,
|
|
139
|
+
id: undefined,
|
|
140
|
+
caption: undefined,
|
|
141
|
+
} );
|
|
110
142
|
return;
|
|
111
143
|
}
|
|
112
144
|
// Sets the block's attribute and updates the edit component from the
|
|
113
145
|
// selected media, then switches off the editing UI.
|
|
114
|
-
setAttributes( {
|
|
146
|
+
setAttributes( {
|
|
147
|
+
src: media.url,
|
|
148
|
+
id: media.id,
|
|
149
|
+
caption: media.caption,
|
|
150
|
+
} );
|
|
115
151
|
}
|
|
116
152
|
|
|
117
153
|
const classes = classnames( className, {
|
|
@@ -140,6 +176,23 @@ function AudioEdit( {
|
|
|
140
176
|
|
|
141
177
|
return (
|
|
142
178
|
<>
|
|
179
|
+
<BlockControls group="block">
|
|
180
|
+
<ToolbarButton
|
|
181
|
+
onClick={ () => {
|
|
182
|
+
setShowCaption( ! showCaption );
|
|
183
|
+
if ( showCaption && caption ) {
|
|
184
|
+
setAttributes( { caption: undefined } );
|
|
185
|
+
}
|
|
186
|
+
} }
|
|
187
|
+
icon={ captionIcon }
|
|
188
|
+
isPressed={ showCaption }
|
|
189
|
+
label={
|
|
190
|
+
showCaption
|
|
191
|
+
? __( 'Remove caption' )
|
|
192
|
+
: __( 'Add caption' )
|
|
193
|
+
}
|
|
194
|
+
/>
|
|
195
|
+
</BlockControls>
|
|
143
196
|
<BlockControls group="other">
|
|
144
197
|
<MediaReplaceFlow
|
|
145
198
|
mediaId={ id }
|
|
@@ -195,26 +248,28 @@ function AudioEdit( {
|
|
|
195
248
|
<audio controls="controls" src={ src } />
|
|
196
249
|
</Disabled>
|
|
197
250
|
{ isTemporaryAudio && <Spinner /> }
|
|
198
|
-
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
251
|
+
{ showCaption &&
|
|
252
|
+
( ! RichText.isEmpty( caption ) || isSelected ) && (
|
|
253
|
+
<RichText
|
|
254
|
+
tagName="figcaption"
|
|
255
|
+
className={ __experimentalGetElementClassName(
|
|
256
|
+
'caption'
|
|
257
|
+
) }
|
|
258
|
+
ref={ captionRef }
|
|
259
|
+
aria-label={ __( 'Audio caption text' ) }
|
|
260
|
+
placeholder={ __( 'Add caption' ) }
|
|
261
|
+
value={ caption }
|
|
262
|
+
onChange={ ( value ) =>
|
|
263
|
+
setAttributes( { caption: value } )
|
|
264
|
+
}
|
|
265
|
+
inlineToolbar
|
|
266
|
+
__unstableOnSplitAtEnd={ () =>
|
|
267
|
+
insertBlocksAfter(
|
|
268
|
+
createBlock( getDefaultBlockName() )
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
/>
|
|
272
|
+
) }
|
|
218
273
|
</figure>
|
|
219
274
|
</>
|
|
220
275
|
);
|
package/src/avatar/index.php
CHANGED
|
@@ -100,7 +100,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
100
100
|
$label = 'aria-label="' . sprintf( esc_attr__( '(%s author archive, opens in a new tab)' ), $author_name ) . '"';
|
|
101
101
|
}
|
|
102
102
|
// translators: %1$s: Author archive link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.
|
|
103
|
-
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
|
|
103
|
+
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
|
|
104
104
|
}
|
|
105
105
|
return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
|
|
106
106
|
}
|
|
@@ -78,14 +78,14 @@ describe( 'Reusable block', () => {
|
|
|
78
78
|
return Promise.resolve( response );
|
|
79
79
|
} );
|
|
80
80
|
|
|
81
|
-
const {
|
|
81
|
+
const { getByLabelText, getByTestId, getByText } =
|
|
82
82
|
await initializeEditor( {
|
|
83
83
|
initialHtml: '',
|
|
84
84
|
capabilities: { reusableBlock: true },
|
|
85
85
|
} );
|
|
86
86
|
|
|
87
87
|
// Open the inserter menu.
|
|
88
|
-
fireEvent.press( await waitFor( () =>
|
|
88
|
+
fireEvent.press( await waitFor( () => getByLabelText( 'Add block' ) ) );
|
|
89
89
|
|
|
90
90
|
// Navigate to reusable tab.
|
|
91
91
|
const reusableSegment = await waitFor( () => getByText( 'Reusable' ) );
|
|
@@ -116,7 +116,7 @@ describe( 'Reusable block', () => {
|
|
|
116
116
|
|
|
117
117
|
// Get the reusable block.
|
|
118
118
|
const reusableBlock = await waitFor( () =>
|
|
119
|
-
|
|
119
|
+
getByLabelText( /Reusable block Block\. Row 1/ )
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
expect( reusableBlock ).toBeDefined();
|
|
@@ -128,12 +128,12 @@ describe( 'Reusable block', () => {
|
|
|
128
128
|
const id = 3;
|
|
129
129
|
const initialHtml = `<!-- wp:block {"ref":${ id }} /-->`;
|
|
130
130
|
|
|
131
|
-
const {
|
|
131
|
+
const { getByLabelText } = await initializeEditor( {
|
|
132
132
|
initialHtml,
|
|
133
133
|
} );
|
|
134
134
|
|
|
135
135
|
const reusableBlock = await waitFor( () =>
|
|
136
|
-
|
|
136
|
+
getByLabelText( /Reusable block Block\. Row 1/ )
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
const blockDeleted = await waitFor( () =>
|
|
@@ -163,12 +163,12 @@ describe( 'Reusable block', () => {
|
|
|
163
163
|
return Promise.resolve( response );
|
|
164
164
|
} );
|
|
165
165
|
|
|
166
|
-
const {
|
|
166
|
+
const { getByLabelText } = await initializeEditor( {
|
|
167
167
|
initialHtml,
|
|
168
168
|
} );
|
|
169
169
|
|
|
170
170
|
const reusableBlock = await waitFor( () =>
|
|
171
|
-
|
|
171
|
+
getByLabelText( /Reusable block Block\. Row 1/ )
|
|
172
172
|
);
|
|
173
173
|
|
|
174
174
|
const innerBlockListWrapper = await waitFor( () =>
|
|
@@ -186,7 +186,7 @@ describe( 'Reusable block', () => {
|
|
|
186
186
|
} );
|
|
187
187
|
|
|
188
188
|
const headingInnerBlock = await waitFor( () =>
|
|
189
|
-
within( reusableBlock ).
|
|
189
|
+
within( reusableBlock ).getByLabelText(
|
|
190
190
|
'Heading Block. Row 1. Level 2. First Reusable block'
|
|
191
191
|
)
|
|
192
192
|
);
|
package/src/button/block.json
CHANGED
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"keywords": [ "link" ],
|
|
10
10
|
"textdomain": "default",
|
|
11
11
|
"attributes": {
|
|
12
|
+
"textAlign": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
12
15
|
"url": {
|
|
13
16
|
"type": "string",
|
|
14
17
|
"source": "attribute",
|
|
@@ -56,7 +59,7 @@
|
|
|
56
59
|
},
|
|
57
60
|
"supports": {
|
|
58
61
|
"anchor": true,
|
|
59
|
-
"align":
|
|
62
|
+
"align": false,
|
|
60
63
|
"alignWide": false,
|
|
61
64
|
"color": {
|
|
62
65
|
"__experimentalSkipSerialization": true,
|
package/src/button/deprecated.js
CHANGED
|
@@ -51,6 +51,20 @@ const migrateBorderRadius = ( attributes ) => {
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
function migrateAlign( attributes ) {
|
|
55
|
+
if ( ! attributes.align ) {
|
|
56
|
+
return attributes;
|
|
57
|
+
}
|
|
58
|
+
const { align, ...otherAttributes } = attributes;
|
|
59
|
+
return {
|
|
60
|
+
...otherAttributes,
|
|
61
|
+
className: classnames(
|
|
62
|
+
otherAttributes.className,
|
|
63
|
+
`align${ attributes.align }`
|
|
64
|
+
),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
54
68
|
const migrateCustomColorsAndGradients = ( attributes ) => {
|
|
55
69
|
if (
|
|
56
70
|
! attributes.customTextColor &&
|
|
@@ -780,10 +794,12 @@ const deprecated = [
|
|
|
780
794
|
isEligible: ( attributes ) =>
|
|
781
795
|
!! attributes.customTextColor ||
|
|
782
796
|
!! attributes.customBackgroundColor ||
|
|
783
|
-
!! attributes.customGradient
|
|
797
|
+
!! attributes.customGradient ||
|
|
798
|
+
!! attributes.align,
|
|
784
799
|
migrate: compose(
|
|
785
800
|
migrateBorderRadius,
|
|
786
|
-
migrateCustomColorsAndGradients
|
|
801
|
+
migrateCustomColorsAndGradients,
|
|
802
|
+
migrateAlign
|
|
787
803
|
),
|
|
788
804
|
save( { attributes } ) {
|
|
789
805
|
const {
|
package/src/button/edit.js
CHANGED
|
@@ -7,7 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import {
|
|
10
|
+
import { useEffect, useState, useRef } from '@wordpress/element';
|
|
11
11
|
import {
|
|
12
12
|
Button,
|
|
13
13
|
ButtonGroup,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
Popover,
|
|
18
18
|
} from '@wordpress/components';
|
|
19
19
|
import {
|
|
20
|
+
AlignmentControl,
|
|
20
21
|
BlockControls,
|
|
21
22
|
InspectorControls,
|
|
22
23
|
RichText,
|
|
@@ -76,14 +77,8 @@ function ButtonEdit( props ) {
|
|
|
76
77
|
onReplace,
|
|
77
78
|
mergeBlocks,
|
|
78
79
|
} = props;
|
|
79
|
-
const { linkTarget, placeholder, rel, style, text, url, width } =
|
|
80
|
+
const { textAlign, linkTarget, placeholder, rel, style, text, url, width } =
|
|
80
81
|
attributes;
|
|
81
|
-
const onSetLinkRel = useCallback(
|
|
82
|
-
( value ) => {
|
|
83
|
-
setAttributes( { rel: value } );
|
|
84
|
-
},
|
|
85
|
-
[ setAttributes ]
|
|
86
|
-
);
|
|
87
82
|
|
|
88
83
|
function onToggleOpenInNewTab( value ) {
|
|
89
84
|
const newLinkTarget = value ? '_blank' : undefined;
|
|
@@ -176,6 +171,7 @@ function ButtonEdit( props ) {
|
|
|
176
171
|
colorProps.className,
|
|
177
172
|
borderProps.className,
|
|
178
173
|
{
|
|
174
|
+
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
179
175
|
// For backwards compatibility add style that isn't
|
|
180
176
|
// provided via block support.
|
|
181
177
|
'no-border-radius': style?.border?.radius === 0,
|
|
@@ -199,6 +195,12 @@ function ButtonEdit( props ) {
|
|
|
199
195
|
/>
|
|
200
196
|
</div>
|
|
201
197
|
<BlockControls group="block">
|
|
198
|
+
<AlignmentControl
|
|
199
|
+
value={ textAlign }
|
|
200
|
+
onChange={ ( nextAlign ) => {
|
|
201
|
+
setAttributes( { textAlign: nextAlign } );
|
|
202
|
+
} }
|
|
203
|
+
/>
|
|
202
204
|
{ ! isURLSet && (
|
|
203
205
|
<ToolbarButton
|
|
204
206
|
name="link"
|
|
@@ -221,7 +223,7 @@ function ButtonEdit( props ) {
|
|
|
221
223
|
</BlockControls>
|
|
222
224
|
{ isSelected && ( isEditingURL || isURLSet ) && (
|
|
223
225
|
<Popover
|
|
224
|
-
|
|
226
|
+
placement="bottom"
|
|
225
227
|
onClose={ () => {
|
|
226
228
|
setIsEditingURL( false );
|
|
227
229
|
richTextRef.current?.focus();
|
|
@@ -262,7 +264,7 @@ function ButtonEdit( props ) {
|
|
|
262
264
|
<TextControl
|
|
263
265
|
label={ __( 'Link rel' ) }
|
|
264
266
|
value={ rel || '' }
|
|
265
|
-
onChange={
|
|
267
|
+
onChange={ ( newRel ) => setAttributes( { rel: newRel } ) }
|
|
266
268
|
/>
|
|
267
269
|
</InspectorControls>
|
|
268
270
|
</>
|
package/src/button/save.js
CHANGED
|
@@ -16,8 +16,17 @@ import {
|
|
|
16
16
|
} from '@wordpress/block-editor';
|
|
17
17
|
|
|
18
18
|
export default function save( { attributes, className } ) {
|
|
19
|
-
const {
|
|
20
|
-
|
|
19
|
+
const {
|
|
20
|
+
textAlign,
|
|
21
|
+
fontSize,
|
|
22
|
+
linkTarget,
|
|
23
|
+
rel,
|
|
24
|
+
style,
|
|
25
|
+
text,
|
|
26
|
+
title,
|
|
27
|
+
url,
|
|
28
|
+
width,
|
|
29
|
+
} = attributes;
|
|
21
30
|
|
|
22
31
|
if ( ! text ) {
|
|
23
32
|
return null;
|
|
@@ -31,6 +40,7 @@ export default function save( { attributes, className } ) {
|
|
|
31
40
|
colorProps.className,
|
|
32
41
|
borderProps.className,
|
|
33
42
|
{
|
|
43
|
+
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
34
44
|
// For backwards compatibility add style that isn't provided via
|
|
35
45
|
// block support.
|
|
36
46
|
'no-border-radius': style?.border?.radius === 0,
|
package/src/button/style.scss
CHANGED
|
@@ -113,4 +113,6 @@ $blocks-block__margin: 0.5em;
|
|
|
113
113
|
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
|
|
114
114
|
.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background) {
|
|
115
115
|
background-color: transparent;
|
|
116
|
+
// background-image is required to overwrite a gradient background
|
|
117
|
+
background-image: none;
|
|
116
118
|
}
|
|
@@ -50,12 +50,12 @@ describe( 'Buttons block', () => {
|
|
|
50
50
|
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" style="border-radius:5px" >Hello</a></div>
|
|
51
51
|
<!-- /wp:button --></div>
|
|
52
52
|
<!-- /wp:buttons -->`;
|
|
53
|
-
const {
|
|
53
|
+
const { getByLabelText } = await initializeEditor( {
|
|
54
54
|
initialHtml,
|
|
55
55
|
} );
|
|
56
56
|
|
|
57
57
|
const buttonsBlock = await waitFor( () =>
|
|
58
|
-
|
|
58
|
+
getByLabelText( /Buttons Block\. Row 1/ )
|
|
59
59
|
);
|
|
60
60
|
fireEvent.press( buttonsBlock );
|
|
61
61
|
|
|
@@ -73,17 +73,17 @@ describe( 'Buttons block', () => {
|
|
|
73
73
|
} );
|
|
74
74
|
|
|
75
75
|
const buttonInnerBlock = await waitFor( () =>
|
|
76
|
-
within( buttonsBlock ).
|
|
76
|
+
within( buttonsBlock ).getByLabelText( /Button Block\. Row 1/ )
|
|
77
77
|
);
|
|
78
78
|
fireEvent.press( buttonInnerBlock );
|
|
79
79
|
|
|
80
80
|
const settingsButton = await waitFor( () =>
|
|
81
|
-
|
|
81
|
+
getByLabelText( 'Open Settings' )
|
|
82
82
|
);
|
|
83
83
|
fireEvent.press( settingsButton );
|
|
84
84
|
|
|
85
85
|
const radiusStepper = await waitFor( () =>
|
|
86
|
-
|
|
86
|
+
getByLabelText( /Border Radius/ )
|
|
87
87
|
);
|
|
88
88
|
|
|
89
89
|
const incrementButton = await waitFor( () =>
|
|
@@ -98,7 +98,7 @@ describe( 'Buttons block', () => {
|
|
|
98
98
|
const screen = await initializeEditor( {
|
|
99
99
|
initialHtml: BUTTONS_HTML,
|
|
100
100
|
} );
|
|
101
|
-
const {
|
|
101
|
+
const { getByLabelText } = screen;
|
|
102
102
|
|
|
103
103
|
// Get block
|
|
104
104
|
const buttonsBlock = await getBlock( screen, 'Buttons' );
|
|
@@ -126,13 +126,13 @@ describe( 'Buttons block', () => {
|
|
|
126
126
|
|
|
127
127
|
// Check for new button
|
|
128
128
|
const secondButtonBlock = await waitFor( () =>
|
|
129
|
-
within( buttonsBlock ).
|
|
129
|
+
within( buttonsBlock ).getByLabelText( /Button Block\. Row 2/ )
|
|
130
130
|
);
|
|
131
131
|
expect( secondButtonBlock ).toBeVisible();
|
|
132
132
|
|
|
133
133
|
// Add a Paragraph block using the empty placeholder at the bottom
|
|
134
134
|
const paragraphPlaceholder = await waitFor( () =>
|
|
135
|
-
|
|
135
|
+
getByLabelText( 'Add paragraph block' )
|
|
136
136
|
);
|
|
137
137
|
fireEvent.press( paragraphPlaceholder );
|
|
138
138
|
|
|
@@ -149,9 +149,9 @@ describe( 'Buttons block', () => {
|
|
|
149
149
|
initialHtml: BUTTONS_HTML,
|
|
150
150
|
} );
|
|
151
151
|
const {
|
|
152
|
-
|
|
152
|
+
getByLabelText,
|
|
153
153
|
getByTestId,
|
|
154
|
-
|
|
154
|
+
queryAllByLabelText,
|
|
155
155
|
getByText,
|
|
156
156
|
} = screen;
|
|
157
157
|
|
|
@@ -176,7 +176,7 @@ describe( 'Buttons block', () => {
|
|
|
176
176
|
fireEvent.press( buttonBlock );
|
|
177
177
|
|
|
178
178
|
// Open the block inserter
|
|
179
|
-
fireEvent.press(
|
|
179
|
+
fireEvent.press( getByLabelText( 'Add block' ) );
|
|
180
180
|
|
|
181
181
|
const blockList = getByTestId( 'InserterUI-Blocks' );
|
|
182
182
|
// onScroll event used to force the FlatList to render all items
|
|
@@ -190,7 +190,7 @@ describe( 'Buttons block', () => {
|
|
|
190
190
|
|
|
191
191
|
// Check the Add block here placeholder is not visible
|
|
192
192
|
const addBlockHerePlaceholders =
|
|
193
|
-
|
|
193
|
+
queryAllByLabelText( 'ADD BLOCK HERE' );
|
|
194
194
|
expect( addBlockHerePlaceholders.length ).toBe( 0 );
|
|
195
195
|
|
|
196
196
|
// Add a new Button block
|
|
@@ -201,7 +201,7 @@ describe( 'Buttons block', () => {
|
|
|
201
201
|
rowIndex: 2,
|
|
202
202
|
} );
|
|
203
203
|
const secondButtonInput =
|
|
204
|
-
within( secondButtonBlock ).
|
|
204
|
+
within( secondButtonBlock ).getByLabelText(
|
|
205
205
|
'Text input. Empty'
|
|
206
206
|
);
|
|
207
207
|
changeTextOfRichText( secondButtonInput, 'Hello!' );
|
|
@@ -214,7 +214,7 @@ describe( 'Buttons block', () => {
|
|
|
214
214
|
const screen = await initializeEditor( {
|
|
215
215
|
initialHtml: BUTTONS_HTML,
|
|
216
216
|
} );
|
|
217
|
-
const {
|
|
217
|
+
const { getByLabelText } = screen;
|
|
218
218
|
|
|
219
219
|
// Get block
|
|
220
220
|
const buttonsBlock = await getBlock( screen, 'Buttons' );
|
|
@@ -236,13 +236,13 @@ describe( 'Buttons block', () => {
|
|
|
236
236
|
fireEvent.press( buttonBlock );
|
|
237
237
|
|
|
238
238
|
// Open block actions menu
|
|
239
|
-
const blockActionsButton =
|
|
239
|
+
const blockActionsButton = getByLabelText(
|
|
240
240
|
/Open Block Actions Menu/
|
|
241
241
|
);
|
|
242
242
|
fireEvent.press( blockActionsButton );
|
|
243
243
|
|
|
244
244
|
// Delete block
|
|
245
|
-
const deleteButton =
|
|
245
|
+
const deleteButton = getByLabelText( /Remove block/ );
|
|
246
246
|
fireEvent.press( deleteButton );
|
|
247
247
|
|
|
248
248
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
@@ -260,17 +260,17 @@ describe( 'Buttons block', () => {
|
|
|
260
260
|
const initialHtml = `<!-- wp:buttons -->
|
|
261
261
|
<div class="wp-block-buttons"><!-- wp:button /--></div>
|
|
262
262
|
<!-- /wp:buttons -->`;
|
|
263
|
-
const {
|
|
263
|
+
const { getByLabelText, getByText } = await initializeEditor( {
|
|
264
264
|
initialHtml,
|
|
265
265
|
} );
|
|
266
266
|
|
|
267
267
|
const block = await waitFor( () =>
|
|
268
|
-
|
|
268
|
+
getByLabelText( /Buttons Block\. Row 1/ )
|
|
269
269
|
);
|
|
270
270
|
fireEvent.press( block );
|
|
271
271
|
|
|
272
272
|
fireEvent.press(
|
|
273
|
-
|
|
273
|
+
getByLabelText( 'Change items justification' )
|
|
274
274
|
);
|
|
275
275
|
|
|
276
276
|
// Select alignment option.
|