@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
|
@@ -95,7 +95,6 @@ var Edit = ({ attributes, setAttributes, clientId }) => {
|
|
|
95
95
|
children: /* @__PURE__ */ jsx(
|
|
96
96
|
SelectControl,
|
|
97
97
|
{
|
|
98
|
-
__next40pxDefaultSize: true,
|
|
99
98
|
label: __("Submissions method"),
|
|
100
99
|
options: [
|
|
101
100
|
// TODO: Allow plugins to add their own submission methods.
|
|
@@ -159,7 +158,6 @@ var Edit = ({ attributes, setAttributes, clientId }) => {
|
|
|
159
158
|
/* @__PURE__ */ jsx(
|
|
160
159
|
SelectControl,
|
|
161
160
|
{
|
|
162
|
-
__next40pxDefaultSize: true,
|
|
163
161
|
label: __("Method"),
|
|
164
162
|
options: [
|
|
165
163
|
{ label: "Get", value: "get" },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/form/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tSelectControl,\n\tTextControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n} from './utils.js';\n\nconst TEMPLATE = [\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tlabel: __( 'Name' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'email',\n\t\t\tlabel: __( 'Email' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'textarea',\n\t\t\tlabel: __( 'Comment' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[ 'core/form-submit-button', {} ],\n];\n\nconst Edit = ( { attributes, setAttributes, clientId } ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst resetAllSettings = () => {\n\t\tsetAttributes( {\n\t\t\tsubmissionMethod: 'email',\n\t\t\temail: undefined,\n\t\t\taction: undefined,\n\t\t\tmethod: 'post',\n\t\t} );\n\t};\n\n\tconst { action, method, email, submissionMethod } = attributes;\n\tconst blockProps = useBlockProps();\n\n\tconst { hasInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ resetAllSettings }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => submissionMethod !== 'email' }\n\t\t\t\t\t\tlabel={ __( 'Submissions method' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tsubmissionMethod: 'email',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA,4BAA4B;AA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,EAChB,CAAE;AAEF,SACC,iCACC;AAAA,wBAAC,qBACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,OAAQ,GAAI,UAAW;AAAA,QACvB,UAAW;AAAA,QAEX;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,UAAW,MAAM,qBAAqB;AAAA,cACtC,OAAQ,GAAI,oBAAqB;AAAA,cACjC,YAAa,MACZ,cAAe;AAAA,gBACd,kBAAkB;AAAA,cACnB,CAAE;AAAA,cAEH,kBAAgB;AAAA,cAEhB;AAAA,gBAAC;AAAA;AAAA,kBACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tSelectControl,\n\tTextControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n} from './utils.js';\n\nconst TEMPLATE = [\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tlabel: __( 'Name' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'email',\n\t\t\tlabel: __( 'Email' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'textarea',\n\t\t\tlabel: __( 'Comment' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[ 'core/form-submit-button', {} ],\n];\n\nconst Edit = ( { attributes, setAttributes, clientId } ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst resetAllSettings = () => {\n\t\tsetAttributes( {\n\t\t\tsubmissionMethod: 'email',\n\t\t\temail: undefined,\n\t\t\taction: undefined,\n\t\t\tmethod: 'post',\n\t\t} );\n\t};\n\n\tconst { action, method, email, submissionMethod } = attributes;\n\tconst blockProps = useBlockProps();\n\n\tconst { hasInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ resetAllSettings }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => submissionMethod !== 'email' }\n\t\t\t\t\t\tlabel={ __( 'Submissions method' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tsubmissionMethod: 'email',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Submissions method' ) }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t// TODO: Allow plugins to add their own submission methods.\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Send email' ),\n\t\t\t\t\t\t\t\t\tvalue: 'email',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( '- Custom -' ),\n\t\t\t\t\t\t\t\t\tvalue: 'custom',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tvalue={ submissionMethod }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { submissionMethod: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tsubmissionMethod === 'custom'\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t'Select the method to use for form submissions. Additional options for the \"custom\" mode can be found in the \"Advanced\" section.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Select the method to use for form submissions.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ submissionMethod === 'email' && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! email }\n\t\t\t\t\t\t\tlabel={ __( 'Email for form submissions' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\temail: undefined,\n\t\t\t\t\t\t\t\t\taction: undefined,\n\t\t\t\t\t\t\t\t\tmethod: 'post',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Email for form submissions' ) }\n\t\t\t\t\t\t\t\tvalue={ email || '' }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { email: value } );\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\taction: `mailto:${ value }`,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tsetAttributes( { method: 'post' } );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'The email address where form submissions will be sent. Separate multiple email addresses with a comma.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttype=\"email\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ submissionMethod !== 'email' && (\n\t\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Method' ) }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: 'Get', value: 'get' },\n\t\t\t\t\t\t\t{ label: 'Post', value: 'post' },\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tvalue={ method }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { method: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Select the method to use for form submissions.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tlabel={ __( 'Form action' ) }\n\t\t\t\t\t\tvalue={ action }\n\t\t\t\t\t\tonChange={ ( newVal ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\taction: newVal,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The URL where the form should be submitted.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<form\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t\tencType={ submissionMethod === 'email' ? 'text/plain' : null }\n\t\t\t/>\n\t\t</>\n\t);\n};\nexport default Edit;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,OAC1B;AACP,SAAS,iBAAiB;AAK1B,SAAS,sCAAsC;AAC/C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAkEL,mBAiBI,KAfF,YAFF;AAhEF,IAAM,WAAW;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO,GAAI,MAAO;AAAA,MAClB,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO,GAAI,OAAQ;AAAA,MACnB,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO,GAAI,SAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA,CAAE,2BAA2B,CAAC,CAAE;AACjC;AAEA,IAAM,OAAO,CAAE,EAAE,YAAY,eAAe,SAAS,MAAO;AAC3D,QAAM,oBAAoB,+BAA+B;AAEzD,QAAM,mBAAmB,MAAM;AAC9B,kBAAe;AAAA,MACd,kBAAkB;AAAA,MAClB,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,QAAQ;AAAA,IACT,CAAE;AAAA,EACH;AAEA,QAA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,MACN;AAAA,OACD;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACL,SAAU,qBAAqB,UAAU,eAAe;AAAA;AAAA,IACzD;AAAA,KACD;AAEF;AACA,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// packages/block-library/src/freeform/convert-to-blocks-button.js
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
|
+
import { ToolbarButton } from "@wordpress/components";
|
|
4
|
+
import { useDispatch, useSelect } from "@wordpress/data";
|
|
5
|
+
import { rawHandler, serialize } from "@wordpress/blocks";
|
|
6
|
+
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var ConvertToBlocksButton = ({ clientId }) => {
|
|
9
|
+
const { replaceBlocks } = useDispatch(blockEditorStore);
|
|
10
|
+
const block = useSelect(
|
|
11
|
+
(select) => {
|
|
12
|
+
return select(blockEditorStore).getBlock(clientId);
|
|
13
|
+
},
|
|
14
|
+
[clientId]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
ToolbarButton,
|
|
18
|
+
{
|
|
19
|
+
onClick: () => replaceBlocks(
|
|
20
|
+
block.clientId,
|
|
21
|
+
rawHandler({ HTML: serialize(block) })
|
|
22
|
+
),
|
|
23
|
+
children: __("Convert to blocks")
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
var convert_to_blocks_button_default = ConvertToBlocksButton;
|
|
28
|
+
export {
|
|
29
|
+
convert_to_blocks_button_default as default
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=convert-to-blocks-button.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/freeform/convert-to-blocks-button.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { rawHandler, serialize } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst ConvertToBlocksButton = ( { clientId } ) => {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst block = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlock( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={ () =>\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tblock.clientId,\n\t\t\t\t\trawHandler( { HTML: serialize( block ) } )\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t{ __( 'Convert to blocks' ) }\n\t\t</ToolbarButton>\n\t);\n};\n\nexport default ConvertToBlocksButton;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAC9B,SAAS,aAAa,iBAAiB;AACvC,SAAS,YAAY,iBAAiB;AACtC,SAAS,SAAS,wBAAwB;AAYxC;AAVF,IAAM,wBAAwB,CAAE,EAAE,SAAS,MAAO;AACjD,QAAM,EAAE,cAAc,IAAI,YAAa,gBAAiB;AACxD,QAAM,QAAQ;AAAA,IACb,CAAE,WAAY;AACb,aAAO,OAAQ,gBAAiB,EAAE,SAAU,QAAS;AAAA,IACtD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MACT;AAAA,QACC,MAAM;AAAA,QACN,WAAY,EAAE,MAAM,UAAW,KAAM,EAAE,CAAE;AAAA,MAC1C;AAAA,MAGC,aAAI,mBAAoB;AAAA;AAAA,EAC3B;AAEF;AAEA,IAAO,mCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useBlockProps,
|
|
6
6
|
store as blockEditorStore
|
|
7
7
|
} from "@wordpress/block-editor";
|
|
8
|
-
import {
|
|
8
|
+
import { useSelect } from "@wordpress/data";
|
|
9
9
|
import {
|
|
10
10
|
Button,
|
|
11
11
|
Placeholder,
|
|
@@ -15,14 +15,13 @@ import {
|
|
|
15
15
|
import { useState, useRef, RawHTML } from "@wordpress/element";
|
|
16
16
|
import { __ } from "@wordpress/i18n";
|
|
17
17
|
import { classic } from "@wordpress/icons";
|
|
18
|
-
import
|
|
18
|
+
import ConvertToBlocksButton from "./convert-to-blocks-button.mjs";
|
|
19
19
|
import ModalEdit from "./modal.mjs";
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
function FreeformEdit({
|
|
22
22
|
attributes,
|
|
23
23
|
setAttributes,
|
|
24
|
-
clientId
|
|
25
|
-
onReplace
|
|
24
|
+
clientId
|
|
26
25
|
}) {
|
|
27
26
|
const { content } = attributes;
|
|
28
27
|
const [isOpen, setOpen] = useState(false);
|
|
@@ -31,8 +30,8 @@ function FreeformEdit({
|
|
|
31
30
|
(select) => select(blockEditorStore).canRemoveBlock(clientId),
|
|
32
31
|
[clientId]
|
|
33
32
|
);
|
|
34
|
-
const { removeBlock } = useDispatch(blockEditorStore);
|
|
35
33
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
canRemove && /* @__PURE__ */ jsx(BlockControls, { children: /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(ConvertToBlocksButton, { clientId }) }) }),
|
|
36
35
|
/* @__PURE__ */ jsx(BlockControls, { children: /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(
|
|
37
36
|
ToolbarButton,
|
|
38
37
|
{
|
|
@@ -42,41 +41,23 @@ function FreeformEdit({
|
|
|
42
41
|
}
|
|
43
42
|
) }) }),
|
|
44
43
|
/* @__PURE__ */ jsxs("div", { ...useBlockProps(), children: [
|
|
45
|
-
|
|
46
|
-
MigrationNotice,
|
|
47
|
-
{
|
|
48
|
-
content,
|
|
49
|
-
onReplace
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
content ? /* @__PURE__ */ jsx(RawHTML, { children: content }) : /* @__PURE__ */ jsxs(
|
|
44
|
+
content ? /* @__PURE__ */ jsx(RawHTML, { children: content }) : /* @__PURE__ */ jsx(
|
|
53
45
|
Placeholder,
|
|
54
46
|
{
|
|
55
47
|
icon: /* @__PURE__ */ jsx(BlockIcon, { icon: classic }),
|
|
56
48
|
label: __("Classic"),
|
|
57
49
|
instructions: __(
|
|
58
|
-
"
|
|
50
|
+
"Use the classic editor to add content."
|
|
59
51
|
),
|
|
60
|
-
children:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ jsx(
|
|
71
|
-
Button,
|
|
72
|
-
{
|
|
73
|
-
__next40pxDefaultSize: true,
|
|
74
|
-
variant: canRemove ? "secondary" : "primary",
|
|
75
|
-
onClick: () => setOpen(true),
|
|
76
|
-
children: __("Edit contents")
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
]
|
|
52
|
+
children: /* @__PURE__ */ jsx(
|
|
53
|
+
Button,
|
|
54
|
+
{
|
|
55
|
+
__next40pxDefaultSize: true,
|
|
56
|
+
variant: "primary",
|
|
57
|
+
onClick: () => setOpen(true),
|
|
58
|
+
children: __("Edit contents")
|
|
59
|
+
}
|
|
60
|
+
)
|
|
80
61
|
}
|
|
81
62
|
),
|
|
82
63
|
isOpen && /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/freeform/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tPlaceholder,\n\tToolbarGroup,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { useState, useRef, RawHTML } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { classic } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ConvertToBlocksButton from './convert-to-blocks-button';\nimport ModalEdit from './modal';\n\nexport default function FreeformEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { content } = attributes;\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst editButtonRef = useRef( null );\n\n\tconst canRemove = useSelect(\n\t\t( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ canRemove && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ConvertToBlocksButton clientId={ clientId } />\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tref={ editButtonRef }\n\t\t\t\t\t\tonClick={ () => setOpen( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</ToolbarButton>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t{ content ? (\n\t\t\t\t\t<RawHTML>{ content }</RawHTML>\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ classic } /> }\n\t\t\t\t\t\tlabel={ __( 'Classic' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Use the classic editor to add content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ () => setOpen( true ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Edit contents' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Placeholder>\n\t\t\t\t) }\n\t\t\t\t{ isOpen && (\n\t\t\t\t\t<ModalEdit\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tcontent={ content }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetOpen( false );\n\t\t\t\t\t\t\tif ( editButtonRef.current ) {\n\t\t\t\t\t\t\t\teditButtonRef.current.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,UAAU,QAAQ,eAAe;AAC1C,SAAS,UAAU;AACnB,SAAS,eAAe;AAKxB,OAAO,2BAA2B;AAClC,OAAO,eAAe;AAiBpB,mBAII,KAcH,YAlBD;AAfa,SAAR,aAA+B;AAAA,EACrC;AAA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|
|
|
10
10
|
edit,
|
|
11
11
|
save
|
|
12
12
|
};
|
|
13
|
-
var init = () => {
|
|
14
|
-
const supports = {
|
|
15
|
-
...metadata.supports,
|
|
16
|
-
inserter: !!window?.__needsClassicBlock
|
|
17
|
-
};
|
|
18
|
-
return initBlock({ name, metadata, settings: { ...settings, supports } });
|
|
19
|
-
};
|
|
13
|
+
var init = () => initBlock({ name, metadata, settings });
|
|
20
14
|
export {
|
|
21
15
|
init,
|
|
22
16
|
metadata,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/freeform/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { classic as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () =>
|
|
5
|
-
"mappings": ";AAGA,SAAS,WAAW,YAAY;AAKhC,OAAO,eAAe;AACtB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AAEjB,IAAM,EAAE,KAAK,IAAI;AAIV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,OAAO,MAAM
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { classic as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,WAAW,YAAY;AAKhC,OAAO,eAAe;AACtB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AAEjB,IAAM,EAAE,KAAK,IAAI;AAIV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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,253 @@
|
|
|
1
|
+
// packages/block-library/src/gallery/dynamic-gallery.js
|
|
2
|
+
import { __, sprintf } from "@wordpress/i18n";
|
|
3
|
+
import { useState } from "@wordpress/element";
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Notice,
|
|
7
|
+
PanelBody,
|
|
8
|
+
Placeholder,
|
|
9
|
+
SelectControl,
|
|
10
|
+
Spinner,
|
|
11
|
+
ToolbarButton,
|
|
12
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
13
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
14
|
+
__experimentalConfirmDialog as ConfirmDialog
|
|
15
|
+
} from "@wordpress/components";
|
|
16
|
+
import {
|
|
17
|
+
BlockContextProvider,
|
|
18
|
+
BlockControls,
|
|
19
|
+
useBlockEditingMode,
|
|
20
|
+
__experimentalUseBlockPreview as useBlockPreview
|
|
21
|
+
} from "@wordpress/block-editor";
|
|
22
|
+
import { sharedIcon } from "./shared-icon.mjs";
|
|
23
|
+
import { Caption } from "../utils/caption.mjs";
|
|
24
|
+
import { DEFAULT_ORDERBY, DEFAULT_ORDER, MAX_IMAGES } from "./dynamic-source.mjs";
|
|
25
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
var ORDER_OPTIONS = [
|
|
27
|
+
{ label: __("Newest to oldest"), value: "date/desc" },
|
|
28
|
+
{ label: __("Oldest to newest"), value: "date/asc" },
|
|
29
|
+
{
|
|
30
|
+
/* translators: Label for ordering images by title in ascending order. */
|
|
31
|
+
label: __("A → Z"),
|
|
32
|
+
value: "title/asc"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
/* translators: Label for ordering images by title in descending order. */
|
|
36
|
+
label: __("Z → A"),
|
|
37
|
+
value: "title/desc"
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
function OrderControl({ orderby, order, onChange }) {
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
SelectControl,
|
|
43
|
+
{
|
|
44
|
+
label: __("Order by"),
|
|
45
|
+
value: `${orderby}/${order}`,
|
|
46
|
+
options: ORDER_OPTIONS,
|
|
47
|
+
onChange: (value) => {
|
|
48
|
+
const [newOrderby, newOrder] = value.split("/");
|
|
49
|
+
onChange({ orderby: newOrderby, order: newOrder });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function GallerySourcePanel({
|
|
55
|
+
dynamic,
|
|
56
|
+
dropdownMenuProps,
|
|
57
|
+
hasImages
|
|
58
|
+
}) {
|
|
59
|
+
const {
|
|
60
|
+
dynamicContent,
|
|
61
|
+
canUseDynamicSource,
|
|
62
|
+
sourceDescriptor,
|
|
63
|
+
sourceOrderby,
|
|
64
|
+
sourceOrder,
|
|
65
|
+
setSourceOrder,
|
|
66
|
+
convertToStatic,
|
|
67
|
+
enableDynamicMode,
|
|
68
|
+
resetSource,
|
|
69
|
+
isResolvingDynamic,
|
|
70
|
+
hasMoreImagesThanCap,
|
|
71
|
+
dynamicMediaTotal
|
|
72
|
+
} = dynamic;
|
|
73
|
+
const isDynamic = !!dynamicContent;
|
|
74
|
+
const [isConfirming, setIsConfirming] = useState(false);
|
|
75
|
+
function requestEnableDynamicMode() {
|
|
76
|
+
if (hasImages) {
|
|
77
|
+
setIsConfirming(true);
|
|
78
|
+
} else {
|
|
79
|
+
enableDynamicMode();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (isDynamic) {
|
|
83
|
+
return /* @__PURE__ */ jsxs(
|
|
84
|
+
ToolsPanel,
|
|
85
|
+
{
|
|
86
|
+
label: __("Source"),
|
|
87
|
+
resetAll: resetSource,
|
|
88
|
+
dropdownMenuProps,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsxs("div", { className: "wp-block-gallery__source-settings", children: [
|
|
91
|
+
/* @__PURE__ */ jsx("p", { className: "wp-block-gallery__source-description", children: sourceDescriptor?.description ?? __("Dynamic images.") }),
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
Button,
|
|
94
|
+
{
|
|
95
|
+
__next40pxDefaultSize: true,
|
|
96
|
+
variant: "secondary",
|
|
97
|
+
onClick: convertToStatic,
|
|
98
|
+
disabled: isResolvingDynamic,
|
|
99
|
+
accessibleWhenDisabled: true,
|
|
100
|
+
children: __("Convert to individual images")
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }),
|
|
104
|
+
hasMoreImagesThanCap && /* @__PURE__ */ jsx(
|
|
105
|
+
Notice,
|
|
106
|
+
{
|
|
107
|
+
className: "wp-block-gallery__source-notice",
|
|
108
|
+
status: "warning",
|
|
109
|
+
isDismissible: false,
|
|
110
|
+
children: sprintf(
|
|
111
|
+
/* translators: 1: number of images shown. 2: total number of matching images. */
|
|
112
|
+
__(
|
|
113
|
+
"Only the first %1$d of %2$d images will be displayed."
|
|
114
|
+
),
|
|
115
|
+
MAX_IMAGES,
|
|
116
|
+
dynamicMediaTotal
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
ToolsPanelItem,
|
|
122
|
+
{
|
|
123
|
+
isShownByDefault: true,
|
|
124
|
+
label: __("Order by"),
|
|
125
|
+
hasValue: () => sourceOrderby !== DEFAULT_ORDERBY || sourceOrder !== DEFAULT_ORDER,
|
|
126
|
+
onDeselect: () => setSourceOrder(void 0, void 0),
|
|
127
|
+
children: /* @__PURE__ */ jsx(
|
|
128
|
+
OrderControl,
|
|
129
|
+
{
|
|
130
|
+
orderby: sourceOrderby,
|
|
131
|
+
order: sourceOrder,
|
|
132
|
+
onChange: ({ orderby, order }) => setSourceOrder(orderby, order)
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
if (!canUseDynamicSource) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
145
|
+
/* @__PURE__ */ jsx(PanelBody, { title: __("Source"), children: /* @__PURE__ */ jsx("div", { className: "wp-block-gallery__source-settings", children: /* @__PURE__ */ jsx(
|
|
146
|
+
Button,
|
|
147
|
+
{
|
|
148
|
+
__next40pxDefaultSize: true,
|
|
149
|
+
variant: "secondary",
|
|
150
|
+
onClick: requestEnableDynamicMode,
|
|
151
|
+
children: __("Use images attached to the post")
|
|
152
|
+
}
|
|
153
|
+
) }) }),
|
|
154
|
+
isConfirming && /* @__PURE__ */ jsx(
|
|
155
|
+
ConfirmDialog,
|
|
156
|
+
{
|
|
157
|
+
isOpen: true,
|
|
158
|
+
title: __("Use images attached to the post?"),
|
|
159
|
+
__experimentalHideHeader: false,
|
|
160
|
+
confirmButtonText: __("Use attached images"),
|
|
161
|
+
onConfirm: () => {
|
|
162
|
+
enableDynamicMode();
|
|
163
|
+
setIsConfirming(false);
|
|
164
|
+
},
|
|
165
|
+
onCancel: () => setIsConfirming(false),
|
|
166
|
+
size: "medium",
|
|
167
|
+
children: __(
|
|
168
|
+
"The images in this gallery will be replaced, but will remain in the media library."
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
function GalleryImagesPreview({ imageBlocks }) {
|
|
175
|
+
const { children, ref, className } = useBlockPreview({
|
|
176
|
+
blocks: imageBlocks
|
|
177
|
+
});
|
|
178
|
+
return /* @__PURE__ */ jsx(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
ref,
|
|
182
|
+
className,
|
|
183
|
+
style: { display: "contents" },
|
|
184
|
+
children
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function GalleryDynamicView({
|
|
189
|
+
dynamic,
|
|
190
|
+
blockProps,
|
|
191
|
+
innerBlocksProps,
|
|
192
|
+
attributes,
|
|
193
|
+
setAttributes,
|
|
194
|
+
isSelected,
|
|
195
|
+
insertBlocksAfter,
|
|
196
|
+
isContentLocked,
|
|
197
|
+
multiGallerySelection
|
|
198
|
+
}) {
|
|
199
|
+
const {
|
|
200
|
+
sourceDescriptor,
|
|
201
|
+
dynamicImageBlocks,
|
|
202
|
+
galleryContext,
|
|
203
|
+
isResolvingDynamic,
|
|
204
|
+
convertToStatic
|
|
205
|
+
} = dynamic;
|
|
206
|
+
const blockEditingMode = useBlockEditingMode();
|
|
207
|
+
const emptyInstructions = isResolvingDynamic ? __("Loading images…") : sourceDescriptor?.emptyMessage ?? __("Dynamic images will appear here.");
|
|
208
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
209
|
+
blockEditingMode === "default" && /* @__PURE__ */ jsx(BlockControls, { group: "other", children: /* @__PURE__ */ jsx(
|
|
210
|
+
ToolbarButton,
|
|
211
|
+
{
|
|
212
|
+
onClick: convertToStatic,
|
|
213
|
+
disabled: isResolvingDynamic,
|
|
214
|
+
children: __("Convert to images")
|
|
215
|
+
}
|
|
216
|
+
) }),
|
|
217
|
+
/* @__PURE__ */ jsxs("figure", { ...blockProps, children: [
|
|
218
|
+
dynamicImageBlocks.length ? /* @__PURE__ */ jsx(BlockContextProvider, { value: galleryContext, children: /* @__PURE__ */ jsx(
|
|
219
|
+
GalleryImagesPreview,
|
|
220
|
+
{
|
|
221
|
+
imageBlocks: dynamicImageBlocks
|
|
222
|
+
}
|
|
223
|
+
) }) : /* @__PURE__ */ jsx(
|
|
224
|
+
Placeholder,
|
|
225
|
+
{
|
|
226
|
+
icon: sharedIcon,
|
|
227
|
+
label: __("Gallery"),
|
|
228
|
+
instructions: emptyInstructions,
|
|
229
|
+
children: isResolvingDynamic && /* @__PURE__ */ jsx(Spinner, {})
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ jsx(
|
|
233
|
+
Caption,
|
|
234
|
+
{
|
|
235
|
+
attributes,
|
|
236
|
+
setAttributes,
|
|
237
|
+
isSelected,
|
|
238
|
+
insertBlocksAfter,
|
|
239
|
+
showToolbarButton: !multiGallerySelection && !isContentLocked,
|
|
240
|
+
className: "blocks-gallery-caption",
|
|
241
|
+
label: __("Gallery caption text"),
|
|
242
|
+
placeholder: __("Add gallery caption")
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
] }),
|
|
246
|
+
innerBlocksProps.children
|
|
247
|
+
] });
|
|
248
|
+
}
|
|
249
|
+
export {
|
|
250
|
+
GalleryDynamicView,
|
|
251
|
+
GallerySourcePanel
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=dynamic-gallery.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/gallery/dynamic-gallery.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\tNotice,\n\tPanelBody,\n\tPlaceholder,\n\tSelectControl,\n\tSpinner,\n\tToolbarButton,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport {\n\tBlockContextProvider,\n\tBlockControls,\n\tuseBlockEditingMode,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from './shared-icon';\nimport { Caption } from '../utils/caption';\nimport { DEFAULT_ORDERBY, DEFAULT_ORDER, MAX_IMAGES } from './dynamic-source';\n\n/**\n * Ordering options for a dynamic gallery source. Each value is a composite\n * `\"orderby/order\"` string mapping to the matching `/wp/v2/media` collection\n * params. `menu_order` is deliberately omitted — it isn't a valid REST `orderby`\n * value, so the editor preview couldn't reproduce it (see `dynamic-source.js`).\n */\nconst ORDER_OPTIONS = [\n\t{ label: __( 'Newest to oldest' ), value: 'date/desc' },\n\t{ label: __( 'Oldest to newest' ), value: 'date/asc' },\n\t{\n\t\t/* translators: Label for ordering images by title in ascending order. */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering images by title in descending order. */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\n\n/**\n * \"Order by\" control for a dynamic gallery, mirroring the Query Loop block's\n * `OrderControl`: a single `SelectControl` whose value composites `orderby` and\n * `order`, split apart again on change.\n *\n * @param {Object} props\n * @param {string} props.orderby Current `orderby` value.\n * @param {string} props.order Current `order` value (`asc`/`desc`).\n * @param {Function} props.onChange Called with `{ orderby, order }` on change.\n */\nfunction OrderControl( { orderby, order, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderby }/${ order }` }\n\t\t\toptions={ ORDER_OPTIONS }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderby, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { orderby: newOrderby, order: newOrder } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\n/**\n * The Gallery block's \"Source\" inspector panel.\n *\n * In dynamic mode it shows the resolved source, a control to convert back to\n * individual images, and the source ordering. In static mode it offers the\n * entry point into dynamic mode — and, since switching discards any hand-added\n * images, owns the confirmation dialog for that one-way change. Rendered inside\n * the block's `InspectorControls`, alongside the Settings panel.\n *\n * @param {Object} props\n * @param {Object} props.dynamic The `useDynamicGallery` result.\n * @param {Object} props.dropdownMenuProps Shared ToolsPanel dropdown menu props.\n * @param {boolean} props.hasImages Whether the gallery has manually-added images.\n */\nexport function GallerySourcePanel( {\n\tdynamic,\n\tdropdownMenuProps,\n\thasImages,\n} ) {\n\tconst {\n\t\tdynamicContent,\n\t\tcanUseDynamicSource,\n\t\tsourceDescriptor,\n\t\tsourceOrderby,\n\t\tsourceOrder,\n\t\tsetSourceOrder,\n\t\tconvertToStatic,\n\t\tenableDynamicMode,\n\t\tresetSource,\n\t\tisResolvingDynamic,\n\t\thasMoreImagesThanCap,\n\t\tdynamicMediaTotal,\n\t} = dynamic;\n\tconst isDynamic = !! dynamicContent;\n\n\tconst [ isConfirming, setIsConfirming ] = useState( false );\n\n\t// Entering dynamic mode discards any hand-added images, so confirm first\n\t// when there are images to lose; otherwise switch straight away.\n\tfunction requestEnableDynamicMode() {\n\t\tif ( hasImages ) {\n\t\t\tsetIsConfirming( true );\n\t\t} else {\n\t\t\tenableDynamicMode();\n\t\t}\n\t}\n\n\tif ( isDynamic ) {\n\t\treturn (\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Source' ) }\n\t\t\t\tresetAll={ resetSource }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<div className=\"wp-block-gallery__source-settings\">\n\t\t\t\t\t<p className=\"wp-block-gallery__source-description\">\n\t\t\t\t\t\t{ sourceDescriptor?.description ??\n\t\t\t\t\t\t\t__( 'Dynamic images.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ convertToStatic }\n\t\t\t\t\t\t// Guard the race where the media is still resolving:\n\t\t\t\t\t\t// converting now would map over an incomplete (or empty)\n\t\t\t\t\t\t// list and produce a gallery missing images.\n\t\t\t\t\t\tdisabled={ isResolvingDynamic }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Convert to individual images' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{ hasMoreImagesThanCap && (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\tclassName=\"wp-block-gallery__source-notice\"\n\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: number of images shown. 2: total number of matching images. */\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'Only the first %1$d of %2$d images will be displayed.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tMAX_IMAGES,\n\t\t\t\t\t\t\tdynamicMediaTotal\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Notice>\n\t\t\t\t) }\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\tsourceOrderby !== DEFAULT_ORDERBY ||\n\t\t\t\t\t\tsourceOrder !== DEFAULT_ORDER\n\t\t\t\t\t}\n\t\t\t\t\tonDeselect={ () => setSourceOrder( undefined, undefined ) }\n\t\t\t\t>\n\t\t\t\t\t<OrderControl\n\t\t\t\t\t\torderby={ sourceOrderby }\n\t\t\t\t\t\torder={ sourceOrder }\n\t\t\t\t\t\tonChange={ ( { orderby, order } ) =>\n\t\t\t\t\t\t\tsetSourceOrder( orderby, order )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t);\n\t}\n\n\t// In static mode this panel is just an entry into dynamic mode, so hide it\n\t// when there's no post type to preview against. This is intentionally\n\t// stricter than the placeholder's entry button (see `edit.js`), which stays\n\t// available anywhere because the source resolves at render time.\n\tif ( ! canUseDynamicSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody title={ __( 'Source' ) }>\n\t\t\t\t<div className=\"wp-block-gallery__source-settings\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Hardcoded on purpose: this single-source entry button (and\n\t\t\t\t\t * its confirm dialog below) is temporary. Once more sources\n\t\t\t\t\t * exist it becomes a \"Choose source\" select whose options read\n\t\t\t\t\t * from each source descriptor's `title`, with help text\n\t\t\t\t\t * carrying the per-source explanation this string does today.\n\t\t\t\t\t */ }\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ requestEnableDynamicMode }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Use images attached to the post' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ isConfirming && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen\n\t\t\t\t\ttitle={ __( 'Use images attached to the post?' ) }\n\t\t\t\t\t__experimentalHideHeader={ false }\n\t\t\t\t\tconfirmButtonText={ __( 'Use attached images' ) }\n\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\tenableDynamicMode();\n\t\t\t\t\t\tsetIsConfirming( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonCancel={ () => setIsConfirming( false ) }\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'The images in this gallery will be replaced, but will remain in the media library.'\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders the resolved image blocks as a read-only preview.\n *\n * `useBlockPreview` returns a `useDisabled` ref that makes its subtree inert, so\n * previewed images (including any links) aren't interactive in the editor. The\n * ref needs a real element, yet the images must stay flex children of the gallery\n * `<figure>` and sit beside an editable caption. `display: contents` resolves\n * this: the wrapper carries the ref but generates no box, so the image figures\n * remain the figure's flex items and only they are disabled — the caption sibling\n * stays editable. This relies on the gallery's image styles using descendant\n * (not direct-child) selectors, which the box-less wrapper leaves intact.\n *\n * @param {Object} props\n * @param {Object[]} props.imageBlocks Non-persisted `core/image` blocks to preview.\n */\nfunction GalleryImagesPreview( { imageBlocks } ) {\n\tconst { children, ref, className } = useBlockPreview( {\n\t\tblocks: imageBlocks,\n\t} );\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ className }\n\t\t\tstyle={ { display: 'contents' } }\n\t\t>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * Renders a dynamic-mode gallery on the canvas:\n *\n * - a block-toolbar control to convert back to individual images;\n * - the gallery `<figure>` wrapper holding a non-editable preview of the\n * resolved media (or a placeholder while resolving / when nothing is found),\n * with the gallery's provided context so the previewed images inherit\n * gallery-wide settings;\n * - an editable gallery-level caption, alongside the read-only preview;\n * - the (empty) inner blocks kept mounted so the container's `allowedBlocks: []`\n * keeps syncing to block list settings (which blocks insertion and hides the\n * List View).\n *\n * @param {Object} props\n * @param {Object} props.dynamic The `useDynamicGallery` result.\n * @param {Object} props.blockProps The gallery's `useBlockProps()` result.\n * @param {Object} props.innerBlocksProps The gallery's `useInnerBlocksProps()` result.\n * @param {Object} props.attributes The gallery block attributes.\n * @param {Function} props.setAttributes The block's `setAttributes`.\n * @param {boolean} props.isSelected Whether the gallery block is selected.\n * @param {Function} props.insertBlocksAfter Inserts blocks after the gallery.\n * @param {boolean} props.isContentLocked Whether the gallery is content-locked.\n * @param {boolean} props.multiGallerySelection Whether multiple galleries are selected.\n */\nexport function GalleryDynamicView( {\n\tdynamic,\n\tblockProps,\n\tinnerBlocksProps,\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tisContentLocked,\n\tmultiGallerySelection,\n} ) {\n\tconst {\n\t\tsourceDescriptor,\n\t\tdynamicImageBlocks,\n\t\tgalleryContext,\n\t\tisResolvingDynamic,\n\t\tconvertToStatic,\n\t} = dynamic;\n\n\t// Converting to a static gallery materializes editable inner blocks, which\n\t// is a structural change. Only offer it when the block is fully editable:\n\t// under a content lock (e.g. inside a `contentOnly` group) the editing mode\n\t// is `'contentOnly'`/`'disabled'`, where structural toolbar controls are\n\t// hidden and the conversion shouldn't be possible.\n\tconst blockEditingMode = useBlockEditingMode();\n\n\t// Empty-state copy for the preview. Framed as forward-looking (\"… will appear\n\t// here\") rather than as an error, since the same empty result covers both a\n\t// post with no matching images and a template with no post in context yet —\n\t// in either case the source simply resolves to nothing right now. The per-\n\t// source wording comes from the source descriptor.\n\tconst emptyInstructions = isResolvingDynamic\n\t\t? __( 'Loading images…' )\n\t\t: sourceDescriptor?.emptyMessage ??\n\t\t __( 'Dynamic images will appear here.' );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ convertToStatic }\n\t\t\t\t\t\t// Same guard as the inspector's \"Convert to individual\n\t\t\t\t\t\t// images\": both call `convertToStatic`, which would map over\n\t\t\t\t\t\t// a still-resolving (or empty) media list. (`ToolbarButton`\n\t\t\t\t\t\t// stays focusable when disabled by default.)\n\t\t\t\t\t\tdisabled={ isResolvingDynamic }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Convert to images' ) }\n\t\t\t\t\t</ToolbarButton>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ dynamicImageBlocks.length ? (\n\t\t\t\t\t<BlockContextProvider value={ galleryContext }>\n\t\t\t\t\t\t<GalleryImagesPreview\n\t\t\t\t\t\t\timageBlocks={ dynamicImageBlocks }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ sharedIcon }\n\t\t\t\t\t\tlabel={ __( 'Gallery' ) }\n\t\t\t\t\t\tinstructions={ emptyInstructions }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isResolvingDynamic && <Spinner /> }\n\t\t\t\t\t</Placeholder>\n\t\t\t\t) }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\t! multiGallerySelection && ! isContentLocked\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\t\tlabel={ __( 'Gallery caption text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add gallery caption' ) }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t\t{ /*\n\t\t\t * Dynamic mode shows a preview instead of real inner blocks, but the\n\t\t\t * empty inner blocks are still rendered here for their side effect:\n\t\t\t * the `allowedBlocks: []` passed to `useInnerBlocksProps` only syncs\n\t\t\t * to block list settings while the inner blocks are mounted (via\n\t\t\t * `useNestedSettingsUpdate`). That setting is what blocks insertion\n\t\t\t * (`canInsertBlockType`) and hides the now-unusable List View\n\t\t\t * (`shouldRenderBlockListView`). With no inner blocks and no appender,\n\t\t\t * this renders no output of its own.\n\t\t\t */ }\n\t\t\t{ innerBlocksProps.children }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B,SAAS,gBAAgB;AACzB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,OACzB;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,iCAAiC;AAAA,OAC3B;AAKP,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,iBAAiB,eAAe,kBAAkB;AAmCzD,SAkIA,UAlIA,KAkEE,YAlEF;AA3BF,IAAM,gBAAgB;AAAA,EACrB,EAAE,OAAO,GAAI,kBAAmB,GAAG,OAAO,YAAY;AAAA,EACtD,EAAE,OAAO,GAAI,kBAAmB,GAAG,OAAO,WAAW;AAAA,EACrD;AAAA;AAAA,IAEC,OAAO,GAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,OAAO,GAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AACD;AAYA,SAAS,aAAc,EAAE,SAAS,OAAO,SAAS,GAAI;AACrD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,UAAW;AAAA,MACv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A0BO,SAAS,mBAAoB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAOJ,QAAM,mBAAmB,oBAAoB;AAO7C,QAAM,oBAAoB,qBACvB,GAAI,iBAAkB,IACtB,kBAAkB,gBAClB,GAAI,kCAAmC;AAE1C,SACC,iCACG;AAAA,yBAAqB,aACtB,oBAAC,iBAAc,OAAM,SACpB;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QAKV,UAAW;AAAA,QAET,aAAI,mBAAoB;AAAA;AAAA,IAC3B,GACD;AAAA,IAED,qBAAC,YAAS,GAAG,YACV;AAAA,yBAAmB,SACpB,oBAAC,wBAAqB,OAAQ,gBAC7B;AAAA,QAAC;AAAA;AAAA,UACA,aAAc;AAAA;AAAA,MACf,GACD,IAEA;AAAA,QAAC;AAAA;AAAA,UACA,MAAO;AAAA,UACP,OAAQ,GAAI,SAAU;AAAA,UACtB,cAAe;AAAA,UAEb,gCAAsB,oBAAC,WAAQ;AAAA;AAAA,MAClC;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,mBACC,CAAE,yBAAyB,CAAE;AAAA,UAE9B,WAAU;AAAA,UACV,OAAQ,GAAI,sBAAuB;AAAA,UACnC,aAAc,GAAI,qBAAsB;AAAA;AAAA,MACzC;AAAA,OACD;AAAA,IAWE,iBAAiB;AAAA,KACpB;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// packages/block-library/src/gallery/dynamic-source.js
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
|
+
var ATTACHED_MEDIA = "core/attached-media";
|
|
4
|
+
var DEFAULT_ORDERBY = "date";
|
|
5
|
+
var DEFAULT_ORDER = "desc";
|
|
6
|
+
var DYNAMIC_SOURCES = {
|
|
7
|
+
[ATTACHED_MEDIA]: {
|
|
8
|
+
// Short label for the entry affordance / future source chooser. Mirrors
|
|
9
|
+
// the "Attached images" media inserter category name.
|
|
10
|
+
title: __("Use attached images"),
|
|
11
|
+
// Help text shown beneath the Source controls.
|
|
12
|
+
description: __("Images attached to the post."),
|
|
13
|
+
// Empty-state copy for the canvas preview.
|
|
14
|
+
emptyMessage: __("Images attached to the post will appear here.")
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
function getDynamicSource(source) {
|
|
18
|
+
return DYNAMIC_SOURCES[source];
|
|
19
|
+
}
|
|
20
|
+
var MAX_IMAGES = 100;
|
|
21
|
+
function getSourceQuery(dynamicContent, { postId }) {
|
|
22
|
+
const { source, args = {} } = dynamicContent ?? {};
|
|
23
|
+
switch (source) {
|
|
24
|
+
case ATTACHED_MEDIA:
|
|
25
|
+
if (!postId) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
parent: postId,
|
|
30
|
+
per_page: MAX_IMAGES,
|
|
31
|
+
// The gallery only accepts images, so constrain the source to
|
|
32
|
+
// image media (matching the server resolver). This keeps the
|
|
33
|
+
// editor preview in step with the rendered output for posts
|
|
34
|
+
// that also have non-image attachments.
|
|
35
|
+
media_type: "image",
|
|
36
|
+
// Map the camelCase `args` to the REST-named media collection
|
|
37
|
+
// params. Unexpected values (only reachable via hand-edited
|
|
38
|
+
// markup) are coerced back to the defaults — mirroring the server
|
|
39
|
+
// resolver's allow list — so the editor preview stays in step with
|
|
40
|
+
// the frontend instead of issuing an invalid REST query.
|
|
41
|
+
orderby: args.orderBy === "date" || args.orderBy === "title" ? args.orderBy : DEFAULT_ORDERBY,
|
|
42
|
+
order: args.order === "asc" || args.order === "desc" ? args.order : DEFAULT_ORDER
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
ATTACHED_MEDIA,
|
|
49
|
+
DEFAULT_ORDER,
|
|
50
|
+
DEFAULT_ORDERBY,
|
|
51
|
+
MAX_IMAGES,
|
|
52
|
+
getDynamicSource,
|
|
53
|
+
getSourceQuery
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=dynamic-source.mjs.map
|