@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
package/src/image/image.js
CHANGED
|
@@ -92,9 +92,8 @@ export default function Image( {
|
|
|
92
92
|
const { image, multiImageSelection } = useSelect(
|
|
93
93
|
( select ) => {
|
|
94
94
|
const { getMedia } = select( coreStore );
|
|
95
|
-
const { getMultiSelectedBlockClientIds, getBlockName } =
|
|
96
|
-
blockEditorStore
|
|
97
|
-
);
|
|
95
|
+
const { getMultiSelectedBlockClientIds, getBlockName } =
|
|
96
|
+
select( blockEditorStore );
|
|
98
97
|
const multiSelectedClientIds = getMultiSelectedBlockClientIds();
|
|
99
98
|
return {
|
|
100
99
|
image:
|
|
@@ -111,42 +110,36 @@ export default function Image( {
|
|
|
111
110
|
},
|
|
112
111
|
[ id, isSelected ]
|
|
113
112
|
);
|
|
114
|
-
const {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
getBlockRootClientId
|
|
124
|
-
getSettings,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
),
|
|
142
|
-
};
|
|
143
|
-
},
|
|
144
|
-
[ clientId ]
|
|
145
|
-
);
|
|
113
|
+
const { canInsertCover, imageEditing, imageSizes, maxWidth, mediaUpload } =
|
|
114
|
+
useSelect(
|
|
115
|
+
( select ) => {
|
|
116
|
+
const {
|
|
117
|
+
getBlockRootClientId,
|
|
118
|
+
getSettings,
|
|
119
|
+
canInsertBlockType,
|
|
120
|
+
} = select( blockEditorStore );
|
|
121
|
+
|
|
122
|
+
const rootClientId = getBlockRootClientId( clientId );
|
|
123
|
+
const settings = pick( getSettings(), [
|
|
124
|
+
'imageEditing',
|
|
125
|
+
'imageSizes',
|
|
126
|
+
'maxWidth',
|
|
127
|
+
'mediaUpload',
|
|
128
|
+
] );
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
...settings,
|
|
132
|
+
canInsertCover: canInsertBlockType(
|
|
133
|
+
'core/cover',
|
|
134
|
+
rootClientId
|
|
135
|
+
),
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
[ clientId ]
|
|
139
|
+
);
|
|
146
140
|
const { replaceBlocks, toggleSelection } = useDispatch( blockEditorStore );
|
|
147
|
-
const { createErrorNotice, createSuccessNotice } =
|
|
148
|
-
noticesStore
|
|
149
|
-
);
|
|
141
|
+
const { createErrorNotice, createSuccessNotice } =
|
|
142
|
+
useDispatch( noticesStore );
|
|
150
143
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
151
144
|
const isWideAligned = includes( [ 'wide', 'full' ], align );
|
|
152
145
|
const [
|
package/src/image/style.scss
CHANGED
package/src/image/transforms.js
CHANGED
|
@@ -90,9 +90,10 @@ const transforms = {
|
|
|
90
90
|
node.className +
|
|
91
91
|
' ' +
|
|
92
92
|
node.querySelector( 'img' ).className;
|
|
93
|
-
const alignMatches =
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
const alignMatches =
|
|
94
|
+
/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(
|
|
95
|
+
className
|
|
96
|
+
);
|
|
96
97
|
const anchor = node.id === '' ? undefined : node.id;
|
|
97
98
|
const align = alignMatches ? alignMatches[ 1 ] : undefined;
|
|
98
99
|
const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(
|
package/src/image/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { isEmpty,
|
|
4
|
+
import { isEmpty, get } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -13,7 +13,7 @@ export function removeNewTabRel( currentRel ) {
|
|
|
13
13
|
|
|
14
14
|
if ( currentRel !== undefined && ! isEmpty( newRel ) ) {
|
|
15
15
|
if ( ! isEmpty( newRel ) ) {
|
|
16
|
-
|
|
16
|
+
NEW_TAB_REL.forEach( ( relVal ) => {
|
|
17
17
|
const regExp = new RegExp( '\\b' + relVal + '\\b', 'gi' );
|
|
18
18
|
newRel = newRel.replace( regExp, '' );
|
|
19
19
|
} );
|
package/src/index.js
CHANGED
|
@@ -153,7 +153,7 @@ const getAllBlocks = () => [
|
|
|
153
153
|
buttons,
|
|
154
154
|
calendar,
|
|
155
155
|
categories,
|
|
156
|
-
window.wp && window.wp.oldEditor ? classic :
|
|
156
|
+
...( window.wp && window.wp.oldEditor ? [ classic ] : [] ), // Only add the classic block in WP Context.
|
|
157
157
|
code,
|
|
158
158
|
column,
|
|
159
159
|
columns,
|
|
@@ -25,12 +25,8 @@ const MIN_COMMENTS = 1;
|
|
|
25
25
|
const MAX_COMMENTS = 100;
|
|
26
26
|
|
|
27
27
|
export default function LatestComments( { attributes, setAttributes } ) {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
displayAvatar,
|
|
31
|
-
displayDate,
|
|
32
|
-
displayExcerpt,
|
|
33
|
-
} = attributes;
|
|
28
|
+
const { commentsToShow, displayAvatar, displayDate, displayExcerpt } =
|
|
29
|
+
attributes;
|
|
34
30
|
|
|
35
31
|
return (
|
|
36
32
|
<div { ...useBlockProps() }>
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get, includes, invoke,
|
|
4
|
+
import { get, includes, invoke, pickBy } from 'lodash';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -113,7 +113,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
113
113
|
per_page: postsToShow,
|
|
114
114
|
_embed: 'wp:featuredmedia',
|
|
115
115
|
},
|
|
116
|
-
( value ) =>
|
|
116
|
+
( value ) => typeof value !== 'undefined'
|
|
117
117
|
);
|
|
118
118
|
|
|
119
119
|
return {
|
|
@@ -450,13 +450,12 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
450
450
|
excerptElement.innerText ||
|
|
451
451
|
'';
|
|
452
452
|
|
|
453
|
-
const {
|
|
454
|
-
|
|
455
|
-
alt: featuredImageAlt,
|
|
456
|
-
} = getFeaturedImageDetails( post, featuredImageSizeSlug );
|
|
453
|
+
const { url: imageSourceUrl, alt: featuredImageAlt } =
|
|
454
|
+
getFeaturedImageDetails( post, featuredImageSizeSlug );
|
|
457
455
|
const imageClasses = classnames( {
|
|
458
456
|
'wp-block-latest-posts__featured-image': true,
|
|
459
|
-
[ `align${ featuredImageAlign }` ]:
|
|
457
|
+
[ `align${ featuredImageAlign }` ]:
|
|
458
|
+
!! featuredImageAlign,
|
|
460
459
|
} );
|
|
461
460
|
const renderFeaturedImage =
|
|
462
461
|
displayFeaturedImage && imageSourceUrl;
|
|
@@ -38,23 +38,18 @@ class LatestPostsEdit extends Component {
|
|
|
38
38
|
this.state = {
|
|
39
39
|
categoriesList: [],
|
|
40
40
|
};
|
|
41
|
-
this.onSetDisplayPostContent =
|
|
42
|
-
this
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this
|
|
46
|
-
);
|
|
41
|
+
this.onSetDisplayPostContent =
|
|
42
|
+
this.onSetDisplayPostContent.bind( this );
|
|
43
|
+
this.onSetDisplayPostContentRadio =
|
|
44
|
+
this.onSetDisplayPostContentRadio.bind( this );
|
|
47
45
|
this.onSetExcerptLength = this.onSetExcerptLength.bind( this );
|
|
48
46
|
this.onSetDisplayPostDate = this.onSetDisplayPostDate.bind( this );
|
|
49
|
-
this.onSetDisplayFeaturedImage =
|
|
50
|
-
this
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.onSetAddLinkToFeaturedImage = this.onSetAddLinkToFeaturedImage.bind(
|
|
56
|
-
this
|
|
57
|
-
);
|
|
47
|
+
this.onSetDisplayFeaturedImage =
|
|
48
|
+
this.onSetDisplayFeaturedImage.bind( this );
|
|
49
|
+
this.onSetFeaturedImageAlign =
|
|
50
|
+
this.onSetFeaturedImageAlign.bind( this );
|
|
51
|
+
this.onSetAddLinkToFeaturedImage =
|
|
52
|
+
this.onSetAddLinkToFeaturedImage.bind( this );
|
|
58
53
|
this.onSetOrder = this.onSetOrder.bind( this );
|
|
59
54
|
this.onSetOrderBy = this.onSetOrderBy.bind( this );
|
|
60
55
|
this.onSetPostsToShow = this.onSetPostsToShow.bind( this );
|
package/src/list/index.js
CHANGED
|
@@ -21,8 +21,7 @@ const settingsV1 = {
|
|
|
21
21
|
icon,
|
|
22
22
|
example: {
|
|
23
23
|
attributes: {
|
|
24
|
-
values:
|
|
25
|
-
'<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',
|
|
24
|
+
values: '<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',
|
|
26
25
|
},
|
|
27
26
|
},
|
|
28
27
|
transforms,
|
package/src/list/test/migrate.js
CHANGED
|
@@ -27,8 +27,7 @@ describe( 'Migrate list block', () => {
|
|
|
27
27
|
|
|
28
28
|
it( 'should migrate the values attribute to inner blocks', () => {
|
|
29
29
|
const [ updatedAttributes, updatedInnerBlocks ] = migrateToListV2( {
|
|
30
|
-
values:
|
|
31
|
-
'<li>test</li><li>test</li><li>test<ol><li>test test</li><li>test est eesssss</li></ol></li>',
|
|
30
|
+
values: '<li>test</li><li>test</li><li>test<ol><li>test test</li><li>test est eesssss</li></ol></li>',
|
|
32
31
|
ordered: false,
|
|
33
32
|
} );
|
|
34
33
|
|
package/src/list/v2/edit.js
CHANGED
|
@@ -45,9 +45,8 @@ const TEMPLATE = [ [ 'core/list-item' ] ];
|
|
|
45
45
|
*/
|
|
46
46
|
function useMigrateOnLoad( attributes, clientId ) {
|
|
47
47
|
const registry = useRegistry();
|
|
48
|
-
const { updateBlockAttributes, replaceInnerBlocks } =
|
|
49
|
-
blockEditorStore
|
|
50
|
-
);
|
|
48
|
+
const { updateBlockAttributes, replaceInnerBlocks } =
|
|
49
|
+
useDispatch( blockEditorStore );
|
|
51
50
|
|
|
52
51
|
useEffect( () => {
|
|
53
52
|
// As soon as the block is loaded, migrate it to the new version.
|
|
@@ -74,9 +73,8 @@ function useMigrateOnLoad( attributes, clientId ) {
|
|
|
74
73
|
function useOutdentList( clientId ) {
|
|
75
74
|
const { canOutdent } = useSelect(
|
|
76
75
|
( innerSelect ) => {
|
|
77
|
-
const { getBlockRootClientId, getBlock } =
|
|
78
|
-
blockEditorStore
|
|
79
|
-
);
|
|
76
|
+
const { getBlockRootClientId, getBlock } =
|
|
77
|
+
innerSelect( blockEditorStore );
|
|
80
78
|
const parentId = getBlockRootClientId( clientId );
|
|
81
79
|
return {
|
|
82
80
|
canOutdent:
|
|
@@ -87,9 +85,8 @@ function useOutdentList( clientId ) {
|
|
|
87
85
|
[ clientId ]
|
|
88
86
|
);
|
|
89
87
|
const { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );
|
|
90
|
-
const { getBlockRootClientId, getBlockAttributes, getBlock } =
|
|
91
|
-
blockEditorStore
|
|
92
|
-
);
|
|
88
|
+
const { getBlockRootClientId, getBlockAttributes, getBlock } =
|
|
89
|
+
useSelect( blockEditorStore );
|
|
93
90
|
|
|
94
91
|
return [
|
|
95
92
|
canOutdent,
|
|
@@ -13,9 +13,8 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
13
13
|
import useOutdentListItem from './use-outdent-list-item';
|
|
14
14
|
|
|
15
15
|
export default function useBackspace( props ) {
|
|
16
|
-
const { getSelectionStart, getSelectionEnd } =
|
|
17
|
-
blockEditorStore
|
|
18
|
-
);
|
|
16
|
+
const { getSelectionStart, getSelectionEnd } =
|
|
17
|
+
useSelect( blockEditorStore );
|
|
19
18
|
const propsRef = useRef( props );
|
|
20
19
|
propsRef.current = props;
|
|
21
20
|
const [ canOutdent, outdentListItem ] = useOutdentListItem(
|
|
@@ -19,9 +19,8 @@ import useOutdentListItem from './use-outdent-list-item';
|
|
|
19
19
|
|
|
20
20
|
export default function useEnter( props ) {
|
|
21
21
|
const { replaceBlocks } = useDispatch( blockEditorStore );
|
|
22
|
-
const { getBlock, getBlockRootClientId, getBlockIndex } =
|
|
23
|
-
blockEditorStore
|
|
24
|
-
);
|
|
22
|
+
const { getBlock, getBlockRootClientId, getBlockIndex } =
|
|
23
|
+
useSelect( blockEditorStore );
|
|
25
24
|
const propsRef = useRef( props );
|
|
26
25
|
propsRef.current = props;
|
|
27
26
|
const [ canOutdent, outdentListItem ] = useOutdentListItem(
|
|
@@ -11,9 +11,8 @@ export default function useIndentListItem( clientId ) {
|
|
|
11
11
|
( select ) => select( blockEditorStore ).getBlockIndex( clientId ) > 0,
|
|
12
12
|
[ clientId ]
|
|
13
13
|
);
|
|
14
|
-
const { replaceBlocks, selectionChange, multiSelect } =
|
|
15
|
-
blockEditorStore
|
|
16
|
-
);
|
|
14
|
+
const { replaceBlocks, selectionChange, multiSelect } =
|
|
15
|
+
useDispatch( blockEditorStore );
|
|
17
16
|
const {
|
|
18
17
|
getBlock,
|
|
19
18
|
getPreviousBlockClientId,
|
|
@@ -42,9 +42,8 @@ export default function useOutdentListItem( clientId ) {
|
|
|
42
42
|
const listParentId = getBlockRootClientId( clientId );
|
|
43
43
|
const listAttributes = getBlockAttributes( listParentId );
|
|
44
44
|
const listItemParentId = getBlockRootClientId( listParentId );
|
|
45
|
-
const listItemParentAttributes =
|
|
46
|
-
listItemParentId
|
|
47
|
-
);
|
|
45
|
+
const listItemParentAttributes =
|
|
46
|
+
getBlockAttributes( listItemParentId );
|
|
48
47
|
|
|
49
48
|
const index = getBlockIndex( clientId );
|
|
50
49
|
const siblingBlocks = getBlock( listParentId ).innerBlocks;
|
|
@@ -12,9 +12,8 @@ import { useSelect } from '@wordpress/data';
|
|
|
12
12
|
import useIndentListItem from './use-indent-list-item';
|
|
13
13
|
|
|
14
14
|
export default function useSpace( clientId ) {
|
|
15
|
-
const { getSelectionStart, getSelectionEnd } =
|
|
16
|
-
blockEditorStore
|
|
17
|
-
);
|
|
15
|
+
const { getSelectionStart, getSelectionEnd } =
|
|
16
|
+
useSelect( blockEditorStore );
|
|
18
17
|
const [ canIndent, indentListItem ] = useIndentListItem( clientId );
|
|
19
18
|
|
|
20
19
|
return useRefEffect(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import {
|
|
5
|
+
import { isEmpty, omit } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -15,6 +15,7 @@ import { InnerBlocks, getColorClassName } from '@wordpress/block-editor';
|
|
|
15
15
|
import { imageFillStyles } from './media-container';
|
|
16
16
|
|
|
17
17
|
const DEFAULT_MEDIA_WIDTH = 50;
|
|
18
|
+
const noop = () => {};
|
|
18
19
|
|
|
19
20
|
const migrateCustomColors = ( attributes ) => {
|
|
20
21
|
if ( ! attributes.customBackgroundColor ) {
|
|
@@ -173,7 +174,8 @@ export default [
|
|
|
173
174
|
'has-background': backgroundClass || customBackgroundColor,
|
|
174
175
|
[ backgroundClass ]: backgroundClass,
|
|
175
176
|
'is-stacked-on-mobile': isStackedOnMobile,
|
|
176
|
-
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
177
|
+
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
178
|
+
verticalAlignment,
|
|
177
179
|
'is-image-fill': imageFill,
|
|
178
180
|
} );
|
|
179
181
|
const backgroundStyles = imageFill
|
|
@@ -268,7 +270,8 @@ export default [
|
|
|
268
270
|
'has-media-on-the-right': 'right' === mediaPosition,
|
|
269
271
|
[ backgroundClass ]: backgroundClass,
|
|
270
272
|
'is-stacked-on-mobile': isStackedOnMobile,
|
|
271
|
-
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
273
|
+
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
274
|
+
verticalAlignment,
|
|
272
275
|
'is-image-fill': imageFill,
|
|
273
276
|
} );
|
|
274
277
|
const backgroundStyles = imageFill
|
|
@@ -395,11 +395,8 @@ class MediaTextEdit extends Component {
|
|
|
395
395
|
export default compose(
|
|
396
396
|
withColors( 'backgroundColor' ),
|
|
397
397
|
withSelect( ( select, { clientId } ) => {
|
|
398
|
-
const {
|
|
399
|
-
|
|
400
|
-
getBlockParents,
|
|
401
|
-
getSettings,
|
|
402
|
-
} = select( blockEditorStore );
|
|
398
|
+
const { getSelectedBlockClientId, getBlockParents, getSettings } =
|
|
399
|
+
select( blockEditorStore );
|
|
403
400
|
|
|
404
401
|
const parents = getBlockParents( clientId, true );
|
|
405
402
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { noop } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -30,6 +29,7 @@ import icon from './media-container-icon';
|
|
|
30
29
|
* Constants
|
|
31
30
|
*/
|
|
32
31
|
const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];
|
|
32
|
+
const noop = () => {};
|
|
33
33
|
|
|
34
34
|
export function imageFillStyles( url, focalPoint ) {
|
|
35
35
|
return url
|
|
@@ -50,16 +50,13 @@ class MediaContainer extends Component {
|
|
|
50
50
|
constructor() {
|
|
51
51
|
super( ...arguments );
|
|
52
52
|
this.updateMediaProgress = this.updateMediaProgress.bind( this );
|
|
53
|
-
this.finishMediaUploadWithSuccess =
|
|
54
|
-
this
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this
|
|
58
|
-
);
|
|
53
|
+
this.finishMediaUploadWithSuccess =
|
|
54
|
+
this.finishMediaUploadWithSuccess.bind( this );
|
|
55
|
+
this.finishMediaUploadWithFailure =
|
|
56
|
+
this.finishMediaUploadWithFailure.bind( this );
|
|
59
57
|
this.mediaUploadStateReset = this.mediaUploadStateReset.bind( this );
|
|
60
|
-
this.onSelectMediaUploadOption =
|
|
61
|
-
this
|
|
62
|
-
);
|
|
58
|
+
this.onSelectMediaUploadOption =
|
|
59
|
+
this.onSelectMediaUploadOption.bind( this );
|
|
63
60
|
this.onMediaPressed = this.onMediaPressed.bind( this );
|
|
64
61
|
|
|
65
62
|
this.state = {
|
package/src/media-text/save.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import {
|
|
5
|
+
import { isEmpty } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -16,6 +16,7 @@ import { imageFillStyles } from './media-container';
|
|
|
16
16
|
import { DEFAULT_MEDIA_SIZE_SLUG } from './constants';
|
|
17
17
|
|
|
18
18
|
const DEFAULT_MEDIA_WIDTH = 50;
|
|
19
|
+
const noop = () => {};
|
|
19
20
|
|
|
20
21
|
export default function save( { attributes } ) {
|
|
21
22
|
const {
|
|
@@ -298,9 +298,8 @@ export default compose( [
|
|
|
298
298
|
canEnableUnsupportedBlockEditor:
|
|
299
299
|
getSettings( 'capabilities' )
|
|
300
300
|
.canEnableUnsupportedBlockEditor === true,
|
|
301
|
-
isEditableInUnsupportedBlockEditor:
|
|
302
|
-
attributes.originalName
|
|
303
|
-
),
|
|
301
|
+
isEditableInUnsupportedBlockEditor:
|
|
302
|
+
! UBE_INCOMPATIBLE_BLOCKS.includes( attributes.originalName ),
|
|
304
303
|
};
|
|
305
304
|
} ),
|
|
306
305
|
withDispatch( ( dispatch, ownProps ) => {
|
|
@@ -48,9 +48,8 @@ describe( 'Unsupported block', () => {
|
|
|
48
48
|
getByA11yLabel( /Unsupported Block\. Row 1/ )
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
const translatedTableTitle =
|
|
52
|
-
'Tabla'
|
|
53
|
-
);
|
|
51
|
+
const translatedTableTitle =
|
|
52
|
+
within( missingBlock ).getByText( 'Tabla' );
|
|
54
53
|
|
|
55
54
|
expect( translatedTableTitle ).toBeDefined();
|
|
56
55
|
} );
|
|
@@ -74,9 +74,8 @@ describe( 'Missing block', () => {
|
|
|
74
74
|
|
|
75
75
|
it( 'renders edit action if UBE is available', () => {
|
|
76
76
|
const testInstance = getTestComponentWithContent();
|
|
77
|
-
const bottomSheet =
|
|
78
|
-
BottomSheet
|
|
79
|
-
);
|
|
77
|
+
const bottomSheet =
|
|
78
|
+
testInstance.UNSAFE_getByType( BottomSheet );
|
|
80
79
|
const bottomSheetCells = bottomSheet.props.children[ 1 ];
|
|
81
80
|
expect( bottomSheetCells ).toBeTruthy();
|
|
82
81
|
expect( bottomSheetCells.props.children.length ).toBe( 2 );
|
|
@@ -91,9 +90,8 @@ describe( 'Missing block', () => {
|
|
|
91
90
|
} );
|
|
92
91
|
|
|
93
92
|
const testInstance = getTestComponentWithContent();
|
|
94
|
-
const bottomSheet =
|
|
95
|
-
BottomSheet
|
|
96
|
-
);
|
|
93
|
+
const bottomSheet =
|
|
94
|
+
testInstance.UNSAFE_getByType( BottomSheet );
|
|
97
95
|
expect( bottomSheet.props.children[ 1 ] ).toBeFalsy();
|
|
98
96
|
} );
|
|
99
97
|
|
|
@@ -101,9 +99,8 @@ describe( 'Missing block', () => {
|
|
|
101
99
|
const testInstance = getTestComponentWithContent( {
|
|
102
100
|
originalName: 'core/block',
|
|
103
101
|
} );
|
|
104
|
-
const bottomSheet =
|
|
105
|
-
BottomSheet
|
|
106
|
-
);
|
|
102
|
+
const bottomSheet =
|
|
103
|
+
testInstance.UNSAFE_getByType( BottomSheet );
|
|
107
104
|
expect( bottomSheet.props.children[ 1 ] ).toBeFalsy();
|
|
108
105
|
} );
|
|
109
106
|
} );
|
|
@@ -33,11 +33,8 @@ const migrateWithLayout = ( attributes ) => {
|
|
|
33
33
|
return attributes;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
orientation,
|
|
39
|
-
...updatedAttributes
|
|
40
|
-
} = attributes;
|
|
36
|
+
const { itemsJustification, orientation, ...updatedAttributes } =
|
|
37
|
+
attributes;
|
|
41
38
|
|
|
42
39
|
if ( itemsJustification || orientation ) {
|
|
43
40
|
Object.assign( updatedAttributes, {
|
|
@@ -79,8 +79,8 @@ function detectColors( colorsDetectionElement, setColor, setBackground ) {
|
|
|
79
79
|
setColor( getComputedStyle( colorsDetectionElement ).color );
|
|
80
80
|
|
|
81
81
|
let backgroundColorNode = colorsDetectionElement;
|
|
82
|
-
let backgroundColor =
|
|
83
|
-
.backgroundColor;
|
|
82
|
+
let backgroundColor =
|
|
83
|
+
getComputedStyle( backgroundColorNode ).backgroundColor;
|
|
84
84
|
while (
|
|
85
85
|
backgroundColor === 'rgba(0, 0, 0, 0)' &&
|
|
86
86
|
backgroundColorNode.parentNode &&
|
|
@@ -88,8 +88,8 @@ function detectColors( colorsDetectionElement, setColor, setBackground ) {
|
|
|
88
88
|
backgroundColorNode.parentNode.ELEMENT_NODE
|
|
89
89
|
) {
|
|
90
90
|
backgroundColorNode = backgroundColorNode.parentNode;
|
|
91
|
-
backgroundColor =
|
|
92
|
-
.backgroundColor;
|
|
91
|
+
backgroundColor =
|
|
92
|
+
getComputedStyle( backgroundColorNode ).backgroundColor;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
setBackground( backgroundColor );
|
|
@@ -147,12 +147,10 @@ function Navigation( {
|
|
|
147
147
|
name: 'block-library/core/navigation/delete',
|
|
148
148
|
} );
|
|
149
149
|
|
|
150
|
-
const [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
name: 'block-library/core/navigation/create',
|
|
155
|
-
} );
|
|
150
|
+
const [ showNavigationMenuCreateNotice, hideNavigationMenuCreateNotice ] =
|
|
151
|
+
useNavigationNotice( {
|
|
152
|
+
name: 'block-library/core/navigation/create',
|
|
153
|
+
} );
|
|
156
154
|
|
|
157
155
|
const {
|
|
158
156
|
create: createNavigationMenu,
|
|
@@ -199,16 +197,16 @@ function Navigation( {
|
|
|
199
197
|
hasSubmenus,
|
|
200
198
|
} = useSelect(
|
|
201
199
|
( select ) => {
|
|
202
|
-
const { getBlock, getBlocks, hasSelectedInnerBlock } =
|
|
203
|
-
blockEditorStore
|
|
204
|
-
);
|
|
200
|
+
const { getBlock, getBlocks, hasSelectedInnerBlock } =
|
|
201
|
+
select( blockEditorStore );
|
|
205
202
|
|
|
206
203
|
// This relies on the fact that `getBlock` won't return controlled
|
|
207
204
|
// inner blocks, while `getBlocks` does. It might be more stable to
|
|
208
205
|
// introduce a selector like `getUncontrolledInnerBlocks`, just in
|
|
209
206
|
// case `getBlock` is fixed.
|
|
210
207
|
const _uncontrolledInnerBlocks = getBlock( clientId ).innerBlocks;
|
|
211
|
-
const _hasUncontrolledInnerBlocks =
|
|
208
|
+
const _hasUncontrolledInnerBlocks =
|
|
209
|
+
!! _uncontrolledInnerBlocks?.length;
|
|
212
210
|
const _controlledInnerBlocks = _hasUncontrolledInnerBlocks
|
|
213
211
|
? EMPTY_ARRAY
|
|
214
212
|
: getBlocks( clientId );
|
|
@@ -233,14 +231,11 @@ function Navigation( {
|
|
|
233
231
|
__unstableMarkNextChangeAsNotPersistent,
|
|
234
232
|
} = useDispatch( blockEditorStore );
|
|
235
233
|
|
|
236
|
-
const [
|
|
237
|
-
|
|
238
|
-
setHasSavedUnsavedInnerBlocks,
|
|
239
|
-
] = useState( false );
|
|
234
|
+
const [ hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks ] =
|
|
235
|
+
useState( false );
|
|
240
236
|
|
|
241
|
-
const [ isResponsiveMenuOpen, setResponsiveMenuVisibility ] =
|
|
242
|
-
false
|
|
243
|
-
);
|
|
237
|
+
const [ isResponsiveMenuOpen, setResponsiveMenuVisibility ] =
|
|
238
|
+
useState( false );
|
|
244
239
|
|
|
245
240
|
const [ overlayMenuPreview, setOverlayMenuPreview ] = useState( false );
|
|
246
241
|
|
|
@@ -335,10 +330,8 @@ function Navigation( {
|
|
|
335
330
|
'no-wrap': flexWrap === 'nowrap',
|
|
336
331
|
'is-responsive': 'never' !== overlayMenu,
|
|
337
332
|
'has-text-color': !! textColor.color || !! textColor?.class,
|
|
338
|
-
[ getColorClassName(
|
|
339
|
-
|
|
340
|
-
textColor?.slug
|
|
341
|
-
) ]: !! textColor?.slug,
|
|
333
|
+
[ getColorClassName( 'color', textColor?.slug ) ]:
|
|
334
|
+
!! textColor?.slug,
|
|
342
335
|
'has-background':
|
|
343
336
|
!! backgroundColor.color || backgroundColor.class,
|
|
344
337
|
[ getColorClassName(
|
|
@@ -360,10 +353,8 @@ function Navigation( {
|
|
|
360
353
|
const overlayClassnames = classnames( {
|
|
361
354
|
'has-text-color':
|
|
362
355
|
!! overlayTextColor.color || !! overlayTextColor?.class,
|
|
363
|
-
[ getColorClassName(
|
|
364
|
-
|
|
365
|
-
overlayTextColor?.slug
|
|
366
|
-
) ]: !! overlayTextColor?.slug,
|
|
356
|
+
[ getColorClassName( 'color', overlayTextColor?.slug ) ]:
|
|
357
|
+
!! overlayTextColor?.slug,
|
|
367
358
|
'has-background':
|
|
368
359
|
!! overlayBackgroundColor.color || overlayBackgroundColor?.class,
|
|
369
360
|
[ getColorClassName(
|
|
@@ -506,19 +497,16 @@ function Navigation( {
|
|
|
506
497
|
] );
|
|
507
498
|
|
|
508
499
|
const navigationSelectorRef = useRef();
|
|
509
|
-
const [
|
|
510
|
-
|
|
511
|
-
setShouldFocusNavigationSelector,
|
|
512
|
-
] = useState( false );
|
|
500
|
+
const [ shouldFocusNavigationSelector, setShouldFocusNavigationSelector ] =
|
|
501
|
+
useState( false );
|
|
513
502
|
const handleSelectNavigation = useCallback(
|
|
514
503
|
( navPostOrClassicMenu ) => {
|
|
515
504
|
if ( ! navPostOrClassicMenu ) {
|
|
516
505
|
return;
|
|
517
506
|
}
|
|
518
507
|
|
|
519
|
-
const isClassicMenu =
|
|
520
|
-
'auto_add'
|
|
521
|
-
);
|
|
508
|
+
const isClassicMenu =
|
|
509
|
+
navPostOrClassicMenu.hasOwnProperty( 'auto_add' );
|
|
522
510
|
|
|
523
511
|
if ( isClassicMenu ) {
|
|
524
512
|
convert( navPostOrClassicMenu.id, navPostOrClassicMenu.name );
|