@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
|
@@ -15,11 +15,8 @@ const migrateWithLayout = ( attributes ) => {
|
|
|
15
15
|
return attributes;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
orientation,
|
|
21
|
-
...updatedAttributes
|
|
22
|
-
} = attributes;
|
|
18
|
+
const { contentJustification, orientation, ...updatedAttributes } =
|
|
19
|
+
attributes;
|
|
23
20
|
|
|
24
21
|
if ( contentJustification || orientation ) {
|
|
25
22
|
Object.assign( updatedAttributes, {
|
|
@@ -67,7 +64,8 @@ const deprecated = [
|
|
|
67
64
|
<div
|
|
68
65
|
{ ...useBlockProps.save( {
|
|
69
66
|
className: classnames( {
|
|
70
|
-
[ `is-content-justification-${ contentJustification }` ]:
|
|
67
|
+
[ `is-content-justification-${ contentJustification }` ]:
|
|
68
|
+
contentJustification,
|
|
71
69
|
'is-vertical': orientation === 'vertical',
|
|
72
70
|
} ),
|
|
73
71
|
} ) }
|
package/src/buttons/edit.js
CHANGED
|
@@ -33,9 +33,9 @@ const DEFAULT_BLOCK = {
|
|
|
33
33
|
function ButtonsEdit( { attributes: { layout = {} } } ) {
|
|
34
34
|
const blockProps = useBlockProps();
|
|
35
35
|
const preferredStyle = useSelect( ( select ) => {
|
|
36
|
-
const preferredStyleVariations =
|
|
37
|
-
blockEditorStore
|
|
38
|
-
|
|
36
|
+
const preferredStyleVariations =
|
|
37
|
+
select( blockEditorStore ).getSettings()
|
|
38
|
+
.__experimentalPreferredStyleVariations;
|
|
39
39
|
return preferredStyleVariations?.value?.[ buttonBlockName ];
|
|
40
40
|
}, [] );
|
|
41
41
|
|
|
@@ -49,11 +49,8 @@ export default function ButtonsEdit( {
|
|
|
49
49
|
|
|
50
50
|
const { isInnerButtonSelected, shouldDelete } = useSelect(
|
|
51
51
|
( select ) => {
|
|
52
|
-
const {
|
|
53
|
-
|
|
54
|
-
getBlockParents,
|
|
55
|
-
getSelectedBlockClientId,
|
|
56
|
-
} = select( blockEditorStore );
|
|
52
|
+
const { getBlockCount, getBlockParents, getSelectedBlockClientId } =
|
|
53
|
+
select( blockEditorStore );
|
|
57
54
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
58
55
|
const selectedBlockParents = getBlockParents(
|
|
59
56
|
selectedBlockClientId,
|
|
@@ -73,16 +70,15 @@ export default function ButtonsEdit( {
|
|
|
73
70
|
);
|
|
74
71
|
|
|
75
72
|
const preferredStyle = useSelect( ( select ) => {
|
|
76
|
-
const preferredStyleVariations =
|
|
77
|
-
blockEditorStore
|
|
78
|
-
|
|
73
|
+
const preferredStyleVariations =
|
|
74
|
+
select( blockEditorStore ).getSettings()
|
|
75
|
+
.__experimentalPreferredStyleVariations;
|
|
79
76
|
return preferredStyleVariations?.value?.[ buttonBlockName ];
|
|
80
77
|
}, [] );
|
|
81
78
|
|
|
82
79
|
const { getBlockOrder } = useSelect( blockEditorStore );
|
|
83
|
-
const { insertBlock, removeBlock, selectBlock } =
|
|
84
|
-
blockEditorStore
|
|
85
|
-
);
|
|
80
|
+
const { insertBlock, removeBlock, selectBlock } =
|
|
81
|
+
useDispatch( blockEditorStore );
|
|
86
82
|
|
|
87
83
|
useEffect( () => {
|
|
88
84
|
const { width } = sizes || {};
|
package/src/column/deprecated.js
CHANGED
|
@@ -33,7 +33,8 @@ const deprecated = [
|
|
|
33
33
|
const { verticalAlignment, width } = attributes;
|
|
34
34
|
|
|
35
35
|
const wrapperClasses = classnames( {
|
|
36
|
-
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
36
|
+
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
37
|
+
verticalAlignment,
|
|
37
38
|
} );
|
|
38
39
|
|
|
39
40
|
const style = { flexBasis: width + '%' };
|
package/src/column/edit.js
CHANGED
|
@@ -50,9 +50,8 @@ function ColumnEdit( {
|
|
|
50
50
|
|
|
51
51
|
const { columnsIds, hasChildBlocks, rootClientId } = useSelect(
|
|
52
52
|
( select ) => {
|
|
53
|
-
const { getBlockOrder, getBlockRootClientId } =
|
|
54
|
-
blockEditorStore
|
|
55
|
-
);
|
|
53
|
+
const { getBlockOrder, getBlockRootClientId } =
|
|
54
|
+
select( blockEditorStore );
|
|
56
55
|
|
|
57
56
|
const rootId = getBlockRootClientId( clientId );
|
|
58
57
|
|
|
@@ -261,8 +261,8 @@ export default compose( [
|
|
|
261
261
|
const selectedColumnIndex = blockOrder.indexOf( clientId );
|
|
262
262
|
const columns = getBlocks( parentId );
|
|
263
263
|
|
|
264
|
-
const parentAlignment =
|
|
265
|
-
?.verticalAlignment;
|
|
264
|
+
const parentAlignment =
|
|
265
|
+
getBlockAttributes( parentId )?.verticalAlignment;
|
|
266
266
|
|
|
267
267
|
return {
|
|
268
268
|
hasChildren,
|
|
@@ -97,7 +97,8 @@ export default [
|
|
|
97
97
|
'has-text-color': textColor || customTextColor,
|
|
98
98
|
[ backgroundClass ]: backgroundClass,
|
|
99
99
|
[ textClass ]: textClass,
|
|
100
|
-
[ `are-vertically-aligned-${ verticalAlignment }` ]:
|
|
100
|
+
[ `are-vertically-aligned-${ verticalAlignment }` ]:
|
|
101
|
+
verticalAlignment,
|
|
101
102
|
} );
|
|
102
103
|
|
|
103
104
|
const style = {
|
|
@@ -204,7 +205,8 @@ export default [
|
|
|
204
205
|
const { verticalAlignment, columns } = attributes;
|
|
205
206
|
|
|
206
207
|
const wrapperClasses = classnames( `has-${ columns }-columns`, {
|
|
207
|
-
[ `are-vertically-aligned-${ verticalAlignment }` ]:
|
|
208
|
+
[ `are-vertically-aligned-${ verticalAlignment }` ]:
|
|
209
|
+
verticalAlignment,
|
|
208
210
|
} );
|
|
209
211
|
|
|
210
212
|
return (
|
package/src/columns/edit.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import {
|
|
5
|
+
import { get, times } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -163,9 +163,8 @@ const ColumnsEditContainerWrapper = withDispatch(
|
|
|
163
163
|
const { getBlocks } = registry.select( blockEditorStore );
|
|
164
164
|
|
|
165
165
|
let innerBlocks = getBlocks( clientId );
|
|
166
|
-
const hasExplicitWidths =
|
|
167
|
-
innerBlocks
|
|
168
|
-
);
|
|
166
|
+
const hasExplicitWidths =
|
|
167
|
+
hasExplicitPercentColumnWidths( innerBlocks );
|
|
169
168
|
|
|
170
169
|
// Redistribute available width for existing inner blocks.
|
|
171
170
|
const isAddingColumn = newColumns > previousColumns;
|
|
@@ -199,9 +198,9 @@ const ColumnsEditContainerWrapper = withDispatch(
|
|
|
199
198
|
];
|
|
200
199
|
} else {
|
|
201
200
|
// The removed column will be the last of the inner blocks.
|
|
202
|
-
innerBlocks =
|
|
203
|
-
|
|
204
|
-
previousColumns - newColumns
|
|
201
|
+
innerBlocks = innerBlocks.slice(
|
|
202
|
+
0,
|
|
203
|
+
-( previousColumns - newColumns )
|
|
205
204
|
);
|
|
206
205
|
|
|
207
206
|
if ( hasExplicitWidths ) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { View, Dimensions } from 'react-native';
|
|
5
|
-
import {
|
|
5
|
+
import { times, map, compact, delay } from 'lodash';
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
@@ -347,14 +347,12 @@ const ColumnsEditContainerWrapper = withDispatch(
|
|
|
347
347
|
updateColumns( previousColumns, newColumns ) {
|
|
348
348
|
const { clientId } = ownProps;
|
|
349
349
|
const { replaceInnerBlocks } = dispatch( blockEditorStore );
|
|
350
|
-
const { getBlocks, getBlockAttributes } =
|
|
351
|
-
blockEditorStore
|
|
352
|
-
);
|
|
350
|
+
const { getBlocks, getBlockAttributes } =
|
|
351
|
+
registry.select( blockEditorStore );
|
|
353
352
|
|
|
354
353
|
let innerBlocks = getBlocks( clientId );
|
|
355
|
-
const hasExplicitWidths =
|
|
356
|
-
innerBlocks
|
|
357
|
-
);
|
|
354
|
+
const hasExplicitWidths =
|
|
355
|
+
hasExplicitPercentColumnWidths( innerBlocks );
|
|
358
356
|
|
|
359
357
|
// Redistribute available width for existing inner blocks.
|
|
360
358
|
const isAddingColumn = newColumns > previousColumns;
|
|
@@ -394,9 +392,9 @@ const ColumnsEditContainerWrapper = withDispatch(
|
|
|
394
392
|
];
|
|
395
393
|
} else {
|
|
396
394
|
// The removed column will be the last of the inner blocks.
|
|
397
|
-
innerBlocks =
|
|
398
|
-
|
|
399
|
-
previousColumns - newColumns
|
|
395
|
+
innerBlocks = innerBlocks.slice(
|
|
396
|
+
0,
|
|
397
|
+
-( previousColumns - newColumns )
|
|
400
398
|
);
|
|
401
399
|
|
|
402
400
|
if ( hasExplicitWidths ) {
|
|
@@ -414,12 +412,10 @@ const ColumnsEditContainerWrapper = withDispatch(
|
|
|
414
412
|
},
|
|
415
413
|
onAddNextColumn: () => {
|
|
416
414
|
const { clientId } = ownProps;
|
|
417
|
-
const { replaceInnerBlocks, selectBlock } =
|
|
418
|
-
blockEditorStore
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
blockEditorStore
|
|
422
|
-
);
|
|
415
|
+
const { replaceInnerBlocks, selectBlock } =
|
|
416
|
+
dispatch( blockEditorStore );
|
|
417
|
+
const { getBlocks, getBlockAttributes } =
|
|
418
|
+
registry.select( blockEditorStore );
|
|
423
419
|
|
|
424
420
|
// Get verticalAlignment from Columns block to set the same to new Column.
|
|
425
421
|
const { verticalAlignment } = getBlockAttributes( clientId );
|
package/src/columns/index.js
CHANGED
package/src/columns/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { merge, mapValues } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Returns a column width attribute value rounded to standard precision.
|
|
@@ -44,8 +44,10 @@ export function getTotalColumnsWidth(
|
|
|
44
44
|
blocks,
|
|
45
45
|
totalBlockCount = blocks.length
|
|
46
46
|
) {
|
|
47
|
-
return
|
|
48
|
-
|
|
47
|
+
return blocks.reduce(
|
|
48
|
+
( sum, block ) =>
|
|
49
|
+
sum + getEffectiveColumnWidth( block, totalBlockCount ),
|
|
50
|
+
0
|
|
49
51
|
);
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -97,7 +97,7 @@ export default function Edit( {
|
|
|
97
97
|
{ inspectorControls }
|
|
98
98
|
{ blockControls }
|
|
99
99
|
<div { ...blockProps }>
|
|
100
|
-
|
|
100
|
+
{ _x( 'Comment Author', 'block title' ) }
|
|
101
101
|
</div>
|
|
102
102
|
</>
|
|
103
103
|
);
|
|
@@ -111,7 +111,7 @@ export default function Edit( {
|
|
|
111
111
|
{ displayName }
|
|
112
112
|
</a>
|
|
113
113
|
) : (
|
|
114
|
-
|
|
114
|
+
{ displayName }
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
return (
|
package/src/comment-date/edit.js
CHANGED
|
@@ -129,7 +129,7 @@ export default function Edit( {
|
|
|
129
129
|
} else {
|
|
130
130
|
placeholder = sprintf(
|
|
131
131
|
/* translators: %s: Number of comments. */
|
|
132
|
-
_n( '%s
|
|
132
|
+
_n( '%s response', '%s responses', commentsCount ),
|
|
133
133
|
commentsCount
|
|
134
134
|
);
|
|
135
135
|
}
|
|
@@ -56,7 +56,7 @@ function render_block_core_comments_title( $attributes ) {
|
|
|
56
56
|
} else {
|
|
57
57
|
$comments_title = sprintf(
|
|
58
58
|
/* translators: %s: Number of comments. */
|
|
59
|
-
_n( '%s
|
|
59
|
+
_n( '%s response', '%s responses', $comments_count ),
|
|
60
60
|
number_format_i18n( $comments_count )
|
|
61
61
|
);
|
|
62
62
|
}
|
|
@@ -206,10 +206,8 @@ function Controls( {
|
|
|
206
206
|
setDisplayPlaceholder( true );
|
|
207
207
|
} }
|
|
208
208
|
onLoad={ ( event ) => {
|
|
209
|
-
const {
|
|
210
|
-
|
|
211
|
-
width,
|
|
212
|
-
} = event.naturalSize;
|
|
209
|
+
const { height, width } =
|
|
210
|
+
event.naturalSize;
|
|
213
211
|
setVideoNaturalSize( {
|
|
214
212
|
height,
|
|
215
213
|
width,
|
package/src/cover/deprecated.js
CHANGED
|
@@ -233,9 +233,8 @@ const v10 = {
|
|
|
233
233
|
'is-light': ! isDark,
|
|
234
234
|
'has-parallax': hasParallax,
|
|
235
235
|
'is-repeated': isRepeated,
|
|
236
|
-
'has-custom-content-position':
|
|
237
|
-
contentPosition
|
|
238
|
-
),
|
|
236
|
+
'has-custom-content-position':
|
|
237
|
+
! isContentPositionCenter( contentPosition ),
|
|
239
238
|
},
|
|
240
239
|
getPositionClassName( contentPosition )
|
|
241
240
|
);
|
|
@@ -368,9 +367,8 @@ const v9 = {
|
|
|
368
367
|
'is-light': ! isDark,
|
|
369
368
|
'has-parallax': hasParallax,
|
|
370
369
|
'is-repeated': isRepeated,
|
|
371
|
-
'has-custom-content-position':
|
|
372
|
-
contentPosition
|
|
373
|
-
),
|
|
370
|
+
'has-custom-content-position':
|
|
371
|
+
! isContentPositionCenter( contentPosition ),
|
|
374
372
|
},
|
|
375
373
|
getPositionClassName( contentPosition )
|
|
376
374
|
);
|
|
@@ -500,9 +498,8 @@ const v8 = {
|
|
|
500
498
|
'is-light': ! isDark,
|
|
501
499
|
'has-parallax': hasParallax,
|
|
502
500
|
'is-repeated': isRepeated,
|
|
503
|
-
'has-custom-content-position':
|
|
504
|
-
contentPosition
|
|
505
|
-
),
|
|
501
|
+
'has-custom-content-position':
|
|
502
|
+
! isContentPositionCenter( contentPosition ),
|
|
506
503
|
},
|
|
507
504
|
getPositionClassName( contentPosition )
|
|
508
505
|
);
|
|
@@ -654,9 +651,8 @@ const v7 = {
|
|
|
654
651
|
'is-repeated': isRepeated,
|
|
655
652
|
'has-background-gradient': gradient || customGradient,
|
|
656
653
|
[ gradientClass ]: ! url && gradientClass,
|
|
657
|
-
'has-custom-content-position':
|
|
658
|
-
contentPosition
|
|
659
|
-
),
|
|
654
|
+
'has-custom-content-position':
|
|
655
|
+
! isContentPositionCenter( contentPosition ),
|
|
660
656
|
},
|
|
661
657
|
getPositionClassName( contentPosition )
|
|
662
658
|
);
|
|
@@ -806,9 +802,8 @@ const v6 = {
|
|
|
806
802
|
'is-repeated': isRepeated,
|
|
807
803
|
'has-background-gradient': gradient || customGradient,
|
|
808
804
|
[ gradientClass ]: ! url && gradientClass,
|
|
809
|
-
'has-custom-content-position':
|
|
810
|
-
contentPosition
|
|
811
|
-
),
|
|
805
|
+
'has-custom-content-position':
|
|
806
|
+
! isContentPositionCenter( contentPosition ),
|
|
812
807
|
},
|
|
813
808
|
getPositionClassName( contentPosition )
|
|
814
809
|
);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useState } from '@wordpress/element';
|
|
5
|
-
import { ToolbarButton } from '@wordpress/components';
|
|
6
5
|
|
|
7
6
|
import {
|
|
8
7
|
BlockControls,
|
|
@@ -11,7 +10,6 @@ import {
|
|
|
11
10
|
__experimentalBlockFullHeightAligmentControl as FullHeightAlignmentControl,
|
|
12
11
|
} from '@wordpress/block-editor';
|
|
13
12
|
import { __ } from '@wordpress/i18n';
|
|
14
|
-
import { postFeaturedImage } from '@wordpress/icons';
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* Internal dependencies
|
|
@@ -35,9 +33,8 @@ export default function CoverBlockControls( {
|
|
|
35
33
|
const { hasInnerBlocks, url } = currentSettings;
|
|
36
34
|
|
|
37
35
|
const [ prevMinHeightValue, setPrevMinHeightValue ] = useState( minHeight );
|
|
38
|
-
const [ prevMinHeightUnit, setPrevMinHeightUnit ] =
|
|
39
|
-
minHeightUnit
|
|
40
|
-
);
|
|
36
|
+
const [ prevMinHeightUnit, setPrevMinHeightUnit ] =
|
|
37
|
+
useState( minHeightUnit );
|
|
41
38
|
const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
|
|
42
39
|
const toggleMinFullHeight = () => {
|
|
43
40
|
if ( isMinFullHeight ) {
|
|
@@ -97,22 +94,16 @@ export default function CoverBlockControls( {
|
|
|
97
94
|
/>
|
|
98
95
|
</BlockControls>
|
|
99
96
|
<BlockControls group="other">
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
<MediaReplaceFlow
|
|
98
|
+
mediaId={ id }
|
|
99
|
+
mediaURL={ url }
|
|
100
|
+
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
101
|
+
accept="image/*,video/*"
|
|
102
|
+
onSelect={ onSelectMedia }
|
|
103
|
+
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
104
|
+
useFeaturedImage={ useFeaturedImage }
|
|
105
|
+
name={ ! url ? __( 'Add Media' ) : __( 'Replace' ) }
|
|
105
106
|
/>
|
|
106
|
-
{ ! useFeaturedImage && (
|
|
107
|
-
<MediaReplaceFlow
|
|
108
|
-
mediaId={ id }
|
|
109
|
-
mediaURL={ url }
|
|
110
|
-
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
111
|
-
accept="image/*,video/*"
|
|
112
|
-
onSelect={ onSelectMedia }
|
|
113
|
-
name={ ! url ? __( 'Add Media' ) : __( 'Replace' ) }
|
|
114
|
-
/>
|
|
115
|
-
) }
|
|
116
107
|
</BlockControls>
|
|
117
108
|
</>
|
|
118
109
|
);
|
package/src/cover/edit/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import namesPlugin from 'colord/plugins/names';
|
|
|
10
10
|
*/
|
|
11
11
|
import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
import { useEffect, useRef } from '@wordpress/element';
|
|
13
|
-
import { Spinner } from '@wordpress/components';
|
|
13
|
+
import { Placeholder, Spinner } from '@wordpress/components';
|
|
14
14
|
import { compose } from '@wordpress/compose';
|
|
15
15
|
import {
|
|
16
16
|
withColors,
|
|
@@ -120,9 +120,8 @@ function CoverEdit( {
|
|
|
120
120
|
? IMAGE_BACKGROUND_TYPE
|
|
121
121
|
: attributes.backgroundType;
|
|
122
122
|
|
|
123
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
124
|
-
blockEditorStore
|
|
125
|
-
);
|
|
123
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
124
|
+
useDispatch( blockEditorStore );
|
|
126
125
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
127
126
|
const { gradientClass, gradientValue } = __experimentalUseGradient();
|
|
128
127
|
const onSelectMedia = attributesFromMedia( setAttributes, dimRatio );
|
|
@@ -212,23 +211,31 @@ function CoverEdit( {
|
|
|
212
211
|
overlayColor,
|
|
213
212
|
};
|
|
214
213
|
|
|
215
|
-
|
|
214
|
+
const blockControls = (
|
|
215
|
+
<CoverBlockControls
|
|
216
|
+
attributes={ attributes }
|
|
217
|
+
setAttributes={ setAttributes }
|
|
218
|
+
onSelectMedia={ onSelectMedia }
|
|
219
|
+
currentSettings={ currentSettings }
|
|
220
|
+
/>
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
const inspectorControls = (
|
|
224
|
+
<CoverInspectorControls
|
|
225
|
+
attributes={ attributes }
|
|
226
|
+
setAttributes={ setAttributes }
|
|
227
|
+
clientId={ clientId }
|
|
228
|
+
setOverlayColor={ setOverlayColor }
|
|
229
|
+
coverRef={ ref }
|
|
230
|
+
currentSettings={ currentSettings }
|
|
231
|
+
/>
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
if ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {
|
|
216
235
|
return (
|
|
217
236
|
<>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
setAttributes={ setAttributes }
|
|
221
|
-
onSelectMedia={ onSelectMedia }
|
|
222
|
-
currentSettings={ currentSettings }
|
|
223
|
-
/>
|
|
224
|
-
<CoverInspectorControls
|
|
225
|
-
attributes={ attributes }
|
|
226
|
-
setAttributes={ setAttributes }
|
|
227
|
-
clientId={ clientId }
|
|
228
|
-
setOverlayColor={ setOverlayColor }
|
|
229
|
-
coverRef={ ref }
|
|
230
|
-
currentSettings={ currentSettings }
|
|
231
|
-
/>
|
|
237
|
+
{ blockControls }
|
|
238
|
+
{ inspectorControls }
|
|
232
239
|
<div
|
|
233
240
|
{ ...blockProps }
|
|
234
241
|
className={ classnames(
|
|
@@ -279,29 +286,16 @@ function CoverEdit( {
|
|
|
279
286
|
'is-transient': isUploadingMedia,
|
|
280
287
|
'has-parallax': hasParallax,
|
|
281
288
|
'is-repeated': isRepeated,
|
|
282
|
-
'has-custom-content-position':
|
|
283
|
-
contentPosition
|
|
284
|
-
),
|
|
289
|
+
'has-custom-content-position':
|
|
290
|
+
! isContentPositionCenter( contentPosition ),
|
|
285
291
|
},
|
|
286
292
|
getPositionClassName( contentPosition )
|
|
287
293
|
);
|
|
288
294
|
|
|
289
295
|
return (
|
|
290
296
|
<>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
setAttributes={ setAttributes }
|
|
294
|
-
onSelectMedia={ onSelectMedia }
|
|
295
|
-
currentSettings={ currentSettings }
|
|
296
|
-
/>
|
|
297
|
-
<CoverInspectorControls
|
|
298
|
-
attributes={ attributes }
|
|
299
|
-
setAttributes={ setAttributes }
|
|
300
|
-
clientId={ clientId }
|
|
301
|
-
setOverlayColor={ setOverlayColor }
|
|
302
|
-
coverRef={ ref }
|
|
303
|
-
currentSettings={ currentSettings }
|
|
304
|
-
/>
|
|
297
|
+
{ blockControls }
|
|
298
|
+
{ inspectorControls }
|
|
305
299
|
<div
|
|
306
300
|
{ ...blockProps }
|
|
307
301
|
className={ classnames( classes, blockProps.className ) }
|
|
@@ -324,25 +318,34 @@ function CoverEdit( {
|
|
|
324
318
|
showHandle={ isSelected }
|
|
325
319
|
/>
|
|
326
320
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
321
|
+
{ ( ! useFeaturedImage || url ) && (
|
|
322
|
+
<span
|
|
323
|
+
aria-hidden="true"
|
|
324
|
+
className={ classnames(
|
|
325
|
+
'wp-block-cover__background',
|
|
326
|
+
dimRatioToClass( dimRatio ),
|
|
327
|
+
{
|
|
328
|
+
[ overlayColor.class ]: overlayColor.class,
|
|
329
|
+
'has-background-dim': dimRatio !== undefined,
|
|
330
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
331
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
332
|
+
// media, a gradient and a dim.
|
|
333
|
+
'wp-block-cover__gradient-background':
|
|
334
|
+
url && gradientValue && dimRatio !== 0,
|
|
335
|
+
'has-background-gradient': gradientValue,
|
|
336
|
+
[ gradientClass ]: gradientClass,
|
|
337
|
+
}
|
|
338
|
+
) }
|
|
339
|
+
style={ { backgroundImage: gradientValue, ...bgStyle } }
|
|
340
|
+
/>
|
|
341
|
+
) }
|
|
342
|
+
|
|
343
|
+
{ ! url && useFeaturedImage && (
|
|
344
|
+
<Placeholder
|
|
345
|
+
className="wp-block-cover__image--placeholder-image"
|
|
346
|
+
withIllustration={ true }
|
|
347
|
+
/>
|
|
348
|
+
) }
|
|
346
349
|
|
|
347
350
|
{ url &&
|
|
348
351
|
isImageBackground &&
|