@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
package/src/file/block.json
CHANGED
|
@@ -65,10 +65,23 @@
|
|
|
65
65
|
"supports": {
|
|
66
66
|
"anchor": true,
|
|
67
67
|
"align": true,
|
|
68
|
+
"background": {
|
|
69
|
+
"backgroundImage": true,
|
|
70
|
+
"backgroundSize": true,
|
|
71
|
+
"gradient": true,
|
|
72
|
+
"__experimentalDefaultControls": {
|
|
73
|
+
"backgroundImage": true,
|
|
74
|
+
"gradient": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
68
77
|
"spacing": {
|
|
69
78
|
"margin": true,
|
|
70
79
|
"padding": true
|
|
71
80
|
},
|
|
81
|
+
"dimensions": {
|
|
82
|
+
"minHeight": true,
|
|
83
|
+
"minWidth": true
|
|
84
|
+
},
|
|
72
85
|
"color": {
|
|
73
86
|
"gradients": true,
|
|
74
87
|
"link": true,
|
|
@@ -90,6 +103,7 @@
|
|
|
90
103
|
"style": true
|
|
91
104
|
}
|
|
92
105
|
},
|
|
106
|
+
"shadow": true,
|
|
93
107
|
"interactivity": true
|
|
94
108
|
},
|
|
95
109
|
"editorStyle": "wp-block-file-editor",
|
package/src/footnotes/README.md
CHANGED
|
@@ -20,6 +20,10 @@ _This block has no custom attributes._
|
|
|
20
20
|
_Defined via the [`supports`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/) property in block.json._
|
|
21
21
|
|
|
22
22
|
- [`anchor`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#anchor): `true`
|
|
23
|
+
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#background):
|
|
24
|
+
- `backgroundImage`: `true`
|
|
25
|
+
- `backgroundSize`: `true`
|
|
26
|
+
- `gradient`: `true`
|
|
23
27
|
- [`color`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color):
|
|
24
28
|
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-background): `true`
|
|
25
29
|
- [`link`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-link): `true`
|
|
@@ -32,6 +36,9 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
32
36
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
33
37
|
- `margin`: `true`
|
|
34
38
|
- `padding`: `true`
|
|
39
|
+
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
|
|
40
|
+
- `minHeight`: `true`
|
|
41
|
+
- `minWidth`: `true`
|
|
35
42
|
- [`typography`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography):
|
|
36
43
|
- [`fontSize`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-fontsize): `true`
|
|
37
44
|
- [`lineHeight`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-lineheight): `true`
|
package/src/footnotes/block.json
CHANGED
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
"usesContext": [ "postId", "postType" ],
|
|
11
11
|
"supports": {
|
|
12
12
|
"anchor": true,
|
|
13
|
+
"background": {
|
|
14
|
+
"backgroundImage": true,
|
|
15
|
+
"backgroundSize": true,
|
|
16
|
+
"gradient": true,
|
|
17
|
+
"__experimentalDefaultControls": {
|
|
18
|
+
"backgroundImage": true,
|
|
19
|
+
"gradient": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
13
22
|
"__experimentalBorder": {
|
|
14
23
|
"radius": true,
|
|
15
24
|
"color": true,
|
|
@@ -44,6 +53,10 @@
|
|
|
44
53
|
"padding": false
|
|
45
54
|
}
|
|
46
55
|
},
|
|
56
|
+
"dimensions": {
|
|
57
|
+
"minHeight": true,
|
|
58
|
+
"minWidth": true
|
|
59
|
+
},
|
|
47
60
|
"typography": {
|
|
48
61
|
"fontSize": true,
|
|
49
62
|
"lineHeight": true,
|
package/src/gallery/README.md
CHANGED
|
@@ -42,6 +42,10 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
42
42
|
|
|
43
43
|
- [`anchor`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#anchor): `true`
|
|
44
44
|
- [`align`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#align): `true`
|
|
45
|
+
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#background):
|
|
46
|
+
- `backgroundImage`: `true`
|
|
47
|
+
- `backgroundSize`: `true`
|
|
48
|
+
- `gradient`: `true`
|
|
45
49
|
- [`html`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#html): `false`
|
|
46
50
|
- `units`: `"px"`, `"em"`, `"rem"`, `"vh"`, `"vw"`
|
|
47
51
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
@@ -52,6 +56,10 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
52
56
|
- [`text`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-text): `false`
|
|
53
57
|
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-background): `true`
|
|
54
58
|
- [`gradients`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-gradients): `true`
|
|
59
|
+
- [`shadow`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#shadow): `true`
|
|
60
|
+
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
|
|
61
|
+
- `minHeight`: `true`
|
|
62
|
+
- `minWidth`: `true`
|
|
55
63
|
- [`layout`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout):
|
|
56
64
|
- [`allowSwitching`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowswitching): `false`
|
|
57
65
|
- [`allowInheriting`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowinheriting): `false`
|
|
@@ -62,6 +70,8 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
62
70
|
- [`allowWrap`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowwrap): `false`
|
|
63
71
|
- [`allowSizingOnChildren`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowsizingonchildren): `true`
|
|
64
72
|
- [`default`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-default): `{"type":"flex"}`
|
|
73
|
+
- [`filter`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#filter):
|
|
74
|
+
- [`duotone`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#filter-duotone): `true`
|
|
65
75
|
- [`interactivity`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#interactivity):
|
|
66
76
|
- `clientNavigation`: `true`
|
|
67
77
|
- [`listView`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#listview): `true`
|
|
@@ -83,6 +93,13 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
|
|
|
83
93
|
- `fixedHeight` → attribute `fixedHeight`
|
|
84
94
|
- `navigationButtonType` → attribute `navigationButtonType`
|
|
85
95
|
|
|
96
|
+
## CSS Selectors
|
|
97
|
+
|
|
98
|
+
_Defined via the [`selectors`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) property in block.json._
|
|
99
|
+
|
|
100
|
+
- **filter**:
|
|
101
|
+
- duotone: `.wp-block-gallery :where(img)`
|
|
102
|
+
|
|
86
103
|
## Block Markup
|
|
87
104
|
|
|
88
105
|
This is a [**hybrid block**](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/). It saves static markup that the server may enhance during rendering.
|
package/src/gallery/block.json
CHANGED
|
@@ -127,6 +127,15 @@
|
|
|
127
127
|
"supports": {
|
|
128
128
|
"anchor": true,
|
|
129
129
|
"align": true,
|
|
130
|
+
"background": {
|
|
131
|
+
"backgroundImage": true,
|
|
132
|
+
"backgroundSize": true,
|
|
133
|
+
"gradient": true,
|
|
134
|
+
"__experimentalDefaultControls": {
|
|
135
|
+
"backgroundImage": true,
|
|
136
|
+
"gradient": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
130
139
|
"__experimentalBorder": {
|
|
131
140
|
"radius": true,
|
|
132
141
|
"color": true,
|
|
@@ -157,6 +166,11 @@
|
|
|
157
166
|
"background": true,
|
|
158
167
|
"gradients": true
|
|
159
168
|
},
|
|
169
|
+
"shadow": true,
|
|
170
|
+
"dimensions": {
|
|
171
|
+
"minHeight": true,
|
|
172
|
+
"minWidth": true
|
|
173
|
+
},
|
|
160
174
|
"layout": {
|
|
161
175
|
"allowSwitching": false,
|
|
162
176
|
"allowInheriting": false,
|
|
@@ -170,11 +184,19 @@
|
|
|
170
184
|
"type": "flex"
|
|
171
185
|
}
|
|
172
186
|
},
|
|
187
|
+
"filter": {
|
|
188
|
+
"duotone": true
|
|
189
|
+
},
|
|
173
190
|
"interactivity": {
|
|
174
191
|
"clientNavigation": true
|
|
175
192
|
},
|
|
176
193
|
"listView": true
|
|
177
194
|
},
|
|
195
|
+
"selectors": {
|
|
196
|
+
"filter": {
|
|
197
|
+
"duotone": ".wp-block-gallery :where(img)"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
178
200
|
"editorStyle": "wp-block-gallery-editor",
|
|
179
201
|
"style": "wp-block-gallery"
|
|
180
202
|
}
|
|
@@ -5,11 +5,8 @@ import {
|
|
|
5
5
|
Notice,
|
|
6
6
|
PanelBody,
|
|
7
7
|
Placeholder,
|
|
8
|
-
SelectControl as WCSelectControl,
|
|
9
8
|
Spinner,
|
|
10
9
|
ToolbarButton,
|
|
11
|
-
__experimentalToolsPanel as ToolsPanel,
|
|
12
|
-
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
13
10
|
__experimentalConfirmDialog as ConfirmDialog,
|
|
14
11
|
} from '@wordpress/components';
|
|
15
12
|
import {
|
|
@@ -21,52 +18,7 @@ import {
|
|
|
21
18
|
import { sharedIcon } from './shared-icon';
|
|
22
19
|
import { isGalleryFlexLayout } from './shared';
|
|
23
20
|
import { Caption } from '../utils/caption';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Ordering options for a dynamic gallery source. Each value is a composite
|
|
28
|
-
* `"orderby/order"` string mapping to the matching `/wp/v2/media` collection
|
|
29
|
-
* params. `menu_order` is deliberately omitted — it isn't a valid REST `orderby`
|
|
30
|
-
* value, so the editor preview couldn't reproduce it (see `dynamic-source.js`).
|
|
31
|
-
*/
|
|
32
|
-
const ORDER_OPTIONS = [
|
|
33
|
-
{ label: __( 'Newest to oldest' ), value: 'date/desc' },
|
|
34
|
-
{ label: __( 'Oldest to newest' ), value: 'date/asc' },
|
|
35
|
-
{
|
|
36
|
-
/* translators: Label for ordering images by title in ascending order. */
|
|
37
|
-
label: __( 'A → Z' ),
|
|
38
|
-
value: 'title/asc',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
/* translators: Label for ordering images by title in descending order. */
|
|
42
|
-
label: __( 'Z → A' ),
|
|
43
|
-
value: 'title/desc',
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* "Order by" control for a dynamic gallery, mirroring the Query Loop block's
|
|
49
|
-
* `OrderControl`: a single `SelectControl` whose value composites `orderby` and
|
|
50
|
-
* `order`, split apart again on change.
|
|
51
|
-
*
|
|
52
|
-
* @param {Object} props
|
|
53
|
-
* @param {string} props.orderby Current `orderby` value.
|
|
54
|
-
* @param {string} props.order Current `order` value (`asc`/`desc`).
|
|
55
|
-
* @param {Function} props.onChange Called with `{ orderby, order }` on change.
|
|
56
|
-
*/
|
|
57
|
-
function OrderControl( { orderby, order, onChange } ) {
|
|
58
|
-
return (
|
|
59
|
-
<WCSelectControl
|
|
60
|
-
label={ __( 'Order by' ) }
|
|
61
|
-
value={ `${ orderby }/${ order }` }
|
|
62
|
-
options={ ORDER_OPTIONS }
|
|
63
|
-
onChange={ ( value ) => {
|
|
64
|
-
const [ newOrderby, newOrder ] = value.split( '/' );
|
|
65
|
-
onChange( { orderby: newOrderby, order: newOrder } );
|
|
66
|
-
} }
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
21
|
+
import { MAX_IMAGES } from './dynamic-source';
|
|
70
22
|
|
|
71
23
|
/**
|
|
72
24
|
* Confirmation for leaving dynamic mode, shown from both the block toolbar and
|
|
@@ -101,32 +53,23 @@ function DetachGalleryDialog( { onConfirm, onCancel } ) {
|
|
|
101
53
|
/**
|
|
102
54
|
* The Gallery block's "Source" inspector panel.
|
|
103
55
|
*
|
|
104
|
-
* In dynamic mode it shows the resolved source
|
|
105
|
-
* from it
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
56
|
+
* In dynamic mode it shows the resolved source and a control to detach the
|
|
57
|
+
* gallery from it. In static mode it offers the entry point into dynamic mode.
|
|
58
|
+
* Either direction is a one-way change, so both are behind a confirmation
|
|
59
|
+
* dialog this panel owns. Rendered inside the block's `InspectorControls`,
|
|
60
|
+
* alongside the Settings panel, which owns the ordering for both modes.
|
|
109
61
|
*
|
|
110
62
|
* @param {Object} props
|
|
111
|
-
* @param {Object} props.dynamic
|
|
112
|
-
* @param {
|
|
113
|
-
* @param {boolean} props.hasImages Whether the gallery has manually-added images.
|
|
63
|
+
* @param {Object} props.dynamic The `useDynamicGallery` result.
|
|
64
|
+
* @param {boolean} props.hasImages Whether the gallery has manually-added images.
|
|
114
65
|
*/
|
|
115
|
-
export function GallerySourcePanel( {
|
|
116
|
-
dynamic,
|
|
117
|
-
dropdownMenuProps,
|
|
118
|
-
hasImages,
|
|
119
|
-
} ) {
|
|
66
|
+
export function GallerySourcePanel( { dynamic, hasImages } ) {
|
|
120
67
|
const {
|
|
121
68
|
dynamicContent,
|
|
122
69
|
canUseDynamicSource,
|
|
123
70
|
sourceDescriptor,
|
|
124
|
-
sourceOrderby,
|
|
125
|
-
sourceOrder,
|
|
126
|
-
setSourceOrder,
|
|
127
71
|
convertToStatic,
|
|
128
72
|
enableDynamicMode,
|
|
129
|
-
resetSource,
|
|
130
73
|
isResolvingDynamic,
|
|
131
74
|
hasMoreImagesThanCap,
|
|
132
75
|
dynamicMediaTotal,
|
|
@@ -149,11 +92,7 @@ export function GallerySourcePanel( {
|
|
|
149
92
|
if ( isDynamic ) {
|
|
150
93
|
return (
|
|
151
94
|
<>
|
|
152
|
-
<
|
|
153
|
-
label={ __( 'Source' ) }
|
|
154
|
-
resetAll={ resetSource }
|
|
155
|
-
dropdownMenuProps={ dropdownMenuProps }
|
|
156
|
-
>
|
|
95
|
+
<PanelBody title={ __( 'Source' ) }>
|
|
157
96
|
<div className="wp-block-gallery__source-settings">
|
|
158
97
|
<p className="wp-block-gallery__source-description">
|
|
159
98
|
{ sourceDescriptor?.description ??
|
|
@@ -188,26 +127,7 @@ export function GallerySourcePanel( {
|
|
|
188
127
|
) }
|
|
189
128
|
</Notice>
|
|
190
129
|
) }
|
|
191
|
-
|
|
192
|
-
isShownByDefault
|
|
193
|
-
label={ __( 'Order by' ) }
|
|
194
|
-
hasValue={ () =>
|
|
195
|
-
sourceOrderby !== DEFAULT_ORDERBY ||
|
|
196
|
-
sourceOrder !== DEFAULT_ORDER
|
|
197
|
-
}
|
|
198
|
-
onDeselect={ () =>
|
|
199
|
-
setSourceOrder( undefined, undefined )
|
|
200
|
-
}
|
|
201
|
-
>
|
|
202
|
-
<OrderControl
|
|
203
|
-
orderby={ sourceOrderby }
|
|
204
|
-
order={ sourceOrder }
|
|
205
|
-
onChange={ ( { orderby, order } ) =>
|
|
206
|
-
setSourceOrder( orderby, order )
|
|
207
|
-
}
|
|
208
|
-
/>
|
|
209
|
-
</ToolsPanelItem>
|
|
210
|
-
</ToolsPanel>
|
|
130
|
+
</PanelBody>
|
|
211
131
|
{ isConfirmingDetach && (
|
|
212
132
|
<DetachGalleryDialog
|
|
213
133
|
onConfirm={ () => {
|
package/src/gallery/edit.jsx
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
MediaReplaceFlow,
|
|
24
24
|
useSettings,
|
|
25
25
|
} from '@wordpress/block-editor';
|
|
26
|
-
import { useEffect, useMemo, useRef } from '@wordpress/element';
|
|
26
|
+
import { useEffect, useMemo, useRef, useState } from '@wordpress/element';
|
|
27
27
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
28
28
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
29
29
|
import { createBlock } from '@wordpress/blocks';
|
|
@@ -64,8 +64,14 @@ import useGetMedia from './use-get-media';
|
|
|
64
64
|
import GalleryStyles from './gallery-styles';
|
|
65
65
|
import useDynamicGallery from './use-dynamic-gallery';
|
|
66
66
|
import { GallerySourcePanel, GalleryDynamicView } from './dynamic-gallery';
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
67
|
+
import { SortImagesControl, SourceOrderControl } from './order-controls';
|
|
68
|
+
import {
|
|
69
|
+
getDynamicSource,
|
|
70
|
+
ATTACHED_MEDIA,
|
|
71
|
+
DEFAULT_ORDERBY,
|
|
72
|
+
DEFAULT_ORDER,
|
|
73
|
+
} from './dynamic-source';
|
|
74
|
+
import { hasSortableImages, sortImageBlocks } from './order-images';
|
|
69
75
|
import {
|
|
70
76
|
getViewportGalleryStyle,
|
|
71
77
|
getUpdatedGalleryStyle,
|
|
@@ -238,7 +244,7 @@ export default function GalleryEdit( props ) {
|
|
|
238
244
|
getSettings: _getSettings,
|
|
239
245
|
getBlock: _getBlock,
|
|
240
246
|
getSelectedBlockStyleState,
|
|
241
|
-
} =
|
|
247
|
+
} = select( blockEditorStore );
|
|
242
248
|
const multiSelectedClientIds = getMultiSelectedBlockClientIds();
|
|
243
249
|
|
|
244
250
|
return {
|
|
@@ -314,6 +320,22 @@ export default function GalleryEdit( props ) {
|
|
|
314
320
|
const hasImages = !! images.length;
|
|
315
321
|
const isDynamic = !! attributes.dynamicContent;
|
|
316
322
|
|
|
323
|
+
// The static "Order by" control shows the last sort applied from it, for as
|
|
324
|
+
// long as the images stay in the sequence that sort produced. Any other
|
|
325
|
+
// change to the images (a drag, an addition, a removal) drops it back to
|
|
326
|
+
// "Custom"; it never reports an order the user didn't choose. Nothing is
|
|
327
|
+
// stored, so this is local state rather than an attribute.
|
|
328
|
+
const [ appliedSort, setAppliedSort ] = useState( null );
|
|
329
|
+
const currentOrder =
|
|
330
|
+
appliedSort &&
|
|
331
|
+
appliedSort.clientIds.length === innerBlockImages.length &&
|
|
332
|
+
appliedSort.clientIds.every(
|
|
333
|
+
( id, index ) => innerBlockImages[ index ].clientId === id
|
|
334
|
+
)
|
|
335
|
+
? appliedSort.order
|
|
336
|
+
: null;
|
|
337
|
+
const canSortImages = hasSortableImages( innerBlockImages, imageData );
|
|
338
|
+
|
|
317
339
|
// Dynamic mode (resolving images from a source instead of inner blocks):
|
|
318
340
|
// source resolution, the editor-preview blocks, and the mode/ordering
|
|
319
341
|
// actions.
|
|
@@ -546,6 +568,49 @@ export default function GalleryEdit( props ) {
|
|
|
546
568
|
}
|
|
547
569
|
}
|
|
548
570
|
|
|
571
|
+
function selectRandomOrder() {
|
|
572
|
+
setAttributes( { randomOrder: true } );
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// Choosing any other order turns "Random" off. Called straight after the
|
|
576
|
+
// edit that applies the order, and marked non-persistent so the two writes
|
|
577
|
+
// share one undo level: a single undo restores both the order and Random.
|
|
578
|
+
function clearRandomOrderAfterEdit() {
|
|
579
|
+
if ( randomOrder ) {
|
|
580
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
581
|
+
setAttributes( { randomOrder: false } );
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// Reorders the inner image blocks in place. Left persistent on purpose so
|
|
586
|
+
// the sort is a single undoable step.
|
|
587
|
+
function sortImages( order ) {
|
|
588
|
+
const sortedBlocks = sortImageBlocks(
|
|
589
|
+
getBlock( clientId ).innerBlocks,
|
|
590
|
+
imageData,
|
|
591
|
+
order
|
|
592
|
+
);
|
|
593
|
+
replaceInnerBlocks( clientId, sortedBlocks );
|
|
594
|
+
clearRandomOrderAfterEdit();
|
|
595
|
+
setAppliedSort( {
|
|
596
|
+
order,
|
|
597
|
+
clientIds: sortedBlocks.map( ( block ) => block.clientId ),
|
|
598
|
+
} );
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// "Custom" is the order arranged in the editor: it turns Random off and
|
|
602
|
+
// forgets any sort applied earlier, so the control reads "Custom" from
|
|
603
|
+
// here on rather than that sort.
|
|
604
|
+
function selectCustomOrder() {
|
|
605
|
+
setAttributes( { randomOrder: false } );
|
|
606
|
+
setAppliedSort( null );
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
function changeSourceOrder( { orderby, order } ) {
|
|
610
|
+
dynamic.setSourceOrder( orderby, order );
|
|
611
|
+
clearRandomOrderAfterEdit();
|
|
612
|
+
}
|
|
613
|
+
|
|
549
614
|
function onUploadError( message ) {
|
|
550
615
|
createErrorNotice( message, { type: 'snackbar' } );
|
|
551
616
|
}
|
|
@@ -616,10 +681,6 @@ export default function GalleryEdit( props ) {
|
|
|
616
681
|
setGallerySettings( { imageCrop: ! activeImageCrop } );
|
|
617
682
|
}
|
|
618
683
|
|
|
619
|
-
function toggleRandomOrder() {
|
|
620
|
-
setAttributes( { randomOrder: ! randomOrder } );
|
|
621
|
-
}
|
|
622
|
-
|
|
623
684
|
function toggleOpenInNewTab( openInNewTab ) {
|
|
624
685
|
const newLinkTarget = openInNewTab ? '_blank' : undefined;
|
|
625
686
|
setAttributes( { linkTarget: newLinkTarget } );
|
|
@@ -863,7 +924,6 @@ export default function GalleryEdit( props ) {
|
|
|
863
924
|
{ ! isViewportStyleState && (
|
|
864
925
|
<GallerySourcePanel
|
|
865
926
|
dynamic={ dynamic }
|
|
866
|
-
dropdownMenuProps={ dropdownMenuProps }
|
|
867
927
|
hasImages={ hasImages }
|
|
868
928
|
/>
|
|
869
929
|
) }
|
|
@@ -890,6 +950,10 @@ export default function GalleryEdit( props ) {
|
|
|
890
950
|
|
|
891
951
|
setAspectRatio( 'auto' );
|
|
892
952
|
|
|
953
|
+
if ( isDynamic ) {
|
|
954
|
+
dynamic.setSourceOrder( undefined, undefined );
|
|
955
|
+
}
|
|
956
|
+
|
|
893
957
|
if ( sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG ) {
|
|
894
958
|
updateImagesSize( DEFAULT_MEDIA_SIZE_SLUG );
|
|
895
959
|
}
|
|
@@ -931,6 +995,56 @@ export default function GalleryEdit( props ) {
|
|
|
931
995
|
/>
|
|
932
996
|
</ToolsPanelItem>
|
|
933
997
|
) }
|
|
998
|
+
{ ! isViewportStyleState && (
|
|
999
|
+
// "Random" is stored in both modes. Beyond that, a
|
|
1000
|
+
// dynamic gallery's order is a stored query setting,
|
|
1001
|
+
// while a static gallery's orders are one-off actions.
|
|
1002
|
+
<ToolsPanelItem
|
|
1003
|
+
isShownByDefault
|
|
1004
|
+
label={ __( 'Order by' ) }
|
|
1005
|
+
hasValue={ () =>
|
|
1006
|
+
!! randomOrder ||
|
|
1007
|
+
( isDynamic &&
|
|
1008
|
+
( dynamic.sourceOrderby !==
|
|
1009
|
+
DEFAULT_ORDERBY ||
|
|
1010
|
+
dynamic.sourceOrder !==
|
|
1011
|
+
DEFAULT_ORDER ) )
|
|
1012
|
+
}
|
|
1013
|
+
onDeselect={ () => {
|
|
1014
|
+
if ( isDynamic ) {
|
|
1015
|
+
// Two writes, folded into one undo level.
|
|
1016
|
+
dynamic.setSourceOrder(
|
|
1017
|
+
undefined,
|
|
1018
|
+
undefined
|
|
1019
|
+
);
|
|
1020
|
+
clearRandomOrderAfterEdit();
|
|
1021
|
+
} else {
|
|
1022
|
+
selectCustomOrder();
|
|
1023
|
+
}
|
|
1024
|
+
} }
|
|
1025
|
+
>
|
|
1026
|
+
{ isDynamic ? (
|
|
1027
|
+
<SourceOrderControl
|
|
1028
|
+
order={ {
|
|
1029
|
+
orderby: dynamic.sourceOrderby,
|
|
1030
|
+
order: dynamic.sourceOrder,
|
|
1031
|
+
} }
|
|
1032
|
+
isRandom={ !! randomOrder }
|
|
1033
|
+
onChange={ changeSourceOrder }
|
|
1034
|
+
onSelectRandom={ selectRandomOrder }
|
|
1035
|
+
/>
|
|
1036
|
+
) : (
|
|
1037
|
+
<SortImagesControl
|
|
1038
|
+
currentOrder={ currentOrder }
|
|
1039
|
+
isRandom={ !! randomOrder }
|
|
1040
|
+
canSort={ canSortImages }
|
|
1041
|
+
onSort={ sortImages }
|
|
1042
|
+
onSelectCustom={ selectCustomOrder }
|
|
1043
|
+
onSelectRandom={ selectRandomOrder }
|
|
1044
|
+
/>
|
|
1045
|
+
) }
|
|
1046
|
+
</ToolsPanelItem>
|
|
1047
|
+
) }
|
|
934
1048
|
{ ! isViewportStyleState &&
|
|
935
1049
|
imageSizeOptions?.length > 0 && (
|
|
936
1050
|
<ToolsPanelItem
|
|
@@ -955,46 +1069,6 @@ export default function GalleryEdit( props ) {
|
|
|
955
1069
|
/>
|
|
956
1070
|
</ToolsPanelItem>
|
|
957
1071
|
) }
|
|
958
|
-
{ isFlexLayout && (
|
|
959
|
-
<ToolsPanelItem
|
|
960
|
-
isShownByDefault
|
|
961
|
-
label={ __( 'Crop images to fit' ) }
|
|
962
|
-
hasValue={ () =>
|
|
963
|
-
isViewportStyleState
|
|
964
|
-
? hasViewportImageCrop
|
|
965
|
-
: ! activeImageCrop
|
|
966
|
-
}
|
|
967
|
-
onDeselect={ () =>
|
|
968
|
-
setGallerySettings( {
|
|
969
|
-
imageCrop: isViewportStyleState
|
|
970
|
-
? undefined
|
|
971
|
-
: true,
|
|
972
|
-
} )
|
|
973
|
-
}
|
|
974
|
-
>
|
|
975
|
-
<ToggleControl
|
|
976
|
-
label={ __( 'Crop images to fit' ) }
|
|
977
|
-
checked={ activeImageCrop }
|
|
978
|
-
onChange={ toggleImageCrop }
|
|
979
|
-
/>
|
|
980
|
-
</ToolsPanelItem>
|
|
981
|
-
) }
|
|
982
|
-
{ ! isViewportStyleState && (
|
|
983
|
-
<ToolsPanelItem
|
|
984
|
-
isShownByDefault
|
|
985
|
-
label={ __( 'Randomize order' ) }
|
|
986
|
-
hasValue={ () => !! randomOrder }
|
|
987
|
-
onDeselect={ () =>
|
|
988
|
-
setAttributes( { randomOrder: false } )
|
|
989
|
-
}
|
|
990
|
-
>
|
|
991
|
-
<ToggleControl
|
|
992
|
-
label={ __( 'Randomize order' ) }
|
|
993
|
-
checked={ !! randomOrder }
|
|
994
|
-
onChange={ toggleRandomOrder }
|
|
995
|
-
/>
|
|
996
|
-
</ToolsPanelItem>
|
|
997
|
-
) }
|
|
998
1072
|
{ ! isViewportStyleState && hasLinkTo && (
|
|
999
1073
|
<ToolsPanelItem
|
|
1000
1074
|
isShownByDefault
|
|
@@ -1038,6 +1112,30 @@ export default function GalleryEdit( props ) {
|
|
|
1038
1112
|
/>
|
|
1039
1113
|
</ToolsPanelItem>
|
|
1040
1114
|
) }
|
|
1115
|
+
{ isFlexLayout && (
|
|
1116
|
+
<ToolsPanelItem
|
|
1117
|
+
isShownByDefault
|
|
1118
|
+
label={ __( 'Crop images to fit' ) }
|
|
1119
|
+
hasValue={ () =>
|
|
1120
|
+
isViewportStyleState
|
|
1121
|
+
? hasViewportImageCrop
|
|
1122
|
+
: ! activeImageCrop
|
|
1123
|
+
}
|
|
1124
|
+
onDeselect={ () =>
|
|
1125
|
+
setGallerySettings( {
|
|
1126
|
+
imageCrop: isViewportStyleState
|
|
1127
|
+
? undefined
|
|
1128
|
+
: true,
|
|
1129
|
+
} )
|
|
1130
|
+
}
|
|
1131
|
+
>
|
|
1132
|
+
<ToggleControl
|
|
1133
|
+
label={ __( 'Crop images to fit' ) }
|
|
1134
|
+
checked={ activeImageCrop }
|
|
1135
|
+
onChange={ toggleImageCrop }
|
|
1136
|
+
/>
|
|
1137
|
+
</ToolsPanelItem>
|
|
1138
|
+
) }
|
|
1041
1139
|
{ ! isViewportStyleState &&
|
|
1042
1140
|
lightboxSetting?.allowEditing &&
|
|
1043
1141
|
hasLightboxImages && (
|
package/src/gallery/editor.scss
CHANGED
|
@@ -125,12 +125,9 @@
|
|
|
125
125
|
gap: $grid-unit-15;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
// The Source controls
|
|
129
|
-
//
|
|
130
|
-
// button so the button is the last element, keeping the same vertical rhythm to
|
|
131
|
-
// the next control (control -> grid row-gap -> next label) as the other rows.
|
|
128
|
+
// The Source panel's controls: a description above a full-width action button,
|
|
129
|
+
// stacked inside a PanelBody.
|
|
132
130
|
.wp-block-gallery__source-settings {
|
|
133
|
-
grid-column: 1 / -1;
|
|
134
131
|
display: flex;
|
|
135
132
|
flex-direction: column;
|
|
136
133
|
gap: $grid-unit-10;
|
|
@@ -150,9 +147,8 @@
|
|
|
150
147
|
}
|
|
151
148
|
}
|
|
152
149
|
|
|
153
|
-
// The "showing the first N" notice
|
|
154
|
-
//
|
|
150
|
+
// The "showing the first N" notice follows the Source controls in the same
|
|
151
|
+
// PanelBody, which adds no spacing of its own between children.
|
|
155
152
|
.wp-block-gallery__source-notice {
|
|
156
|
-
grid-
|
|
157
|
-
margin: 0;
|
|
153
|
+
margin: $grid-unit-20 0 0;
|
|
158
154
|
}
|