@wordpress/block-library 8.9.0 → 8.11.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/block/edit.native.js +17 -10
- package/build/block/edit.native.js.map +1 -1
- package/build/code/index.js +1 -0
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +1 -1
- package/build/columns/transforms.js +1 -5
- package/build/columns/transforms.js.map +1 -1
- package/build/comment-author-name/edit.js +1 -1
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +1 -1
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +1 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +3 -3
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/index.js +1 -1
- package/build/cover/variations.js +1 -1
- package/build/cover/variations.js.map +1 -1
- package/build/details/edit.js +19 -5
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +14 -10
- package/build/details/index.js.map +1 -1
- package/build/details/save.js +4 -1
- package/build/details/save.js.map +1 -1
- package/build/embed/variations.js +2 -2
- package/build/embed/variations.js.map +1 -1
- package/build/file/interactivity.js +19 -0
- package/build/file/interactivity.js.map +1 -0
- package/build/file/{utils.js → utils/index.js} +1 -1
- package/build/file/utils/index.js.map +1 -0
- package/build/file/view.js +1 -1
- package/build/file/view.js.map +1 -1
- package/build/freeform/modal.js +20 -17
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/edit.js +2 -8
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/v1/edit.js +1 -7
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.native.js +1 -3
- package/build/gallery/v1/gallery-image.native.js.map +1 -1
- package/build/group/transforms.js +0 -5
- package/build/group/transforms.js.map +1 -1
- package/build/image/deprecated.js +2 -4
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +13 -11
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +7 -12
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +3 -0
- package/build/image/index.js.map +1 -1
- package/build/image/interactivity.js +102 -0
- package/build/image/interactivity.js.map +1 -0
- package/build/image/save.js +2 -4
- package/build/image/save.js.map +1 -1
- package/build/image/utils.js +10 -18
- package/build/image/utils.js.map +1 -1
- package/build/index.js +0 -6
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -1
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/edit.native.js +1 -3
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/edit.js +1 -1
- package/build/list/edit.js.map +1 -1
- package/build/list-item/edit.native.js +1 -1
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/transforms.js +4 -1
- package/build/list-item/transforms.js.map +1 -1
- package/build/list-item/utils.js +5 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/loginout/index.js +11 -1
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/deprecated.js +4 -6
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +13 -11
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/media-container.js +3 -3
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/save.js +1 -3
- package/build/media-text/save.js.map +1 -1
- package/build/navigation/constants.js +15 -0
- package/build/navigation/constants.js.map +1 -0
- package/build/navigation/edit/index.js +16 -26
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +5 -7
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +148 -0
- package/build/navigation/edit/leaf-more-menu.js.map +1 -0
- package/build/navigation/edit/menu-inspector-controls.js +53 -8
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +6 -6
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +12 -25
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/interactivity.js +157 -0
- package/build/navigation/interactivity.js.map +1 -0
- package/build/navigation-link/edit.js +7 -5
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/update-attributes.js +5 -5
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/edit.js +7 -5
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/paragraph/index.js +5 -1
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +5 -1
- package/build/paragraph/transforms.js.map +1 -1
- package/build/pattern/edit.js +42 -8
- package/build/pattern/edit.js.map +1 -1
- package/build/pattern/index.js +12 -5
- package/build/pattern/index.js.map +1 -1
- package/build/pattern/v1/edit.js +57 -0
- package/build/pattern/v1/edit.js.map +1 -0
- package/build/post-author-name/edit.js +1 -1
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -2
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/overlay.js +5 -0
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-title/edit.js +24 -7
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/edit.native.js +3 -2
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/quote/transforms.js +23 -37
- package/build/quote/transforms.js.map +1 -1
- package/build/read-more/edit.js +1 -1
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +9 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-title/edit/index.js +1 -1
- package/build/site-title/edit/index.js.map +1 -1
- package/build/social-link/edit.js +21 -4
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.js +2 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/template-part/edit/index.js +1 -7
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +2 -2
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/utils/interactivity/constants.js +9 -0
- package/build/utils/interactivity/constants.js.map +1 -0
- package/build/utils/interactivity/directives.js +236 -0
- package/build/utils/interactivity/directives.js.map +1 -0
- package/build/utils/interactivity/hooks.js +176 -0
- package/build/utils/interactivity/hooks.js.map +1 -0
- package/build/utils/interactivity/hydration.js +34 -0
- package/build/utils/interactivity/hydration.js.map +1 -0
- package/build/utils/interactivity/index.js +34 -0
- package/build/utils/interactivity/index.js.map +1 -0
- package/build/utils/interactivity/portals.js +108 -0
- package/build/utils/interactivity/portals.js.map +1 -0
- package/build/utils/interactivity/store.js +67 -0
- package/build/utils/interactivity/store.js.map +1 -0
- package/build/utils/interactivity/utils.js +87 -0
- package/build/utils/interactivity/utils.js.map +1 -0
- package/build/utils/interactivity/vdom.js +109 -0
- package/build/utils/interactivity/vdom.js.map +1 -0
- package/build-module/block/edit.native.js +7 -1
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/code/index.js +1 -0
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +1 -1
- package/build-module/columns/transforms.js +1 -5
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/comment-author-name/edit.js +1 -1
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +1 -1
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +3 -3
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/variations.js +1 -1
- package/build-module/cover/variations.js.map +1 -1
- package/build-module/details/edit.js +20 -6
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +14 -10
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/save.js +5 -2
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/variations.js +2 -2
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/interactivity.js +15 -0
- package/build-module/file/interactivity.js.map +1 -0
- package/build-module/file/{utils.js → utils/index.js} +1 -1
- package/build-module/file/utils/index.js.map +1 -0
- package/build-module/file/view.js +1 -1
- package/build-module/file/view.js.map +1 -1
- package/build-module/freeform/modal.js +19 -18
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/edit.js +2 -8
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/v1/edit.js +1 -6
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.native.js +1 -2
- package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
- package/build-module/group/transforms.js +0 -5
- package/build-module/group/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +2 -3
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +12 -11
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +7 -11
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +3 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/interactivity.js +99 -0
- package/build-module/image/interactivity.js.map +1 -0
- package/build-module/image/save.js +2 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/image/utils.js +10 -17
- package/build-module/image/utils.js.map +1 -1
- package/build-module/index.js +0 -4
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +1 -2
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/edit.js +1 -1
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +1 -1
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/transforms.js +5 -2
- package/build-module/list-item/transforms.js.map +1 -1
- package/build-module/list-item/utils.js +5 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/loginout/index.js +11 -1
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/deprecated.js +4 -5
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +13 -12
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/media-container.js +3 -3
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/save.js +1 -2
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/navigation/constants.js +6 -0
- package/build-module/navigation/constants.js.map +1 -0
- package/build-module/navigation/edit/index.js +18 -27
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -4
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +132 -0
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -0
- package/build-module/navigation/edit/menu-inspector-controls.js +52 -9
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +7 -7
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +9 -20
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/interactivity.js +154 -0
- package/build-module/navigation/interactivity.js.map +1 -0
- package/build-module/navigation-link/edit.js +7 -5
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +4 -4
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +7 -5
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/paragraph/index.js +5 -1
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +5 -1
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/pattern/edit.js +42 -9
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/pattern/index.js +12 -3
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/pattern/v1/edit.js +48 -0
- package/build-module/pattern/v1/edit.js.map +1 -0
- package/build-module/post-author-name/edit.js +1 -1
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -2
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +5 -0
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-title/edit.js +23 -7
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/preformatted/edit.native.js +3 -2
- package/build-module/preformatted/edit.native.js.map +1 -1
- package/build-module/quote/transforms.js +23 -37
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/read-more/edit.js +1 -1
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +9 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-title/edit/index.js +1 -1
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/social-link/edit.js +20 -5
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.js +2 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -6
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +1 -1
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/utils/interactivity/constants.js +2 -0
- package/build-module/utils/interactivity/constants.js.map +1 -0
- package/build-module/utils/interactivity/directives.js +220 -0
- package/build-module/utils/interactivity/directives.js.map +1 -0
- package/build-module/utils/interactivity/hooks.js +162 -0
- package/build-module/utils/interactivity/hooks.js.map +1 -0
- package/build-module/utils/interactivity/hydration.js +21 -0
- package/build-module/utils/interactivity/hydration.js.map +1 -0
- package/build-module/utils/interactivity/index.js +17 -0
- package/build-module/utils/interactivity/index.js.map +1 -0
- package/build-module/utils/interactivity/portals.js +100 -0
- package/build-module/utils/interactivity/portals.js.map +1 -0
- package/build-module/utils/interactivity/store.js +56 -0
- package/build-module/utils/interactivity/store.js.map +1 -0
- package/build-module/utils/interactivity/utils.js +75 -0
- package/build-module/utils/interactivity/utils.js.map +1 -0
- package/build-module/utils/interactivity/vdom.js +97 -0
- package/build-module/utils/interactivity/vdom.js.map +1 -0
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/style-rtl.css +3 -2
- package/build-style/cover/style.css +3 -2
- package/build-style/{details-summary → details}/editor-rtl.css +1 -1
- package/build-style/{details-summary → details}/editor.css +1 -1
- package/build-style/details/style-rtl.css +14 -0
- package/build-style/details/style.css +14 -0
- package/build-style/editor-rtl.css +71 -5
- package/build-style/editor.css +71 -5
- package/build-style/file/editor-rtl.css +3 -0
- package/build-style/file/editor.css +3 -0
- package/build-style/freeform/editor-rtl.css +29 -0
- package/build-style/freeform/editor.css +29 -0
- package/build-style/gallery/editor-rtl.css +0 -4
- package/build-style/gallery/editor.css +0 -4
- package/build-style/gallery/style-rtl.css +2 -4
- package/build-style/gallery/style.css +2 -4
- package/build-style/image/style-rtl.css +98 -0
- package/build-style/image/style.css +98 -0
- package/build-style/navigation/editor-rtl.css +36 -0
- package/build-style/navigation/editor.css +36 -0
- package/build-style/post-comments-form/style-rtl.css +1 -1
- package/build-style/post-comments-form/style.css +1 -1
- package/build-style/search/editor-rtl.css +1 -0
- package/build-style/search/editor.css +1 -0
- package/build-style/site-logo/editor-rtl.css +1 -0
- package/build-style/site-logo/editor.css +1 -0
- package/build-style/style-rtl.css +116 -10
- package/build-style/style.css +116 -10
- package/build-style/video/style-rtl.css +1 -2
- package/build-style/video/style.css +1 -2
- package/package.json +37 -33
- package/src/block/edit.native.js +18 -4
- package/src/buttons/test/edit.native.js +0 -9
- package/src/code/block.json +1 -0
- package/src/column/block.json +1 -1
- package/src/columns/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/columns/test/transforms.native.js +3 -5
- package/src/columns/transforms.js +2 -8
- package/src/comment-author-name/edit.js +1 -1
- package/src/comment-edit-link/edit.js +1 -1
- package/src/comment-template/index.php +8 -7
- package/src/comments/index.php +1 -6
- package/src/cover/block.json +1 -1
- package/src/cover/edit/inspector-controls.js +56 -54
- package/src/cover/edit/resizable-cover-popover.js +2 -1
- package/src/cover/style.scss +5 -0
- package/src/cover/test/edit.js +56 -2
- package/src/cover/variations.js +1 -3
- package/src/details/block.json +8 -6
- package/src/details/edit.js +27 -5
- package/src/details/editor.scss +3 -0
- package/src/details/index.js +10 -5
- package/src/details/save.js +5 -1
- package/src/details/style.scss +16 -0
- package/src/editor.scss +1 -1
- package/src/embed/variations.js +2 -2
- package/src/file/editor.scss +4 -0
- package/src/file/interactivity.js +15 -0
- package/src/file/view.js +4 -1
- package/src/freeform/editor.scss +45 -0
- package/src/freeform/modal.js +22 -19
- package/src/gallery/edit.js +5 -8
- package/src/gallery/editor.scss +0 -6
- package/src/gallery/test/index.native.js +48 -3
- package/src/gallery/v1/edit.js +1 -6
- package/src/gallery/v1/gallery-image.native.js +1 -2
- package/src/group/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/group/test/transforms.native.js +3 -5
- package/src/group/transforms.js +0 -7
- package/src/image/block.json +3 -0
- package/src/image/deprecated.js +2 -3
- package/src/image/edit.js +18 -18
- package/src/image/image.js +8 -11
- package/src/image/index.php +75 -2
- package/src/image/interactivity.js +113 -0
- package/src/image/save.js +4 -3
- package/src/image/style.scss +113 -0
- package/src/image/test/edit.native.js +38 -16
- package/src/image/utils.js +11 -18
- package/src/index.js +0 -4
- package/src/index.native.js +1 -0
- package/src/latest-posts/edit.native.js +1 -4
- package/src/list/edit.js +1 -1
- package/src/list/test/edit.native.js +80 -1
- package/src/list-item/edit.native.js +1 -1
- package/src/list-item/transforms.js +4 -2
- package/src/loginout/block.json +11 -1
- package/src/media-text/deprecated.js +4 -5
- package/src/media-text/edit.js +12 -10
- package/src/media-text/media-container.js +3 -3
- package/src/media-text/save.js +1 -2
- package/src/navigation/constants.js +21 -0
- package/src/navigation/edit/index.js +71 -83
- package/src/navigation/edit/inner-blocks.js +6 -16
- package/src/navigation/edit/leaf-more-menu.js +170 -0
- package/src/navigation/edit/menu-inspector-controls.js +78 -10
- package/src/navigation/edit/navigation-menu-delete-control.js +29 -29
- package/src/navigation/edit/unsaved-inner-blocks.js +12 -40
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/src/navigation/editor.scss +10 -0
- package/src/navigation/index.php +213 -204
- package/src/navigation/interactivity.js +151 -0
- package/src/navigation-link/edit.js +9 -3
- package/src/navigation-link/update-attributes.js +2 -2
- package/src/navigation-submenu/edit.js +9 -3
- package/src/paragraph/block.json +5 -1
- package/src/pattern/block.json +4 -0
- package/src/pattern/edit.js +53 -16
- package/src/pattern/index.js +5 -4
- package/src/pattern/index.php +14 -1
- package/src/pattern/v1/edit.js +57 -0
- package/src/post-author-name/edit.js +1 -1
- package/src/post-comments-form/style.scss +3 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-featured-image/index.php +1 -1
- package/src/post-featured-image/overlay.js +4 -0
- package/src/post-terms/index.php +2 -2
- package/src/post-title/edit.js +57 -44
- package/src/preformatted/edit.native.js +1 -3
- package/src/quote/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/quote/test/transforms.native.js +3 -5
- package/src/quote/transforms.js +9 -19
- package/src/read-more/edit.js +1 -1
- package/src/search/edit.js +9 -4
- package/src/search/editor.scss +1 -0
- package/src/site-logo/editor.scss +2 -1
- package/src/site-title/edit/index.js +1 -1
- package/src/social-link/edit.js +51 -26
- package/src/social-links/edit.js +33 -31
- package/src/style.scss +0 -1
- package/src/template-part/edit/index.js +4 -6
- package/src/template-part/edit/utils/hooks.js +1 -1
- package/src/template-part/index.php +22 -7
- package/src/utils/interactivity/constants.js +1 -0
- package/src/utils/interactivity/directives.js +200 -0
- package/src/utils/interactivity/hooks.js +145 -0
- package/src/utils/interactivity/hydration.js +22 -0
- package/src/utils/interactivity/index.js +17 -0
- package/src/utils/interactivity/portals.js +98 -0
- package/src/utils/interactivity/store.js +45 -0
- package/src/utils/interactivity/utils.js +66 -0
- package/src/utils/interactivity/vdom.js +94 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/details-content/edit.js +0 -34
- package/build/details-content/edit.js.map +0 -1
- package/build/details-content/index.js +0 -94
- package/build/details-content/index.js.map +0 -1
- package/build/details-content/save.js +0 -20
- package/build/details-content/save.js.map +0 -1
- package/build/details-summary/edit.js +0 -42
- package/build/details-summary/edit.js.map +0 -1
- package/build/details-summary/index.js +0 -97
- package/build/details-summary/index.js.map +0 -1
- package/build/details-summary/save.js +0 -24
- package/build/details-summary/save.js.map +0 -1
- package/build/file/utils.js.map +0 -1
- package/build-module/details-content/edit.js +0 -23
- package/build-module/details-content/edit.js.map +0 -1
- package/build-module/details-content/index.js +0 -76
- package/build-module/details-content/index.js.map +0 -1
- package/build-module/details-content/save.js +0 -11
- package/build-module/details-content/save.js.map +0 -1
- package/build-module/details-summary/edit.js +0 -30
- package/build-module/details-summary/edit.js.map +0 -1
- package/build-module/details-summary/index.js +0 -79
- package/build-module/details-summary/index.js.map +0 -1
- package/build-module/details-summary/save.js +0 -16
- package/build-module/details-summary/save.js.map +0 -1
- package/build-module/file/utils.js.map +0 -1
- package/build-style/details-summary/style-rtl.css +0 -91
- package/build-style/details-summary/style.css +0 -91
- package/src/details-content/block.json +0 -50
- package/src/details-content/edit.js +0 -29
- package/src/details-content/index.js +0 -23
- package/src/details-content/save.js +0 -12
- package/src/details-summary/block.json +0 -53
- package/src/details-summary/edit.js +0 -27
- package/src/details-summary/editor.scss +0 -3
- package/src/details-summary/index.js +0 -23
- package/src/details-summary/save.js +0 -13
- package/src/details-summary/style.scss +0 -3
- /package/src/file/{utils.js → utils/index.js} +0 -0
package/src/pattern/block.json
CHANGED
package/src/pattern/edit.js
CHANGED
|
@@ -1,46 +1,83 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { cloneBlock } from '@wordpress/blocks';
|
|
4
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
6
|
import { useEffect } from '@wordpress/element';
|
|
6
7
|
import {
|
|
7
8
|
store as blockEditorStore,
|
|
8
9
|
useBlockProps,
|
|
10
|
+
useInnerBlocksProps,
|
|
9
11
|
} from '@wordpress/block-editor';
|
|
10
12
|
|
|
11
13
|
const PatternEdit = ( { attributes, clientId } ) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const { slug, syncStatus } = attributes;
|
|
15
|
+
const { selectedPattern, innerBlocks } = useSelect(
|
|
16
|
+
( select ) => {
|
|
17
|
+
return {
|
|
18
|
+
selectedPattern:
|
|
19
|
+
select( blockEditorStore ).__experimentalGetParsedPattern(
|
|
20
|
+
slug
|
|
21
|
+
),
|
|
22
|
+
innerBlocks:
|
|
23
|
+
select( blockEditorStore ).getBlock( clientId )
|
|
24
|
+
?.innerBlocks,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
[ slug, clientId ]
|
|
18
28
|
);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
const {
|
|
30
|
+
replaceBlocks,
|
|
31
|
+
replaceInnerBlocks,
|
|
32
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
33
|
+
} = useDispatch( blockEditorStore );
|
|
22
34
|
|
|
23
35
|
// Run this effect when the component loads.
|
|
24
36
|
// This adds the Pattern's contents to the post.
|
|
25
|
-
// This change won't be saved.
|
|
26
|
-
// It will continue to pull from the pattern file unless changes are made to its respective template part.
|
|
27
37
|
useEffect( () => {
|
|
28
|
-
if ( selectedPattern?.blocks ) {
|
|
38
|
+
if ( selectedPattern?.blocks && ! innerBlocks?.length ) {
|
|
29
39
|
// We batch updates to block list settings to avoid triggering cascading renders
|
|
30
40
|
// for each container block included in a tree and optimize initial render.
|
|
31
41
|
// Since the above uses microtasks, we need to use a microtask here as well,
|
|
32
42
|
// because nested pattern blocks cannot be inserted if the parent block supports
|
|
33
43
|
// inner blocks but doesn't have blockSettings in the state.
|
|
34
44
|
window.queueMicrotask( () => {
|
|
45
|
+
// Clone blocks from the pattern before insertion to ensure they receive
|
|
46
|
+
// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.
|
|
47
|
+
const clonedBlocks = selectedPattern.blocks.map( ( block ) =>
|
|
48
|
+
cloneBlock( block )
|
|
49
|
+
);
|
|
35
50
|
__unstableMarkNextChangeAsNotPersistent();
|
|
36
|
-
|
|
51
|
+
if ( syncStatus === 'partial' ) {
|
|
52
|
+
replaceInnerBlocks( clientId, clonedBlocks );
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
replaceBlocks( clientId, clonedBlocks );
|
|
37
56
|
} );
|
|
38
57
|
}
|
|
39
|
-
}, [
|
|
58
|
+
}, [
|
|
59
|
+
clientId,
|
|
60
|
+
selectedPattern?.blocks,
|
|
61
|
+
replaceInnerBlocks,
|
|
62
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
63
|
+
innerBlocks,
|
|
64
|
+
syncStatus,
|
|
65
|
+
replaceBlocks,
|
|
66
|
+
] );
|
|
67
|
+
|
|
68
|
+
const blockProps = useBlockProps( {
|
|
69
|
+
className: slug?.replace( '/', '-' ),
|
|
70
|
+
} );
|
|
71
|
+
|
|
72
|
+
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
73
|
+
templateLock: syncStatus === 'partial' ? 'contentOnly' : false,
|
|
74
|
+
} );
|
|
40
75
|
|
|
41
|
-
|
|
76
|
+
if ( syncStatus !== 'partial' ) {
|
|
77
|
+
return <div { ...blockProps } />;
|
|
78
|
+
}
|
|
42
79
|
|
|
43
|
-
return <div { ...
|
|
80
|
+
return <div { ...innerBlocksProps } />;
|
|
44
81
|
};
|
|
45
82
|
|
|
46
83
|
export default PatternEdit;
|
package/src/pattern/index.js
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import initBlock from '../utils/init-block';
|
|
5
5
|
import metadata from './block.json';
|
|
6
|
-
import
|
|
6
|
+
import PatternEditV1 from './v1/edit';
|
|
7
|
+
import PatternEditV2 from './edit';
|
|
7
8
|
|
|
8
9
|
const { name } = metadata;
|
|
9
10
|
export { metadata, name };
|
|
10
11
|
|
|
11
|
-
export const settings =
|
|
12
|
-
edit:
|
|
13
|
-
};
|
|
12
|
+
export const settings = window?.__experimentalEnablePatternEnhancements
|
|
13
|
+
? { edit: PatternEditV2 }
|
|
14
|
+
: { edit: PatternEditV1 };
|
|
14
15
|
|
|
15
16
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/pattern/index.php
CHANGED
|
@@ -33,12 +33,25 @@ function render_block_core_pattern( $attributes ) {
|
|
|
33
33
|
|
|
34
34
|
$slug = $attributes['slug'];
|
|
35
35
|
$registry = WP_Block_Patterns_Registry::get_instance();
|
|
36
|
+
|
|
36
37
|
if ( ! $registry->is_registered( $slug ) ) {
|
|
37
38
|
return '';
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
$pattern = $registry->get_registered( $slug );
|
|
41
|
-
|
|
42
|
+
|
|
43
|
+
// Currently all existing blocks should be returned here without a wp-block-pattern wrapper
|
|
44
|
+
// as the syncStatus attribute is only used if the gutenberg-pattern-enhancements experiment
|
|
45
|
+
// is enabled.
|
|
46
|
+
if ( ! isset( $attributes['syncStatus'] ) ) {
|
|
47
|
+
return do_blocks( $pattern['content'] );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
$block_classnames = 'wp-block-pattern ' . str_replace( '/', '-', $attributes['slug'] );
|
|
51
|
+
$classnames = isset( $attributes['className'] ) ? $attributes['className'] . ' ' . $block_classnames : $block_classnames;
|
|
52
|
+
$wrapper = '<div class="' . esc_attr( $classnames ) . '">%s</div>';
|
|
53
|
+
|
|
54
|
+
return sprintf( $wrapper, do_blocks( $pattern['content'] ) );
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
add_action( 'init', 'register_block_core_pattern' );
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { cloneBlock } from '@wordpress/blocks';
|
|
5
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
7
|
+
import {
|
|
8
|
+
store as blockEditorStore,
|
|
9
|
+
useBlockProps,
|
|
10
|
+
} from '@wordpress/block-editor';
|
|
11
|
+
|
|
12
|
+
const PatternEdit = ( { attributes, clientId } ) => {
|
|
13
|
+
const selectedPattern = useSelect(
|
|
14
|
+
( select ) =>
|
|
15
|
+
select( blockEditorStore ).__experimentalGetParsedPattern(
|
|
16
|
+
attributes.slug
|
|
17
|
+
),
|
|
18
|
+
[ attributes.slug ]
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const { replaceBlocks, __unstableMarkNextChangeAsNotPersistent } =
|
|
22
|
+
useDispatch( blockEditorStore );
|
|
23
|
+
|
|
24
|
+
// Run this effect when the component loads.
|
|
25
|
+
// This adds the Pattern's contents to the post.
|
|
26
|
+
// This change won't be saved.
|
|
27
|
+
// It will continue to pull from the pattern file unless changes are made to its respective template part.
|
|
28
|
+
useEffect( () => {
|
|
29
|
+
if ( selectedPattern?.blocks ) {
|
|
30
|
+
// We batch updates to block list settings to avoid triggering cascading renders
|
|
31
|
+
// for each container block included in a tree and optimize initial render.
|
|
32
|
+
// Since the above uses microtasks, we need to use a microtask here as well,
|
|
33
|
+
// because nested pattern blocks cannot be inserted if the parent block supports
|
|
34
|
+
// inner blocks but doesn't have blockSettings in the state.
|
|
35
|
+
window.queueMicrotask( () => {
|
|
36
|
+
// Clone blocks from the pattern before insertion to ensure they receive
|
|
37
|
+
// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.
|
|
38
|
+
const clonedBlocks = selectedPattern.blocks.map( ( block ) =>
|
|
39
|
+
cloneBlock( block )
|
|
40
|
+
);
|
|
41
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
42
|
+
replaceBlocks( clientId, clonedBlocks );
|
|
43
|
+
} );
|
|
44
|
+
}
|
|
45
|
+
}, [
|
|
46
|
+
clientId,
|
|
47
|
+
selectedPattern?.blocks,
|
|
48
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
49
|
+
replaceBlocks,
|
|
50
|
+
] );
|
|
51
|
+
|
|
52
|
+
const props = useBlockProps();
|
|
53
|
+
|
|
54
|
+
return <div { ...props } />;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default PatternEdit;
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
|
|
46
46
|
.comment-form {
|
|
47
47
|
textarea,
|
|
48
|
-
|
|
48
|
+
// Make sure to not set display block on hidden input fields, to prevent
|
|
49
|
+
// the Safari bug experienced in https://github.com/WordPress/gutenberg/issues/50830
|
|
50
|
+
input:not([type="submit"]):not([type="checkbox"]):not([type="hidden"]) {
|
|
49
51
|
display: block;
|
|
50
52
|
box-sizing: border-box;
|
|
51
53
|
width: 100%;
|
|
@@ -97,7 +97,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
97
97
|
} ) );
|
|
98
98
|
|
|
99
99
|
const blockProps = useBlockProps( {
|
|
100
|
-
style: { width, height, aspectRatio
|
|
100
|
+
style: { width, height, aspectRatio },
|
|
101
101
|
} );
|
|
102
102
|
const borderProps = useBorderProps( attributes );
|
|
103
103
|
|
|
@@ -92,7 +92,7 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
92
92
|
if ( ! $height && ! $width && ! $aspect_ratio ) {
|
|
93
93
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
94
94
|
} else {
|
|
95
|
-
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height
|
|
95
|
+
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) );
|
|
96
96
|
}
|
|
97
97
|
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
|
98
98
|
}
|
package/src/post-terms/index.php
CHANGED
|
@@ -64,8 +64,8 @@ function render_block_core_post_terms( $attributes, $content, $block ) {
|
|
|
64
64
|
function register_block_core_post_terms() {
|
|
65
65
|
$taxonomies = get_taxonomies(
|
|
66
66
|
array(
|
|
67
|
-
'
|
|
68
|
-
'show_in_rest'
|
|
67
|
+
'publicly_queryable' => true,
|
|
68
|
+
'show_in_rest' => true,
|
|
69
69
|
),
|
|
70
70
|
'objects'
|
|
71
71
|
);
|
package/src/post-title/edit.js
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
16
|
import { ToggleControl, TextControl, PanelBody } from '@wordpress/components';
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
18
19
|
import { useEntityProp } from '@wordpress/core-data';
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -27,10 +28,21 @@ export default function PostTitleEdit( {
|
|
|
27
28
|
attributes: { level, textAlign, isLink, rel, linkTarget },
|
|
28
29
|
setAttributes,
|
|
29
30
|
context: { postType, postId, queryId },
|
|
31
|
+
insertBlocksAfter,
|
|
30
32
|
} ) {
|
|
31
33
|
const TagName = 0 === level ? 'p' : 'h' + level;
|
|
32
34
|
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
33
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Hack: useCanEditEntity may trigger an OPTIONS request to the REST API via the canUser resolver.
|
|
37
|
+
* However, when the Post Title is a descendant of a Query Loop block, the title cannot be edited.
|
|
38
|
+
* In order to avoid these unnecessary requests, we call the hook without
|
|
39
|
+
* the proper data, resulting in returning early without making them.
|
|
40
|
+
*/
|
|
41
|
+
const userCanEdit = useCanEditEntity(
|
|
42
|
+
'postType',
|
|
43
|
+
! isDescendentOfQueryLoop && postType,
|
|
44
|
+
postId
|
|
45
|
+
);
|
|
34
46
|
const [ rawTitle = '', setTitle, fullTitle ] = useEntityProp(
|
|
35
47
|
'postType',
|
|
36
48
|
postType,
|
|
@@ -38,6 +50,9 @@ export default function PostTitleEdit( {
|
|
|
38
50
|
postId
|
|
39
51
|
);
|
|
40
52
|
const [ link ] = useEntityProp( 'postType', postType, 'link', postId );
|
|
53
|
+
const onSplitAtEnd = () => {
|
|
54
|
+
insertBlocksAfter( createBlock( getDefaultBlockName() ) );
|
|
55
|
+
};
|
|
41
56
|
const blockProps = useBlockProps( {
|
|
42
57
|
className: classnames( {
|
|
43
58
|
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
@@ -49,54 +64,52 @@ export default function PostTitleEdit( {
|
|
|
49
64
|
);
|
|
50
65
|
|
|
51
66
|
if ( postType && postId ) {
|
|
52
|
-
titleElement =
|
|
53
|
-
|
|
67
|
+
titleElement = userCanEdit ? (
|
|
68
|
+
<PlainText
|
|
69
|
+
tagName={ TagName }
|
|
70
|
+
placeholder={ __( 'No Title' ) }
|
|
71
|
+
value={ rawTitle }
|
|
72
|
+
onChange={ setTitle }
|
|
73
|
+
__experimentalVersion={ 2 }
|
|
74
|
+
__unstableOnSplitAtEnd={ onSplitAtEnd }
|
|
75
|
+
{ ...blockProps }
|
|
76
|
+
/>
|
|
77
|
+
) : (
|
|
78
|
+
<TagName
|
|
79
|
+
{ ...blockProps }
|
|
80
|
+
dangerouslySetInnerHTML={ { __html: fullTitle?.rendered } }
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if ( isLink && postType && postId ) {
|
|
86
|
+
titleElement = userCanEdit ? (
|
|
87
|
+
<TagName { ...blockProps }>
|
|
54
88
|
<PlainText
|
|
55
|
-
tagName=
|
|
56
|
-
|
|
89
|
+
tagName="a"
|
|
90
|
+
href={ link }
|
|
91
|
+
target={ linkTarget }
|
|
92
|
+
rel={ rel }
|
|
93
|
+
placeholder={ ! rawTitle.length ? __( 'No Title' ) : null }
|
|
57
94
|
value={ rawTitle }
|
|
58
95
|
onChange={ setTitle }
|
|
59
96
|
__experimentalVersion={ 2 }
|
|
60
|
-
{
|
|
97
|
+
__unstableOnSplitAtEnd={ onSplitAtEnd }
|
|
61
98
|
/>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
99
|
+
</TagName>
|
|
100
|
+
) : (
|
|
101
|
+
<TagName { ...blockProps }>
|
|
102
|
+
<a
|
|
103
|
+
href={ link }
|
|
104
|
+
target={ linkTarget }
|
|
105
|
+
rel={ rel }
|
|
106
|
+
onClick={ ( event ) => event.preventDefault() }
|
|
107
|
+
dangerouslySetInnerHTML={ {
|
|
108
|
+
__html: fullTitle?.rendered,
|
|
109
|
+
} }
|
|
66
110
|
/>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if ( isLink && postType && postId ) {
|
|
71
|
-
titleElement =
|
|
72
|
-
userCanEdit && ! isDescendentOfQueryLoop ? (
|
|
73
|
-
<TagName { ...blockProps }>
|
|
74
|
-
<PlainText
|
|
75
|
-
tagName="a"
|
|
76
|
-
href={ link }
|
|
77
|
-
target={ linkTarget }
|
|
78
|
-
rel={ rel }
|
|
79
|
-
placeholder={
|
|
80
|
-
! rawTitle.length ? __( 'No Title' ) : null
|
|
81
|
-
}
|
|
82
|
-
value={ rawTitle }
|
|
83
|
-
onChange={ setTitle }
|
|
84
|
-
__experimentalVersion={ 2 }
|
|
85
|
-
/>
|
|
86
|
-
</TagName>
|
|
87
|
-
) : (
|
|
88
|
-
<TagName { ...blockProps }>
|
|
89
|
-
<a
|
|
90
|
-
href={ link }
|
|
91
|
-
target={ linkTarget }
|
|
92
|
-
rel={ rel }
|
|
93
|
-
onClick={ ( event ) => event.preventDefault() }
|
|
94
|
-
dangerouslySetInnerHTML={ {
|
|
95
|
-
__html: fullTitle?.rendered,
|
|
96
|
-
} }
|
|
97
|
-
/>
|
|
98
|
-
</TagName>
|
|
99
|
-
);
|
|
111
|
+
</TagName>
|
|
112
|
+
);
|
|
100
113
|
}
|
|
101
114
|
|
|
102
115
|
return (
|
|
@@ -116,7 +129,7 @@ export default function PostTitleEdit( {
|
|
|
116
129
|
/>
|
|
117
130
|
</BlockControls>
|
|
118
131
|
<InspectorControls>
|
|
119
|
-
<PanelBody title={ __( '
|
|
132
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
120
133
|
<ToggleControl
|
|
121
134
|
__nextHasNoMarginBottom
|
|
122
135
|
label={ __( 'Make title a link' ) }
|
|
@@ -28,12 +28,10 @@ export default function PreformattedEdit( props ) {
|
|
|
28
28
|
...( style?.fontSize && { fontSize: style.fontSize } ),
|
|
29
29
|
...( style?.color && { color: style.color } ),
|
|
30
30
|
};
|
|
31
|
-
const hasBaseColors =
|
|
32
|
-
style?.baseColors && Object.entries( style.baseColors ).length !== 0;
|
|
33
31
|
const containerStyles = [
|
|
34
32
|
wpBlockPreformatted,
|
|
35
33
|
style?.backgroundColor && { backgroundColor: style.backgroundColor },
|
|
36
|
-
|
|
34
|
+
style?.baseColors?.color &&
|
|
37
35
|
! style?.backgroundColor &&
|
|
38
36
|
styles[ 'wp-block-preformatted__no-background' ],
|
|
39
37
|
];
|
|
@@ -28,7 +28,7 @@ exports[`Quote block transforms to Pullquote block 1`] = `
|
|
|
28
28
|
<!-- /wp:pullquote -->"
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
|
-
exports[`Quote block transforms
|
|
31
|
+
exports[`Quote block transforms ungroups block 1`] = `
|
|
32
32
|
"<!-- wp:paragraph -->
|
|
33
33
|
<p>"This will make running your own blog a viable alternative again."</p>
|
|
34
34
|
<!-- /wp:paragraph -->
|
|
@@ -36,14 +36,13 @@ describe( `${ block } block transforms`, () => {
|
|
|
36
36
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
37
37
|
} );
|
|
38
38
|
|
|
39
|
-
it( '
|
|
39
|
+
it( 'ungroups block', async () => {
|
|
40
40
|
const screen = await initializeEditor( { initialHtml } );
|
|
41
41
|
const { getByText } = screen;
|
|
42
42
|
fireEvent.press( getBlock( screen, block ) );
|
|
43
43
|
|
|
44
44
|
await openBlockActionsMenu( screen );
|
|
45
|
-
fireEvent.press( getByText( '
|
|
46
|
-
fireEvent.press( getByText( 'Unwrap' ) );
|
|
45
|
+
fireEvent.press( getByText( 'Ungroup' ) );
|
|
47
46
|
|
|
48
47
|
// The first block created is the content of the Paragraph block.
|
|
49
48
|
const paragraph = getBlock( screen, 'Paragraph', 0 );
|
|
@@ -59,8 +58,7 @@ describe( `${ block } block transforms`, () => {
|
|
|
59
58
|
const screen = await initializeEditor( { initialHtml } );
|
|
60
59
|
const transformOptions = await getBlockTransformOptions(
|
|
61
60
|
screen,
|
|
62
|
-
block
|
|
63
|
-
{ canUnwrap: true }
|
|
61
|
+
block
|
|
64
62
|
);
|
|
65
63
|
expect( transformOptions ).toHaveLength( blockTransforms.length );
|
|
66
64
|
} );
|
package/src/quote/transforms.js
CHANGED
|
@@ -21,12 +21,6 @@ const transforms = {
|
|
|
21
21
|
);
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
-
{
|
|
25
|
-
type: 'block',
|
|
26
|
-
blocks: [ 'core/group' ],
|
|
27
|
-
transform: ( { anchor }, innerBlocks ) =>
|
|
28
|
-
createBlock( 'core/quote', { anchor }, innerBlocks ),
|
|
29
|
-
},
|
|
30
24
|
{
|
|
31
25
|
type: 'prefix',
|
|
32
26
|
prefix: '>',
|
|
@@ -132,20 +126,16 @@ const transforms = {
|
|
|
132
126
|
: innerBlocks
|
|
133
127
|
),
|
|
134
128
|
},
|
|
135
|
-
{
|
|
136
|
-
type: 'block',
|
|
137
|
-
blocks: [ '*' ],
|
|
138
|
-
transform: ( { citation }, innerBlocks ) =>
|
|
139
|
-
citation
|
|
140
|
-
? [
|
|
141
|
-
...innerBlocks,
|
|
142
|
-
createBlock( 'core/paragraph', {
|
|
143
|
-
content: citation,
|
|
144
|
-
} ),
|
|
145
|
-
]
|
|
146
|
-
: innerBlocks,
|
|
147
|
-
},
|
|
148
129
|
],
|
|
130
|
+
ungroup: ( { citation }, innerBlocks ) =>
|
|
131
|
+
citation
|
|
132
|
+
? [
|
|
133
|
+
...innerBlocks,
|
|
134
|
+
createBlock( 'core/paragraph', {
|
|
135
|
+
content: citation,
|
|
136
|
+
} ),
|
|
137
|
+
]
|
|
138
|
+
: innerBlocks,
|
|
149
139
|
};
|
|
150
140
|
|
|
151
141
|
export default transforms;
|
package/src/read-more/edit.js
CHANGED
package/src/search/edit.js
CHANGED
|
@@ -115,10 +115,15 @@ export default function SearchEdit( {
|
|
|
115
115
|
|
|
116
116
|
const colorProps = useColorProps( attributes );
|
|
117
117
|
const fluidTypographySettings = useSetting( 'typography.fluid' );
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
const layout = useSetting( 'layout' );
|
|
119
|
+
const typographyProps = useTypographyProps( attributes, {
|
|
120
|
+
typography: {
|
|
121
|
+
fluid: fluidTypographySettings,
|
|
122
|
+
},
|
|
123
|
+
layout: {
|
|
124
|
+
wideSize: layout?.wideSize,
|
|
125
|
+
},
|
|
126
|
+
} );
|
|
122
127
|
const unitControlInstanceId = useInstanceId( UnitControl );
|
|
123
128
|
const unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;
|
|
124
129
|
const isButtonPositionInside = 'button-inside' === buttonPosition;
|
package/src/search/editor.scss
CHANGED
|
@@ -109,7 +109,7 @@ export default function SiteTitleEdit( {
|
|
|
109
109
|
/>
|
|
110
110
|
</BlockControls>
|
|
111
111
|
<InspectorControls>
|
|
112
|
-
<PanelBody title={ __( '
|
|
112
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
113
113
|
<ToggleControl
|
|
114
114
|
__nextHasNoMarginBottom
|
|
115
115
|
label={ __( 'Make title link to home' ) }
|