@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/gallery/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\tToggleControl,\n\tRangeControl,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tMediaReplaceFlow,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { View } from '@wordpress/primitives';\nimport { createBlock } from '@wordpress/blocks';\nimport { createBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tlink as linkIcon,\n\tcustomLink,\n\timage as imageIcon,\n\tlinkOff,\n\tfullscreen,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from './shared-icon';\nimport { defaultColumnsNumber, pickRelevantMediaFiles } from './shared';\nimport { getHrefAndDestination } from './utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tgetUpdatedLinkTargetSettings,\n\tgetImageSizeAttributes,\n} from '../image/utils';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_LIGHTBOX,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n} from './constants';\nimport useImageSizes from './use-image-sizes';\nimport useGetNewImages from './use-get-new-images';\nimport useGetMedia from './use-get-media';\nimport GapStyles from './gap-styles';\n\nconst MAX_COLUMNS = 8;\nconst LINK_OPTIONS = [\n\t{\n\t\ticon: customLink,\n\t\tlabel: __( 'Link images to attachment pages' ),\n\t\tvalue: LINK_DESTINATION_ATTACHMENT,\n\t\tnoticeText: __( 'Attachment Pages' ),\n\t},\n\t{\n\t\ticon: imageIcon,\n\t\tlabel: __( 'Link images to media files' ),\n\t\tvalue: LINK_DESTINATION_MEDIA,\n\t\tnoticeText: __( 'Media Files' ),\n\t},\n\t{\n\t\ticon: fullscreen,\n\t\tlabel: __( 'Enlarge on click' ),\n\t\tvalue: LINK_DESTINATION_LIGHTBOX,\n\t\tnoticeText: __( 'Lightbox effect' ),\n\t\tinfoText: __( 'Scale images with a lightbox effect' ),\n\t},\n\t{\n\t\ticon: linkOff,\n\t\tlabel: _x( 'None', 'Media item link option' ),\n\t\tvalue: LINK_DESTINATION_NONE,\n\t\tnoticeText: __( 'None' ),\n\t},\n];\nconst NAVIGATION_BUTTON_TYPE_OPTIONS = [\n\t{\n\t\tlabel: __( 'Icon' ),\n\t\tvalue: 'icon',\n\t},\n\t{\n\t\tlabel: __( 'Text' ),\n\t\tvalue: 'text',\n\t},\n\t{\n\t\tlabel: __( 'Both' ),\n\t\tvalue: 'both',\n\t},\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = __(\n\t'Drag and drop images, upload, or choose from your library.'\n);\n\nconst DEFAULT_BLOCK = { name: 'core/image' };\nconst EMPTY_ARRAY = [];\n\nexport default function GalleryEdit( props ) {\n\tconst {\n\t\tsetAttributes,\n\t\tattributes,\n\t\tclassName,\n\t\tclientId,\n\t\tisSelected,\n\t\tinsertBlocksAfter,\n\t\tisContentLocked,\n\t} = props;\n\n\tconst [ lightboxSetting, defaultRatios, themeRatios, showDefaultRatios ] =\n\t\tuseSettings(\n\t\t\t'blocks.core/image.lightbox',\n\t\t\t'dimensions.aspectRatios.default',\n\t\t\t'dimensions.aspectRatios.theme',\n\t\t\t'dimensions.defaultAspectRatios'\n\t\t);\n\n\tconst linkOptions = ! lightboxSetting?.allowEditing\n\t\t? LINK_OPTIONS.filter(\n\t\t\t\t( option ) => option.value !== LINK_DESTINATION_LIGHTBOX\n\t\t )\n\t\t: LINK_OPTIONS;\n\n\tconst {\n\t\tnavigationButtonType,\n\t\tcolumns,\n\t\timageCrop,\n\t\trandomOrder,\n\t\tlinkTarget,\n\t\tlinkTo,\n\t\tsizeSlug,\n\t\taspectRatio,\n\t} = attributes;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceInnerBlocks,\n\t\tupdateBlockAttributes,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst { getBlock, getSettings, innerBlockImages, multiGallerySelection } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockName,\n\t\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\t\tgetSettings: _getSettings,\n\t\t\t\t\tgetBlock: _getBlock,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst multiSelectedClientIds = getMultiSelectedBlockClientIds();\n\n\t\t\t\treturn {\n\t\t\t\t\tgetBlock: _getBlock,\n\t\t\t\t\tgetSettings: _getSettings,\n\t\t\t\t\tinnerBlockImages:\n\t\t\t\t\t\t_getBlock( clientId )?.innerBlocks ?? EMPTY_ARRAY,\n\t\t\t\t\tmultiGallerySelection:\n\t\t\t\t\t\tmultiSelectedClientIds.length &&\n\t\t\t\t\t\tmultiSelectedClientIds.every(\n\t\t\t\t\t\t\t( _clientId ) =>\n\t\t\t\t\t\t\t\tgetBlockName( _clientId ) === 'core/gallery'\n\t\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\tconst images = useMemo(\n\t\t() =>\n\t\t\tinnerBlockImages?.map( ( block ) => ( {\n\t\t\t\tclientId: block.clientId,\n\t\t\t\tid: block.attributes.id,\n\t\t\t\turl: block.attributes.url,\n\t\t\t\tattributes: block.attributes,\n\t\t\t\tfromSavedContent: Boolean( block.originalContent ),\n\t\t\t} ) ),\n\t\t[ innerBlockImages ]\n\t);\n\n\tconst imageData = useGetMedia( innerBlockImages );\n\n\tconst newImages = useGetNewImages( images, imageData );\n\n\t// Check if there is at least one image with lightbox enabled\n\tconst hasLightboxImages = lightboxSetting?.enabled\n\t\t? images.filter(\n\t\t\t\t( image ) =>\n\t\t\t\t\timage.attributes?.lightbox?.enabled === undefined ||\n\t\t\t\t\timage.attributes?.lightbox?.enabled === true\n\t\t ).length > 0\n\t\t: images.filter( ( image ) => image.attributes.lightbox?.enabled )\n\t\t\t\t.length > 0;\n\n\tconst themeOptions = themeRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst defaultOptions = defaultRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst aspectRatioOptions = [\n\t\t{\n\t\t\tlabel: _x(\n\t\t\t\t'Original',\n\t\t\t\t'Aspect ratio option for dimensions control'\n\t\t\t),\n\t\t\tvalue: 'auto',\n\t\t},\n\t\t...( showDefaultRatios ? defaultOptions || [] : [] ),\n\t\t...( themeOptions || [] ),\n\t];\n\n\tuseEffect( () => {\n\t\tnewImages?.forEach( ( newImage ) => {\n\t\t\t// Update the images data without creating new undo levels.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( newImage.clientId, {\n\t\t\t\t...buildImageAttributes( newImage.attributes ),\n\t\t\t\tid: newImage.id,\n\t\t\t\talign: undefined,\n\t\t\t} );\n\t\t} );\n\t}, [ newImages ] );\n\n\tconst imageSizeOptions = useImageSizes(\n\t\timageData,\n\t\tisSelected,\n\t\tgetSettings\n\t);\n\n\t/**\n\t * Determines the image attributes that should be applied to an image block\n\t * after the gallery updates.\n\t *\n\t * The gallery will receive the full collection of images when a new image\n\t * is added. As a result we need to reapply the image's original settings if\n\t * it already existed in the gallery. If the image is in fact new, we need\n\t * to apply the gallery's current settings to the image.\n\t *\n\t * @param {Object} imageAttributes Media object for the actual image.\n\t * @return {Object} Attributes to set on the new image block.\n\t */\n\tfunction buildImageAttributes( imageAttributes ) {\n\t\tconst image = imageAttributes.id\n\t\t\t? imageData.find( ( { id } ) => id === imageAttributes.id )\n\t\t\t: null;\n\n\t\tlet newClassName;\n\t\tif ( imageAttributes.className && imageAttributes.className !== '' ) {\n\t\t\tnewClassName = imageAttributes.className;\n\t\t}\n\n\t\tlet newLinkTarget;\n\t\tif ( imageAttributes.linkTarget || imageAttributes.rel ) {\n\t\t\t// When transformed from image blocks, the link destination and rel attributes are inherited.\n\t\t\tnewLinkTarget = {\n\t\t\t\tlinkTarget: imageAttributes.linkTarget,\n\t\t\t\trel: imageAttributes.rel,\n\t\t\t};\n\t\t} else {\n\t\t\t// When an image is added, update the link destination and rel attributes according to the gallery settings\n\t\t\tnewLinkTarget = getUpdatedLinkTargetSettings(\n\t\t\t\tlinkTarget,\n\t\t\t\tattributes\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\t...pickRelevantMediaFiles( image, sizeSlug ),\n\t\t\t...getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tlinkTo,\n\t\t\t\timageAttributes?.linkDestination\n\t\t\t),\n\t\t\t...newLinkTarget,\n\t\t\tclassName: newClassName,\n\t\t\tsizeSlug,\n\t\t\tcaption:\n\t\t\t\timageAttributes.caption.length > 0\n\t\t\t\t\t? imageAttributes.caption\n\t\t\t\t\t: image.caption?.raw,\n\t\t\talt: imageAttributes.alt || image.alt_text,\n\t\t\taspectRatio: aspectRatio === 'auto' ? undefined : aspectRatio,\n\t\t};\n\t}\n\n\tfunction isValidFileType( file ) {\n\t\tconst mediaTypeSelector = file.type;\n\n\t\treturn (\n\t\t\tALLOWED_MEDIA_TYPES.some(\n\t\t\t\t( mediaType ) => mediaTypeSelector?.indexOf( mediaType ) === 0\n\t\t\t) || file.blob\n\t\t);\n\t}\n\n\tfunction updateImages( selectedImages ) {\n\t\tconst newFileUploads =\n\t\t\tObject.prototype.toString.call( selectedImages ) ===\n\t\t\t'[object FileList]';\n\n\t\tconst imageArray = newFileUploads\n\t\t\t? Array.from( selectedImages ).map( ( file ) => {\n\t\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t } )\n\t\t\t: selectedImages;\n\n\t\tif ( ! imageArray.every( isValidFileType ) ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t),\n\t\t\t\t{ id: 'gallery-upload-invalid-file', type: 'snackbar' }\n\t\t\t);\n\t\t}\n\n\t\tconst processedImages = imageArray\n\t\t\t.filter( ( file ) => file.url || isValidFileType( file ) )\n\t\t\t.map( ( file ) => {\n\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tblob: file.blob || createBlobURL( file ),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn file;\n\t\t\t} );\n\n\t\t// Because we are reusing existing innerImage blocks any reordering\n\t\t// done in the media library will be lost so we need to reapply that ordering\n\t\t// once the new image blocks are merged in with existing.\n\t\tconst newOrderMap = processedImages.reduce(\n\t\t\t( result, image, index ) => (\n\t\t\t\t( result[ image.id ] = index ), result\n\t\t\t),\n\t\t\t{}\n\t\t);\n\n\t\tconst existingImageBlocks = ! newFileUploads\n\t\t\t? innerBlockImages.filter( ( block ) =>\n\t\t\t\t\tprocessedImages.find(\n\t\t\t\t\t\t( img ) => img.id === block.attributes.id\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: innerBlockImages;\n\n\t\tconst newImageList = processedImages.filter(\n\t\t\t( img ) =>\n\t\t\t\t! existingImageBlocks.find(\n\t\t\t\t\t( existingImg ) => img.id === existingImg.attributes.id\n\t\t\t\t)\n\t\t);\n\n\t\tconst newBlocks = newImageList.map( ( image ) => {\n\t\t\treturn createBlock( 'core/image', {\n\t\t\t\tid: image.id,\n\t\t\t\tblob: image.blob,\n\t\t\t\turl: image.url,\n\t\t\t\tcaption: image.caption,\n\t\t\t\talt: image.alt,\n\t\t\t} );\n\t\t} );\n\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\texistingImageBlocks\n\t\t\t\t.concat( newBlocks )\n\t\t\t\t.sort(\n\t\t\t\t\t( a, b ) =>\n\t\t\t\t\t\tnewOrderMap[ a.attributes.id ] -\n\t\t\t\t\t\tnewOrderMap[ b.attributes.id ]\n\t\t\t\t)\n\t\t);\n\n\t\t// Select the first block to scroll into view when new blocks are added.\n\t\tif ( newBlocks?.length > 0 ) {\n\t\t\tselectBlock( newBlocks[ 0 ].clientId );\n\t\t}\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\n\t\t\tchangedAttributes[ block.clientId ] = getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tvalue,\n\t\t\t\tfalse,\n\t\t\t\tblock.attributes,\n\t\t\t\tlightboxSetting\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst linkToText = [ ...linkOptions ].find(\n\t\t\t( linkType ) => linkType.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image links updated to: %s' ),\n\t\t\t\tlinkToText.noticeText\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-linkTo',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetAttributes( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetAttributes( { imageCrop: ! imageCrop } );\n\t}\n\n\tfunction toggleRandomOrder() {\n\t\tsetAttributes( { randomOrder: ! randomOrder } );\n\t}\n\n\tfunction toggleOpenInNewTab( openInNewTab ) {\n\t\tconst newLinkTarget = openInNewTab ? '_blank' : undefined;\n\t\tsetAttributes( { linkTarget: newLinkTarget } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = getUpdatedLinkTargetSettings(\n\t\t\t\tnewLinkTarget,\n\t\t\t\tblock.attributes\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst noticeText = openInNewTab\n\t\t\t? __( 'All gallery images updated to open in new tab' )\n\t\t\t: __( 'All gallery images updated to not open in new tab' );\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-openInNewTab',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tsetAttributes( { sizeSlug: newSizeSlug } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getImageSizeAttributes(\n\t\t\t\timage,\n\t\t\t\tnewSizeSlug\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst imageSize = imageSizeOptions.find(\n\t\t\t( size ) => size.value === newSizeSlug\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image sizes updated to: %s' ),\n\t\t\t\timageSize?.label ?? newSizeSlug\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-sizeSlug',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setAspectRatio( value ) {\n\t\tsetAttributes( { aspectRatio: value } );\n\n\t\t// Update all inner image blocks with the new aspect ratio\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = {\n\t\t\t\taspectRatio: value === 'auto' ? undefined : value,\n\t\t\t};\n\t\t} );\n\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\n\t\tconst aspectRatioText = aspectRatioOptions.find(\n\t\t\t( option ) => option.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: aspect ratio setting */\n\t\t\t\t__( 'All gallery images updated to aspect ratio: %s' ),\n\t\t\t\taspectRatioText?.label || value\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-aspectRatio',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImages = !! images.length;\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\tconst imagesUploading = images.some(\n\t\t( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0\n\t);\n\n\tconst mediaPlaceholderProps = {\n\t\taddToGallery: false,\n\t\tdisableMediaButtons: imagesUploading,\n\t\tvalue: {},\n\t};\n\tconst mediaPlaceholder = (\n\t\t<MediaPlaceholder\n\t\t\thandleUpload={ false }\n\t\t\ticon={ sharedIcon }\n\t\t\tlabels={ {\n\t\t\t\ttitle: __( 'Gallery' ),\n\t\t\t\tinstructions: PLACEHOLDER_TEXT,\n\t\t\t} }\n\t\t\tonSelect={ updateImages }\n\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\tmultiple\n\t\t\tonError={ onUploadError }\n\t\t\t{ ...mediaPlaceholderProps }\n\t\t/>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( className, 'has-nested-images' ),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t} );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tif ( ! hasImages ) {\n\t\treturn (\n\t\t\t<View { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst hasLinkTo = linkTo && linkTo !== 'none';\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tnavigationButtonType: 'icon',\n\t\t\t\t\t\t\tcolumns: undefined,\n\t\t\t\t\t\t\timageCrop: true,\n\t\t\t\t\t\t\trandomOrder: false,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tsetAspectRatio( 'auto' );\n\n\t\t\t\t\t\tif ( sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG ) {\n\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( linkTarget ) {\n\t\t\t\t\t\t\ttoggleOpenInNewTab( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ images.length > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t!! columns && columns !== images.length\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setColumnsNumber( undefined ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tcolumns\n\t\t\t\t\t\t\t\t\t\t? columns\n\t\t\t\t\t\t\t\t\t\t: defaultColumnsNumber( images.length )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ Math.min( MAX_COLUMNS, images.length ) }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\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\t{ imageSizeOptions?.length > 0 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tsizeSlug !== DEFAULT_MEDIA_SIZE_SLUG\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Select the size of the source images.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\t\thideCancelButton\n\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\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\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\thasValue={ () => ! imageCrop }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { imageCrop: true } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\t\tchecked={ !! imageCrop }\n\t\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Randomize order' ) }\n\t\t\t\t\t\thasValue={ () => !! randomOrder }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { randomOrder: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Randomize order' ) }\n\t\t\t\t\t\t\tchecked={ !! randomOrder }\n\t\t\t\t\t\t\tonChange={ toggleRandomOrder }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ hasLinkTo && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\thasValue={ () => !! linkTarget }\n\t\t\t\t\t\t\tonDeselect={ () => toggleOpenInNewTab( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t\tonChange={ toggleOpenInNewTab }\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\t{ aspectRatioOptions.length > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t!! aspectRatio && aspectRatio !== 'auto'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setAspectRatio( 'auto' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Set a consistent aspect ratio for all images in the gallery.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ aspectRatio }\n\t\t\t\t\t\t\t\toptions={ aspectRatioOptions }\n\t\t\t\t\t\t\t\tonChange={ setAspectRatio }\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\t{ lightboxSetting?.allowEditing && hasLightboxImages && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => navigationButtonType !== 'icon' }\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\tnavigationButtonType: 'icon',\n\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\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\t\tvalue={ navigationButtonType }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tnavigationButtonType: value,\n\t\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\tisBlock\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adjust the appearance of buttons in the lightbox.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ NAVIGATION_BUTTON_TYPE_OPTIONS.map(\n\t\t\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\n\t\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) }\n\t\t\t\t\t\t\t</ToggleGroupControl>\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<BlockControls group=\"block\">\n\t\t\t\t<ToolbarDropdownMenu icon={ linkIcon } label={ __( 'Link' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ linkOptions.map( ( linkItem ) => {\n\t\t\t\t\t\t\t\tconst isOptionSelected =\n\t\t\t\t\t\t\t\t\tlinkTo === linkItem.value;\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ linkItem.value }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isOptionSelected }\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'is-active': isOptionSelected,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\ticon={ linkItem.icon }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetLinkTo( linkItem.value );\n\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t\tinfo={ linkItem.infoText }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ linkItem.label }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<>\n\t\t\t\t{ ! multiGallerySelection && (\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\t\t\tname={ __( 'Add' ) }\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\tmediaIds={ images\n\t\t\t\t\t\t\t\t.filter( ( image ) => image.id )\n\t\t\t\t\t\t\t\t.map( ( image ) => image.id ) }\n\t\t\t\t\t\t\taddToGallery={ hasImageIds }\n\t\t\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t\t<GapStyles\n\t\t\t\t\tblockGap={ attributes.style?.spacing?.blockGap }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</>\n\t\t\t<Gallery\n\t\t\t\t{ ...props }\n\t\t\t\tisContentLocked={ isContentLocked }\n\t\t\t\timages={ images }\n\t\t\t\tmediaPlaceholder={ ! hasImages ? mediaPlaceholder : undefined }\n\t\t\t\tblockProps={ innerBlocksProps }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC,oCAAoC;AAAA,EACpC,0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kBAAmB,CAAE,YAAY,mBAAmB;AAAA,QACpD,YAAa;AAAA,QACb;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\tToggleControl,\n\tRangeControl,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToolbarDropdownMenu,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tuseBlockEditingMode,\n\tBlockControls,\n\tMediaReplaceFlow,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { createBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tlink as linkIcon,\n\tcustomLink,\n\timage as imageIcon,\n\tlinkOff,\n\tfullscreen,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from './shared-icon';\nimport { defaultColumnsNumber, pickRelevantMediaFiles } from './shared';\nimport { getHrefAndDestination } from './utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tgetUpdatedLinkTargetSettings,\n\tgetImageSizeAttributes,\n} from '../image/utils';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_LIGHTBOX,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n} from './constants';\nimport useImageSizes from './use-image-sizes';\nimport useGetNewImages from './use-get-new-images';\nimport useGetMedia from './use-get-media';\nimport GalleryGapCustomProperties from './gap-styles';\nimport useDynamicGallery from './use-dynamic-gallery';\nimport { GallerySourcePanel, GalleryDynamicView } from './dynamic-gallery';\nimport { getDynamicSource, ATTACHED_MEDIA } from './dynamic-source';\n\nconst MAX_COLUMNS = 8;\nconst LINK_OPTIONS = [\n\t{\n\t\ticon: customLink,\n\t\tlabel: __( 'Link images to attachment pages' ),\n\t\tvalue: LINK_DESTINATION_ATTACHMENT,\n\t\tnoticeText: __( 'Attachment Pages' ),\n\t},\n\t{\n\t\ticon: imageIcon,\n\t\tlabel: __( 'Link images to media files' ),\n\t\tvalue: LINK_DESTINATION_MEDIA,\n\t\tnoticeText: __( 'Media Files' ),\n\t},\n\t{\n\t\ticon: fullscreen,\n\t\tlabel: __( 'Enlarge on click' ),\n\t\tvalue: LINK_DESTINATION_LIGHTBOX,\n\t\tnoticeText: __( 'Lightbox effect' ),\n\t\tinfoText: __( 'Scale images with a lightbox effect' ),\n\t},\n\t{\n\t\ticon: linkOff,\n\t\tlabel: _x( 'None', 'Media item link option' ),\n\t\tvalue: LINK_DESTINATION_NONE,\n\t\tnoticeText: __( 'None' ),\n\t},\n];\nconst NAVIGATION_BUTTON_TYPE_OPTIONS = [\n\t{\n\t\tlabel: __( 'Icon' ),\n\t\tvalue: 'icon',\n\t},\n\t{\n\t\tlabel: __( 'Text' ),\n\t\tvalue: 'text',\n\t},\n\t{\n\t\tlabel: __( 'Both' ),\n\t\tvalue: 'both',\n\t},\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = __(\n\t'Drag and drop images, upload, or choose from your library.'\n);\n\nconst DEFAULT_BLOCK = { name: 'core/image' };\nconst EMPTY_ARRAY = [];\n\nexport default function GalleryEdit( props ) {\n\tconst {\n\t\tsetAttributes,\n\t\tattributes,\n\t\tclassName,\n\t\tclientId,\n\t\tisSelected,\n\t\tinsertBlocksAfter,\n\t\tisContentLocked,\n\t\tcontext,\n\t\t__unstableLayoutClassNames: layoutClassNames,\n\t} = props;\n\n\tconst postId = context?.postId;\n\tconst postType = context?.postType;\n\n\t// Entering dynamic mode is a structural change (it discards inner blocks and\n\t// switches the block's mode), so the entry point is only offered when the\n\t// block is fully editable — mirroring the dynamic view's \"Edit images\"\n\t// toolbar control. Under a content lock the mode is `'contentOnly'`/\n\t// `'disabled'`, where structural affordances are hidden.\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ lightboxSetting, defaultRatios, themeRatios, showDefaultRatios ] =\n\t\tuseSettings(\n\t\t\t'blocks.core/image.lightbox',\n\t\t\t'dimensions.aspectRatios.default',\n\t\t\t'dimensions.aspectRatios.theme',\n\t\t\t'dimensions.defaultAspectRatios'\n\t\t);\n\n\tconst linkOptions = ! lightboxSetting?.allowEditing\n\t\t? LINK_OPTIONS.filter(\n\t\t\t\t( option ) => option.value !== LINK_DESTINATION_LIGHTBOX\n\t\t )\n\t\t: LINK_OPTIONS;\n\n\tconst {\n\t\talign,\n\t\tnavigationButtonType,\n\t\tcolumns,\n\t\timageCrop,\n\t\trandomOrder,\n\t\tlinkTarget,\n\t\tlinkTo,\n\t\tsizeSlug,\n\t\taspectRatio,\n\t} = attributes;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceInnerBlocks,\n\t\tupdateBlockAttributes,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst { getBlock, getSettings, innerBlockImages, multiGallerySelection } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockName,\n\t\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\t\tgetSettings: _getSettings,\n\t\t\t\t\tgetBlock: _getBlock,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst multiSelectedClientIds = getMultiSelectedBlockClientIds();\n\n\t\t\t\treturn {\n\t\t\t\t\tgetBlock: _getBlock,\n\t\t\t\t\tgetSettings: _getSettings,\n\t\t\t\t\tinnerBlockImages:\n\t\t\t\t\t\t_getBlock( clientId )?.innerBlocks ?? EMPTY_ARRAY,\n\t\t\t\t\tmultiGallerySelection:\n\t\t\t\t\t\tmultiSelectedClientIds.length &&\n\t\t\t\t\t\tmultiSelectedClientIds.every(\n\t\t\t\t\t\t\t( _clientId ) =>\n\t\t\t\t\t\t\t\tgetBlockName( _clientId ) === 'core/gallery'\n\t\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\tconst images = useMemo(\n\t\t() =>\n\t\t\tinnerBlockImages?.map( ( block ) => ( {\n\t\t\t\tclientId: block.clientId,\n\t\t\t\tid: block.attributes.id,\n\t\t\t\turl: block.attributes.url,\n\t\t\t\tattributes: block.attributes,\n\t\t\t\tfromSavedContent: Boolean( block.originalContent ),\n\t\t\t} ) ),\n\t\t[ innerBlockImages ]\n\t);\n\n\tconst imageData = useGetMedia( innerBlockImages );\n\n\tconst newImages = useGetNewImages( images, imageData );\n\n\tconst hasImages = !! images.length;\n\tconst isDynamic = !! attributes.dynamicContent;\n\n\t// Dynamic mode (resolving images from a source instead of inner blocks):\n\t// source resolution, the editor-preview blocks, and the mode/ordering\n\t// actions.\n\tconst dynamic = useDynamicGallery( {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclientId,\n\t\tpostId,\n\t\tpostType,\n\t} );\n\n\t// State that drives counts/size options should reflect the dynamic media\n\t// when the gallery is in dynamic mode.\n\tconst displayedImageCount = isDynamic\n\t\t? dynamic.dynamicMedia.length\n\t\t: images.length;\n\n\t// Check if there is at least one image with lightbox enabled. In dynamic\n\t// mode the images inherit the gallery's link setting, so the lightbox is on\n\t// when the gallery links images to the lightbox.\n\tlet hasLightboxImages;\n\tif ( isDynamic ) {\n\t\thasLightboxImages = linkTo === LINK_DESTINATION_LIGHTBOX;\n\t} else if ( lightboxSetting?.enabled ) {\n\t\thasLightboxImages =\n\t\t\timages.filter(\n\t\t\t\t( image ) =>\n\t\t\t\t\timage.attributes?.lightbox?.enabled === undefined ||\n\t\t\t\t\timage.attributes?.lightbox?.enabled === true\n\t\t\t).length > 0;\n\t} else {\n\t\thasLightboxImages =\n\t\t\timages.filter( ( image ) => image.attributes.lightbox?.enabled )\n\t\t\t\t.length > 0;\n\t}\n\n\tconst themeOptions = themeRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst defaultOptions = defaultRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst aspectRatioOptions = [\n\t\t{\n\t\t\tlabel: _x(\n\t\t\t\t'Original',\n\t\t\t\t'Aspect ratio option for dimensions control'\n\t\t\t),\n\t\t\tvalue: 'auto',\n\t\t},\n\t\t...( showDefaultRatios ? defaultOptions || [] : [] ),\n\t\t...( themeOptions || [] ),\n\t];\n\n\tuseEffect( () => {\n\t\tnewImages?.forEach( ( newImage ) => {\n\t\t\t// Update the images data without creating new undo levels.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( newImage.clientId, {\n\t\t\t\t...buildImageAttributes( newImage.attributes ),\n\t\t\t\tid: newImage.id,\n\t\t\t\talign: undefined,\n\t\t\t} );\n\t\t} );\n\t}, [ newImages ] );\n\n\tconst imageSizeOptions = useImageSizes(\n\t\tisDynamic ? dynamic.dynamicMedia : imageData,\n\t\tisSelected,\n\t\tgetSettings\n\t);\n\n\t/**\n\t * Determines the image attributes that should be applied to an image block\n\t * after the gallery updates.\n\t *\n\t * The gallery will receive the full collection of images when a new image\n\t * is added. As a result we need to reapply the image's original settings if\n\t * it already existed in the gallery. If the image is in fact new, we need\n\t * to apply the gallery's current settings to the image.\n\t *\n\t * @param {Object} imageAttributes Media object for the actual image.\n\t * @return {Object} Attributes to set on the new image block.\n\t */\n\tfunction buildImageAttributes( imageAttributes ) {\n\t\tconst image = imageAttributes.id\n\t\t\t? imageData.find( ( { id } ) => id === imageAttributes.id )\n\t\t\t: null;\n\n\t\tlet newClassName;\n\t\tif ( imageAttributes.className && imageAttributes.className !== '' ) {\n\t\t\tnewClassName = imageAttributes.className;\n\t\t}\n\n\t\tlet newLinkTarget;\n\t\tif ( imageAttributes.linkTarget || imageAttributes.rel ) {\n\t\t\t// When transformed from image blocks, the link destination and rel attributes are inherited.\n\t\t\tnewLinkTarget = {\n\t\t\t\tlinkTarget: imageAttributes.linkTarget,\n\t\t\t\trel: imageAttributes.rel,\n\t\t\t};\n\t\t} else {\n\t\t\t// When an image is added, update the link destination and rel attributes according to the gallery settings\n\t\t\tnewLinkTarget = getUpdatedLinkTargetSettings(\n\t\t\t\tlinkTarget,\n\t\t\t\tattributes\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\t...pickRelevantMediaFiles( image, sizeSlug ),\n\t\t\t...getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tlinkTo,\n\t\t\t\timageAttributes?.linkDestination\n\t\t\t),\n\t\t\t...newLinkTarget,\n\t\t\tclassName: newClassName,\n\t\t\tsizeSlug,\n\t\t\tcaption:\n\t\t\t\timageAttributes.caption.length > 0\n\t\t\t\t\t? imageAttributes.caption\n\t\t\t\t\t: image.caption?.raw,\n\t\t\talt: imageAttributes.alt || image.alt_text,\n\t\t\taspectRatio: aspectRatio === 'auto' ? undefined : aspectRatio,\n\t\t};\n\t}\n\n\tfunction isValidFileType( file ) {\n\t\tconst mediaTypeSelector = file.type;\n\n\t\treturn (\n\t\t\tALLOWED_MEDIA_TYPES.some(\n\t\t\t\t( mediaType ) => mediaTypeSelector?.indexOf( mediaType ) === 0\n\t\t\t) || file.blob\n\t\t);\n\t}\n\n\tfunction updateImages( selectedImages ) {\n\t\tconst newFileUploads =\n\t\t\tObject.prototype.toString.call( selectedImages ) ===\n\t\t\t'[object FileList]';\n\n\t\tconst imageArray = newFileUploads\n\t\t\t? Array.from( selectedImages ).map( ( file ) => {\n\t\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t } )\n\t\t\t: selectedImages;\n\n\t\tif ( ! imageArray.every( isValidFileType ) ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t),\n\t\t\t\t{ id: 'gallery-upload-invalid-file', type: 'snackbar' }\n\t\t\t);\n\t\t}\n\n\t\tconst processedImages = imageArray\n\t\t\t.filter( ( file ) => file.url || isValidFileType( file ) )\n\t\t\t.map( ( file ) => {\n\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tblob: file.blob || createBlobURL( file ),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn file;\n\t\t\t} );\n\n\t\t// Because we are reusing existing innerImage blocks any reordering\n\t\t// done in the media library will be lost so we need to reapply that ordering\n\t\t// once the new image blocks are merged in with existing.\n\t\tconst newOrderMap = processedImages.reduce(\n\t\t\t( result, image, index ) => (\n\t\t\t\t( result[ image.id ] = index ), result\n\t\t\t),\n\t\t\t{}\n\t\t);\n\n\t\tconst existingImageBlocks = ! newFileUploads\n\t\t\t? innerBlockImages.filter( ( block ) =>\n\t\t\t\t\tprocessedImages.find(\n\t\t\t\t\t\t( img ) => img.id === block.attributes.id\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: innerBlockImages;\n\n\t\tconst newImageList = processedImages.filter(\n\t\t\t( img ) =>\n\t\t\t\t! existingImageBlocks.find(\n\t\t\t\t\t( existingImg ) => img.id === existingImg.attributes.id\n\t\t\t\t)\n\t\t);\n\n\t\tconst newBlocks = newImageList.map( ( image ) => {\n\t\t\treturn createBlock( 'core/image', {\n\t\t\t\tid: image.id,\n\t\t\t\tblob: image.blob,\n\t\t\t\turl: image.url,\n\t\t\t\tcaption: image.caption,\n\t\t\t\talt: image.alt,\n\t\t\t} );\n\t\t} );\n\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\texistingImageBlocks\n\t\t\t\t.concat( newBlocks )\n\t\t\t\t.sort(\n\t\t\t\t\t( a, b ) =>\n\t\t\t\t\t\tnewOrderMap[ a.attributes.id ] -\n\t\t\t\t\t\tnewOrderMap[ b.attributes.id ]\n\t\t\t\t)\n\t\t);\n\n\t\t// Select the first block to scroll into view when new blocks are added.\n\t\tif ( newBlocks?.length > 0 ) {\n\t\t\tselectBlock( newBlocks[ 0 ].clientId );\n\t\t}\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\n\t\t\tchangedAttributes[ block.clientId ] = getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tvalue,\n\t\t\t\tfalse,\n\t\t\t\tblock.attributes,\n\t\t\t\tlightboxSetting\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst linkToText = [ ...linkOptions ].find(\n\t\t\t( linkType ) => linkType.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image links updated to: %s' ),\n\t\t\t\tlinkToText.noticeText\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-linkTo',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetAttributes( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetAttributes( { imageCrop: ! imageCrop } );\n\t}\n\n\tfunction toggleRandomOrder() {\n\t\tsetAttributes( { randomOrder: ! randomOrder } );\n\t}\n\n\tfunction toggleOpenInNewTab( openInNewTab ) {\n\t\tconst newLinkTarget = openInNewTab ? '_blank' : undefined;\n\t\tsetAttributes( { linkTarget: newLinkTarget } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = getUpdatedLinkTargetSettings(\n\t\t\t\tnewLinkTarget,\n\t\t\t\tblock.attributes\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst noticeText = openInNewTab\n\t\t\t? __( 'All gallery images updated to open in new tab' )\n\t\t\t: __( 'All gallery images updated to not open in new tab' );\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-openInNewTab',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tsetAttributes( { sizeSlug: newSizeSlug } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getImageSizeAttributes(\n\t\t\t\timage,\n\t\t\t\tnewSizeSlug\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst imageSize = imageSizeOptions.find(\n\t\t\t( size ) => size.value === newSizeSlug\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image sizes updated to: %s' ),\n\t\t\t\timageSize?.label ?? newSizeSlug\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-sizeSlug',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setAspectRatio( value ) {\n\t\tsetAttributes( { aspectRatio: value } );\n\n\t\t// Update all inner image blocks with the new aspect ratio\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = {\n\t\t\t\taspectRatio: value === 'auto' ? undefined : value,\n\t\t\t};\n\t\t} );\n\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\n\t\tconst aspectRatioText = aspectRatioOptions.find(\n\t\t\t( option ) => option.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: aspect ratio setting */\n\t\t\t\t__( 'All gallery images updated to aspect ratio: %s' ),\n\t\t\t\taspectRatioText?.label || value\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-aspectRatio',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\tconst imagesUploading = images.some(\n\t\t( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0\n\t);\n\n\tconst mediaPlaceholderProps = {\n\t\taddToGallery: false,\n\t\tdisableMediaButtons: imagesUploading,\n\t\tvalue: {},\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\tclassName,\n\t\t\t'has-nested-images',\n\t\t\t// In dynamic mode there are no inner blocks and the gallery isn't\n\t\t\t// rendered through the `Gallery` component, so the classes that\n\t\t\t// component normally composes onto the `<figure>` (see `gallery.js`)\n\t\t\t// must be added here to keep the preview's flex/crop layout matching\n\t\t\t// the static gallery and the frontend.\n\t\t\tisDynamic && [\n\t\t\t\tlayoutClassNames,\n\t\t\t\t'blocks-gallery-grid',\n\t\t\t\t{\n\t\t\t\t\t[ `align${ align }` ]: align,\n\t\t\t\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t\t\t\t'columns-default': columns === undefined,\n\t\t\t\t\t'is-cropped': imageCrop,\n\t\t\t\t},\n\t\t\t]\n\t\t),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\t// In dynamic mode nothing may be inserted: the images are resolved from\n\t\t// the source, not authored as inner blocks. `allowedBlocks: []` enforces\n\t\t// this in every context — unlike `templateLock: 'all'`, it isn't relaxed\n\t\t// to `contentOnly` by a content-locked ancestor — so it blocks insertion\n\t\t// and drag-and-drop (via `canInsertBlockType`). It's also what opts the\n\t\t// gallery out of the List View: a block that can't be inserted into and\n\t\t// has no inner blocks has nothing to navigate or add (see\n\t\t// `shouldRenderBlockListView`). This reaches the block's list settings\n\t\t// only while the inner blocks are mounted, which is why the dynamic view\n\t\t// still renders the (empty) inner blocks.\n\t\tallowedBlocks: isDynamic ? EMPTY_ARRAY : undefined,\n\t} );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tif ( ! hasImages && ! isDynamic ) {\n\t\treturn (\n\t\t\t<div { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\ticon={ sharedIcon }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'Gallery' ),\n\t\t\t\t\t\tinstructions: PLACEHOLDER_TEXT,\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tmultiple\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t{ ...mediaPlaceholderProps }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Entry into dynamic mode. Gated on the editing mode so it's\n\t\t\t\t\t * hidden in content-only editing (where this structural change\n\t\t\t\t\t * isn't allowed), but intentionally not hidden by\n\t\t\t\t\t * `canUseDynamicSource` the way the inspector is (see\n\t\t\t\t\t * `dynamic-gallery.js`): even with no\n\t\t\t\t\t * post type to preview against, the source still resolves at\n\t\t\t\t\t * render time via `get_the_ID()` (see `index.php`) — e.g. in a\n\t\t\t\t\t * template part or pattern shown on a singular page.\n\t\t\t\t\t */ }\n\t\t\t\t\t{ blockEditingMode === 'default' && (\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=\"secondary\"\n\t\t\t\t\t\t\tonClick={ dynamic.enableDynamicMode }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ getDynamicSource( ATTACHED_MEDIA ).title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</MediaPlaceholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst hasLinkTo = linkTo && linkTo !== 'none';\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<GallerySourcePanel\n\t\t\t\t\tdynamic={ dynamic }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\thasImages={ hasImages }\n\t\t\t\t/>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tnavigationButtonType: 'icon',\n\t\t\t\t\t\t\tcolumns: undefined,\n\t\t\t\t\t\t\timageCrop: true,\n\t\t\t\t\t\t\trandomOrder: false,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tsetAspectRatio( 'auto' );\n\n\t\t\t\t\t\tif ( sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG ) {\n\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( linkTarget ) {\n\t\t\t\t\t\t\ttoggleOpenInNewTab( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ displayedImageCount > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t!! columns && columns !== displayedImageCount\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setColumnsNumber( undefined ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tcolumns\n\t\t\t\t\t\t\t\t\t\t? columns\n\t\t\t\t\t\t\t\t\t\t: defaultColumnsNumber(\n\t\t\t\t\t\t\t\t\t\t\t\tdisplayedImageCount\n\t\t\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\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ Math.min(\n\t\t\t\t\t\t\t\t\tMAX_COLUMNS,\n\t\t\t\t\t\t\t\t\tdisplayedImageCount\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\trequired\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\t{ imageSizeOptions?.length > 0 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tsizeSlug !== DEFAULT_MEDIA_SIZE_SLUG\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Select the size of the source images.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\t\thideCancelButton\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\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\thasValue={ () => ! imageCrop }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { imageCrop: true } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\t\tchecked={ !! imageCrop }\n\t\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Randomize order' ) }\n\t\t\t\t\t\thasValue={ () => !! randomOrder }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { randomOrder: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Randomize order' ) }\n\t\t\t\t\t\t\tchecked={ !! randomOrder }\n\t\t\t\t\t\t\tonChange={ toggleRandomOrder }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ hasLinkTo && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\thasValue={ () => !! linkTarget }\n\t\t\t\t\t\t\tonDeselect={ () => toggleOpenInNewTab( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t\tonChange={ toggleOpenInNewTab }\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\t{ aspectRatioOptions.length > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t!! aspectRatio && aspectRatio !== 'auto'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setAspectRatio( 'auto' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Set a consistent aspect ratio for all images in the gallery.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ aspectRatio }\n\t\t\t\t\t\t\t\toptions={ aspectRatioOptions }\n\t\t\t\t\t\t\t\tonChange={ setAspectRatio }\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\t{ lightboxSetting?.allowEditing && hasLightboxImages && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => navigationButtonType !== 'icon' }\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\tnavigationButtonType: 'icon',\n\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\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\t\tvalue={ navigationButtonType }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tnavigationButtonType: value,\n\t\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\tisBlock\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adjust the appearance of buttons in the lightbox.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ NAVIGATION_BUTTON_TYPE_OPTIONS.map(\n\t\t\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\n\t\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) }\n\t\t\t\t\t\t\t</ToggleGroupControl>\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<BlockControls group=\"block\">\n\t\t\t\t<ToolbarDropdownMenu icon={ linkIcon } label={ __( 'Link' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ linkOptions.map( ( linkItem ) => {\n\t\t\t\t\t\t\t\tconst isOptionSelected =\n\t\t\t\t\t\t\t\t\tlinkTo === linkItem.value;\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ linkItem.value }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isOptionSelected }\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'is-active': isOptionSelected,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\ticon={ linkItem.icon }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetLinkTo( linkItem.value );\n\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t\tinfo={ linkItem.infoText }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ linkItem.label }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<>\n\t\t\t\t{ ! multiGallerySelection && ! isDynamic && (\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\t\t\tname={ __( 'Add' ) }\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\tmediaIds={ images\n\t\t\t\t\t\t\t\t.filter( ( image ) => image.id )\n\t\t\t\t\t\t\t\t.map( ( image ) => image.id ) }\n\t\t\t\t\t\t\taddToGallery={ hasImageIds }\n\t\t\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t\t<GalleryGapCustomProperties\n\t\t\t\t\tstyle={ attributes.style }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</>\n\t\t\t{ isDynamic ? (\n\t\t\t\t<GalleryDynamicView\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tdynamic={ dynamic }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tinnerBlocksProps={ innerBlocksProps }\n\t\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Gallery\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tisContentLocked={ isContentLocked }\n\t\t\t\t\timages={ images }\n\t\t\t\t\tblockProps={ innerBlocksProps }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,EAC1C;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,WAAW,eAAe;AACnC,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,WAAW,mBAAmB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,oBAAoB;AACtC;AAAA,EACC,QAAQ;AAAA,EACR;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACM;AAKP,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB,8BAA8B;AAC7D,SAAS,6BAA6B;AACtC,SAAS,sCAAsC;AAC/C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,aAAa;AACpB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,OAAO,iBAAiB;AACxB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e;AAAA,UACf,UAAW;AAAA,UACX,MAAO,GAAI,KAAM;AAAA,UACjB,UAAQ;AAAA,UACR,UAAW,OACT,OAAQ,CAAE,UAAW,MAAM,EAAG,EAC9B,IAAK,CAAE,UAAW,MAAM,EAAG;AAAA,UAC7B,cAAe;AAAA,UACf,SAAQ;AAAA;AAAA,MACT,GACD;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ,WAAW;AAAA,UACnB;AAAA;AAAA,MACD;AAAA,OACD;AAAA,IACE,YACD;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD,IAEA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACL;AAAA,QACA;AAAA,QACA,YAAa;AAAA,QACb;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// packages/block-library/src/gallery/gallery.js
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { __ } from "@wordpress/i18n";
|
|
4
|
-
import { View } from "@wordpress/primitives";
|
|
5
4
|
import { Caption } from "../utils/caption.mjs";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
function Gallery(props) {
|
|
@@ -9,7 +8,6 @@ function Gallery(props) {
|
|
|
9
8
|
attributes,
|
|
10
9
|
isSelected,
|
|
11
10
|
setAttributes,
|
|
12
|
-
mediaPlaceholder,
|
|
13
11
|
insertBlocksAfter,
|
|
14
12
|
blockProps,
|
|
15
13
|
__unstableLayoutClassNames: layoutClassNames,
|
|
@@ -34,7 +32,6 @@ function Gallery(props) {
|
|
|
34
32
|
),
|
|
35
33
|
children: [
|
|
36
34
|
blockProps.children,
|
|
37
|
-
isSelected && !blockProps.children && /* @__PURE__ */ jsx(View, { className: "blocks-gallery-media-placeholder-wrapper", children: mediaPlaceholder }),
|
|
38
35
|
/* @__PURE__ */ jsx(
|
|
39
36
|
Caption,
|
|
40
37
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/gallery/gallery.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,UAAU;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Caption } from '../utils/caption';\n\nexport default function Gallery( props ) {\n\tconst {\n\t\tattributes,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tblockProps,\n\t\t__unstableLayoutClassNames: layoutClassNames,\n\t\tisContentLocked,\n\t\tmultiGallerySelection,\n\t} = props;\n\n\tconst { align, columns, imageCrop } = attributes;\n\n\treturn (\n\t\t<figure\n\t\t\t{ ...blockProps }\n\t\t\tclassName={ clsx(\n\t\t\t\tblockProps.className,\n\t\t\t\tlayoutClassNames,\n\t\t\t\t'blocks-gallery-grid',\n\t\t\t\t{\n\t\t\t\t\t[ `align${ align }` ]: align,\n\t\t\t\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t\t\t\t[ `columns-default` ]: columns === undefined,\n\t\t\t\t\t'is-cropped': imageCrop,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ blockProps.children }\n\t\t\t<Caption\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tshowToolbarButton={\n\t\t\t\t\t! multiGallerySelection && ! isContentLocked\n\t\t\t\t}\n\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\tlabel={ __( 'Gallery caption text' ) }\n\t\t\t\tplaceholder={ __( 'Add gallery caption' ) }\n\t\t\t/>\n\t\t</figure>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,UAAU;AAKnB,SAAS,eAAe;AAiBtB,SAeC,KAfD;AAfa,SAAR,QAA0B,OAAQ;AACxC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,4BAA4B;AAAA,IAC5B;AAAA,IACA;AAAA,EACD,IAAI;AAEJ,QAAM,EAAE,OAAO,SAAS,UAAU,IAAI;AAEtC,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,WAAY;AAAA,QACX,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,UACC,CAAE,QAAS,KAAM,EAAG,GAAG;AAAA,UACvB,CAAE,WAAY,OAAQ,EAAG,GAAG,YAAY;AAAA,UACxC,CAAE,iBAAkB,GAAG,YAAY;AAAA,UACnC,cAAc;AAAA,QACf;AAAA,MACD;AAAA,MAEE;AAAA,mBAAW;AAAA,QACb;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,mBACC,CAAE,yBAAyB,CAAE;AAAA,YAE9B,WAAU;AAAA,YACV,OAAQ,GAAI,sBAAuB;AAAA,YACnC,aAAc,GAAI,qBAAsB;AAAA;AAAA,QACzC;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,26 +1,65 @@
|
|
|
1
1
|
// packages/block-library/src/gallery/gap-styles.js
|
|
2
2
|
import {
|
|
3
3
|
__experimentalGetGapCSSValue as getGapCSSValue,
|
|
4
|
-
|
|
4
|
+
privateApis as blockEditorPrivateApis,
|
|
5
|
+
store as blockEditorStore,
|
|
6
|
+
useStyleOverride,
|
|
7
|
+
useSettings
|
|
5
8
|
} from "@wordpress/block-editor";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { useSelect } from "@wordpress/data";
|
|
10
|
+
import { privateApis as globalStylesEnginePrivateApis } from "@wordpress/global-styles-engine";
|
|
11
|
+
import { unlock } from "../lock-unlock.mjs";
|
|
12
|
+
var { getResponsiveMediaQueries } = unlock(globalStylesEnginePrivateApis);
|
|
13
|
+
var { globalStylesDataKey } = unlock(blockEditorPrivateApis);
|
|
14
|
+
var GALLERY_BLOCK_NAME = "core/gallery";
|
|
15
|
+
var FALLBACK_VALUE = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
|
|
16
|
+
function getGalleryGapCustomPropertyStyle(selector, blockGap) {
|
|
17
|
+
let column = FALLBACK_VALUE;
|
|
18
|
+
if (blockGap) {
|
|
19
|
+
column = typeof blockGap === "string" ? getGapCSSValue(blockGap) || FALLBACK_VALUE : getGapCSSValue(blockGap?.left) || FALLBACK_VALUE;
|
|
15
20
|
}
|
|
16
|
-
|
|
17
|
-
--wp--style--unstable-gallery-gap: ${column === "0" ? "0px" : column}
|
|
18
|
-
gap: ${gapValue}
|
|
21
|
+
return `${selector} {
|
|
22
|
+
--wp--style--unstable-gallery-gap: ${column === "0" ? "0px" : column}
|
|
19
23
|
}`;
|
|
24
|
+
}
|
|
25
|
+
function getBlockGapValue(style) {
|
|
26
|
+
if (!Object.hasOwn(style?.spacing || {}, "blockGap")) {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
return style.spacing.blockGap;
|
|
30
|
+
}
|
|
31
|
+
function GalleryGapCustomProperties({ style, clientId }) {
|
|
32
|
+
const selector = `#block-${clientId}`;
|
|
33
|
+
const [viewportSettings] = useSettings("viewport");
|
|
34
|
+
const globalStyles = useSelect(
|
|
35
|
+
(select) => select(blockEditorStore).getSettings()?.[globalStylesDataKey],
|
|
36
|
+
[]
|
|
37
|
+
);
|
|
38
|
+
const globalGalleryStyles = globalStyles?.blocks?.[GALLERY_BLOCK_NAME] || {};
|
|
39
|
+
const styleBlockGap = getBlockGapValue(style);
|
|
40
|
+
const globalGalleryBlockGap = globalGalleryStyles?.spacing?.blockGap ?? FALLBACK_VALUE;
|
|
41
|
+
const blockGap = styleBlockGap === void 0 ? globalGalleryBlockGap : styleBlockGap;
|
|
42
|
+
let gap = getGalleryGapCustomPropertyStyle(selector, blockGap);
|
|
43
|
+
Object.entries(getResponsiveMediaQueries(viewportSettings)).forEach(
|
|
44
|
+
([viewport, mediaQuery]) => {
|
|
45
|
+
const styleViewportBlockGap = getBlockGapValue(
|
|
46
|
+
style?.[viewport]
|
|
47
|
+
);
|
|
48
|
+
const globalViewportBlockGap = styleBlockGap === void 0 ? globalGalleryStyles?.[viewport]?.spacing?.blockGap : void 0;
|
|
49
|
+
const viewportBlockGap = styleViewportBlockGap === void 0 ? globalViewportBlockGap : styleViewportBlockGap;
|
|
50
|
+
if (viewportBlockGap === void 0 || viewportBlockGap === null) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
gap += `${mediaQuery}{${getGalleryGapCustomPropertyStyle(
|
|
54
|
+
selector,
|
|
55
|
+
viewportBlockGap
|
|
56
|
+
)}}`;
|
|
57
|
+
}
|
|
58
|
+
);
|
|
20
59
|
useStyleOverride({ css: gap });
|
|
21
60
|
return null;
|
|
22
61
|
}
|
|
23
62
|
export {
|
|
24
|
-
|
|
63
|
+
GalleryGapCustomProperties as default
|
|
25
64
|
};
|
|
26
65
|
//# sourceMappingURL=gap-styles.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/gallery/gap-styles.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGetGapCSSValue as getGapCSSValue,\n\tuseStyleOverride,\n} from '@wordpress/block-editor';\n\
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC,gCAAgC;AAAA,EAChC;AAAA,OACM;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGetGapCSSValue as getGapCSSValue,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tuseStyleOverride,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { getResponsiveMediaQueries } = unlock( globalStylesEnginePrivateApis );\nconst { globalStylesDataKey } = unlock( blockEditorPrivateApis );\nconst GALLERY_BLOCK_NAME = 'core/gallery';\n\n// --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default\n// gap on the gallery.\nconst FALLBACK_VALUE = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;\n\nfunction getGalleryGapCustomPropertyStyle( selector, blockGap ) {\n\tlet column = FALLBACK_VALUE;\n\tif ( blockGap ) {\n\t\tcolumn =\n\t\t\ttypeof blockGap === 'string'\n\t\t\t\t? getGapCSSValue( blockGap ) || FALLBACK_VALUE\n\t\t\t\t: getGapCSSValue( blockGap?.left ) || FALLBACK_VALUE;\n\t}\n\n\t// The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`.\n\treturn `${ selector } {\n\t\t--wp--style--unstable-gallery-gap: ${ column === '0' ? '0px' : column }\n\t}`;\n}\n\nfunction getBlockGapValue( style ) {\n\tif ( ! Object.hasOwn( style?.spacing || {}, 'blockGap' ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn style.spacing.blockGap;\n}\n\nexport default function GalleryGapCustomProperties( { style, clientId } ) {\n\tconst selector = `#block-${ clientId }`;\n\tconst [ viewportSettings ] = useSettings( 'viewport' );\n\tconst globalStyles = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()?.[ globalStylesDataKey ],\n\t\t[]\n\t);\n\tconst globalGalleryStyles =\n\t\tglobalStyles?.blocks?.[ GALLERY_BLOCK_NAME ] || {};\n\tconst styleBlockGap = getBlockGapValue( style );\n\tconst globalGalleryBlockGap =\n\t\tglobalGalleryStyles?.spacing?.blockGap ?? FALLBACK_VALUE;\n\t// Prefer the block's own gap value, then Gallery global styles. Missing\n\t// values fall back to the Gallery blockGap default.\n\tconst blockGap =\n\t\tstyleBlockGap === undefined ? globalGalleryBlockGap : styleBlockGap;\n\tlet gap = getGalleryGapCustomPropertyStyle( selector, blockGap );\n\n\tObject.entries( getResponsiveMediaQueries( viewportSettings ) ).forEach(\n\t\t( [ viewport, mediaQuery ] ) => {\n\t\t\tconst styleViewportBlockGap = getBlockGapValue(\n\t\t\t\tstyle?.[ viewport ]\n\t\t\t);\n\t\t\t// Viewport-specific block values win. Gallery global viewport values\n\t\t\t// only apply when the block has no base gap, so they do not override an instance value.\n\t\t\tconst globalViewportBlockGap =\n\t\t\t\tstyleBlockGap === undefined\n\t\t\t\t\t? globalGalleryStyles?.[ viewport ]?.spacing?.blockGap\n\t\t\t\t\t: undefined;\n\t\t\tconst viewportBlockGap =\n\t\t\t\tstyleViewportBlockGap === undefined\n\t\t\t\t\t? globalViewportBlockGap\n\t\t\t\t\t: styleViewportBlockGap;\n\t\t\tif ( viewportBlockGap === undefined || viewportBlockGap === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tgap += `${ mediaQuery }{${ getGalleryGapCustomPropertyStyle(\n\t\t\t\tselector,\n\t\t\t\tviewportBlockGap\n\t\t\t) }}`;\n\t\t}\n\t);\n\n\tuseStyleOverride( { css: gap } );\n\n\treturn null;\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC,gCAAgC;AAAA,EAChC,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nB;AAGA,YAAM,yBACL,kBAAkB,SACf,sBAAuB,QAAS,GAAG,SAAS,WAC5C;AACJ,YAAM,mBACL,0BAA0B,SACvB,yBACA;AACJ,UAAK,qBAAqB,UAAa,qBAAqB,MAAO;AAClE;AAAA,MACD;AAEA,aAAO,GAAI,UAAW,IAAK;AAAA,QAC1B;AAAA,QACA;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD;AAEA,mBAAkB,EAAE,KAAK,IAAI,CAAE;AAE/B,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,6 +6,7 @@ import edit from "./edit.mjs";
|
|
|
6
6
|
import metadata from "./block.json";
|
|
7
7
|
import save from "./save.mjs";
|
|
8
8
|
import transforms from "./transforms.mjs";
|
|
9
|
+
import variations from "./variations.mjs";
|
|
9
10
|
var { name } = metadata;
|
|
10
11
|
var settings = {
|
|
11
12
|
icon,
|
|
@@ -29,6 +30,7 @@ var settings = {
|
|
|
29
30
|
]
|
|
30
31
|
},
|
|
31
32
|
transforms,
|
|
33
|
+
variations,
|
|
32
34
|
edit,
|
|
33
35
|
save,
|
|
34
36
|
deprecated
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/gallery/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { gallery as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcolumns: 2,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,WAAW,YAAY;AAKhC,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AAEvB,IAAM,EAAE,KAAK,IAAI;AAIV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,SAAS;AAAA,IACV;AAAA,IACA,aAAa;AAAA,MACZ;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,KAAK;AAAA,QACN;AAAA,MACD;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,KAAK;AAAA,QACN;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { gallery as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcolumns: 2,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tvariations,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,WAAW,YAAY;AAKhC,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AAEvB,IAAM,EAAE,KAAK,IAAI;AAIV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,SAAS;AAAA,IACV;AAAA,IACA,aAAa;AAAA,MACZ;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,KAAK;AAAA,QACN;AAAA,MACD;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,KAAK;AAAA,QACN;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,21 @@ import {
|
|
|
8
8
|
} from "@wordpress/block-editor";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
function saveWithInnerBlocks({ attributes }) {
|
|
11
|
-
const { caption, columns, imageCrop } = attributes;
|
|
11
|
+
const { caption, columns, imageCrop, dynamicContent } = attributes;
|
|
12
|
+
const captionElement = !RichText.isEmpty(caption) && /* @__PURE__ */ jsx(
|
|
13
|
+
RichText.Content,
|
|
14
|
+
{
|
|
15
|
+
tagName: "figcaption",
|
|
16
|
+
className: clsx(
|
|
17
|
+
"blocks-gallery-caption",
|
|
18
|
+
__experimentalGetElementClassName("caption")
|
|
19
|
+
),
|
|
20
|
+
value: caption
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
if (dynamicContent) {
|
|
24
|
+
return captionElement || null;
|
|
25
|
+
}
|
|
12
26
|
const className = clsx("has-nested-images", {
|
|
13
27
|
[`columns-${columns}`]: columns !== void 0,
|
|
14
28
|
[`columns-default`]: columns === void 0,
|
|
@@ -18,17 +32,7 @@ function saveWithInnerBlocks({ attributes }) {
|
|
|
18
32
|
const innerBlocksProps = useInnerBlocksProps.save(blockProps);
|
|
19
33
|
return /* @__PURE__ */ jsxs("figure", { ...innerBlocksProps, children: [
|
|
20
34
|
innerBlocksProps.children,
|
|
21
|
-
|
|
22
|
-
RichText.Content,
|
|
23
|
-
{
|
|
24
|
-
tagName: "figcaption",
|
|
25
|
-
className: clsx(
|
|
26
|
-
"blocks-gallery-caption",
|
|
27
|
-
__experimentalGetElementClassName("caption")
|
|
28
|
-
),
|
|
29
|
-
value: caption
|
|
30
|
-
}
|
|
31
|
-
)
|
|
35
|
+
captionElement
|
|
32
36
|
] });
|
|
33
37
|
}
|
|
34
38
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/gallery/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\nexport default function saveWithInnerBlocks( { attributes } ) {\n\tconst { caption, columns, imageCrop } = attributes;\n\n\tconst className = clsx( 'has-nested-images', {\n\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t[ `columns-default` ]: columns === undefined,\n\t\t'is-cropped': imageCrop,\n\t} );\n\tconst blockProps = useBlockProps.save( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn (\n\t\t<figure { ...innerBlocksProps }>\n\t\t\t{ innerBlocksProps.children }\n\t\t\t{
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\nexport default function saveWithInnerBlocks( { attributes } ) {\n\tconst { caption, columns, imageCrop, dynamicContent } = attributes;\n\n\tconst captionElement = ! RichText.isEmpty( caption ) && (\n\t\t<RichText.Content\n\t\t\ttagName=\"figcaption\"\n\t\t\tclassName={ clsx(\n\t\t\t\t'blocks-gallery-caption',\n\t\t\t\t__experimentalGetElementClassName( 'caption' )\n\t\t\t) }\n\t\t\tvalue={ caption }\n\t\t/>\n\t);\n\n\t// In dynamic mode the images are resolved at render time and the `<figure>`\n\t// wrapper is built by the server render callback (`block_core_gallery_render()`),\n\t// so persist only the gallery-level caption. It still sources from\n\t// `.blocks-gallery-caption`, so it round-trips; the render callback drops it in\n\t// after the resolved images. Nothing is saved when there's no caption.\n\tif ( dynamicContent ) {\n\t\treturn captionElement || null;\n\t}\n\n\tconst className = clsx( 'has-nested-images', {\n\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t[ `columns-default` ]: columns === undefined,\n\t\t'is-cropped': imageCrop,\n\t} );\n\tconst blockProps = useBlockProps.save( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn (\n\t\t<figure { ...innerBlocksProps }>\n\t\t\t{ innerBlocksProps.children }\n\t\t\t{ captionElement }\n\t\t</figure>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAML,cA4BA,YA5BA;AAJa,SAAR,oBAAsC,EAAE,WAAW,GAAI;AAC7D,QAAM,EAAE,SAAS,SAAS,WAAW,eAAe,IAAI;AAExD,QAAM,iBAAiB,CAAE,SAAS,QAAS,OAAQ,KAClD;AAAA,IAAC,SAAS;AAAA,IAAT;AAAA,MACA,SAAQ;AAAA,MACR,WAAY;AAAA,QACX;AAAA,QACA,kCAAmC,SAAU;AAAA,MAC9C;AAAA,MACA,OAAQ;AAAA;AAAA,EACT;AAQD,MAAK,gBAAiB;AACrB,WAAO,kBAAkB;AAAA,EAC1B;AAEA,QAAM,YAAY,KAAM,qBAAqB;AAAA,IAC5C,CAAE,WAAY,OAAQ,EAAG,GAAG,YAAY;AAAA,IACxC,CAAE,iBAAkB,GAAG,YAAY;AAAA,IACnC,cAAc;AAAA,EACf,CAAE;AACF,QAAM,aAAa,cAAc,KAAM,EAAE,UAAU,CAAE;AACrD,QAAM,mBAAmB,oBAAoB,KAAM,UAAW;AAE9D,SACC,qBAAC,YAAS,GAAG,kBACV;AAAA,qBAAiB;AAAA,IACjB;AAAA,KACH;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// packages/block-library/src/gallery/use-dynamic-gallery.js
|
|
2
|
+
import { useMemo } from "@wordpress/element";
|
|
3
|
+
import { useDispatch, useSelect } from "@wordpress/data";
|
|
4
|
+
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
5
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
6
|
+
import { createBlock } from "@wordpress/blocks";
|
|
7
|
+
import { pickRelevantMediaFiles } from "./shared.mjs";
|
|
8
|
+
import { getHrefAndDestination } from "./utils.mjs";
|
|
9
|
+
import { getUpdatedLinkTargetSettings } from "../image/utils.mjs";
|
|
10
|
+
import {
|
|
11
|
+
getSourceQuery,
|
|
12
|
+
getDynamicSource,
|
|
13
|
+
ATTACHED_MEDIA,
|
|
14
|
+
DEFAULT_ORDERBY,
|
|
15
|
+
DEFAULT_ORDER,
|
|
16
|
+
MAX_IMAGES
|
|
17
|
+
} from "./dynamic-source.mjs";
|
|
18
|
+
var EMPTY_ARRAY = [];
|
|
19
|
+
function buildImageBlockAttributes(media, galleryAttributes) {
|
|
20
|
+
const { sizeSlug, linkTo, linkTarget, aspectRatio } = galleryAttributes;
|
|
21
|
+
const hasAspectRatio = !!aspectRatio && aspectRatio !== "auto";
|
|
22
|
+
return {
|
|
23
|
+
id: media.id,
|
|
24
|
+
...pickRelevantMediaFiles(media, sizeSlug),
|
|
25
|
+
...getHrefAndDestination(media, linkTo),
|
|
26
|
+
...getUpdatedLinkTargetSettings(linkTarget, galleryAttributes),
|
|
27
|
+
sizeSlug,
|
|
28
|
+
// Raw caption, mirroring the frontend (`index.php`). Gap: the REST API
|
|
29
|
+
// exposes no caption run through `wp_get_attachment_caption`, so neither
|
|
30
|
+
// side applies that filter.
|
|
31
|
+
caption: media.caption?.raw || "",
|
|
32
|
+
alt: media.alt_text || "",
|
|
33
|
+
aspectRatio: hasAspectRatio ? aspectRatio : void 0,
|
|
34
|
+
// Pair `scale` with `aspectRatio` so the image crops rather than stretches,
|
|
35
|
+
// matching the image block's UI and the frontend (`index.php`).
|
|
36
|
+
scale: hasAspectRatio ? "cover" : void 0
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function buildImageBlocks(media, galleryAttributes) {
|
|
40
|
+
return media.map(
|
|
41
|
+
(mediaItem) => createBlock(
|
|
42
|
+
"core/image",
|
|
43
|
+
buildImageBlockAttributes(mediaItem, galleryAttributes)
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function useDynamicGallery({
|
|
48
|
+
attributes,
|
|
49
|
+
setAttributes,
|
|
50
|
+
clientId,
|
|
51
|
+
postId,
|
|
52
|
+
postType
|
|
53
|
+
}) {
|
|
54
|
+
const { dynamicContent } = attributes;
|
|
55
|
+
const canUseDynamicSource = !!postType;
|
|
56
|
+
const sourceDescriptor = getDynamicSource(dynamicContent?.source);
|
|
57
|
+
const sourceOrderby = dynamicContent?.args?.orderBy ?? DEFAULT_ORDERBY;
|
|
58
|
+
const sourceOrder = dynamicContent?.args?.order ?? DEFAULT_ORDER;
|
|
59
|
+
const { replaceInnerBlocks } = useDispatch(blockEditorStore);
|
|
60
|
+
const query = useMemo(
|
|
61
|
+
() => dynamicContent ? getSourceQuery(dynamicContent, { postId }) : null,
|
|
62
|
+
[dynamicContent, postId]
|
|
63
|
+
);
|
|
64
|
+
const { dynamicMedia, dynamicMediaTotal, isResolvingDynamic } = useSelect(
|
|
65
|
+
(select) => {
|
|
66
|
+
if (!query) {
|
|
67
|
+
return {
|
|
68
|
+
dynamicMedia: EMPTY_ARRAY,
|
|
69
|
+
dynamicMediaTotal: 0,
|
|
70
|
+
isResolvingDynamic: false
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const selectorArgs = ["postType", "attachment", query];
|
|
74
|
+
return {
|
|
75
|
+
dynamicMedia: select(coreStore).getEntityRecords(...selectorArgs) ?? EMPTY_ARRAY,
|
|
76
|
+
// Total matching attachments (the `X-WP-Total` header), which the
|
|
77
|
+
// query's `per_page` cap doesn't bound — so it reveals when the
|
|
78
|
+
// post has more attached images than are shown.
|
|
79
|
+
dynamicMediaTotal: select(coreStore).getEntityRecordsTotalItems(
|
|
80
|
+
...selectorArgs
|
|
81
|
+
) ?? 0,
|
|
82
|
+
isResolvingDynamic: !select(coreStore).hasFinishedResolution(
|
|
83
|
+
"getEntityRecords",
|
|
84
|
+
selectorArgs
|
|
85
|
+
)
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
[query]
|
|
89
|
+
);
|
|
90
|
+
const hasMoreImagesThanCap = dynamicMediaTotal > MAX_IMAGES;
|
|
91
|
+
const { sizeSlug, linkTo, linkTarget, aspectRatio } = attributes;
|
|
92
|
+
const imageAttributes = useMemo(
|
|
93
|
+
() => ({ sizeSlug, linkTo, linkTarget, aspectRatio }),
|
|
94
|
+
[sizeSlug, linkTo, linkTarget, aspectRatio]
|
|
95
|
+
);
|
|
96
|
+
const dynamicImageBlocks = useMemo(
|
|
97
|
+
() => buildImageBlocks(dynamicMedia, imageAttributes),
|
|
98
|
+
[dynamicMedia, imageAttributes]
|
|
99
|
+
);
|
|
100
|
+
const galleryContext = useMemo(
|
|
101
|
+
() => ({
|
|
102
|
+
allowResize: attributes.allowResize ?? false,
|
|
103
|
+
imageCrop: attributes.imageCrop,
|
|
104
|
+
fixedHeight: attributes.fixedHeight,
|
|
105
|
+
navigationButtonType: attributes.navigationButtonType
|
|
106
|
+
}),
|
|
107
|
+
[
|
|
108
|
+
attributes.allowResize,
|
|
109
|
+
attributes.imageCrop,
|
|
110
|
+
attributes.fixedHeight,
|
|
111
|
+
attributes.navigationButtonType
|
|
112
|
+
]
|
|
113
|
+
);
|
|
114
|
+
function enableDynamicMode() {
|
|
115
|
+
setAttributes({ dynamicContent: { source: ATTACHED_MEDIA } });
|
|
116
|
+
replaceInnerBlocks(clientId, []);
|
|
117
|
+
}
|
|
118
|
+
function convertToStatic() {
|
|
119
|
+
replaceInnerBlocks(
|
|
120
|
+
clientId,
|
|
121
|
+
buildImageBlocks(dynamicMedia, imageAttributes)
|
|
122
|
+
);
|
|
123
|
+
setAttributes({ dynamicContent: void 0 });
|
|
124
|
+
}
|
|
125
|
+
function setSourceOrder(nextOrderby, nextOrder) {
|
|
126
|
+
const nextArgs = { ...dynamicContent?.args };
|
|
127
|
+
delete nextArgs.orderBy;
|
|
128
|
+
delete nextArgs.order;
|
|
129
|
+
if (nextOrderby !== void 0 && (nextOrderby !== DEFAULT_ORDERBY || nextOrder !== DEFAULT_ORDER)) {
|
|
130
|
+
nextArgs.orderBy = nextOrderby;
|
|
131
|
+
nextArgs.order = nextOrder;
|
|
132
|
+
}
|
|
133
|
+
const nextSource = { ...dynamicContent };
|
|
134
|
+
if (Object.keys(nextArgs).length) {
|
|
135
|
+
nextSource.args = nextArgs;
|
|
136
|
+
} else {
|
|
137
|
+
delete nextSource.args;
|
|
138
|
+
}
|
|
139
|
+
setAttributes({ dynamicContent: nextSource });
|
|
140
|
+
}
|
|
141
|
+
function resetSource() {
|
|
142
|
+
setAttributes({
|
|
143
|
+
dynamicContent: { source: dynamicContent.source }
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
dynamicContent,
|
|
148
|
+
canUseDynamicSource,
|
|
149
|
+
sourceDescriptor,
|
|
150
|
+
hasMoreImagesThanCap,
|
|
151
|
+
dynamicMediaTotal,
|
|
152
|
+
sourceOrderby,
|
|
153
|
+
sourceOrder,
|
|
154
|
+
dynamicMedia,
|
|
155
|
+
dynamicImageBlocks,
|
|
156
|
+
isResolvingDynamic,
|
|
157
|
+
galleryContext,
|
|
158
|
+
enableDynamicMode,
|
|
159
|
+
convertToStatic,
|
|
160
|
+
setSourceOrder,
|
|
161
|
+
resetSource
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
useDynamicGallery as default
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=use-dynamic-gallery.mjs.map
|