@wordpress/block-library 8.6.0 → 8.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 +4 -0
- package/build/buttons/index.js +1 -0
- package/build/buttons/index.js.map +1 -1
- package/build/buttons/transforms.js +1 -0
- package/build/buttons/transforms.js.map +1 -1
- package/build/column/index.js +2 -1
- package/build/column/index.js.map +1 -1
- package/build/columns/edit.js +28 -8
- package/build/columns/edit.js.map +1 -1
- package/build/columns/index.js +6 -1
- package/build/columns/index.js.map +1 -1
- package/build/columns/utils.js +4 -9
- package/build/columns/utils.js.map +1 -1
- package/build/cover/edit/index.js +46 -50
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -2
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build/cover/index.js +12 -0
- package/build/cover/index.js.map +1 -1
- package/build/details/edit.js +67 -0
- package/build/details/edit.js.map +1 -0
- package/build/details/index.js +110 -0
- package/build/details/index.js.map +1 -0
- package/build/details/save.js +33 -0
- package/build/details/save.js.map +1 -0
- package/build/details-content/edit.js +34 -0
- package/build/details-content/edit.js.map +1 -0
- package/build/details-content/index.js +94 -0
- package/build/details-content/index.js.map +1 -0
- package/build/details-content/save.js +20 -0
- package/build/details-content/save.js.map +1 -0
- package/build/details-summary/edit.js +42 -0
- package/build/details-summary/edit.js.map +1 -0
- package/build/details-summary/index.js +97 -0
- package/build/details-summary/index.js.map +1 -0
- package/build/details-summary/save.js +24 -0
- package/build/details-summary/save.js.map +1 -0
- package/build/embed/deprecated.js +4 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/embed-link-settings.native.js +1 -1
- package/build/embed/embed-link-settings.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +1 -1
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/index.js +4 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +4 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +4 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.native.js +0 -2
- package/build/file/edit.native.js.map +1 -1
- package/build/gallery/edit.js +8 -5
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/use-get-media.native.js +2 -1
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/gallery/use-image-sizes.js +1 -1
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/group/deprecated.js +4 -2
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +22 -5
- package/build/group/edit.js.map +1 -1
- package/build/group/placeholder.js +11 -1
- package/build/group/placeholder.js.map +1 -1
- package/build/group/variations.js +23 -3
- package/build/group/variations.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/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 +8 -6
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +9 -2
- package/build/image/index.js.map +1 -1
- package/build/index.js +24 -6
- package/build/index.js.map +1 -1
- package/build/latest-posts/edit.js +1 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/media-text/deprecated.js +228 -18
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +3 -3
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +1 -1
- package/build/media-text/media-container.js +2 -6
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +3 -3
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/deprecated.js +8 -11
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +1 -12
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +1 -4
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-date/edit.js +2 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +4 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-date/variations.js +28 -0
- package/build/post-date/variations.js.map +1 -0
- package/build/post-excerpt/edit.js +39 -10
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +4 -3
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +8 -22
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/post-time-to-read/edit.js +1 -1
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +24 -1
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/spacer/controls.js +25 -6
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +27 -7
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/save.js +2 -2
- package/build/spacer/save.js.map +1 -1
- package/build/table/state.js +35 -35
- package/build/table/state.js.map +1 -1
- package/build/term-description/index.js +1 -2
- package/build/term-description/index.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -2
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build-module/buttons/index.js +1 -0
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/buttons/transforms.js +1 -0
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/column/index.js +2 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/edit.js +28 -8
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/index.js +6 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/utils.js +4 -8
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/cover/edit/index.js +48 -52
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -2
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build-module/cover/index.js +12 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/edit.js +52 -0
- package/build-module/details/edit.js.map +1 -0
- package/build-module/details/index.js +91 -0
- package/build-module/details/index.js.map +1 -0
- package/build-module/details/save.js +20 -0
- package/build-module/details/save.js.map +1 -0
- package/build-module/details-content/edit.js +23 -0
- package/build-module/details-content/edit.js.map +1 -0
- package/build-module/details-content/index.js +76 -0
- package/build-module/details-content/index.js.map +1 -0
- package/build-module/details-content/save.js +11 -0
- package/build-module/details-content/save.js.map +1 -0
- package/build-module/details-summary/edit.js +30 -0
- package/build-module/details-summary/edit.js.map +1 -0
- package/build-module/details-summary/index.js +79 -0
- package/build-module/details-summary/index.js.map +1 -0
- package/build-module/details-summary/save.js +16 -0
- package/build-module/details-summary/save.js.map +1 -0
- package/build-module/embed/deprecated.js +4 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/embed-link-settings.native.js +1 -1
- package/build-module/embed/embed-link-settings.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +1 -1
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/index.js +4 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +4 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +4 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.native.js +0 -2
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/gallery/edit.js +8 -5
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +2 -1
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +1 -1
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/group/deprecated.js +4 -2
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +21 -5
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/placeholder.js +11 -1
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/group/variations.js +24 -1
- package/build-module/group/variations.js.map +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/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 +8 -6
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +9 -2
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +21 -6
- package/build-module/index.js.map +1 -1
- package/build-module/latest-posts/edit.js +1 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/media-text/deprecated.js +227 -18
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +3 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +1 -1
- package/build-module/media-text/media-container.js +1 -5
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/deprecated.js +8 -10
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -12
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +1 -4
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-date/edit.js +2 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +3 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-date/variations.js +18 -0
- package/build-module/post-date/variations.js.map +1 -0
- package/build-module/post-excerpt/edit.js +38 -11
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +4 -3
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +8 -22
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/post-time-to-read/edit.js +1 -1
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +24 -1
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/spacer/controls.js +27 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +27 -8
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/save.js +3 -3
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/table/state.js +35 -33
- package/build-module/table/state.js.map +1 -1
- package/build-module/term-description/index.js +1 -2
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +6 -3
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-style/categories/editor-rtl.css +5 -0
- package/build-style/categories/editor.css +5 -0
- package/build-style/categories/style-rtl.css +4 -0
- package/build-style/categories/style.css +4 -0
- package/build-style/columns/style-rtl.css +4 -1
- package/build-style/columns/style.css +4 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/editor-rtl.css +11 -12
- package/build-style/cover/editor.css +11 -12
- package/build-style/cover/style-rtl.css +3 -2
- package/build-style/cover/style.css +3 -2
- package/build-style/details/style-rtl.css +91 -0
- package/build-style/details/style.css +91 -0
- package/build-style/details-summary/editor-rtl.css +91 -0
- package/build-style/details-summary/editor.css +91 -0
- package/build-style/details-summary/style-rtl.css +91 -0
- package/build-style/details-summary/style.css +91 -0
- package/build-style/editor-rtl.css +40 -48
- package/build-style/editor.css +40 -48
- package/build-style/file/style-rtl.css +4 -3
- package/build-style/file/style.css +4 -3
- package/build-style/navigation/style-rtl.css +2 -0
- package/build-style/navigation/style.css +2 -0
- package/build-style/post-excerpt/style-rtl.css +1 -1
- package/build-style/post-excerpt/style.css +1 -1
- package/build-style/post-featured-image/editor-rtl.css +1 -0
- package/build-style/post-featured-image/editor.css +1 -0
- package/build-style/post-template/style-rtl.css +1 -1
- package/build-style/post-template/style.css +1 -1
- package/build-style/post-time-to-read/style-rtl.css +91 -0
- package/build-style/post-time-to-read/style.css +91 -0
- package/build-style/pullquote/style-rtl.css +4 -1
- package/build-style/pullquote/style.css +4 -1
- package/build-style/search/style-rtl.css +8 -7
- package/build-style/search/style.css +8 -7
- package/build-style/shortcode/editor-rtl.css +15 -34
- package/build-style/shortcode/editor.css +15 -34
- package/build-style/spacer/editor-rtl.css +4 -2
- package/build-style/spacer/editor.css +4 -2
- package/build-style/style-rtl.css +44 -17
- package/build-style/style.css +44 -17
- package/package.json +31 -31
- package/src/buttons/block.json +1 -0
- package/src/categories/editor.scss +5 -0
- package/src/categories/style.scss +4 -0
- package/src/column/block.json +2 -1
- package/src/columns/block.json +6 -1
- package/src/columns/edit.js +35 -10
- package/src/columns/style.scss +5 -1
- package/src/columns/utils.js +8 -9
- package/src/comments/index.php +1 -0
- package/src/common.scss +1 -1
- package/src/cover/block.json +12 -0
- package/src/cover/edit/index.js +44 -37
- package/src/cover/edit/inspector-controls.js +4 -5
- package/src/cover/edit/resizable-cover-popover.js +82 -0
- package/src/cover/editor.scss +20 -13
- package/src/cover/index.php +9 -10
- package/src/cover/style.scss +2 -1
- package/src/cover/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/cover/test/edit.js +324 -0
- package/src/details/block.json +54 -0
- package/src/details/edit.js +59 -0
- package/src/details/index.js +35 -0
- package/src/details/save.js +15 -0
- package/src/details/style.scss +3 -0
- package/src/details-content/block.json +50 -0
- package/src/details-content/edit.js +29 -0
- package/src/details-content/index.js +23 -0
- package/src/details-content/save.js +12 -0
- package/src/details-summary/block.json +53 -0
- package/src/details-summary/edit.js +27 -0
- package/src/details-summary/editor.scss +3 -0
- package/src/details-summary/index.js +23 -0
- package/src/details-summary/save.js +13 -0
- package/src/details-summary/style.scss +3 -0
- package/src/editor.scss +1 -0
- package/src/embed/block.json +4 -1
- package/src/embed/embed-link-settings.native.js +1 -1
- package/src/embed/embed-placeholder.js +1 -1
- package/src/file/edit.native.js +0 -2
- package/src/file/style.scss +5 -2
- package/src/gallery/edit.js +5 -2
- package/src/gallery/test/use-get-media.native.js +24 -0
- package/src/gallery/use-get-media.native.js +1 -1
- package/src/gallery/use-image-sizes.js +1 -1
- package/src/group/deprecated.js +4 -2
- package/src/group/edit.js +27 -9
- package/src/group/placeholder.js +13 -1
- package/src/group/variations.js +14 -1
- package/src/home-link/index.php +2 -2
- package/src/image/block.json +9 -2
- package/src/image/edit.js +1 -1
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +15 -7
- package/src/image/index.php +7 -2
- package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/index.js +13 -3
- package/src/latest-comments/style.scss +1 -1
- package/src/latest-posts/edit.js +3 -0
- package/src/media-text/block.json +1 -1
- package/src/media-text/deprecated.js +235 -3
- package/src/media-text/edit.js +7 -6
- package/src/media-text/media-container.js +1 -5
- package/src/media-text/media-container.native.js +1 -1
- package/src/media-text/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/navigation/block.json +0 -1
- package/src/navigation/deprecated.js +15 -19
- package/src/navigation/edit/index.js +0 -13
- package/src/navigation/edit/inner-blocks.js +0 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
- package/src/navigation/index.php +0 -4
- package/src/navigation/style.scss +6 -4
- package/src/navigation-link/index.php +2 -1
- package/src/navigation-submenu/index.php +30 -76
- package/src/paragraph/test/edit.native.js +356 -1
- package/src/post-author/block.json +0 -1
- package/src/post-author/index.php +1 -1
- package/src/post-date/edit.js +4 -1
- package/src/post-date/index.js +2 -0
- package/src/post-date/variations.js +20 -0
- package/src/post-excerpt/edit.js +48 -16
- package/src/post-excerpt/index.php +3 -3
- package/src/post-excerpt/style.scss +2 -1
- package/src/post-featured-image/dimension-controls.js +7 -3
- package/src/post-featured-image/edit.js +8 -29
- package/src/post-featured-image/editor.scss +1 -0
- package/src/post-template/block.json +1 -1
- package/src/post-template/style.scss +1 -1
- package/src/post-time-to-read/block.json +24 -1
- package/src/post-time-to-read/edit.js +1 -1
- package/src/post-time-to-read/index.php +3 -3
- package/src/post-time-to-read/style.scss +4 -0
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
- package/src/preformatted/test/edit.native.js +45 -2
- package/src/pullquote/style.scss +5 -1
- package/src/pullquote/test/edit.native.js +70 -0
- package/src/query-title/index.php +2 -5
- package/src/quote/block.json +1 -0
- package/src/quote/test/edit.native.js +92 -0
- package/src/search/index.php +1 -1
- package/src/search/style.scss +16 -12
- package/src/shortcode/editor.scss +26 -5
- package/src/spacer/controls.js +42 -17
- package/src/spacer/edit.js +41 -9
- package/src/spacer/editor.scss +2 -1
- package/src/spacer/save.js +3 -3
- package/src/style.scss +3 -0
- package/src/table/state.js +83 -66
- package/src/term-description/block.json +1 -2
- package/src/utils/clean-empty-object.js +4 -4
- package/src/verse/test/edit.native.js +33 -0
- package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/cover/edit/resizable-cover.js.map +0 -1
- package/build/media-text/media-container-icon.js +0 -27
- package/build/media-text/media-container-icon.js.map +0 -1
- package/build-module/cover/edit/resizable-cover.js.map +0 -1
- package/build-module/media-text/media-container-icon.js +0 -17
- package/build-module/media-text/media-container-icon.js.map +0 -1
- package/src/cover/edit/resizable-cover.js +0 -61
- package/src/cover/test/block-controls.js +0 -62
- package/src/media-text/media-container-icon.js +0 -12
package/src/image/edit.native.js
CHANGED
|
@@ -578,7 +578,7 @@ export class ImageEdit extends Component {
|
|
|
578
578
|
footerNote={
|
|
579
579
|
<>
|
|
580
580
|
{ __(
|
|
581
|
-
'Describe the purpose of the image. Leave empty if
|
|
581
|
+
'Describe the purpose of the image. Leave empty if decorative.'
|
|
582
582
|
) }{ ' ' }
|
|
583
583
|
<FooterMessageLink
|
|
584
584
|
href={
|
package/src/image/image.js
CHANGED
|
@@ -170,12 +170,18 @@ export default function Image( {
|
|
|
170
170
|
( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url
|
|
171
171
|
)
|
|
172
172
|
.map( ( { name, slug } ) => ( { value: slug, label: name } ) );
|
|
173
|
+
const canUploadMedia = !! mediaUpload;
|
|
173
174
|
|
|
174
175
|
// If an image is externally hosted, try to fetch the image data. This may
|
|
175
176
|
// fail if the image host doesn't allow CORS with the domain. If it works,
|
|
176
177
|
// we can enable a button in the toolbar to upload the image.
|
|
177
178
|
useEffect( () => {
|
|
178
|
-
if (
|
|
179
|
+
if (
|
|
180
|
+
! isExternalImage( id, url ) ||
|
|
181
|
+
! isSelected ||
|
|
182
|
+
! canUploadMedia ||
|
|
183
|
+
externalBlob
|
|
184
|
+
) {
|
|
179
185
|
return;
|
|
180
186
|
}
|
|
181
187
|
|
|
@@ -185,7 +191,7 @@ export default function Image( {
|
|
|
185
191
|
.then( ( blob ) => setExternalBlob( blob ) )
|
|
186
192
|
// Do nothing, cannot upload.
|
|
187
193
|
.catch( () => {} );
|
|
188
|
-
}, [ id, url, isSelected, externalBlob ] );
|
|
194
|
+
}, [ id, url, isSelected, externalBlob, canUploadMedia ] );
|
|
189
195
|
|
|
190
196
|
// We need to show the caption when changes come from
|
|
191
197
|
// history navigation(undo/redo).
|
|
@@ -401,19 +407,18 @@ export default function Image( {
|
|
|
401
407
|
{ ! multiImageSelection && (
|
|
402
408
|
<TextareaControl
|
|
403
409
|
__nextHasNoMarginBottom
|
|
404
|
-
label={ __( '
|
|
410
|
+
label={ __( 'Alternative text' ) }
|
|
405
411
|
value={ alt }
|
|
406
412
|
onChange={ updateAlt }
|
|
407
413
|
help={
|
|
408
414
|
<>
|
|
409
415
|
<ExternalLink href="https://www.w3.org/WAI/tutorials/images/decision-tree">
|
|
410
416
|
{ __(
|
|
411
|
-
'Describe the purpose of the image'
|
|
417
|
+
'Describe the purpose of the image.'
|
|
412
418
|
) }
|
|
413
419
|
</ExternalLink>
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
) }
|
|
420
|
+
<br />
|
|
421
|
+
{ __( 'Leave empty if decorative.' ) }
|
|
417
422
|
</>
|
|
418
423
|
}
|
|
419
424
|
/>
|
|
@@ -428,6 +433,9 @@ export default function Image( {
|
|
|
428
433
|
isResizable={ isResizable }
|
|
429
434
|
imageWidth={ naturalWidth }
|
|
430
435
|
imageHeight={ naturalHeight }
|
|
436
|
+
imageSizeHelp={ __(
|
|
437
|
+
'Select the size of the source image.'
|
|
438
|
+
) }
|
|
431
439
|
/>
|
|
432
440
|
</PanelBody>
|
|
433
441
|
</InspectorControls>
|
package/src/image/index.php
CHANGED
|
@@ -14,13 +14,18 @@
|
|
|
14
14
|
* @return string Returns the block content with the data-id attribute added.
|
|
15
15
|
*/
|
|
16
16
|
function render_block_core_image( $attributes, $content ) {
|
|
17
|
+
$processor = new WP_HTML_Tag_Processor( $content );
|
|
18
|
+
$processor->next_tag( 'img' );
|
|
19
|
+
|
|
20
|
+
if ( $processor->get_attribute( 'src' ) === null ) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
if ( isset( $attributes['data-id'] ) ) {
|
|
18
25
|
// Add the data-id="$id" attribute to the img element
|
|
19
26
|
// to provide backwards compatibility for the Gallery Block,
|
|
20
27
|
// which now wraps Image Blocks within innerBlocks.
|
|
21
28
|
// The data-id attribute is added in a core/gallery `render_block_data` hook.
|
|
22
|
-
$processor = new WP_HTML_Tag_Processor( $content );
|
|
23
|
-
$processor->next_tag( 'img' );
|
|
24
29
|
$processor->set_attribute( 'data-id', $attributes['data-id'] );
|
|
25
30
|
$content = $processor->get_updated_html();
|
|
26
31
|
}
|
|
@@ -42,7 +42,7 @@ exports[`Image block transformations to Group block 1`] = `
|
|
|
42
42
|
|
|
43
43
|
exports[`Image block transformations to Media & Text block 1`] = `
|
|
44
44
|
"<!-- wp:media-text {"mediaId":1,"mediaType":"image"} -->
|
|
45
|
-
<div class="wp-block-media-text
|
|
45
|
+
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->
|
|
46
46
|
<p></p>
|
|
47
47
|
<!-- /wp:paragraph --></div></div>
|
|
48
48
|
<!-- /wp:media-text -->"
|
package/src/index.js
CHANGED
|
@@ -45,6 +45,9 @@ import * as commentsPaginationNext from './comments-pagination-next';
|
|
|
45
45
|
import * as commentsPaginationNumbers from './comments-pagination-numbers';
|
|
46
46
|
import * as commentsTitle from './comments-title';
|
|
47
47
|
import * as cover from './cover';
|
|
48
|
+
import * as details from './details';
|
|
49
|
+
import * as detailsContent from './details-content';
|
|
50
|
+
import * as detailsSummary from './details-summary';
|
|
48
51
|
import * as embed from './embed';
|
|
49
52
|
import * as file from './file';
|
|
50
53
|
import * as gallery from './gallery';
|
|
@@ -121,8 +124,8 @@ import isBlockMetadataExperimental from './utils/is-block-metadata-experimental'
|
|
|
121
124
|
/**
|
|
122
125
|
* Function to get all the block-library blocks in an array
|
|
123
126
|
*/
|
|
124
|
-
const getAllBlocks = () =>
|
|
125
|
-
[
|
|
127
|
+
const getAllBlocks = () => {
|
|
128
|
+
const blocks = [
|
|
126
129
|
// Common blocks are grouped at the top to prioritize their display
|
|
127
130
|
// in various contexts — like the inserter and auto-complete components.
|
|
128
131
|
paragraph,
|
|
@@ -224,7 +227,14 @@ const getAllBlocks = () =>
|
|
|
224
227
|
termDescription,
|
|
225
228
|
queryTitle,
|
|
226
229
|
postAuthorBiography,
|
|
227
|
-
]
|
|
230
|
+
];
|
|
231
|
+
if ( window?.__experimentalEnableDetailsBlocks ) {
|
|
232
|
+
blocks.push( details );
|
|
233
|
+
blocks.push( detailsContent );
|
|
234
|
+
blocks.push( detailsSummary );
|
|
235
|
+
}
|
|
236
|
+
return blocks.filter( Boolean );
|
|
237
|
+
};
|
|
228
238
|
|
|
229
239
|
/**
|
|
230
240
|
* Function to get all the core blocks in an array.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Lower specificity - target list element.
|
|
2
2
|
ol.wp-block-latest-comments {
|
|
3
3
|
// Removes left spacing in Customizer Widgets screen.
|
|
4
|
-
// Due to low specificity this will be safely
|
|
4
|
+
// Due to low specificity this will be safely overridden
|
|
5
5
|
// by default wp-block layout styles in the Post/Site editor
|
|
6
6
|
margin-left: 0;
|
|
7
7
|
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -289,6 +289,9 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
289
289
|
imageWidth={ defaultImageWidth }
|
|
290
290
|
imageHeight={ defaultImageHeight }
|
|
291
291
|
imageSizeOptions={ imageSizeOptions }
|
|
292
|
+
imageSizeHelp={ __(
|
|
293
|
+
'Select the size of the source image.'
|
|
294
|
+
) }
|
|
292
295
|
onChangeImage={ ( value ) =>
|
|
293
296
|
setAttributes( {
|
|
294
297
|
featuredImageSizeSlug: value,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
useInnerBlocksProps,
|
|
14
14
|
useBlockProps,
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
|
+
import { compose } from '@wordpress/compose';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Internal dependencies
|
|
@@ -30,6 +31,19 @@ const v1ToV5ImageFillStyles = ( url, focalPoint ) => {
|
|
|
30
31
|
: {};
|
|
31
32
|
};
|
|
32
33
|
|
|
34
|
+
const v6ImageFillStyles = ( url, focalPoint ) => {
|
|
35
|
+
return url
|
|
36
|
+
? {
|
|
37
|
+
backgroundImage: `url(${ url })`,
|
|
38
|
+
backgroundPosition: focalPoint
|
|
39
|
+
? `${ Math.round( focalPoint.x * 100 ) }% ${ Math.round(
|
|
40
|
+
focalPoint.y * 100
|
|
41
|
+
) }%`
|
|
42
|
+
: `50% 50%`,
|
|
43
|
+
}
|
|
44
|
+
: {};
|
|
45
|
+
};
|
|
46
|
+
|
|
33
47
|
const DEFAULT_MEDIA_WIDTH = 50;
|
|
34
48
|
const noop = () => {};
|
|
35
49
|
|
|
@@ -49,6 +63,20 @@ const migrateCustomColors = ( attributes ) => {
|
|
|
49
63
|
};
|
|
50
64
|
};
|
|
51
65
|
|
|
66
|
+
// After align attribute's default was updated this function explicitly sets
|
|
67
|
+
// the align value for deprecated blocks to the `wide` value which was default
|
|
68
|
+
// for their versions of this block.
|
|
69
|
+
const migrateDefaultAlign = ( attributes ) => {
|
|
70
|
+
if ( attributes.align ) {
|
|
71
|
+
return attributes;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
...attributes,
|
|
76
|
+
align: 'wide',
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
52
80
|
const baseAttributes = {
|
|
53
81
|
align: {
|
|
54
82
|
type: 'string',
|
|
@@ -133,6 +161,40 @@ const v4ToV5BlockAttributes = {
|
|
|
133
161
|
},
|
|
134
162
|
};
|
|
135
163
|
|
|
164
|
+
const v6Attributes = {
|
|
165
|
+
...v4ToV5BlockAttributes,
|
|
166
|
+
mediaAlt: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
source: 'attribute',
|
|
169
|
+
selector: 'figure img',
|
|
170
|
+
attribute: 'alt',
|
|
171
|
+
default: '',
|
|
172
|
+
__experimentalRole: 'content',
|
|
173
|
+
},
|
|
174
|
+
mediaId: {
|
|
175
|
+
type: 'number',
|
|
176
|
+
__experimentalRole: 'content',
|
|
177
|
+
},
|
|
178
|
+
mediaUrl: {
|
|
179
|
+
type: 'string',
|
|
180
|
+
source: 'attribute',
|
|
181
|
+
selector: 'figure video,figure img',
|
|
182
|
+
attribute: 'src',
|
|
183
|
+
__experimentalRole: 'content',
|
|
184
|
+
},
|
|
185
|
+
href: {
|
|
186
|
+
type: 'string',
|
|
187
|
+
source: 'attribute',
|
|
188
|
+
selector: 'figure a',
|
|
189
|
+
attribute: 'href',
|
|
190
|
+
__experimentalRole: 'content',
|
|
191
|
+
},
|
|
192
|
+
mediaType: {
|
|
193
|
+
type: 'string',
|
|
194
|
+
__experimentalRole: 'content',
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
|
|
136
198
|
const v4ToV5Supports = {
|
|
137
199
|
anchor: true,
|
|
138
200
|
align: [ 'wide', 'full' ],
|
|
@@ -143,6 +205,166 @@ const v4ToV5Supports = {
|
|
|
143
205
|
},
|
|
144
206
|
};
|
|
145
207
|
|
|
208
|
+
const v6Supports = {
|
|
209
|
+
...v4ToV5Supports,
|
|
210
|
+
color: {
|
|
211
|
+
gradients: true,
|
|
212
|
+
link: true,
|
|
213
|
+
__experimentalDefaultControls: {
|
|
214
|
+
background: true,
|
|
215
|
+
text: true,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
spacing: {
|
|
219
|
+
margin: true,
|
|
220
|
+
padding: true,
|
|
221
|
+
},
|
|
222
|
+
typography: {
|
|
223
|
+
fontSize: true,
|
|
224
|
+
lineHeight: true,
|
|
225
|
+
__experimentalFontFamily: true,
|
|
226
|
+
__experimentalFontWeight: true,
|
|
227
|
+
__experimentalFontStyle: true,
|
|
228
|
+
__experimentalTextTransform: true,
|
|
229
|
+
__experimentalTextDecoration: true,
|
|
230
|
+
__experimentalLetterSpacing: true,
|
|
231
|
+
__experimentalDefaultControls: {
|
|
232
|
+
fontSize: true,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// Version with wide as the default alignment.
|
|
238
|
+
// See: https://github.com/WordPress/gutenberg/pull/48404
|
|
239
|
+
const v6 = {
|
|
240
|
+
attributes: v6Attributes,
|
|
241
|
+
supports: v6Supports,
|
|
242
|
+
save( { attributes } ) {
|
|
243
|
+
const {
|
|
244
|
+
isStackedOnMobile,
|
|
245
|
+
mediaAlt,
|
|
246
|
+
mediaPosition,
|
|
247
|
+
mediaType,
|
|
248
|
+
mediaUrl,
|
|
249
|
+
mediaWidth,
|
|
250
|
+
mediaId,
|
|
251
|
+
verticalAlignment,
|
|
252
|
+
imageFill,
|
|
253
|
+
focalPoint,
|
|
254
|
+
linkClass,
|
|
255
|
+
href,
|
|
256
|
+
linkTarget,
|
|
257
|
+
rel,
|
|
258
|
+
} = attributes;
|
|
259
|
+
const mediaSizeSlug =
|
|
260
|
+
attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
|
|
261
|
+
const newRel = isEmpty( rel ) ? undefined : rel;
|
|
262
|
+
|
|
263
|
+
const imageClasses = classnames( {
|
|
264
|
+
[ `wp-image-${ mediaId }` ]: mediaId && mediaType === 'image',
|
|
265
|
+
[ `size-${ mediaSizeSlug }` ]: mediaId && mediaType === 'image',
|
|
266
|
+
} );
|
|
267
|
+
|
|
268
|
+
let image = (
|
|
269
|
+
<img
|
|
270
|
+
src={ mediaUrl }
|
|
271
|
+
alt={ mediaAlt }
|
|
272
|
+
className={ imageClasses || null }
|
|
273
|
+
/>
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
if ( href ) {
|
|
277
|
+
image = (
|
|
278
|
+
<a
|
|
279
|
+
className={ linkClass }
|
|
280
|
+
href={ href }
|
|
281
|
+
target={ linkTarget }
|
|
282
|
+
rel={ newRel }
|
|
283
|
+
>
|
|
284
|
+
{ image }
|
|
285
|
+
</a>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const mediaTypeRenders = {
|
|
290
|
+
image: () => image,
|
|
291
|
+
video: () => <video controls src={ mediaUrl } />,
|
|
292
|
+
};
|
|
293
|
+
const className = classnames( {
|
|
294
|
+
'has-media-on-the-right': 'right' === mediaPosition,
|
|
295
|
+
'is-stacked-on-mobile': isStackedOnMobile,
|
|
296
|
+
[ `is-vertically-aligned-${ verticalAlignment }` ]:
|
|
297
|
+
verticalAlignment,
|
|
298
|
+
'is-image-fill': imageFill,
|
|
299
|
+
} );
|
|
300
|
+
const backgroundStyles = imageFill
|
|
301
|
+
? v6ImageFillStyles( mediaUrl, focalPoint )
|
|
302
|
+
: {};
|
|
303
|
+
|
|
304
|
+
let gridTemplateColumns;
|
|
305
|
+
if ( mediaWidth !== DEFAULT_MEDIA_WIDTH ) {
|
|
306
|
+
gridTemplateColumns =
|
|
307
|
+
'right' === mediaPosition
|
|
308
|
+
? `auto ${ mediaWidth }%`
|
|
309
|
+
: `${ mediaWidth }% auto`;
|
|
310
|
+
}
|
|
311
|
+
const style = {
|
|
312
|
+
gridTemplateColumns,
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
if ( 'right' === mediaPosition ) {
|
|
316
|
+
return (
|
|
317
|
+
<div { ...useBlockProps.save( { className, style } ) }>
|
|
318
|
+
<div
|
|
319
|
+
{ ...useInnerBlocksProps.save( {
|
|
320
|
+
className: 'wp-block-media-text__content',
|
|
321
|
+
} ) }
|
|
322
|
+
/>
|
|
323
|
+
<figure
|
|
324
|
+
className="wp-block-media-text__media"
|
|
325
|
+
style={ backgroundStyles }
|
|
326
|
+
>
|
|
327
|
+
{ ( mediaTypeRenders[ mediaType ] || noop )() }
|
|
328
|
+
</figure>
|
|
329
|
+
</div>
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
return (
|
|
333
|
+
<div { ...useBlockProps.save( { className, style } ) }>
|
|
334
|
+
<figure
|
|
335
|
+
className="wp-block-media-text__media"
|
|
336
|
+
style={ backgroundStyles }
|
|
337
|
+
>
|
|
338
|
+
{ ( mediaTypeRenders[ mediaType ] || noop )() }
|
|
339
|
+
</figure>
|
|
340
|
+
<div
|
|
341
|
+
{ ...useInnerBlocksProps.save( {
|
|
342
|
+
className: 'wp-block-media-text__content',
|
|
343
|
+
} ) }
|
|
344
|
+
/>
|
|
345
|
+
</div>
|
|
346
|
+
);
|
|
347
|
+
},
|
|
348
|
+
migrate: migrateDefaultAlign,
|
|
349
|
+
isEligible( attributes, innerBlocks, { block } ) {
|
|
350
|
+
const { attributes: finalizedAttributes } = block;
|
|
351
|
+
// When the align attribute defaults to none, valid block markup should
|
|
352
|
+
// not contain any alignment CSS class. Unfortunately, this
|
|
353
|
+
// deprecation's version of the block won't be invalidated due to the
|
|
354
|
+
// alignwide class still being in the markup. That is because the custom
|
|
355
|
+
// CSS classname support picks it up and adds it to the className
|
|
356
|
+
// attribute. At the time of parsing, the className attribute won't
|
|
357
|
+
// contain the alignwide class, hence the need to check the finalized
|
|
358
|
+
// block attributes.
|
|
359
|
+
return (
|
|
360
|
+
attributes.align === undefined &&
|
|
361
|
+
!! finalizedAttributes.className?.includes( 'alignwide' )
|
|
362
|
+
);
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
// Version with non-rounded background position attribute for focal point.
|
|
367
|
+
// See: https://github.com/WordPress/gutenberg/pull/33915
|
|
146
368
|
const v5 = {
|
|
147
369
|
attributes: v4ToV5BlockAttributes,
|
|
148
370
|
supports: v4ToV5Supports,
|
|
@@ -252,9 +474,11 @@ const v5 = {
|
|
|
252
474
|
</div>
|
|
253
475
|
);
|
|
254
476
|
},
|
|
477
|
+
migrate: migrateDefaultAlign,
|
|
255
478
|
};
|
|
256
479
|
|
|
257
480
|
// Version with CSS grid
|
|
481
|
+
// See: https://github.com/WordPress/gutenberg/pull/40806
|
|
258
482
|
const v4 = {
|
|
259
483
|
attributes: v4ToV5BlockAttributes,
|
|
260
484
|
supports: v4ToV5Supports,
|
|
@@ -348,8 +572,11 @@ const v4 = {
|
|
|
348
572
|
</div>
|
|
349
573
|
);
|
|
350
574
|
},
|
|
575
|
+
migrate: migrateDefaultAlign,
|
|
351
576
|
};
|
|
352
577
|
|
|
578
|
+
// Version with ad-hoc color attributes
|
|
579
|
+
// See: https://github.com/WordPress/gutenberg/pull/21169
|
|
353
580
|
const v3 = {
|
|
354
581
|
attributes: {
|
|
355
582
|
...baseAttributes,
|
|
@@ -399,7 +626,7 @@ const v3 = {
|
|
|
399
626
|
type: 'object',
|
|
400
627
|
},
|
|
401
628
|
},
|
|
402
|
-
migrate: migrateCustomColors,
|
|
629
|
+
migrate: compose( migrateCustomColors, migrateDefaultAlign ),
|
|
403
630
|
save( { attributes } ) {
|
|
404
631
|
const {
|
|
405
632
|
backgroundColor,
|
|
@@ -496,6 +723,8 @@ const v3 = {
|
|
|
496
723
|
},
|
|
497
724
|
};
|
|
498
725
|
|
|
726
|
+
// Version with stack on mobile off by default
|
|
727
|
+
// See: https://github.com/WordPress/gutenberg/pull/14364
|
|
499
728
|
const v2 = {
|
|
500
729
|
attributes: {
|
|
501
730
|
...baseAttributes,
|
|
@@ -521,7 +750,7 @@ const v2 = {
|
|
|
521
750
|
type: 'object',
|
|
522
751
|
},
|
|
523
752
|
},
|
|
524
|
-
migrate: migrateCustomColors,
|
|
753
|
+
migrate: compose( migrateCustomColors, migrateDefaultAlign ),
|
|
525
754
|
save( { attributes } ) {
|
|
526
755
|
const {
|
|
527
756
|
backgroundColor,
|
|
@@ -596,6 +825,8 @@ const v2 = {
|
|
|
596
825
|
},
|
|
597
826
|
};
|
|
598
827
|
|
|
828
|
+
// Version without the wp-image-#### class on image
|
|
829
|
+
// See: https://github.com/WordPress/gutenberg/pull/11922
|
|
599
830
|
const v1 = {
|
|
600
831
|
attributes: {
|
|
601
832
|
...baseAttributes,
|
|
@@ -612,6 +843,7 @@ const v1 = {
|
|
|
612
843
|
attribute: 'src',
|
|
613
844
|
},
|
|
614
845
|
},
|
|
846
|
+
migrate: migrateDefaultAlign,
|
|
615
847
|
save( { attributes } ) {
|
|
616
848
|
const {
|
|
617
849
|
backgroundColor,
|
|
@@ -663,4 +895,4 @@ const v1 = {
|
|
|
663
895
|
},
|
|
664
896
|
};
|
|
665
897
|
|
|
666
|
-
export default [ v5, v4, v3, v2, v1 ];
|
|
898
|
+
export default [ v6, v5, v4, v3, v2, v1 ];
|
package/src/media-text/edit.js
CHANGED
|
@@ -270,17 +270,16 @@ function MediaTextEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
270
270
|
{ mediaType === 'image' && (
|
|
271
271
|
<TextareaControl
|
|
272
272
|
__nextHasNoMarginBottom
|
|
273
|
-
label={ __( '
|
|
273
|
+
label={ __( 'Alternative text' ) }
|
|
274
274
|
value={ mediaAlt }
|
|
275
275
|
onChange={ onMediaAltChange }
|
|
276
276
|
help={
|
|
277
277
|
<>
|
|
278
278
|
<ExternalLink href="https://www.w3.org/WAI/tutorials/images/decision-tree">
|
|
279
|
-
{ __( 'Describe the purpose of the image' ) }
|
|
279
|
+
{ __( 'Describe the purpose of the image.' ) }
|
|
280
280
|
</ExternalLink>
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
) }
|
|
281
|
+
<br />
|
|
282
|
+
{ __( 'Leave empty if decorative.' ) }
|
|
284
283
|
</>
|
|
285
284
|
}
|
|
286
285
|
/>
|
|
@@ -291,7 +290,9 @@ function MediaTextEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
291
290
|
slug={ mediaSizeSlug }
|
|
292
291
|
imageSizeOptions={ imageSizeOptions }
|
|
293
292
|
isResizable={ false }
|
|
294
|
-
imageSizeHelp={ __(
|
|
293
|
+
imageSizeHelp={ __(
|
|
294
|
+
'Select the size of the source image.'
|
|
295
|
+
) }
|
|
295
296
|
/>
|
|
296
297
|
) }
|
|
297
298
|
{ mediaUrl && (
|
|
@@ -20,11 +20,7 @@ import { useDispatch } from '@wordpress/data';
|
|
|
20
20
|
import { forwardRef } from '@wordpress/element';
|
|
21
21
|
import { isBlobURL } from '@wordpress/blob';
|
|
22
22
|
import { store as noticesStore } from '@wordpress/notices';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
import icon from './media-container-icon';
|
|
23
|
+
import { media as icon } from '@wordpress/icons';
|
|
28
24
|
|
|
29
25
|
/**
|
|
30
26
|
* Constants
|
|
@@ -26,12 +26,12 @@ import { Component } from '@wordpress/element';
|
|
|
26
26
|
import { __ } from '@wordpress/i18n';
|
|
27
27
|
import { isURL, getProtocol } from '@wordpress/url';
|
|
28
28
|
import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
29
|
+
import { media as icon } from '@wordpress/icons';
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Internal dependencies
|
|
32
33
|
*/
|
|
33
34
|
import styles from './style.scss';
|
|
34
|
-
import icon from './media-container-icon';
|
|
35
35
|
import SvgIconRetry from './icon-retry';
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Media & Text block transformations with Image to Columns block 1`] = `
|
|
4
4
|
"<!-- wp:columns -->
|
|
5
5
|
<div class="wp-block-columns"><!-- wp:column {"width":"100%"} -->
|
|
6
|
-
<div class="wp-block-column" style="flex-basis:100%"><!-- wp:media-text {"mediaId":4674,"mediaType":"image","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
6
|
+
<div class="wp-block-column" style="flex-basis:100%"><!-- wp:media-text {"align":"wide","mediaId":4674,"mediaType":"image","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
7
7
|
<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-4674 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"className":"has-large-font-size"} -->
|
|
8
8
|
<p class="has-large-font-size">Mountain</p>
|
|
9
9
|
<!-- /wp:paragraph --></div></div>
|
|
@@ -22,7 +22,7 @@ exports[`Media & Text block transformations with Image to Cover block 1`] = `
|
|
|
22
22
|
|
|
23
23
|
exports[`Media & Text block transformations with Image to Group block 1`] = `
|
|
24
24
|
"<!-- wp:group {"align":"wide","layout":{"type":"constrained"}} -->
|
|
25
|
-
<div class="wp-block-group alignwide"><!-- wp:media-text {"mediaId":4674,"mediaType":"image","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
25
|
+
<div class="wp-block-group alignwide"><!-- wp:media-text {"align":"wide","mediaId":4674,"mediaType":"image","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
26
26
|
<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-4674 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"className":"has-large-font-size"} -->
|
|
27
27
|
<p class="has-large-font-size">Mountain</p>
|
|
28
28
|
<!-- /wp:paragraph --></div></div>
|
|
@@ -39,7 +39,7 @@ exports[`Media & Text block transformations with Image to Image block 1`] = `
|
|
|
39
39
|
exports[`Media & Text block transformations with Video to Columns block 1`] = `
|
|
40
40
|
"<!-- wp:columns -->
|
|
41
41
|
<div class="wp-block-columns"><!-- wp:column {"width":"100%"} -->
|
|
42
|
-
<div class="wp-block-column" style="flex-basis:100%"><!-- wp:media-text {"mediaId":4675,"mediaType":"video","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
42
|
+
<div class="wp-block-column" style="flex-basis:100%"><!-- wp:media-text {"align":"wide","mediaId":4675,"mediaType":"video","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
43
43
|
<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><video controls src="https://i.cloudup.com/YtZFJbuQCE.mov"></video></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"className":"has-large-font-size"} -->
|
|
44
44
|
<p class="has-large-font-size">Cloudup</p>
|
|
45
45
|
<!-- /wp:paragraph --></div></div>
|
|
@@ -58,7 +58,7 @@ exports[`Media & Text block transformations with Video to Cover block 1`] = `
|
|
|
58
58
|
|
|
59
59
|
exports[`Media & Text block transformations with Video to Group block 1`] = `
|
|
60
60
|
"<!-- wp:group {"align":"wide","layout":{"type":"constrained"}} -->
|
|
61
|
-
<div class="wp-block-group alignwide"><!-- wp:media-text {"mediaId":4675,"mediaType":"video","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
61
|
+
<div class="wp-block-group alignwide"><!-- wp:media-text {"align":"wide","mediaId":4675,"mediaType":"video","isStackedOnMobile":false,"className":"is-stacked-on-mobile"} -->
|
|
62
62
|
<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><video controls src="https://i.cloudup.com/YtZFJbuQCE.mov"></video></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"className":"has-large-font-size"} -->
|
|
63
63
|
<p class="has-large-font-size">Cloudup</p>
|
|
64
64
|
<!-- /wp:paragraph --></div></div>
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { mapValues } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -331,22 +326,23 @@ const migrateTypographyPresets = function ( attributes ) {
|
|
|
331
326
|
...attributes,
|
|
332
327
|
style: {
|
|
333
328
|
...attributes.style,
|
|
334
|
-
typography:
|
|
335
|
-
attributes.style.typography
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
329
|
+
typography: Object.fromEntries(
|
|
330
|
+
Object.entries( attributes.style.typography ?? {} ).map(
|
|
331
|
+
( [ key, value ] ) => {
|
|
332
|
+
const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[ key ];
|
|
333
|
+
if ( prefix && value.startsWith( prefix ) ) {
|
|
334
|
+
const newValue = value.slice( prefix.length );
|
|
335
|
+
if (
|
|
336
|
+
'textDecoration' === key &&
|
|
337
|
+
'strikethrough' === newValue
|
|
338
|
+
) {
|
|
339
|
+
return [ key, 'line-through' ];
|
|
340
|
+
}
|
|
341
|
+
return [ key, newValue ];
|
|
345
342
|
}
|
|
346
|
-
return
|
|
343
|
+
return [ key, value ];
|
|
347
344
|
}
|
|
348
|
-
|
|
349
|
-
}
|
|
345
|
+
)
|
|
350
346
|
),
|
|
351
347
|
},
|
|
352
348
|
};
|
|
@@ -477,19 +477,6 @@ function Navigation( {
|
|
|
477
477
|
showClassicMenuConversionNotice,
|
|
478
478
|
] );
|
|
479
479
|
|
|
480
|
-
// Spacer block needs orientation from context. This is a patch until
|
|
481
|
-
// https://github.com/WordPress/gutenberg/issues/36197 is addressed.
|
|
482
|
-
useEffect( () => {
|
|
483
|
-
if ( orientation ) {
|
|
484
|
-
__unstableMarkNextChangeAsNotPersistent();
|
|
485
|
-
setAttributes( { orientation } );
|
|
486
|
-
}
|
|
487
|
-
}, [
|
|
488
|
-
orientation,
|
|
489
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
490
|
-
setAttributes,
|
|
491
|
-
] );
|
|
492
|
-
|
|
493
480
|
useEffect( () => {
|
|
494
481
|
if ( ! enableContrastChecking ) {
|
|
495
482
|
return;
|