@wordpress/block-library 8.13.0 → 8.15.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/archives/index.js +5 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/index.js +5 -1
- package/build/audio/index.js.map +1 -1
- package/build/avatar/edit.js +1 -0
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/index.js +1 -1
- package/build/block/edit.js +1 -1
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +6 -9
- package/build/block/edit.native.js.map +1 -1
- package/build/block/index.js +2 -1
- package/build/block/index.js.map +1 -1
- package/build/buttons/edit.js +7 -3
- package/build/buttons/edit.js.map +1 -1
- package/build/categories/index.js +5 -1
- package/build/categories/index.js.map +1 -1
- package/build/code/index.js +5 -1
- package/build/code/index.js.map +1 -1
- package/build/column/edit.native.js +1 -4
- package/build/column/edit.native.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -0
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comments/index.js +1 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/deprecated.js +4 -2
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +1 -0
- package/build/cover/index.js.map +1 -1
- package/build/details/index.js +5 -1
- package/build/details/index.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +37 -13
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/util.js +9 -8
- package/build/embed/util.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/file/{interactivity.js → view-interactivity.js} +6 -2
- package/build/file/view-interactivity.js.map +1 -0
- package/build/footnotes/edit.js +20 -1
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js +19 -16
- package/build/footnotes/format.js.map +1 -1
- package/build/footnotes/index.js +0 -1
- package/build/footnotes/index.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +3 -1
- package/build/gallery/index.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/index.js +5 -1
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +5 -1
- package/build/heading/transforms.js.map +1 -1
- package/build/image/deprecated.js +453 -175
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +0 -4
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +96 -43
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +6 -0
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +8 -1
- package/build/image/save.js.map +1 -1
- package/build/image/utils.js +18 -0
- package/build/image/utils.js.map +1 -1
- package/build/image/{interactivity.js → view-interactivity.js} +86 -44
- package/build/image/view-interactivity.js.map +1 -0
- package/build/index.js +12 -3
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +1 -0
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +2 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/edit.js +4 -4
- package/build/list/edit.js.map +1 -1
- package/build/list/index.js +5 -1
- package/build/list/index.js.map +1 -1
- package/build/list-item/utils.js +6 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/index.js +1 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/missing/edit.js +22 -8
- package/build/missing/edit.js.map +1 -1
- package/build/missing/edit.native.js +7 -5
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/constants.js +10 -4
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/edit/index.js +17 -3
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +2 -2
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +0 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -15
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +33 -45
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view-interactivity.js +185 -0
- package/build/navigation/view-interactivity.js.map +1 -0
- package/build/navigation-link/edit.js +12 -18
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +12 -2
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +3 -3
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +34 -39
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +2 -15
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/paragraph/index.js +1 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +1 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-navigation-link/index.js +1 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-time-to-read/index.js +5 -1
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination-numbers/index.js +1 -1
- package/build/query-title/edit.js +43 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/transforms.js +8 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +4 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +1 -0
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +5 -1
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/icon.js +1 -1
- package/build/site-tagline/icon.js.map +1 -1
- package/build/site-tagline/index.js +5 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +5 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-links/index.js +3 -1
- package/build/social-links/index.js.map +1 -1
- package/build/table/index.js +5 -1
- package/build/table/index.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -0
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/index.js +1 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/term-description/index.js +1 -0
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build/verse/index.js +5 -1
- package/build/verse/index.js.map +1 -1
- package/build/video/deprecated.js +5 -1
- package/build/video/deprecated.js.map +1 -1
- package/build/video/index.js +5 -1
- package/build/video/index.js.map +1 -1
- package/build-module/archives/index.js +5 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/index.js +5 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/avatar/edit.js +1 -0
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/index.js +1 -1
- package/build-module/block/edit.js +1 -1
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +7 -9
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/block/index.js +2 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/buttons/edit.js +7 -3
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/categories/index.js +5 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/index.js +5 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/edit.native.js +1 -4
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comments/index.js +1 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/deprecated.js +4 -2
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +1 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/index.js +5 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +37 -14
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/util.js +6 -6
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/{interactivity.js → view-interactivity.js} +6 -2
- package/build-module/file/view-interactivity.js.map +1 -0
- package/build-module/footnotes/edit.js +18 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/footnotes/format.js +19 -16
- package/build-module/footnotes/format.js.map +1 -1
- package/build-module/footnotes/index.js +0 -1
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +3 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/index.js +5 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +5 -1
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +454 -176
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +0 -4
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +96 -46
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +6 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +8 -1
- package/build-module/image/save.js.map +1 -1
- package/build-module/image/utils.js +16 -0
- package/build-module/image/utils.js.map +1 -1
- package/build-module/image/{interactivity.js → view-interactivity.js} +86 -44
- package/build-module/image/view-interactivity.js.map +1 -0
- package/build-module/index.js +12 -3
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -0
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/edit.js +4 -4
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/index.js +5 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/list-item/utils.js +6 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/index.js +1 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/missing/edit.js +22 -8
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +8 -6
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/constants.js +8 -3
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/edit/index.js +18 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -2
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +0 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -2
- 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 +10 -14
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +35 -47
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view-interactivity.js +182 -0
- package/build-module/navigation/view-interactivity.js.map +1 -0
- package/build-module/navigation-link/edit.js +13 -19
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +13 -3
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +3 -3
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +34 -39
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +3 -16
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/paragraph/index.js +1 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +1 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +1 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-time-to-read/index.js +5 -1
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -1
- package/build-module/query-title/edit.js +44 -3
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/transforms.js +8 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +4 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -0
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +5 -1
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/icon.js +1 -1
- package/build-module/site-tagline/icon.js.map +1 -1
- package/build-module/site-tagline/index.js +5 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +5 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-links/index.js +3 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/table/index.js +5 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -0
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/term-description/index.js +1 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/verse/index.js +5 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/deprecated.js +5 -1
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/index.js +5 -1
- package/build-module/video/index.js.map +1 -1
- package/build-style/details/style-rtl.css +4 -2
- package/build-style/details/style.css +4 -2
- package/build-style/footnotes/style-rtl.css +4 -3
- package/build-style/footnotes/style.css +4 -3
- package/build-style/image/style-rtl.css +16 -2
- package/build-style/image/style.css +16 -2
- package/build-style/navigation/style-rtl.css +14 -2
- package/build-style/navigation/style.css +14 -2
- package/build-style/query-pagination/style-rtl.css +4 -2
- package/build-style/query-pagination/style.css +4 -2
- package/build-style/style-rtl.css +42 -11
- package/build-style/style.css +42 -11
- package/package.json +33 -37
- package/src/archives/block.json +5 -1
- package/src/audio/block.json +5 -1
- package/src/audio/test/__snapshots__/edit.native.js.snap +58 -33
- package/src/avatar/block.json +1 -1
- package/src/avatar/edit.js +1 -0
- package/src/block/block.json +2 -1
- package/src/block/edit.js +2 -2
- package/src/block/edit.native.js +8 -12
- package/src/block/editor.native.scss +2 -2
- package/src/block/test/edit.native.js +4 -4
- package/src/buttons/edit.js +4 -4
- package/src/categories/block.json +5 -1
- package/src/code/block.json +5 -1
- package/src/column/block.json +1 -0
- package/src/column/edit.native.js +4 -10
- package/src/column/editor.native.scss +0 -4
- package/src/columns/edit.js +1 -0
- package/src/comment-author-avatar/edit.js +1 -0
- package/src/comment-template/index.php +5 -2
- package/src/comments/block.json +1 -0
- package/src/cover/block.json +1 -0
- package/src/cover/deprecated.js +2 -0
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/details/block.json +5 -1
- package/src/embed/embed-placeholder.native.js +80 -47
- package/src/embed/styles.native.scss +54 -18
- package/src/embed/test/index.native.js +5 -5
- package/src/embed/util.js +4 -6
- package/src/file/index.php +4 -3
- package/src/file/inspector.js +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +58 -33
- package/src/file/{interactivity.js → view-interactivity.js} +4 -1
- package/src/footnotes/block.json +0 -1
- package/src/footnotes/edit.js +21 -2
- package/src/footnotes/format.js +22 -20
- package/src/footnotes/index.php +11 -9
- package/src/footnotes/style.scss +6 -3
- package/src/gallery/block.json +3 -1
- package/src/gallery/edit.js +1 -1
- package/src/gallery/test/index.native.js +17 -16
- package/src/group/block.json +1 -0
- package/src/heading/block.json +5 -1
- package/src/heading/test/index.native.js +18 -0
- package/src/home-link/index.php +15 -2
- package/src/image/block.json +6 -0
- package/src/image/deprecated.js +597 -320
- package/src/image/edit.js +0 -4
- package/src/image/image.js +131 -62
- package/src/image/index.php +47 -8
- package/src/image/save.js +9 -1
- package/src/image/style.scss +15 -2
- package/src/image/test/edit.native.js +1 -1
- package/src/image/utils.js +16 -0
- package/src/image/{interactivity.js → view-interactivity.js} +99 -50
- package/src/index.js +18 -1
- package/src/latest-comments/edit.js +1 -0
- package/src/latest-posts/edit.js +2 -0
- package/src/latest-posts/index.php +1 -1
- package/src/list/block.json +5 -1
- package/src/list/edit.js +6 -4
- package/src/list/test/edit.native.js +129 -33
- package/src/media-text/block.json +1 -0
- package/src/media-text/media-container.native.js +1 -0
- package/src/missing/edit.js +31 -11
- package/src/missing/edit.native.js +12 -10
- package/src/missing/style.native.scss +19 -12
- package/src/missing/test/__snapshots__/edit.native.js.snap +21 -13
- package/src/navigation/constants.js +12 -6
- package/src/navigation/edit/index.js +30 -3
- package/src/navigation/edit/inner-blocks.js +2 -2
- package/src/navigation/edit/menu-inspector-controls.js +0 -1
- package/src/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +17 -21
- package/src/navigation/index.php +43 -16
- package/src/navigation/style.scss +27 -8
- package/src/navigation/use-navigation-menu.js +39 -63
- package/src/navigation/view-interactivity.js +196 -0
- package/src/navigation-link/edit.js +61 -61
- package/src/navigation-link/link-ui.js +14 -2
- package/src/navigation-submenu/edit.js +2 -2
- package/src/navigation-submenu/index.php +2 -12
- package/src/page-list/convert-to-links-modal.js +3 -3
- package/src/page-list/edit.js +65 -62
- package/src/page-list/use-convert-to-navigation-links.js +3 -20
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +1 -0
- package/src/paragraph/test/edit.native.js +26 -0
- package/src/post-comments-form/block.json +1 -0
- package/src/post-navigation-link/block.json +1 -0
- package/src/post-template/index.php +4 -2
- package/src/post-time-to-read/block.json +5 -1
- package/src/post-title/index.php +6 -3
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -0
- package/src/query-pagination/edit.js +17 -14
- package/src/query-pagination-numbers/block.json +1 -1
- package/src/query-title/edit.js +48 -6
- package/src/quote/block.json +1 -0
- package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
- package/src/quote/test/transforms.native.js +5 -1
- package/src/quote/transforms.js +13 -0
- package/src/rss/edit.js +3 -0
- package/src/search/block.json +1 -0
- package/src/search/edit.js +4 -3
- package/src/search/index.php +22 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +7 -0
- package/src/site-logo/block.json +5 -1
- package/src/site-logo/edit.js +1 -0
- package/src/site-tagline/block.json +5 -1
- package/src/site-tagline/icon.js +1 -1
- package/src/site-title/block.json +5 -1
- package/src/social-links/block.json +3 -1
- package/src/table/block.json +5 -1
- package/src/tag-cloud/edit.js +1 -0
- package/src/template-part/edit/index.js +1 -1
- package/src/template-part/index.php +9 -15
- package/src/term-description/block.json +1 -0
- package/src/text-columns/edit.js +1 -0
- package/src/verse/block.json +5 -1
- package/src/video/block.json +5 -1
- package/build/file/interactivity.js.map +0 -1
- package/build/gallery/shared-icon.native.js +0 -38
- package/build/gallery/shared-icon.native.js.map +0 -1
- package/build/heading/heading-level-icon.js +0 -61
- package/build/heading/heading-level-icon.js.map +0 -1
- package/build/image/interactivity.js.map +0 -1
- package/build/navigation/interactivity.js +0 -167
- package/build/navigation/interactivity.js.map +0 -1
- package/build/utils/interactivity/constants.js +0 -9
- package/build/utils/interactivity/constants.js.map +0 -1
- package/build/utils/interactivity/directives.js +0 -222
- package/build/utils/interactivity/directives.js.map +0 -1
- package/build/utils/interactivity/hooks.js +0 -159
- package/build/utils/interactivity/hooks.js.map +0 -1
- package/build/utils/interactivity/hydration.js +0 -34
- package/build/utils/interactivity/hydration.js.map +0 -1
- package/build/utils/interactivity/index.js +0 -32
- package/build/utils/interactivity/index.js.map +0 -1
- package/build/utils/interactivity/portals.js +0 -108
- package/build/utils/interactivity/portals.js.map +0 -1
- package/build/utils/interactivity/store.js +0 -66
- package/build/utils/interactivity/store.js.map +0 -1
- package/build/utils/interactivity/utils.js +0 -87
- package/build/utils/interactivity/utils.js.map +0 -1
- package/build/utils/interactivity/vdom.js +0 -119
- package/build/utils/interactivity/vdom.js.map +0 -1
- package/build-module/file/interactivity.js.map +0 -1
- package/build-module/gallery/shared-icon.native.js +0 -24
- package/build-module/gallery/shared-icon.native.js.map +0 -1
- package/build-module/heading/heading-level-icon.js +0 -53
- package/build-module/heading/heading-level-icon.js.map +0 -1
- package/build-module/image/interactivity.js.map +0 -1
- package/build-module/navigation/interactivity.js +0 -164
- package/build-module/navigation/interactivity.js.map +0 -1
- package/build-module/utils/interactivity/constants.js +0 -2
- package/build-module/utils/interactivity/constants.js.map +0 -1
- package/build-module/utils/interactivity/directives.js +0 -209
- package/build-module/utils/interactivity/directives.js.map +0 -1
- package/build-module/utils/interactivity/hooks.js +0 -145
- package/build-module/utils/interactivity/hooks.js.map +0 -1
- package/build-module/utils/interactivity/hydration.js +0 -21
- package/build-module/utils/interactivity/hydration.js.map +0 -1
- package/build-module/utils/interactivity/index.js +0 -15
- package/build-module/utils/interactivity/index.js.map +0 -1
- package/build-module/utils/interactivity/portals.js +0 -100
- package/build-module/utils/interactivity/portals.js.map +0 -1
- package/build-module/utils/interactivity/store.js +0 -55
- package/build-module/utils/interactivity/store.js.map +0 -1
- package/build-module/utils/interactivity/utils.js +0 -75
- package/build-module/utils/interactivity/utils.js.map +0 -1
- package/build-module/utils/interactivity/vdom.js +0 -107
- package/build-module/utils/interactivity/vdom.js.map +0 -1
- package/src/gallery/shared-icon.native.js +0 -23
- package/src/heading/heading-level-icon.js +0 -48
- package/src/navigation/interactivity.js +0 -169
- package/src/utils/interactivity/constants.js +0 -1
- package/src/utils/interactivity/directives.js +0 -200
- package/src/utils/interactivity/hooks.js +0 -145
- package/src/utils/interactivity/hydration.js +0 -22
- package/src/utils/interactivity/index.js +0 -15
- package/src/utils/interactivity/portals.js +0 -98
- package/src/utils/interactivity/store.js +0 -45
- package/src/utils/interactivity/utils.js +0 -66
- package/src/utils/interactivity/vdom.js +0 -111
package/src/image/deprecated.js
CHANGED
|
@@ -6,355 +6,632 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
RichText,
|
|
11
|
+
useBlockProps,
|
|
12
|
+
__experimentalGetElementClassName as getBorderClassesAndStyles,
|
|
13
|
+
} from '@wordpress/block-editor';
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
attribute: 'class',
|
|
56
|
-
},
|
|
57
|
-
id: {
|
|
58
|
-
type: 'number',
|
|
15
|
+
/**
|
|
16
|
+
* Deprecation for adding the `wp-image-${id}` class to the image block for
|
|
17
|
+
* responsive images.
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/WordPress/gutenberg/pull/4898
|
|
20
|
+
*/
|
|
21
|
+
const v1 = {
|
|
22
|
+
attributes: {
|
|
23
|
+
url: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
source: 'attribute',
|
|
26
|
+
selector: 'img',
|
|
27
|
+
attribute: 'src',
|
|
28
|
+
},
|
|
29
|
+
alt: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
source: 'attribute',
|
|
32
|
+
selector: 'img',
|
|
33
|
+
attribute: 'alt',
|
|
34
|
+
default: '',
|
|
35
|
+
},
|
|
36
|
+
caption: {
|
|
37
|
+
type: 'array',
|
|
38
|
+
source: 'children',
|
|
39
|
+
selector: 'figcaption',
|
|
40
|
+
},
|
|
41
|
+
href: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
source: 'attribute',
|
|
44
|
+
selector: 'a',
|
|
45
|
+
attribute: 'href',
|
|
46
|
+
},
|
|
47
|
+
id: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
},
|
|
50
|
+
align: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
},
|
|
53
|
+
width: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
},
|
|
56
|
+
height: {
|
|
57
|
+
type: 'number',
|
|
58
|
+
},
|
|
59
59
|
},
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
save( { attributes } ) {
|
|
61
|
+
const { url, alt, caption, align, href, width, height } = attributes;
|
|
62
|
+
const extraImageProps = width || height ? { width, height } : {};
|
|
63
|
+
const image = <img src={ url } alt={ alt } { ...extraImageProps } />;
|
|
64
|
+
|
|
65
|
+
let figureStyle = {};
|
|
66
|
+
|
|
67
|
+
if ( width ) {
|
|
68
|
+
figureStyle = { width };
|
|
69
|
+
} else if ( align === 'left' || align === 'right' ) {
|
|
70
|
+
figureStyle = { maxWidth: '50%' };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<figure
|
|
75
|
+
className={ align ? `align${ align }` : null }
|
|
76
|
+
style={ figureStyle }
|
|
77
|
+
>
|
|
78
|
+
{ href ? <a href={ href }>{ image }</a> : image }
|
|
79
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
80
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
81
|
+
) }
|
|
82
|
+
</figure>
|
|
83
|
+
);
|
|
62
84
|
},
|
|
63
|
-
|
|
64
|
-
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Deprecation for adding the `is-resized` class to the image block to fix
|
|
89
|
+
* captions on resized images.
|
|
90
|
+
*
|
|
91
|
+
* @see https://github.com/WordPress/gutenberg/pull/6496
|
|
92
|
+
*/
|
|
93
|
+
const v2 = {
|
|
94
|
+
attributes: {
|
|
95
|
+
url: {
|
|
96
|
+
type: 'string',
|
|
97
|
+
source: 'attribute',
|
|
98
|
+
selector: 'img',
|
|
99
|
+
attribute: 'src',
|
|
100
|
+
},
|
|
101
|
+
alt: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
source: 'attribute',
|
|
104
|
+
selector: 'img',
|
|
105
|
+
attribute: 'alt',
|
|
106
|
+
default: '',
|
|
107
|
+
},
|
|
108
|
+
caption: {
|
|
109
|
+
type: 'array',
|
|
110
|
+
source: 'children',
|
|
111
|
+
selector: 'figcaption',
|
|
112
|
+
},
|
|
113
|
+
href: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
source: 'attribute',
|
|
116
|
+
selector: 'a',
|
|
117
|
+
attribute: 'href',
|
|
118
|
+
},
|
|
119
|
+
id: {
|
|
120
|
+
type: 'number',
|
|
121
|
+
},
|
|
122
|
+
align: {
|
|
123
|
+
type: 'string',
|
|
124
|
+
},
|
|
125
|
+
width: {
|
|
126
|
+
type: 'number',
|
|
127
|
+
},
|
|
128
|
+
height: {
|
|
129
|
+
type: 'number',
|
|
130
|
+
},
|
|
65
131
|
},
|
|
66
|
-
|
|
67
|
-
|
|
132
|
+
save( { attributes } ) {
|
|
133
|
+
const { url, alt, caption, align, href, width, height, id } =
|
|
134
|
+
attributes;
|
|
135
|
+
|
|
136
|
+
const image = (
|
|
137
|
+
<img
|
|
138
|
+
src={ url }
|
|
139
|
+
alt={ alt }
|
|
140
|
+
className={ id ? `wp-image-${ id }` : null }
|
|
141
|
+
width={ width }
|
|
142
|
+
height={ height }
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<figure className={ align ? `align${ align }` : null }>
|
|
148
|
+
{ href ? <a href={ href }>{ image }</a> : image }
|
|
149
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
150
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
151
|
+
) }
|
|
152
|
+
</figure>
|
|
153
|
+
);
|
|
68
154
|
},
|
|
69
|
-
|
|
70
|
-
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Deprecation for image floats including a wrapping div.
|
|
159
|
+
*
|
|
160
|
+
* @see https://github.com/WordPress/gutenberg/pull/7721
|
|
161
|
+
*/
|
|
162
|
+
const v3 = {
|
|
163
|
+
attributes: {
|
|
164
|
+
url: {
|
|
165
|
+
type: 'string',
|
|
166
|
+
source: 'attribute',
|
|
167
|
+
selector: 'img',
|
|
168
|
+
attribute: 'src',
|
|
169
|
+
},
|
|
170
|
+
alt: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
source: 'attribute',
|
|
173
|
+
selector: 'img',
|
|
174
|
+
attribute: 'alt',
|
|
175
|
+
default: '',
|
|
176
|
+
},
|
|
177
|
+
caption: {
|
|
178
|
+
type: 'array',
|
|
179
|
+
source: 'children',
|
|
180
|
+
selector: 'figcaption',
|
|
181
|
+
},
|
|
182
|
+
href: {
|
|
183
|
+
type: 'string',
|
|
184
|
+
source: 'attribute',
|
|
185
|
+
selector: 'figure > a',
|
|
186
|
+
attribute: 'href',
|
|
187
|
+
},
|
|
188
|
+
id: {
|
|
189
|
+
type: 'number',
|
|
190
|
+
},
|
|
191
|
+
align: {
|
|
192
|
+
type: 'string',
|
|
193
|
+
},
|
|
194
|
+
width: {
|
|
195
|
+
type: 'number',
|
|
196
|
+
},
|
|
197
|
+
height: {
|
|
198
|
+
type: 'number',
|
|
199
|
+
},
|
|
200
|
+
linkDestination: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
default: 'none',
|
|
203
|
+
},
|
|
71
204
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
205
|
+
save( { attributes } ) {
|
|
206
|
+
const { url, alt, caption, align, href, width, height, id } =
|
|
207
|
+
attributes;
|
|
208
|
+
|
|
209
|
+
const classes = classnames( {
|
|
210
|
+
[ `align${ align }` ]: align,
|
|
211
|
+
'is-resized': width || height,
|
|
212
|
+
} );
|
|
213
|
+
|
|
214
|
+
const image = (
|
|
215
|
+
<img
|
|
216
|
+
src={ url }
|
|
217
|
+
alt={ alt }
|
|
218
|
+
className={ id ? `wp-image-${ id }` : null }
|
|
219
|
+
width={ width }
|
|
220
|
+
height={ height }
|
|
221
|
+
/>
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<figure className={ classes }>
|
|
226
|
+
{ href ? <a href={ href }>{ image }</a> : image }
|
|
227
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
228
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
229
|
+
) }
|
|
230
|
+
</figure>
|
|
231
|
+
);
|
|
77
232
|
},
|
|
78
233
|
};
|
|
79
234
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
235
|
+
/**
|
|
236
|
+
* Deprecation for removing the outer div wrapper around aligned images.
|
|
237
|
+
*
|
|
238
|
+
* @see https://github.com/WordPress/gutenberg/pull/38657
|
|
239
|
+
*/
|
|
240
|
+
const v4 = {
|
|
241
|
+
attributes: {
|
|
242
|
+
align: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
},
|
|
245
|
+
url: {
|
|
246
|
+
type: 'string',
|
|
247
|
+
source: 'attribute',
|
|
248
|
+
selector: 'img',
|
|
249
|
+
attribute: 'src',
|
|
250
|
+
},
|
|
251
|
+
alt: {
|
|
252
|
+
type: 'string',
|
|
253
|
+
source: 'attribute',
|
|
254
|
+
selector: 'img',
|
|
255
|
+
attribute: 'alt',
|
|
256
|
+
default: '',
|
|
257
|
+
},
|
|
258
|
+
caption: {
|
|
259
|
+
type: 'string',
|
|
260
|
+
source: 'html',
|
|
261
|
+
selector: 'figcaption',
|
|
262
|
+
},
|
|
263
|
+
title: {
|
|
264
|
+
type: 'string',
|
|
265
|
+
source: 'attribute',
|
|
266
|
+
selector: 'img',
|
|
267
|
+
attribute: 'title',
|
|
268
|
+
},
|
|
269
|
+
href: {
|
|
270
|
+
type: 'string',
|
|
271
|
+
source: 'attribute',
|
|
272
|
+
selector: 'figure > a',
|
|
273
|
+
attribute: 'href',
|
|
274
|
+
},
|
|
275
|
+
rel: {
|
|
276
|
+
type: 'string',
|
|
277
|
+
source: 'attribute',
|
|
278
|
+
selector: 'figure > a',
|
|
279
|
+
attribute: 'rel',
|
|
280
|
+
},
|
|
281
|
+
linkClass: {
|
|
282
|
+
type: 'string',
|
|
283
|
+
source: 'attribute',
|
|
284
|
+
selector: 'figure > a',
|
|
285
|
+
attribute: 'class',
|
|
286
|
+
},
|
|
287
|
+
id: {
|
|
288
|
+
type: 'number',
|
|
289
|
+
},
|
|
290
|
+
width: {
|
|
291
|
+
type: 'number',
|
|
292
|
+
},
|
|
293
|
+
height: {
|
|
294
|
+
type: 'number',
|
|
295
|
+
},
|
|
296
|
+
sizeSlug: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
},
|
|
299
|
+
linkDestination: {
|
|
300
|
+
type: 'string',
|
|
301
|
+
},
|
|
302
|
+
linkTarget: {
|
|
303
|
+
type: 'string',
|
|
304
|
+
source: 'attribute',
|
|
305
|
+
selector: 'figure > a',
|
|
306
|
+
attribute: 'target',
|
|
91
307
|
},
|
|
92
308
|
},
|
|
93
|
-
|
|
309
|
+
supports: {
|
|
310
|
+
anchor: true,
|
|
311
|
+
},
|
|
312
|
+
save( { attributes } ) {
|
|
313
|
+
const {
|
|
314
|
+
url,
|
|
315
|
+
alt,
|
|
316
|
+
caption,
|
|
317
|
+
align,
|
|
318
|
+
href,
|
|
319
|
+
rel,
|
|
320
|
+
linkClass,
|
|
321
|
+
width,
|
|
322
|
+
height,
|
|
323
|
+
id,
|
|
324
|
+
linkTarget,
|
|
325
|
+
sizeSlug,
|
|
326
|
+
title,
|
|
327
|
+
} = attributes;
|
|
94
328
|
|
|
95
|
-
const
|
|
96
|
-
// The following deprecation moves existing border radius styles onto the
|
|
97
|
-
// inner img element where new border block support styles must be applied.
|
|
98
|
-
// It will also add a new `.has-custom-border` class for existing blocks
|
|
99
|
-
// with border radii set. This class is required to improve caption position
|
|
100
|
-
// and styling when an image within a gallery has a custom border or
|
|
101
|
-
// rounded corners.
|
|
102
|
-
//
|
|
103
|
-
// See: https://github.com/WordPress/gutenberg/pull/31366/
|
|
104
|
-
{
|
|
105
|
-
attributes: blockAttributes,
|
|
106
|
-
supports: blockSupports,
|
|
107
|
-
save( { attributes } ) {
|
|
108
|
-
const {
|
|
109
|
-
url,
|
|
110
|
-
alt,
|
|
111
|
-
caption,
|
|
112
|
-
align,
|
|
113
|
-
href,
|
|
114
|
-
rel,
|
|
115
|
-
linkClass,
|
|
116
|
-
width,
|
|
117
|
-
height,
|
|
118
|
-
id,
|
|
119
|
-
linkTarget,
|
|
120
|
-
sizeSlug,
|
|
121
|
-
title,
|
|
122
|
-
} = attributes;
|
|
123
|
-
|
|
124
|
-
const newRel = ! rel ? undefined : rel;
|
|
125
|
-
|
|
126
|
-
const classes = classnames( {
|
|
127
|
-
[ `align${ align }` ]: align,
|
|
128
|
-
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
129
|
-
'is-resized': width || height,
|
|
130
|
-
} );
|
|
131
|
-
|
|
132
|
-
const image = (
|
|
133
|
-
<img
|
|
134
|
-
src={ url }
|
|
135
|
-
alt={ alt }
|
|
136
|
-
className={ id ? `wp-image-${ id }` : null }
|
|
137
|
-
width={ width }
|
|
138
|
-
height={ height }
|
|
139
|
-
title={ title }
|
|
140
|
-
/>
|
|
141
|
-
);
|
|
329
|
+
const newRel = ! rel ? undefined : rel;
|
|
142
330
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
331
|
+
const classes = classnames( {
|
|
332
|
+
[ `align${ align }` ]: align,
|
|
333
|
+
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
334
|
+
'is-resized': width || height,
|
|
335
|
+
} );
|
|
336
|
+
|
|
337
|
+
const image = (
|
|
338
|
+
<img
|
|
339
|
+
src={ url }
|
|
340
|
+
alt={ alt }
|
|
341
|
+
className={ id ? `wp-image-${ id }` : null }
|
|
342
|
+
width={ width }
|
|
343
|
+
height={ height }
|
|
344
|
+
title={ title }
|
|
345
|
+
/>
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
const figure = (
|
|
349
|
+
<>
|
|
350
|
+
{ href ? (
|
|
351
|
+
<a
|
|
352
|
+
className={ linkClass }
|
|
353
|
+
href={ href }
|
|
354
|
+
target={ linkTarget }
|
|
355
|
+
rel={ newRel }
|
|
356
|
+
>
|
|
357
|
+
{ image }
|
|
358
|
+
</a>
|
|
359
|
+
) : (
|
|
360
|
+
image
|
|
361
|
+
) }
|
|
362
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
363
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
364
|
+
) }
|
|
365
|
+
</>
|
|
366
|
+
);
|
|
165
367
|
|
|
368
|
+
if ( 'left' === align || 'right' === align || 'center' === align ) {
|
|
166
369
|
return (
|
|
167
|
-
<
|
|
168
|
-
{ figure }
|
|
169
|
-
</
|
|
370
|
+
<div { ...useBlockProps.save() }>
|
|
371
|
+
<figure className={ classes }>{ figure }</figure>
|
|
372
|
+
</div>
|
|
170
373
|
);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return (
|
|
377
|
+
<figure { ...useBlockProps.save( { className: classes } ) }>
|
|
378
|
+
{ figure }
|
|
379
|
+
</figure>
|
|
380
|
+
);
|
|
381
|
+
},
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Deprecation for moving existing border radius styles onto the inner img
|
|
386
|
+
* element where new border block support styles must be applied.
|
|
387
|
+
* It will also add a new `.has-custom-border` class for existing blocks
|
|
388
|
+
* with border radii set. This class is required to improve caption position
|
|
389
|
+
* and styling when an image within a gallery has a custom border or
|
|
390
|
+
* rounded corners.
|
|
391
|
+
*
|
|
392
|
+
* @see https://github.com/WordPress/gutenberg/pull/31366
|
|
393
|
+
*/
|
|
394
|
+
const v5 = {
|
|
395
|
+
attributes: {
|
|
396
|
+
align: {
|
|
397
|
+
type: 'string',
|
|
398
|
+
},
|
|
399
|
+
url: {
|
|
400
|
+
type: 'string',
|
|
401
|
+
source: 'attribute',
|
|
402
|
+
selector: 'img',
|
|
403
|
+
attribute: 'src',
|
|
404
|
+
},
|
|
405
|
+
alt: {
|
|
406
|
+
type: 'string',
|
|
407
|
+
source: 'attribute',
|
|
408
|
+
selector: 'img',
|
|
409
|
+
attribute: 'alt',
|
|
410
|
+
default: '',
|
|
411
|
+
},
|
|
412
|
+
caption: {
|
|
413
|
+
type: 'string',
|
|
414
|
+
source: 'html',
|
|
415
|
+
selector: 'figcaption',
|
|
416
|
+
},
|
|
417
|
+
title: {
|
|
418
|
+
type: 'string',
|
|
419
|
+
source: 'attribute',
|
|
420
|
+
selector: 'img',
|
|
421
|
+
attribute: 'title',
|
|
422
|
+
},
|
|
423
|
+
href: {
|
|
424
|
+
type: 'string',
|
|
425
|
+
source: 'attribute',
|
|
426
|
+
selector: 'figure > a',
|
|
427
|
+
attribute: 'href',
|
|
428
|
+
},
|
|
429
|
+
rel: {
|
|
430
|
+
type: 'string',
|
|
431
|
+
source: 'attribute',
|
|
432
|
+
selector: 'figure > a',
|
|
433
|
+
attribute: 'rel',
|
|
434
|
+
},
|
|
435
|
+
linkClass: {
|
|
436
|
+
type: 'string',
|
|
437
|
+
source: 'attribute',
|
|
438
|
+
selector: 'figure > a',
|
|
439
|
+
attribute: 'class',
|
|
440
|
+
},
|
|
441
|
+
id: {
|
|
442
|
+
type: 'number',
|
|
443
|
+
},
|
|
444
|
+
width: {
|
|
445
|
+
type: 'number',
|
|
446
|
+
},
|
|
447
|
+
height: {
|
|
448
|
+
type: 'number',
|
|
449
|
+
},
|
|
450
|
+
sizeSlug: {
|
|
451
|
+
type: 'string',
|
|
452
|
+
},
|
|
453
|
+
linkDestination: {
|
|
454
|
+
type: 'string',
|
|
455
|
+
},
|
|
456
|
+
linkTarget: {
|
|
457
|
+
type: 'string',
|
|
458
|
+
source: 'attribute',
|
|
459
|
+
selector: 'figure > a',
|
|
460
|
+
attribute: 'target',
|
|
171
461
|
},
|
|
172
462
|
},
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
463
|
+
supports: {
|
|
464
|
+
anchor: true,
|
|
465
|
+
color: {
|
|
466
|
+
__experimentalDuotone: 'img',
|
|
467
|
+
text: false,
|
|
468
|
+
background: false,
|
|
469
|
+
},
|
|
470
|
+
__experimentalBorder: {
|
|
471
|
+
radius: true,
|
|
472
|
+
__experimentalDefaultControls: {
|
|
473
|
+
radius: true,
|
|
181
474
|
},
|
|
182
|
-
|
|
183
|
-
|
|
475
|
+
},
|
|
476
|
+
__experimentalStyle: {
|
|
477
|
+
spacing: {
|
|
478
|
+
margin: '0 0 1em 0',
|
|
184
479
|
},
|
|
185
480
|
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const newRel = ! rel ? undefined : rel;
|
|
205
|
-
|
|
206
|
-
const classes = classnames( {
|
|
207
|
-
[ `align${ align }` ]: align,
|
|
208
|
-
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
209
|
-
'is-resized': width || height,
|
|
210
|
-
} );
|
|
211
|
-
|
|
212
|
-
const image = (
|
|
213
|
-
<img
|
|
214
|
-
src={ url }
|
|
215
|
-
alt={ alt }
|
|
216
|
-
className={ id ? `wp-image-${ id }` : null }
|
|
217
|
-
width={ width }
|
|
218
|
-
height={ height }
|
|
219
|
-
title={ title }
|
|
220
|
-
/>
|
|
221
|
-
);
|
|
481
|
+
},
|
|
482
|
+
save( { attributes } ) {
|
|
483
|
+
const {
|
|
484
|
+
url,
|
|
485
|
+
alt,
|
|
486
|
+
caption,
|
|
487
|
+
align,
|
|
488
|
+
href,
|
|
489
|
+
rel,
|
|
490
|
+
linkClass,
|
|
491
|
+
width,
|
|
492
|
+
height,
|
|
493
|
+
id,
|
|
494
|
+
linkTarget,
|
|
495
|
+
sizeSlug,
|
|
496
|
+
title,
|
|
497
|
+
} = attributes;
|
|
222
498
|
|
|
223
|
-
|
|
224
|
-
<>
|
|
225
|
-
{ href ? (
|
|
226
|
-
<a
|
|
227
|
-
className={ linkClass }
|
|
228
|
-
href={ href }
|
|
229
|
-
target={ linkTarget }
|
|
230
|
-
rel={ newRel }
|
|
231
|
-
>
|
|
232
|
-
{ image }
|
|
233
|
-
</a>
|
|
234
|
-
) : (
|
|
235
|
-
image
|
|
236
|
-
) }
|
|
237
|
-
{ ! RichText.isEmpty( caption ) && (
|
|
238
|
-
<RichText.Content
|
|
239
|
-
tagName="figcaption"
|
|
240
|
-
value={ caption }
|
|
241
|
-
/>
|
|
242
|
-
) }
|
|
243
|
-
</>
|
|
244
|
-
);
|
|
499
|
+
const newRel = ! rel ? undefined : rel;
|
|
245
500
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
);
|
|
252
|
-
}
|
|
501
|
+
const classes = classnames( {
|
|
502
|
+
[ `align${ align }` ]: align,
|
|
503
|
+
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
504
|
+
'is-resized': width || height,
|
|
505
|
+
} );
|
|
253
506
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const { url, alt, caption, align, href, width, height, id } =
|
|
265
|
-
attributes;
|
|
266
|
-
|
|
267
|
-
const classes = classnames( {
|
|
268
|
-
[ `align${ align }` ]: align,
|
|
269
|
-
'is-resized': width || height,
|
|
270
|
-
} );
|
|
271
|
-
|
|
272
|
-
const image = (
|
|
273
|
-
<img
|
|
274
|
-
src={ url }
|
|
275
|
-
alt={ alt }
|
|
276
|
-
className={ id ? `wp-image-${ id }` : null }
|
|
277
|
-
width={ width }
|
|
278
|
-
height={ height }
|
|
279
|
-
/>
|
|
280
|
-
);
|
|
507
|
+
const image = (
|
|
508
|
+
<img
|
|
509
|
+
src={ url }
|
|
510
|
+
alt={ alt }
|
|
511
|
+
className={ id ? `wp-image-${ id }` : null }
|
|
512
|
+
width={ width }
|
|
513
|
+
height={ height }
|
|
514
|
+
title={ title }
|
|
515
|
+
/>
|
|
516
|
+
);
|
|
281
517
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const image = (
|
|
302
|
-
<img
|
|
303
|
-
src={ url }
|
|
304
|
-
alt={ alt }
|
|
305
|
-
className={ id ? `wp-image-${ id }` : null }
|
|
306
|
-
width={ width }
|
|
307
|
-
height={ height }
|
|
308
|
-
/>
|
|
309
|
-
);
|
|
518
|
+
const figure = (
|
|
519
|
+
<>
|
|
520
|
+
{ href ? (
|
|
521
|
+
<a
|
|
522
|
+
className={ linkClass }
|
|
523
|
+
href={ href }
|
|
524
|
+
target={ linkTarget }
|
|
525
|
+
rel={ newRel }
|
|
526
|
+
>
|
|
527
|
+
{ image }
|
|
528
|
+
</a>
|
|
529
|
+
) : (
|
|
530
|
+
image
|
|
531
|
+
) }
|
|
532
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
533
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
534
|
+
) }
|
|
535
|
+
</>
|
|
536
|
+
);
|
|
310
537
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
tagName="figcaption"
|
|
317
|
-
value={ caption }
|
|
318
|
-
/>
|
|
319
|
-
) }
|
|
320
|
-
</figure>
|
|
321
|
-
);
|
|
322
|
-
},
|
|
538
|
+
return (
|
|
539
|
+
<figure { ...useBlockProps.save( { className: classes } ) }>
|
|
540
|
+
{ figure }
|
|
541
|
+
</figure>
|
|
542
|
+
);
|
|
323
543
|
},
|
|
324
|
-
|
|
325
|
-
attributes: blockAttributes,
|
|
326
|
-
save( { attributes } ) {
|
|
327
|
-
const { url, alt, caption, align, href, width, height } =
|
|
328
|
-
attributes;
|
|
329
|
-
const extraImageProps = width || height ? { width, height } : {};
|
|
330
|
-
const image = (
|
|
331
|
-
<img src={ url } alt={ alt } { ...extraImageProps } />
|
|
332
|
-
);
|
|
544
|
+
};
|
|
333
545
|
|
|
334
|
-
|
|
546
|
+
/**
|
|
547
|
+
* Deprecation for adding width and height as style rules on the inner img.
|
|
548
|
+
* It also updates the widht and height attributes to be strings instead of numbers.
|
|
549
|
+
*
|
|
550
|
+
* @see https://github.com/WordPress/gutenberg/pull/31366
|
|
551
|
+
*/
|
|
552
|
+
const v6 = {
|
|
553
|
+
save( { attributes } ) {
|
|
554
|
+
const {
|
|
555
|
+
url,
|
|
556
|
+
alt,
|
|
557
|
+
caption,
|
|
558
|
+
align,
|
|
559
|
+
href,
|
|
560
|
+
rel,
|
|
561
|
+
linkClass,
|
|
562
|
+
width,
|
|
563
|
+
height,
|
|
564
|
+
aspectRatio,
|
|
565
|
+
scale,
|
|
566
|
+
id,
|
|
567
|
+
linkTarget,
|
|
568
|
+
sizeSlug,
|
|
569
|
+
title,
|
|
570
|
+
} = attributes;
|
|
335
571
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
} else if ( align === 'left' || align === 'right' ) {
|
|
339
|
-
figureStyle = { maxWidth: '50%' };
|
|
340
|
-
}
|
|
572
|
+
const newRel = ! rel ? undefined : rel;
|
|
573
|
+
const borderProps = getBorderClassesAndStyles( attributes );
|
|
341
574
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
575
|
+
const classes = classnames( {
|
|
576
|
+
[ `align${ align }` ]: align,
|
|
577
|
+
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
578
|
+
'is-resized': width || height,
|
|
579
|
+
'has-custom-border':
|
|
580
|
+
!! borderProps.className ||
|
|
581
|
+
( borderProps.style &&
|
|
582
|
+
Object.keys( borderProps.style ).length > 0 ),
|
|
583
|
+
} );
|
|
584
|
+
|
|
585
|
+
const imageClasses = classnames( borderProps.className, {
|
|
586
|
+
[ `wp-image-${ id }` ]: !! id,
|
|
587
|
+
} );
|
|
588
|
+
|
|
589
|
+
const image = (
|
|
590
|
+
<img
|
|
591
|
+
src={ url }
|
|
592
|
+
alt={ alt }
|
|
593
|
+
className={ imageClasses || undefined }
|
|
594
|
+
style={ {
|
|
595
|
+
...borderProps.style,
|
|
596
|
+
aspectRatio,
|
|
597
|
+
objectFit: scale,
|
|
598
|
+
} }
|
|
599
|
+
width={ width }
|
|
600
|
+
height={ height }
|
|
601
|
+
title={ title }
|
|
602
|
+
/>
|
|
603
|
+
);
|
|
604
|
+
|
|
605
|
+
const figure = (
|
|
606
|
+
<>
|
|
607
|
+
{ href ? (
|
|
608
|
+
<a
|
|
609
|
+
className={ linkClass }
|
|
610
|
+
href={ href }
|
|
611
|
+
target={ linkTarget }
|
|
612
|
+
rel={ newRel }
|
|
613
|
+
>
|
|
614
|
+
{ image }
|
|
615
|
+
</a>
|
|
616
|
+
) : (
|
|
617
|
+
image
|
|
618
|
+
) }
|
|
619
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
620
|
+
<RichText.Content
|
|
621
|
+
className={ getBorderClassesAndStyles( 'caption' ) }
|
|
622
|
+
tagName="figcaption"
|
|
623
|
+
value={ caption }
|
|
624
|
+
/>
|
|
625
|
+
) }
|
|
626
|
+
</>
|
|
627
|
+
);
|
|
628
|
+
|
|
629
|
+
return (
|
|
630
|
+
<figure { ...useBlockProps.save( { className: classes } ) }>
|
|
631
|
+
{ figure }
|
|
632
|
+
</figure>
|
|
633
|
+
);
|
|
357
634
|
},
|
|
358
|
-
|
|
635
|
+
};
|
|
359
636
|
|
|
360
|
-
export default
|
|
637
|
+
export default [ v6, v5, v4, v3, v2, v1 ];
|