@wordpress/block-library 8.18.0 → 8.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 +2 -0
- package/README.md +1 -1
- package/build/block/edit.js +53 -2
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +7 -4
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +11 -2
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +10 -4
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.js +12 -3
- package/build/buttons/edit.js.map +1 -1
- package/build/code/edit.js +8 -2
- package/build/code/edit.js.map +1 -1
- package/build/code/index.js +7 -1
- package/build/code/index.js.map +1 -1
- package/build/column/edit.native.js +5 -5
- package/build/column/edit.native.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/index.js +2 -0
- package/build/columns/index.js.map +1 -1
- package/build/file/edit.native.js +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/index.js +2 -1
- package/build/file/index.js.map +1 -1
- package/build/file/utils/index.js +1 -15
- package/build/file/utils/index.js.map +1 -1
- package/build/file/view.js +14 -1
- package/build/file/view.js.map +1 -1
- package/build/footnotes/edit.js +14 -5
- package/build/footnotes/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/group/edit.js +0 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +5 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/edit.js +0 -1
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +2 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +3 -6
- package/build/heading/transforms.js.map +1 -1
- package/build/image/deprecated.js +191 -7
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +27 -12
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +75 -40
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -4
- package/build/image/index.js.map +1 -1
- package/build/image/{view-interactivity.js → view.js} +1 -1
- package/build/image/view.js.map +1 -0
- package/build/list/deprecated.js +93 -1
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +10 -10
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +10 -10
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +4 -2
- package/build/list/save.js.map +1 -1
- package/build/list/utils.js +21 -2
- package/build/list/utils.js.map +1 -1
- package/build/navigation/constants.js +1 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/index.js +4 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view.js +168 -82
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +3 -9
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/transforms.js +24 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/page-list/edit.js +2 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +10 -2
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +5 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-content/edit.js +8 -7
- 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/post-featured-image/overlay.js +2 -1
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-terms/use-post-terms.js +3 -2
- package/build/post-terms/use-post-terms.js.map +1 -1
- package/build/preformatted/edit.js +4 -1
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -7
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +56 -0
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -0
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +42 -0
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
- package/build/query/edit/inspector-controls/index.js +8 -25
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +8 -2
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/utils.js +19 -0
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js +4 -5
- package/build/query/view.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/search/view.js +81 -150
- package/build/search/view.js.map +1 -1
- package/build/social-link/edit.native.js +3 -1
- package/build/social-link/edit.native.js.map +1 -1
- package/build/table/edit.js +7 -7
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -130
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js +145 -0
- package/build/table-of-contents/hooks.js.map +1 -0
- package/build/table-of-contents/index.js +2 -1
- package/build/table-of-contents/index.js.map +1 -1
- package/build/verse/edit.js +4 -1
- package/build/verse/edit.js.map +1 -1
- package/build/verse/index.js +1 -1
- package/build/verse/index.js.map +1 -1
- package/build-module/block/edit.js +54 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +7 -4
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +11 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +10 -4
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/edit.js +12 -3
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/code/edit.js +8 -2
- package/build-module/code/edit.js.map +1 -1
- package/build-module/code/index.js +7 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/edit.native.js +5 -5
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/index.js +2 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/file/edit.native.js +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/index.js +2 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/utils/index.js +0 -13
- package/build-module/file/utils/index.js.map +1 -1
- package/build-module/file/view.js +14 -2
- package/build-module/file/view.js.map +1 -1
- package/build-module/footnotes/edit.js +14 -5
- package/build-module/footnotes/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/group/edit.js +0 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +5 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/edit.js +0 -1
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +2 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +3 -6
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +191 -7
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +27 -12
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +77 -42
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -4
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/{view-interactivity.js → view.js} +1 -1
- package/build-module/image/view.js.map +1 -0
- package/build-module/list/deprecated.js +95 -3
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +10 -10
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +10 -10
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list/save.js +4 -2
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/utils.js +20 -2
- package/build-module/list/utils.js.map +1 -1
- package/build-module/navigation/constants.js +1 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/index.js +4 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view.js +168 -83
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +3 -9
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/transforms.js +24 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/page-list/edit.js +2 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +10 -2
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +5 -3
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-content/edit.js +8 -7
- 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/post-featured-image/overlay.js +2 -1
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-terms/use-post-terms.js +3 -2
- package/build-module/post-terms/use-post-terms.js.map +1 -1
- package/build-module/preformatted/edit.js +4 -1
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/index.js +1 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +6 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +50 -0
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -0
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +35 -0
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/index.js +9 -26
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +8 -2
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/utils.js +17 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js +4 -5
- package/build-module/query/view.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/search/view.js +81 -151
- package/build-module/search/view.js.map +1 -1
- package/build-module/social-link/edit.native.js +3 -1
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/table/edit.js +7 -7
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +3 -131
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js +137 -0
- package/build-module/table-of-contents/hooks.js.map +1 -0
- package/build-module/table-of-contents/index.js +2 -1
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/verse/edit.js +4 -1
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/index.js +1 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-style/cover/style-rtl.css +9 -0
- package/build-style/cover/style.css +9 -0
- package/build-style/editor-rtl.css +15 -9
- package/build-style/editor.css +15 -9
- package/build-style/file/style-rtl.css +5 -0
- package/build-style/file/style.css +5 -0
- package/build-style/heading/style-rtl.css +13 -0
- package/build-style/heading/style.css +13 -0
- package/build-style/navigation-link/editor-rtl.css +0 -9
- package/build-style/navigation-link/editor.css +0 -9
- package/build-style/paragraph/editor-rtl.css +5 -0
- package/build-style/paragraph/editor.css +5 -0
- package/build-style/paragraph/style-rtl.css +5 -0
- package/build-style/paragraph/style.css +5 -0
- package/build-style/post-navigation-link/style-rtl.css +3 -0
- package/build-style/post-navigation-link/style.css +3 -0
- package/build-style/query/editor-rtl.css +10 -0
- package/build-style/query/editor.css +10 -0
- package/build-style/query/style-rtl.css +1 -1
- package/build-style/query/style.css +1 -1
- package/build-style/reset-rtl.css +27 -27
- package/build-style/reset.css +27 -27
- package/build-style/style-rtl.css +35 -0
- package/build-style/style.css +35 -0
- package/package.json +32 -33
- package/src/audio/test/__snapshots__/edit.native.js.snap +78 -106
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +58 -2
- package/src/block/test/edit.native.js +2 -3
- package/src/button/block.json +11 -2
- package/src/button/edit.js +27 -11
- package/src/button/save.js +10 -4
- package/src/buttons/edit.js +13 -3
- package/src/buttons/test/edit.native.js +28 -24
- package/src/calendar/index.php +2 -2
- package/src/code/block.json +2 -1
- package/src/code/edit.js +13 -1
- package/src/code/index.js +5 -0
- package/src/column/block.json +1 -0
- package/src/column/edit.native.js +4 -4
- package/src/columns/block.json +2 -0
- package/src/columns/test/__snapshots__/edit.native.js.snap +14 -0
- package/src/columns/test/edit.native.js +47 -17
- package/src/comment-template/index.php +1 -1
- package/src/comments-pagination-next/index.php +1 -1
- package/src/comments-pagination-previous/index.php +1 -1
- package/src/cover/style.scss +12 -1
- package/src/cover/test/edit.js +7 -7
- package/src/cover/test/edit.native.js +18 -27
- package/src/embed/test/index.native.js +30 -45
- package/src/file/block.json +2 -1
- package/src/file/edit.native.js +1 -1
- package/src/file/index.php +19 -21
- package/src/file/style.scss +6 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +162 -218
- package/src/file/utils/index.js +0 -15
- package/src/file/view.js +14 -5
- package/src/footnotes/edit.js +16 -2
- package/src/gallery/edit.js +1 -1
- package/src/gallery/index.php +1 -1
- package/src/group/block.json +5 -0
- package/src/group/edit.js +0 -1
- package/src/heading/block.json +2 -0
- package/src/heading/edit.js +0 -1
- package/src/heading/style.scss +4 -0
- package/src/heading/transforms.js +1 -6
- package/src/image/block.json +7 -4
- package/src/image/deprecated.js +210 -7
- package/src/image/edit.js +43 -29
- package/src/image/image.js +86 -43
- package/src/image/index.php +251 -28
- package/src/latest-posts/index.php +1 -1
- package/src/list/deprecated.js +84 -3
- package/src/list/edit.js +6 -3
- package/src/list/ordered-list-settings.js +20 -5
- package/src/list/save.js +10 -1
- package/src/list/test/edit.native.js +2 -4
- package/src/list/utils.js +22 -1
- package/src/navigation/block.json +4 -2
- package/src/navigation/constants.js +1 -0
- package/src/navigation/index.php +85 -123
- package/src/navigation/view.js +192 -96
- package/src/navigation-link/edit.js +21 -36
- package/src/navigation-link/editor.scss +0 -8
- package/src/navigation-link/transforms.js +22 -0
- package/src/page-list/edit.js +2 -1
- package/src/paragraph/editor.scss +5 -0
- package/src/paragraph/style.scss +5 -0
- package/src/pattern/index.php +2 -2
- package/src/post-comments-form/edit.js +10 -0
- package/src/post-comments-form/form.js +7 -1
- package/src/post-content/block.json +3 -0
- package/src/post-content/edit.js +14 -6
- package/src/post-excerpt/index.php +2 -2
- package/src/post-featured-image/index.php +2 -2
- package/src/post-featured-image/overlay.js +1 -0
- package/src/post-navigation-link/index.php +5 -1
- package/src/post-navigation-link/style.scss +4 -0
- package/src/post-template/index.php +1 -1
- package/src/post-terms/index.php +5 -2
- package/src/post-terms/use-post-terms.js +4 -2
- package/src/preformatted/edit.js +5 -0
- package/src/preformatted/index.js +1 -1
- package/src/pullquote/deprecated.js +8 -13
- package/src/query/edit/enhanced-pagination-modal.js +65 -0
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +49 -0
- package/src/query/edit/inspector-controls/index.js +9 -45
- package/src/query/edit/query-content.js +8 -0
- package/src/query/editor.scss +10 -0
- package/src/query/index.php +29 -16
- package/src/query/style.scss +2 -2
- package/src/query/utils.js +22 -0
- package/src/query/view.js +5 -5
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
- package/src/reset.scss +1 -1
- package/src/search/block.json +1 -0
- package/src/search/index.php +45 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +265 -363
- package/src/search/view.js +70 -169
- package/src/social-link/edit.native.js +1 -1
- package/src/social-link/editor.native.scss +4 -0
- package/src/table/edit.js +21 -19
- package/src/table-of-contents/block.json +2 -1
- package/src/table-of-contents/edit.js +5 -162
- package/src/table-of-contents/hooks.js +156 -0
- package/src/verse/edit.js +5 -0
- package/src/verse/index.js +1 -1
- package/src/verse/test/edit.native.js +2 -3
- package/build/file/view-interactivity.js +0 -22
- package/build/file/view-interactivity.js.map +0 -1
- package/build/image/view-interactivity.js.map +0 -1
- package/build/navigation/view-interactivity.js +0 -172
- package/build/navigation/view-interactivity.js.map +0 -1
- package/build/navigation/view-modal.js +0 -115
- package/build/navigation/view-modal.js.map +0 -1
- package/build-module/file/view-interactivity.js +0 -18
- package/build-module/file/view-interactivity.js.map +0 -1
- package/build-module/image/view-interactivity.js.map +0 -1
- package/build-module/navigation/view-interactivity.js +0 -169
- package/build-module/navigation/view-interactivity.js.map +0 -1
- package/build-module/navigation/view-modal.js +0 -112
- package/build-module/navigation/view-modal.js.map +0 -1
- package/src/file/view-interactivity.js +0 -18
- package/src/navigation/view-interactivity.js +0 -196
- package/src/navigation/view-modal.js +0 -127
- /package/src/image/{view-interactivity.js → view.js} +0 -0
package/build-style/style.css
CHANGED
|
@@ -904,6 +904,15 @@
|
|
|
904
904
|
.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,
|
|
905
905
|
.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container {
|
|
906
906
|
margin: 0;
|
|
907
|
+
}
|
|
908
|
+
.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container, .wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container, .wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container, .wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container, .wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container, .wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,
|
|
909
|
+
.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,
|
|
910
|
+
.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container,
|
|
911
|
+
.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,
|
|
912
|
+
.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,
|
|
913
|
+
.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,
|
|
914
|
+
.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container {
|
|
915
|
+
margin: 0;
|
|
907
916
|
width: auto;
|
|
908
917
|
}
|
|
909
918
|
.wp-block-cover-image .wp-block-cover__image-background,
|
|
@@ -1135,6 +1144,11 @@ section.wp-block-cover-image > h2,
|
|
|
1135
1144
|
margin-bottom: 1em;
|
|
1136
1145
|
}
|
|
1137
1146
|
|
|
1147
|
+
@media (max-width: 768px) {
|
|
1148
|
+
.wp-block-file__embed {
|
|
1149
|
+
display: none;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1138
1152
|
:where(.wp-block-file__button) {
|
|
1139
1153
|
border-radius: 2em;
|
|
1140
1154
|
padding: 0.5em 1em;
|
|
@@ -1479,6 +1493,19 @@ h5.has-background,
|
|
|
1479
1493
|
h6.has-background {
|
|
1480
1494
|
padding: 1.25em 2.375em;
|
|
1481
1495
|
}
|
|
1496
|
+
h1.has-text-align-right[style*=writing-mode]:where([style*="vertical-rl"]), h1.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]),
|
|
1497
|
+
h2.has-text-align-right[style*=writing-mode]:where([style*="vertical-rl"]),
|
|
1498
|
+
h2.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]),
|
|
1499
|
+
h3.has-text-align-right[style*=writing-mode]:where([style*="vertical-rl"]),
|
|
1500
|
+
h3.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]),
|
|
1501
|
+
h4.has-text-align-right[style*=writing-mode]:where([style*="vertical-rl"]),
|
|
1502
|
+
h4.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]),
|
|
1503
|
+
h5.has-text-align-right[style*=writing-mode]:where([style*="vertical-rl"]),
|
|
1504
|
+
h5.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]),
|
|
1505
|
+
h6.has-text-align-right[style*=writing-mode]:where([style*="vertical-rl"]),
|
|
1506
|
+
h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
1507
|
+
rotate: 180deg;
|
|
1508
|
+
}
|
|
1482
1509
|
|
|
1483
1510
|
.wp-block-image img {
|
|
1484
1511
|
height: auto;
|
|
@@ -2633,6 +2660,11 @@ p.has-background {
|
|
|
2633
2660
|
color: inherit;
|
|
2634
2661
|
}
|
|
2635
2662
|
|
|
2663
|
+
p.has-text-align-right[style*="writing-mode:vertical-rl"],
|
|
2664
|
+
p.has-text-align-left[style*="writing-mode:vertical-lr"] {
|
|
2665
|
+
rotate: 180deg;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2636
2668
|
.wp-block-post-author {
|
|
2637
2669
|
display: flex;
|
|
2638
2670
|
flex-wrap: wrap;
|
|
@@ -2824,6 +2856,9 @@ p.has-background {
|
|
|
2824
2856
|
.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-next:not(.is-arrow-chevron) {
|
|
2825
2857
|
transform: scaleX(1) /*rtl:scaleX(-1);*/;
|
|
2826
2858
|
}
|
|
2859
|
+
.wp-block-post-navigation-link.has-text-align-right[style*="writing-mode: vertical-rl"], .wp-block-post-navigation-link.has-text-align-left[style*="writing-mode: vertical-lr"] {
|
|
2860
|
+
rotate: 180deg;
|
|
2861
|
+
}
|
|
2827
2862
|
|
|
2828
2863
|
.wp-block-post-terms {
|
|
2829
2864
|
box-sizing: border-box;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.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,36 +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": "^12.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^25.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^9.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/escape-html": "^2.
|
|
49
|
-
"@wordpress/hooks": "^3.
|
|
50
|
-
"@wordpress/html-entities": "^3.
|
|
51
|
-
"@wordpress/i18n": "^4.
|
|
52
|
-
"@wordpress/icons": "^9.
|
|
53
|
-
"@wordpress/interactivity": "^2.
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/primitives": "^3.
|
|
57
|
-
"@wordpress/private-apis": "^0.
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.
|
|
59
|
-
"@wordpress/rich-text": "^6.
|
|
60
|
-
"@wordpress/server-side-render": "^4.
|
|
61
|
-
"@wordpress/url": "^3.
|
|
62
|
-
"@wordpress/viewport": "^5.
|
|
63
|
-
"@wordpress/wordcount": "^3.
|
|
34
|
+
"@wordpress/a11y": "^3.42.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.39.0",
|
|
36
|
+
"@wordpress/autop": "^3.42.0",
|
|
37
|
+
"@wordpress/blob": "^3.42.0",
|
|
38
|
+
"@wordpress/block-editor": "^12.10.0",
|
|
39
|
+
"@wordpress/blocks": "^12.19.0",
|
|
40
|
+
"@wordpress/components": "^25.8.0",
|
|
41
|
+
"@wordpress/compose": "^6.19.0",
|
|
42
|
+
"@wordpress/core-data": "^6.19.0",
|
|
43
|
+
"@wordpress/data": "^9.12.0",
|
|
44
|
+
"@wordpress/date": "^4.42.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.42.0",
|
|
46
|
+
"@wordpress/dom": "^3.42.0",
|
|
47
|
+
"@wordpress/element": "^5.19.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.42.0",
|
|
49
|
+
"@wordpress/hooks": "^3.42.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.42.0",
|
|
51
|
+
"@wordpress/i18n": "^4.42.0",
|
|
52
|
+
"@wordpress/icons": "^9.33.0",
|
|
53
|
+
"@wordpress/interactivity": "^2.3.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.42.0",
|
|
55
|
+
"@wordpress/notices": "^4.10.0",
|
|
56
|
+
"@wordpress/primitives": "^3.40.0",
|
|
57
|
+
"@wordpress/private-apis": "^0.24.0",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.19.0",
|
|
59
|
+
"@wordpress/rich-text": "^6.19.0",
|
|
60
|
+
"@wordpress/server-side-render": "^4.19.0",
|
|
61
|
+
"@wordpress/url": "^3.43.0",
|
|
62
|
+
"@wordpress/viewport": "^5.19.0",
|
|
63
|
+
"@wordpress/wordcount": "^3.42.0",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"fast-average-color": "^9.1.1",
|
|
69
69
|
"fast-deep-equal": "^3.1.3",
|
|
70
70
|
"memize": "^2.1.0",
|
|
71
|
-
"micromodal": "^0.4.10",
|
|
72
71
|
"remove-accents": "^0.5.0",
|
|
73
72
|
"uuid": "^8.3.0"
|
|
74
73
|
},
|
|
@@ -79,5 +78,5 @@
|
|
|
79
78
|
"publishConfig": {
|
|
80
79
|
"access": "public"
|
|
81
80
|
},
|
|
82
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "cc35f517ed017ab7131319af3e87c359e8de175d"
|
|
83
82
|
}
|
|
@@ -133,7 +133,7 @@ exports[`Audio block renders audio block error state without crashing 1`] = `
|
|
|
133
133
|
]
|
|
134
134
|
}
|
|
135
135
|
>
|
|
136
|
-
<
|
|
136
|
+
<RCTAztecView
|
|
137
137
|
accessibilityState={
|
|
138
138
|
{
|
|
139
139
|
"busy": undefined,
|
|
@@ -143,73 +143,59 @@ exports[`Audio block renders audio block error state without crashing 1`] = `
|
|
|
143
143
|
"selected": undefined,
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
accessible={true}
|
|
147
|
+
activeFormats={[]}
|
|
148
|
+
blockType={
|
|
147
149
|
{
|
|
148
|
-
"
|
|
149
|
-
"min": undefined,
|
|
150
|
-
"now": undefined,
|
|
151
|
-
"text": undefined,
|
|
150
|
+
"tag": "p",
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
deleteEnter={true}
|
|
154
|
+
disableEditingMenu={false}
|
|
156
155
|
focusable={true}
|
|
156
|
+
fontFamily="serif"
|
|
157
|
+
fontSize={14}
|
|
158
|
+
isMultiline={false}
|
|
159
|
+
maxImagesWidth={200}
|
|
160
|
+
onBackspace={[Function]}
|
|
157
161
|
onBlur={[Function]}
|
|
162
|
+
onChange={[Function]}
|
|
158
163
|
onClick={[Function]}
|
|
164
|
+
onContentSizeChange={[Function]}
|
|
165
|
+
onEnter={[Function]}
|
|
159
166
|
onFocus={[Function]}
|
|
167
|
+
onHTMLContentWithCursor={[Function]}
|
|
168
|
+
onKeyDown={[Function]}
|
|
169
|
+
onPaste={[Function]}
|
|
160
170
|
onResponderGrant={[Function]}
|
|
161
171
|
onResponderMove={[Function]}
|
|
162
172
|
onResponderRelease={[Function]}
|
|
163
173
|
onResponderTerminate={[Function]}
|
|
164
174
|
onResponderTerminationRequest={[Function]}
|
|
175
|
+
onSelectionChange={[Function]}
|
|
165
176
|
onStartShouldSetResponder={[Function]}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
deleteEnter={true}
|
|
175
|
-
disableEditingMenu={false}
|
|
176
|
-
fontFamily="serif"
|
|
177
|
-
fontSize={14}
|
|
178
|
-
isMultiline={false}
|
|
179
|
-
maxImagesWidth={200}
|
|
180
|
-
onBackspace={[Function]}
|
|
181
|
-
onBlur={[Function]}
|
|
182
|
-
onChange={[Function]}
|
|
183
|
-
onContentSizeChange={[Function]}
|
|
184
|
-
onEnter={[Function]}
|
|
185
|
-
onFocus={[Function]}
|
|
186
|
-
onHTMLContentWithCursor={[Function]}
|
|
187
|
-
onKeyDown={[Function]}
|
|
188
|
-
onPaste={[Function]}
|
|
189
|
-
onSelectionChange={[Function]}
|
|
190
|
-
placeholder="Add caption"
|
|
191
|
-
placeholderTextColor="gray"
|
|
192
|
-
selectionColor="black"
|
|
193
|
-
style={
|
|
194
|
-
{
|
|
195
|
-
"backgroundColor": undefined,
|
|
196
|
-
"maxWidth": undefined,
|
|
197
|
-
"minHeight": 0,
|
|
198
|
-
}
|
|
177
|
+
placeholder="Add caption"
|
|
178
|
+
placeholderTextColor="gray"
|
|
179
|
+
selectionColor="black"
|
|
180
|
+
style={
|
|
181
|
+
{
|
|
182
|
+
"backgroundColor": undefined,
|
|
183
|
+
"maxWidth": undefined,
|
|
184
|
+
"minHeight": 0,
|
|
199
185
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
186
|
+
}
|
|
187
|
+
text={
|
|
188
|
+
{
|
|
189
|
+
"eventCount": undefined,
|
|
190
|
+
"linkTextColor": undefined,
|
|
191
|
+
"selection": null,
|
|
192
|
+
"tag": "p",
|
|
193
|
+
"text": "",
|
|
208
194
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
195
|
+
}
|
|
196
|
+
textAlign="center"
|
|
197
|
+
triggerKeyCodes={[]}
|
|
198
|
+
/>
|
|
213
199
|
</View>
|
|
214
200
|
</View>
|
|
215
201
|
</View>
|
|
@@ -373,7 +359,7 @@ exports[`Audio block renders audio file without crashing 1`] = `
|
|
|
373
359
|
]
|
|
374
360
|
}
|
|
375
361
|
>
|
|
376
|
-
<
|
|
362
|
+
<RCTAztecView
|
|
377
363
|
accessibilityState={
|
|
378
364
|
{
|
|
379
365
|
"busy": undefined,
|
|
@@ -383,73 +369,59 @@ exports[`Audio block renders audio file without crashing 1`] = `
|
|
|
383
369
|
"selected": undefined,
|
|
384
370
|
}
|
|
385
371
|
}
|
|
386
|
-
|
|
372
|
+
accessible={true}
|
|
373
|
+
activeFormats={[]}
|
|
374
|
+
blockType={
|
|
387
375
|
{
|
|
388
|
-
"
|
|
389
|
-
"min": undefined,
|
|
390
|
-
"now": undefined,
|
|
391
|
-
"text": undefined,
|
|
376
|
+
"tag": "p",
|
|
392
377
|
}
|
|
393
378
|
}
|
|
394
|
-
|
|
395
|
-
|
|
379
|
+
deleteEnter={true}
|
|
380
|
+
disableEditingMenu={false}
|
|
396
381
|
focusable={true}
|
|
382
|
+
fontFamily="serif"
|
|
383
|
+
fontSize={14}
|
|
384
|
+
isMultiline={false}
|
|
385
|
+
maxImagesWidth={200}
|
|
386
|
+
onBackspace={[Function]}
|
|
397
387
|
onBlur={[Function]}
|
|
388
|
+
onChange={[Function]}
|
|
398
389
|
onClick={[Function]}
|
|
390
|
+
onContentSizeChange={[Function]}
|
|
391
|
+
onEnter={[Function]}
|
|
399
392
|
onFocus={[Function]}
|
|
393
|
+
onHTMLContentWithCursor={[Function]}
|
|
394
|
+
onKeyDown={[Function]}
|
|
395
|
+
onPaste={[Function]}
|
|
400
396
|
onResponderGrant={[Function]}
|
|
401
397
|
onResponderMove={[Function]}
|
|
402
398
|
onResponderRelease={[Function]}
|
|
403
399
|
onResponderTerminate={[Function]}
|
|
404
400
|
onResponderTerminationRequest={[Function]}
|
|
401
|
+
onSelectionChange={[Function]}
|
|
405
402
|
onStartShouldSetResponder={[Function]}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
deleteEnter={true}
|
|
415
|
-
disableEditingMenu={false}
|
|
416
|
-
fontFamily="serif"
|
|
417
|
-
fontSize={14}
|
|
418
|
-
isMultiline={false}
|
|
419
|
-
maxImagesWidth={200}
|
|
420
|
-
onBackspace={[Function]}
|
|
421
|
-
onBlur={[Function]}
|
|
422
|
-
onChange={[Function]}
|
|
423
|
-
onContentSizeChange={[Function]}
|
|
424
|
-
onEnter={[Function]}
|
|
425
|
-
onFocus={[Function]}
|
|
426
|
-
onHTMLContentWithCursor={[Function]}
|
|
427
|
-
onKeyDown={[Function]}
|
|
428
|
-
onPaste={[Function]}
|
|
429
|
-
onSelectionChange={[Function]}
|
|
430
|
-
placeholder="Add caption"
|
|
431
|
-
placeholderTextColor="gray"
|
|
432
|
-
selectionColor="black"
|
|
433
|
-
style={
|
|
434
|
-
{
|
|
435
|
-
"backgroundColor": undefined,
|
|
436
|
-
"maxWidth": undefined,
|
|
437
|
-
"minHeight": 0,
|
|
438
|
-
}
|
|
403
|
+
placeholder="Add caption"
|
|
404
|
+
placeholderTextColor="gray"
|
|
405
|
+
selectionColor="black"
|
|
406
|
+
style={
|
|
407
|
+
{
|
|
408
|
+
"backgroundColor": undefined,
|
|
409
|
+
"maxWidth": undefined,
|
|
410
|
+
"minHeight": 0,
|
|
439
411
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
412
|
+
}
|
|
413
|
+
text={
|
|
414
|
+
{
|
|
415
|
+
"eventCount": undefined,
|
|
416
|
+
"linkTextColor": undefined,
|
|
417
|
+
"selection": null,
|
|
418
|
+
"tag": "p",
|
|
419
|
+
"text": "",
|
|
448
420
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
421
|
+
}
|
|
422
|
+
textAlign="center"
|
|
423
|
+
triggerKeyCodes={[]}
|
|
424
|
+
/>
|
|
453
425
|
</View>
|
|
454
426
|
</View>
|
|
455
427
|
</View>
|
package/src/avatar/index.php
CHANGED
|
@@ -112,12 +112,12 @@ function get_block_core_avatar_border_attributes( $attributes ) {
|
|
|
112
112
|
|
|
113
113
|
// Border color.
|
|
114
114
|
$preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
|
|
115
|
-
$custom_color =
|
|
115
|
+
$custom_color = $attributes['style']['border']['color'] ?? null;
|
|
116
116
|
$border_styles['color'] = $preset_color ? $preset_color : $custom_color;
|
|
117
117
|
|
|
118
118
|
// Individual border styles e.g. top, left etc.
|
|
119
119
|
foreach ( $sides as $side ) {
|
|
120
|
-
$border =
|
|
120
|
+
$border = $attributes['style']['border'][ $side ] ?? null;
|
|
121
121
|
$border_styles[ $side ] = array(
|
|
122
122
|
'color' => isset( $border['color'] ) ? $border['color'] : null,
|
|
123
123
|
'style' => isset( $border['style'] ) ? $border['style'] : null,
|
package/src/block/edit.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -21,9 +26,52 @@ import {
|
|
|
21
26
|
InspectorControls,
|
|
22
27
|
useBlockProps,
|
|
23
28
|
Warning,
|
|
29
|
+
privateApis as blockEditorPrivateApis,
|
|
24
30
|
} from '@wordpress/block-editor';
|
|
31
|
+
import { useRef, useMemo } from '@wordpress/element';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Internal dependencies
|
|
35
|
+
*/
|
|
36
|
+
import { unlock } from '../lock-unlock';
|
|
37
|
+
|
|
38
|
+
const fullAlignments = [ 'full', 'wide', 'left', 'right' ];
|
|
39
|
+
|
|
40
|
+
const useInferredLayout = ( blocks, parentLayout ) => {
|
|
41
|
+
const initialInferredAlignmentRef = useRef();
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
return useMemo( () => {
|
|
44
|
+
// Exit early if the pattern's blocks haven't loaded yet.
|
|
45
|
+
if ( ! blocks?.length ) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let alignment = initialInferredAlignmentRef.current;
|
|
50
|
+
|
|
51
|
+
// Only track the initial alignment so that temporarily removed
|
|
52
|
+
// alignments can be reapplied.
|
|
53
|
+
if ( alignment === undefined ) {
|
|
54
|
+
const isConstrained = parentLayout?.type === 'constrained';
|
|
55
|
+
const hasFullAlignment = blocks.some( ( block ) =>
|
|
56
|
+
fullAlignments.includes( block.attributes.align )
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
alignment = isConstrained && hasFullAlignment ? 'full' : null;
|
|
60
|
+
initialInferredAlignmentRef.current = alignment;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const layout = alignment ? parentLayout : undefined;
|
|
64
|
+
|
|
65
|
+
return { alignment, layout };
|
|
66
|
+
}, [ blocks, parentLayout ] );
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default function ReusableBlockEdit( {
|
|
70
|
+
name,
|
|
71
|
+
attributes: { ref },
|
|
72
|
+
__unstableParentLayout: parentLayout,
|
|
73
|
+
} ) {
|
|
74
|
+
const { useLayoutClasses } = unlock( blockEditorPrivateApis );
|
|
27
75
|
const hasAlreadyRendered = useHasRecursion( ref );
|
|
28
76
|
const { record, hasResolved } = useEntityRecord(
|
|
29
77
|
'postType',
|
|
@@ -45,12 +93,20 @@ export default function ReusableBlockEdit( { attributes: { ref } } ) {
|
|
|
45
93
|
ref
|
|
46
94
|
);
|
|
47
95
|
|
|
96
|
+
const { alignment, layout } = useInferredLayout( blocks, parentLayout );
|
|
97
|
+
const layoutClasses = useLayoutClasses( { layout }, name );
|
|
98
|
+
|
|
48
99
|
const blockProps = useBlockProps( {
|
|
49
|
-
className:
|
|
100
|
+
className: classnames(
|
|
101
|
+
'block-library-block__reusable-block-container',
|
|
102
|
+
layout && layoutClasses,
|
|
103
|
+
{ [ `align${ alignment }` ]: alignment }
|
|
104
|
+
),
|
|
50
105
|
} );
|
|
51
106
|
|
|
52
107
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
53
108
|
value: blocks,
|
|
109
|
+
layout,
|
|
54
110
|
onInput,
|
|
55
111
|
onChange,
|
|
56
112
|
renderAppender: blocks?.length
|
|
@@ -165,9 +165,8 @@ describe( 'Synced patterns', () => {
|
|
|
165
165
|
/Pattern Block\. Row 1/
|
|
166
166
|
);
|
|
167
167
|
|
|
168
|
-
const innerBlockListWrapper =
|
|
169
|
-
reusableBlock
|
|
170
|
-
).findByTestId( 'block-list-wrapper' );
|
|
168
|
+
const innerBlockListWrapper =
|
|
169
|
+
await within( reusableBlock ).findByTestId( 'block-list-wrapper' );
|
|
171
170
|
|
|
172
171
|
// onLayout event has to be explicitly dispatched in BlockList component,
|
|
173
172
|
// otherwise the inner blocks are not rendered.
|
package/src/button/block.json
CHANGED
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
"keywords": [ "link" ],
|
|
10
10
|
"textdomain": "default",
|
|
11
11
|
"attributes": {
|
|
12
|
+
"tagName": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": [ "a", "button" ],
|
|
15
|
+
"default": "a"
|
|
16
|
+
},
|
|
17
|
+
"type": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": "button"
|
|
20
|
+
},
|
|
12
21
|
"textAlign": {
|
|
13
22
|
"type": "string"
|
|
14
23
|
},
|
|
@@ -22,14 +31,14 @@
|
|
|
22
31
|
"title": {
|
|
23
32
|
"type": "string",
|
|
24
33
|
"source": "attribute",
|
|
25
|
-
"selector": "a",
|
|
34
|
+
"selector": "a,button",
|
|
26
35
|
"attribute": "title",
|
|
27
36
|
"__experimentalRole": "content"
|
|
28
37
|
},
|
|
29
38
|
"text": {
|
|
30
39
|
"type": "string",
|
|
31
40
|
"source": "html",
|
|
32
|
-
"selector": "a",
|
|
41
|
+
"selector": "a,button",
|
|
33
42
|
"__experimentalRole": "content"
|
|
34
43
|
},
|
|
35
44
|
"linkTarget": {
|
package/src/button/edit.js
CHANGED
|
@@ -78,8 +78,19 @@ function ButtonEdit( props ) {
|
|
|
78
78
|
onReplace,
|
|
79
79
|
mergeBlocks,
|
|
80
80
|
} = props;
|
|
81
|
-
const {
|
|
82
|
-
|
|
81
|
+
const {
|
|
82
|
+
tagName,
|
|
83
|
+
textAlign,
|
|
84
|
+
linkTarget,
|
|
85
|
+
placeholder,
|
|
86
|
+
rel,
|
|
87
|
+
style,
|
|
88
|
+
text,
|
|
89
|
+
url,
|
|
90
|
+
width,
|
|
91
|
+
} = attributes;
|
|
92
|
+
|
|
93
|
+
const TagName = tagName || 'a';
|
|
83
94
|
|
|
84
95
|
function onToggleOpenInNewTab( value ) {
|
|
85
96
|
const newLinkTarget = value ? '_blank' : undefined;
|
|
@@ -128,6 +139,7 @@ function ButtonEdit( props ) {
|
|
|
128
139
|
const [ isEditingURL, setIsEditingURL ] = useState( false );
|
|
129
140
|
const isURLSet = !! url;
|
|
130
141
|
const opensInNewTab = linkTarget === '_blank';
|
|
142
|
+
const isLinkTag = 'a' === TagName;
|
|
131
143
|
|
|
132
144
|
function startEditing( event ) {
|
|
133
145
|
event.preventDefault();
|
|
@@ -209,7 +221,7 @@ function ButtonEdit( props ) {
|
|
|
209
221
|
setAttributes( { textAlign: nextAlign } );
|
|
210
222
|
} }
|
|
211
223
|
/>
|
|
212
|
-
{ ! isURLSet && (
|
|
224
|
+
{ ! isURLSet && isLinkTag && (
|
|
213
225
|
<ToolbarButton
|
|
214
226
|
name="link"
|
|
215
227
|
icon={ link }
|
|
@@ -218,7 +230,7 @@ function ButtonEdit( props ) {
|
|
|
218
230
|
onClick={ startEditing }
|
|
219
231
|
/>
|
|
220
232
|
) }
|
|
221
|
-
{ isURLSet && (
|
|
233
|
+
{ isURLSet && isLinkTag && (
|
|
222
234
|
<ToolbarButton
|
|
223
235
|
name="link"
|
|
224
236
|
icon={ linkOff }
|
|
@@ -229,7 +241,7 @@ function ButtonEdit( props ) {
|
|
|
229
241
|
/>
|
|
230
242
|
) }
|
|
231
243
|
</BlockControls>
|
|
232
|
-
{ isSelected && ( isEditingURL || isURLSet ) && (
|
|
244
|
+
{ isLinkTag && isSelected && ( isEditingURL || isURLSet ) && (
|
|
233
245
|
<Popover
|
|
234
246
|
placement="bottom"
|
|
235
247
|
onClose={ () => {
|
|
@@ -268,12 +280,16 @@ function ButtonEdit( props ) {
|
|
|
268
280
|
/>
|
|
269
281
|
</InspectorControls>
|
|
270
282
|
<InspectorControls group="advanced">
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
283
|
+
{ isLinkTag && (
|
|
284
|
+
<TextControl
|
|
285
|
+
__nextHasNoMarginBottom
|
|
286
|
+
label={ __( 'Link rel' ) }
|
|
287
|
+
value={ rel || '' }
|
|
288
|
+
onChange={ ( newRel ) =>
|
|
289
|
+
setAttributes( { rel: newRel } )
|
|
290
|
+
}
|
|
291
|
+
/>
|
|
292
|
+
) }
|
|
277
293
|
</InspectorControls>
|
|
278
294
|
</>
|
|
279
295
|
);
|
package/src/button/save.js
CHANGED
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
|
|
18
18
|
export default function save( { attributes, className } ) {
|
|
19
19
|
const {
|
|
20
|
+
tagName,
|
|
21
|
+
type,
|
|
20
22
|
textAlign,
|
|
21
23
|
fontSize,
|
|
22
24
|
linkTarget,
|
|
@@ -32,6 +34,9 @@ export default function save( { attributes, className } ) {
|
|
|
32
34
|
return null;
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
const TagName = tagName || 'a';
|
|
38
|
+
const isButtonTag = 'button' === TagName;
|
|
39
|
+
const buttonType = type || 'button';
|
|
35
40
|
const borderProps = getBorderClassesAndStyles( attributes );
|
|
36
41
|
const colorProps = getColorClassesAndStyles( attributes );
|
|
37
42
|
const spacingProps = getSpacingClassesAndStyles( attributes );
|
|
@@ -65,14 +70,15 @@ export default function save( { attributes, className } ) {
|
|
|
65
70
|
return (
|
|
66
71
|
<div { ...useBlockProps.save( { className: wrapperClasses } ) }>
|
|
67
72
|
<RichText.Content
|
|
68
|
-
tagName=
|
|
73
|
+
tagName={ TagName }
|
|
74
|
+
type={ isButtonTag ? buttonType : null }
|
|
69
75
|
className={ buttonClasses }
|
|
70
|
-
href={ url }
|
|
76
|
+
href={ isButtonTag ? null : url }
|
|
71
77
|
title={ title }
|
|
72
78
|
style={ buttonStyle }
|
|
73
79
|
value={ text }
|
|
74
|
-
target={ linkTarget }
|
|
75
|
-
rel={ rel }
|
|
80
|
+
target={ isButtonTag ? null : linkTarget }
|
|
81
|
+
rel={ isButtonTag ? null : rel }
|
|
76
82
|
/>
|
|
77
83
|
</div>
|
|
78
84
|
);
|