@wordpress/block-library 11.0.2-next.v.202609171837.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 +44 -1
- package/build/accordion/block.json +4 -1
- package/build/accordion-heading/block.json +1 -0
- package/build/accordion-item/block.json +7 -1
- package/build/accordion-panel/block.json +9 -1
- package/build/archives/block.json +12 -0
- package/build/audio/block.json +8 -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/breadcrumbs/block.json +3 -0
- package/build/breadcrumbs/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 +15 -1
- package/build/categories/block.json +12 -1
- package/build/code/block.json +13 -0
- package/build/column/block.json +9 -0
- package/build/column/edit.cjs +5 -0
- package/build/column/edit.cjs.map +2 -2
- package/build/columns/block.json +13 -0
- package/build/columns/edit.cjs +21 -112
- package/build/columns/edit.cjs.map +3 -3
- package/build/comment-author-name/block.json +3 -0
- package/build/comment-content/block.json +5 -0
- package/build/comment-date/block.json +3 -0
- package/build/comment-edit-link/block.json +3 -0
- package/build/comment-reply-link/block.json +3 -0
- package/build/comments/block.json +10 -0
- package/build/comments/edit/placeholder.cjs +95 -87
- package/build/comments/edit/placeholder.cjs.map +2 -2
- package/build/comments-pagination/block.json +14 -0
- package/build/comments-pagination-next/block.json +3 -0
- package/build/comments-pagination-numbers/block.json +3 -0
- package/build/comments-pagination-previous/block.json +6 -0
- package/build/comments-title/block.json +3 -0
- package/build/cover/block.json +2 -1
- package/build/cover/edit/index.cjs +30 -6
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +56 -14
- 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 +14 -0
- package/build/embed/block.json +6 -1
- package/build/file/block.json +14 -0
- package/build/footnotes/block.json +13 -0
- package/build/gallery/block.json +22 -0
- package/build/gallery/dynamic-gallery.cjs +32 -93
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +104 -42
- 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/block.json +1 -0
- package/build/group/edit.cjs +3 -3
- package/build/group/edit.cjs.map +2 -2
- package/build/heading/block.json +14 -0
- package/build/home-link/block.json +30 -0
- package/build/home-link/edit.cjs.map +3 -3
- 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/image.cjs +10 -8
- package/build/image/image.cjs.map +3 -3
- package/build/image/use-open-image-media-editor-modal.cjs +32 -8
- 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 +20 -0
- package/build/latest-posts/block.json +14 -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 +14 -0
- package/build/math/block.json +14 -0
- package/build/media-text/block.json +19 -0
- package/build/navigation/edit/index.cjs +1 -4
- package/build/navigation/edit/index.cjs.map +2 -2
- 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/link-ui/page-creator.cjs.map +3 -3
- package/build/navigation-link/shared/controls.cjs.map +3 -3
- 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/navigation-link/shared/use-link-preview.cjs +13 -13
- package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
- package/build/navigation-overlay-close/block.json +7 -0
- package/build/navigation-submenu/block.json +6 -0
- package/build/navigation-submenu/edit.cjs +9 -1
- package/build/navigation-submenu/edit.cjs.map +3 -3
- package/build/page-list/block.json +14 -0
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/edit.cjs +1 -2
- package/build/paragraph/edit.cjs.map +2 -2
- package/build/playlist/block.json +1 -0
- package/build/post-author-biography/block.json +5 -0
- package/build/post-author-name/block.json +5 -0
- package/build/post-comments-count/block.json +3 -0
- package/build/post-comments-form/block.json +15 -0
- package/build/post-content/block.json +4 -1
- package/build/post-date/block.json +3 -0
- package/build/post-excerpt/block.json +9 -0
- package/build/post-featured-image/block.json +1 -0
- package/build/post-featured-image/edit.cjs +12 -10
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-navigation-link/block.json +30 -0
- package/build/post-navigation-link/edit.cjs +13 -2
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-template/block.json +13 -1
- package/build/post-terms/block.json +10 -0
- package/build/post-time-to-read/block.json +10 -0
- package/build/post-title/block.json +14 -0
- package/build/preformatted/block.json +11 -0
- package/build/pullquote/block.json +3 -1
- package/build/query-no-results/block.json +14 -2
- package/build/query-pagination/block.json +20 -0
- package/build/query-pagination-next/block.json +3 -0
- package/build/query-pagination-numbers/block.json +3 -0
- package/build/query-pagination-previous/block.json +3 -0
- package/build/query-title/block.json +3 -0
- package/build/query-total/block.json +10 -0
- package/build/quote/block.json +3 -0
- package/build/read-more/block.json +11 -0
- package/build/rss/block.json +10 -0
- package/build/search/block.json +2 -1
- package/build/site-tagline/block.json +12 -1
- package/build/site-title/block.json +11 -1
- package/build/social-links/block.json +4 -0
- package/build/social-links/edit.cjs +2 -3
- package/build/social-links/edit.cjs.map +2 -2
- 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-panel/block.json +25 -0
- package/build/tab-panel/controls.cjs.map +3 -3
- package/build/tab-panels/block.json +21 -1
- package/build/table-of-contents/block.json +7 -0
- package/build/tabs/block.json +27 -1
- package/build/tag-cloud/block.json +19 -0
- package/build/template-part/edit/selection-modal.cjs.map +1 -1
- package/build/term-count/block.json +12 -0
- package/build/term-description/block.json +13 -0
- package/build/term-name/block.json +16 -1
- package/build/term-template/block.json +14 -1
- package/build/utils/search-patterns.cjs +7 -43
- package/build/utils/search-patterns.cjs.map +3 -3
- package/build/utils/style-state.cjs +4 -6
- package/build/utils/style-state.cjs.map +2 -2
- 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 +12 -0
- package/build/video/edit.cjs +30 -14
- package/build/video/edit.cjs.map +3 -3
- package/build/video/index.cjs +0 -2
- package/build/video/index.cjs.map +3 -3
- package/build/video/save.cjs +5 -1
- package/build/video/save.cjs.map +3 -3
- package/build-module/accordion/block.json +4 -1
- package/build-module/accordion-heading/block.json +1 -0
- package/build-module/accordion-item/block.json +7 -1
- package/build-module/accordion-panel/block.json +9 -1
- package/build-module/archives/block.json +12 -0
- package/build-module/audio/block.json +8 -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/breadcrumbs/block.json +3 -0
- package/build-module/breadcrumbs/edit.mjs +3 -3
- package/build-module/breadcrumbs/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 +15 -1
- package/build-module/categories/block.json +12 -1
- package/build-module/code/block.json +13 -0
- package/build-module/column/block.json +9 -0
- package/build-module/column/edit.mjs +5 -0
- package/build-module/column/edit.mjs.map +2 -2
- package/build-module/columns/block.json +13 -0
- package/build-module/columns/edit.mjs +22 -122
- package/build-module/columns/edit.mjs.map +2 -2
- package/build-module/comment-author-name/block.json +3 -0
- package/build-module/comment-content/block.json +5 -0
- package/build-module/comment-date/block.json +3 -0
- package/build-module/comment-edit-link/block.json +3 -0
- package/build-module/comment-reply-link/block.json +3 -0
- package/build-module/comments/block.json +10 -0
- 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 +14 -0
- package/build-module/comments-pagination-next/block.json +3 -0
- package/build-module/comments-pagination-numbers/block.json +3 -0
- package/build-module/comments-pagination-previous/block.json +6 -0
- package/build-module/comments-title/block.json +3 -0
- package/build-module/cover/block.json +2 -1
- package/build-module/cover/edit/index.mjs +36 -7
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +62 -16
- 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 +14 -0
- package/build-module/embed/block.json +6 -1
- package/build-module/file/block.json +14 -0
- package/build-module/footnotes/block.json +13 -0
- package/build-module/gallery/block.json +22 -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 +111 -44
- 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/block.json +1 -0
- package/build-module/group/edit.mjs +4 -4
- package/build-module/group/edit.mjs.map +2 -2
- package/build-module/heading/block.json +14 -0
- package/build-module/home-link/block.json +30 -0
- package/build-module/home-link/edit.mjs +2 -2
- package/build-module/home-link/edit.mjs.map +2 -2
- 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/image.mjs +12 -10
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs +32 -8
- 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 +20 -0
- package/build-module/latest-posts/block.json +14 -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 +14 -0
- package/build-module/math/block.json +14 -0
- package/build-module/media-text/block.json +19 -0
- package/build-module/navigation/edit/index.mjs +1 -4
- package/build-module/navigation/edit/index.mjs.map +2 -2
- 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/link-ui/page-creator.mjs +2 -2
- package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
- package/build-module/navigation-link/shared/controls.mjs +2 -2
- package/build-module/navigation-link/shared/controls.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/navigation-link/shared/use-link-preview.mjs +13 -13
- package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
- package/build-module/navigation-overlay-close/block.json +7 -0
- package/build-module/navigation-submenu/block.json +6 -0
- package/build-module/navigation-submenu/edit.mjs +11 -2
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/page-list/block.json +14 -0
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/edit.mjs +1 -2
- package/build-module/paragraph/edit.mjs.map +2 -2
- package/build-module/playlist/block.json +1 -0
- package/build-module/post-author-biography/block.json +5 -0
- package/build-module/post-author-name/block.json +5 -0
- package/build-module/post-comments-count/block.json +3 -0
- package/build-module/post-comments-form/block.json +15 -0
- package/build-module/post-content/block.json +4 -1
- package/build-module/post-date/block.json +3 -0
- package/build-module/post-excerpt/block.json +9 -0
- package/build-module/post-featured-image/block.json +1 -0
- package/build-module/post-featured-image/edit.mjs +12 -10
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/block.json +30 -0
- package/build-module/post-navigation-link/edit.mjs +17 -3
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-template/block.json +13 -1
- package/build-module/post-terms/block.json +10 -0
- package/build-module/post-time-to-read/block.json +10 -0
- package/build-module/post-title/block.json +14 -0
- package/build-module/preformatted/block.json +11 -0
- package/build-module/pullquote/block.json +3 -1
- package/build-module/query-no-results/block.json +14 -2
- package/build-module/query-pagination/block.json +20 -0
- package/build-module/query-pagination-next/block.json +3 -0
- package/build-module/query-pagination-numbers/block.json +3 -0
- package/build-module/query-pagination-previous/block.json +3 -0
- package/build-module/query-title/block.json +3 -0
- package/build-module/query-total/block.json +10 -0
- package/build-module/quote/block.json +3 -0
- package/build-module/read-more/block.json +11 -0
- package/build-module/rss/block.json +10 -0
- package/build-module/search/block.json +2 -1
- package/build-module/site-tagline/block.json +12 -1
- package/build-module/site-title/block.json +11 -1
- package/build-module/social-links/block.json +4 -0
- package/build-module/social-links/edit.mjs +2 -3
- package/build-module/social-links/edit.mjs.map +2 -2
- 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-panel/block.json +25 -0
- package/build-module/tab-panel/controls.mjs +2 -2
- package/build-module/tab-panel/controls.mjs.map +2 -2
- package/build-module/tab-panels/block.json +21 -1
- package/build-module/table-of-contents/block.json +7 -0
- package/build-module/tabs/block.json +27 -1
- package/build-module/tag-cloud/block.json +19 -0
- package/build-module/template-part/edit/selection-modal.mjs.map +1 -1
- package/build-module/term-count/block.json +12 -0
- package/build-module/term-description/block.json +13 -0
- package/build-module/term-name/block.json +16 -1
- package/build-module/term-template/block.json +14 -1
- package/build-module/utils/search-patterns.mjs +7 -32
- package/build-module/utils/search-patterns.mjs.map +2 -2
- package/build-module/utils/style-state.mjs +6 -4
- package/build-module/utils/style-state.mjs.map +2 -2
- 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 +12 -0
- package/build-module/video/edit.mjs +32 -15
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/index.mjs +0 -2
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/save.mjs +7 -2
- package/build-module/video/save.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 +23 -6
- package/build-style/editor.css +23 -6
- 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/editor-rtl.css +6 -0
- package/build-style/image/editor.css +6 -0
- 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/navigation/style-rtl.css +18 -3
- package/build-style/navigation/style.css +18 -3
- package/build-style/navigation-link/editor-rtl.css +3 -1
- package/build-style/navigation-link/editor.css +3 -1
- package/build-style/navigation-overlay-close/style-rtl.css +1 -1
- package/build-style/navigation-overlay-close/style.css +1 -1
- package/build-style/navigation-submenu/editor-rtl.css +3 -1
- package/build-style/navigation-submenu/editor.css +3 -1
- package/build-style/post-navigation-link/style-rtl.css +3 -0
- package/build-style/post-navigation-link/style.css +3 -0
- 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 +94 -13
- package/build-style/style.css +97 -14
- package/build-style/tab-panel/style-rtl.css +2 -0
- package/build-style/tab-panel/style.css +2 -0
- 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 +46 -44
- package/src/accordion/README.md +3 -0
- package/src/accordion/block.json +4 -1
- package/src/accordion-heading/README.md +1 -0
- package/src/accordion-heading/block.json +1 -0
- package/src/accordion-item/README.md +5 -0
- package/src/accordion-item/block.json +7 -1
- package/src/accordion-panel/README.md +7 -0
- package/src/accordion-panel/block.json +9 -1
- package/src/archives/README.md +6 -0
- package/src/archives/block.json +12 -0
- package/src/audio/README.md +4 -0
- package/src/audio/block.json +8 -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/README.md +2 -0
- package/src/breadcrumbs/block.json +3 -0
- package/src/breadcrumbs/edit.jsx +3 -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 +8 -0
- package/src/buttons/block.json +15 -1
- package/src/categories/README.md +6 -0
- package/src/categories/block.json +12 -1
- package/src/code/README.md +7 -0
- package/src/code/block.json +13 -0
- package/src/column/README.md +4 -0
- package/src/column/block.json +9 -0
- package/src/column/edit.jsx +6 -0
- package/src/columns/README.md +7 -0
- package/src/columns/block.json +13 -0
- package/src/columns/edit.jsx +1 -131
- package/src/comment-author-name/README.md +2 -0
- package/src/comment-author-name/block.json +3 -0
- package/src/comment-content/README.md +4 -0
- package/src/comment-content/block.json +5 -0
- package/src/comment-date/README.md +2 -0
- package/src/comment-date/block.json +3 -0
- package/src/comment-edit-link/README.md +2 -0
- package/src/comment-edit-link/block.json +3 -0
- package/src/comment-reply-link/README.md +2 -0
- package/src/comment-reply-link/block.json +3 -0
- package/src/comments/README.md +5 -0
- package/src/comments/block.json +10 -0
- package/src/comments/edit/placeholder.jsx +5 -1
- package/src/comments-pagination/README.md +6 -0
- package/src/comments-pagination/block.json +14 -0
- package/src/comments-pagination/style.scss +3 -0
- package/src/comments-pagination-next/README.md +2 -0
- package/src/comments-pagination-next/block.json +3 -0
- package/src/comments-pagination-numbers/README.md +2 -0
- package/src/comments-pagination-numbers/block.json +3 -0
- package/src/comments-pagination-previous/README.md +2 -0
- package/src/comments-pagination-previous/block.json +6 -0
- package/src/comments-title/README.md +2 -0
- package/src/comments-title/block.json +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 +41 -6
- package/src/cover/edit/inspector-controls.jsx +74 -14
- package/src/cover/embed-video-utils.js +18 -10
- package/src/cover/index.php +44 -15
- package/src/cover/test/edit.browser.test.js +200 -4
- package/src/cover/test/embed-video-utils.test.js +48 -0
- package/src/cover/view.js +22 -0
- package/src/details/README.md +8 -0
- package/src/details/block.json +14 -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 +8 -0
- package/src/file/block.json +14 -0
- package/src/footnotes/README.md +7 -0
- package/src/footnotes/block.json +13 -0
- package/src/gallery/README.md +17 -0
- package/src/gallery/block.json +22 -0
- package/src/gallery/dynamic-gallery.jsx +11 -91
- package/src/gallery/edit.jsx +147 -49
- 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/README.md +1 -0
- package/src/group/block.json +1 -0
- package/src/group/edit.jsx +5 -5
- package/src/heading/README.md +8 -0
- package/src/heading/block.json +14 -0
- package/src/home-link/README.md +11 -0
- package/src/home-link/block.json +30 -0
- package/src/home-link/edit.jsx +2 -2
- package/src/icon/components/custom-inserter/index.jsx +5 -1
- package/src/icon/edit.jsx +68 -7
- package/src/icon/index.php +10 -1
- package/src/image/editor.scss +8 -0
- package/src/image/image.jsx +13 -11
- 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 +201 -0
- package/src/image/use-open-image-media-editor-modal.js +37 -4
- package/src/image/view.js +64 -68
- package/src/latest-comments/README.md +8 -0
- package/src/latest-comments/block.json +20 -0
- package/src/latest-posts/README.md +8 -0
- package/src/latest-posts/block.json +14 -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 +8 -0
- package/src/loginout/block.json +14 -0
- package/src/math/README.md +8 -0
- package/src/math/block.json +14 -0
- package/src/media-text/README.md +18 -0
- package/src/media-text/block.json +19 -0
- package/src/media-text/style.scss +5 -1
- package/src/navigation/edit/index.jsx +2 -4
- package/src/navigation/style.scss +40 -4
- package/src/navigation/test/use-navigation-menu.jsdom.test.js +1 -1
- package/src/navigation-link/README.md +1 -1
- package/src/navigation-link/editor.scss +6 -1
- package/src/navigation-link/link-ui/index.jsx +60 -27
- package/src/navigation-link/link-ui/page-creator.jsx +2 -2
- package/src/navigation-link/link-ui/test/get-suggestions-query.jsdom.test.js +67 -0
- package/src/navigation-link/shared/controls.jsx +2 -2
- 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/test/use-link-preview.jsdom.test.js +22 -22
- package/src/navigation-link/shared/use-block-suggestions.js +192 -0
- package/src/navigation-link/shared/use-link-preview.js +15 -14
- package/src/navigation-overlay-close/README.md +1 -0
- package/src/navigation-overlay-close/block.json +7 -0
- package/src/navigation-overlay-close/style.scss +1 -1
- package/src/navigation-submenu/README.md +7 -0
- package/src/navigation-submenu/block.json +6 -0
- package/src/navigation-submenu/edit.jsx +11 -1
- package/src/navigation-submenu/editor.scss +6 -1
- package/src/navigation-submenu/index.php +11 -0
- package/src/page-list/README.md +8 -0
- package/src/page-list/block.json +14 -0
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/edit.jsx +1 -3
- package/src/playlist/README.md +1 -0
- package/src/playlist/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 +4 -0
- package/src/post-author-biography/block.json +5 -0
- package/src/post-author-name/README.md +4 -0
- package/src/post-author-name/block.json +5 -0
- package/src/post-comments-count/README.md +2 -0
- package/src/post-comments-count/block.json +3 -0
- package/src/post-comments-form/README.md +8 -0
- package/src/post-comments-form/block.json +15 -0
- package/src/post-content/README.md +3 -0
- package/src/post-content/block.json +4 -1
- package/src/post-date/README.md +2 -0
- package/src/post-date/block.json +3 -0
- package/src/post-excerpt/README.md +7 -0
- package/src/post-excerpt/block.json +9 -0
- package/src/post-featured-image/block.json +1 -0
- package/src/post-featured-image/edit.jsx +13 -11
- package/src/post-navigation-link/README.md +12 -0
- package/src/post-navigation-link/block.json +30 -0
- package/src/post-navigation-link/edit.jsx +23 -2
- package/src/post-navigation-link/index.php +94 -5
- package/src/post-navigation-link/style.scss +2 -0
- package/src/post-template/README.md +7 -0
- package/src/post-template/block.json +13 -1
- package/src/post-terms/README.md +8 -0
- package/src/post-terms/block.json +10 -0
- package/src/post-time-to-read/README.md +8 -0
- package/src/post-time-to-read/block.json +10 -0
- package/src/post-title/README.md +8 -0
- package/src/post-title/block.json +14 -0
- package/src/preformatted/README.md +9 -0
- package/src/preformatted/block.json +11 -0
- package/src/pullquote/README.md +2 -0
- package/src/pullquote/block.json +3 -1
- package/src/query-no-results/README.md +10 -0
- package/src/query-no-results/block.json +14 -2
- package/src/query-pagination/README.md +6 -0
- package/src/query-pagination/block.json +20 -0
- package/src/query-pagination/style.scss +3 -0
- package/src/query-pagination-next/README.md +2 -0
- package/src/query-pagination-next/block.json +3 -0
- package/src/query-pagination-numbers/README.md +2 -0
- package/src/query-pagination-numbers/block.json +3 -0
- package/src/query-pagination-previous/README.md +2 -0
- package/src/query-pagination-previous/block.json +3 -0
- package/src/query-title/README.md +2 -0
- package/src/query-title/block.json +3 -0
- package/src/query-total/README.md +8 -0
- package/src/query-total/block.json +10 -0
- package/src/quote/README.md +3 -0
- package/src/quote/block.json +3 -0
- package/src/read-more/README.md +8 -0
- package/src/read-more/block.json +11 -0
- package/src/rss/README.md +8 -0
- package/src/rss/block.json +10 -0
- package/src/search/README.md +1 -0
- package/src/search/block.json +2 -1
- package/src/site-tagline/README.md +9 -0
- package/src/site-tagline/block.json +12 -1
- package/src/site-title/README.md +8 -0
- package/src/site-title/block.json +11 -1
- package/src/social-links/README.md +3 -0
- package/src/social-links/block.json +4 -0
- package/src/social-links/edit.jsx +2 -3
- 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-panel/README.md +9 -0
- package/src/tab-panel/block.json +25 -0
- package/src/tab-panel/controls.jsx +2 -2
- package/src/tab-panel/style.scss +5 -2
- package/src/tab-panels/README.md +9 -0
- package/src/tab-panels/block.json +21 -1
- package/src/table/editor.scss +8 -2
- package/src/table/style.scss +4 -4
- package/src/table-of-contents/README.md +6 -0
- package/src/table-of-contents/block.json +7 -0
- package/src/tabs/README.md +11 -0
- package/src/tabs/block.json +27 -1
- package/src/tag-cloud/README.md +9 -0
- package/src/tag-cloud/block.json +19 -0
- package/src/tag-cloud/style.scss +1 -1
- package/src/template-part/edit/selection-modal.jsx +1 -1
- package/src/template-part/index.php +16 -3
- package/src/term-count/README.md +10 -0
- package/src/term-count/block.json +12 -0
- package/src/term-description/README.md +8 -0
- package/src/term-description/block.json +13 -0
- package/src/term-name/README.md +9 -0
- package/src/term-name/block.json +16 -1
- package/src/term-name/index.php +1 -1
- package/src/term-template/README.md +8 -0
- package/src/term-template/block.json +14 -1
- package/src/utils/search-patterns.js +9 -53
- package/src/utils/style-state.js +6 -4
- package/src/utils/test/{search-patterns.js → search-patterns.jsdom.test.js} +1 -22
- 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 +11 -0
- package/src/video/block.json +12 -0
- package/src/video/edit.jsx +65 -49
- package/src/video/index.js +0 -2
- package/src/video/save.jsx +10 -1
- package/build/columns/utils.cjs +0 -112
- package/build/columns/utils.cjs.map +0 -7
- package/build/video/variations.cjs +0 -75
- package/build/video/variations.cjs.map +0 -7
- package/build-module/columns/utils.mjs +0 -78
- package/build-module/columns/utils.mjs.map +0 -7
- package/build-module/video/variations.mjs +0 -50
- package/build-module/video/variations.mjs.map +0 -7
- package/src/columns/test/utils.js +0 -331
- package/src/columns/utils.js +0 -176
- package/src/video/test/variations.js +0 -63
- package/src/video/variations.js +0 -62
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { __ } from '@wordpress/i18n';
|
|
2
|
+
import { SelectControl as WCSelectControl } from '@wordpress/components';
|
|
3
|
+
import {
|
|
4
|
+
ORDER_OPTIONS,
|
|
5
|
+
RANDOM_OPTION,
|
|
6
|
+
RANDOM_ORDER,
|
|
7
|
+
parseOrderValue,
|
|
8
|
+
toOrderValue,
|
|
9
|
+
} from './order-options';
|
|
10
|
+
import type { Order } from './order-options';
|
|
11
|
+
|
|
12
|
+
function getOrderHelp( isRandom: boolean ): string | undefined {
|
|
13
|
+
return isRandom
|
|
14
|
+
? __( 'Images are shown in a random order each time the page loads.' )
|
|
15
|
+
: undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const SOURCE_ORDER_OPTIONS = [ ...ORDER_OPTIONS, RANDOM_OPTION ];
|
|
19
|
+
|
|
20
|
+
type SourceOrderControlProps = {
|
|
21
|
+
/** The stored query order. */
|
|
22
|
+
order: Order;
|
|
23
|
+
/** Whether the gallery's `randomOrder` attribute is set. */
|
|
24
|
+
isRandom: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Called with `{ orderby, order }` to update the query. Choosing an order
|
|
27
|
+
* also turns "Random" off; the handler owns that so both writes land in one
|
|
28
|
+
* undo level.
|
|
29
|
+
*/
|
|
30
|
+
onChange: ( order: Order ) => void;
|
|
31
|
+
/** Called when "Random" is chosen. */
|
|
32
|
+
onSelectRandom: () => void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Ordering control for a dynamic gallery, shown in the Settings panel. The
|
|
37
|
+
* chosen order is a *setting*: it's stored in the source's query and re-applied
|
|
38
|
+
* every time the source resolves. "Random" is stored separately (the
|
|
39
|
+
* `randomOrder` attribute) and overrides the query order on the front end, so
|
|
40
|
+
* while it's set the control shows it instead of the query order.
|
|
41
|
+
*/
|
|
42
|
+
export function SourceOrderControl( {
|
|
43
|
+
order,
|
|
44
|
+
isRandom,
|
|
45
|
+
onChange,
|
|
46
|
+
onSelectRandom,
|
|
47
|
+
}: SourceOrderControlProps ) {
|
|
48
|
+
return (
|
|
49
|
+
<WCSelectControl
|
|
50
|
+
label={ __( 'Order by' ) }
|
|
51
|
+
value={ isRandom ? RANDOM_ORDER : toOrderValue( order ) }
|
|
52
|
+
options={ SOURCE_ORDER_OPTIONS }
|
|
53
|
+
help={ getOrderHelp( isRandom ) }
|
|
54
|
+
onChange={ ( value ) => {
|
|
55
|
+
if ( value === RANDOM_ORDER ) {
|
|
56
|
+
onSelectRandom();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
onChange( parseOrderValue( value ) );
|
|
60
|
+
} }
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const CUSTOM_ORDER = 'custom';
|
|
66
|
+
|
|
67
|
+
type SortImagesControlProps = {
|
|
68
|
+
/** The last sort applied, while it still holds, or `null` for a custom order. */
|
|
69
|
+
currentOrder: Order | null;
|
|
70
|
+
/** Whether the gallery's `randomOrder` attribute is set. */
|
|
71
|
+
isRandom: boolean;
|
|
72
|
+
/** Whether the sort orders can be applied (false while media resolves). */
|
|
73
|
+
canSort: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Called with `{ orderby, order }` to sort the images. Sorting also turns
|
|
76
|
+
* "Random" off; the handler owns that so both writes land in one undo level.
|
|
77
|
+
*/
|
|
78
|
+
onSort: ( order: Order ) => void;
|
|
79
|
+
/** Called when "Custom" is chosen, which turns "Random" off. */
|
|
80
|
+
onSelectCustom: () => void;
|
|
81
|
+
/** Called when "Random" is chosen. */
|
|
82
|
+
onSelectRandom: () => void;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Ordering control for a static gallery, shown in the Settings panel.
|
|
87
|
+
*
|
|
88
|
+
* The date and title orders are one-off *actions*: choosing one reorders the
|
|
89
|
+
* inner image blocks once, and the user can drag them into any other order
|
|
90
|
+
* afterwards. Nothing is stored for them, so the caller passes back the last
|
|
91
|
+
* sort it applied for as long as the images remain in that sequence, and
|
|
92
|
+
* `null` ("Custom") otherwise. "Custom" means the order arranged in the
|
|
93
|
+
* editor, and is choosable only while "Random" is on: picking it turns
|
|
94
|
+
* "Random" off without reordering anything.
|
|
95
|
+
*
|
|
96
|
+
* "Random" is the one stored value (the `randomOrder` attribute). It applies
|
|
97
|
+
* on the front end only, leaving the editor order as it is, and choosing any
|
|
98
|
+
* other option clears it.
|
|
99
|
+
*/
|
|
100
|
+
export function SortImagesControl( {
|
|
101
|
+
currentOrder,
|
|
102
|
+
isRandom,
|
|
103
|
+
canSort,
|
|
104
|
+
onSort,
|
|
105
|
+
onSelectCustom,
|
|
106
|
+
onSelectRandom,
|
|
107
|
+
}: SortImagesControlProps ) {
|
|
108
|
+
const options = [
|
|
109
|
+
{ label: __( 'Custom' ), value: CUSTOM_ORDER, disabled: ! isRandom },
|
|
110
|
+
...ORDER_OPTIONS.map( ( option ) => ( {
|
|
111
|
+
...option,
|
|
112
|
+
disabled: ! canSort,
|
|
113
|
+
} ) ),
|
|
114
|
+
RANDOM_OPTION,
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
let value = CUSTOM_ORDER;
|
|
118
|
+
if ( isRandom ) {
|
|
119
|
+
value = RANDOM_ORDER;
|
|
120
|
+
} else if ( currentOrder ) {
|
|
121
|
+
value = toOrderValue( currentOrder );
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<WCSelectControl
|
|
126
|
+
label={ __( 'Order by' ) }
|
|
127
|
+
value={ value }
|
|
128
|
+
options={ options }
|
|
129
|
+
help={ getOrderHelp( isRandom ) }
|
|
130
|
+
onChange={ ( nextValue ) => {
|
|
131
|
+
if ( nextValue === RANDOM_ORDER ) {
|
|
132
|
+
onSelectRandom();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if ( nextValue === CUSTOM_ORDER ) {
|
|
136
|
+
onSelectCustom();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
onSort( parseOrderValue( nextValue ) );
|
|
140
|
+
} }
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the value an image block is ordered by, or `undefined` when it has no
|
|
3
|
+
* resolved attachment record to take it from.
|
|
4
|
+
*
|
|
5
|
+
* @param {Object} block A `core/image` inner block.
|
|
6
|
+
* @param {Array} media Attachment records for the gallery's images.
|
|
7
|
+
* @param {string} orderby `date` or `title`.
|
|
8
|
+
* @return {?string} The sort key.
|
|
9
|
+
*/
|
|
10
|
+
function getSortKey( block, media, orderby ) {
|
|
11
|
+
const { id } = block.attributes;
|
|
12
|
+
if ( id === undefined ) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const record = media.find( ( item ) => item.id === id );
|
|
16
|
+
if ( ! record ) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
if ( orderby === 'title' ) {
|
|
20
|
+
// The media is fetched in the default (view) context, so `rendered`
|
|
21
|
+
// is the usual source; `raw` is only present with the edit context.
|
|
22
|
+
return record.title?.raw ?? record.title?.rendered ?? '';
|
|
23
|
+
}
|
|
24
|
+
return record.date ?? '';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether there's anything to sort: at least two image blocks with a resolved
|
|
29
|
+
* attachment record. With fewer, sorting is a no-op, so the sort options are
|
|
30
|
+
* disabled.
|
|
31
|
+
*
|
|
32
|
+
* @param {Array} blocks The gallery's `core/image` inner blocks.
|
|
33
|
+
* @param {Array} media Attachment records for the gallery's images.
|
|
34
|
+
* @return {boolean} Whether the images can be sorted.
|
|
35
|
+
*/
|
|
36
|
+
export function hasSortableImages( blocks, media ) {
|
|
37
|
+
// Runs on every render, so avoid scanning `media` once per block.
|
|
38
|
+
const mediaIds = new Set( media.map( ( item ) => item.id ) );
|
|
39
|
+
let sortableCount = 0;
|
|
40
|
+
for ( const block of blocks ) {
|
|
41
|
+
if ( ! mediaIds.has( block.attributes.id ) ) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
sortableCount++;
|
|
45
|
+
if ( sortableCount > 1 ) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Compares two sort keys for the given field. Titles use a natural,
|
|
54
|
+
* case-insensitive comparison so `IMG_2` sorts before `IMG_10`; dates are ISO
|
|
55
|
+
* 8601 strings, so a plain string comparison orders them chronologically.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} a First key.
|
|
58
|
+
* @param {string} b Second key.
|
|
59
|
+
* @param {string} orderby `date` or `title`.
|
|
60
|
+
* @return {number} Negative when `a` sorts first, positive when `b` does.
|
|
61
|
+
*/
|
|
62
|
+
function compareKeys( a, b, orderby ) {
|
|
63
|
+
if ( orderby === 'title' ) {
|
|
64
|
+
return a.localeCompare( b, undefined, {
|
|
65
|
+
numeric: true,
|
|
66
|
+
sensitivity: 'base',
|
|
67
|
+
} );
|
|
68
|
+
}
|
|
69
|
+
if ( a === b ) {
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
return a < b ? -1 : 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Sorts a static gallery's image blocks by an attachment field.
|
|
77
|
+
*
|
|
78
|
+
* Blocks without an `id`, or whose attachment record isn't in `media` (still
|
|
79
|
+
* loading, or deleted from the library), can't be placed, so they keep their
|
|
80
|
+
* relative order and move to the end. Blocks with equal keys likewise keep
|
|
81
|
+
* their relative order (`Array.prototype.sort` is stable), so re-applying the
|
|
82
|
+
* current order is a no-op.
|
|
83
|
+
*
|
|
84
|
+
* @param {Array} blocks The gallery's `core/image` inner blocks.
|
|
85
|
+
* @param {Array} media Attachment records for the gallery's images.
|
|
86
|
+
* @param {Object} order The order to apply.
|
|
87
|
+
* @param {string} order.orderby `date` or `title`.
|
|
88
|
+
* @param {string} order.order `asc` or `desc`.
|
|
89
|
+
* @return {Array} A new array holding the same block objects, sorted.
|
|
90
|
+
*/
|
|
91
|
+
export function sortImageBlocks( blocks, media, { orderby, order } ) {
|
|
92
|
+
const direction = order === 'desc' ? -1 : 1;
|
|
93
|
+
const keys = new Map(
|
|
94
|
+
blocks.map( ( block ) => [
|
|
95
|
+
block,
|
|
96
|
+
getSortKey( block, media, orderby ),
|
|
97
|
+
] )
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
return [ ...blocks ].sort( ( a, b ) => {
|
|
101
|
+
const keyA = keys.get( a );
|
|
102
|
+
const keyB = keys.get( b );
|
|
103
|
+
if ( keyA === undefined || keyB === undefined ) {
|
|
104
|
+
if ( keyA === keyB ) {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
return keyA === undefined ? 1 : -1;
|
|
108
|
+
}
|
|
109
|
+
return compareKeys( keyA, keyB, orderby ) * direction;
|
|
110
|
+
} );
|
|
111
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { __ } from '@wordpress/i18n';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An ordering of gallery images: the field to order by and the direction.
|
|
5
|
+
*/
|
|
6
|
+
export type Order = {
|
|
7
|
+
orderby: string;
|
|
8
|
+
order: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The composite `"orderby/order"` select value for an order. A select needs one
|
|
13
|
+
* string per option, so this format exists only at the select boundary; the
|
|
14
|
+
* rest of the feature passes `Order` objects.
|
|
15
|
+
*
|
|
16
|
+
* @param order The order.
|
|
17
|
+
* @return The select value.
|
|
18
|
+
*/
|
|
19
|
+
export function toOrderValue( order: Order ): string {
|
|
20
|
+
return `${ order.orderby }/${ order.order }`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Parses a composite `"orderby/order"` select value back into an order.
|
|
25
|
+
*
|
|
26
|
+
* @param value The select value.
|
|
27
|
+
* @return The order.
|
|
28
|
+
*/
|
|
29
|
+
export function parseOrderValue( value: string ): Order {
|
|
30
|
+
const [ orderby, order ] = value.split( '/' );
|
|
31
|
+
return { orderby, order };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Ordering options offered for gallery images. Each value is a composite
|
|
36
|
+
* `orderby/order` string. The two modes share values and labels but differ
|
|
37
|
+
* in their comparison logic:
|
|
38
|
+
*
|
|
39
|
+
* - A dynamic gallery passes `orderby/order` to the REST API in the editor (the
|
|
40
|
+
* `/wp/v2/media` collection params; see `dynamic-source.js`) and to a
|
|
41
|
+
* `WP_Query` on the front end (see `index.php`). Either way the database
|
|
42
|
+
* orders by post date or post title.
|
|
43
|
+
* - A static gallery orders its inner image blocks client-side from the same
|
|
44
|
+
* attachment fields (see `order-images.js`). Dates compare the same way.
|
|
45
|
+
* Titles use a natural, case-insensitive compare, so `IMG_2` sorts before
|
|
46
|
+
* `IMG_10` where the database would put it after. The two title orders can
|
|
47
|
+
* therefore differ for numbered titles.
|
|
48
|
+
*
|
|
49
|
+
* `menu_order` is deliberately omitted — it isn't a valid REST `orderby`
|
|
50
|
+
* value, so the editor preview couldn't reproduce it (see `dynamic-source.js`).
|
|
51
|
+
*/
|
|
52
|
+
export const ORDER_OPTIONS = [
|
|
53
|
+
{ label: __( 'Newest to oldest' ), value: 'date/desc' },
|
|
54
|
+
{ label: __( 'Oldest to newest' ), value: 'date/asc' },
|
|
55
|
+
{
|
|
56
|
+
/* translators: Label for ordering images by title in ascending order. */
|
|
57
|
+
label: __( 'A → Z' ),
|
|
58
|
+
value: 'title/asc',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
/* translators: Label for ordering images by title in descending order. */
|
|
62
|
+
label: __( 'Z → A' ),
|
|
63
|
+
value: 'title/desc',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The "Random" order. Unlike the orders above it isn't an `orderby`: it is the
|
|
69
|
+
* gallery's `randomOrder` attribute, applied only on the front end by shuffling
|
|
70
|
+
* the rendered images (see `index.php`), so the editor keeps showing the
|
|
71
|
+
* underlying order. Offered as the last option of both modes' "Order by"
|
|
72
|
+
* control, since it overrides whatever other order is in place.
|
|
73
|
+
*/
|
|
74
|
+
export const RANDOM_ORDER = 'random';
|
|
75
|
+
export const RANDOM_OPTION = { label: __( 'Random' ), value: RANDOM_ORDER };
|
|
@@ -26,6 +26,15 @@ const IMAGE_ATTRIBUTES = {
|
|
|
26
26
|
|
|
27
27
|
const VIEWPORT_STATE_INITIALIZER = 'test/viewport-state-initializer';
|
|
28
28
|
|
|
29
|
+
const createGallery = ( attributes = {} ) =>
|
|
30
|
+
createBlock( 'core/gallery', attributes, [
|
|
31
|
+
createBlock( 'core/image', IMAGE_ATTRIBUTES ),
|
|
32
|
+
createBlock( 'core/image', {
|
|
33
|
+
...IMAGE_ATTRIBUTES,
|
|
34
|
+
id: 2,
|
|
35
|
+
} ),
|
|
36
|
+
] );
|
|
37
|
+
|
|
29
38
|
// The Gallery only offers its aspect ratio control when the theme or the
|
|
30
39
|
// defaults provide ratios to choose from.
|
|
31
40
|
const ASPECT_RATIO_SETTINGS = {
|
|
@@ -110,16 +119,84 @@ describe( 'Gallery block', () => {
|
|
|
110
119
|
} );
|
|
111
120
|
} );
|
|
112
121
|
|
|
113
|
-
describe( '
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
createBlock( 'core/image', {
|
|
118
|
-
...IMAGE_ATTRIBUTES,
|
|
119
|
-
id: 2,
|
|
120
|
-
} ),
|
|
121
|
-
] );
|
|
122
|
+
describe( 'Order by', () => {
|
|
123
|
+
test( 'offers a sort control in Settings for a static gallery that reads as a custom order until the media resolves', async () => {
|
|
124
|
+
await setup( createGallery() );
|
|
125
|
+
await selectBlock( 'Block: Gallery' );
|
|
122
126
|
|
|
127
|
+
const orderBy = await screen.findByRole( 'combobox', {
|
|
128
|
+
name: 'Order by',
|
|
129
|
+
} );
|
|
130
|
+
expect( orderBy ).toHaveDisplayValue( 'Custom' );
|
|
131
|
+
// The attachment records never resolve in this environment, so
|
|
132
|
+
// there's nothing to sort by yet; Random doesn't need them. Custom
|
|
133
|
+
// is only choosable while Random is on, since that's all it does.
|
|
134
|
+
expect(
|
|
135
|
+
screen.getByRole( 'option', { name: 'Newest to oldest' } )
|
|
136
|
+
).toBeDisabled();
|
|
137
|
+
expect(
|
|
138
|
+
screen.getByRole( 'option', { name: 'Custom' } )
|
|
139
|
+
).toBeDisabled();
|
|
140
|
+
expect(
|
|
141
|
+
screen.getByRole( 'option', { name: 'Random' } )
|
|
142
|
+
).toBeEnabled();
|
|
143
|
+
} );
|
|
144
|
+
|
|
145
|
+
test( 'stores a random order for a static gallery and clears it when choosing the custom order', async () => {
|
|
146
|
+
await setup( createGallery() );
|
|
147
|
+
await selectBlock( 'Block: Gallery' );
|
|
148
|
+
|
|
149
|
+
const orderBy = await screen.findByRole( 'combobox', {
|
|
150
|
+
name: 'Order by',
|
|
151
|
+
} );
|
|
152
|
+
// The select is controlled from the `randomOrder` attribute, so
|
|
153
|
+
// its display value reflects the stored state after each change.
|
|
154
|
+
await userEvent.selectOptions( orderBy, 'random' );
|
|
155
|
+
expect( orderBy ).toHaveDisplayValue( 'Random' );
|
|
156
|
+
expect(
|
|
157
|
+
screen.getByRole( 'option', { name: 'Custom' } )
|
|
158
|
+
).toBeEnabled();
|
|
159
|
+
|
|
160
|
+
await userEvent.selectOptions( orderBy, 'custom' );
|
|
161
|
+
expect( orderBy ).toHaveDisplayValue( 'Custom' );
|
|
162
|
+
expect(
|
|
163
|
+
screen.getByRole( 'option', { name: 'Custom' } )
|
|
164
|
+
).toBeDisabled();
|
|
165
|
+
} );
|
|
166
|
+
|
|
167
|
+
test( 'offers a random order but no custom order for a dynamic gallery', async () => {
|
|
168
|
+
await setup(
|
|
169
|
+
createBlock( 'core/gallery', {
|
|
170
|
+
dynamicContent: { source: 'core/attached-media' },
|
|
171
|
+
} )
|
|
172
|
+
);
|
|
173
|
+
await selectBlock( 'Block: Dynamic Gallery' );
|
|
174
|
+
|
|
175
|
+
const orderBy = await screen.findByRole( 'combobox', {
|
|
176
|
+
name: 'Order by',
|
|
177
|
+
} );
|
|
178
|
+
expect( orderBy ).toHaveDisplayValue( 'Newest to oldest' );
|
|
179
|
+
expect(
|
|
180
|
+
screen.queryByRole( 'option', { name: 'Custom' } )
|
|
181
|
+
).not.toBeInTheDocument();
|
|
182
|
+
// The order lives in Settings; the Source panel is a plain
|
|
183
|
+
// PanelBody with no resettable items, hence no options menu.
|
|
184
|
+
expect(
|
|
185
|
+
screen.getByRole( 'button', { name: 'Settings options' } )
|
|
186
|
+
).toBeInTheDocument();
|
|
187
|
+
expect(
|
|
188
|
+
screen.queryByRole( 'button', { name: 'Source options' } )
|
|
189
|
+
).not.toBeInTheDocument();
|
|
190
|
+
|
|
191
|
+
await userEvent.selectOptions( orderBy, 'random' );
|
|
192
|
+
expect( orderBy ).toHaveDisplayValue( 'Random' );
|
|
193
|
+
|
|
194
|
+
await userEvent.selectOptions( orderBy, 'title/asc' );
|
|
195
|
+
expect( orderBy ).toHaveDisplayValue( 'A → Z' );
|
|
196
|
+
} );
|
|
197
|
+
} );
|
|
198
|
+
|
|
199
|
+
describe( 'Layout', () => {
|
|
123
200
|
test( 'keeps the custom Gallery controls for the default Flex layout', async () => {
|
|
124
201
|
await setup( createGallery() );
|
|
125
202
|
await selectBlock( 'Block: Gallery' );
|
|
@@ -149,7 +226,7 @@ describe( 'Gallery block', () => {
|
|
|
149
226
|
screen.getByLabelText( 'Crop images to fit' )
|
|
150
227
|
).toBeInTheDocument();
|
|
151
228
|
expect(
|
|
152
|
-
screen.
|
|
229
|
+
screen.queryByRole( 'combobox', { name: 'Order by' } )
|
|
153
230
|
).not.toBeInTheDocument();
|
|
154
231
|
} );
|
|
155
232
|
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { hasSortableImages, sortImageBlocks } from '../order-images';
|
|
3
|
+
|
|
4
|
+
const NEWEST_FIRST = { orderby: 'date', order: 'desc' };
|
|
5
|
+
const OLDEST_FIRST = { orderby: 'date', order: 'asc' };
|
|
6
|
+
const TITLE_A_TO_Z = { orderby: 'title', order: 'asc' };
|
|
7
|
+
const TITLE_Z_TO_A = { orderby: 'title', order: 'desc' };
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates the minimal `core/image` block the helpers read: an attachment id
|
|
11
|
+
* and a client ID, which defaults from the id.
|
|
12
|
+
*
|
|
13
|
+
* @param {number|undefined} id Attachment id, or `undefined` for an external image.
|
|
14
|
+
* @param {string} clientId Block client ID.
|
|
15
|
+
*/
|
|
16
|
+
function createImageBlock( id, clientId = `block-${ id }` ) {
|
|
17
|
+
return { clientId, attributes: { id } };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Creates image blocks for the given attachment ids, in that order.
|
|
22
|
+
*
|
|
23
|
+
* @param {...number} ids Attachment ids.
|
|
24
|
+
*/
|
|
25
|
+
function createImageBlocks( ...ids ) {
|
|
26
|
+
return ids.map( ( id ) => createImageBlock( id ) );
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creates the minimal attachment record the helpers read.
|
|
31
|
+
*
|
|
32
|
+
* @param {number} id Attachment id.
|
|
33
|
+
* @param {string} title Attachment title.
|
|
34
|
+
* @param {string} date Upload date, ISO 8601.
|
|
35
|
+
*/
|
|
36
|
+
function createAttachment( id, title, date ) {
|
|
37
|
+
return { id, title: { raw: title, rendered: title }, date };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Listed oldest to newest, so the date order reads top to bottom: 2, 3, 1, 4.
|
|
41
|
+
// The ids deliberately don't follow the dates, so a sort keyed on the id (or
|
|
42
|
+
// on the position in this list) can't pass the date tests by accident. The
|
|
43
|
+
// title order is different again: apple, Beach, IMG_2, IMG_10 (2, 1, 4, 3),
|
|
44
|
+
// which requires the compare to ignore case and treat numbers naturally.
|
|
45
|
+
const ATTACHMENTS = [
|
|
46
|
+
createAttachment( 2, 'apple', '2024-01-15T10:00:00' ),
|
|
47
|
+
createAttachment( 3, 'IMG_10', '2024-02-01T10:00:00' ),
|
|
48
|
+
createAttachment( 1, 'Beach', '2024-03-01T10:00:00' ),
|
|
49
|
+
createAttachment( 4, 'IMG_2', '2024-04-01T10:00:00' ),
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const getImageIds = ( blocks ) =>
|
|
53
|
+
blocks.map( ( { attributes } ) => attributes.id );
|
|
54
|
+
|
|
55
|
+
describe( 'sortImageBlocks', () => {
|
|
56
|
+
it( 'sorts by date, newest first', () => {
|
|
57
|
+
const blocks = createImageBlocks( 1, 2, 3, 4 );
|
|
58
|
+
expect(
|
|
59
|
+
getImageIds( sortImageBlocks( blocks, ATTACHMENTS, NEWEST_FIRST ) )
|
|
60
|
+
).toEqual( [ 4, 1, 3, 2 ] );
|
|
61
|
+
} );
|
|
62
|
+
|
|
63
|
+
it( 'sorts by date, oldest first', () => {
|
|
64
|
+
const blocks = createImageBlocks( 1, 2, 3, 4 );
|
|
65
|
+
expect(
|
|
66
|
+
getImageIds( sortImageBlocks( blocks, ATTACHMENTS, OLDEST_FIRST ) )
|
|
67
|
+
).toEqual( [ 2, 3, 1, 4 ] );
|
|
68
|
+
} );
|
|
69
|
+
|
|
70
|
+
it( 'sorts by title ascending, ignoring case and comparing numbers naturally', () => {
|
|
71
|
+
const blocks = createImageBlocks( 1, 2, 3, 4 );
|
|
72
|
+
expect(
|
|
73
|
+
getImageIds( sortImageBlocks( blocks, ATTACHMENTS, TITLE_A_TO_Z ) )
|
|
74
|
+
).toEqual( [ 2, 1, 4, 3 ] );
|
|
75
|
+
} );
|
|
76
|
+
|
|
77
|
+
it( 'sorts by title descending', () => {
|
|
78
|
+
const blocks = createImageBlocks( 1, 2, 3, 4 );
|
|
79
|
+
expect(
|
|
80
|
+
getImageIds( sortImageBlocks( blocks, ATTACHMENTS, TITLE_Z_TO_A ) )
|
|
81
|
+
).toEqual( [ 3, 4, 1, 2 ] );
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
it( 'returns a new array containing the same block objects', () => {
|
|
85
|
+
const blocks = createImageBlocks( 1, 2 );
|
|
86
|
+
const sorted = sortImageBlocks( blocks, ATTACHMENTS, OLDEST_FIRST );
|
|
87
|
+
expect( sorted ).not.toBe( blocks );
|
|
88
|
+
expect( sorted[ 0 ] ).toBe( blocks[ 1 ] );
|
|
89
|
+
expect( sorted[ 1 ] ).toBe( blocks[ 0 ] );
|
|
90
|
+
} );
|
|
91
|
+
|
|
92
|
+
it( 'moves images without an id or attachment record to the end, in their existing order', () => {
|
|
93
|
+
const blocks = [
|
|
94
|
+
createImageBlock( undefined, 'external-a' ),
|
|
95
|
+
createImageBlock( 1 ),
|
|
96
|
+
createImageBlock( 99 ),
|
|
97
|
+
createImageBlock( 2 ),
|
|
98
|
+
createImageBlock( undefined, 'external-b' ),
|
|
99
|
+
];
|
|
100
|
+
const sorted = sortImageBlocks( blocks, ATTACHMENTS, OLDEST_FIRST );
|
|
101
|
+
expect( sorted.map( ( { clientId } ) => clientId ) ).toEqual( [
|
|
102
|
+
'block-2',
|
|
103
|
+
'block-1',
|
|
104
|
+
'external-a',
|
|
105
|
+
'block-99',
|
|
106
|
+
'external-b',
|
|
107
|
+
] );
|
|
108
|
+
} );
|
|
109
|
+
|
|
110
|
+
it( 'keeps the existing order of images with equal keys', () => {
|
|
111
|
+
const media = [
|
|
112
|
+
createAttachment( 1, 'Same', '2024-01-01T00:00:00' ),
|
|
113
|
+
createAttachment( 2, 'Same', '2024-01-01T00:00:00' ),
|
|
114
|
+
];
|
|
115
|
+
const blocks = createImageBlocks( 2, 1 );
|
|
116
|
+
expect(
|
|
117
|
+
getImageIds( sortImageBlocks( blocks, media, NEWEST_FIRST ) )
|
|
118
|
+
).toEqual( [ 2, 1 ] );
|
|
119
|
+
expect(
|
|
120
|
+
getImageIds( sortImageBlocks( blocks, media, TITLE_A_TO_Z ) )
|
|
121
|
+
).toEqual( [ 2, 1 ] );
|
|
122
|
+
} );
|
|
123
|
+
|
|
124
|
+
it( 'falls back to the rendered title when there is no raw title', () => {
|
|
125
|
+
const media = [
|
|
126
|
+
{ id: 1, title: { rendered: 'b' }, date: '' },
|
|
127
|
+
{ id: 2, title: { rendered: 'a' }, date: '' },
|
|
128
|
+
];
|
|
129
|
+
expect(
|
|
130
|
+
getImageIds(
|
|
131
|
+
sortImageBlocks(
|
|
132
|
+
createImageBlocks( 1, 2 ),
|
|
133
|
+
media,
|
|
134
|
+
TITLE_A_TO_Z
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
).toEqual( [ 2, 1 ] );
|
|
138
|
+
} );
|
|
139
|
+
} );
|
|
140
|
+
|
|
141
|
+
describe( 'hasSortableImages', () => {
|
|
142
|
+
it( 'is true with two or more images that have an attachment record', () => {
|
|
143
|
+
expect(
|
|
144
|
+
hasSortableImages( createImageBlocks( 1, 2 ), ATTACHMENTS )
|
|
145
|
+
).toBe( true );
|
|
146
|
+
} );
|
|
147
|
+
|
|
148
|
+
it( 'is false while the attachment records have not resolved', () => {
|
|
149
|
+
expect( hasSortableImages( createImageBlocks( 1, 2 ), [] ) ).toBe(
|
|
150
|
+
false
|
|
151
|
+
);
|
|
152
|
+
} );
|
|
153
|
+
|
|
154
|
+
it( 'does not count images without an id or attachment record', () => {
|
|
155
|
+
expect(
|
|
156
|
+
hasSortableImages(
|
|
157
|
+
createImageBlocks( 1, undefined, 99 ),
|
|
158
|
+
ATTACHMENTS
|
|
159
|
+
)
|
|
160
|
+
).toBe( false );
|
|
161
|
+
} );
|
|
162
|
+
} );
|
|
@@ -235,7 +235,7 @@ export default function useDynamicGallery( {
|
|
|
235
235
|
|
|
236
236
|
// Updates the source ordering within `dynamicContent.args`. Passing
|
|
237
237
|
// `undefined` (or the default order) strips the keys so they aren't
|
|
238
|
-
// persisted redundantly and the
|
|
238
|
+
// persisted redundantly and the Settings "Order by" item reads as unset.
|
|
239
239
|
function setSourceOrder( nextOrderby, nextOrder ) {
|
|
240
240
|
const nextArgs = { ...dynamicContent?.args };
|
|
241
241
|
delete nextArgs.orderBy;
|
|
@@ -256,13 +256,6 @@ export default function useDynamicGallery( {
|
|
|
256
256
|
setAttributes( { dynamicContent: nextSource } );
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
// Resets the source to its bare form: keeps the source kind, drops its args.
|
|
260
|
-
function resetSource() {
|
|
261
|
-
setAttributes( {
|
|
262
|
-
dynamicContent: { source: dynamicContent.source },
|
|
263
|
-
} );
|
|
264
|
-
}
|
|
265
|
-
|
|
266
259
|
return {
|
|
267
260
|
dynamicContent,
|
|
268
261
|
canUseDynamicSource,
|
|
@@ -278,6 +271,5 @@ export default function useDynamicGallery( {
|
|
|
278
271
|
enableDynamicMode,
|
|
279
272
|
convertToStatic,
|
|
280
273
|
setSourceOrder,
|
|
281
|
-
resetSource,
|
|
282
274
|
};
|
|
283
275
|
}
|
|
@@ -14,9 +14,15 @@ const EMPTY_IMAGE_MEDIA = [];
|
|
|
14
14
|
export default function useGetMedia( innerBlockImages ) {
|
|
15
15
|
return useSelect(
|
|
16
16
|
( select ) => {
|
|
17
|
+
// Sorted so the query only changes when the set of images changes,
|
|
18
|
+
// not when they're reordered: a reorder would otherwise be a new
|
|
19
|
+
// query, and the records would read as empty until it resolved.
|
|
20
|
+
// Consumers look records up by id, so the returned order doesn't
|
|
21
|
+
// matter.
|
|
17
22
|
const imageIds = innerBlockImages
|
|
18
23
|
.map( ( imageBlock ) => imageBlock.attributes.id )
|
|
19
|
-
.filter( ( id ) => id !== undefined )
|
|
24
|
+
.filter( ( id ) => id !== undefined )
|
|
25
|
+
.sort( ( a, b ) => a - b );
|
|
20
26
|
|
|
21
27
|
if ( imageIds.length === 0 ) {
|
|
22
28
|
return EMPTY_IMAGE_MEDIA;
|
|
@@ -29,7 +35,6 @@ export default function useGetMedia( innerBlockImages ) {
|
|
|
29
35
|
{
|
|
30
36
|
include: imageIds.join( ',' ),
|
|
31
37
|
per_page: -1,
|
|
32
|
-
orderby: 'include',
|
|
33
38
|
}
|
|
34
39
|
) ?? EMPTY_IMAGE_MEDIA
|
|
35
40
|
);
|
package/src/group/README.md
CHANGED
|
@@ -48,6 +48,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
48
48
|
- [`typography`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography):
|
|
49
49
|
- [`fontSize`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-fontsize): `true`
|
|
50
50
|
- [`lineHeight`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-lineheight): `true`
|
|
51
|
+
- `textColumns`: `true`
|
|
51
52
|
- [`layout`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout):
|
|
52
53
|
- [`allowSizingOnChildren`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowsizingonchildren): `true`
|
|
53
54
|
- [`interactivity`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#interactivity):
|