@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/file/index.js
CHANGED
|
@@ -21,8 +21,7 @@ export const settings = {
|
|
|
21
21
|
icon,
|
|
22
22
|
example: {
|
|
23
23
|
attributes: {
|
|
24
|
-
href:
|
|
25
|
-
'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',
|
|
24
|
+
href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',
|
|
26
25
|
fileName: _x( 'Armstrong_Small_Step', 'Name of the file' ),
|
|
27
26
|
},
|
|
28
27
|
},
|
package/src/file/style.scss
CHANGED
|
@@ -10,19 +10,24 @@
|
|
|
10
10
|
text-align: right;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.wp-block-
|
|
14
|
-
margin-
|
|
13
|
+
* + .wp-block-file__button {
|
|
14
|
+
margin-left: 0.75em;
|
|
15
15
|
}
|
|
16
|
+
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color: $white;
|
|
21
|
-
font-size: 0.8em;
|
|
22
|
-
padding: 0.5em 1em;
|
|
23
|
-
}
|
|
18
|
+
.wp-block-file__embed {
|
|
19
|
+
margin-bottom: 1em;
|
|
20
|
+
}
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
//This needs a low specificity so it won't override the rules from the button element if defined in theme.json.
|
|
23
|
+
.wp-block-file__button {
|
|
24
|
+
background: #32373c;
|
|
25
|
+
border-radius: 2em;
|
|
26
|
+
color: $white;
|
|
27
|
+
font-size: 0.8em;
|
|
28
|
+
padding: 0.5em 1em;
|
|
29
|
+
|
|
30
|
+
&:is(a) {
|
|
26
31
|
text-decoration: none;
|
|
27
32
|
|
|
28
33
|
&:hover,
|
|
@@ -35,8 +40,4 @@
|
|
|
35
40
|
text-decoration: none;
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
* + .wp-block-file__button {
|
|
40
|
-
margin-left: 0.75em;
|
|
41
|
-
}
|
|
42
43
|
}
|
package/src/gallery/edit.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import {
|
|
5
|
+
import { find } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -300,11 +300,13 @@ function GalleryEdit( props ) {
|
|
|
300
300
|
|
|
301
301
|
replaceInnerBlocks(
|
|
302
302
|
clientId,
|
|
303
|
-
|
|
304
|
-
(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
existingImageBlocks
|
|
304
|
+
.concat( newBlocks )
|
|
305
|
+
.sort(
|
|
306
|
+
( a, b ) =>
|
|
307
|
+
newOrderMap[ a.attributes.id ] -
|
|
308
|
+
newOrderMap[ b.attributes.id ]
|
|
309
|
+
)
|
|
308
310
|
);
|
|
309
311
|
}
|
|
310
312
|
|
|
@@ -49,10 +49,8 @@ export const Gallery = ( props ) => {
|
|
|
49
49
|
}
|
|
50
50
|
}, [ sizes ] );
|
|
51
51
|
|
|
52
|
-
const {
|
|
53
|
-
|
|
54
|
-
columns = defaultColumnsNumber( images.length ),
|
|
55
|
-
} = attributes;
|
|
52
|
+
const { align, columns = defaultColumnsNumber( images.length ) } =
|
|
53
|
+
attributes;
|
|
56
54
|
|
|
57
55
|
const displayedColumns = Math.min(
|
|
58
56
|
columns,
|
package/src/gallery/index.js
CHANGED
|
@@ -26,15 +26,13 @@ export const settings = {
|
|
|
26
26
|
{
|
|
27
27
|
name: 'core/image',
|
|
28
28
|
attributes: {
|
|
29
|
-
url:
|
|
30
|
-
'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',
|
|
29
|
+
url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',
|
|
31
30
|
},
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
33
|
name: 'core/image',
|
|
35
34
|
attributes: {
|
|
36
|
-
url:
|
|
37
|
-
'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',
|
|
35
|
+
url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',
|
|
38
36
|
},
|
|
39
37
|
},
|
|
40
38
|
],
|
package/src/gallery/shared.js
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { get, pick } from 'lodash';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Platform } from '@wordpress/element';
|
|
10
|
+
|
|
6
11
|
export function defaultColumnsNumber( imageCount ) {
|
|
7
12
|
return imageCount ? Math.min( 3, imageCount ) : 3;
|
|
8
13
|
}
|
|
@@ -23,6 +28,15 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
|
23
28
|
return imageProps;
|
|
24
29
|
};
|
|
25
30
|
|
|
31
|
+
function getGalleryBlockV2Enabled() {
|
|
32
|
+
// We want to fail early here, at least during beta testing phase, to ensure
|
|
33
|
+
// there aren't instances where undefined values cause false negatives.
|
|
34
|
+
if ( ! window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean' ) {
|
|
35
|
+
throw 'window.wp.galleryBlockV2Enabled is not defined';
|
|
36
|
+
}
|
|
37
|
+
return window.wp.galleryBlockV2Enabled;
|
|
38
|
+
}
|
|
39
|
+
|
|
26
40
|
/**
|
|
27
41
|
* The new gallery block format is not compatible with the use_BalanceTags option
|
|
28
42
|
* in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
|
|
@@ -30,18 +44,17 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
|
30
44
|
* can be removed when minimum supported WP version >=5.9.
|
|
31
45
|
*/
|
|
32
46
|
export function isGalleryV2Enabled() {
|
|
47
|
+
// The logic for the native version is located in a different if statement
|
|
48
|
+
// due to a lint rule that prohibits a single conditional combining
|
|
49
|
+
// `process.env.IS_GUTENBERG_PLUGIN` with a native platform check.
|
|
50
|
+
if ( Platform.isNative ) {
|
|
51
|
+
return getGalleryBlockV2Enabled();
|
|
52
|
+
}
|
|
53
|
+
|
|
33
54
|
// Only run the Gallery version compat check if the plugin is running, otherwise
|
|
34
55
|
// assume we are in 5.9 core and enable by default.
|
|
35
56
|
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
36
|
-
|
|
37
|
-
// there aren't instances where undefined values cause false negatives.
|
|
38
|
-
if (
|
|
39
|
-
! window.wp ||
|
|
40
|
-
typeof window.wp.galleryBlockV2Enabled !== 'boolean'
|
|
41
|
-
) {
|
|
42
|
-
throw 'window.wp.galleryBlockV2Enabled is not defined';
|
|
43
|
-
}
|
|
44
|
-
return window.wp.galleryBlockV2Enabled;
|
|
57
|
+
return getGalleryBlockV2Enabled();
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
return true;
|
|
@@ -110,13 +110,10 @@ describe( 'Gallery block', () => {
|
|
|
110
110
|
// is addressed.
|
|
111
111
|
it.skip( 'displays media options picker when selecting the block', async () => {
|
|
112
112
|
// Initialize with an empty gallery
|
|
113
|
-
const {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} = await initializeEditor( {
|
|
118
|
-
initialHtml: generateGalleryBlock( 0 ),
|
|
119
|
-
} );
|
|
113
|
+
const { getByA11yLabel, getByText, getByTestId } =
|
|
114
|
+
await initializeEditor( {
|
|
115
|
+
initialHtml: generateGalleryBlock( 0 ),
|
|
116
|
+
} );
|
|
120
117
|
|
|
121
118
|
// Tap on Gallery block
|
|
122
119
|
fireEvent.press( getByText( 'ADD MEDIA' ) );
|
|
@@ -208,9 +205,8 @@ describe( 'Gallery block', () => {
|
|
|
208
205
|
fireEvent.press( galleryItem );
|
|
209
206
|
|
|
210
207
|
// Set gallery item caption
|
|
211
|
-
const captionField =
|
|
212
|
-
'Add caption'
|
|
213
|
-
);
|
|
208
|
+
const captionField =
|
|
209
|
+
within( galleryItem ).getByPlaceholderText( 'Add caption' );
|
|
214
210
|
setCaption(
|
|
215
211
|
captionField,
|
|
216
212
|
'<strong>Bold</strong> <em>italic</em> <s>strikethrough</s> image caption'
|
|
@@ -223,10 +219,8 @@ describe( 'Gallery block', () => {
|
|
|
223
219
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc005
|
|
224
220
|
it( 'successfully uploads items', async () => {
|
|
225
221
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
226
|
-
const {
|
|
227
|
-
|
|
228
|
-
mediaPickerCallback,
|
|
229
|
-
} = setupMediaPicker();
|
|
222
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
223
|
+
setupMediaPicker();
|
|
230
224
|
|
|
231
225
|
// Initialize with an empty gallery
|
|
232
226
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -263,10 +257,8 @@ describe( 'Gallery block', () => {
|
|
|
263
257
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc006
|
|
264
258
|
it( 'handles failed uploads', async () => {
|
|
265
259
|
const { notifyUploadingState, notifyFailedState } = setupMediaUpload();
|
|
266
|
-
const {
|
|
267
|
-
|
|
268
|
-
mediaPickerCallback,
|
|
269
|
-
} = setupMediaPicker();
|
|
260
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
261
|
+
setupMediaPicker();
|
|
270
262
|
|
|
271
263
|
// Initialize with an empty gallery
|
|
272
264
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -319,10 +311,8 @@ describe( 'Gallery block', () => {
|
|
|
319
311
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc007
|
|
320
312
|
it( 'takes a photo', async () => {
|
|
321
313
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
322
|
-
const {
|
|
323
|
-
|
|
324
|
-
mediaPickerCallback,
|
|
325
|
-
} = setupMediaPicker();
|
|
314
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
315
|
+
setupMediaPicker();
|
|
326
316
|
|
|
327
317
|
// Initialize with an empty gallery
|
|
328
318
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -360,10 +350,8 @@ describe( 'Gallery block', () => {
|
|
|
360
350
|
}.jpeg`,
|
|
361
351
|
} ) );
|
|
362
352
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
363
|
-
const {
|
|
364
|
-
|
|
365
|
-
mediaPickerCallback,
|
|
366
|
-
} = setupMediaPicker();
|
|
353
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
354
|
+
setupMediaPicker();
|
|
367
355
|
|
|
368
356
|
let otherMediaOptionsCallback;
|
|
369
357
|
getOtherMediaOptions.mockImplementation( ( filter, callback ) => {
|
|
@@ -417,10 +405,8 @@ describe( 'Gallery block', () => {
|
|
|
417
405
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc009
|
|
418
406
|
it( 'cancels uploads', async () => {
|
|
419
407
|
const { notifyUploadingState, notifyResetState } = setupMediaUpload();
|
|
420
|
-
const {
|
|
421
|
-
|
|
422
|
-
mediaPickerCallback,
|
|
423
|
-
} = setupMediaPicker();
|
|
408
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
409
|
+
setupMediaPicker();
|
|
424
410
|
|
|
425
411
|
// Initialize with an empty gallery
|
|
426
412
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -506,10 +492,8 @@ describe( 'Gallery block', () => {
|
|
|
506
492
|
localUrl: `file:///IMG_${ index + 1 }.JPG`,
|
|
507
493
|
} ) );
|
|
508
494
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
509
|
-
const {
|
|
510
|
-
|
|
511
|
-
mediaPickerCallback,
|
|
512
|
-
} = setupMediaPicker();
|
|
495
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
496
|
+
setupMediaPicker();
|
|
513
497
|
|
|
514
498
|
let otherMediaOptionsCallback;
|
|
515
499
|
getOtherMediaOptions.mockImplementation( ( filter, callback ) => {
|
package/src/gallery/v1/edit.js
CHANGED
|
@@ -90,27 +90,22 @@ function GalleryEdit( props ) {
|
|
|
90
90
|
} = attributes;
|
|
91
91
|
const [ selectedImage, setSelectedImage ] = useState();
|
|
92
92
|
const [ attachmentCaptions, setAttachmentCaptions ] = useState();
|
|
93
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
94
|
-
blockEditorStore
|
|
95
|
-
);
|
|
93
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
94
|
+
useDispatch( blockEditorStore );
|
|
96
95
|
|
|
97
|
-
const {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
blockEditorStore
|
|
111
|
-
).wasBlockJustInserted( clientId, 'inserter_menu' ),
|
|
112
|
-
};
|
|
113
|
-
} );
|
|
96
|
+
const { imageSizes, mediaUpload, getMedia, wasBlockJustInserted } =
|
|
97
|
+
useSelect( ( select ) => {
|
|
98
|
+
const settings = select( blockEditorStore ).getSettings();
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
imageSizes: settings.imageSizes,
|
|
102
|
+
mediaUpload: settings.mediaUpload,
|
|
103
|
+
getMedia: select( coreStore ).getMedia,
|
|
104
|
+
wasBlockJustInserted: select(
|
|
105
|
+
blockEditorStore
|
|
106
|
+
).wasBlockJustInserted( clientId, 'inserter_menu' ),
|
|
107
|
+
};
|
|
108
|
+
} );
|
|
114
109
|
|
|
115
110
|
const resizedImages = useMemo( () => {
|
|
116
111
|
if ( isSelected ) {
|
|
@@ -47,9 +47,8 @@ class GalleryImage extends Component {
|
|
|
47
47
|
this.onRemoveImage = this.onRemoveImage.bind( this );
|
|
48
48
|
this.bindContainer = this.bindContainer.bind( this );
|
|
49
49
|
this.onEdit = this.onEdit.bind( this );
|
|
50
|
-
this.onSelectImageFromLibrary =
|
|
51
|
-
this
|
|
52
|
-
);
|
|
50
|
+
this.onSelectImageFromLibrary =
|
|
51
|
+
this.onSelectImageFromLibrary.bind( this );
|
|
53
52
|
this.onSelectCustomURL = this.onSelectCustomURL.bind( this );
|
|
54
53
|
this.state = {
|
|
55
54
|
isEditing: false,
|
|
@@ -84,11 +83,8 @@ class GalleryImage extends Component {
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
componentDidUpdate() {
|
|
87
|
-
const {
|
|
88
|
-
|
|
89
|
-
url,
|
|
90
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
91
|
-
} = this.props;
|
|
86
|
+
const { image, url, __unstableMarkNextChangeAsNotPersistent } =
|
|
87
|
+
this.props;
|
|
92
88
|
if ( image && ! url ) {
|
|
93
89
|
__unstableMarkNextChangeAsNotPersistent();
|
|
94
90
|
this.props.setAttributes( {
|
|
@@ -273,9 +269,8 @@ export default compose( [
|
|
|
273
269
|
};
|
|
274
270
|
} ),
|
|
275
271
|
withDispatch( ( dispatch ) => {
|
|
276
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
277
|
-
blockEditorStore
|
|
278
|
-
);
|
|
272
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
273
|
+
dispatch( blockEditorStore );
|
|
279
274
|
return {
|
|
280
275
|
__unstableMarkNextChangeAsNotPersistent,
|
|
281
276
|
};
|
|
@@ -50,12 +50,10 @@ class GalleryImage extends Component {
|
|
|
50
50
|
this.onSelectMedia = this.onSelectMedia.bind( this );
|
|
51
51
|
|
|
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.renderContent = this.renderContent.bind( this );
|
|
60
58
|
|
|
61
59
|
this.state = {
|
|
@@ -79,11 +77,8 @@ class GalleryImage extends Component {
|
|
|
79
77
|
|
|
80
78
|
onMediaPressed() {
|
|
81
79
|
const { id, url, isSelected } = this.props;
|
|
82
|
-
const {
|
|
83
|
-
|
|
84
|
-
isUploadInProgress,
|
|
85
|
-
didUploadFail,
|
|
86
|
-
} = this.state;
|
|
80
|
+
const { captionSelected, isUploadInProgress, didUploadFail } =
|
|
81
|
+
this.state;
|
|
87
82
|
|
|
88
83
|
this.onSelectImage();
|
|
89
84
|
|
|
@@ -303,12 +298,8 @@ class GalleryImage extends Component {
|
|
|
303
298
|
}
|
|
304
299
|
|
|
305
300
|
render() {
|
|
306
|
-
const {
|
|
307
|
-
|
|
308
|
-
onRemove,
|
|
309
|
-
getStylesFromColorScheme,
|
|
310
|
-
isSelected,
|
|
311
|
-
} = this.props;
|
|
301
|
+
const { id, onRemove, getStylesFromColorScheme, isSelected } =
|
|
302
|
+
this.props;
|
|
312
303
|
|
|
313
304
|
const containerStyle = getStylesFromColorScheme(
|
|
314
305
|
style.galleryImageContainer,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import removeAccents from 'remove-accents';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Object map tracking anchors.
|
|
@@ -32,11 +32,14 @@ const getTextWithoutMarkup = ( text ) => {
|
|
|
32
32
|
*/
|
|
33
33
|
const getSlug = ( content ) => {
|
|
34
34
|
// Get the slug.
|
|
35
|
-
return
|
|
36
|
-
|
|
35
|
+
return (
|
|
36
|
+
removeAccents( getTextWithoutMarkup( content ) )
|
|
37
|
+
// Convert anything that's not a letter or number to a hyphen.
|
|
37
38
|
.replace( /[^\p{L}\p{N}]+/gu, '-' )
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
// Convert to lowercase
|
|
40
|
+
.toLowerCase()
|
|
41
|
+
// Remove any remaining leading or trailing hyphens.
|
|
42
|
+
.replace( /(^-+)|(-+$)/g, '' )
|
|
40
43
|
);
|
|
41
44
|
};
|
|
42
45
|
|
|
@@ -112,13 +112,8 @@ const deprecated = [
|
|
|
112
112
|
migrate: ( attributes ) =>
|
|
113
113
|
migrateCustomColors( migrateTextAlign( attributes ) ),
|
|
114
114
|
save( { attributes } ) {
|
|
115
|
-
const {
|
|
116
|
-
|
|
117
|
-
content,
|
|
118
|
-
customTextColor,
|
|
119
|
-
level,
|
|
120
|
-
textColor,
|
|
121
|
-
} = attributes;
|
|
115
|
+
const { align, content, customTextColor, level, textColor } =
|
|
116
|
+
attributes;
|
|
122
117
|
const tagName = 'h' + level;
|
|
123
118
|
|
|
124
119
|
const textClass = getColorClassName( 'color', textColor );
|
|
@@ -154,13 +149,8 @@ const deprecated = [
|
|
|
154
149
|
migrate: ( attributes ) =>
|
|
155
150
|
migrateCustomColors( migrateTextAlign( attributes ) ),
|
|
156
151
|
save( { attributes } ) {
|
|
157
|
-
const {
|
|
158
|
-
|
|
159
|
-
content,
|
|
160
|
-
customTextColor,
|
|
161
|
-
level,
|
|
162
|
-
textColor,
|
|
163
|
-
} = attributes;
|
|
152
|
+
const { align, content, customTextColor, level, textColor } =
|
|
153
|
+
attributes;
|
|
164
154
|
const tagName = 'h' + level;
|
|
165
155
|
|
|
166
156
|
const textClass = getColorClassName( 'color', textColor );
|
|
@@ -197,13 +187,8 @@ const deprecated = [
|
|
|
197
187
|
migrate: ( attributes ) =>
|
|
198
188
|
migrateCustomColors( migrateTextAlign( attributes ) ),
|
|
199
189
|
save( { attributes } ) {
|
|
200
|
-
const {
|
|
201
|
-
|
|
202
|
-
level,
|
|
203
|
-
content,
|
|
204
|
-
textColor,
|
|
205
|
-
customTextColor,
|
|
206
|
-
} = attributes;
|
|
190
|
+
const { align, level, content, textColor, customTextColor } =
|
|
191
|
+
attributes;
|
|
207
192
|
const tagName = 'h' + level;
|
|
208
193
|
|
|
209
194
|
const textClass = getColorClassName( 'color', textColor );
|
package/src/heading/edit.js
CHANGED
|
@@ -52,9 +52,8 @@ function HeadingEdit( {
|
|
|
52
52
|
};
|
|
53
53
|
}, [] );
|
|
54
54
|
|
|
55
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
56
|
-
blockEditorStore
|
|
57
|
-
);
|
|
55
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
56
|
+
useDispatch( blockEditorStore );
|
|
58
57
|
|
|
59
58
|
// Initially set anchor for headings that have content but no anchor set.
|
|
60
59
|
// This is used when transforming a block to heading, or for legacy anchors.
|
package/src/image/block.json
CHANGED
package/src/image/deprecated.js
CHANGED
|
@@ -176,16 +176,8 @@ const deprecated = [
|
|
|
176
176
|
{
|
|
177
177
|
attributes: blockAttributes,
|
|
178
178
|
save( { attributes } ) {
|
|
179
|
-
const {
|
|
180
|
-
|
|
181
|
-
alt,
|
|
182
|
-
caption,
|
|
183
|
-
align,
|
|
184
|
-
href,
|
|
185
|
-
width,
|
|
186
|
-
height,
|
|
187
|
-
id,
|
|
188
|
-
} = attributes;
|
|
179
|
+
const { url, alt, caption, align, href, width, height, id } =
|
|
180
|
+
attributes;
|
|
189
181
|
|
|
190
182
|
const classes = classnames( {
|
|
191
183
|
[ `align${ align }` ]: align,
|
|
@@ -218,16 +210,8 @@ const deprecated = [
|
|
|
218
210
|
{
|
|
219
211
|
attributes: blockAttributes,
|
|
220
212
|
save( { attributes } ) {
|
|
221
|
-
const {
|
|
222
|
-
|
|
223
|
-
alt,
|
|
224
|
-
caption,
|
|
225
|
-
align,
|
|
226
|
-
href,
|
|
227
|
-
width,
|
|
228
|
-
height,
|
|
229
|
-
id,
|
|
230
|
-
} = attributes;
|
|
213
|
+
const { url, alt, caption, align, href, width, height, id } =
|
|
214
|
+
attributes;
|
|
231
215
|
|
|
232
216
|
const image = (
|
|
233
217
|
<img
|
|
@@ -255,15 +239,8 @@ const deprecated = [
|
|
|
255
239
|
{
|
|
256
240
|
attributes: blockAttributes,
|
|
257
241
|
save( { attributes } ) {
|
|
258
|
-
const {
|
|
259
|
-
|
|
260
|
-
alt,
|
|
261
|
-
caption,
|
|
262
|
-
align,
|
|
263
|
-
href,
|
|
264
|
-
width,
|
|
265
|
-
height,
|
|
266
|
-
} = attributes;
|
|
242
|
+
const { url, alt, caption, align, href, width, height } =
|
|
243
|
+
attributes;
|
|
267
244
|
const extraImageProps = width || height ? { width, height } : {};
|
|
268
245
|
const image = (
|
|
269
246
|
<img src={ url } alt={ alt } { ...extraImageProps } />
|
package/src/image/edit.native.js
CHANGED
|
@@ -196,16 +196,13 @@ export class ImageEdit extends Component {
|
|
|
196
196
|
|
|
197
197
|
this.replacedFeaturedImage = false;
|
|
198
198
|
|
|
199
|
-
this.finishMediaUploadWithSuccess =
|
|
200
|
-
this
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this
|
|
204
|
-
);
|
|
199
|
+
this.finishMediaUploadWithSuccess =
|
|
200
|
+
this.finishMediaUploadWithSuccess.bind( this );
|
|
201
|
+
this.finishMediaUploadWithFailure =
|
|
202
|
+
this.finishMediaUploadWithFailure.bind( this );
|
|
205
203
|
this.mediaUploadStateReset = this.mediaUploadStateReset.bind( this );
|
|
206
|
-
this.onSelectMediaUploadOption =
|
|
207
|
-
this
|
|
208
|
-
);
|
|
204
|
+
this.onSelectMediaUploadOption =
|
|
205
|
+
this.onSelectMediaUploadOption.bind( this );
|
|
209
206
|
this.updateMediaProgress = this.updateMediaProgress.bind( this );
|
|
210
207
|
this.updateImageURL = this.updateImageURL.bind( this );
|
|
211
208
|
this.onSetNewTab = this.onSetNewTab.bind( this );
|
|
@@ -215,9 +212,8 @@ export class ImageEdit extends Component {
|
|
|
215
212
|
this.onFocusCaption = this.onFocusCaption.bind( this );
|
|
216
213
|
this.onSelectURL = this.onSelectURL.bind( this );
|
|
217
214
|
this.updateAlignment = this.updateAlignment.bind( this );
|
|
218
|
-
this.accessibilityLabelCreator =
|
|
219
|
-
this
|
|
220
|
-
);
|
|
215
|
+
this.accessibilityLabelCreator =
|
|
216
|
+
this.accessibilityLabelCreator.bind( this );
|
|
221
217
|
this.setMappedAttributes = this.setMappedAttributes.bind( this );
|
|
222
218
|
this.onSizeChangeValue = this.onSizeChangeValue.bind( this );
|
|
223
219
|
}
|
|
@@ -270,12 +266,8 @@ export class ImageEdit extends Component {
|
|
|
270
266
|
}
|
|
271
267
|
|
|
272
268
|
componentDidUpdate( previousProps ) {
|
|
273
|
-
const {
|
|
274
|
-
|
|
275
|
-
attributes,
|
|
276
|
-
setAttributes,
|
|
277
|
-
featuredImageId,
|
|
278
|
-
} = this.props;
|
|
269
|
+
const { image, attributes, setAttributes, featuredImageId } =
|
|
270
|
+
this.props;
|
|
279
271
|
if ( ! previousProps.image && image ) {
|
|
280
272
|
const url =
|
|
281
273
|
getUrlForSlug( image, attributes?.sizeSlug ) ||
|
|
@@ -469,11 +461,8 @@ export class ImageEdit extends Component {
|
|
|
469
461
|
}
|
|
470
462
|
|
|
471
463
|
onSelectURL( newURL ) {
|
|
472
|
-
const {
|
|
473
|
-
|
|
474
|
-
imageDefaultSize,
|
|
475
|
-
setAttributes,
|
|
476
|
-
} = this.props;
|
|
464
|
+
const { createErrorNotice, imageDefaultSize, setAttributes } =
|
|
465
|
+
this.props;
|
|
477
466
|
|
|
478
467
|
if ( isURL( newURL ) ) {
|
|
479
468
|
this.setState( {
|
|
@@ -906,9 +895,8 @@ export class ImageEdit extends Component {
|
|
|
906
895
|
export default compose( [
|
|
907
896
|
withSelect( ( select, props ) => {
|
|
908
897
|
const { getMedia } = select( coreStore );
|
|
909
|
-
const { getSettings, wasBlockJustInserted } =
|
|
910
|
-
blockEditorStore
|
|
911
|
-
);
|
|
898
|
+
const { getSettings, wasBlockJustInserted } =
|
|
899
|
+
select( blockEditorStore );
|
|
912
900
|
const { getEditedPostAttribute } = select( 'core/editor' );
|
|
913
901
|
const {
|
|
914
902
|
attributes: { id, url },
|