@wordpress/block-library 7.16.0 → 7.18.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 +4 -1
- package/build/archives/edit.js +1 -0
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +44 -4
- package/build/audio/edit.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/edit.native.js +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/comment-template/edit.js +40 -32
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/index.js +6 -2
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/edit/placeholder.js +1 -4
- package/build/comments/edit/placeholder.js.map +1 -1
- package/build/comments/index.js +5 -1
- package/build/comments/index.js.map +1 -1
- package/build/comments-title/edit.js +18 -1
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/edit/index.js +2 -2
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +3 -7
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/use-cover-is-dark.js +8 -7
- package/build/cover/edit/use-cover-is-dark.js.map +1 -1
- package/build/embed/deprecated.js +43 -4
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/variations.js +1 -1
- package/build/embed/variations.js.map +1 -1
- package/build/file/deprecated.js +108 -4
- package/build/file/deprecated.js.map +1 -1
- package/build/file/transforms.js +3 -9
- package/build/file/transforms.js.map +1 -1
- package/build/gallery/deprecated.js +148 -23
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/gallery.js +3 -2
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/transforms.js +3 -3
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-image-sizes.js +2 -1
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/v1/edit.js +3 -2
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/edit.js +7 -3
- package/build/group/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +33 -12
- package/build/image/image.js.map +1 -1
- package/build/image/transforms.js +1 -7
- package/build/image/transforms.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/transforms.js +9 -1
- package/build/list/transforms.js.map +1 -1
- package/build/list/utils.js +4 -8
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +3 -2
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +3 -2
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +19 -22
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +24 -10
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/index.js +14 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +14 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/navigation/edit/index.js +45 -31
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +3 -5
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +25 -8
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/index.js +4 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +5 -3
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -4
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +29 -10
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +1 -5
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +3 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/pattern/edit.js +11 -4
- package/build/pattern/edit.js.map +1 -1
- package/build/post-comments-count/index.js +4 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/form.js +1 -2
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-form/index.js +4 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +4 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +14 -6
- package/build/post-content/edit.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -6
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +79 -104
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/search/edit.js +3 -4
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +7 -10
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +21 -9
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-title/edit/index.js +20 -8
- package/build/site-title/edit/index.js.map +1 -1
- package/build/social-link/edit.js +11 -2
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +3 -0
- package/build/social-link/index.js.map +1 -1
- package/build/spacer/controls.js +3 -7
- package/build/spacer/controls.js.map +1 -1
- package/build/table/deprecated.js +282 -27
- package/build/table/deprecated.js.map +1 -1
- package/build/table/state.js +2 -2
- package/build/table/state.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -4
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +8 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -4
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build/video/deprecated.js +159 -0
- package/build/video/deprecated.js.map +1 -0
- package/build/video/edit.js +41 -5
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +3 -0
- package/build/video/index.js.map +1 -1
- package/build/video/tracks-editor.js +3 -28
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +1 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +46 -7
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/button/edit.js +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/comment-template/edit.js +38 -30
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/index.js +6 -2
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/edit/placeholder.js +1 -3
- package/build-module/comments/edit/placeholder.js.map +1 -1
- package/build-module/comments/index.js +5 -1
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-title/edit.js +18 -2
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/cover/edit/index.js +2 -2
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +4 -8
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/use-cover-is-dark.js +7 -7
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -1
- package/build-module/embed/deprecated.js +44 -5
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/variations.js +1 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/deprecated.js +108 -4
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/transforms.js +3 -8
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/gallery/deprecated.js +147 -25
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/gallery.js +3 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/transforms.js +4 -4
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +3 -2
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/v1/edit.js +4 -3
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/group/edit.js +7 -3
- package/build-module/group/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +36 -15
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/transforms.js +1 -6
- package/build-module/image/transforms.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/list/transforms.js +9 -1
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/utils.js +5 -9
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +3 -2
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +3 -2
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +19 -21
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +24 -9
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/index.js +14 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +14 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/navigation/edit/index.js +45 -31
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +3 -5
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +3 -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 +25 -8
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/index.js +4 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -4
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +29 -10
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +1 -5
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +3 -10
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/pattern/edit.js +10 -3
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +4 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/form.js +2 -3
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-comments-form/index.js +4 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +4 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +14 -6
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/pullquote/deprecated.js +7 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +4 -4
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +81 -102
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/search/edit.js +4 -5
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +8 -11
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +23 -11
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-title/edit/index.js +22 -10
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/social-link/edit.js +11 -2
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +3 -0
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/spacer/controls.js +4 -8
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/deprecated.js +282 -27
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/state.js +3 -3
- package/build-module/table/state.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -3
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +8 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +5 -5
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-module/video/deprecated.js +147 -0
- package/build-module/video/deprecated.js.map +1 -0
- package/build-module/video/edit.js +45 -9
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +2 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/tracks-editor.js +4 -29
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/archives/style-rtl.css +4 -0
- package/build-style/archives/style.css +4 -0
- package/build-style/button/style-rtl.css +1 -0
- package/build-style/button/style.css +1 -0
- package/build-style/comment-template/style-rtl.css +1 -0
- package/build-style/comment-template/style.css +1 -0
- package/build-style/comments/editor-rtl.css +1 -0
- package/build-style/comments/editor.css +1 -0
- package/build-style/comments/style-rtl.css +1 -0
- package/build-style/comments/style.css +1 -0
- package/build-style/cover/editor-rtl.css +4 -0
- package/build-style/cover/editor.css +4 -0
- package/build-style/editor-rtl.css +13 -21
- package/build-style/editor.css +13 -21
- package/build-style/group/editor-rtl.css +1 -0
- package/build-style/group/editor.css +1 -0
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/navigation/editor-rtl.css +5 -4
- package/build-style/navigation/editor.css +5 -4
- package/build-style/navigation/style-rtl.css +3 -1
- package/build-style/navigation/style.css +3 -1
- package/build-style/paragraph/editor-rtl.css +0 -16
- package/build-style/paragraph/editor.css +0 -16
- package/build-style/post-comments-form/style-rtl.css +3 -0
- package/build-style/post-comments-form/style.css +3 -0
- package/build-style/site-logo/editor-rtl.css +1 -0
- package/build-style/site-logo/editor.css +1 -0
- package/build-style/style-rtl.css +16 -1
- package/build-style/style.css +16 -1
- package/build-style/tag-cloud/style-rtl.css +3 -0
- package/build-style/tag-cloud/style.css +3 -0
- package/package.json +29 -28
- package/src/archives/edit.js +1 -0
- package/src/archives/style.scss +5 -0
- package/src/audio/edit.js +79 -24
- package/src/avatar/index.php +1 -1
- package/src/button/edit.js +1 -1
- package/src/button/style.scss +2 -0
- package/src/buttons/edit.native.js +1 -1
- package/src/code/test/__snapshots__/edit.native.js.snap +13 -0
- package/src/code/test/edit.native.js +46 -32
- package/src/comment-template/block.json +6 -2
- package/src/comment-template/edit.js +47 -34
- package/src/comment-template/style.scss +2 -0
- package/src/comments/block.json +5 -1
- package/src/comments/edit/placeholder.js +1 -7
- package/src/comments/style.scss +2 -0
- package/src/comments-title/edit.js +24 -1
- package/src/cover/edit/index.js +2 -7
- package/src/cover/edit/inspector-controls.js +11 -13
- package/src/cover/edit/use-cover-is-dark.js +11 -11
- package/src/cover/editor.scss +7 -0
- package/src/embed/deprecated.js +53 -26
- package/src/embed/variations.js +1 -1
- package/src/file/deprecated.js +130 -2
- package/src/file/transforms.js +3 -8
- package/src/gallery/deprecated.js +129 -4
- package/src/gallery/gallery.js +2 -0
- package/src/gallery/index.php +19 -10
- package/src/gallery/transforms.js +8 -5
- package/src/gallery/use-image-sizes.js +3 -2
- package/src/gallery/v1/edit.js +4 -3
- package/src/group/edit.js +10 -2
- package/src/group/editor.scss +1 -0
- package/src/image/edit.native.js +1 -1
- package/src/image/editor.scss +4 -1
- package/src/image/image.js +75 -33
- package/src/image/transforms.js +1 -7
- package/src/latest-posts/edit.js +2 -2
- package/src/list/test/edit.native.js +102 -3
- package/src/list/transforms.js +11 -0
- package/src/list/utils.js +3 -11
- package/src/list-item/block.json +14 -1
- package/src/list-item/edit.js +2 -1
- package/src/list-item/edit.native.js +2 -1
- package/src/list-item/hooks/use-merge.js +4 -23
- package/src/list-item/hooks/use-outdent-list-item.js +9 -8
- package/src/navigation/block.json +4 -1
- package/src/navigation/edit/index.js +61 -37
- package/src/navigation/edit/inner-blocks.js +2 -5
- package/src/navigation/edit/unsaved-inner-blocks.js +9 -2
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +32 -5
- package/src/navigation/edit/use-create-navigation-menu.js +2 -5
- package/src/navigation/editor.scss +5 -4
- package/src/navigation/index.php +103 -6
- package/src/navigation/style.scss +3 -1
- package/src/navigation-link/edit.js +6 -5
- package/src/navigation-link/index.php +8 -1
- package/src/navigation-submenu/edit.js +7 -5
- package/src/navigation-submenu/index.php +8 -1
- package/src/page-list/block.json +1 -5
- package/src/page-list/edit.js +36 -22
- package/src/page-list/index.php +8 -6
- package/src/paragraph/edit.js +1 -14
- package/src/paragraph/editor.scss +0 -20
- package/src/pattern/edit.js +10 -3
- package/src/post-comments-count/block.json +4 -0
- package/src/post-comments-form/block.json +4 -0
- package/src/post-comments-form/form.js +2 -3
- package/src/post-comments-form/style.scss +3 -0
- package/src/post-comments-link/block.json +4 -0
- package/src/post-content/edit.js +8 -4
- package/src/pullquote/deprecated.js +7 -7
- package/src/query/edit/inspector-controls/index.js +4 -3
- package/src/query/edit/inspector-controls/taxonomy-controls.js +82 -87
- package/src/rss/index.php +3 -3
- package/src/search/edit.js +7 -2
- package/src/search/index.php +21 -13
- package/src/site-logo/edit.js +12 -10
- package/src/site-logo/editor.scss +1 -0
- package/src/site-tagline/edit.js +25 -18
- package/src/site-title/edit/index.js +26 -12
- package/src/social-link/block.json +3 -0
- package/src/social-link/edit.js +8 -1
- package/src/social-link/index.php +11 -7
- package/src/spacer/controls.js +10 -12
- package/src/table/deprecated.js +587 -348
- package/src/table/state.js +3 -3
- package/src/table-of-contents/edit.js +1 -3
- package/src/tag-cloud/block.json +8 -0
- package/src/tag-cloud/edit.js +1 -1
- package/src/tag-cloud/style.scss +3 -0
- package/src/template-part/index.php +4 -0
- package/src/utils/clean-empty-object.js +5 -6
- package/src/video/deprecated.js +57 -0
- package/src/video/edit.js +71 -23
- package/src/video/index.js +2 -0
- package/src/video/tracks-editor.js +12 -28
- package/build/paragraph/drop-zone.js +0 -99
- package/build/paragraph/drop-zone.js.map +0 -1
- package/build-module/paragraph/drop-zone.js +0 -88
- package/build-module/paragraph/drop-zone.js.map +0 -1
- package/src/paragraph/drop-zone.js +0 -105
package/src/cover/editor.scss
CHANGED
|
@@ -107,3 +107,10 @@
|
|
|
107
107
|
.color-block-support-panel__inner-wrapper > :not(.block-editor-tools-panel-color-gradient-settings__item) {
|
|
108
108
|
margin-top: $grid-unit-30;
|
|
109
109
|
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
// The frontend style.scss includes a min-height as an IE11 fix.
|
|
113
|
+
// This fix causes extra spacing for the focus style in the editor, so we omit it here.
|
|
114
|
+
.wp-block-cover::after {
|
|
115
|
+
min-height: auto;
|
|
116
|
+
}
|
package/src/embed/deprecated.js
CHANGED
|
@@ -11,36 +11,63 @@ import metadata from './block.json';
|
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { RichText } from '@wordpress/block-editor';
|
|
14
|
+
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
15
15
|
|
|
16
16
|
const { attributes: blockAttributes } = metadata;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
// In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname
|
|
19
|
+
// to the embed figcaption element.
|
|
20
|
+
const v2 = {
|
|
21
|
+
attributes: blockAttributes,
|
|
22
|
+
save( { attributes } ) {
|
|
23
|
+
const { url, caption, type, providerNameSlug } = attributes;
|
|
24
|
+
|
|
25
|
+
if ( ! url ) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const className = classnames( 'wp-block-embed', {
|
|
30
|
+
[ `is-type-${ type }` ]: type,
|
|
31
|
+
[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,
|
|
32
|
+
[ `wp-block-embed-${ providerNameSlug }` ]: providerNameSlug,
|
|
33
|
+
} );
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<figure { ...useBlockProps.save( { className } ) }>
|
|
37
|
+
<div className="wp-block-embed__wrapper">
|
|
33
38
|
{ `\n${ url }\n` /* URL needs to be on its own line. */ }
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
</div>
|
|
40
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
41
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
42
|
+
) }
|
|
43
|
+
</figure>
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const v1 = {
|
|
49
|
+
attributes: blockAttributes,
|
|
50
|
+
save( { attributes: { url, caption, type, providerNameSlug } } ) {
|
|
51
|
+
if ( ! url ) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const embedClassName = classnames( 'wp-block-embed', {
|
|
56
|
+
[ `is-type-${ type }` ]: type,
|
|
57
|
+
[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,
|
|
58
|
+
} );
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<figure className={ embedClassName }>
|
|
62
|
+
{ `\n${ url }\n` /* URL needs to be on its own line. */ }
|
|
63
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
64
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
65
|
+
) }
|
|
66
|
+
</figure>
|
|
67
|
+
);
|
|
43
68
|
},
|
|
44
|
-
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const deprecated = [ v2, v1 ];
|
|
45
72
|
|
|
46
73
|
export default deprecated;
|
package/src/embed/variations.js
CHANGED
|
@@ -309,7 +309,7 @@ const variations = [
|
|
|
309
309
|
icon: embedTumblrIcon,
|
|
310
310
|
keywords: [ __( 'social' ) ],
|
|
311
311
|
description: __( 'Embed a Tumblr post.' ),
|
|
312
|
-
patterns: [ /^https?:\/\/(
|
|
312
|
+
patterns: [ /^https?:\/\/(.+)\.tumblr\.com\/.+/i ],
|
|
313
313
|
attributes: { providerNameSlug: 'tumblr', responsive: true },
|
|
314
314
|
},
|
|
315
315
|
{
|
package/src/file/deprecated.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { __, sprintf } from '@wordpress/i18n';
|
|
15
15
|
|
|
16
16
|
// Version of the file block without PR#43050 removing the translated aria-label.
|
|
17
|
-
const
|
|
17
|
+
const v3 = {
|
|
18
18
|
attributes: {
|
|
19
19
|
id: {
|
|
20
20
|
type: 'number',
|
|
@@ -143,6 +143,134 @@ const v2 = {
|
|
|
143
143
|
},
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
+
// In #41239 the button was made an element button which added a `wp-element-button` classname
|
|
147
|
+
// to the download link element.
|
|
148
|
+
const v2 = {
|
|
149
|
+
attributes: {
|
|
150
|
+
id: {
|
|
151
|
+
type: 'number',
|
|
152
|
+
},
|
|
153
|
+
href: {
|
|
154
|
+
type: 'string',
|
|
155
|
+
},
|
|
156
|
+
fileId: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
source: 'attribute',
|
|
159
|
+
selector: 'a:not([download])',
|
|
160
|
+
attribute: 'id',
|
|
161
|
+
},
|
|
162
|
+
fileName: {
|
|
163
|
+
type: 'string',
|
|
164
|
+
source: 'html',
|
|
165
|
+
selector: 'a:not([download])',
|
|
166
|
+
},
|
|
167
|
+
textLinkHref: {
|
|
168
|
+
type: 'string',
|
|
169
|
+
source: 'attribute',
|
|
170
|
+
selector: 'a:not([download])',
|
|
171
|
+
attribute: 'href',
|
|
172
|
+
},
|
|
173
|
+
textLinkTarget: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
source: 'attribute',
|
|
176
|
+
selector: 'a:not([download])',
|
|
177
|
+
attribute: 'target',
|
|
178
|
+
},
|
|
179
|
+
showDownloadButton: {
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
default: true,
|
|
182
|
+
},
|
|
183
|
+
downloadButtonText: {
|
|
184
|
+
type: 'string',
|
|
185
|
+
source: 'html',
|
|
186
|
+
selector: 'a[download]',
|
|
187
|
+
},
|
|
188
|
+
displayPreview: {
|
|
189
|
+
type: 'boolean',
|
|
190
|
+
},
|
|
191
|
+
previewHeight: {
|
|
192
|
+
type: 'number',
|
|
193
|
+
default: 600,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
supports: {
|
|
197
|
+
anchor: true,
|
|
198
|
+
align: true,
|
|
199
|
+
},
|
|
200
|
+
save( { attributes } ) {
|
|
201
|
+
const {
|
|
202
|
+
href,
|
|
203
|
+
fileId,
|
|
204
|
+
fileName,
|
|
205
|
+
textLinkHref,
|
|
206
|
+
textLinkTarget,
|
|
207
|
+
showDownloadButton,
|
|
208
|
+
downloadButtonText,
|
|
209
|
+
displayPreview,
|
|
210
|
+
previewHeight,
|
|
211
|
+
} = attributes;
|
|
212
|
+
|
|
213
|
+
const pdfEmbedLabel = RichText.isEmpty( fileName )
|
|
214
|
+
? __( 'PDF embed' )
|
|
215
|
+
: sprintf(
|
|
216
|
+
/* translators: %s: filename. */
|
|
217
|
+
__( 'Embed of %s.' ),
|
|
218
|
+
fileName
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
const hasFilename = ! RichText.isEmpty( fileName );
|
|
222
|
+
|
|
223
|
+
// Only output an `aria-describedby` when the element it's referring to is
|
|
224
|
+
// actually rendered.
|
|
225
|
+
const describedById = hasFilename ? fileId : undefined;
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
href && (
|
|
229
|
+
<div { ...useBlockProps.save() }>
|
|
230
|
+
{ displayPreview && (
|
|
231
|
+
<>
|
|
232
|
+
<object
|
|
233
|
+
className="wp-block-file__embed"
|
|
234
|
+
data={ href }
|
|
235
|
+
type="application/pdf"
|
|
236
|
+
style={ {
|
|
237
|
+
width: '100%',
|
|
238
|
+
height: `${ previewHeight }px`,
|
|
239
|
+
} }
|
|
240
|
+
aria-label={ pdfEmbedLabel }
|
|
241
|
+
/>
|
|
242
|
+
</>
|
|
243
|
+
) }
|
|
244
|
+
{ hasFilename && (
|
|
245
|
+
<a
|
|
246
|
+
id={ describedById }
|
|
247
|
+
href={ textLinkHref }
|
|
248
|
+
target={ textLinkTarget }
|
|
249
|
+
rel={
|
|
250
|
+
textLinkTarget
|
|
251
|
+
? 'noreferrer noopener'
|
|
252
|
+
: undefined
|
|
253
|
+
}
|
|
254
|
+
>
|
|
255
|
+
<RichText.Content value={ fileName } />
|
|
256
|
+
</a>
|
|
257
|
+
) }
|
|
258
|
+
{ showDownloadButton && (
|
|
259
|
+
<a
|
|
260
|
+
href={ href }
|
|
261
|
+
className="wp-block-file__button"
|
|
262
|
+
download={ true }
|
|
263
|
+
aria-describedby={ describedById }
|
|
264
|
+
>
|
|
265
|
+
<RichText.Content value={ downloadButtonText } />
|
|
266
|
+
</a>
|
|
267
|
+
) }
|
|
268
|
+
</div>
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
|
|
146
274
|
// Version of the file block without PR#28062 accessibility fix.
|
|
147
275
|
const v1 = {
|
|
148
276
|
attributes: {
|
|
@@ -255,6 +383,6 @@ const v1 = {
|
|
|
255
383
|
},
|
|
256
384
|
};
|
|
257
385
|
|
|
258
|
-
const deprecated = [ v2, v1 ];
|
|
386
|
+
const deprecated = [ v3, v2, v1 ];
|
|
259
387
|
|
|
260
388
|
export default deprecated;
|
package/src/file/transforms.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { includes } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -92,7 +87,7 @@ const transforms = {
|
|
|
92
87
|
}
|
|
93
88
|
const { getMedia } = select( coreStore );
|
|
94
89
|
const media = getMedia( id );
|
|
95
|
-
return !! media &&
|
|
90
|
+
return !! media && media.mime_type.includes( 'audio' );
|
|
96
91
|
},
|
|
97
92
|
transform: ( attributes ) => {
|
|
98
93
|
return createBlock( 'core/audio', {
|
|
@@ -112,7 +107,7 @@ const transforms = {
|
|
|
112
107
|
}
|
|
113
108
|
const { getMedia } = select( coreStore );
|
|
114
109
|
const media = getMedia( id );
|
|
115
|
-
return !! media &&
|
|
110
|
+
return !! media && media.mime_type.includes( 'video' );
|
|
116
111
|
},
|
|
117
112
|
transform: ( attributes ) => {
|
|
118
113
|
return createBlock( 'core/video', {
|
|
@@ -132,7 +127,7 @@ const transforms = {
|
|
|
132
127
|
}
|
|
133
128
|
const { getMedia } = select( coreStore );
|
|
134
129
|
const media = getMedia( id );
|
|
135
|
-
return !! media &&
|
|
130
|
+
return !! media && media.mime_type.includes( 'image' );
|
|
136
131
|
},
|
|
137
132
|
transform: ( attributes ) => {
|
|
138
133
|
return createBlock( 'core/image', {
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { map
|
|
5
|
+
import { map } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
RichText,
|
|
12
|
+
useBlockProps,
|
|
13
|
+
useInnerBlocksProps,
|
|
14
|
+
} from '@wordpress/block-editor';
|
|
11
15
|
|
|
12
16
|
import { createBlock } from '@wordpress/blocks';
|
|
13
17
|
|
|
@@ -127,6 +131,127 @@ export function getImageBlock( image, sizeSlug, linkTo ) {
|
|
|
127
131
|
} );
|
|
128
132
|
}
|
|
129
133
|
|
|
134
|
+
// In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname
|
|
135
|
+
// to the gallery figcaption element.
|
|
136
|
+
const v7 = {
|
|
137
|
+
attributes: {
|
|
138
|
+
images: {
|
|
139
|
+
type: 'array',
|
|
140
|
+
default: [],
|
|
141
|
+
source: 'query',
|
|
142
|
+
selector: '.blocks-gallery-item',
|
|
143
|
+
query: {
|
|
144
|
+
url: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
source: 'attribute',
|
|
147
|
+
selector: 'img',
|
|
148
|
+
attribute: 'src',
|
|
149
|
+
},
|
|
150
|
+
fullUrl: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
source: 'attribute',
|
|
153
|
+
selector: 'img',
|
|
154
|
+
attribute: 'data-full-url',
|
|
155
|
+
},
|
|
156
|
+
link: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
source: 'attribute',
|
|
159
|
+
selector: 'img',
|
|
160
|
+
attribute: 'data-link',
|
|
161
|
+
},
|
|
162
|
+
alt: {
|
|
163
|
+
type: 'string',
|
|
164
|
+
source: 'attribute',
|
|
165
|
+
selector: 'img',
|
|
166
|
+
attribute: 'alt',
|
|
167
|
+
default: '',
|
|
168
|
+
},
|
|
169
|
+
id: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
source: 'attribute',
|
|
172
|
+
selector: 'img',
|
|
173
|
+
attribute: 'data-id',
|
|
174
|
+
},
|
|
175
|
+
caption: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
source: 'html',
|
|
178
|
+
selector: '.blocks-gallery-item__caption',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
ids: {
|
|
183
|
+
type: 'array',
|
|
184
|
+
items: {
|
|
185
|
+
type: 'number',
|
|
186
|
+
},
|
|
187
|
+
default: [],
|
|
188
|
+
},
|
|
189
|
+
shortCodeTransforms: {
|
|
190
|
+
type: 'array',
|
|
191
|
+
default: [],
|
|
192
|
+
items: {
|
|
193
|
+
type: 'object',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
columns: {
|
|
197
|
+
type: 'number',
|
|
198
|
+
minimum: 1,
|
|
199
|
+
maximum: 8,
|
|
200
|
+
},
|
|
201
|
+
caption: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
source: 'html',
|
|
204
|
+
selector: '.blocks-gallery-caption',
|
|
205
|
+
},
|
|
206
|
+
imageCrop: {
|
|
207
|
+
type: 'boolean',
|
|
208
|
+
default: true,
|
|
209
|
+
},
|
|
210
|
+
fixedHeight: {
|
|
211
|
+
type: 'boolean',
|
|
212
|
+
default: true,
|
|
213
|
+
},
|
|
214
|
+
linkTarget: {
|
|
215
|
+
type: 'string',
|
|
216
|
+
},
|
|
217
|
+
linkTo: {
|
|
218
|
+
type: 'string',
|
|
219
|
+
},
|
|
220
|
+
sizeSlug: {
|
|
221
|
+
type: 'string',
|
|
222
|
+
default: 'large',
|
|
223
|
+
},
|
|
224
|
+
allowResize: {
|
|
225
|
+
type: 'boolean',
|
|
226
|
+
default: false,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
save( { attributes } ) {
|
|
230
|
+
const { caption, columns, imageCrop } = attributes;
|
|
231
|
+
|
|
232
|
+
const className = classnames( 'has-nested-images', {
|
|
233
|
+
[ `columns-${ columns }` ]: columns !== undefined,
|
|
234
|
+
[ `columns-default` ]: columns === undefined,
|
|
235
|
+
'is-cropped': imageCrop,
|
|
236
|
+
} );
|
|
237
|
+
const blockProps = useBlockProps.save( { className } );
|
|
238
|
+
const innerBlocksProps = useInnerBlocksProps.save( blockProps );
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
<figure { ...innerBlocksProps }>
|
|
242
|
+
{ innerBlocksProps.children }
|
|
243
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
244
|
+
<RichText.Content
|
|
245
|
+
tagName="figcaption"
|
|
246
|
+
className="blocks-gallery-caption"
|
|
247
|
+
value={ caption }
|
|
248
|
+
/>
|
|
249
|
+
) }
|
|
250
|
+
</figure>
|
|
251
|
+
);
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
|
|
130
255
|
const v6 = {
|
|
131
256
|
attributes: {
|
|
132
257
|
images: {
|
|
@@ -803,7 +928,7 @@ const v2 = {
|
|
|
803
928
|
images.length > 0 &&
|
|
804
929
|
( ( ! ids && images ) ||
|
|
805
930
|
( ids && images && ids.length !== images.length ) ||
|
|
806
|
-
some(
|
|
931
|
+
images.some( ( id, index ) => {
|
|
807
932
|
if ( ! id && ids[ index ] !== null ) {
|
|
808
933
|
return true;
|
|
809
934
|
}
|
|
@@ -984,4 +1109,4 @@ const v1 = {
|
|
|
984
1109
|
},
|
|
985
1110
|
};
|
|
986
1111
|
|
|
987
|
-
export default [ v6, v5, v4, v3, v2, v1 ];
|
|
1112
|
+
export default [ v7, v6, v5, v4, v3, v2, v1 ];
|
package/src/gallery/gallery.js
CHANGED
|
@@ -26,6 +26,7 @@ export const Gallery = ( props ) => {
|
|
|
26
26
|
mediaPlaceholder,
|
|
27
27
|
insertBlocksAfter,
|
|
28
28
|
blockProps,
|
|
29
|
+
__unstableLayoutClassNames: layoutClassNames,
|
|
29
30
|
} = props;
|
|
30
31
|
|
|
31
32
|
const { align, columns, caption, imageCrop } = attributes;
|
|
@@ -42,6 +43,7 @@ export const Gallery = ( props ) => {
|
|
|
42
43
|
{ ...innerBlocksProps }
|
|
43
44
|
className={ classnames(
|
|
44
45
|
blockProps.className,
|
|
46
|
+
layoutClassNames,
|
|
45
47
|
'blocks-gallery-grid',
|
|
46
48
|
{
|
|
47
49
|
[ `align${ align }` ]: align,
|
package/src/gallery/index.php
CHANGED
|
@@ -76,13 +76,10 @@ function block_core_gallery_render( $attributes, $content ) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
$
|
|
80
|
-
$
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
$content,
|
|
84
|
-
1
|
|
85
|
-
);
|
|
79
|
+
$unique_gallery_classname = wp_unique_id( 'wp-block-gallery-' );
|
|
80
|
+
$processed_content = new WP_HTML_Tag_Processor( $content );
|
|
81
|
+
$processed_content->next_tag();
|
|
82
|
+
$processed_content->add_class( $unique_gallery_classname );
|
|
86
83
|
|
|
87
84
|
// --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
|
|
88
85
|
// gap on the gallery.
|
|
@@ -102,10 +99,22 @@ function block_core_gallery_render( $attributes, $content ) {
|
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
// Set the CSS variable to the column value, and the `gap` property to the combined gap value.
|
|
105
|
-
$
|
|
102
|
+
$gallery_styles = array();
|
|
103
|
+
$gallery_styles[] = array(
|
|
104
|
+
'selector' => ".wp-block-gallery.{$unique_gallery_classname}",
|
|
105
|
+
'declarations' => array(
|
|
106
|
+
'--wp--style--unstable-gallery-gap' => $gap_column,
|
|
107
|
+
'gap' => $gap_value,
|
|
108
|
+
),
|
|
109
|
+
);
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
gutenberg_style_engine_get_stylesheet_from_css_rules(
|
|
112
|
+
$gallery_styles,
|
|
113
|
+
array(
|
|
114
|
+
'context' => 'block-supports',
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
return (string) $processed_content;
|
|
109
118
|
}
|
|
110
119
|
/**
|
|
111
120
|
* Registers the `core/gallery` block on server.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { filter
|
|
4
|
+
import { filter } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -133,10 +133,14 @@ const transforms = {
|
|
|
133
133
|
// Init the align and size from the first item which may be either the placeholder or an image.
|
|
134
134
|
let { align, sizeSlug } = attributes[ 0 ];
|
|
135
135
|
// Loop through all the images and check if they have the same align and size.
|
|
136
|
-
align = every(
|
|
136
|
+
align = attributes.every(
|
|
137
|
+
( attribute ) => attribute.align === align
|
|
138
|
+
)
|
|
137
139
|
? align
|
|
138
140
|
: undefined;
|
|
139
|
-
sizeSlug = every(
|
|
141
|
+
sizeSlug = attributes.every(
|
|
142
|
+
( attribute ) => attribute.sizeSlug === sizeSlug
|
|
143
|
+
)
|
|
140
144
|
? sizeSlug
|
|
141
145
|
: undefined;
|
|
142
146
|
|
|
@@ -268,8 +272,7 @@ const transforms = {
|
|
|
268
272
|
isMatch( files ) {
|
|
269
273
|
return (
|
|
270
274
|
files.length !== 1 &&
|
|
271
|
-
every(
|
|
272
|
-
files,
|
|
275
|
+
files.every(
|
|
273
276
|
( file ) => file.type.indexOf( 'image/' ) === 0
|
|
274
277
|
)
|
|
275
278
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get
|
|
4
|
+
import { get } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -57,9 +57,10 @@ export default function useImageSizes( images, isSelected, getSettings ) {
|
|
|
57
57
|
};
|
|
58
58
|
}, {} );
|
|
59
59
|
}
|
|
60
|
+
const resizedImageSizes = Object.values( resizedImages );
|
|
60
61
|
return imageSizes
|
|
61
62
|
.filter( ( { slug } ) =>
|
|
62
|
-
some(
|
|
63
|
+
resizedImageSizes.some( ( sizes ) => sizes[ slug ] )
|
|
63
64
|
)
|
|
64
65
|
.map( ( { name, slug } ) => ( { value: slug, label: name } ) );
|
|
65
66
|
}
|
package/src/gallery/v1/edit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { filter, find, get, isEmpty, map, reduce } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -302,9 +302,10 @@ function GalleryEdit( props ) {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
function getImagesSizeOptions() {
|
|
305
|
+
const resizedImageSizes = Object.values( resizedImages );
|
|
305
306
|
return map(
|
|
306
307
|
filter( imageSizes, ( { slug } ) =>
|
|
307
|
-
some(
|
|
308
|
+
resizedImageSizes.some( ( sizes ) => sizes[ slug ] )
|
|
308
309
|
),
|
|
309
310
|
( { name, slug } ) => ( { value: slug, label: name } )
|
|
310
311
|
);
|
|
@@ -333,7 +334,7 @@ function GalleryEdit( props ) {
|
|
|
333
334
|
Platform.OS === 'web' &&
|
|
334
335
|
images &&
|
|
335
336
|
images.length > 0 &&
|
|
336
|
-
every(
|
|
337
|
+
images.every( ( { url } ) => isBlobURL( url ) )
|
|
337
338
|
) {
|
|
338
339
|
const filesList = map( images, ( { url } ) => getBlobByURL( url ) );
|
|
339
340
|
images.forEach( ( { url } ) => revokeBlobURL( url ) );
|
package/src/group/edit.js
CHANGED
|
@@ -35,7 +35,12 @@ const htmlElementMessages = {
|
|
|
35
35
|
),
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
function GroupEdit( {
|
|
38
|
+
function GroupEdit( {
|
|
39
|
+
attributes,
|
|
40
|
+
setAttributes,
|
|
41
|
+
clientId,
|
|
42
|
+
__unstableLayoutClassNames: layoutClassNames,
|
|
43
|
+
} ) {
|
|
39
44
|
const { hasInnerBlocks, themeSupportsLayout } = useSelect(
|
|
40
45
|
( select ) => {
|
|
41
46
|
const { getBlock, getSettings } = select( blockEditorStore );
|
|
@@ -55,7 +60,9 @@ function GroupEdit( { attributes, setAttributes, clientId } ) {
|
|
|
55
60
|
const { type = 'default' } = usedLayout;
|
|
56
61
|
const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
|
|
57
62
|
|
|
58
|
-
const blockProps = useBlockProps(
|
|
63
|
+
const blockProps = useBlockProps( {
|
|
64
|
+
className: ! layoutSupportEnabled ? layoutClassNames : null,
|
|
65
|
+
} );
|
|
59
66
|
|
|
60
67
|
const innerBlocksProps = useInnerBlocksProps(
|
|
61
68
|
layoutSupportEnabled
|
|
@@ -67,6 +74,7 @@ function GroupEdit( { attributes, setAttributes, clientId } ) {
|
|
|
67
74
|
? undefined
|
|
68
75
|
: InnerBlocks.ButtonBlockAppender,
|
|
69
76
|
__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,
|
|
77
|
+
__unstableDisableLayoutClassNames: ! layoutSupportEnabled,
|
|
70
78
|
}
|
|
71
79
|
);
|
|
72
80
|
|
package/src/group/editor.scss
CHANGED
package/src/image/edit.native.js
CHANGED
|
@@ -878,7 +878,7 @@ export class ImageEdit extends Component {
|
|
|
878
878
|
<BlockCaption
|
|
879
879
|
clientId={ this.props.clientId }
|
|
880
880
|
isSelected={ this.state.isCaptionSelected }
|
|
881
|
-
accessible
|
|
881
|
+
accessible={ ! this.state.isCaptionSelected }
|
|
882
882
|
accessibilityLabelCreator={ this.accessibilityLabelCreator }
|
|
883
883
|
onFocus={ this.onFocusCaption }
|
|
884
884
|
onBlur={ this.props.onBlur } // Always assign onBlur as props.
|
package/src/image/editor.scss
CHANGED
|
@@ -66,7 +66,10 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
66
66
|
|
|
67
67
|
// This is necessary for the editor resize handles to accurately work on a non-floated, non-resized, small image.
|
|
68
68
|
.wp-block-image .components-resizable-box__container {
|
|
69
|
-
display:
|
|
69
|
+
// Using "display: table" because:
|
|
70
|
+
// - it visually hides empty white space in between elements
|
|
71
|
+
// - it allows the element to be as wide as its contents (instead of 100% width, as it would be with `display: block`)
|
|
72
|
+
display: table;
|
|
70
73
|
img {
|
|
71
74
|
display: block;
|
|
72
75
|
width: inherit;
|