@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
|
@@ -21,8 +21,9 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
21
21
|
import {
|
|
22
22
|
InspectorControls,
|
|
23
23
|
useSetting,
|
|
24
|
+
__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
|
|
24
25
|
__experimentalUseGradient,
|
|
25
|
-
|
|
26
|
+
__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
|
|
26
27
|
} from '@wordpress/block-editor';
|
|
27
28
|
import { __ } from '@wordpress/i18n';
|
|
28
29
|
|
|
@@ -138,6 +139,9 @@ export default function CoverInspectorControls( {
|
|
|
138
139
|
: [ coverRef.current.style, 'backgroundPosition' ];
|
|
139
140
|
styleOfRef[ property ] = mediaPosition( value );
|
|
140
141
|
};
|
|
142
|
+
|
|
143
|
+
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
|
144
|
+
|
|
141
145
|
return (
|
|
142
146
|
<>
|
|
143
147
|
<InspectorControls>
|
|
@@ -220,23 +224,50 @@ export default function CoverInspectorControls( {
|
|
|
220
224
|
</PanelRow>
|
|
221
225
|
</PanelBody>
|
|
222
226
|
) }
|
|
223
|
-
|
|
227
|
+
</InspectorControls>
|
|
228
|
+
<InspectorControls __experimentalGroup="color">
|
|
229
|
+
<ColorGradientSettingsDropdown
|
|
224
230
|
__experimentalHasMultipleOrigins
|
|
225
231
|
__experimentalIsRenderedInSidebar
|
|
226
|
-
title={ __( 'Overlay' ) }
|
|
227
|
-
initialOpen={ true }
|
|
228
232
|
settings={ [
|
|
229
233
|
{
|
|
230
234
|
colorValue: overlayColor.color,
|
|
231
235
|
gradientValue,
|
|
236
|
+
label: __( 'Overlay' ),
|
|
232
237
|
onColorChange: setOverlayColor,
|
|
233
238
|
onGradientChange: setGradient,
|
|
234
|
-
|
|
239
|
+
isShownByDefault: true,
|
|
240
|
+
resetAllFilter: () => ( {
|
|
241
|
+
overlayColor: undefined,
|
|
242
|
+
customOverlayColor: undefined,
|
|
243
|
+
gradient: undefined,
|
|
244
|
+
customGradient: undefined,
|
|
245
|
+
} ),
|
|
235
246
|
},
|
|
236
247
|
] }
|
|
248
|
+
panelId={ clientId }
|
|
249
|
+
{ ...colorGradientSettings }
|
|
250
|
+
/>
|
|
251
|
+
<ToolsPanelItem
|
|
252
|
+
hasValue={ () => {
|
|
253
|
+
// If there's a media background the dimRatio will be
|
|
254
|
+
// defaulted to 50 whereas it will be 100 for colors.
|
|
255
|
+
return dimRatio === undefined
|
|
256
|
+
? false
|
|
257
|
+
: dimRatio !== ( url ? 50 : 100 );
|
|
258
|
+
} }
|
|
259
|
+
label={ __( 'Overlay opacity' ) }
|
|
260
|
+
onDeselect={ () =>
|
|
261
|
+
setAttributes( { dimRatio: url ? 50 : 100 } )
|
|
262
|
+
}
|
|
263
|
+
resetAllFilter={ () => ( {
|
|
264
|
+
dimRatio: url ? 50 : 100,
|
|
265
|
+
} ) }
|
|
266
|
+
isShownByDefault
|
|
267
|
+
panelId={ clientId }
|
|
237
268
|
>
|
|
238
269
|
<RangeControl
|
|
239
|
-
label={ __( '
|
|
270
|
+
label={ __( 'Overlay opacity' ) }
|
|
240
271
|
value={ dimRatio }
|
|
241
272
|
onChange={ ( newDimRation ) =>
|
|
242
273
|
setAttributes( {
|
|
@@ -248,7 +279,7 @@ export default function CoverInspectorControls( {
|
|
|
248
279
|
step={ 10 }
|
|
249
280
|
required
|
|
250
281
|
/>
|
|
251
|
-
</
|
|
282
|
+
</ToolsPanelItem>
|
|
252
283
|
</InspectorControls>
|
|
253
284
|
<InspectorControls __experimentalGroup="dimensions">
|
|
254
285
|
<ToolsPanelItem
|
package/src/cover/edit.native.js
CHANGED
|
@@ -117,9 +117,8 @@ const Cover = ( {
|
|
|
117
117
|
overlayColor,
|
|
118
118
|
isDark,
|
|
119
119
|
} = attributes;
|
|
120
|
-
const [ isScreenReaderEnabled, setIsScreenReaderEnabled ] =
|
|
121
|
-
false
|
|
122
|
-
);
|
|
120
|
+
const [ isScreenReaderEnabled, setIsScreenReaderEnabled ] =
|
|
121
|
+
useState( false );
|
|
123
122
|
|
|
124
123
|
useEffect( () => {
|
|
125
124
|
let isCurrent = true;
|
|
@@ -176,10 +175,8 @@ const Cover = ( {
|
|
|
176
175
|
|
|
177
176
|
const hasOnlyColorBackground = ! url && ( hasBackground || hasInnerBlocks );
|
|
178
177
|
|
|
179
|
-
const [
|
|
180
|
-
|
|
181
|
-
setCustomColorPickerShowing,
|
|
182
|
-
] = useState( false );
|
|
178
|
+
const [ isCustomColorPickerShowing, setCustomColorPickerShowing ] =
|
|
179
|
+
useState( false );
|
|
183
180
|
|
|
184
181
|
const openMediaOptionsRef = useRef();
|
|
185
182
|
|
|
@@ -248,9 +245,8 @@ const Cover = ( {
|
|
|
248
245
|
openGeneralSidebar();
|
|
249
246
|
}
|
|
250
247
|
|
|
251
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
252
|
-
blockEditorStore
|
|
253
|
-
);
|
|
248
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
249
|
+
useDispatch( blockEditorStore );
|
|
254
250
|
const isCoverDark = useCoverIsDark(
|
|
255
251
|
isDark,
|
|
256
252
|
url,
|
|
@@ -622,9 +618,8 @@ const Cover = ( {
|
|
|
622
618
|
|
|
623
619
|
export default compose( [
|
|
624
620
|
withSelect( ( select, { clientId } ) => {
|
|
625
|
-
const { getSelectedBlockClientId, getBlock } =
|
|
626
|
-
blockEditorStore
|
|
627
|
-
);
|
|
621
|
+
const { getSelectedBlockClientId, getBlock } =
|
|
622
|
+
select( blockEditorStore );
|
|
628
623
|
|
|
629
624
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
630
625
|
|
package/src/cover/editor.scss
CHANGED
|
@@ -62,6 +62,15 @@
|
|
|
62
62
|
.wp-block-cover__placeholder-background-options {
|
|
63
63
|
width: 100%;
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
.wp-block-cover__image--placeholder-image {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
left: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
[data-align="left"] > .wp-block-cover,
|
|
@@ -98,3 +107,7 @@
|
|
|
98
107
|
.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover {
|
|
99
108
|
background-attachment: scroll;
|
|
100
109
|
}
|
|
110
|
+
|
|
111
|
+
.color-block-support-panel__inner-wrapper > :not(.block-editor-tools-panel-color-gradient-settings__item) {
|
|
112
|
+
margin-top: $grid-unit-30;
|
|
113
|
+
}
|
package/src/cover/save.js
CHANGED
|
@@ -84,9 +84,8 @@ export default function save( { attributes } ) {
|
|
|
84
84
|
'is-light': ! isDark,
|
|
85
85
|
'has-parallax': hasParallax,
|
|
86
86
|
'is-repeated': isRepeated,
|
|
87
|
-
'has-custom-content-position':
|
|
88
|
-
contentPosition
|
|
89
|
-
),
|
|
87
|
+
'has-custom-content-position':
|
|
88
|
+
! isContentPositionCenter( contentPosition ),
|
|
90
89
|
},
|
|
91
90
|
getPositionClassName( contentPosition )
|
|
92
91
|
);
|
|
@@ -493,13 +493,10 @@ describe( 'color settings', () => {
|
|
|
493
493
|
} );
|
|
494
494
|
|
|
495
495
|
it( 'clears the selected overlay color and mantains the inner blocks', async () => {
|
|
496
|
-
const {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
} = await initializeEditor( {
|
|
501
|
-
initialHtml: COVER_BLOCK_SOLID_COLOR_HTML,
|
|
502
|
-
} );
|
|
496
|
+
const { getByTestId, getByA11yLabel, getByText } =
|
|
497
|
+
await initializeEditor( {
|
|
498
|
+
initialHtml: COVER_BLOCK_SOLID_COLOR_HTML,
|
|
499
|
+
} );
|
|
503
500
|
|
|
504
501
|
// Wait for the block to be created.
|
|
505
502
|
const coverBlock = await waitFor( () =>
|
package/src/cover/transforms.js
CHANGED
|
@@ -66,13 +66,8 @@ const transforms = {
|
|
|
66
66
|
type: 'block',
|
|
67
67
|
blocks: [ 'core/group' ],
|
|
68
68
|
transform: ( attributes, innerBlocks ) => {
|
|
69
|
-
const {
|
|
70
|
-
|
|
71
|
-
anchor,
|
|
72
|
-
backgroundColor,
|
|
73
|
-
gradient,
|
|
74
|
-
style,
|
|
75
|
-
} = attributes;
|
|
69
|
+
const { align, anchor, backgroundColor, gradient, style } =
|
|
70
|
+
attributes;
|
|
76
71
|
|
|
77
72
|
// If the Group block being transformed has a Cover block as its
|
|
78
73
|
// only child return that Cover block.
|
package/src/embed/block.json
CHANGED
package/src/embed/edit.js
CHANGED
|
@@ -56,47 +56,45 @@ const EmbedEdit = ( props ) => {
|
|
|
56
56
|
const [ isEditingURL, setIsEditingURL ] = useState( false );
|
|
57
57
|
const { invalidateResolution } = useDispatch( coreStore );
|
|
58
58
|
|
|
59
|
-
const {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
} = select( coreStore );
|
|
72
|
-
if ( ! attributesUrl ) {
|
|
73
|
-
return { fetching: false, cannotEmbed: false };
|
|
74
|
-
}
|
|
59
|
+
const { preview, fetching, themeSupportsResponsive, cannotEmbed } =
|
|
60
|
+
useSelect(
|
|
61
|
+
( select ) => {
|
|
62
|
+
const {
|
|
63
|
+
getEmbedPreview,
|
|
64
|
+
isPreviewEmbedFallback,
|
|
65
|
+
isRequestingEmbedPreview,
|
|
66
|
+
getThemeSupports,
|
|
67
|
+
} = select( coreStore );
|
|
68
|
+
if ( ! attributesUrl ) {
|
|
69
|
+
return { fetching: false, cannotEmbed: false };
|
|
70
|
+
}
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
const embedPreview = getEmbedPreview( attributesUrl );
|
|
73
|
+
const previewIsFallback =
|
|
74
|
+
isPreviewEmbedFallback( attributesUrl );
|
|
75
|
+
|
|
76
|
+
// The external oEmbed provider does not exist. We got no type info and no html.
|
|
77
|
+
const badEmbedProvider =
|
|
78
|
+
embedPreview?.html === false &&
|
|
79
|
+
embedPreview?.type === undefined;
|
|
80
|
+
// Some WordPress URLs that can't be embedded will cause the API to return
|
|
81
|
+
// a valid JSON response with no HTML and `data.status` set to 404, rather
|
|
82
|
+
// than generating a fallback response as other embeds do.
|
|
83
|
+
const wordpressCantEmbed = embedPreview?.data?.status === 404;
|
|
84
|
+
const validPreview =
|
|
85
|
+
!! embedPreview &&
|
|
86
|
+
! badEmbedProvider &&
|
|
87
|
+
! wordpressCantEmbed;
|
|
88
|
+
return {
|
|
89
|
+
preview: validPreview ? embedPreview : undefined,
|
|
90
|
+
fetching: isRequestingEmbedPreview( attributesUrl ),
|
|
91
|
+
themeSupportsResponsive:
|
|
92
|
+
getThemeSupports()[ 'responsive-embeds' ],
|
|
93
|
+
cannotEmbed: ! validPreview || previewIsFallback,
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
[ attributesUrl ]
|
|
97
|
+
);
|
|
100
98
|
|
|
101
99
|
/**
|
|
102
100
|
* Returns the attributes derived from the preview, merged with the current attributes.
|
package/src/embed/edit.native.js
CHANGED
|
@@ -72,57 +72,53 @@ const EmbedEdit = ( props ) => {
|
|
|
72
72
|
const [ isEditingURL, setIsEditingURL ] = useState(
|
|
73
73
|
isSelected && wasBlockJustInserted && ! url
|
|
74
74
|
);
|
|
75
|
-
const [ showEmbedBottomSheet, setShowEmbedBottomSheet ] =
|
|
76
|
-
isEditingURL
|
|
77
|
-
);
|
|
75
|
+
const [ showEmbedBottomSheet, setShowEmbedBottomSheet ] =
|
|
76
|
+
useState( isEditingURL );
|
|
78
77
|
const { invalidateResolution } = useDispatch( coreStore );
|
|
79
78
|
|
|
80
|
-
const {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} = select( coreStore );
|
|
93
|
-
if ( ! url ) {
|
|
94
|
-
return { fetching: false, cannotEmbed: false };
|
|
95
|
-
}
|
|
79
|
+
const { preview, fetching, themeSupportsResponsive, cannotEmbed } =
|
|
80
|
+
useSelect(
|
|
81
|
+
( select ) => {
|
|
82
|
+
const {
|
|
83
|
+
getEmbedPreview,
|
|
84
|
+
hasFinishedResolution,
|
|
85
|
+
isPreviewEmbedFallback,
|
|
86
|
+
getThemeSupports,
|
|
87
|
+
} = select( coreStore );
|
|
88
|
+
if ( ! url ) {
|
|
89
|
+
return { fetching: false, cannotEmbed: false };
|
|
90
|
+
}
|
|
96
91
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
const embedPreview = getEmbedPreview( url );
|
|
93
|
+
const hasResolvedEmbedPreview = hasFinishedResolution(
|
|
94
|
+
'getEmbedPreview',
|
|
95
|
+
[ url ]
|
|
96
|
+
);
|
|
97
|
+
const previewIsFallback = isPreviewEmbedFallback( url );
|
|
103
98
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
99
|
+
// The external oEmbed provider does not exist. We got no type info and no html.
|
|
100
|
+
const badEmbedProvider =
|
|
101
|
+
embedPreview?.html === false &&
|
|
102
|
+
embedPreview?.type === undefined;
|
|
103
|
+
// Some WordPress URLs that can't be embedded will cause the API to return
|
|
104
|
+
// a valid JSON response with no HTML and `code` set to 404, rather
|
|
105
|
+
// than generating a fallback response as other embeds do.
|
|
106
|
+
const wordpressCantEmbed = embedPreview?.code === '404';
|
|
107
|
+
const validPreview =
|
|
108
|
+
!! embedPreview &&
|
|
109
|
+
! badEmbedProvider &&
|
|
110
|
+
! wordpressCantEmbed;
|
|
114
111
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
112
|
+
return {
|
|
113
|
+
preview: validPreview ? embedPreview : undefined,
|
|
114
|
+
fetching: ! hasResolvedEmbedPreview,
|
|
115
|
+
themeSupportsResponsive:
|
|
116
|
+
getThemeSupports()[ 'responsive-embeds' ],
|
|
117
|
+
cannotEmbed: ! validPreview || previewIsFallback,
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
[ url ]
|
|
121
|
+
);
|
|
126
122
|
|
|
127
123
|
/**
|
|
128
124
|
* Returns the attributes derived from the preview, merged with the current attributes.
|
|
@@ -187,9 +183,10 @@ const EmbedEdit = ( props ) => {
|
|
|
187
183
|
}
|
|
188
184
|
}, [ preview, isEditingURL ] );
|
|
189
185
|
|
|
190
|
-
useEffect(
|
|
191
|
-
isEditingURL,
|
|
192
|
-
|
|
186
|
+
useEffect(
|
|
187
|
+
() => setShowEmbedBottomSheet( isEditingURL ),
|
|
188
|
+
[ isEditingURL ]
|
|
189
|
+
);
|
|
193
190
|
|
|
194
191
|
const onEditURL = useCallback( ( value ) => {
|
|
195
192
|
// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,
|
|
@@ -30,9 +30,8 @@ const EmbedControls = ( {
|
|
|
30
30
|
linkLabel,
|
|
31
31
|
onEditURL,
|
|
32
32
|
} ) => {
|
|
33
|
-
const { closeGeneralSidebar: closeSettingsBottomSheet } =
|
|
34
|
-
editPostStore
|
|
35
|
-
);
|
|
33
|
+
const { closeGeneralSidebar: closeSettingsBottomSheet } =
|
|
34
|
+
useDispatch( editPostStore );
|
|
36
35
|
|
|
37
36
|
return (
|
|
38
37
|
<>
|
package/src/embed/style.scss
CHANGED
|
@@ -246,10 +246,8 @@ describe( 'Embed block', () => {
|
|
|
246
246
|
it( 'sets a valid URL when dismissing edit URL modal', async () => {
|
|
247
247
|
const expectedURL = 'https://twitter.com/notnownikki';
|
|
248
248
|
|
|
249
|
-
const {
|
|
250
|
-
|
|
251
|
-
getByTestId,
|
|
252
|
-
} = await insertEmbedBlock();
|
|
249
|
+
const { getByPlaceholderText, getByTestId } =
|
|
250
|
+
await insertEmbedBlock();
|
|
253
251
|
|
|
254
252
|
// Wait for edit URL modal to be visible.
|
|
255
253
|
const embedEditURLModal = getByTestId( 'embed-edit-url-modal' );
|
|
@@ -336,11 +334,8 @@ describe( 'Embed block', () => {
|
|
|
336
334
|
it( 'sets a valid URL when dismissing edit URL modal', async () => {
|
|
337
335
|
const expectedURL = 'https://twitter.com/notnownikki';
|
|
338
336
|
|
|
339
|
-
const {
|
|
340
|
-
|
|
341
|
-
getByTestId,
|
|
342
|
-
getByText,
|
|
343
|
-
} = await initializeWithEmbedBlock( EMPTY_EMBED_HTML );
|
|
337
|
+
const { getByPlaceholderText, getByTestId, getByText } =
|
|
338
|
+
await initializeWithEmbedBlock( EMPTY_EMBED_HTML );
|
|
344
339
|
|
|
345
340
|
// Edit URL.
|
|
346
341
|
fireEvent.press( getByText( 'ADD LINK' ) );
|
|
@@ -412,10 +407,8 @@ describe( 'Embed block', () => {
|
|
|
412
407
|
|
|
413
408
|
describe( 'edit URL', () => {
|
|
414
409
|
it( 'keeps the previous URL if no URL is set', async () => {
|
|
415
|
-
const {
|
|
416
|
-
|
|
417
|
-
getByTestId,
|
|
418
|
-
} = await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
410
|
+
const { getByA11yLabel, getByTestId } =
|
|
411
|
+
await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
419
412
|
|
|
420
413
|
// Open Block Settings.
|
|
421
414
|
fireEvent.press(
|
|
@@ -437,11 +430,8 @@ describe( 'Embed block', () => {
|
|
|
437
430
|
const initialURL = 'https://twitter.com/notnownikki';
|
|
438
431
|
const expectedURL = 'https://www.youtube.com/watch?v=lXMskKTw3Bc';
|
|
439
432
|
|
|
440
|
-
const {
|
|
441
|
-
|
|
442
|
-
getByDisplayValue,
|
|
443
|
-
getByTestId,
|
|
444
|
-
} = await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
433
|
+
const { getByA11yLabel, getByDisplayValue, getByTestId } =
|
|
434
|
+
await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
445
435
|
|
|
446
436
|
// Open Block Settings.
|
|
447
437
|
fireEvent.press(
|
|
@@ -673,10 +663,8 @@ describe( 'Embed block', () => {
|
|
|
673
663
|
'Full width',
|
|
674
664
|
].forEach( ( alignmentOption ) =>
|
|
675
665
|
it( `sets ${ alignmentOption } option`, async () => {
|
|
676
|
-
const {
|
|
677
|
-
|
|
678
|
-
getByText,
|
|
679
|
-
} = await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
666
|
+
const { getByA11yLabel, getByText } =
|
|
667
|
+
await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
680
668
|
|
|
681
669
|
// Open alignment options.
|
|
682
670
|
fireEvent.press(
|
|
@@ -743,10 +731,8 @@ describe( 'Embed block', () => {
|
|
|
743
731
|
);
|
|
744
732
|
} );
|
|
745
733
|
|
|
746
|
-
const {
|
|
747
|
-
|
|
748
|
-
getByText,
|
|
749
|
-
} = await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
734
|
+
const { getByA11yLabel, getByText } =
|
|
735
|
+
await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
750
736
|
|
|
751
737
|
// Convert embed to link.
|
|
752
738
|
fireEvent.press( getByText( 'More options' ) );
|
|
@@ -955,11 +941,8 @@ describe( 'Embed block', () => {
|
|
|
955
941
|
describe( 'insert via slash inserter', () => {
|
|
956
942
|
it( 'insert generic embed block', async () => {
|
|
957
943
|
const embedBlockSlashInserter = '/Embed';
|
|
958
|
-
const {
|
|
959
|
-
|
|
960
|
-
getByA11yLabel,
|
|
961
|
-
getByText,
|
|
962
|
-
} = await initializeEditor( { initialHtml: EMPTY_PARAGRAPH_HTML } );
|
|
944
|
+
const { getByPlaceholderText, getByA11yLabel, getByText } =
|
|
945
|
+
await initializeEditor( { initialHtml: EMPTY_PARAGRAPH_HTML } );
|
|
963
946
|
|
|
964
947
|
const paragraphText = getByPlaceholderText( 'Start writing…' );
|
|
965
948
|
fireEvent( paragraphText, 'focus' );
|
|
@@ -997,13 +980,10 @@ describe( 'Embed block', () => {
|
|
|
997
980
|
MOST_USED_PROVIDERS.forEach( ( { title } ) =>
|
|
998
981
|
it( `inserts ${ title } embed block`, async () => {
|
|
999
982
|
const embedBlockSlashInserter = `/${ title }`;
|
|
1000
|
-
const {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
} = await initializeEditor( {
|
|
1005
|
-
initialHtml: EMPTY_PARAGRAPH_HTML,
|
|
1006
|
-
} );
|
|
983
|
+
const { getByPlaceholderText, getByA11yLabel, getByText } =
|
|
984
|
+
await initializeEditor( {
|
|
985
|
+
initialHtml: EMPTY_PARAGRAPH_HTML,
|
|
986
|
+
} );
|
|
1007
987
|
|
|
1008
988
|
const paragraphText = getByPlaceholderText( 'Start writing…' );
|
|
1009
989
|
fireEvent( paragraphText, 'focus' );
|
|
@@ -1043,10 +1023,8 @@ describe( 'Embed block', () => {
|
|
|
1043
1023
|
it( 'sets block caption', async () => {
|
|
1044
1024
|
const expectedCaption = 'Caption';
|
|
1045
1025
|
|
|
1046
|
-
const {
|
|
1047
|
-
|
|
1048
|
-
getByDisplayValue,
|
|
1049
|
-
} = await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
1026
|
+
const { getByPlaceholderText, getByDisplayValue } =
|
|
1027
|
+
await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
1050
1028
|
|
|
1051
1029
|
// Set a caption.
|
|
1052
1030
|
const captionField = getByPlaceholderText( 'Add caption' );
|
|
@@ -1087,10 +1065,8 @@ describe( 'Embed block', () => {
|
|
|
1087
1065
|
|
|
1088
1066
|
describe( 'block settings', () => {
|
|
1089
1067
|
it( 'toggles resize for smaller devices media settings', async () => {
|
|
1090
|
-
const {
|
|
1091
|
-
|
|
1092
|
-
getByText,
|
|
1093
|
-
} = await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
1068
|
+
const { getByA11yLabel, getByText } =
|
|
1069
|
+
await initializeWithEmbedBlock( RICH_TEXT_EMBED_HTML );
|
|
1094
1070
|
|
|
1095
1071
|
// Open Block Settings.
|
|
1096
1072
|
fireEvent.press(
|
|
@@ -1106,10 +1082,8 @@ describe( 'Embed block', () => {
|
|
|
1106
1082
|
} );
|
|
1107
1083
|
|
|
1108
1084
|
it( 'does not show media settings panel if responsive is not supported', async () => {
|
|
1109
|
-
const {
|
|
1110
|
-
|
|
1111
|
-
getByText,
|
|
1112
|
-
} = await initializeWithEmbedBlock( WP_EMBED_HTML );
|
|
1085
|
+
const { getByA11yLabel, getByText } =
|
|
1086
|
+
await initializeWithEmbedBlock( WP_EMBED_HTML );
|
|
1113
1087
|
|
|
1114
1088
|
// Open Block Settings.
|
|
1115
1089
|
fireEvent.press(
|
package/src/file/edit.js
CHANGED
|
@@ -91,10 +91,8 @@ function FileEdit( {
|
|
|
91
91
|
[ id ]
|
|
92
92
|
);
|
|
93
93
|
|
|
94
|
-
const {
|
|
95
|
-
|
|
96
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
97
|
-
} = useDispatch( blockEditorStore );
|
|
94
|
+
const { toggleSelection, __unstableMarkNextChangeAsNotPersistent } =
|
|
95
|
+
useDispatch( blockEditorStore );
|
|
98
96
|
|
|
99
97
|
useEffect( () => {
|
|
100
98
|
// Upload a file drag-and-dropped into the editor.
|
package/src/file/edit.native.js
CHANGED
|
@@ -72,28 +72,22 @@ export class FileEdit extends Component {
|
|
|
72
72
|
this.onLayout = this.onLayout.bind( this );
|
|
73
73
|
this.onSelectFile = this.onSelectFile.bind( this );
|
|
74
74
|
this.onChangeFileName = this.onChangeFileName.bind( this );
|
|
75
|
-
this.onChangeDownloadButtonText =
|
|
76
|
-
this
|
|
77
|
-
);
|
|
75
|
+
this.onChangeDownloadButtonText =
|
|
76
|
+
this.onChangeDownloadButtonText.bind( this );
|
|
78
77
|
this.updateMediaProgress = this.updateMediaProgress.bind( this );
|
|
79
|
-
this.finishMediaUploadWithSuccess =
|
|
80
|
-
this
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this
|
|
84
|
-
);
|
|
78
|
+
this.finishMediaUploadWithSuccess =
|
|
79
|
+
this.finishMediaUploadWithSuccess.bind( this );
|
|
80
|
+
this.finishMediaUploadWithFailure =
|
|
81
|
+
this.finishMediaUploadWithFailure.bind( this );
|
|
85
82
|
this.getFileComponent = this.getFileComponent.bind( this );
|
|
86
|
-
this.onChangeDownloadButtonVisibility =
|
|
87
|
-
this
|
|
88
|
-
);
|
|
83
|
+
this.onChangeDownloadButtonVisibility =
|
|
84
|
+
this.onChangeDownloadButtonVisibility.bind( this );
|
|
89
85
|
this.onCopyURL = this.onCopyURL.bind( this );
|
|
90
|
-
this.onChangeOpenInNewWindow =
|
|
91
|
-
this
|
|
92
|
-
);
|
|
86
|
+
this.onChangeOpenInNewWindow =
|
|
87
|
+
this.onChangeOpenInNewWindow.bind( this );
|
|
93
88
|
|
|
94
|
-
this.onChangeLinkDestinationOption =
|
|
95
|
-
this
|
|
96
|
-
);
|
|
89
|
+
this.onChangeLinkDestinationOption =
|
|
90
|
+
this.onChangeLinkDestinationOption.bind( this );
|
|
97
91
|
this.onShowLinkSettings = this.onShowLinkSettings.bind( this );
|
|
98
92
|
this.onFilePressed = this.onFilePressed.bind( this );
|
|
99
93
|
this.mediaUploadStateReset = this.mediaUploadStateReset.bind( this );
|
|
@@ -398,13 +392,8 @@ export class FileEdit extends Component {
|
|
|
398
392
|
const { attributes, media, isSelected } = this.props;
|
|
399
393
|
const { isButtonFocused, placeholderTextWidth } = this.state;
|
|
400
394
|
|
|
401
|
-
const {
|
|
402
|
-
|
|
403
|
-
downloadButtonText,
|
|
404
|
-
id,
|
|
405
|
-
showDownloadButton,
|
|
406
|
-
align,
|
|
407
|
-
} = attributes;
|
|
395
|
+
const { fileName, downloadButtonText, id, showDownloadButton, align } =
|
|
396
|
+
attributes;
|
|
408
397
|
|
|
409
398
|
const minWidth =
|
|
410
399
|
isButtonFocused ||
|