@wordpress/block-library 11.1.0 → 11.2.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 +32 -0
- package/build/accordion-heading/block.json +1 -0
- package/build/archives/block.json +3 -0
- package/build/audio/edit.cjs +2 -1
- package/build/audio/edit.cjs.map +2 -2
- package/build/avatar/block.json +4 -0
- package/build/avatar/edit.cjs +31 -1
- package/build/avatar/edit.cjs.map +3 -3
- package/build/button/block.json +6 -0
- package/build/button/edit.cjs +9 -6
- package/build/button/edit.cjs.map +2 -2
- package/build/buttons/block.json +6 -1
- package/build/code/block.json +4 -0
- package/build/column/edit.cjs +5 -0
- package/build/column/edit.cjs.map +2 -2
- package/build/columns/block.json +4 -0
- package/build/columns/edit.cjs +21 -112
- package/build/columns/edit.cjs.map +3 -3
- package/build/comments/edit/placeholder.cjs +95 -87
- package/build/comments/edit/placeholder.cjs.map +2 -2
- package/build/comments-pagination/block.json +11 -0
- package/build/cover/block.json +2 -1
- package/build/cover/edit/index.cjs +26 -5
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +4 -1
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/cover/embed-video-utils.cjs +9 -8
- package/build/cover/embed-video-utils.cjs.map +2 -2
- package/build/cover/view.cjs +21 -0
- package/build/cover/view.cjs.map +7 -0
- package/build/details/block.json +3 -0
- package/build/embed/block.json +6 -1
- package/build/file/block.json +5 -0
- package/build/footnotes/block.json +4 -0
- package/build/gallery/block.json +13 -0
- package/build/gallery/dynamic-gallery.cjs +32 -93
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +103 -40
- package/build/gallery/edit.cjs.map +2 -2
- package/build/gallery/order-controls.cjs +107 -0
- package/build/gallery/order-controls.cjs.map +7 -0
- package/build/gallery/order-images.cjs +92 -0
- package/build/gallery/order-images.cjs.map +7 -0
- package/build/gallery/order-options.cjs +62 -0
- package/build/gallery/order-options.cjs.map +7 -0
- package/build/gallery/use-dynamic-gallery.cjs +1 -7
- package/build/gallery/use-dynamic-gallery.cjs.map +2 -2
- package/build/gallery/use-get-media.cjs +2 -3
- package/build/gallery/use-get-media.cjs.map +2 -2
- package/build/group/edit.cjs +3 -3
- package/build/group/edit.cjs.map +2 -2
- package/build/heading/block.json +5 -0
- package/build/home-link/block.json +12 -0
- package/build/icon/components/custom-inserter/index.cjs +3 -1
- package/build/icon/components/custom-inserter/index.cjs.map +2 -2
- package/build/icon/edit.cjs +49 -5
- package/build/icon/edit.cjs.map +2 -2
- package/build/image/use-open-image-media-editor-modal.cjs +32 -28
- package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
- package/build/image/view.cjs +44 -50
- package/build/image/view.cjs.map +2 -2
- package/build/latest-comments/block.json +10 -0
- package/build/latest-posts/block.json +4 -0
- package/build/list/block.json +12 -1
- package/build/list-item/block.json +8 -1
- package/build/list-item/index.cjs +4 -0
- package/build/list-item/index.cjs.map +3 -3
- package/build/loginout/block.json +4 -0
- package/build/math/block.json +4 -0
- package/build/media-text/block.json +18 -0
- package/build/navigation-link/link-ui/index.cjs +33 -19
- package/build/navigation-link/link-ui/index.cjs.map +2 -2
- package/build/navigation-link/shared/index.cjs +5 -0
- package/build/navigation-link/shared/index.cjs.map +2 -2
- package/build/navigation-link/shared/use-block-suggestions.cjs +141 -0
- package/build/navigation-link/shared/use-block-suggestions.cjs.map +7 -0
- package/build/page-list/block.json +4 -0
- package/build/paragraph/block.json +1 -0
- package/build/post-author-biography/block.json +1 -0
- package/build/post-comments-form/block.json +5 -0
- package/build/post-content/block.json +2 -1
- package/build/post-excerpt/block.json +4 -0
- package/build/post-featured-image/block.json +1 -0
- package/build/post-featured-image/edit.cjs +1 -1
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-terms/block.json +4 -0
- package/build/post-time-to-read/block.json +4 -0
- package/build/post-title/block.json +4 -0
- package/build/preformatted/block.json +4 -0
- package/build/pullquote/block.json +2 -1
- package/build/query-no-results/block.json +4 -0
- package/build/query-pagination/block.json +17 -0
- package/build/query-total/block.json +4 -0
- package/build/quote/block.json +2 -0
- package/build/read-more/block.json +5 -0
- package/build/rss/block.json +4 -0
- package/build/search/block.json +2 -1
- package/build/site-tagline/block.json +4 -0
- package/build/site-title/block.json +4 -0
- package/build/social-links/block.json +1 -0
- package/build/tab-list/block.json +4 -0
- package/build/tab-list/edit.cjs +3 -1
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/save.cjs +3 -1
- package/build/tab-list/save.cjs.map +3 -3
- package/build/tab-panels/block.json +3 -0
- package/build/tabs/block.json +3 -0
- package/build/term-count/block.json +5 -0
- package/build/term-description/block.json +4 -0
- package/build/term-name/block.json +6 -1
- package/build/term-template/block.json +4 -0
- package/build/utils/waveform-utils.cjs +2 -2
- package/build/utils/waveform-utils.cjs.map +2 -2
- package/build/verse/block.json +4 -0
- package/build/video/block.json +7 -1
- package/build/video/edit.cjs +10 -2
- package/build/video/edit.cjs.map +2 -2
- package/build-module/accordion-heading/block.json +1 -0
- package/build-module/archives/block.json +3 -0
- package/build-module/audio/edit.mjs +2 -1
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/avatar/block.json +4 -0
- package/build-module/avatar/edit.mjs +33 -2
- package/build-module/avatar/edit.mjs.map +2 -2
- package/build-module/button/block.json +6 -0
- package/build-module/button/edit.mjs +11 -7
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/buttons/block.json +6 -1
- package/build-module/code/block.json +4 -0
- package/build-module/column/edit.mjs +5 -0
- package/build-module/column/edit.mjs.map +2 -2
- package/build-module/columns/block.json +4 -0
- package/build-module/columns/edit.mjs +22 -122
- package/build-module/columns/edit.mjs.map +2 -2
- package/build-module/comments/edit/placeholder.mjs +95 -87
- package/build-module/comments/edit/placeholder.mjs.map +2 -2
- package/build-module/comments-pagination/block.json +11 -0
- package/build-module/cover/block.json +2 -1
- package/build-module/cover/edit/index.mjs +32 -6
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +5 -2
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/cover/embed-video-utils.mjs +9 -8
- package/build-module/cover/embed-video-utils.mjs.map +2 -2
- package/build-module/cover/view.mjs +19 -0
- package/build-module/cover/view.mjs.map +7 -0
- package/build-module/details/block.json +3 -0
- package/build-module/embed/block.json +6 -1
- package/build-module/file/block.json +5 -0
- package/build-module/footnotes/block.json +4 -0
- package/build-module/gallery/block.json +13 -0
- package/build-module/gallery/dynamic-gallery.mjs +33 -97
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/gallery/edit.mjs +110 -42
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/order-controls.mjs +87 -0
- package/build-module/gallery/order-controls.mjs.map +7 -0
- package/build-module/gallery/order-images.mjs +66 -0
- package/build-module/gallery/order-images.mjs.map +7 -0
- package/build-module/gallery/order-options.mjs +33 -0
- package/build-module/gallery/order-options.mjs.map +7 -0
- package/build-module/gallery/use-dynamic-gallery.mjs +1 -7
- package/build-module/gallery/use-dynamic-gallery.mjs.map +2 -2
- package/build-module/gallery/use-get-media.mjs +2 -3
- package/build-module/gallery/use-get-media.mjs.map +2 -2
- package/build-module/group/edit.mjs +4 -4
- package/build-module/group/edit.mjs.map +2 -2
- package/build-module/heading/block.json +5 -0
- package/build-module/home-link/block.json +12 -0
- package/build-module/icon/components/custom-inserter/index.mjs +3 -1
- package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
- package/build-module/icon/edit.mjs +50 -6
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs +32 -28
- package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
- package/build-module/image/view.mjs +44 -50
- package/build-module/image/view.mjs.map +2 -2
- package/build-module/latest-comments/block.json +10 -0
- package/build-module/latest-posts/block.json +4 -0
- package/build-module/list/block.json +12 -1
- package/build-module/list-item/block.json +8 -1
- package/build-module/list-item/index.mjs +4 -0
- package/build-module/list-item/index.mjs.map +2 -2
- package/build-module/loginout/block.json +4 -0
- package/build-module/math/block.json +4 -0
- package/build-module/media-text/block.json +18 -0
- package/build-module/navigation-link/link-ui/index.mjs +39 -20
- package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
- package/build-module/navigation-link/shared/index.mjs +6 -0
- package/build-module/navigation-link/shared/index.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-block-suggestions.mjs +120 -0
- package/build-module/navigation-link/shared/use-block-suggestions.mjs.map +7 -0
- package/build-module/page-list/block.json +4 -0
- package/build-module/paragraph/block.json +1 -0
- package/build-module/post-author-biography/block.json +1 -0
- package/build-module/post-comments-form/block.json +5 -0
- package/build-module/post-content/block.json +2 -1
- package/build-module/post-excerpt/block.json +4 -0
- package/build-module/post-featured-image/block.json +1 -0
- package/build-module/post-featured-image/edit.mjs +1 -1
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-terms/block.json +4 -0
- package/build-module/post-time-to-read/block.json +4 -0
- package/build-module/post-title/block.json +4 -0
- package/build-module/preformatted/block.json +4 -0
- package/build-module/pullquote/block.json +2 -1
- package/build-module/query-no-results/block.json +4 -0
- package/build-module/query-pagination/block.json +17 -0
- package/build-module/query-total/block.json +4 -0
- package/build-module/quote/block.json +2 -0
- package/build-module/read-more/block.json +5 -0
- package/build-module/rss/block.json +4 -0
- package/build-module/search/block.json +2 -1
- package/build-module/site-tagline/block.json +4 -0
- package/build-module/site-title/block.json +4 -0
- package/build-module/social-links/block.json +1 -0
- package/build-module/tab-list/block.json +4 -0
- package/build-module/tab-list/edit.mjs +4 -1
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/save.mjs +4 -1
- package/build-module/tab-list/save.mjs.map +2 -2
- package/build-module/tab-panels/block.json +3 -0
- package/build-module/tabs/block.json +3 -0
- package/build-module/term-count/block.json +5 -0
- package/build-module/term-description/block.json +4 -0
- package/build-module/term-name/block.json +6 -1
- package/build-module/term-template/block.json +4 -0
- package/build-module/utils/waveform-utils.mjs +1 -1
- package/build-module/utils/waveform-utils.mjs.map +1 -1
- package/build-module/verse/block.json +4 -0
- package/build-module/video/block.json +7 -1
- package/build-module/video/edit.mjs +10 -2
- package/build-module/video/edit.mjs.map +2 -2
- package/build-style/avatar/editor-rtl.css +4 -0
- package/build-style/avatar/editor.css +4 -0
- package/build-style/comments-pagination/style-rtl.css +3 -0
- package/build-style/comments-pagination/style.css +3 -0
- package/build-style/common-rtl.css +32 -1
- package/build-style/common.css +35 -2
- package/build-style/editor-rtl.css +11 -4
- package/build-style/editor.css +11 -4
- package/build-style/embed/style-rtl.css +4 -1
- package/build-style/embed/style.css +4 -1
- package/build-style/gallery/editor-rtl.css +1 -3
- package/build-style/gallery/editor.css +1 -3
- package/build-style/image/style-rtl.css +11 -2
- package/build-style/image/style.css +11 -2
- package/build-style/media-text/style-rtl.css +4 -1
- package/build-style/media-text/style.css +4 -1
- package/build-style/query-pagination/style-rtl.css +3 -0
- package/build-style/query-pagination/style.css +3 -0
- package/build-style/style-rtl.css +70 -9
- package/build-style/style.css +73 -10
- package/build-style/table/editor-rtl.css +6 -1
- package/build-style/table/editor.css +6 -1
- package/build-style/table/style-rtl.css +4 -2
- package/build-style/table/style.css +4 -2
- package/build-style/tag-cloud/style-rtl.css +1 -1
- package/build-style/tag-cloud/style.css +1 -1
- package/build-style/verse/style-rtl.css +8 -1
- package/build-style/verse/style.css +8 -1
- package/build-types/gallery/order-controls.d.ts +58 -0
- package/build-types/gallery/order-controls.d.ts.map +1 -0
- package/build-types/gallery/order-options.d.ts +67 -0
- package/build-types/gallery/order-options.d.ts.map +1 -0
- package/package.json +44 -41
- package/src/accordion-heading/README.md +1 -0
- package/src/accordion-heading/block.json +1 -0
- package/src/archives/README.md +2 -0
- package/src/archives/block.json +3 -0
- package/src/audio/edit.jsx +2 -1
- package/src/avatar/README.md +2 -0
- package/src/avatar/block.json +4 -0
- package/src/avatar/edit.jsx +48 -2
- package/src/avatar/editor.scss +4 -0
- package/src/avatar/index.php +5 -3
- package/src/breadcrumbs/index.php +1 -1
- package/src/button/README.md +4 -0
- package/src/button/block.json +6 -0
- package/src/button/edit.jsx +47 -52
- package/src/button/index.php +47 -0
- package/src/buttons/README.md +4 -0
- package/src/buttons/block.json +6 -1
- package/src/code/README.md +3 -0
- package/src/code/block.json +4 -0
- package/src/column/edit.jsx +6 -0
- package/src/columns/README.md +3 -0
- package/src/columns/block.json +4 -0
- package/src/columns/edit.jsx +1 -131
- package/src/comments/edit/placeholder.jsx +5 -1
- package/src/comments-pagination/README.md +4 -0
- package/src/comments-pagination/block.json +11 -0
- package/src/comments-pagination/style.scss +3 -0
- package/src/common.scss +38 -0
- package/src/cover/README.md +1 -0
- package/src/cover/block.json +2 -1
- package/src/cover/edit/index.jsx +38 -6
- package/src/cover/edit/inspector-controls.jsx +10 -1
- package/src/cover/embed-video-utils.js +18 -10
- package/src/cover/index.php +44 -15
- package/src/cover/test/edit.browser.test.js +182 -2
- package/src/cover/test/embed-video-utils.test.js +48 -0
- package/src/cover/view.js +22 -0
- package/src/details/README.md +2 -0
- package/src/details/block.json +3 -0
- package/src/embed/README.md +4 -0
- package/src/embed/block.json +6 -1
- package/src/embed/style.scss +7 -1
- package/src/file/README.md +4 -0
- package/src/file/block.json +5 -0
- package/src/footnotes/README.md +3 -0
- package/src/footnotes/block.json +4 -0
- package/src/gallery/README.md +13 -0
- package/src/gallery/block.json +13 -0
- package/src/gallery/dynamic-gallery.jsx +11 -91
- package/src/gallery/edit.jsx +146 -47
- package/src/gallery/editor.scss +5 -9
- package/src/gallery/order-controls.tsx +143 -0
- package/src/gallery/order-images.js +111 -0
- package/src/gallery/order-options.ts +75 -0
- package/src/gallery/test/edit.jsdom.test.js +87 -10
- package/src/gallery/test/order-images.js +162 -0
- package/src/gallery/use-dynamic-gallery.js +1 -9
- package/src/gallery/use-get-media.js +7 -2
- package/src/group/edit.jsx +5 -5
- package/src/heading/README.md +4 -0
- package/src/heading/block.json +5 -0
- package/src/home-link/README.md +6 -0
- package/src/home-link/block.json +12 -0
- package/src/icon/components/custom-inserter/index.jsx +5 -1
- package/src/icon/edit.jsx +68 -7
- package/src/icon/index.php +1 -1
- package/src/image/index.php +3 -4
- package/src/image/style.scss +14 -2
- package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +122 -60
- package/src/image/use-open-image-media-editor-modal.js +37 -41
- package/src/image/view.js +64 -68
- package/src/latest-comments/README.md +3 -0
- package/src/latest-comments/block.json +10 -0
- package/src/latest-posts/README.md +3 -0
- package/src/latest-posts/block.json +4 -0
- package/src/list/README.md +6 -0
- package/src/list/block.json +12 -1
- package/src/list-item/README.md +6 -0
- package/src/list-item/block.json +8 -1
- package/src/list-item/index.js +5 -0
- package/src/loginout/README.md +3 -0
- package/src/loginout/block.json +4 -0
- package/src/math/README.md +3 -0
- package/src/math/block.json +4 -0
- package/src/media-text/README.md +17 -0
- package/src/media-text/block.json +18 -0
- package/src/media-text/style.scss +5 -1
- package/src/navigation/test/use-navigation-menu.jsdom.test.js +1 -1
- package/src/navigation-link/README.md +1 -1
- package/src/navigation-link/link-ui/index.jsx +60 -27
- package/src/navigation-link/link-ui/test/get-suggestions-query.jsdom.test.js +67 -0
- package/src/navigation-link/shared/index.js +4 -0
- package/src/navigation-link/shared/test/use-block-suggestions.jsdom.test.js +158 -0
- package/src/navigation-link/shared/test/use-entity-binding.jsdom.test.js +1 -7
- package/src/navigation-link/shared/use-block-suggestions.js +192 -0
- package/src/page-list/README.md +3 -0
- package/src/page-list/block.json +4 -0
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/playlist/test/edit-component.jsdom.test.jsx +11 -11
- package/src/playlist-track/test/edit.jsdom.test.jsx +3 -3
- package/src/post-author-biography/README.md +1 -0
- package/src/post-author-biography/block.json +1 -0
- package/src/post-comments-form/README.md +3 -0
- package/src/post-comments-form/block.json +5 -0
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +2 -1
- package/src/post-excerpt/README.md +3 -0
- package/src/post-excerpt/block.json +4 -0
- package/src/post-featured-image/block.json +1 -0
- package/src/post-featured-image/edit.jsx +2 -2
- package/src/post-terms/README.md +3 -0
- package/src/post-terms/block.json +4 -0
- package/src/post-time-to-read/README.md +3 -0
- package/src/post-time-to-read/block.json +4 -0
- package/src/post-title/README.md +3 -0
- package/src/post-title/block.json +4 -0
- package/src/preformatted/README.md +3 -0
- package/src/preformatted/block.json +4 -0
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +2 -1
- package/src/query-no-results/README.md +3 -0
- package/src/query-no-results/block.json +4 -0
- package/src/query-pagination/README.md +4 -0
- package/src/query-pagination/block.json +17 -0
- package/src/query-pagination/style.scss +3 -0
- package/src/query-total/README.md +3 -0
- package/src/query-total/block.json +4 -0
- package/src/quote/README.md +2 -0
- package/src/quote/block.json +2 -0
- package/src/read-more/README.md +3 -0
- package/src/read-more/block.json +5 -0
- package/src/rss/README.md +3 -0
- package/src/rss/block.json +4 -0
- package/src/search/README.md +1 -0
- package/src/search/block.json +2 -1
- package/src/site-tagline/README.md +3 -0
- package/src/site-tagline/block.json +4 -0
- package/src/site-title/README.md +3 -0
- package/src/site-title/block.json +4 -0
- package/src/social-links/README.md +1 -0
- package/src/social-links/block.json +1 -0
- package/src/tab-list/README.md +2 -0
- package/src/tab-list/block.json +4 -0
- package/src/tab-list/edit.jsx +3 -0
- package/src/tab-list/save.jsx +3 -0
- package/src/tab-panels/README.md +2 -0
- package/src/tab-panels/block.json +3 -0
- package/src/table/editor.scss +8 -2
- package/src/table/style.scss +4 -4
- package/src/tabs/README.md +2 -0
- package/src/tabs/block.json +3 -0
- package/src/tag-cloud/style.scss +1 -1
- package/src/template-part/index.php +16 -3
- package/src/term-count/README.md +4 -0
- package/src/term-count/block.json +5 -0
- package/src/term-description/README.md +3 -0
- package/src/term-description/block.json +4 -0
- package/src/term-name/README.md +4 -0
- package/src/term-name/block.json +6 -1
- package/src/term-template/README.md +3 -0
- package/src/term-template/block.json +4 -0
- package/src/utils/test/waveform-player-auto-init.jsdom.test.js +25 -0
- package/src/utils/test/waveform-player-dependency.jsdom.test.js +7 -60
- package/src/utils/test/waveform-utils.browser.test.js +3 -15
- package/src/utils/waveform-utils.js +1 -1
- package/src/verse/README.md +4 -0
- package/src/verse/block.json +4 -0
- package/src/verse/style.scss +11 -2
- package/src/video/README.md +4 -0
- package/src/video/block.json +7 -1
- package/src/video/edit.jsx +13 -2
- package/build/columns/utils.cjs +0 -112
- package/build/columns/utils.cjs.map +0 -7
- package/build-module/columns/utils.mjs +0 -78
- package/build-module/columns/utils.mjs.map +0 -7
- package/src/columns/test/utils.js +0 -331
- package/src/columns/utils.js +0 -176
package/src/audio/edit.jsx
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
__experimentalToolsPanel as ToolsPanel,
|
|
8
8
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
9
9
|
} from '@wordpress/components';
|
|
10
|
+
import { inertValue } from '@wordpress/react-inert-value';
|
|
10
11
|
import { Text } from '@wordpress/ui';
|
|
11
12
|
import {
|
|
12
13
|
BlockControls,
|
|
@@ -251,7 +252,7 @@ function AudioEdit( {
|
|
|
251
252
|
<figure { ...blockProps }>
|
|
252
253
|
<audio
|
|
253
254
|
controls="controls"
|
|
254
|
-
inert={ ! isSingleSelected
|
|
255
|
+
inert={ inertValue( ! isSingleSelected ) }
|
|
255
256
|
src={ src ?? temporaryURL }
|
|
256
257
|
/>
|
|
257
258
|
{ !! temporaryURL && <Spinner /> }
|
package/src/avatar/README.md
CHANGED
|
@@ -35,6 +35,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
35
35
|
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-background): `false`
|
|
36
36
|
- [`filter`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#filter):
|
|
37
37
|
- [`duotone`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#filter-duotone): `true`
|
|
38
|
+
- [`shadow`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#shadow): `true`
|
|
38
39
|
- [`interactivity`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#interactivity):
|
|
39
40
|
- `clientNavigation`: `true`
|
|
40
41
|
|
|
@@ -53,6 +54,7 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
|
|
|
53
54
|
_Defined via the [`selectors`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) property in block.json._
|
|
54
55
|
|
|
55
56
|
- **border**: `.wp-block-avatar img`
|
|
57
|
+
- **shadow**: `.wp-block-avatar img`
|
|
56
58
|
- **filter**:
|
|
57
59
|
- duotone: `.wp-block-avatar img`
|
|
58
60
|
|
package/src/avatar/block.json
CHANGED
|
@@ -54,12 +54,16 @@
|
|
|
54
54
|
"filter": {
|
|
55
55
|
"duotone": true
|
|
56
56
|
},
|
|
57
|
+
"shadow": {
|
|
58
|
+
"__experimentalSkipSerialization": true
|
|
59
|
+
},
|
|
57
60
|
"interactivity": {
|
|
58
61
|
"clientNavigation": true
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
64
|
"selectors": {
|
|
62
65
|
"border": ".wp-block-avatar img",
|
|
66
|
+
"shadow": ".wp-block-avatar img",
|
|
63
67
|
"filter": {
|
|
64
68
|
"duotone": ".wp-block-avatar img"
|
|
65
69
|
}
|
package/src/avatar/edit.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
InspectorControls,
|
|
4
4
|
useBlockProps,
|
|
5
5
|
__experimentalUseBorderProps as useBorderProps,
|
|
6
|
+
__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,
|
|
6
7
|
} from '@wordpress/block-editor';
|
|
7
8
|
import {
|
|
8
9
|
RangeControl,
|
|
@@ -11,12 +12,47 @@ import {
|
|
|
11
12
|
__experimentalToolsPanel as ToolsPanel,
|
|
12
13
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
13
14
|
} from '@wordpress/components';
|
|
15
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
16
|
+
import { useSelect } from '@wordpress/data';
|
|
17
|
+
import { createInterpolateElement } from '@wordpress/element';
|
|
14
18
|
import { __, isRTL } from '@wordpress/i18n';
|
|
19
|
+
import { Link, Text } from '@wordpress/ui';
|
|
15
20
|
import { addQueryArgs, removeQueryArgs } from '@wordpress/url';
|
|
16
21
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
17
22
|
import { useCommentAvatar, useUserAvatar } from './hooks';
|
|
18
23
|
import UserControl from './user-control';
|
|
19
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Returns the help text explaining where avatars come from, with a link to the
|
|
27
|
+
* Discussion settings where the default avatar is chosen. Only users who can
|
|
28
|
+
* manage the site's settings get it, since nobody else can act on it.
|
|
29
|
+
*
|
|
30
|
+
* @return {React.ReactNode|null} Help text, or `null` when the user can't manage settings.
|
|
31
|
+
*/
|
|
32
|
+
function useAvatarHelpText() {
|
|
33
|
+
const canManageSettings = useSelect(
|
|
34
|
+
( select ) =>
|
|
35
|
+
select( coreStore ).canUser( 'update', {
|
|
36
|
+
kind: 'root',
|
|
37
|
+
name: 'site',
|
|
38
|
+
} ),
|
|
39
|
+
[]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
if ( ! canManageSettings ) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return createInterpolateElement(
|
|
47
|
+
__(
|
|
48
|
+
'Avatars use the Gravatar service. Go to <a>Discussion settings</a> to change the default avatar.'
|
|
49
|
+
),
|
|
50
|
+
{
|
|
51
|
+
a: <Link href="options-discussion.php" openInNewTab />,
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
20
56
|
/**
|
|
21
57
|
* Renders the inspector controls for the `core/avatar` block.
|
|
22
58
|
*
|
|
@@ -35,6 +71,7 @@ const AvatarInspectorControls = ( {
|
|
|
35
71
|
selectUser,
|
|
36
72
|
} ) => {
|
|
37
73
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
74
|
+
const helpText = useAvatarHelpText();
|
|
38
75
|
return (
|
|
39
76
|
<InspectorControls>
|
|
40
77
|
<ToolsPanel
|
|
@@ -49,6 +86,11 @@ const AvatarInspectorControls = ( {
|
|
|
49
86
|
} }
|
|
50
87
|
dropdownMenuProps={ dropdownMenuProps }
|
|
51
88
|
>
|
|
89
|
+
{ helpText && (
|
|
90
|
+
<Text className="wp-block-avatar__help-text">
|
|
91
|
+
{ helpText }
|
|
92
|
+
</Text>
|
|
93
|
+
) }
|
|
52
94
|
<ToolsPanelItem
|
|
53
95
|
label={ __( 'Image size' ) }
|
|
54
96
|
isShownByDefault
|
|
@@ -156,7 +198,7 @@ const AvatarLinkWrapper = ( { children, isLink } ) =>
|
|
|
156
198
|
*
|
|
157
199
|
* @param {Object} props React props.
|
|
158
200
|
* @param {Function} props.setAttributes Callback for updating block attributes.
|
|
159
|
-
* @param {Object} props.attributes Block attributes: `size` and `isLink`, plus the border support values
|
|
201
|
+
* @param {Object} props.attributes Block attributes: `size` and `isLink`, plus the border and shadow support values applied to the image.
|
|
160
202
|
* @param {Object} props.avatar Avatar data returned by `useCommentAvatar` or `useUserAvatar`, with the image `src` and `alt` and the `minSize` and `maxSize` resize bounds.
|
|
161
203
|
* @param {Object} props.blockProps Props returned by `useBlockProps`, applied to the wrapper element.
|
|
162
204
|
* @param {boolean} props.isSelected Whether the block is selected. Resize handles are only shown when it is.
|
|
@@ -171,6 +213,7 @@ const ResizableAvatar = ( {
|
|
|
171
213
|
isSelected,
|
|
172
214
|
} ) => {
|
|
173
215
|
const borderProps = useBorderProps( attributes );
|
|
216
|
+
const shadowProps = getShadowClassesAndStyles( attributes );
|
|
174
217
|
const doubledSizedSrc = addQueryArgs(
|
|
175
218
|
removeQueryArgs( avatar?.src, [ 's' ] ),
|
|
176
219
|
{
|
|
@@ -215,7 +258,10 @@ const ResizableAvatar = ( {
|
|
|
215
258
|
'wp-block-avatar__image',
|
|
216
259
|
borderProps.className
|
|
217
260
|
) }
|
|
218
|
-
style={
|
|
261
|
+
style={ {
|
|
262
|
+
...borderProps.style,
|
|
263
|
+
...shadowProps.style,
|
|
264
|
+
} }
|
|
219
265
|
/>
|
|
220
266
|
</ResizableBox>
|
|
221
267
|
</AvatarLinkWrapper>
|
package/src/avatar/editor.scss
CHANGED
package/src/avatar/index.php
CHANGED
|
@@ -19,6 +19,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
19
19
|
$size = $attributes['size'] ?? 96;
|
|
20
20
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
21
21
|
$border_attributes = get_block_core_avatar_border_attributes( $attributes );
|
|
22
|
+
$shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ?? null ) );
|
|
22
23
|
|
|
23
24
|
// Class gets passed through `esc_attr` via `get_avatar`.
|
|
24
25
|
$image_classes = ! empty( $border_attributes['class'] )
|
|
@@ -26,10 +27,11 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
26
27
|
: 'wp-block-avatar__image';
|
|
27
28
|
|
|
28
29
|
// Unlike class, `get_avatar` doesn't filter the styles via `esc_attr`.
|
|
29
|
-
// The style engine does pass the border styles through
|
|
30
|
+
// The style engine does pass the border and shadow styles through
|
|
30
31
|
// `safecss_filter_attr` however.
|
|
31
|
-
$
|
|
32
|
-
|
|
32
|
+
$image_css = ( $border_attributes['style'] ?? '' ) . ( $shadow_styles['css'] ?? '' );
|
|
33
|
+
$image_styles = ! empty( $image_css )
|
|
34
|
+
? sprintf( ' style="%s"', esc_attr( $image_css ) )
|
|
33
35
|
: '';
|
|
34
36
|
|
|
35
37
|
if ( ! isset( $block->context['commentId'] ) ) {
|
|
@@ -188,7 +188,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
|
|
|
188
188
|
$wrapper_attributes = get_block_wrapper_attributes(
|
|
189
189
|
array(
|
|
190
190
|
'style' => '--separator: "' . $separator . '";',
|
|
191
|
-
'aria-label' => _x( 'Breadcrumbs', '
|
|
191
|
+
'aria-label' => _x( 'Breadcrumbs', 'aria label' ),
|
|
192
192
|
)
|
|
193
193
|
);
|
|
194
194
|
|
package/src/button/README.md
CHANGED
|
@@ -40,6 +40,10 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
40
40
|
- [`splitting`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#splitting): `true`
|
|
41
41
|
- [`align`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#align): `false`
|
|
42
42
|
- [`alignWide`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#alignwide): `false`
|
|
43
|
+
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#background):
|
|
44
|
+
- `backgroundImage`: `true`
|
|
45
|
+
- `backgroundSize`: `true`
|
|
46
|
+
- `gradient`: `true`
|
|
43
47
|
- [`color`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color):
|
|
44
48
|
- [`gradients`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-gradients): `true`
|
|
45
49
|
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
|
package/src/button/block.json
CHANGED
|
@@ -70,6 +70,12 @@
|
|
|
70
70
|
"splitting": true,
|
|
71
71
|
"align": false,
|
|
72
72
|
"alignWide": false,
|
|
73
|
+
"background": {
|
|
74
|
+
"backgroundImage": true,
|
|
75
|
+
"backgroundSize": true,
|
|
76
|
+
"gradient": true,
|
|
77
|
+
"__experimentalSkipSerialization": true
|
|
78
|
+
},
|
|
73
79
|
"color": {
|
|
74
80
|
"__experimentalSkipSerialization": true,
|
|
75
81
|
"gradients": true,
|
package/src/button/edit.jsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
LinkControl,
|
|
17
17
|
__experimentalUseBorderProps as useBorderProps,
|
|
18
18
|
__experimentalUseColorProps as useColorProps,
|
|
19
|
+
useBackgroundProps,
|
|
19
20
|
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
|
|
20
21
|
__experimentalGetShadowClassesAndStyles as useShadowProps,
|
|
21
22
|
__experimentalGetDimensionsClassesAndStyles as useDimensionsProps,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
privateApis as blockEditorPrivateApis,
|
|
28
29
|
} from '@wordpress/block-editor';
|
|
29
30
|
import { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';
|
|
30
|
-
import { link
|
|
31
|
+
import { link } from '@wordpress/icons';
|
|
31
32
|
import {
|
|
32
33
|
createBlock,
|
|
33
34
|
cloneBlock,
|
|
@@ -166,6 +167,7 @@ function ButtonEdit( props ) {
|
|
|
166
167
|
const colorProps = useColorProps( attributes );
|
|
167
168
|
const spacingProps = useSpacingProps( attributes );
|
|
168
169
|
const shadowProps = useShadowProps( attributes );
|
|
170
|
+
const backgroundProps = useBackgroundProps( attributes );
|
|
169
171
|
const dimensionsProps = useDimensionsProps( attributes );
|
|
170
172
|
const ref = useRef();
|
|
171
173
|
const richTextRef = useRef();
|
|
@@ -348,6 +350,7 @@ function ButtonEdit( props ) {
|
|
|
348
350
|
className,
|
|
349
351
|
'wp-block-button__link',
|
|
350
352
|
colorProps.className,
|
|
353
|
+
backgroundProps.className,
|
|
351
354
|
borderProps.className,
|
|
352
355
|
typographyProps.className,
|
|
353
356
|
{
|
|
@@ -362,6 +365,7 @@ function ButtonEdit( props ) {
|
|
|
362
365
|
style={ {
|
|
363
366
|
...borderProps.style,
|
|
364
367
|
...colorProps.style,
|
|
368
|
+
...backgroundProps.style,
|
|
365
369
|
...spacingProps.style,
|
|
366
370
|
...shadowProps.style,
|
|
367
371
|
...typographyProps.style,
|
|
@@ -377,64 +381,55 @@ function ButtonEdit( props ) {
|
|
|
377
381
|
{ isLinkTag && ! lockUrlControls && (
|
|
378
382
|
<ToolbarButton
|
|
379
383
|
name="link"
|
|
380
|
-
icon={
|
|
381
|
-
title={
|
|
382
|
-
shortcut={
|
|
383
|
-
|
|
384
|
-
? displayShortcut.primary( 'k' )
|
|
385
|
-
: displayShortcut.primaryShift( 'k' )
|
|
386
|
-
}
|
|
387
|
-
onClick={ ! isURLSet ? startEditing : unlink }
|
|
384
|
+
icon={ link }
|
|
385
|
+
title={ __( 'Link' ) }
|
|
386
|
+
shortcut={ displayShortcut.primary( 'k' ) }
|
|
387
|
+
onClick={ () => setIsEditingURL( ! isEditingURL ) }
|
|
388
388
|
isActive={ isURLSet }
|
|
389
389
|
/>
|
|
390
390
|
) }
|
|
391
391
|
</BlockControls>
|
|
392
392
|
) }
|
|
393
|
-
{ isLinkTag &&
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
393
|
+
{ isLinkTag && isSelected && isEditingURL && ! lockUrlControls && (
|
|
394
|
+
<Popover
|
|
395
|
+
placement="bottom"
|
|
396
|
+
onClose={ () => {
|
|
397
|
+
setIsEditingURL( false );
|
|
398
|
+
richTextRef.current?.focus();
|
|
399
|
+
} }
|
|
400
|
+
anchor={ popoverAnchor }
|
|
401
|
+
focusOnMount={ isEditingURL ? 'firstElement' : false }
|
|
402
|
+
__unstableSlotName="__unstable-block-tools-after"
|
|
403
|
+
shift
|
|
404
|
+
>
|
|
405
|
+
<LinkControl
|
|
406
|
+
value={ linkValue }
|
|
407
|
+
onChange={ ( {
|
|
408
|
+
url: newURL,
|
|
409
|
+
opensInNewTab: newOpensInNewTab,
|
|
410
|
+
nofollow: newNofollow,
|
|
411
|
+
} ) =>
|
|
412
|
+
setAttributes(
|
|
413
|
+
getUpdatedLinkAttributes( {
|
|
414
|
+
rel,
|
|
415
|
+
url: newURL,
|
|
416
|
+
opensInNewTab: newOpensInNewTab,
|
|
417
|
+
nofollow: newNofollow,
|
|
418
|
+
} )
|
|
419
|
+
)
|
|
420
|
+
}
|
|
421
|
+
onRemove={ () => {
|
|
422
|
+
unlink();
|
|
401
423
|
richTextRef.current?.focus();
|
|
402
424
|
} }
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
url: newURL,
|
|
412
|
-
opensInNewTab: newOpensInNewTab,
|
|
413
|
-
nofollow: newNofollow,
|
|
414
|
-
} ) =>
|
|
415
|
-
setAttributes(
|
|
416
|
-
getUpdatedLinkAttributes( {
|
|
417
|
-
rel,
|
|
418
|
-
url: newURL,
|
|
419
|
-
opensInNewTab: newOpensInNewTab,
|
|
420
|
-
nofollow: newNofollow,
|
|
421
|
-
} )
|
|
422
|
-
)
|
|
423
|
-
}
|
|
424
|
-
onRemove={ () => {
|
|
425
|
-
unlink();
|
|
426
|
-
richTextRef.current?.focus();
|
|
427
|
-
} }
|
|
428
|
-
forceIsEditingLink={ isEditingURL }
|
|
429
|
-
settings={ LINK_SETTINGS }
|
|
430
|
-
createSuggestion={
|
|
431
|
-
createPageEntity && handleCreate
|
|
432
|
-
}
|
|
433
|
-
withCreateSuggestion={ userCanCreatePages }
|
|
434
|
-
createSuggestionButtonText={ createButtonText }
|
|
435
|
-
/>
|
|
436
|
-
</Popover>
|
|
437
|
-
) }
|
|
425
|
+
forceIsEditingLink={ ! isURLSet }
|
|
426
|
+
settings={ LINK_SETTINGS }
|
|
427
|
+
createSuggestion={ createPageEntity && handleCreate }
|
|
428
|
+
withCreateSuggestion={ userCanCreatePages }
|
|
429
|
+
createSuggestionButtonText={ createButtonText }
|
|
430
|
+
/>
|
|
431
|
+
</Popover>
|
|
432
|
+
) }
|
|
438
433
|
<InspectorControls group="advanced">
|
|
439
434
|
<HTMLElementControl
|
|
440
435
|
tagName={ tagName }
|
package/src/button/index.php
CHANGED
|
@@ -60,6 +60,53 @@ function render_block_core_button( $attributes, $content ) {
|
|
|
60
60
|
return '';
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// Background skips serialization, so apply it to the link like color.
|
|
64
|
+
$background = $attributes['style']['background'] ?? null;
|
|
65
|
+
|
|
66
|
+
if ( is_array( $background ) ) {
|
|
67
|
+
$background_styles = array(
|
|
68
|
+
'backgroundImage' => $background['backgroundImage'] ?? null,
|
|
69
|
+
'backgroundSize' => $background['backgroundSize'] ?? null,
|
|
70
|
+
'backgroundPosition' => $background['backgroundPosition'] ?? null,
|
|
71
|
+
'backgroundRepeat' => $background['backgroundRepeat'] ?? null,
|
|
72
|
+
'backgroundAttachment' => $background['backgroundAttachment'] ?? null,
|
|
73
|
+
'gradient' => $background['gradient'] ?? null,
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
// Mirror the background block support defaults.
|
|
77
|
+
if ( ! empty( $background_styles['backgroundImage'] ) ) {
|
|
78
|
+
$background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover';
|
|
79
|
+
if ( 'contain' === $background_styles['backgroundSize'] && ! $background_styles['backgroundPosition'] ) {
|
|
80
|
+
$background_styles['backgroundPosition'] = '50% 50%';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
$styles = wp_style_engine_get_styles( array( 'background' => $background_styles ) );
|
|
85
|
+
|
|
86
|
+
if ( ! empty( $styles['css'] ) ) {
|
|
87
|
+
$processor = new WP_HTML_Tag_Processor( $content );
|
|
88
|
+
while ( $processor->next_tag() ) {
|
|
89
|
+
if ( $tag !== $processor->get_tag() ) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
$existing_style = $processor->get_attribute( 'style' );
|
|
94
|
+
if ( is_string( $existing_style ) && '' !== $existing_style ) {
|
|
95
|
+
$separator = str_ends_with( $existing_style, ';' ) ? '' : ';';
|
|
96
|
+
$processor->set_attribute( 'style', $existing_style . $separator . $styles['css'] );
|
|
97
|
+
} else {
|
|
98
|
+
$processor->set_attribute( 'style', $styles['css'] );
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if ( ! empty( $background_styles['backgroundImage'] ) || ! empty( $background_styles['gradient'] ) ) {
|
|
102
|
+
$processor->add_class( 'has-background' );
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
$content = $processor->get_updated_html();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
63
110
|
$width = $attributes['style']['dimensions']['width'] ?? null;
|
|
64
111
|
|
|
65
112
|
if ( is_string( $width ) && '' !== $width ) {
|
package/src/buttons/README.md
CHANGED
|
@@ -41,6 +41,9 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
41
41
|
- [`typography`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography):
|
|
42
42
|
- [`fontSize`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-fontsize): `true`
|
|
43
43
|
- [`lineHeight`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-lineheight): `true`
|
|
44
|
+
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
|
|
45
|
+
- `minHeight`: `true`
|
|
46
|
+
- `minWidth`: `true`
|
|
44
47
|
- [`layout`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout):
|
|
45
48
|
- [`allowSwitching`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowswitching): `false`
|
|
46
49
|
- [`allowInheriting`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowinheriting): `false`
|
|
@@ -49,6 +52,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
49
52
|
- `clientNavigation`: `true`
|
|
50
53
|
- [`listView`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#listview): `true`
|
|
51
54
|
- [`contentRole`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#contentrole): `true`
|
|
55
|
+
- [`shadow`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#shadow): `true`
|
|
52
56
|
|
|
53
57
|
## Block Markup
|
|
54
58
|
|
package/src/buttons/block.json
CHANGED
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
"fontSize": true
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
+
"dimensions": {
|
|
54
|
+
"minHeight": true,
|
|
55
|
+
"minWidth": true
|
|
56
|
+
},
|
|
53
57
|
"__experimentalBorder": {
|
|
54
58
|
"color": true,
|
|
55
59
|
"radius": true,
|
|
@@ -73,7 +77,8 @@
|
|
|
73
77
|
"clientNavigation": true
|
|
74
78
|
},
|
|
75
79
|
"listView": true,
|
|
76
|
-
"contentRole": true
|
|
80
|
+
"contentRole": true,
|
|
81
|
+
"shadow": true
|
|
77
82
|
},
|
|
78
83
|
"editorStyle": "wp-block-buttons-editor",
|
|
79
84
|
"style": "wp-block-buttons"
|
package/src/code/README.md
CHANGED
|
@@ -26,6 +26,9 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
26
26
|
- `backgroundImage`: `true`
|
|
27
27
|
- `backgroundSize`: `true`
|
|
28
28
|
- `gradient`: `true`
|
|
29
|
+
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
|
|
30
|
+
- `minHeight`: `true`
|
|
31
|
+
- `minWidth`: `true`
|
|
29
32
|
- [`typography`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography):
|
|
30
33
|
- [`fontSize`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-fontsize): `true`
|
|
31
34
|
- [`lineHeight`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-lineheight): `true`
|
package/src/code/block.json
CHANGED
package/src/column/edit.jsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
18
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
19
|
+
import { useState } from '@wordpress/element';
|
|
19
20
|
import { sprintf, __ } from '@wordpress/i18n';
|
|
20
21
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
21
22
|
|
|
@@ -105,7 +106,10 @@ function ColumnEdit( {
|
|
|
105
106
|
};
|
|
106
107
|
|
|
107
108
|
const widthWithUnit = Number.isFinite( width ) ? width + '%' : width;
|
|
109
|
+
// State, not a ref, so that the element is there on the next render.
|
|
110
|
+
const [ dropZoneElement, setDropZoneElement ] = useState( null );
|
|
108
111
|
const blockProps = useBlockProps( {
|
|
112
|
+
ref: setDropZoneElement,
|
|
109
113
|
className: classes,
|
|
110
114
|
style: widthWithUnit ? { flexBasis: widthWithUnit } : undefined,
|
|
111
115
|
} );
|
|
@@ -124,6 +128,8 @@ function ColumnEdit( {
|
|
|
124
128
|
const innerBlocksProps = useInnerBlocksProps(
|
|
125
129
|
{ ...blockProps, 'aria-label': label },
|
|
126
130
|
{
|
|
131
|
+
// Allows dropping before or after the column, not only inside it.
|
|
132
|
+
dropZoneElement,
|
|
127
133
|
templateLock,
|
|
128
134
|
allowedBlocks,
|
|
129
135
|
renderAppender: hasChildBlocks
|
package/src/columns/README.md
CHANGED
|
@@ -39,6 +39,9 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
39
39
|
- `backgroundImage`: `true`
|
|
40
40
|
- `backgroundSize`: `true`
|
|
41
41
|
- `gradient`: `true`
|
|
42
|
+
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
|
|
43
|
+
- `minHeight`: `true`
|
|
44
|
+
- `minWidth`: `true`
|
|
42
45
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
43
46
|
- `blockGap`: `{"__experimentalDefault":"2em","sides":["horizontal","vertical"]}`
|
|
44
47
|
- `margin`: `["top","bottom"]`
|