@wordpress/block-library 10.1.0 → 10.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 +18 -0
- package/build/accordion/block.json +1 -0
- package/build/accordion/edit.cjs +0 -1
- package/build/accordion/edit.cjs.map +2 -2
- package/build/accordion/view.cjs +23 -0
- package/build/accordion/view.cjs.map +2 -2
- package/build/accordion-heading/deprecated.cjs +121 -1
- package/build/accordion-heading/deprecated.cjs.map +2 -2
- package/build/accordion-heading/edit.cjs +18 -1
- package/build/accordion-heading/edit.cjs.map +3 -3
- package/build/accordion-heading/save.cjs +18 -1
- package/build/accordion-heading/save.cjs.map +3 -3
- package/build/accordion-panel/edit.cjs +1 -1
- package/build/accordion-panel/edit.cjs.map +2 -2
- package/build/archives/edit.cjs +0 -1
- package/build/archives/edit.cjs.map +2 -2
- package/build/audio/edit.cjs +0 -1
- package/build/audio/edit.cjs.map +2 -2
- package/build/avatar/edit.cjs +0 -1
- package/build/avatar/edit.cjs.map +2 -2
- package/build/avatar/user-control.cjs +0 -1
- package/build/avatar/user-control.cjs.map +2 -2
- package/build/button/edit.cjs +18 -8
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs +0 -1
- package/build/categories/edit.cjs.map +2 -2
- package/build/code/transforms.cjs +5 -3
- package/build/code/transforms.cjs.map +2 -2
- package/build/column/edit.cjs +0 -1
- package/build/column/edit.cjs.map +2 -2
- package/build/columns/edit.cjs +0 -1
- package/build/columns/edit.cjs.map +2 -2
- package/build/columns/transforms.cjs +9 -2
- package/build/columns/transforms.cjs.map +2 -2
- package/build/comment-author-avatar/edit.cjs +0 -1
- package/build/comment-author-avatar/edit.cjs.map +2 -2
- package/build/comments-pagination/comments-pagination-arrow-controls.cjs +0 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.cjs.map +2 -2
- package/build/cover/block.json +11 -0
- package/build/cover/edit/block-controls.cjs +11 -4
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/embed-video-url-input.cjs +5 -3
- package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
- package/build/cover/edit/index.cjs +1 -1
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +1 -3
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/cover/embed-video-utils.cjs +17 -7
- package/build/cover/embed-video-utils.cjs.map +2 -2
- package/build/details/transforms.cjs +1 -1
- package/build/details/transforms.cjs.map +2 -2
- package/build/embed/edit.cjs +2 -3
- package/build/embed/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +20 -21
- package/build/embed/embed-placeholder.cjs.map +3 -3
- package/build/file/edit.cjs +4 -3
- package/build/file/edit.cjs.map +2 -2
- package/build/file/inspector.cjs +0 -2
- package/build/file/inspector.cjs.map +2 -2
- package/build/file/transforms.cjs +25 -60
- package/build/file/transforms.cjs.map +2 -2
- package/build/form/edit.cjs +0 -2
- package/build/form/edit.cjs.map +2 -2
- package/build/freeform/convert-to-blocks-button.cjs +52 -0
- package/build/freeform/convert-to-blocks-button.cjs.map +7 -0
- package/build/freeform/edit.cjs +14 -33
- package/build/freeform/edit.cjs.map +3 -3
- package/build/freeform/index.cjs +1 -7
- package/build/freeform/index.cjs.map +3 -3
- package/build/gallery/block.json +8 -3
- package/build/gallery/dynamic-gallery.cjs +263 -0
- package/build/gallery/dynamic-gallery.cjs.map +7 -0
- package/build/gallery/dynamic-source.cjs +85 -0
- package/build/gallery/dynamic-source.cjs.map +7 -0
- package/build/gallery/edit.cjs +286 -206
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/gallery.cjs +0 -3
- package/build/gallery/gallery.cjs.map +2 -2
- package/build/gallery/gap-styles.cjs +49 -13
- package/build/gallery/gap-styles.cjs.map +3 -3
- package/build/gallery/index.cjs +2 -0
- package/build/gallery/index.cjs.map +3 -3
- package/build/gallery/save.cjs +16 -12
- package/build/gallery/save.cjs.map +2 -2
- package/build/gallery/use-dynamic-gallery.cjs +181 -0
- package/build/gallery/use-dynamic-gallery.cjs.map +7 -0
- package/build/gallery/variations.cjs +54 -0
- package/build/gallery/variations.cjs.map +7 -0
- package/build/group/edit.cjs +1 -2
- package/build/group/edit.cjs.map +2 -2
- package/build/group/transforms.cjs +3 -7
- package/build/group/transforms.cjs.map +2 -2
- package/build/heading/edit.cjs +10 -3
- package/build/heading/edit.cjs.map +2 -2
- package/build/html/block.json +2 -2
- package/build/html/edit.cjs +65 -23
- package/build/html/edit.cjs.map +3 -3
- package/build/html/index.cjs +3 -3
- package/build/html/index.cjs.map +2 -2
- package/build/html/modal.cjs +4 -8
- package/build/html/modal.cjs.map +2 -2
- package/build/html/save.cjs +2 -4
- package/build/html/save.cjs.map +2 -2
- package/build/html/transforms.cjs +7 -5
- package/build/html/transforms.cjs.map +2 -2
- package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
- package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
- package/build/icon/components/custom-inserter/index.cjs +100 -31
- package/build/icon/components/custom-inserter/index.cjs.map +3 -3
- package/build/icon/edit.cjs +11 -12
- package/build/icon/edit.cjs.map +2 -2
- package/build/image/block.json +1 -1
- package/build/image/image.cjs +23 -70
- package/build/image/image.cjs.map +3 -3
- package/build/image/transforms.cjs +78 -0
- package/build/image/transforms.cjs.map +3 -3
- package/build/index.cjs +18 -8
- package/build/index.cjs.map +2 -2
- package/build/latest-comments/edit.cjs +0 -2
- package/build/latest-comments/edit.cjs.map +2 -2
- package/build/latest-posts/block.json +8 -9
- package/build/latest-posts/constants.cjs +0 -3
- package/build/latest-posts/constants.cjs.map +2 -2
- package/build/latest-posts/deprecated.cjs +100 -8
- package/build/latest-posts/deprecated.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +67 -84
- package/build/latest-posts/edit.cjs.map +2 -2
- package/build/list/ordered-list-settings.cjs +0 -1
- package/build/list/ordered-list-settings.cjs.map +2 -2
- package/build/list-item/edit.cjs +1 -1
- package/build/list-item/edit.cjs.map +2 -2
- package/build/list-item/hooks/use-enter.cjs +14 -17
- package/build/list-item/hooks/use-enter.cjs.map +3 -3
- package/build/list-item/hooks/use-space.cjs +3 -2
- package/build/list-item/hooks/use-space.cjs.map +3 -3
- package/build/media-text/edit.cjs +0 -1
- package/build/media-text/edit.cjs.map +2 -2
- package/build/missing/edit.cjs +1 -3
- package/build/missing/edit.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +0 -1
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/overlay-menu-preview-controls.cjs +0 -1
- package/build/navigation/edit/overlay-menu-preview-controls.cjs.map +2 -2
- package/build/navigation/edit/overlay-menu-preview.cjs +0 -1
- package/build/navigation/edit/overlay-menu-preview.cjs.map +2 -2
- package/build/navigation/edit/overlay-template-part-selector.cjs +0 -1
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
- package/build/navigation/edit/overlay-visibility-control.cjs +0 -1
- package/build/navigation/edit/overlay-visibility-control.cjs.map +2 -2
- package/build/navigation-link/shared/use-link-preview.cjs +11 -1
- package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
- package/build/navigation-overlay-close/edit.cjs +0 -1
- package/build/navigation-overlay-close/edit.cjs.map +2 -2
- package/build/page-list/edit.cjs +0 -1
- package/build/page-list/edit.cjs.map +2 -2
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/use-enter.cjs +3 -7
- package/build/paragraph/use-enter.cjs.map +3 -3
- package/build/playlist/block.json +28 -15
- package/build/playlist/context.cjs +36 -0
- package/build/playlist/context.cjs.map +7 -0
- package/build/playlist/edit.cjs +257 -81
- package/build/playlist/edit.cjs.map +3 -3
- package/build/playlist/index.cjs +1 -1
- package/build/playlist/index.cjs.map +2 -2
- package/build/playlist/utils.cjs +19 -8
- package/build/playlist/utils.cjs.map +3 -3
- package/build/playlist/view.cjs +87 -17
- package/build/playlist/view.cjs.map +2 -2
- package/build/playlist-track/block.json +4 -5
- package/build/playlist-track/edit.cjs +114 -70
- package/build/playlist-track/edit.cjs.map +3 -3
- package/build/post-author/edit.cjs +0 -2
- package/build/post-author/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-excerpt/edit.cjs +0 -1
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/overlay-controls.cjs +1 -2
- package/build/post-featured-image/overlay-controls.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs +0 -2
- package/build/post-navigation-link/edit.cjs.map +2 -2
- package/build/post-template/block.json +2 -1
- package/build/post-template/edit.cjs +10 -1
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +3 -1
- package/build/query/block.json +3 -2
- package/build/query/edit/inspector-controls/author-control.cjs +1 -2
- package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/format-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs +38 -7
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/inspector-controls/offset-controls.cjs +0 -1
- package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/order-control.cjs +0 -1
- package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
- package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/parent-control.cjs +0 -1
- package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/per-page-control.cjs +0 -1
- package/build/query/edit/inspector-controls/per-page-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/sticky-control.cjs +0 -1
- package/build/query/edit/inspector-controls/sticky-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
- package/build/query/edit/query-content.cjs +10 -3
- package/build/query/edit/query-content.cjs.map +2 -2
- package/build/query/index.cjs +2 -1
- package/build/query/index.cjs.map +2 -2
- package/build/query-pagination/query-pagination-arrow-controls.cjs +0 -1
- package/build/query-pagination/query-pagination-arrow-controls.cjs.map +2 -2
- package/build/query-pagination-numbers/edit.cjs +0 -1
- package/build/query-pagination-numbers/edit.cjs.map +2 -2
- package/build/quote/block.json +3 -1
- package/build/quote/transforms.cjs +1 -7
- package/build/quote/transforms.cjs.map +2 -2
- package/build/rss/edit.cjs +0 -4
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/edit.cjs +0 -4
- package/build/search/edit.cjs.map +2 -2
- package/build/separator/edit.cjs +1 -2
- package/build/separator/edit.cjs.map +2 -2
- package/build/site-logo/edit.cjs +34 -63
- package/build/site-logo/edit.cjs.map +3 -3
- package/build/social-links/edit.cjs +0 -1
- package/build/social-links/edit.cjs.map +2 -2
- package/build/spacer/controls.cjs +2 -4
- package/build/spacer/controls.cjs.map +2 -2
- package/build/spacer/edit.cjs +1 -2
- package/build/spacer/edit.cjs.map +2 -2
- package/build/tab-list/block.json +5 -4
- package/build/tab-list/edit.cjs +95 -54
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/save.cjs +4 -3
- package/build/tab-list/save.cjs.map +2 -2
- package/build/tab-panel/block.json +1 -6
- package/build/tab-panel/controls.cjs +2 -4
- package/build/tab-panel/controls.cjs.map +3 -3
- package/build/tab-panel/edit.cjs +15 -15
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tab-panels/block.json +0 -1
- package/build/tab-panels/edit.cjs +2 -4
- package/build/tab-panels/edit.cjs.map +3 -3
- package/build/table-of-contents/edit.cjs +0 -1
- package/build/table-of-contents/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -5
- package/build/tabs/edit.cjs +6 -41
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/tab-toolbar-controls.cjs +74 -0
- package/build/tabs/tab-toolbar-controls.cjs.map +7 -0
- package/build/tabs/use-tab-actions.cjs +87 -0
- package/build/tabs/use-tab-actions.cjs.map +7 -0
- package/build/tabs/use-tab-list-items-sync.cjs +23 -5
- package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
- package/build/tag-cloud/edit.cjs +2 -6
- package/build/tag-cloud/edit.cjs.map +2 -2
- package/build/template-part/edit/advanced-controls.cjs +0 -1
- package/build/template-part/edit/advanced-controls.cjs.map +2 -2
- package/build/template-part/edit/import-controls.cjs +1 -2
- package/build/template-part/edit/import-controls.cjs.map +2 -2
- package/build/term-name/block.json +1 -3
- package/build/term-name/deprecated.cjs +105 -0
- package/build/term-name/deprecated.cjs.map +7 -0
- package/build/term-name/edit.cjs +11 -37
- package/build/term-name/edit.cjs.map +3 -3
- package/build/term-name/index.cjs +3 -1
- package/build/term-name/index.cjs.map +3 -3
- package/build/terms-query/edit/inspector-controls/include-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/max-terms-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/max-terms-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +2 -2
- package/build/text-columns/edit.cjs +0 -1
- package/build/text-columns/edit.cjs.map +2 -2
- package/build/utils/waveform-player.cjs +138 -22
- package/build/utils/waveform-player.cjs.map +2 -2
- package/build/utils/waveform-utils.cjs +315 -17
- package/build/utils/waveform-utils.cjs.map +2 -2
- package/build/verse/block.json +3 -1
- package/build/video/block.json +6 -0
- package/build/video/edit-common-settings.cjs +0 -1
- package/build/video/edit-common-settings.cjs.map +2 -2
- package/build/video/edit.cjs +17 -1
- package/build/video/edit.cjs.map +2 -2
- package/build/video/index.cjs +2 -0
- package/build/video/index.cjs.map +3 -3
- package/build/video/save.cjs +7 -1
- package/build/video/save.cjs.map +2 -2
- package/build/video/tracks-editor.cjs +0 -1
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build/video/variations.cjs +75 -0
- package/build/video/variations.cjs.map +7 -0
- package/build-module/accordion/block.json +1 -0
- package/build-module/accordion/edit.mjs +0 -1
- package/build-module/accordion/edit.mjs.map +2 -2
- package/build-module/accordion/view.mjs +23 -0
- package/build-module/accordion/view.mjs.map +2 -2
- package/build-module/accordion-heading/deprecated.mjs +121 -1
- package/build-module/accordion-heading/deprecated.mjs.map +2 -2
- package/build-module/accordion-heading/edit.mjs +8 -1
- package/build-module/accordion-heading/edit.mjs.map +2 -2
- package/build-module/accordion-heading/save.mjs +8 -1
- package/build-module/accordion-heading/save.mjs.map +2 -2
- package/build-module/accordion-panel/edit.mjs +1 -1
- package/build-module/accordion-panel/edit.mjs.map +2 -2
- package/build-module/archives/edit.mjs +0 -1
- package/build-module/archives/edit.mjs.map +2 -2
- package/build-module/audio/edit.mjs +0 -1
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/avatar/edit.mjs +0 -1
- package/build-module/avatar/edit.mjs.map +2 -2
- package/build-module/avatar/user-control.mjs +0 -1
- package/build-module/avatar/user-control.mjs.map +2 -2
- package/build-module/button/edit.mjs +19 -14
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +0 -1
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/code/transforms.mjs +6 -4
- package/build-module/code/transforms.mjs.map +2 -2
- package/build-module/column/edit.mjs +0 -1
- package/build-module/column/edit.mjs.map +2 -2
- package/build-module/columns/edit.mjs +0 -1
- package/build-module/columns/edit.mjs.map +2 -2
- package/build-module/columns/transforms.mjs +9 -2
- package/build-module/columns/transforms.mjs.map +2 -2
- package/build-module/comment-author-avatar/edit.mjs +0 -1
- package/build-module/comment-author-avatar/edit.mjs.map +2 -2
- package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs +0 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs.map +2 -2
- package/build-module/cover/block.json +11 -0
- package/build-module/cover/edit/block-controls.mjs +11 -4
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
- package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +1 -1
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +1 -3
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/cover/embed-video-utils.mjs +16 -7
- package/build-module/cover/embed-video-utils.mjs.map +2 -2
- package/build-module/details/transforms.mjs +2 -2
- package/build-module/details/transforms.mjs.map +2 -2
- package/build-module/embed/edit.mjs +2 -3
- package/build-module/embed/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +20 -24
- package/build-module/embed/embed-placeholder.mjs.map +2 -2
- package/build-module/file/edit.mjs +4 -3
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/inspector.mjs +0 -2
- package/build-module/file/inspector.mjs.map +2 -2
- package/build-module/file/transforms.mjs +25 -60
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/form/edit.mjs +0 -2
- package/build-module/form/edit.mjs.map +2 -2
- package/build-module/freeform/convert-to-blocks-button.mjs +31 -0
- package/build-module/freeform/convert-to-blocks-button.mjs.map +7 -0
- package/build-module/freeform/edit.mjs +15 -34
- package/build-module/freeform/edit.mjs.map +2 -2
- package/build-module/freeform/index.mjs +1 -7
- package/build-module/freeform/index.mjs.map +2 -2
- package/build-module/gallery/block.json +8 -3
- package/build-module/gallery/dynamic-gallery.mjs +253 -0
- package/build-module/gallery/dynamic-gallery.mjs.map +7 -0
- package/build-module/gallery/dynamic-source.mjs +55 -0
- package/build-module/gallery/dynamic-source.mjs.map +7 -0
- package/build-module/gallery/edit.mjs +291 -209
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/gallery.mjs +0 -3
- package/build-module/gallery/gallery.mjs.map +2 -2
- package/build-module/gallery/gap-styles.mjs +53 -14
- package/build-module/gallery/gap-styles.mjs.map +2 -2
- package/build-module/gallery/index.mjs +2 -0
- package/build-module/gallery/index.mjs.map +2 -2
- package/build-module/gallery/save.mjs +16 -12
- package/build-module/gallery/save.mjs.map +2 -2
- package/build-module/gallery/use-dynamic-gallery.mjs +167 -0
- package/build-module/gallery/use-dynamic-gallery.mjs.map +7 -0
- package/build-module/gallery/variations.mjs +33 -0
- package/build-module/gallery/variations.mjs.map +7 -0
- package/build-module/group/edit.mjs +1 -2
- package/build-module/group/edit.mjs.map +2 -2
- package/build-module/group/transforms.mjs +4 -8
- package/build-module/group/transforms.mjs.map +2 -2
- package/build-module/heading/edit.mjs +11 -4
- package/build-module/heading/edit.mjs.map +2 -2
- package/build-module/html/block.json +2 -2
- package/build-module/html/edit.mjs +69 -25
- package/build-module/html/edit.mjs.map +2 -2
- package/build-module/html/index.mjs +3 -3
- package/build-module/html/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +4 -8
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/html/save.mjs +2 -4
- package/build-module/html/save.mjs.map +2 -2
- package/build-module/html/transforms.mjs +8 -6
- package/build-module/html/transforms.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
- package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/index.mjs +102 -33
- package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
- package/build-module/icon/edit.mjs +11 -12
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/image/block.json +1 -1
- package/build-module/image/image.mjs +23 -71
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/transforms.mjs +78 -0
- package/build-module/image/transforms.mjs.map +2 -2
- package/build-module/index.mjs +18 -8
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-comments/edit.mjs +0 -2
- package/build-module/latest-comments/edit.mjs.map +2 -2
- package/build-module/latest-posts/block.json +8 -9
- package/build-module/latest-posts/constants.mjs +0 -2
- package/build-module/latest-posts/constants.mjs.map +2 -2
- package/build-module/latest-posts/deprecated.mjs +100 -8
- package/build-module/latest-posts/deprecated.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +67 -85
- package/build-module/latest-posts/edit.mjs.map +2 -2
- package/build-module/list/ordered-list-settings.mjs +0 -1
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- package/build-module/list-item/edit.mjs +1 -1
- package/build-module/list-item/edit.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs +15 -21
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/list-item/hooks/use-space.mjs +4 -6
- package/build-module/list-item/hooks/use-space.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +0 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/missing/edit.mjs +1 -3
- package/build-module/missing/edit.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +0 -1
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-menu-preview-controls.mjs +0 -1
- package/build-module/navigation/edit/overlay-menu-preview-controls.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-menu-preview.mjs +0 -1
- package/build-module/navigation/edit/overlay-menu-preview.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +0 -1
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-visibility-control.mjs +0 -1
- package/build-module/navigation/edit/overlay-visibility-control.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-link-preview.mjs +11 -1
- package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
- package/build-module/navigation-overlay-close/edit.mjs +0 -1
- package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
- package/build-module/page-list/edit.mjs +0 -1
- package/build-module/page-list/edit.mjs.map +2 -2
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/use-enter.mjs +4 -11
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/playlist/block.json +28 -15
- package/build-module/playlist/context.mjs +11 -0
- package/build-module/playlist/context.mjs.map +7 -0
- package/build-module/playlist/edit.mjs +262 -84
- package/build-module/playlist/edit.mjs.map +2 -2
- package/build-module/playlist/index.mjs +1 -1
- package/build-module/playlist/index.mjs.map +2 -2
- package/build-module/playlist/utils.mjs +17 -7
- package/build-module/playlist/utils.mjs.map +2 -2
- package/build-module/playlist/view.mjs +93 -18
- package/build-module/playlist/view.mjs.map +2 -2
- package/build-module/playlist-track/block.json +4 -5
- package/build-module/playlist-track/edit.mjs +117 -72
- package/build-module/playlist-track/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +0 -2
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-excerpt/edit.mjs +0 -1
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/overlay-controls.mjs +1 -2
- package/build-module/post-featured-image/overlay-controls.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +0 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-template/block.json +2 -1
- package/build-module/post-template/edit.mjs +10 -1
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +3 -1
- package/build-module/query/block.json +3 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs +1 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +40 -8
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/offset-controls.mjs +0 -1
- package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/per-page-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/per-page-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
- package/build-module/query/edit/query-content.mjs +10 -3
- package/build-module/query/edit/query-content.mjs.map +2 -2
- package/build-module/query/index.mjs +2 -1
- package/build-module/query/index.mjs.map +2 -2
- package/build-module/query-pagination/query-pagination-arrow-controls.mjs +0 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.mjs.map +2 -2
- package/build-module/query-pagination-numbers/edit.mjs +0 -1
- package/build-module/query-pagination-numbers/edit.mjs.map +2 -2
- package/build-module/quote/block.json +3 -1
- package/build-module/quote/transforms.mjs +6 -8
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/rss/edit.mjs +0 -4
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/edit.mjs +0 -4
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/separator/edit.mjs +1 -2
- package/build-module/separator/edit.mjs.map +2 -2
- package/build-module/site-logo/edit.mjs +34 -64
- package/build-module/site-logo/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +0 -1
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/spacer/controls.mjs +2 -4
- package/build-module/spacer/controls.mjs.map +2 -2
- package/build-module/spacer/edit.mjs +1 -2
- package/build-module/spacer/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +5 -4
- package/build-module/tab-list/edit.mjs +102 -56
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/save.mjs +5 -3
- package/build-module/tab-list/save.mjs.map +2 -2
- package/build-module/tab-panel/block.json +1 -6
- package/build-module/tab-panel/controls.mjs +2 -4
- package/build-module/tab-panel/controls.mjs.map +2 -2
- package/build-module/tab-panel/edit.mjs +16 -16
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panels/block.json +0 -1
- package/build-module/tab-panels/edit.mjs +2 -4
- package/build-module/tab-panels/edit.mjs.map +2 -2
- package/build-module/table-of-contents/edit.mjs +0 -1
- package/build-module/table-of-contents/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -5
- package/build-module/tabs/edit.mjs +7 -47
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/tab-toolbar-controls.mjs +46 -0
- package/build-module/tabs/tab-toolbar-controls.mjs.map +7 -0
- package/build-module/tabs/use-tab-actions.mjs +66 -0
- package/build-module/tabs/use-tab-actions.mjs.map +7 -0
- package/build-module/tabs/use-tab-list-items-sync.mjs +25 -7
- package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
- package/build-module/tag-cloud/edit.mjs +2 -6
- package/build-module/tag-cloud/edit.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +0 -1
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/import-controls.mjs +1 -2
- package/build-module/template-part/edit/import-controls.mjs.map +2 -2
- package/build-module/term-name/block.json +1 -3
- package/build-module/term-name/deprecated.mjs +74 -0
- package/build-module/term-name/deprecated.mjs.map +7 -0
- package/build-module/term-name/edit.mjs +11 -28
- package/build-module/term-name/edit.mjs.map +2 -2
- package/build-module/term-name/index.mjs +3 -1
- package/build-module/term-name/index.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
- package/build-module/text-columns/edit.mjs +0 -1
- package/build-module/text-columns/edit.mjs.map +2 -2
- package/build-module/utils/waveform-player.mjs +144 -23
- package/build-module/utils/waveform-player.mjs.map +2 -2
- package/build-module/utils/waveform-utils.mjs +310 -16
- package/build-module/utils/waveform-utils.mjs.map +2 -2
- package/build-module/verse/block.json +3 -1
- package/build-module/video/block.json +6 -0
- package/build-module/video/edit-common-settings.mjs +0 -1
- package/build-module/video/edit-common-settings.mjs.map +2 -2
- package/build-module/video/edit.mjs +17 -1
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/index.mjs +2 -0
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/save.mjs +7 -1
- package/build-module/video/save.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +0 -1
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-module/video/variations.mjs +50 -0
- package/build-module/video/variations.mjs.map +7 -0
- package/build-style/accordion-panel/style-rtl.css +1 -2
- package/build-style/accordion-panel/style.css +1 -2
- package/build-style/audio/style-rtl.css +6 -0
- package/build-style/audio/style.css +6 -0
- package/build-style/audio/theme-rtl.css +6 -0
- package/build-style/audio/theme.css +6 -0
- package/build-style/columns/style-rtl.css +6 -0
- package/build-style/columns/style.css +6 -0
- package/build-style/common-rtl.css +6 -4
- package/build-style/common.css +6 -4
- package/build-style/editor-rtl.css +84 -24
- package/build-style/editor.css +84 -24
- package/build-style/embed/style-rtl.css +6 -0
- package/build-style/embed/style.css +6 -0
- package/build-style/embed/theme-rtl.css +6 -0
- package/build-style/embed/theme.css +6 -0
- package/build-style/freeform/editor-rtl.css +6 -0
- package/build-style/freeform/editor.css +6 -0
- package/build-style/gallery/editor-rtl.css +27 -3
- package/build-style/gallery/editor.css +27 -3
- package/build-style/gallery/style-rtl.css +6 -0
- package/build-style/gallery/style.css +6 -0
- package/build-style/gallery/theme-rtl.css +6 -0
- package/build-style/gallery/theme.css +6 -0
- package/build-style/html/editor-rtl.css +13 -0
- package/build-style/html/editor.css +13 -0
- package/build-style/icon/editor-rtl.css +80 -7
- package/build-style/icon/editor.css +80 -7
- package/build-style/image/editor-rtl.css +10 -0
- package/build-style/image/editor.css +10 -0
- package/build-style/image/style-rtl.css +6 -1
- package/build-style/image/style.css +6 -1
- package/build-style/image/theme-rtl.css +6 -0
- package/build-style/image/theme.css +6 -0
- package/build-style/latest-posts/style-rtl.css +26 -15
- package/build-style/latest-posts/style.css +26 -15
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +9 -4
- package/build-style/navigation/editor.css +9 -4
- package/build-style/navigation/style-rtl.css +6 -0
- package/build-style/navigation/style.css +6 -0
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/navigation-submenu/editor-rtl.css +6 -0
- package/build-style/navigation-submenu/editor.css +6 -0
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/page-list/editor-rtl.css +6 -0
- package/build-style/page-list/editor.css +6 -0
- package/build-style/playlist/editor-rtl.css +6 -0
- package/build-style/playlist/editor.css +6 -0
- package/build-style/playlist/style-rtl.css +158 -20
- package/build-style/playlist/style.css +158 -20
- package/build-style/playlist-track/style-rtl.css +10 -0
- package/build-style/playlist-track/style.css +10 -0
- package/build-style/post-template/style-rtl.css +6 -0
- package/build-style/post-template/style.css +6 -0
- package/build-style/query/editor-rtl.css +6 -0
- package/build-style/query/editor.css +6 -0
- package/build-style/rss/style-rtl.css +6 -0
- package/build-style/rss/style.css +6 -0
- package/build-style/shortcode/editor-rtl.css +6 -0
- package/build-style/shortcode/editor.css +6 -0
- package/build-style/style-rtl.css +192 -39
- package/build-style/style.css +192 -39
- package/build-style/table/editor-rtl.css +6 -0
- package/build-style/table/editor.css +6 -0
- package/build-style/table/theme-rtl.css +6 -0
- package/build-style/table/theme.css +6 -0
- package/build-style/template-part/editor-rtl.css +6 -0
- package/build-style/template-part/editor.css +6 -0
- package/build-style/theme-rtl.css +6 -0
- package/build-style/theme.css +6 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/build-style/video/style-rtl.css +6 -0
- package/build-style/video/style.css +6 -0
- package/build-style/video/theme-rtl.css +6 -0
- package/build-style/video/theme.css +6 -0
- package/build-types/table-of-contents/list.d.ts +1 -1
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +48 -44
- package/src/accordion/README.md +2 -1
- package/src/accordion/block.json +1 -0
- package/src/accordion/edit.js +0 -1
- package/src/accordion/view.js +24 -0
- package/src/accordion-heading/README.md +1 -1
- package/src/accordion-heading/deprecated.js +122 -1
- package/src/accordion-heading/edit.js +12 -1
- package/src/accordion-heading/save.js +12 -1
- package/src/accordion-item/README.md +1 -1
- package/src/accordion-item/index.php +2 -1
- package/src/accordion-panel/edit.js +1 -1
- package/src/accordion-panel/style.scss +1 -4
- package/src/archives/edit.js +0 -1
- package/src/audio/edit.js +0 -1
- package/src/avatar/edit.js +0 -1
- package/src/avatar/user-control.js +0 -1
- package/src/button/edit.js +21 -15
- package/src/categories/edit.js +0 -1
- package/src/code/transforms.js +6 -4
- package/src/column/edit.js +0 -1
- package/src/columns/edit.js +0 -1
- package/src/columns/transforms.js +9 -2
- package/src/comment-author-avatar/edit.js +0 -1
- package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -1
- package/src/common.scss +0 -4
- package/src/cover/README.md +60 -0
- package/src/cover/block.json +11 -0
- package/src/cover/edit/block-controls.js +21 -11
- package/src/cover/edit/embed-video-url-input.js +5 -4
- package/src/cover/edit/index.js +9 -11
- package/src/cover/edit/inspector-controls.js +0 -2
- package/src/cover/embed-video-utils.js +38 -13
- package/src/cover/test/edit.js +4 -4
- package/src/details/transforms.js +2 -2
- package/src/embed/edit.js +4 -5
- package/src/embed/embed-placeholder.js +16 -20
- package/src/file/edit.js +8 -8
- package/src/file/inspector.js +0 -2
- package/src/file/transforms.js +28 -60
- package/src/form/edit.js +0 -2
- package/src/freeform/convert-to-blocks-button.js +33 -0
- package/src/freeform/edit.js +11 -21
- package/src/freeform/index.js +1 -9
- package/src/gallery/README.md +4 -1
- package/src/gallery/block.json +8 -3
- package/src/gallery/dynamic-gallery.js +384 -0
- package/src/gallery/dynamic-source.js +117 -0
- package/src/gallery/edit.js +155 -49
- package/src/gallery/editor.scss +32 -4
- package/src/gallery/gallery.js +0 -7
- package/src/gallery/gap-styles.js +79 -20
- package/src/gallery/index.js +2 -0
- package/src/gallery/index.php +379 -42
- package/src/gallery/save.js +22 -11
- package/src/gallery/test/dynamic-source.js +90 -0
- package/src/gallery/use-dynamic-gallery.js +275 -0
- package/src/gallery/variations.js +37 -0
- package/src/group/edit.js +2 -3
- package/src/group/transforms.js +4 -8
- package/src/heading/edit.js +19 -14
- package/src/home-link/index.php +1 -1
- package/src/html/README.md +2 -1
- package/src/html/block.json +2 -2
- package/src/html/edit.js +86 -14
- package/src/html/editor.scss +10 -0
- package/src/html/index.js +3 -4
- package/src/html/modal.js +5 -9
- package/src/html/save.js +4 -7
- package/src/html/test/index.js +143 -0
- package/src/html/transforms.js +11 -6
- package/src/icon/components/custom-inserter/icon-grid.js +40 -11
- package/src/icon/components/custom-inserter/index.js +98 -25
- package/src/icon/edit.js +11 -17
- package/src/icon/editor.scss +33 -8
- package/src/icon/index.php +38 -45
- package/src/image/README.md +1 -1
- package/src/image/block.json +1 -1
- package/src/image/editor.scss +11 -0
- package/src/image/image.js +105 -169
- package/src/image/style.scss +0 -1
- package/src/image/test/use-open-image-media-editor-modal.js +19 -4
- package/src/image/transforms.js +128 -0
- package/src/index.js +19 -9
- package/src/latest-comments/edit.js +0 -2
- package/src/latest-posts/README.md +2 -2
- package/src/latest-posts/block.json +8 -9
- package/src/latest-posts/constants.js +0 -1
- package/src/latest-posts/deprecated.js +112 -9
- package/src/latest-posts/edit.js +38 -53
- package/src/latest-posts/index.php +60 -19
- package/src/latest-posts/style.scss +12 -2
- package/src/latest-posts/test/deprecated.js +153 -0
- package/src/list/ordered-list-settings.js +0 -1
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-enter.js +15 -22
- package/src/list-item/hooks/use-space.js +4 -6
- package/src/media-text/edit.js +0 -1
- package/src/media-text/editor.scss +1 -0
- package/src/missing/edit.js +1 -3
- package/src/more/editor.scss +1 -1
- package/src/navigation/edit/index.js +0 -1
- package/src/navigation/edit/overlay-menu-preview-controls.js +0 -1
- package/src/navigation/edit/overlay-menu-preview.js +0 -1
- package/src/navigation/edit/overlay-template-part-selector.js +0 -1
- package/src/navigation/edit/overlay-visibility-control.js +0 -1
- package/src/navigation/editor.scss +1 -2
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/index.php +6 -3
- package/src/navigation-link/shared/test/controls.js +0 -4
- package/src/navigation-link/shared/test/use-entity-binding.js +8 -12
- package/src/navigation-link/shared/test/use-handle-link-change.test.js +0 -4
- package/src/navigation-link/shared/test/use-link-preview.test.js +17 -4
- package/src/navigation-link/shared/use-link-preview.js +24 -4
- package/src/navigation-overlay-close/edit.js +0 -1
- package/src/navigation-submenu/index.php +6 -3
- package/src/nextpage/editor.scss +1 -1
- package/src/page-list/edit.js +0 -1
- package/src/page-list/index.php +1 -1
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/use-enter.js +4 -11
- package/src/playlist/README.md +17 -20
- package/src/playlist/block.json +28 -15
- package/src/playlist/context.js +9 -0
- package/src/playlist/edit.js +298 -97
- package/src/playlist/editor.scss +6 -0
- package/src/playlist/index.js +1 -1
- package/src/playlist/index.php +91 -36
- package/src/playlist/style.scss +51 -6
- package/src/playlist/test/edit.js +13 -12
- package/src/playlist/utils.js +24 -12
- package/src/playlist/view.js +101 -20
- package/src/playlist-track/README.md +3 -5
- package/src/playlist-track/block.json +4 -5
- package/src/playlist-track/edit.js +116 -83
- package/src/playlist-track/index.php +24 -17
- package/src/playlist-track/style.scss +10 -0
- package/src/playlist-track/test/edit.js +169 -0
- package/src/post-author/edit.js +0 -2
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-excerpt/edit.js +0 -1
- package/src/post-featured-image/overlay-controls.js +0 -1
- package/src/post-navigation-link/edit.js +0 -2
- package/src/post-template/README.md +1 -0
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +9 -0
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +3 -1
- package/src/query/README.md +2 -1
- package/src/query/block.json +3 -2
- package/src/query/edit/inspector-controls/author-control.js +0 -1
- package/src/query/edit/inspector-controls/format-controls.js +0 -1
- package/src/query/edit/inspector-controls/index.js +43 -6
- package/src/query/edit/inspector-controls/offset-controls.js +0 -1
- package/src/query/edit/inspector-controls/order-control.js +0 -1
- package/src/query/edit/inspector-controls/pages-control.js +0 -1
- package/src/query/edit/inspector-controls/parent-control.js +0 -1
- package/src/query/edit/inspector-controls/per-page-control.js +0 -1
- package/src/query/edit/inspector-controls/sticky-control.js +0 -1
- package/src/query/edit/inspector-controls/taxonomy-controls.js +0 -1
- package/src/query/edit/query-content.js +19 -3
- package/src/query/index.js +1 -0
- package/src/query-pagination/query-pagination-arrow-controls.js +0 -1
- package/src/query-pagination-numbers/edit.js +0 -1
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +3 -1
- package/src/quote/transforms.js +6 -8
- package/src/rss/edit.js +0 -4
- package/src/rss/index.php +1 -1
- package/src/search/edit.js +0 -4
- package/src/separator/edit.js +0 -1
- package/src/site-logo/edit.js +38 -78
- package/src/social-links/edit.js +0 -1
- package/src/spacer/controls.js +2 -4
- package/src/spacer/edit.js +2 -3
- package/src/tab-list/README.md +4 -5
- package/src/tab-list/block.json +5 -4
- package/src/tab-list/edit.js +133 -73
- package/src/tab-list/index.php +9 -4
- package/src/tab-list/save.js +5 -4
- package/src/tab-panel/README.md +4 -6
- package/src/tab-panel/block.json +1 -6
- package/src/tab-panel/controls.js +2 -4
- package/src/tab-panel/edit.js +19 -24
- package/src/tab-panels/README.md +5 -3
- package/src/tab-panels/block.json +0 -1
- package/src/tab-panels/edit.js +2 -4
- package/src/table-of-contents/edit.js +0 -1
- package/src/tabs/README.md +18 -9
- package/src/tabs/block.json +0 -5
- package/src/tabs/edit.js +8 -65
- package/src/tabs/tab-toolbar-controls.js +58 -0
- package/src/tabs/use-tab-actions.js +102 -0
- package/src/tabs/use-tab-list-items-sync.js +31 -12
- package/src/tag-cloud/edit.js +0 -4
- package/src/tag-cloud/index.php +1 -1
- package/src/template-part/edit/advanced-controls.js +0 -1
- package/src/template-part/edit/import-controls.js +0 -1
- package/src/template-part/index.php +1 -16
- package/src/term-name/README.md +1 -1
- package/src/term-name/block.json +1 -3
- package/src/term-name/deprecated.js +74 -0
- package/src/term-name/edit.js +2 -18
- package/src/term-name/index.js +2 -0
- package/src/terms-query/edit/inspector-controls/include-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/inherit-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/max-terms-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/order-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/taxonomy-control.js +0 -1
- package/src/text-columns/edit.js +0 -1
- package/src/utils/media-control.scss +1 -5
- package/src/utils/test/waveform-player.js +297 -38
- package/src/utils/test/waveform-utils.js +410 -9
- package/src/utils/waveform-player.js +189 -59
- package/src/utils/waveform-utils.js +443 -40
- package/src/verse/README.md +1 -0
- package/src/verse/block.json +3 -1
- package/src/video/README.md +2 -0
- package/src/video/block.json +6 -0
- package/src/video/edit-common-settings.js +0 -1
- package/src/video/edit.js +30 -1
- package/src/video/editor.scss +1 -1
- package/src/video/index.js +2 -0
- package/src/video/save.js +12 -0
- package/src/video/test/variations.js +65 -0
- package/src/video/tracks-editor.js +0 -1
- package/src/video/variations.js +65 -0
- package/build/freeform/migration-notice.cjs +0 -58
- package/build/freeform/migration-notice.cjs.map +0 -7
- package/build/tab-panel/add-tab-toolbar-control.cjs +0 -90
- package/build/tab-panel/add-tab-toolbar-control.cjs.map +0 -7
- package/build/tab-panel/remove-tab-toolbar-control.cjs +0 -99
- package/build/tab-panel/remove-tab-toolbar-control.cjs.map +0 -7
- package/build/tabs/controls.cjs +0 -45
- package/build/tabs/controls.cjs.map +0 -7
- package/build-module/freeform/migration-notice.mjs +0 -37
- package/build-module/freeform/migration-notice.mjs.map +0 -7
- package/build-module/tab-panel/add-tab-toolbar-control.mjs +0 -72
- package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs +0 -81
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tabs/controls.mjs +0 -14
- package/build-module/tabs/controls.mjs.map +0 -7
- package/src/freeform/migration-notice.js +0 -49
- package/src/tab-panel/add-tab-toolbar-control.js +0 -90
- package/src/tab-panel/remove-tab-toolbar-control.js +0 -110
- package/src/tabs/controls.js +0 -14
package/src/file/transforms.js
CHANGED
|
@@ -11,6 +11,31 @@ import { getFilename } from '@wordpress/url';
|
|
|
11
11
|
// Transforms bypass the default variation, so set the localized default here.
|
|
12
12
|
const downloadButtonText = _x( 'Download', 'button label' );
|
|
13
13
|
|
|
14
|
+
// The File → audio/video/image transforms are identical apart from the target
|
|
15
|
+
// block, its media MIME type, and the src attribute name (image uses `url`).
|
|
16
|
+
const toMediaTransform = ( blockName, mediaType, srcAttribute ) => ( {
|
|
17
|
+
type: 'block',
|
|
18
|
+
blocks: [ blockName ],
|
|
19
|
+
isMatch: ( { id } ) => {
|
|
20
|
+
if ( ! id ) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const { getEntityRecord } = select( coreStore );
|
|
24
|
+
const media = getEntityRecord( 'postType', 'attachment', id, {
|
|
25
|
+
context: 'view',
|
|
26
|
+
} );
|
|
27
|
+
return !! media && media.mime_type.includes( mediaType );
|
|
28
|
+
},
|
|
29
|
+
transform: ( attributes ) => {
|
|
30
|
+
return createBlock( blockName, {
|
|
31
|
+
[ srcAttribute ]: attributes.href,
|
|
32
|
+
caption: attributes.fileName,
|
|
33
|
+
id: attributes.id,
|
|
34
|
+
anchor: attributes.anchor,
|
|
35
|
+
} );
|
|
36
|
+
},
|
|
37
|
+
} );
|
|
38
|
+
|
|
14
39
|
const transforms = {
|
|
15
40
|
from: [
|
|
16
41
|
{
|
|
@@ -78,66 +103,9 @@ const transforms = {
|
|
|
78
103
|
},
|
|
79
104
|
],
|
|
80
105
|
to: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
isMatch: ( { id } ) => {
|
|
85
|
-
if ( ! id ) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
const { getEntityRecord } = select( coreStore );
|
|
89
|
-
const media = getEntityRecord( 'postType', 'attachment', id );
|
|
90
|
-
return !! media && media.mime_type.includes( 'audio' );
|
|
91
|
-
},
|
|
92
|
-
transform: ( attributes ) => {
|
|
93
|
-
return createBlock( 'core/audio', {
|
|
94
|
-
src: attributes.href,
|
|
95
|
-
caption: attributes.fileName,
|
|
96
|
-
id: attributes.id,
|
|
97
|
-
anchor: attributes.anchor,
|
|
98
|
-
} );
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: 'block',
|
|
103
|
-
blocks: [ 'core/video' ],
|
|
104
|
-
isMatch: ( { id } ) => {
|
|
105
|
-
if ( ! id ) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
const { getEntityRecord } = select( coreStore );
|
|
109
|
-
const media = getEntityRecord( 'postType', 'attachment', id );
|
|
110
|
-
return !! media && media.mime_type.includes( 'video' );
|
|
111
|
-
},
|
|
112
|
-
transform: ( attributes ) => {
|
|
113
|
-
return createBlock( 'core/video', {
|
|
114
|
-
src: attributes.href,
|
|
115
|
-
caption: attributes.fileName,
|
|
116
|
-
id: attributes.id,
|
|
117
|
-
anchor: attributes.anchor,
|
|
118
|
-
} );
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
type: 'block',
|
|
123
|
-
blocks: [ 'core/image' ],
|
|
124
|
-
isMatch: ( { id } ) => {
|
|
125
|
-
if ( ! id ) {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
const { getEntityRecord } = select( coreStore );
|
|
129
|
-
const media = getEntityRecord( 'postType', 'attachment', id );
|
|
130
|
-
return !! media && media.mime_type.includes( 'image' );
|
|
131
|
-
},
|
|
132
|
-
transform: ( attributes ) => {
|
|
133
|
-
return createBlock( 'core/image', {
|
|
134
|
-
url: attributes.href,
|
|
135
|
-
caption: attributes.fileName,
|
|
136
|
-
id: attributes.id,
|
|
137
|
-
anchor: attributes.anchor,
|
|
138
|
-
} );
|
|
139
|
-
},
|
|
140
|
-
},
|
|
106
|
+
toMediaTransform( 'core/audio', 'audio', 'src' ),
|
|
107
|
+
toMediaTransform( 'core/video', 'video', 'src' ),
|
|
108
|
+
toMediaTransform( 'core/image', 'image', 'url' ),
|
|
141
109
|
],
|
|
142
110
|
};
|
|
143
111
|
|
package/src/form/edit.js
CHANGED
|
@@ -108,7 +108,6 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
|
|
|
108
108
|
isShownByDefault
|
|
109
109
|
>
|
|
110
110
|
<SelectControl
|
|
111
|
-
__next40pxDefaultSize
|
|
112
111
|
label={ __( 'Submissions method' ) }
|
|
113
112
|
options={ [
|
|
114
113
|
// TODO: Allow plugins to add their own submission methods.
|
|
@@ -173,7 +172,6 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
|
|
|
173
172
|
{ submissionMethod !== 'email' && (
|
|
174
173
|
<InspectorControls group="advanced">
|
|
175
174
|
<SelectControl
|
|
176
|
-
__next40pxDefaultSize
|
|
177
175
|
label={ __( 'Method' ) }
|
|
178
176
|
options={ [
|
|
179
177
|
{ label: 'Get', value: 'get' },
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { ToolbarButton } from '@wordpress/components';
|
|
6
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
|
+
import { rawHandler, serialize } from '@wordpress/blocks';
|
|
8
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
+
|
|
10
|
+
const ConvertToBlocksButton = ( { clientId } ) => {
|
|
11
|
+
const { replaceBlocks } = useDispatch( blockEditorStore );
|
|
12
|
+
const block = useSelect(
|
|
13
|
+
( select ) => {
|
|
14
|
+
return select( blockEditorStore ).getBlock( clientId );
|
|
15
|
+
},
|
|
16
|
+
[ clientId ]
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ToolbarButton
|
|
21
|
+
onClick={ () =>
|
|
22
|
+
replaceBlocks(
|
|
23
|
+
block.clientId,
|
|
24
|
+
rawHandler( { HTML: serialize( block ) } )
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
>
|
|
28
|
+
{ __( 'Convert to blocks' ) }
|
|
29
|
+
</ToolbarButton>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default ConvertToBlocksButton;
|
package/src/freeform/edit.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useBlockProps,
|
|
8
8
|
store as blockEditorStore,
|
|
9
9
|
} from '@wordpress/block-editor';
|
|
10
|
-
import {
|
|
10
|
+
import { useSelect } from '@wordpress/data';
|
|
11
11
|
import {
|
|
12
12
|
Button,
|
|
13
13
|
Placeholder,
|
|
@@ -21,14 +21,13 @@ import { classic } from '@wordpress/icons';
|
|
|
21
21
|
/**
|
|
22
22
|
* Internal dependencies
|
|
23
23
|
*/
|
|
24
|
-
import
|
|
24
|
+
import ConvertToBlocksButton from './convert-to-blocks-button';
|
|
25
25
|
import ModalEdit from './modal';
|
|
26
26
|
|
|
27
27
|
export default function FreeformEdit( {
|
|
28
28
|
attributes,
|
|
29
29
|
setAttributes,
|
|
30
30
|
clientId,
|
|
31
|
-
onReplace,
|
|
32
31
|
} ) {
|
|
33
32
|
const { content } = attributes;
|
|
34
33
|
const [ isOpen, setOpen ] = useState( false );
|
|
@@ -38,10 +37,16 @@ export default function FreeformEdit( {
|
|
|
38
37
|
( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),
|
|
39
38
|
[ clientId ]
|
|
40
39
|
);
|
|
41
|
-
const { removeBlock } = useDispatch( blockEditorStore );
|
|
42
40
|
|
|
43
41
|
return (
|
|
44
42
|
<>
|
|
43
|
+
{ canRemove && (
|
|
44
|
+
<BlockControls>
|
|
45
|
+
<ToolbarGroup>
|
|
46
|
+
<ConvertToBlocksButton clientId={ clientId } />
|
|
47
|
+
</ToolbarGroup>
|
|
48
|
+
</BlockControls>
|
|
49
|
+
) }
|
|
45
50
|
<BlockControls>
|
|
46
51
|
<ToolbarGroup>
|
|
47
52
|
<ToolbarButton
|
|
@@ -53,12 +58,6 @@ export default function FreeformEdit( {
|
|
|
53
58
|
</ToolbarGroup>
|
|
54
59
|
</BlockControls>
|
|
55
60
|
<div { ...useBlockProps() }>
|
|
56
|
-
{ canRemove && content && (
|
|
57
|
-
<MigrationNotice
|
|
58
|
-
content={ content }
|
|
59
|
-
onReplace={ onReplace }
|
|
60
|
-
/>
|
|
61
|
-
) }
|
|
62
61
|
{ content ? (
|
|
63
62
|
<RawHTML>{ content }</RawHTML>
|
|
64
63
|
) : (
|
|
@@ -66,21 +65,12 @@ export default function FreeformEdit( {
|
|
|
66
65
|
icon={ <BlockIcon icon={ classic } /> }
|
|
67
66
|
label={ __( 'Classic' ) }
|
|
68
67
|
instructions={ __(
|
|
69
|
-
'
|
|
68
|
+
'Use the classic editor to add content.'
|
|
70
69
|
) }
|
|
71
70
|
>
|
|
72
|
-
{ canRemove && (
|
|
73
|
-
<Button
|
|
74
|
-
__next40pxDefaultSize
|
|
75
|
-
variant="primary"
|
|
76
|
-
onClick={ () => removeBlock( clientId ) }
|
|
77
|
-
>
|
|
78
|
-
{ __( 'Remove block' ) }
|
|
79
|
-
</Button>
|
|
80
|
-
) }
|
|
81
71
|
<Button
|
|
82
72
|
__next40pxDefaultSize
|
|
83
|
-
variant=
|
|
73
|
+
variant="primary"
|
|
84
74
|
onClick={ () => setOpen( true ) }
|
|
85
75
|
>
|
|
86
76
|
{ __( 'Edit contents' ) }
|
package/src/freeform/index.js
CHANGED
|
@@ -21,12 +21,4 @@ export const settings = {
|
|
|
21
21
|
save,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export const init = () => {
|
|
25
|
-
// Only expose the block in the inserter if the current post actually needs
|
|
26
|
-
// a classic block.
|
|
27
|
-
const supports = {
|
|
28
|
-
...metadata.supports,
|
|
29
|
-
inserter: !! window?.__needsClassicBlock,
|
|
30
|
-
};
|
|
31
|
-
return initBlock( { name, metadata, settings: { ...settings, supports } } );
|
|
32
|
-
};
|
|
24
|
+
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/gallery/README.md
CHANGED
|
@@ -22,6 +22,7 @@ _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/ref
|
|
|
22
22
|
|-----------|------|---------|-------------|
|
|
23
23
|
| `images` | `array` | `[]` | [Source](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `query`. [Selector](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `.blocks-gallery-item` |
|
|
24
24
|
| `ids` | `array` | `[]` | — |
|
|
25
|
+
| `dynamicContent` | `object` | — | — |
|
|
25
26
|
| `navigationButtonType` | `string` | `"icon"` | [Enum](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#enum-validation): `icon`, `text`, `both` |
|
|
26
27
|
| `shortCodeTransforms` | `array` | `[]` | — |
|
|
27
28
|
| `columns` | `number` | — | — |
|
|
@@ -46,7 +47,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
46
47
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
47
48
|
- `margin`: `true`
|
|
48
49
|
- `padding`: `true`
|
|
49
|
-
- `blockGap`: `["horizontal","vertical"]`
|
|
50
|
+
- `blockGap`: `{"sides":["horizontal","vertical"],"__experimentalDefault":"var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )"}`
|
|
50
51
|
- [`color`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color):
|
|
51
52
|
- [`text`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-text): `false`
|
|
52
53
|
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-background): `true`
|
|
@@ -67,6 +68,8 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
|
|
|
67
68
|
**Uses context:**
|
|
68
69
|
|
|
69
70
|
- `galleryId`
|
|
71
|
+
- `postId`
|
|
72
|
+
- `postType`
|
|
70
73
|
|
|
71
74
|
**Provides context:**
|
|
72
75
|
|
package/src/gallery/block.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/gallery",
|
|
5
5
|
"title": "Gallery",
|
|
6
6
|
"category": "media",
|
|
7
|
-
"usesContext": [ "galleryId" ],
|
|
7
|
+
"usesContext": [ "galleryId", "postId", "postType" ],
|
|
8
8
|
"allowedBlocks": [ "core/image" ],
|
|
9
9
|
"description": "Display multiple images in a rich gallery.",
|
|
10
10
|
"keywords": [ "images", "photos" ],
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
"default": []
|
|
63
63
|
},
|
|
64
|
+
"dynamicContent": {
|
|
65
|
+
"type": "object"
|
|
66
|
+
},
|
|
64
67
|
"navigationButtonType": {
|
|
65
68
|
"type": "string",
|
|
66
69
|
"default": "icon",
|
|
@@ -139,8 +142,10 @@
|
|
|
139
142
|
"spacing": {
|
|
140
143
|
"margin": true,
|
|
141
144
|
"padding": true,
|
|
142
|
-
"blockGap":
|
|
143
|
-
|
|
145
|
+
"blockGap": {
|
|
146
|
+
"sides": [ "horizontal", "vertical" ],
|
|
147
|
+
"__experimentalDefault": "var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )"
|
|
148
|
+
},
|
|
144
149
|
"__experimentalDefaultControls": {
|
|
145
150
|
"blockGap": true,
|
|
146
151
|
"margin": false,
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { useState } from '@wordpress/element';
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
Notice,
|
|
9
|
+
PanelBody,
|
|
10
|
+
Placeholder,
|
|
11
|
+
SelectControl,
|
|
12
|
+
Spinner,
|
|
13
|
+
ToolbarButton,
|
|
14
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
15
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
16
|
+
__experimentalConfirmDialog as ConfirmDialog,
|
|
17
|
+
} from '@wordpress/components';
|
|
18
|
+
import {
|
|
19
|
+
BlockContextProvider,
|
|
20
|
+
BlockControls,
|
|
21
|
+
useBlockEditingMode,
|
|
22
|
+
__experimentalUseBlockPreview as useBlockPreview,
|
|
23
|
+
} from '@wordpress/block-editor';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Internal dependencies
|
|
27
|
+
*/
|
|
28
|
+
import { sharedIcon } from './shared-icon';
|
|
29
|
+
import { Caption } from '../utils/caption';
|
|
30
|
+
import { DEFAULT_ORDERBY, DEFAULT_ORDER, MAX_IMAGES } from './dynamic-source';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Ordering options for a dynamic gallery source. Each value is a composite
|
|
34
|
+
* `"orderby/order"` string mapping to the matching `/wp/v2/media` collection
|
|
35
|
+
* params. `menu_order` is deliberately omitted — it isn't a valid REST `orderby`
|
|
36
|
+
* value, so the editor preview couldn't reproduce it (see `dynamic-source.js`).
|
|
37
|
+
*/
|
|
38
|
+
const ORDER_OPTIONS = [
|
|
39
|
+
{ label: __( 'Newest to oldest' ), value: 'date/desc' },
|
|
40
|
+
{ label: __( 'Oldest to newest' ), value: 'date/asc' },
|
|
41
|
+
{
|
|
42
|
+
/* translators: Label for ordering images by title in ascending order. */
|
|
43
|
+
label: __( 'A → Z' ),
|
|
44
|
+
value: 'title/asc',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
/* translators: Label for ordering images by title in descending order. */
|
|
48
|
+
label: __( 'Z → A' ),
|
|
49
|
+
value: 'title/desc',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* "Order by" control for a dynamic gallery, mirroring the Query Loop block's
|
|
55
|
+
* `OrderControl`: a single `SelectControl` whose value composites `orderby` and
|
|
56
|
+
* `order`, split apart again on change.
|
|
57
|
+
*
|
|
58
|
+
* @param {Object} props
|
|
59
|
+
* @param {string} props.orderby Current `orderby` value.
|
|
60
|
+
* @param {string} props.order Current `order` value (`asc`/`desc`).
|
|
61
|
+
* @param {Function} props.onChange Called with `{ orderby, order }` on change.
|
|
62
|
+
*/
|
|
63
|
+
function OrderControl( { orderby, order, onChange } ) {
|
|
64
|
+
return (
|
|
65
|
+
<SelectControl
|
|
66
|
+
label={ __( 'Order by' ) }
|
|
67
|
+
value={ `${ orderby }/${ order }` }
|
|
68
|
+
options={ ORDER_OPTIONS }
|
|
69
|
+
onChange={ ( value ) => {
|
|
70
|
+
const [ newOrderby, newOrder ] = value.split( '/' );
|
|
71
|
+
onChange( { orderby: newOrderby, order: newOrder } );
|
|
72
|
+
} }
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The Gallery block's "Source" inspector panel.
|
|
79
|
+
*
|
|
80
|
+
* In dynamic mode it shows the resolved source, a control to convert back to
|
|
81
|
+
* individual images, and the source ordering. In static mode it offers the
|
|
82
|
+
* entry point into dynamic mode — and, since switching discards any hand-added
|
|
83
|
+
* images, owns the confirmation dialog for that one-way change. Rendered inside
|
|
84
|
+
* the block's `InspectorControls`, alongside the Settings panel.
|
|
85
|
+
*
|
|
86
|
+
* @param {Object} props
|
|
87
|
+
* @param {Object} props.dynamic The `useDynamicGallery` result.
|
|
88
|
+
* @param {Object} props.dropdownMenuProps Shared ToolsPanel dropdown menu props.
|
|
89
|
+
* @param {boolean} props.hasImages Whether the gallery has manually-added images.
|
|
90
|
+
*/
|
|
91
|
+
export function GallerySourcePanel( {
|
|
92
|
+
dynamic,
|
|
93
|
+
dropdownMenuProps,
|
|
94
|
+
hasImages,
|
|
95
|
+
} ) {
|
|
96
|
+
const {
|
|
97
|
+
dynamicContent,
|
|
98
|
+
canUseDynamicSource,
|
|
99
|
+
sourceDescriptor,
|
|
100
|
+
sourceOrderby,
|
|
101
|
+
sourceOrder,
|
|
102
|
+
setSourceOrder,
|
|
103
|
+
convertToStatic,
|
|
104
|
+
enableDynamicMode,
|
|
105
|
+
resetSource,
|
|
106
|
+
isResolvingDynamic,
|
|
107
|
+
hasMoreImagesThanCap,
|
|
108
|
+
dynamicMediaTotal,
|
|
109
|
+
} = dynamic;
|
|
110
|
+
const isDynamic = !! dynamicContent;
|
|
111
|
+
|
|
112
|
+
const [ isConfirming, setIsConfirming ] = useState( false );
|
|
113
|
+
|
|
114
|
+
// Entering dynamic mode discards any hand-added images, so confirm first
|
|
115
|
+
// when there are images to lose; otherwise switch straight away.
|
|
116
|
+
function requestEnableDynamicMode() {
|
|
117
|
+
if ( hasImages ) {
|
|
118
|
+
setIsConfirming( true );
|
|
119
|
+
} else {
|
|
120
|
+
enableDynamicMode();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if ( isDynamic ) {
|
|
125
|
+
return (
|
|
126
|
+
<ToolsPanel
|
|
127
|
+
label={ __( 'Source' ) }
|
|
128
|
+
resetAll={ resetSource }
|
|
129
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
130
|
+
>
|
|
131
|
+
<div className="wp-block-gallery__source-settings">
|
|
132
|
+
<p className="wp-block-gallery__source-description">
|
|
133
|
+
{ sourceDescriptor?.description ??
|
|
134
|
+
__( 'Dynamic images.' ) }
|
|
135
|
+
</p>
|
|
136
|
+
<Button
|
|
137
|
+
__next40pxDefaultSize
|
|
138
|
+
variant="secondary"
|
|
139
|
+
onClick={ convertToStatic }
|
|
140
|
+
// Guard the race where the media is still resolving:
|
|
141
|
+
// converting now would map over an incomplete (or empty)
|
|
142
|
+
// list and produce a gallery missing images.
|
|
143
|
+
disabled={ isResolvingDynamic }
|
|
144
|
+
accessibleWhenDisabled
|
|
145
|
+
>
|
|
146
|
+
{ __( 'Convert to individual images' ) }
|
|
147
|
+
</Button>
|
|
148
|
+
</div>
|
|
149
|
+
{ hasMoreImagesThanCap && (
|
|
150
|
+
<Notice
|
|
151
|
+
className="wp-block-gallery__source-notice"
|
|
152
|
+
status="warning"
|
|
153
|
+
isDismissible={ false }
|
|
154
|
+
>
|
|
155
|
+
{ sprintf(
|
|
156
|
+
/* translators: 1: number of images shown. 2: total number of matching images. */
|
|
157
|
+
__(
|
|
158
|
+
'Only the first %1$d of %2$d images will be displayed.'
|
|
159
|
+
),
|
|
160
|
+
MAX_IMAGES,
|
|
161
|
+
dynamicMediaTotal
|
|
162
|
+
) }
|
|
163
|
+
</Notice>
|
|
164
|
+
) }
|
|
165
|
+
<ToolsPanelItem
|
|
166
|
+
isShownByDefault
|
|
167
|
+
label={ __( 'Order by' ) }
|
|
168
|
+
hasValue={ () =>
|
|
169
|
+
sourceOrderby !== DEFAULT_ORDERBY ||
|
|
170
|
+
sourceOrder !== DEFAULT_ORDER
|
|
171
|
+
}
|
|
172
|
+
onDeselect={ () => setSourceOrder( undefined, undefined ) }
|
|
173
|
+
>
|
|
174
|
+
<OrderControl
|
|
175
|
+
orderby={ sourceOrderby }
|
|
176
|
+
order={ sourceOrder }
|
|
177
|
+
onChange={ ( { orderby, order } ) =>
|
|
178
|
+
setSourceOrder( orderby, order )
|
|
179
|
+
}
|
|
180
|
+
/>
|
|
181
|
+
</ToolsPanelItem>
|
|
182
|
+
</ToolsPanel>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// In static mode this panel is just an entry into dynamic mode, so hide it
|
|
187
|
+
// when there's no post type to preview against. This is intentionally
|
|
188
|
+
// stricter than the placeholder's entry button (see `edit.js`), which stays
|
|
189
|
+
// available anywhere because the source resolves at render time.
|
|
190
|
+
if ( ! canUseDynamicSource ) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<>
|
|
196
|
+
<PanelBody title={ __( 'Source' ) }>
|
|
197
|
+
<div className="wp-block-gallery__source-settings">
|
|
198
|
+
{ /*
|
|
199
|
+
* Hardcoded on purpose: this single-source entry button (and
|
|
200
|
+
* its confirm dialog below) is temporary. Once more sources
|
|
201
|
+
* exist it becomes a "Choose source" select whose options read
|
|
202
|
+
* from each source descriptor's `title`, with help text
|
|
203
|
+
* carrying the per-source explanation this string does today.
|
|
204
|
+
*/ }
|
|
205
|
+
<Button
|
|
206
|
+
__next40pxDefaultSize
|
|
207
|
+
variant="secondary"
|
|
208
|
+
onClick={ requestEnableDynamicMode }
|
|
209
|
+
>
|
|
210
|
+
{ __( 'Use images attached to the post' ) }
|
|
211
|
+
</Button>
|
|
212
|
+
</div>
|
|
213
|
+
</PanelBody>
|
|
214
|
+
{ isConfirming && (
|
|
215
|
+
<ConfirmDialog
|
|
216
|
+
isOpen
|
|
217
|
+
title={ __( 'Use images attached to the post?' ) }
|
|
218
|
+
__experimentalHideHeader={ false }
|
|
219
|
+
confirmButtonText={ __( 'Use attached images' ) }
|
|
220
|
+
onConfirm={ () => {
|
|
221
|
+
enableDynamicMode();
|
|
222
|
+
setIsConfirming( false );
|
|
223
|
+
} }
|
|
224
|
+
onCancel={ () => setIsConfirming( false ) }
|
|
225
|
+
size="medium"
|
|
226
|
+
>
|
|
227
|
+
{ __(
|
|
228
|
+
'The images in this gallery will be replaced, but will remain in the media library.'
|
|
229
|
+
) }
|
|
230
|
+
</ConfirmDialog>
|
|
231
|
+
) }
|
|
232
|
+
</>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Renders the resolved image blocks as a read-only preview.
|
|
238
|
+
*
|
|
239
|
+
* `useBlockPreview` returns a `useDisabled` ref that makes its subtree inert, so
|
|
240
|
+
* previewed images (including any links) aren't interactive in the editor. The
|
|
241
|
+
* ref needs a real element, yet the images must stay flex children of the gallery
|
|
242
|
+
* `<figure>` and sit beside an editable caption. `display: contents` resolves
|
|
243
|
+
* this: the wrapper carries the ref but generates no box, so the image figures
|
|
244
|
+
* remain the figure's flex items and only they are disabled — the caption sibling
|
|
245
|
+
* stays editable. This relies on the gallery's image styles using descendant
|
|
246
|
+
* (not direct-child) selectors, which the box-less wrapper leaves intact.
|
|
247
|
+
*
|
|
248
|
+
* @param {Object} props
|
|
249
|
+
* @param {Object[]} props.imageBlocks Non-persisted `core/image` blocks to preview.
|
|
250
|
+
*/
|
|
251
|
+
function GalleryImagesPreview( { imageBlocks } ) {
|
|
252
|
+
const { children, ref, className } = useBlockPreview( {
|
|
253
|
+
blocks: imageBlocks,
|
|
254
|
+
} );
|
|
255
|
+
return (
|
|
256
|
+
<div
|
|
257
|
+
ref={ ref }
|
|
258
|
+
className={ className }
|
|
259
|
+
style={ { display: 'contents' } }
|
|
260
|
+
>
|
|
261
|
+
{ children }
|
|
262
|
+
</div>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Renders a dynamic-mode gallery on the canvas:
|
|
268
|
+
*
|
|
269
|
+
* - a block-toolbar control to convert back to individual images;
|
|
270
|
+
* - the gallery `<figure>` wrapper holding a non-editable preview of the
|
|
271
|
+
* resolved media (or a placeholder while resolving / when nothing is found),
|
|
272
|
+
* with the gallery's provided context so the previewed images inherit
|
|
273
|
+
* gallery-wide settings;
|
|
274
|
+
* - an editable gallery-level caption, alongside the read-only preview;
|
|
275
|
+
* - the (empty) inner blocks kept mounted so the container's `allowedBlocks: []`
|
|
276
|
+
* keeps syncing to block list settings (which blocks insertion and hides the
|
|
277
|
+
* List View).
|
|
278
|
+
*
|
|
279
|
+
* @param {Object} props
|
|
280
|
+
* @param {Object} props.dynamic The `useDynamicGallery` result.
|
|
281
|
+
* @param {Object} props.blockProps The gallery's `useBlockProps()` result.
|
|
282
|
+
* @param {Object} props.innerBlocksProps The gallery's `useInnerBlocksProps()` result.
|
|
283
|
+
* @param {Object} props.attributes The gallery block attributes.
|
|
284
|
+
* @param {Function} props.setAttributes The block's `setAttributes`.
|
|
285
|
+
* @param {boolean} props.isSelected Whether the gallery block is selected.
|
|
286
|
+
* @param {Function} props.insertBlocksAfter Inserts blocks after the gallery.
|
|
287
|
+
* @param {boolean} props.isContentLocked Whether the gallery is content-locked.
|
|
288
|
+
* @param {boolean} props.multiGallerySelection Whether multiple galleries are selected.
|
|
289
|
+
*/
|
|
290
|
+
export function GalleryDynamicView( {
|
|
291
|
+
dynamic,
|
|
292
|
+
blockProps,
|
|
293
|
+
innerBlocksProps,
|
|
294
|
+
attributes,
|
|
295
|
+
setAttributes,
|
|
296
|
+
isSelected,
|
|
297
|
+
insertBlocksAfter,
|
|
298
|
+
isContentLocked,
|
|
299
|
+
multiGallerySelection,
|
|
300
|
+
} ) {
|
|
301
|
+
const {
|
|
302
|
+
sourceDescriptor,
|
|
303
|
+
dynamicImageBlocks,
|
|
304
|
+
galleryContext,
|
|
305
|
+
isResolvingDynamic,
|
|
306
|
+
convertToStatic,
|
|
307
|
+
} = dynamic;
|
|
308
|
+
|
|
309
|
+
// Converting to a static gallery materializes editable inner blocks, which
|
|
310
|
+
// is a structural change. Only offer it when the block is fully editable:
|
|
311
|
+
// under a content lock (e.g. inside a `contentOnly` group) the editing mode
|
|
312
|
+
// is `'contentOnly'`/`'disabled'`, where structural toolbar controls are
|
|
313
|
+
// hidden and the conversion shouldn't be possible.
|
|
314
|
+
const blockEditingMode = useBlockEditingMode();
|
|
315
|
+
|
|
316
|
+
// Empty-state copy for the preview. Framed as forward-looking ("… will appear
|
|
317
|
+
// here") rather than as an error, since the same empty result covers both a
|
|
318
|
+
// post with no matching images and a template with no post in context yet —
|
|
319
|
+
// in either case the source simply resolves to nothing right now. The per-
|
|
320
|
+
// source wording comes from the source descriptor.
|
|
321
|
+
const emptyInstructions = isResolvingDynamic
|
|
322
|
+
? __( 'Loading images…' )
|
|
323
|
+
: sourceDescriptor?.emptyMessage ??
|
|
324
|
+
__( 'Dynamic images will appear here.' );
|
|
325
|
+
|
|
326
|
+
return (
|
|
327
|
+
<>
|
|
328
|
+
{ blockEditingMode === 'default' && (
|
|
329
|
+
<BlockControls group="other">
|
|
330
|
+
<ToolbarButton
|
|
331
|
+
onClick={ convertToStatic }
|
|
332
|
+
// Same guard as the inspector's "Convert to individual
|
|
333
|
+
// images": both call `convertToStatic`, which would map over
|
|
334
|
+
// a still-resolving (or empty) media list. (`ToolbarButton`
|
|
335
|
+
// stays focusable when disabled by default.)
|
|
336
|
+
disabled={ isResolvingDynamic }
|
|
337
|
+
>
|
|
338
|
+
{ __( 'Convert to images' ) }
|
|
339
|
+
</ToolbarButton>
|
|
340
|
+
</BlockControls>
|
|
341
|
+
) }
|
|
342
|
+
<figure { ...blockProps }>
|
|
343
|
+
{ dynamicImageBlocks.length ? (
|
|
344
|
+
<BlockContextProvider value={ galleryContext }>
|
|
345
|
+
<GalleryImagesPreview
|
|
346
|
+
imageBlocks={ dynamicImageBlocks }
|
|
347
|
+
/>
|
|
348
|
+
</BlockContextProvider>
|
|
349
|
+
) : (
|
|
350
|
+
<Placeholder
|
|
351
|
+
icon={ sharedIcon }
|
|
352
|
+
label={ __( 'Gallery' ) }
|
|
353
|
+
instructions={ emptyInstructions }
|
|
354
|
+
>
|
|
355
|
+
{ isResolvingDynamic && <Spinner /> }
|
|
356
|
+
</Placeholder>
|
|
357
|
+
) }
|
|
358
|
+
<Caption
|
|
359
|
+
attributes={ attributes }
|
|
360
|
+
setAttributes={ setAttributes }
|
|
361
|
+
isSelected={ isSelected }
|
|
362
|
+
insertBlocksAfter={ insertBlocksAfter }
|
|
363
|
+
showToolbarButton={
|
|
364
|
+
! multiGallerySelection && ! isContentLocked
|
|
365
|
+
}
|
|
366
|
+
className="blocks-gallery-caption"
|
|
367
|
+
label={ __( 'Gallery caption text' ) }
|
|
368
|
+
placeholder={ __( 'Add gallery caption' ) }
|
|
369
|
+
/>
|
|
370
|
+
</figure>
|
|
371
|
+
{ /*
|
|
372
|
+
* Dynamic mode shows a preview instead of real inner blocks, but the
|
|
373
|
+
* empty inner blocks are still rendered here for their side effect:
|
|
374
|
+
* the `allowedBlocks: []` passed to `useInnerBlocksProps` only syncs
|
|
375
|
+
* to block list settings while the inner blocks are mounted (via
|
|
376
|
+
* `useNestedSettingsUpdate`). That setting is what blocks insertion
|
|
377
|
+
* (`canInsertBlockType`) and hides the now-unusable List View
|
|
378
|
+
* (`shouldRenderBlockListView`). With no inner blocks and no appender,
|
|
379
|
+
* this renders no output of its own.
|
|
380
|
+
*/ }
|
|
381
|
+
{ innerBlocksProps.children }
|
|
382
|
+
</>
|
|
383
|
+
);
|
|
384
|
+
}
|