@wordpress/block-library 7.7.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/audio/index.js +6 -1
- package/build/audio/index.js.map +1 -1
- package/build/avatar/hooks.js +2 -2
- package/build/avatar/hooks.js.map +1 -1
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js.map +1 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +24 -1
- package/build/button/index.js.map +1 -1
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/column/deprecated.js.map +1 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +1 -1
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/index.js.map +1 -1
- package/build/columns/utils.js +1 -1
- package/build/columns/utils.js.map +1 -1
- package/build/comment-author-name/edit.js +4 -2
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-date/edit.js +1 -1
- package/build/comment-date/edit.js.map +1 -1
- package/build/comments-title/edit.js +1 -1
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +3 -10
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/index.js +21 -28
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +34 -6
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/save.js.map +1 -1
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/deprecated.js +6 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-controls.native.js.map +1 -1
- package/build/embed/index.js +6 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +6 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +6 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/index.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/shared.js +27 -10
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/gallery-image.native.js.map +1 -1
- package/build/heading/autogenerate-anchors.js +7 -2
- package/build/heading/autogenerate-anchors.js.map +1 -1
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js.map +1 -1
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +5 -0
- package/build/image/index.js.map +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/image/utils.js +2 -1
- package/build/image/utils.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.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/edit.native.js.map +1 -1
- package/build/list/index.js.map +1 -1
- package/build/list/v2/edit.js.map +1 -1
- package/build/list-item/hooks/use-backspace.js.map +1 -1
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js.map +1 -1
- package/build/media-text/deprecated.js +5 -3
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.native.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/media-container.native.js.map +1 -1
- package/build/media-text/save.js +3 -1
- package/build/media-text/save.js.map +1 -1
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +130 -38
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +4 -1
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation-link/edit.js +14 -8
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +1 -1
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +10 -24
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +4 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/query/edit/index.js +5 -1
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/query-toolbar.js +16 -2
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/quote/v2/edit.js.map +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js.map +1 -1
- package/build/separator/use-deprecated-opacity.js.map +1 -1
- package/build/shortcode/edit.native.js.map +1 -1
- package/build/site-logo/edit.js +3 -12
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/controls.js.map +1 -1
- package/build/table/deprecated.js.map +1 -1
- package/build/table/index.js +6 -1
- package/build/table/index.js.map +1 -1
- package/build/table/state.js.map +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +4 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +4 -1
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/transformationCategories.native.js.map +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.native.js +43 -0
- package/build/video/edit.native.js.map +1 -1
- package/build/video/index.js +6 -1
- package/build/video/index.js.map +1 -1
- package/build-module/audio/index.js +6 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -2
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +24 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/column/deprecated.js.map +1 -1
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +2 -2
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/utils.js +2 -2
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-author-name/edit.js +4 -2
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +1 -1
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +1 -1
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +3 -8
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/index.js +22 -29
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +32 -7
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/deprecated.js +6 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.native.js.map +1 -1
- package/build-module/embed/index.js +6 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +6 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +6 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/gallery/edit.js +2 -2
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/shared.js +25 -8
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
- package/build-module/heading/autogenerate-anchors.js +5 -2
- package/build-module/heading/autogenerate-anchors.js.map +1 -1
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +5 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/utils.js +2 -2
- package/build-module/image/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.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/edit.native.js.map +1 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-backspace.js.map +1 -1
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js.map +1 -1
- package/build-module/media-text/deprecated.js +3 -1
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.js +3 -1
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +4 -1
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- 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.map +1 -1
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +130 -38
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +4 -1
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation-link/edit.js +14 -8
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js +2 -2
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +10 -23
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +4 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/query/edit/index.js +5 -1
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +14 -2
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/separator/use-deprecated-opacity.js.map +1 -1
- package/build-module/shortcode/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js +3 -11
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-links/deprecated.js.map +1 -1
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/index.js +6 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/state.js.map +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +4 -1
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +4 -1
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/transformationCategories.native.js.map +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.native.js +42 -1
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/index.js +6 -1
- package/build-module/video/index.js.map +1 -1
- package/build-style/audio/style-rtl.css +0 -3
- package/build-style/audio/style.css +0 -3
- package/build-style/button/style-rtl.css +0 -5
- package/build-style/button/style.css +0 -5
- package/build-style/common-rtl.css +1 -3
- package/build-style/common.css +1 -3
- package/build-style/cover/editor-rtl.css +11 -0
- package/build-style/cover/editor.css +11 -0
- package/build-style/cover/style-rtl.css +1 -2
- package/build-style/cover/style.css +1 -2
- package/build-style/editor-rtl.css +11 -39
- package/build-style/editor.css +11 -39
- package/build-style/embed/style-rtl.css +0 -1
- package/build-style/embed/style.css +0 -1
- package/build-style/file/style-rtl.css +9 -7
- package/build-style/file/style.css +9 -7
- package/build-style/gallery/style-rtl.css +2 -4
- package/build-style/gallery/style.css +2 -4
- package/build-style/image/style-rtl.css +0 -3
- package/build-style/image/style.css +0 -3
- package/build-style/post-featured-image/editor-rtl.css +0 -27
- package/build-style/post-featured-image/editor.css +0 -27
- package/build-style/search/style-rtl.css +4 -4
- package/build-style/search/style.css +4 -4
- package/build-style/site-logo/editor-rtl.css +0 -12
- package/build-style/site-logo/editor.css +0 -12
- package/build-style/style-rtl.css +18 -38
- package/build-style/style.css +18 -38
- package/build-style/table/style-rtl.css +0 -1
- package/build-style/table/style.css +0 -1
- package/build-style/video/style-rtl.css +1 -5
- package/build-style/video/style.css +1 -5
- package/package.json +30 -29
- package/src/audio/block.json +6 -1
- package/src/audio/index.js +1 -2
- package/src/audio/style.scss +0 -2
- package/src/avatar/hooks.js +9 -6
- package/src/block/edit.js +4 -6
- package/src/block/edit.native.js +12 -16
- package/src/block/test/edit.native.js +5 -8
- package/src/button/block.json +24 -1
- package/src/button/deprecated.js +10 -46
- package/src/button/edit.js +4 -10
- package/src/button/edit.native.js +2 -3
- package/src/button/save.js +2 -10
- package/src/button/style.scss +0 -5
- package/src/buttons/deprecated.js +4 -6
- package/src/buttons/edit.js +3 -3
- package/src/buttons/edit.native.js +7 -11
- package/src/column/deprecated.js +2 -1
- package/src/column/edit.js +2 -3
- package/src/column/edit.native.js +2 -2
- package/src/columns/deprecated.js +4 -2
- package/src/columns/edit.js +6 -7
- package/src/columns/edit.native.js +12 -16
- package/src/columns/index.js +1 -2
- package/src/columns/utils.js +5 -3
- package/src/comment-author-name/edit.js +2 -2
- package/src/comment-date/edit.js +1 -1
- package/src/comments-title/edit.js +1 -1
- package/src/comments-title/index.php +1 -1
- package/src/cover/controls.native.js +2 -4
- package/src/cover/deprecated.js +10 -15
- package/src/cover/edit/block-controls.js +11 -20
- package/src/cover/edit/index.js +58 -55
- package/src/cover/edit/inspector-controls.js +38 -7
- package/src/cover/edit.native.js +8 -13
- package/src/cover/editor.scss +13 -0
- package/src/cover/save.js +2 -3
- package/src/cover/test/edit.native.js +4 -7
- package/src/cover/transforms.js +2 -7
- package/src/embed/block.json +6 -1
- package/src/embed/edit.js +38 -40
- package/src/embed/edit.native.js +46 -49
- package/src/embed/embed-controls.native.js +2 -3
- package/src/embed/style.scss +0 -1
- package/src/embed/test/index.native.js +24 -50
- package/src/file/edit.js +2 -4
- package/src/file/edit.native.js +14 -25
- package/src/file/index.js +1 -2
- package/src/file/style.scss +15 -14
- package/src/gallery/edit.js +8 -6
- package/src/gallery/gallery.native.js +2 -4
- package/src/gallery/index.js +2 -4
- package/src/gallery/shared.js +22 -9
- package/src/gallery/test/index.native.js +18 -34
- package/src/gallery/v1/edit.js +15 -20
- package/src/gallery/v1/gallery-image.js +6 -11
- package/src/gallery/v1/gallery-image.native.js +8 -17
- package/src/heading/autogenerate-anchors.js +8 -5
- package/src/heading/deprecated.js +6 -21
- package/src/heading/edit.js +2 -3
- package/src/image/block.json +5 -0
- package/src/image/deprecated.js +6 -29
- package/src/image/edit.native.js +14 -26
- package/src/image/image.js +31 -38
- package/src/image/style.scss +0 -2
- package/src/image/transforms.js +4 -3
- package/src/image/utils.js +2 -2
- package/src/index.js +1 -1
- package/src/latest-comments/edit.js +2 -6
- package/src/latest-posts/edit.js +6 -7
- package/src/latest-posts/edit.native.js +10 -15
- package/src/list/index.js +1 -2
- package/src/list/test/migrate.js +1 -2
- package/src/list/v2/edit.js +6 -9
- package/src/list-item/hooks/use-backspace.js +2 -3
- package/src/list-item/hooks/use-enter.js +2 -3
- package/src/list-item/hooks/use-indent-list-item.js +2 -3
- package/src/list-item/hooks/use-outdent-list-item.js +2 -3
- package/src/list-item/hooks/use-space.js +2 -3
- package/src/media-text/deprecated.js +6 -3
- package/src/media-text/edit.native.js +2 -5
- package/src/media-text/media-container.js +1 -1
- package/src/media-text/media-container.native.js +6 -9
- package/src/media-text/save.js +2 -1
- package/src/missing/edit.native.js +2 -3
- package/src/missing/test/edit-integration.native.js +2 -3
- package/src/missing/test/edit.native.js +6 -9
- package/src/navigation/deprecated.js +2 -5
- package/src/navigation/edit/index.js +24 -36
- package/src/navigation/edit/navigation-menu-delete-control.js +2 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +31 -30
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +2 -3
- package/src/navigation/test/use-navigation-menu.js +236 -0
- package/src/navigation/use-navigation-entities.js +11 -13
- package/src/navigation/use-navigation-menu.js +152 -82
- package/src/navigation/use-template-part-area-label.js +8 -7
- package/src/navigation-link/edit.js +24 -20
- package/src/navigation-link/test/edit.js +2 -4
- package/src/navigation-submenu/edit.js +10 -20
- package/src/page-list/convert-to-links-modal.js +51 -54
- package/src/page-list/edit.js +6 -6
- package/src/page-list/test/convert-to-links-modal.js +6 -12
- package/src/paragraph/deprecated.js +2 -2
- package/src/pattern/edit.js +2 -4
- package/src/post-author/edit.js +2 -3
- package/src/post-content/edit.js +2 -3
- package/src/post-featured-image/edit.js +14 -30
- package/src/post-featured-image/editor.scss +0 -29
- package/src/post-navigation-link/block.json +4 -0
- package/src/pullquote/deprecated.js +2 -1
- package/src/query/edit/index.js +10 -10
- package/src/query/edit/inspector-controls/parent-control.js +2 -3
- package/src/query/edit/query-toolbar.js +25 -5
- package/src/quote/v2/edit.js +4 -6
- package/src/quote/v2/test/migrate.js +1 -2
- package/src/search/edit.js +6 -12
- package/src/search/edit.native.js +4 -6
- package/src/search/style.scss +2 -1
- package/src/separator/use-deprecated-opacity.js +2 -4
- package/src/shortcode/edit.native.js +4 -3
- package/src/shortcode/test/edit.native.js +2 -5
- package/src/site-logo/edit.js +3 -17
- package/src/site-logo/editor.scss +0 -14
- package/src/social-links/deprecated.js +4 -2
- package/src/social-links/edit.native.js +3 -5
- package/src/spacer/controls.js +2 -3
- package/src/spacer/test/index.native.js +10 -21
- package/src/table/block.json +6 -1
- package/src/table/deprecated.js +4 -8
- package/src/table/state.js +2 -4
- package/src/table/style.scss +0 -1
- package/src/table-of-contents/edit.js +6 -10
- package/src/tag-cloud/edit.js +4 -7
- package/src/template-part/edit/advanced-controls.js +4 -4
- package/src/template-part/edit/index.js +6 -10
- package/src/template-part/edit/utils/hooks.js +8 -7
- package/src/transformationCategories.native.js +3 -3
- package/src/video/block.json +6 -1
- package/src/video/edit-common-settings.js +2 -8
- package/src/video/edit.native.js +38 -16
- package/src/video/index.js +1 -2
- package/src/video/style.scss +0 -2
|
@@ -225,20 +225,28 @@ export const updateNavigationLinkBlockAttributes = (
|
|
|
225
225
|
} = blockAttributes;
|
|
226
226
|
|
|
227
227
|
const {
|
|
228
|
-
title = '', // the title of any provided Post.
|
|
229
|
-
url = '',
|
|
228
|
+
title: newLabel = '', // the title of any provided Post.
|
|
229
|
+
url: newUrl = '',
|
|
230
230
|
|
|
231
231
|
opensInNewTab,
|
|
232
232
|
id,
|
|
233
233
|
kind: newKind = originalKind,
|
|
234
234
|
type: newType = originalType,
|
|
235
235
|
} = updatedValue;
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
|
|
237
|
+
const newLabelWithoutHttp = newLabel.replace( /http(s?):\/\//gi, '' );
|
|
238
|
+
const newUrlWithoutHttp = newUrl.replace( /http(s?):\/\//gi, '' );
|
|
239
|
+
|
|
240
|
+
const useNewLabel =
|
|
241
|
+
newLabel &&
|
|
242
|
+
newLabel !== originalLabel &&
|
|
243
|
+
// LinkControl without the title field relies
|
|
244
|
+
// on the check below. Specifically, it assumes that
|
|
245
|
+
// the URL is the same as a title.
|
|
246
|
+
// This logic a) looks suspicious and b) should really
|
|
247
|
+
// live in the LinkControl and not here. It's a great
|
|
248
|
+
// candidate for future refactoring.
|
|
249
|
+
newLabelWithoutHttp !== newUrlWithoutHttp;
|
|
242
250
|
|
|
243
251
|
// Unfortunately this causes the escaping model to be inverted.
|
|
244
252
|
// The escaped content is stored in the block attributes (and ultimately in the database),
|
|
@@ -249,9 +257,9 @@ export const updateNavigationLinkBlockAttributes = (
|
|
|
249
257
|
// See also:
|
|
250
258
|
// - https://github.com/WordPress/gutenberg/pull/41063
|
|
251
259
|
// - https://github.com/WordPress/gutenberg/pull/18617.
|
|
252
|
-
const label =
|
|
253
|
-
? escape(
|
|
254
|
-
: originalLabel || escape(
|
|
260
|
+
const label = useNewLabel
|
|
261
|
+
? escape( newLabel )
|
|
262
|
+
: originalLabel || escape( newUrlWithoutHttp );
|
|
255
263
|
|
|
256
264
|
// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
|
|
257
265
|
const type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );
|
|
@@ -265,7 +273,7 @@ export const updateNavigationLinkBlockAttributes = (
|
|
|
265
273
|
|
|
266
274
|
setAttributes( {
|
|
267
275
|
// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
|
|
268
|
-
...(
|
|
276
|
+
...( newUrl && { url: encodeURI( safeDecodeURI( newUrl ) ) } ),
|
|
269
277
|
...( label && { label } ),
|
|
270
278
|
...( undefined !== opensInNewTab && { opensInNewTab } ),
|
|
271
279
|
...( id && Number.isInteger( id ) && { id } ),
|
|
@@ -447,10 +455,8 @@ export default function NavigationLinkEdit( {
|
|
|
447
455
|
title: label && navStripHTML( label ), // don't allow HTML to display inside the <LinkControl>
|
|
448
456
|
};
|
|
449
457
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
450
|
-
const {
|
|
451
|
-
|
|
452
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
453
|
-
} = useDispatch( blockEditorStore );
|
|
458
|
+
const { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =
|
|
459
|
+
useDispatch( blockEditorStore );
|
|
454
460
|
const [ isLinkOpen, setIsLinkOpen ] = useState( false );
|
|
455
461
|
const listItemRef = useRef( null );
|
|
456
462
|
const isDraggingWithin = useIsDraggingWithin( listItemRef );
|
|
@@ -658,10 +664,8 @@ export default function NavigationLinkEdit( {
|
|
|
658
664
|
'has-text-color': !! textColor || !! customTextColor,
|
|
659
665
|
[ getColorClassName( 'color', textColor ) ]: !! textColor,
|
|
660
666
|
'has-background': !! backgroundColor || customBackgroundColor,
|
|
661
|
-
[ getColorClassName(
|
|
662
|
-
|
|
663
|
-
backgroundColor
|
|
664
|
-
) ]: !! backgroundColor,
|
|
667
|
+
[ getColorClassName( 'background-color', backgroundColor ) ]:
|
|
668
|
+
!! backgroundColor,
|
|
665
669
|
} ),
|
|
666
670
|
style: {
|
|
667
671
|
color: ! textColor && customTextColor,
|
|
@@ -160,8 +160,7 @@ describe( 'edit', () => {
|
|
|
160
160
|
opensInNewTab: false,
|
|
161
161
|
title: 'Portfolio Category',
|
|
162
162
|
type: 'portfolio_category',
|
|
163
|
-
url:
|
|
164
|
-
'http://wordpress.local/portfolio_category/Portfolio-category/',
|
|
163
|
+
url: 'http://wordpress.local/portfolio_category/Portfolio-category/',
|
|
165
164
|
};
|
|
166
165
|
updateNavigationLinkBlockAttributes(
|
|
167
166
|
linkSuggestion,
|
|
@@ -173,8 +172,7 @@ describe( 'edit', () => {
|
|
|
173
172
|
opensInNewTab: false,
|
|
174
173
|
label: 'Portfolio Category',
|
|
175
174
|
type: 'portfolio_category',
|
|
176
|
-
url:
|
|
177
|
-
'http://wordpress.local/portfolio_category/Portfolio-category/',
|
|
175
|
+
url: 'http://wordpress.local/portfolio_category/Portfolio-category/',
|
|
178
176
|
} );
|
|
179
177
|
} );
|
|
180
178
|
|
|
@@ -277,16 +277,8 @@ export default function NavigationSubmenuEdit( {
|
|
|
277
277
|
context,
|
|
278
278
|
clientId,
|
|
279
279
|
} ) {
|
|
280
|
-
const {
|
|
281
|
-
|
|
282
|
-
type,
|
|
283
|
-
opensInNewTab,
|
|
284
|
-
url,
|
|
285
|
-
description,
|
|
286
|
-
rel,
|
|
287
|
-
title,
|
|
288
|
-
kind,
|
|
289
|
-
} = attributes;
|
|
280
|
+
const { label, type, opensInNewTab, url, description, rel, title, kind } =
|
|
281
|
+
attributes;
|
|
290
282
|
const link = {
|
|
291
283
|
url,
|
|
292
284
|
opensInNewTab,
|
|
@@ -294,10 +286,8 @@ export default function NavigationSubmenuEdit( {
|
|
|
294
286
|
const { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;
|
|
295
287
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
296
288
|
|
|
297
|
-
const {
|
|
298
|
-
|
|
299
|
-
replaceBlock,
|
|
300
|
-
} = useDispatch( blockEditorStore );
|
|
289
|
+
const { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =
|
|
290
|
+
useDispatch( blockEditorStore );
|
|
301
291
|
const [ isLinkOpen, setIsLinkOpen ] = useState( false );
|
|
302
292
|
const listItemRef = useRef( null );
|
|
303
293
|
const isDraggingWithin = useIsDraggingWithin( listItemRef );
|
|
@@ -481,10 +471,8 @@ export default function NavigationSubmenuEdit( {
|
|
|
481
471
|
'has-text-color': !! textColor || !! customTextColor,
|
|
482
472
|
[ getColorClassName( 'color', textColor ) ]: !! textColor,
|
|
483
473
|
'has-background': !! backgroundColor || customBackgroundColor,
|
|
484
|
-
[ getColorClassName(
|
|
485
|
-
|
|
486
|
-
backgroundColor
|
|
487
|
-
) ]: !! backgroundColor,
|
|
474
|
+
[ getColorClassName( 'background-color', backgroundColor ) ]:
|
|
475
|
+
!! backgroundColor,
|
|
488
476
|
'open-on-click': openSubmenusOnClick,
|
|
489
477
|
} ),
|
|
490
478
|
style: {
|
|
@@ -509,12 +497,14 @@ export default function NavigationSubmenuEdit( {
|
|
|
509
497
|
innerBlocksColors.textColor ||
|
|
510
498
|
innerBlocksColors.customTextColor
|
|
511
499
|
),
|
|
512
|
-
[ `has-${ innerBlocksColors.textColor }-color` ]:
|
|
500
|
+
[ `has-${ innerBlocksColors.textColor }-color` ]:
|
|
501
|
+
!! innerBlocksColors.textColor,
|
|
513
502
|
'has-background': !! (
|
|
514
503
|
innerBlocksColors.backgroundColor ||
|
|
515
504
|
innerBlocksColors.customBackgroundColor
|
|
516
505
|
),
|
|
517
|
-
[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:
|
|
506
|
+
[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:
|
|
507
|
+
!! innerBlocksColors.backgroundColor,
|
|
518
508
|
} ),
|
|
519
509
|
style: {
|
|
520
510
|
color: innerBlocksColors.customTextColor,
|
|
@@ -11,67 +11,64 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
11
11
|
const PAGE_FIELDS = [ 'id', 'title', 'link', 'type', 'parent' ];
|
|
12
12
|
const MAX_PAGE_COUNT = 100;
|
|
13
13
|
|
|
14
|
-
export const convertSelectedBlockToNavigationLinks =
|
|
15
|
-
pages,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} ) => () => {
|
|
20
|
-
if ( ! pages ) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const linkMap = {};
|
|
25
|
-
const navigationLinks = [];
|
|
26
|
-
pages.forEach( ( { id, title, link: url, type, parent } ) => {
|
|
27
|
-
// See if a placeholder exists. This is created if children appear before parents in list.
|
|
28
|
-
const innerBlocks = linkMap[ id ]?.innerBlocks ?? [];
|
|
29
|
-
linkMap[ id ] = createBlock(
|
|
30
|
-
'core/navigation-link',
|
|
31
|
-
{
|
|
32
|
-
id,
|
|
33
|
-
label: title.rendered,
|
|
34
|
-
url,
|
|
35
|
-
type,
|
|
36
|
-
kind: 'post-type',
|
|
37
|
-
},
|
|
38
|
-
innerBlocks
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
if ( ! parent ) {
|
|
42
|
-
navigationLinks.push( linkMap[ id ] );
|
|
43
|
-
} else {
|
|
44
|
-
if ( ! linkMap[ parent ] ) {
|
|
45
|
-
// Use a placeholder if the child appears before parent in list.
|
|
46
|
-
linkMap[ parent ] = { innerBlocks: [] };
|
|
47
|
-
}
|
|
48
|
-
const parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;
|
|
49
|
-
parentLinkInnerBlocks.push( linkMap[ id ] );
|
|
14
|
+
export const convertSelectedBlockToNavigationLinks =
|
|
15
|
+
( { pages, clientId, replaceBlock, createBlock } ) =>
|
|
16
|
+
() => {
|
|
17
|
+
if ( ! pages ) {
|
|
18
|
+
return;
|
|
50
19
|
}
|
|
51
|
-
} );
|
|
52
20
|
|
|
53
|
-
|
|
54
|
-
|
|
21
|
+
const linkMap = {};
|
|
22
|
+
const navigationLinks = [];
|
|
23
|
+
pages.forEach( ( { id, title, link: url, type, parent } ) => {
|
|
24
|
+
// See if a placeholder exists. This is created if children appear before parents in list.
|
|
25
|
+
const innerBlocks = linkMap[ id ]?.innerBlocks ?? [];
|
|
26
|
+
linkMap[ id ] = createBlock(
|
|
27
|
+
'core/navigation-link',
|
|
28
|
+
{
|
|
29
|
+
id,
|
|
30
|
+
label: title.rendered,
|
|
31
|
+
url,
|
|
32
|
+
type,
|
|
33
|
+
kind: 'post-type',
|
|
34
|
+
},
|
|
35
|
+
innerBlocks
|
|
36
|
+
);
|
|
55
37
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
);
|
|
66
|
-
listOfLinksArray[ index ] = transformedBlock;
|
|
38
|
+
if ( ! parent ) {
|
|
39
|
+
navigationLinks.push( linkMap[ id ] );
|
|
40
|
+
} else {
|
|
41
|
+
if ( ! linkMap[ parent ] ) {
|
|
42
|
+
// Use a placeholder if the child appears before parent in list.
|
|
43
|
+
linkMap[ parent ] = { innerBlocks: [] };
|
|
44
|
+
}
|
|
45
|
+
const parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;
|
|
46
|
+
parentLinkInnerBlocks.push( linkMap[ id ] );
|
|
67
47
|
}
|
|
68
48
|
} );
|
|
69
|
-
};
|
|
70
49
|
|
|
71
|
-
|
|
50
|
+
// Transform all links with innerBlocks into Submenus. This can't be done
|
|
51
|
+
// sooner because page objects have no information on their children.
|
|
72
52
|
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
const transformSubmenus = ( listOfLinks ) => {
|
|
54
|
+
listOfLinks.forEach( ( block, index, listOfLinksArray ) => {
|
|
55
|
+
const { attributes, innerBlocks } = block;
|
|
56
|
+
if ( innerBlocks.length !== 0 ) {
|
|
57
|
+
transformSubmenus( innerBlocks );
|
|
58
|
+
const transformedBlock = createBlock(
|
|
59
|
+
'core/navigation-submenu',
|
|
60
|
+
attributes,
|
|
61
|
+
innerBlocks
|
|
62
|
+
);
|
|
63
|
+
listOfLinksArray[ index ] = transformedBlock;
|
|
64
|
+
}
|
|
65
|
+
} );
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
transformSubmenus( navigationLinks );
|
|
69
|
+
|
|
70
|
+
replaceBlock( clientId, navigationLinks );
|
|
71
|
+
};
|
|
75
72
|
|
|
76
73
|
export default function ConvertToLinksModal( { onClose, clientId } ) {
|
|
77
74
|
const { records: pages, hasResolved: pagesFinished } = useEntityRecords(
|
package/src/page-list/edit.js
CHANGED
|
@@ -42,10 +42,8 @@ export default function PageListEdit( { context, clientId } ) {
|
|
|
42
42
|
const blockProps = useBlockProps( {
|
|
43
43
|
className: classnames( 'wp-block-page-list', {
|
|
44
44
|
'has-text-color': !! context.textColor,
|
|
45
|
-
[ getColorClassName(
|
|
46
|
-
|
|
47
|
-
context.textColor
|
|
48
|
-
) ]: !! context.textColor,
|
|
45
|
+
[ getColorClassName( 'color', context.textColor ) ]:
|
|
46
|
+
!! context.textColor,
|
|
49
47
|
'has-background': !! context.backgroundColor,
|
|
50
48
|
[ getColorClassName(
|
|
51
49
|
'background-color',
|
|
@@ -193,7 +191,8 @@ const PageItems = memo( function PageItems( {
|
|
|
193
191
|
className={ classnames(
|
|
194
192
|
'wp-block-pages-list__item__link',
|
|
195
193
|
{
|
|
196
|
-
'wp-block-navigation-item__content':
|
|
194
|
+
'wp-block-navigation-item__content':
|
|
195
|
+
isNavigationChild,
|
|
197
196
|
}
|
|
198
197
|
) }
|
|
199
198
|
href={ page.link }
|
|
@@ -214,7 +213,8 @@ const PageItems = memo( function PageItems( {
|
|
|
214
213
|
) }
|
|
215
214
|
<ul
|
|
216
215
|
className={ classnames( 'submenu-container', {
|
|
217
|
-
'wp-block-navigation__submenu-container':
|
|
216
|
+
'wp-block-navigation__submenu-container':
|
|
217
|
+
isNavigationChild,
|
|
218
218
|
} ) }
|
|
219
219
|
>
|
|
220
220
|
<PageItems
|
|
@@ -130,8 +130,7 @@ describe( 'page list convert to links', () => {
|
|
|
130
130
|
kind: 'post-type',
|
|
131
131
|
label: 'About Sub 1',
|
|
132
132
|
type: 'page',
|
|
133
|
-
url:
|
|
134
|
-
'http://wordpress.local/about/about-sub-1/',
|
|
133
|
+
url: 'http://wordpress.local/about/about-sub-1/',
|
|
135
134
|
},
|
|
136
135
|
innerBlocks: [],
|
|
137
136
|
name: 'core/navigation-link',
|
|
@@ -142,8 +141,7 @@ describe( 'page list convert to links', () => {
|
|
|
142
141
|
kind: 'post-type',
|
|
143
142
|
label: 'About Sub 2',
|
|
144
143
|
type: 'page',
|
|
145
|
-
url:
|
|
146
|
-
'http://wordpress.local/about/about-sub-2/',
|
|
144
|
+
url: 'http://wordpress.local/about/about-sub-2/',
|
|
147
145
|
},
|
|
148
146
|
innerBlocks: [],
|
|
149
147
|
name: 'core/navigation-link',
|
|
@@ -186,8 +184,7 @@ describe( 'page list convert to links', () => {
|
|
|
186
184
|
kind: 'post-type',
|
|
187
185
|
label: 'Test Sub Sub',
|
|
188
186
|
type: 'page',
|
|
189
|
-
url:
|
|
190
|
-
'http://wordpress.local/test/test-sub/test-sub-sub/',
|
|
187
|
+
url: 'http://wordpress.local/test/test-sub/test-sub-sub/',
|
|
191
188
|
},
|
|
192
189
|
innerBlocks: [],
|
|
193
190
|
name: 'core/navigation-link',
|
|
@@ -325,8 +322,7 @@ describe( 'page list convert to links', () => {
|
|
|
325
322
|
kind: 'post-type',
|
|
326
323
|
label: 'About Sub 1',
|
|
327
324
|
type: 'page',
|
|
328
|
-
url:
|
|
329
|
-
'http://wordpress.local/about/about-sub-1/',
|
|
325
|
+
url: 'http://wordpress.local/about/about-sub-1/',
|
|
330
326
|
},
|
|
331
327
|
innerBlocks: [],
|
|
332
328
|
name: 'core/navigation-link',
|
|
@@ -337,8 +333,7 @@ describe( 'page list convert to links', () => {
|
|
|
337
333
|
kind: 'post-type',
|
|
338
334
|
label: 'About Sub 2',
|
|
339
335
|
type: 'page',
|
|
340
|
-
url:
|
|
341
|
-
'http://wordpress.local/about/about-sub-2/',
|
|
336
|
+
url: 'http://wordpress.local/about/about-sub-2/',
|
|
342
337
|
},
|
|
343
338
|
innerBlocks: [],
|
|
344
339
|
name: 'core/navigation-link',
|
|
@@ -381,8 +376,7 @@ describe( 'page list convert to links', () => {
|
|
|
381
376
|
kind: 'post-type',
|
|
382
377
|
label: 'Test Sub Sub',
|
|
383
378
|
type: 'page',
|
|
384
|
-
url:
|
|
385
|
-
'http://wordpress.local/test/test-sub/test-sub-sub/',
|
|
379
|
+
url: 'http://wordpress.local/test/test-sub/test-sub-sub/',
|
|
386
380
|
},
|
|
387
381
|
innerBlocks: [],
|
|
388
382
|
name: 'core/navigation-link',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import {
|
|
5
|
+
import { omit } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -328,7 +328,7 @@ const deprecated = [
|
|
|
328
328
|
return migrateCustomColorsAndFontSizes(
|
|
329
329
|
omit( {
|
|
330
330
|
...attributes,
|
|
331
|
-
customFontSize: isFinite( attributes.fontSize )
|
|
331
|
+
customFontSize: Number.isFinite( attributes.fontSize )
|
|
332
332
|
? attributes.fontSize
|
|
333
333
|
: undefined,
|
|
334
334
|
customTextColor:
|
package/src/pattern/edit.js
CHANGED
|
@@ -17,10 +17,8 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
17
17
|
[ attributes.slug ]
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
23
|
-
} = useDispatch( blockEditorStore );
|
|
20
|
+
const { replaceBlocks, __unstableMarkNextChangeAsNotPersistent } =
|
|
21
|
+
useDispatch( blockEditorStore );
|
|
24
22
|
|
|
25
23
|
// Run this effect when the component loads.
|
|
26
24
|
// This adds the Pattern's contents to the post.
|
package/src/post-author/edit.js
CHANGED
|
@@ -28,9 +28,8 @@ function PostAuthorEdit( {
|
|
|
28
28
|
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
29
29
|
const { authorId, authorDetails, authors } = useSelect(
|
|
30
30
|
( select ) => {
|
|
31
|
-
const { getEditedEntityRecord, getUser, getUsers } =
|
|
32
|
-
coreStore
|
|
33
|
-
);
|
|
31
|
+
const { getEditedEntityRecord, getUser, getUsers } =
|
|
32
|
+
select( coreStore );
|
|
34
33
|
const _authorId = getEditedEntityRecord(
|
|
35
34
|
'postType',
|
|
36
35
|
postType,
|
package/src/post-content/edit.js
CHANGED
|
@@ -118,9 +118,8 @@ function RecursionError() {
|
|
|
118
118
|
export default function PostContentEdit( { context, attributes } ) {
|
|
119
119
|
const { postId: contextPostId, postType: contextPostType } = context;
|
|
120
120
|
const { layout = {} } = attributes;
|
|
121
|
-
const [ hasAlreadyRendered, RecursionProvider ] =
|
|
122
|
-
contextPostId
|
|
123
|
-
);
|
|
121
|
+
const [ hasAlreadyRendered, RecursionProvider ] =
|
|
122
|
+
useNoRecursiveRenders( contextPostId );
|
|
124
123
|
|
|
125
124
|
if ( contextPostId && contextPostType && hasAlreadyRendered ) {
|
|
126
125
|
return <RecursionError />;
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
} from '@wordpress/block-editor';
|
|
21
21
|
import { __, sprintf } from '@wordpress/i18n';
|
|
22
22
|
import { upload } from '@wordpress/icons';
|
|
23
|
-
import { SVG, Path } from '@wordpress/primitives';
|
|
24
23
|
import { store as noticesStore } from '@wordpress/notices';
|
|
25
24
|
|
|
26
25
|
/**
|
|
@@ -28,24 +27,18 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
28
27
|
*/
|
|
29
28
|
import DimensionControls from './dimension-controls';
|
|
30
29
|
|
|
31
|
-
const placeholderIllustration = (
|
|
32
|
-
<SVG
|
|
33
|
-
className="components-placeholder__illustration"
|
|
34
|
-
fill="none"
|
|
35
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
36
|
-
viewBox="0 0 60 60"
|
|
37
|
-
preserveAspectRatio="none"
|
|
38
|
-
>
|
|
39
|
-
<Path vectorEffect="non-scaling-stroke" d="M60 60 0 0" />
|
|
40
|
-
</SVG>
|
|
41
|
-
);
|
|
42
|
-
|
|
43
30
|
const ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
|
|
32
|
+
const placeholder = ( content ) => {
|
|
33
|
+
return (
|
|
34
|
+
<Placeholder
|
|
35
|
+
className="block-editor-media-placeholder"
|
|
36
|
+
withIllustration={ true }
|
|
37
|
+
>
|
|
38
|
+
{ content }
|
|
39
|
+
</Placeholder>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
49
42
|
|
|
50
43
|
function getMediaSourceUrlBySizeSlug( media, slug ) {
|
|
51
44
|
return (
|
|
@@ -101,15 +94,6 @@ function PostFeaturedImageDisplay( {
|
|
|
101
94
|
style: { width, height },
|
|
102
95
|
} );
|
|
103
96
|
|
|
104
|
-
const placeholder = ( content ) => {
|
|
105
|
-
return (
|
|
106
|
-
<Placeholder className="block-editor-media-placeholder">
|
|
107
|
-
{ placeholderIllustration }
|
|
108
|
-
{ content }
|
|
109
|
-
</Placeholder>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
97
|
const onSelectImage = ( value ) => {
|
|
114
98
|
if ( value?.id ) {
|
|
115
99
|
setFeaturedImage( value.id );
|
|
@@ -153,7 +137,7 @@ function PostFeaturedImageDisplay( {
|
|
|
153
137
|
return (
|
|
154
138
|
<>
|
|
155
139
|
{ controls }
|
|
156
|
-
<div { ...blockProps }>{
|
|
140
|
+
<div { ...blockProps }>{ placeholder() }</div>
|
|
157
141
|
</>
|
|
158
142
|
);
|
|
159
143
|
}
|
|
@@ -187,7 +171,7 @@ function PostFeaturedImageDisplay( {
|
|
|
187
171
|
} else {
|
|
188
172
|
// We have a Featured image so show a Placeholder if is loading.
|
|
189
173
|
image = ! media ? (
|
|
190
|
-
|
|
174
|
+
placeholder()
|
|
191
175
|
) : (
|
|
192
176
|
<img
|
|
193
177
|
src={ mediaUrl }
|
|
@@ -232,7 +216,7 @@ function PostFeaturedImageDisplay( {
|
|
|
232
216
|
export default function PostFeaturedImageEdit( props ) {
|
|
233
217
|
const blockProps = useBlockProps();
|
|
234
218
|
if ( ! props.context?.postId ) {
|
|
235
|
-
return <div { ...blockProps }>{
|
|
219
|
+
return <div { ...blockProps }>{ placeholder() }</div>;
|
|
236
220
|
}
|
|
237
221
|
return <PostFeaturedImageDisplay { ...props } />;
|
|
238
222
|
}
|
|
@@ -39,21 +39,6 @@
|
|
|
39
39
|
// against any background color.
|
|
40
40
|
color: currentColor;
|
|
41
41
|
background: transparent;
|
|
42
|
-
&::before {
|
|
43
|
-
content: "";
|
|
44
|
-
display: block;
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: 0;
|
|
47
|
-
right: 0;
|
|
48
|
-
bottom: 0;
|
|
49
|
-
left: 0;
|
|
50
|
-
border: $border-width dashed currentColor;
|
|
51
|
-
opacity: 0.4;
|
|
52
|
-
pointer-events: none;
|
|
53
|
-
|
|
54
|
-
// Inherit border radius from style variations.
|
|
55
|
-
border-radius: inherit;
|
|
56
|
-
}
|
|
57
42
|
|
|
58
43
|
// Style the upload button.
|
|
59
44
|
.components-placeholder__fieldset {
|
|
@@ -82,20 +67,6 @@
|
|
|
82
67
|
color: $white;
|
|
83
68
|
}
|
|
84
69
|
|
|
85
|
-
// Style the placeholder illustration.
|
|
86
|
-
.components-placeholder__illustration {
|
|
87
|
-
position: absolute;
|
|
88
|
-
top: 0;
|
|
89
|
-
right: 0;
|
|
90
|
-
bottom: 0;
|
|
91
|
-
left: 0;
|
|
92
|
-
width: 100%;
|
|
93
|
-
height: 100%;
|
|
94
|
-
stroke: currentColor;
|
|
95
|
-
stroke-dasharray: 3;
|
|
96
|
-
opacity: 0.4;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
70
|
// Show default placeholder height when not resized.
|
|
100
71
|
min-height: 200px;
|
|
101
72
|
}
|
|
@@ -29,9 +29,13 @@
|
|
|
29
29
|
"supports": {
|
|
30
30
|
"reusable": false,
|
|
31
31
|
"html": false,
|
|
32
|
+
"color": {
|
|
33
|
+
"link": true
|
|
34
|
+
},
|
|
32
35
|
"typography": {
|
|
33
36
|
"fontSize": true,
|
|
34
37
|
"lineHeight": true,
|
|
38
|
+
"__experimentalFontFamily": true,
|
|
35
39
|
"__experimentalFontStyle": true,
|
|
36
40
|
"__experimentalFontWeight": true,
|
|
37
41
|
"__experimentalLetterSpacing": true,
|
|
@@ -397,7 +397,8 @@ const deprecated = [
|
|
|
397
397
|
const blockquoteClasses =
|
|
398
398
|
textColor || customTextColor
|
|
399
399
|
? classnames( 'has-text-color', {
|
|
400
|
-
[ blockquoteTextColorClass ]:
|
|
400
|
+
[ blockquoteTextColorClass ]:
|
|
401
|
+
blockquoteTextColorClass,
|
|
401
402
|
} )
|
|
402
403
|
: undefined;
|
|
403
404
|
const blockquoteStyle = blockquoteTextColorClass
|
package/src/query/edit/index.js
CHANGED
|
@@ -37,6 +37,8 @@ export function QueryContent( {
|
|
|
37
37
|
attributes,
|
|
38
38
|
setAttributes,
|
|
39
39
|
openPatternSelectionModal,
|
|
40
|
+
name,
|
|
41
|
+
clientId,
|
|
40
42
|
} ) {
|
|
41
43
|
const {
|
|
42
44
|
queryId,
|
|
@@ -45,9 +47,8 @@ export function QueryContent( {
|
|
|
45
47
|
tagName: TagName = 'div',
|
|
46
48
|
layout = {},
|
|
47
49
|
} = attributes;
|
|
48
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
49
|
-
blockEditorStore
|
|
50
|
-
);
|
|
50
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
51
|
+
useDispatch( blockEditorStore );
|
|
51
52
|
const instanceId = useInstanceId( QueryContent );
|
|
52
53
|
const { themeSupportsLayout } = useSelect( ( select ) => {
|
|
53
54
|
const { getSettings } = select( blockEditorStore );
|
|
@@ -109,6 +110,8 @@ export function QueryContent( {
|
|
|
109
110
|
/>
|
|
110
111
|
<BlockControls>
|
|
111
112
|
<QueryToolbar
|
|
113
|
+
name={ name }
|
|
114
|
+
clientId={ clientId }
|
|
112
115
|
attributes={ attributes }
|
|
113
116
|
setQuery={ updateQuery }
|
|
114
117
|
setDisplayLayout={ updateDisplayLayout }
|
|
@@ -213,10 +216,8 @@ function QueryPatternSetup( {
|
|
|
213
216
|
|
|
214
217
|
const QueryEdit = ( props ) => {
|
|
215
218
|
const { clientId, name } = props;
|
|
216
|
-
const [
|
|
217
|
-
|
|
218
|
-
setIsPatternSelectionModalOpen,
|
|
219
|
-
] = useState( false );
|
|
219
|
+
const [ isPatternSelectionModalOpen, setIsPatternSelectionModalOpen ] =
|
|
220
|
+
useState( false );
|
|
220
221
|
const { replaceBlock, selectBlock } = useDispatch( blockEditorStore );
|
|
221
222
|
const hasInnerBlocks = useSelect(
|
|
222
223
|
( select ) =>
|
|
@@ -226,9 +227,8 @@ const QueryEdit = ( props ) => {
|
|
|
226
227
|
const Component = hasInnerBlocks ? QueryContent : QueryPatternSetup;
|
|
227
228
|
const onBlockPatternSelect = ( blocks ) => {
|
|
228
229
|
const clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );
|
|
229
|
-
const firstQueryClientId =
|
|
230
|
-
clonedBlocks
|
|
231
|
-
);
|
|
230
|
+
const firstQueryClientId =
|
|
231
|
+
getFirstQueryClientIdFromBlocks( clonedBlocks );
|
|
232
232
|
replaceBlock( clientId, clonedBlocks );
|
|
233
233
|
if ( firstQueryClientId ) {
|
|
234
234
|
selectBlock( firstQueryClientId );
|
|
@@ -30,9 +30,8 @@ function ParentControl( { parents, postType, onChange } ) {
|
|
|
30
30
|
if ( ! search ) {
|
|
31
31
|
return { searchResults: EMPTY_ARRAY, searchHasResolved: true };
|
|
32
32
|
}
|
|
33
|
-
const { getEntityRecords, hasFinishedResolution } =
|
|
34
|
-
coreStore
|
|
35
|
-
);
|
|
33
|
+
const { getEntityRecords, hasFinishedResolution } =
|
|
34
|
+
select( coreStore );
|
|
36
35
|
const selectorArgs = [
|
|
37
36
|
'postType',
|
|
38
37
|
postType,
|