@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/playlist/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tBlockIcon,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tInspectorControls,\n\tInnerBlocks,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tDisabled,\n\tSelectControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\nimport { audio as icon } from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { Caption } from '../utils/caption';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { WaveformPlayer } from '../utils/waveform-player';\nimport { getTrackAttributes } from './utils';\n\nconst ALLOWED_MEDIA_TYPES = [ 'audio' ];\n\nconst PlaylistEdit = ( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tclientId,\n} ) => {\n\tconst {\n\t\torder,\n\t\tshowTracklist,\n\t\tshowNumbers,\n\t\tshowImages,\n\t\tshowArtists,\n\t\tshowTrackLength,\n\t\tcurrentTrack,\n\t} = attributes;\n\n\t// Extract the waveform style from the block style variation class.\n\tconst waveformStyle =\n\t\tattributes.className?.match( /is-style-([\\w-]+)/ )?.[ 1 ] || 'bars';\n\tconst blockProps = useBlockProps();\n\tconst { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst { innerBlockTracks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock: _getBlock } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tinnerBlockTracks: _getBlock( clientId )?.innerBlocks ?? [],\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Ensure that each inner block has a unique ID,\n\t// even if a track is duplicated.\n\tuseEffect( () => {\n\t\tconst seen = new Set();\n\t\tlet hasDuplicates = false;\n\t\tconst updatedBlocks = innerBlockTracks.map( ( block ) => {\n\t\t\tif ( seen.has( block.attributes.uniqueId ) ) {\n\t\t\t\thasDuplicates = true;\n\t\t\t\treturn {\n\t\t\t\t\t...block,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\t...block.attributes,\n\t\t\t\t\t\tuniqueId: uuid(),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tseen.add( block.attributes.uniqueId );\n\t\t\treturn block;\n\t\t} );\n\t\tif ( hasDuplicates ) {\n\t\t\treplaceInnerBlocks( clientId, updatedBlocks );\n\t\t}\n\t}, [ innerBlockTracks, clientId, replaceInnerBlocks ] );\n\n\t// Create a list of tracks from the inner blocks,\n\t// but skip blocks that do not have a uniqueId attribute, such as the media placeholder.\n\tconst validTracks = innerBlockTracks.filter(\n\t\t( block ) => !! block.attributes.uniqueId\n\t);\n\tconst tracks = validTracks.map( ( block ) => block.attributes );\n\tconst firstTrackId = validTracks[ 0 ]?.attributes?.uniqueId;\n\n\t// updateBlockAttributes is used to force updating the parent playlist block\n\t// when the currentTrack changes. Using setAttributes directly does not update\n\t// the currentTrack when multiple tracks are moved at the same time.\n\tuseEffect( () => {\n\t\tif ( tracks.length === 0 ) {\n\t\t\t// If there are no tracks but currentTrack is set, set it to null.\n\t\t\tif ( currentTrack !== null ) {\n\t\t\t\tupdateBlockAttributes( clientId, { currentTrack: null } );\n\t\t\t}\n\t\t} else if (\n\t\t\t// If the currentTrack is not the first track, update it to the first track.\n\t\t\tfirstTrackId &&\n\t\t\tfirstTrackId !== currentTrack\n\t\t) {\n\t\t\tupdateBlockAttributes( clientId, { currentTrack: firstTrackId } );\n\t\t}\n\t}, [\n\t\ttracks,\n\t\tcurrentTrack,\n\t\tfirstTrackId,\n\t\tclientId,\n\t\tupdateBlockAttributes,\n\t] );\n\n\tconst onSelectTracks = useCallback(\n\t\t( media ) => {\n\t\t\tif ( ! media ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! Array.isArray( media ) ) {\n\t\t\t\tmedia = [ media ];\n\t\t\t}\n\n\t\t\tconst trackList = media.map( getTrackAttributes );\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tcurrentTrack:\n\t\t\t\t\ttrackList.length > 0 ? trackList[ 0 ].uniqueId : null,\n\t\t\t} );\n\n\t\t\tconst newBlocks = trackList.map( ( track ) =>\n\t\t\t\tcreateBlock( 'core/playlist-track', track )\n\t\t\t);\n\t\t\t// Replace the inner blocks with the new tracks.\n\t\t\treplaceInnerBlocks( clientId, newBlocks );\n\t\t},\n\t\t[\n\t\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\t\tsetAttributes,\n\t\t\treplaceInnerBlocks,\n\t\t\tclientId,\n\t\t]\n\t);\n\n\t// Get current track data by finding the track with matching uniqueId.\n\tconst currentTrackData = tracks.find(\n\t\t( track ) => track.uniqueId === currentTrack\n\t);\n\n\t// Handle track end - advance to next track or loop to first.\n\tconst onTrackEnded = useCallback( () => {\n\t\tconst currentIndex = tracks.findIndex(\n\t\t\t( track ) => track.uniqueId === currentTrack\n\t\t);\n\t\tconst nextTrack = tracks[ currentIndex + 1 ] || tracks[ 0 ];\n\t\tif ( nextTrack?.uniqueId ) {\n\t\t\tsetAttributes( { currentTrack: nextTrack.uniqueId } );\n\t\t}\n\t}, [ currentTrack, tracks, setAttributes ] );\n\n\tconst onChangeOrder = useCallback(\n\t\t( trackOrder ) => {\n\t\t\tconst sortedBlocks = [ ...innerBlockTracks ].sort( ( a, b ) => {\n\t\t\t\tconst titleA = a.attributes.title || '';\n\t\t\t\tconst titleB = b.attributes.title || '';\n\n\t\t\t\tif ( trackOrder === 'asc' ) {\n\t\t\t\t\treturn titleA.localeCompare( titleB );\n\t\t\t\t}\n\t\t\t\treturn titleB.localeCompare( titleA );\n\t\t\t} );\n\t\t\tconst firstUniqueId = sortedBlocks[ 0 ]?.attributes?.uniqueId;\n\t\t\treplaceInnerBlocks( clientId, sortedBlocks );\n\t\t\tsetAttributes( {\n\t\t\t\torder: trackOrder,\n\t\t\t\tcurrentTrack:\n\t\t\t\t\tfirstUniqueId && firstUniqueId !== currentTrack\n\t\t\t\t\t\t? firstUniqueId\n\t\t\t\t\t\t: currentTrack,\n\t\t\t} );\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tcurrentTrack,\n\t\t\tinnerBlockTracks,\n\t\t\treplaceInnerBlocks,\n\t\t\tsetAttributes,\n\t\t]\n\t);\n\n\tfunction toggleAttribute( attribute ) {\n\t\treturn ( newValue ) => {\n\t\t\tsetAttributes( { [ attribute ]: newValue } );\n\t\t};\n\t}\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tif ( tracks.length === 0 ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'Playlist' ),\n\t\t\t\t\t\tinstructions: __(\n\t\t\t\t\t\t\t'Upload an audio file or pick one from your media library.'\n\t\t\t\t\t\t),\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ onSelectTracks }\n\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\tmultiple\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tname={ __( 'Edit' ) }\n\t\t\t\t\tonSelect={ onSelectTracks }\n\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\tmultiple\n\t\t\t\t\tmediaIds={ tracks\n\t\t\t\t\t\t.filter( ( track ) => track.id )\n\t\t\t\t\t\t.map( ( track ) => track.id ) }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</BlockControls>\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\tshowTracklist: true,\n\t\t\t\t\t\t\tshowArtists: true,\n\t\t\t\t\t\t\tshowNumbers: true,\n\t\t\t\t\t\t\tshowTrackLength: true,\n\t\t\t\t\t\t\tshowImages: true,\n\t\t\t\t\t\t\torder: 'asc',\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<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show Tracklist' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showTracklist !== true }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showTracklist: 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={ __( 'Show Tracklist' ) }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showTracklist' ) }\n\t\t\t\t\t\t\tchecked={ showTracklist }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ showTracklist && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Show artist name in Tracklist' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => showArtists !== true }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { showArtists: true } )\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<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Show artist name in Tracklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t\t\t'showArtists'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ showArtists }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Show number in Tracklist' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => showNumbers !== true }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { showNumbers: true } )\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<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show number in Tracklist' ) }\n\t\t\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t\t\t'showNumbers'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ showNumbers }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Show track length in Tracklist' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => showTrackLength !== true }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { showTrackLength: true } )\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<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Show track length in Tracklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t\t\t'showTrackLength'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ showTrackLength }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show images' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showImages !== true }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showImages: 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={ __( 'Show images' ) }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showImages' ) }\n\t\t\t\t\t\t\tchecked={ showImages }\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\tlabel={ __( 'Order' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => order !== 'asc' }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { order: 'asc' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Order' ) }\n\t\t\t\t\t\t\tvalue={ order }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{ label: __( 'Descending' ), value: 'desc' },\n\t\t\t\t\t\t\t\t{ label: __( 'Ascending' ), value: 'asc' },\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonChange={ ( value ) => onChangeOrder( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t<Disabled isDisabled={ ! isSelected }>\n\t\t\t\t\t<WaveformPlayer\n\t\t\t\t\t\tsrc={ currentTrackData?.src }\n\t\t\t\t\t\ttitle={ currentTrackData?.title }\n\t\t\t\t\t\tartist={ currentTrackData?.artist }\n\t\t\t\t\t\timage={ currentTrackData?.image }\n\t\t\t\t\t\twaveformStyle={ waveformStyle }\n\t\t\t\t\t\tonEnded={ onTrackEnded }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t\t{ showTracklist && (\n\t\t\t\t\t<ol\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-playlist__tracklist', {\n\t\t\t\t\t\t\t'wp-block-playlist__tracklist-show-numbers':\n\t\t\t\t\t\t\t\tshowNumbers,\n\t\t\t\t\t\t\t'wp-block-playlist__tracklist-length-is-hidden':\n\t\t\t\t\t\t\t\t! showTrackLength,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t\t</ol>\n\t\t\t\t) }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Playlist caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t\t\tstyle={ { marginTop: 16 } }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n};\n\nexport default PlaylistEdit;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AACjB,kBAA2B;AAK3B,qBAAuC;AACvC,0BAUO;AACP,wBAMO;AACP,kBAAuC;AACvC,qBAAsC;AACtC,kBAAmB;AACnB,mBAA8B;AAC9B,oBAA4B;AAK5B,qBAAwB;AACxB,mBAA+C;AAC/C,6BAA+B;AAC/B,mBAAmC;AA2MvB;AAzMZ,IAAM,sBAAsB,CAAE,OAAQ;AAEtC,IAAM,eAAe,CAAE;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAGJ,QAAM,gBACL,WAAW,WAAW,MAAO,mBAAoB,IAAK,CAAE,KAAK;AAC9D,QAAM,iBAAa,mCAAc;AACjC,QAAM,EAAE,oBAAoB,wCAAwC,QACnE,yBAAa,oBAAAA,KAAiB;AAC/B,QAAM,EAAE,kBAAkB,QAAI,yBAAa,eAAAC,KAAa;AACxD,QAAM,wBAAoB,6CAA+B;AACzD,WAAS,cAAe,SAAU;AACjC,sBAAmB,SAAS,EAAE,MAAM,WAAW,CAAE;AAAA,EAClD;AACA,QAAM,EAAE,sBAAsB,QAAI,yBAAa,oBAA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B,OAAQ;AAAA,kBACR,SAAU;AAAA,oBACT,EAAE,WAAO,gBAAI,YAAa,GAAG,OAAO,OAAO;AAAA,oBAC3C,EAAE,WAAO,gBAAI,WAAY,GAAG,OAAO,MAAM;AAAA,kBAC1C;AAAA,kBACA,UAAW,CAAE,UAAW,cAAe,KAAM;AAAA;AAAA,cAC9C;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD,GACD;AAAA,IACA,6CAAC,YAAS,GAAG,YACZ;AAAA,kDAAC,8BAAS,YAAa,CAAE,YACxB;AAAA,QAAC;AAAA;AAAA,UACA,KAAM,kBAAkB;AAAA,UACxB,OAAQ,kBAAkB;AAAA,UAC1B,QAAS,kBAAkB;AAAA,UAC3B,OAAQ,kBAAkB;AAAA,UAC1B;AAAA,UACA,SAAU;AAAA;AAAA,MACX,GACD;AAAA,MACE,iBACD;AAAA,QAAC;AAAA;AAAA,UACA,eAAY,YAAAH,SAAM,gCAAgC;AAAA,YACjD,6CACC;AAAA,YACD,iDACC,CAAE;AAAA,UACJ,CAAE;AAAA,UAEA,2BAAiB;AAAA;AAAA,MACpB;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAQ,gBAAI,uBAAwB;AAAA,UACpC,mBAAoB;AAAA,UACpB,OAAQ,EAAE,WAAW,GAAG;AAAA;AAAA,MACzB;AAAA,OACD;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
|
-
"names": ["blockEditorStore", "noticesStore", "
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useMemo, useState } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tBlockIcon,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tInspectorControls,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tDisabled,\n\tSelectControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, _x } from '@wordpress/i18n';\nimport { playlist as icon } from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { Caption } from '../utils/caption';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { WaveformPlayer } from '../utils/waveform-player';\nimport { PlaylistContext } from './context';\nimport { getTrackAttributes } from './utils';\n\nconst ALLOWED_MEDIA_TYPES = [ 'audio' ];\nconst DEFAULT_WAVEFORM_STYLE = 'bars';\nconst WAVEFORM_STYLE_OPTIONS = [\n\t{ label: _x( 'Bars', 'waveform style option' ), value: 'bars' },\n\t{ label: _x( 'Mirror', 'waveform style option' ), value: 'mirror' },\n\t{ label: _x( 'Line', 'waveform style option' ), value: 'line' },\n\t{ label: _x( 'Blocks', 'waveform style option' ), value: 'blocks' },\n\t{ label: _x( 'Dots', 'waveform style option' ), value: 'dots' },\n\t{ label: _x( 'Seekbar', 'waveform style option' ), value: 'seekbar' },\n];\n\nconst PlaylistEdit = ( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tclientId,\n} ) => {\n\tconst {\n\t\torder,\n\t\tshowTracklist,\n\t\tshowNumbers,\n\t\tshowImages,\n\t\tshowPlayButtonArtwork,\n\t\tshowArtists,\n\t\tshowTrackLength,\n\t\twaveformStyle = DEFAULT_WAVEFORM_STYLE,\n\t\twaveformColor,\n\t\twaveformGradient,\n\t\twaveformBackgroundColor,\n\t\twaveformBackgroundGradient,\n\t} = attributes;\n\n\tconst blockProps = useBlockProps();\n\tconst waveformPanelId = `${ clientId }-waveform`;\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\tconst colors = useMemo(\n\t\t() =>\n\t\t\tcolorGradientSettings.colors.flatMap(\n\t\t\t\t( origin ) => origin?.colors ?? []\n\t\t\t),\n\t\t[ colorGradientSettings.colors ]\n\t);\n\tconst gradients = useMemo(\n\t\t() =>\n\t\t\tcolorGradientSettings.gradients.flatMap(\n\t\t\t\t( origin ) => origin?.gradients ?? []\n\t\t\t),\n\t\t[ colorGradientSettings.gradients ]\n\t);\n\tconst hasColors =\n\t\tcolors.length > 0 || ! colorGradientSettings.disableCustomColors;\n\tconst hasGradients =\n\t\tgradients.length > 0 || ! colorGradientSettings.disableCustomGradients;\n\tconst waveformGradientValue = waveformGradient;\n\tconst waveformBackgroundGradientValue = waveformBackgroundGradient;\n\tlet waveformColorGradientChange;\n\tlet waveformBackgroundColorGradientChange;\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\tconst [ currentTrackClientId, setCurrentTrackClientId ] = useState( null );\n\n\tconst { innerBlockTracks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock: _getBlock } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tinnerBlockTracks: _getBlock( clientId )?.innerBlocks ?? [],\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Create a list of tracks from the inner blocks,\n\t// but skip blocks that do not have a source, such as the media placeholder.\n\tconst validTracks = useMemo(\n\t\t() =>\n\t\t\tinnerBlockTracks.filter(\n\t\t\t\t( block ) => !! block.attributes.src || !! block.attributes.blob\n\t\t\t),\n\t\t[ innerBlockTracks ]\n\t);\n\tconst tracks = useMemo(\n\t\t() =>\n\t\t\tvalidTracks.map( ( block ) => ( {\n\t\t\t\t...block.attributes,\n\t\t\t\tclientId: block.clientId,\n\t\t\t} ) ),\n\t\t[ validTracks ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( validTracks.length === 0 ) {\n\t\t\tif ( currentTrackClientId !== null ) {\n\t\t\t\tsetCurrentTrackClientId( null );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentTrackExists = validTracks.some(\n\t\t\t( block ) => block.clientId === currentTrackClientId\n\t\t);\n\t\tif ( ! currentTrackExists ) {\n\t\t\tsetCurrentTrackClientId( validTracks[ 0 ].clientId );\n\t\t}\n\t}, [ currentTrackClientId, setCurrentTrackClientId, validTracks ] );\n\n\tconst playlistContext = useMemo(\n\t\t() => ( { currentTrackClientId, setCurrentTrackClientId } ),\n\t\t[ currentTrackClientId, setCurrentTrackClientId ]\n\t);\n\n\tconst onSelectTracks = useCallback(\n\t\t( media ) => {\n\t\t\tif ( ! media ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! Array.isArray( media ) ) {\n\t\t\t\tmedia = [ media ];\n\t\t\t}\n\n\t\t\tconst trackList = media.map( getTrackAttributes );\n\n\t\t\tconst newBlocks = trackList.map( ( track ) =>\n\t\t\t\tcreateBlock( 'core/playlist-track', track )\n\t\t\t);\n\t\t\tsetCurrentTrackClientId( newBlocks[ 0 ]?.clientId ?? null );\n\t\t\t// Replace the inner blocks with the new tracks.\n\t\t\treplaceInnerBlocks( clientId, newBlocks );\n\t\t},\n\t\t[ replaceInnerBlocks, clientId, setCurrentTrackClientId ]\n\t);\n\n\t// Get current track data by finding the track with matching client ID.\n\tconst currentTrackData =\n\t\ttracks.find( ( track ) => track.clientId === currentTrackClientId ) ??\n\t\ttracks[ 0 ];\n\n\t// Handle track end - advance to next track or loop to first.\n\tconst onTrackEnded = useCallback( () => {\n\t\tconst currentIndex = tracks.findIndex(\n\t\t\t( track ) => track.clientId === currentTrackClientId\n\t\t);\n\t\tconst nextTrack = tracks[ currentIndex + 1 ] || tracks[ 0 ];\n\t\tif ( nextTrack?.clientId ) {\n\t\t\tsetCurrentTrackClientId( nextTrack.clientId );\n\t\t}\n\t}, [ currentTrackClientId, setCurrentTrackClientId, tracks ] );\n\n\tconst onChangeOrder = useCallback(\n\t\t( trackOrder ) => {\n\t\t\tconst sortedBlocks = [ ...innerBlockTracks ].sort( ( a, b ) => {\n\t\t\t\tconst titleA = a.attributes.title || '';\n\t\t\t\tconst titleB = b.attributes.title || '';\n\n\t\t\t\tif ( trackOrder === 'asc' ) {\n\t\t\t\t\treturn titleA.localeCompare( titleB );\n\t\t\t\t}\n\t\t\t\treturn titleB.localeCompare( titleA );\n\t\t\t} );\n\t\t\treplaceInnerBlocks( clientId, sortedBlocks );\n\t\t\tsetCurrentTrackClientId( sortedBlocks[ 0 ]?.clientId ?? null );\n\t\t\tsetAttributes( {\n\t\t\t\torder: trackOrder,\n\t\t\t} );\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tinnerBlockTracks,\n\t\t\treplaceInnerBlocks,\n\t\t\tsetAttributes,\n\t\t\tsetCurrentTrackClientId,\n\t\t]\n\t);\n\n\tfunction toggleAttribute( attribute ) {\n\t\treturn ( newValue ) => {\n\t\t\tsetAttributes( { [ attribute ]: newValue } );\n\t\t};\n\t}\n\n\tconst onChangeWaveformStyle = useCallback(\n\t\t( newWaveformStyle ) => {\n\t\t\tsetAttributes( {\n\t\t\t\twaveformStyle:\n\t\t\t\t\tnewWaveformStyle === DEFAULT_WAVEFORM_STYLE\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: newWaveformStyle,\n\t\t\t} );\n\t\t},\n\t\t[ setAttributes ]\n\t);\n\n\tfunction updateWaveformColor( colorValue ) {\n\t\tconst isSettingColor = colorValue !== undefined;\n\t\tif ( ! isSettingColor && waveformColorGradientChange === 'gradient' ) {\n\t\t\twaveformColorGradientChange = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\twaveformColorGradientChange = 'color';\n\n\t\tsetAttributes( {\n\t\t\twaveformColor: colorValue,\n\t\t\twaveformGradient: undefined,\n\t\t} );\n\t}\n\n\tfunction updateWaveformGradient( gradientValue ) {\n\t\tconst isSettingGradient = gradientValue !== undefined;\n\t\tif ( ! isSettingGradient && waveformColorGradientChange === 'color' ) {\n\t\t\twaveformColorGradientChange = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\twaveformColorGradientChange = 'gradient';\n\n\t\tsetAttributes( {\n\t\t\twaveformGradient: gradientValue,\n\t\t\twaveformColor: undefined,\n\t\t} );\n\t}\n\n\tfunction updateWaveformBackgroundColor( colorValue ) {\n\t\tconst isSettingColor = colorValue !== undefined;\n\t\tif (\n\t\t\t! isSettingColor &&\n\t\t\twaveformBackgroundColorGradientChange === 'gradient'\n\t\t) {\n\t\t\twaveformBackgroundColorGradientChange = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\twaveformBackgroundColorGradientChange = 'color';\n\n\t\tsetAttributes( {\n\t\t\twaveformBackgroundColor: colorValue,\n\t\t\twaveformBackgroundGradient: undefined,\n\t\t} );\n\t}\n\n\tfunction updateWaveformBackgroundGradient( gradientValue ) {\n\t\tconst isSettingGradient = gradientValue !== undefined;\n\t\tif (\n\t\t\t! isSettingGradient &&\n\t\t\twaveformBackgroundColorGradientChange === 'color'\n\t\t) {\n\t\t\twaveformBackgroundColorGradientChange = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\twaveformBackgroundColorGradientChange = 'gradient';\n\n\t\tsetAttributes( {\n\t\t\twaveformBackgroundGradient: gradientValue,\n\t\t\twaveformBackgroundColor: undefined,\n\t\t} );\n\t}\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst colorSettings = [];\n\tif ( hasColors || hasGradients ) {\n\t\tcolorSettings.push(\n\t\t\t{\n\t\t\t\tcolorValue: hasColors ? waveformColor : undefined,\n\t\t\t\tgradientValue: hasGradients ? waveformGradientValue : undefined,\n\t\t\t\tlabel: __( 'Waveform & Play button' ),\n\t\t\t\tonColorChange: hasColors ? updateWaveformColor : undefined,\n\t\t\t\tonGradientChange: hasGradients\n\t\t\t\t\t? updateWaveformGradient\n\t\t\t\t\t: undefined,\n\t\t\t\tisShownByDefault: true,\n\t\t\t\tclearable: true,\n\t\t\t\tenableAlpha: true,\n\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\twaveformColor: undefined,\n\t\t\t\t\twaveformGradient: undefined,\n\t\t\t\t} ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tcolorValue: hasColors ? waveformBackgroundColor : undefined,\n\t\t\t\tgradientValue: hasGradients\n\t\t\t\t\t? waveformBackgroundGradientValue\n\t\t\t\t\t: undefined,\n\t\t\t\tlabel: __( 'Waveform background' ),\n\t\t\t\tonColorChange: hasColors\n\t\t\t\t\t? updateWaveformBackgroundColor\n\t\t\t\t\t: undefined,\n\t\t\t\tonGradientChange: hasGradients\n\t\t\t\t\t? updateWaveformBackgroundGradient\n\t\t\t\t\t: undefined,\n\t\t\t\tisShownByDefault: true,\n\t\t\t\tclearable: true,\n\t\t\t\tenableAlpha: true,\n\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\twaveformBackgroundColor: undefined,\n\t\t\t\t\twaveformBackgroundGradient: undefined,\n\t\t\t\t} ),\n\t\t\t}\n\t\t);\n\t}\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tif ( tracks.length === 0 ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'Playlist' ),\n\t\t\t\t\t\tinstructions: __(\n\t\t\t\t\t\t\t'Upload an audio file or pick one from your media library.'\n\t\t\t\t\t\t),\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ onSelectTracks }\n\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\tmultiple\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tname={ __( 'Edit' ) }\n\t\t\t\t\tonSelect={ onSelectTracks }\n\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\tmultiple\n\t\t\t\t\tmediaIds={ tracks\n\t\t\t\t\t\t.filter( ( track ) => track.id )\n\t\t\t\t\t\t.map( ( track ) => track.id ) }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</BlockControls>\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\tshowTracklist: true,\n\t\t\t\t\t\t\tshowArtists: true,\n\t\t\t\t\t\t\tshowNumbers: true,\n\t\t\t\t\t\t\tshowTrackLength: true,\n\t\t\t\t\t\t\tshowImages: true,\n\t\t\t\t\t\t\tshowPlayButtonArtwork: false,\n\t\t\t\t\t\t\torder: 'asc',\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<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show tracklist' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showTracklist !== true }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showTracklist: 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={ __( 'Show tracklist' ) }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showTracklist' ) }\n\t\t\t\t\t\t\tchecked={ showTracklist }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ showTracklist && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Show artist name in tracklist' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => showArtists !== true }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { showArtists: true } )\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<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Show artist name in tracklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t\t\t'showArtists'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ showArtists }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Show track numbers in tracklist'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => showNumbers !== true }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { showNumbers: true } )\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<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Show track numbers in tracklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t\t\t'showNumbers'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ showNumbers }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Show track duration in tracklist'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => showTrackLength !== true }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { showTrackLength: true } )\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<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Show track duration in tracklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t\t\t'showTrackLength'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ showTrackLength }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show tracklist images' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showImages !== true }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showImages: 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={ __( 'Show tracklist images' ) }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showImages' ) }\n\t\t\t\t\t\t\tchecked={ showImages }\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\tlabel={ __( 'Show track image on play button' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showPlayButtonArtwork === true }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showPlayButtonArtwork: 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={ __( 'Show track image on play button' ) }\n\t\t\t\t\t\t\tonChange={ toggleAttribute(\n\t\t\t\t\t\t\t\t'showPlayButtonArtwork'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ showPlayButtonArtwork === true }\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\tlabel={ __( 'Order' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => order !== 'asc' }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { order: 'asc' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Order' ) }\n\t\t\t\t\t\t\tvalue={ order }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{ label: __( 'Descending' ), value: 'desc' },\n\t\t\t\t\t\t\t\t{ label: __( 'Ascending' ), value: 'asc' },\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonChange={ ( value ) => onChangeOrder( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"styles\">\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Waveform' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twaveformStyle: undefined,\n\t\t\t\t\t\t\twaveformColor: undefined,\n\t\t\t\t\t\t\twaveformGradient: undefined,\n\t\t\t\t\t\t\twaveformBackgroundColor: undefined,\n\t\t\t\t\t\t\twaveformBackgroundGradient: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tpanelId={ waveformPanelId }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ colorSettings.length > 0 && (\n\t\t\t\t\t\t<div className=\"wp-block-playlist__waveform-color-controls\">\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ colorSettings }\n\t\t\t\t\t\t\t\tpanelId={ waveformPanelId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Shape' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\twaveformStyle !== DEFAULT_WAVEFORM_STYLE\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tonChangeWaveformStyle( DEFAULT_WAVEFORM_STYLE )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpanelId={ waveformPanelId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Shape' ) }\n\t\t\t\t\t\t\tvalue={ waveformStyle }\n\t\t\t\t\t\t\toptions={ WAVEFORM_STYLE_OPTIONS }\n\t\t\t\t\t\t\tonChange={ onChangeWaveformStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t<Disabled isDisabled={ ! isSelected }>\n\t\t\t\t\t<WaveformPlayer\n\t\t\t\t\t\tsrc={ currentTrackData?.src }\n\t\t\t\t\t\ttitle={ currentTrackData?.title }\n\t\t\t\t\t\tartist={ currentTrackData?.artist }\n\t\t\t\t\t\timage={ currentTrackData?.image }\n\t\t\t\t\t\timageAlt={ currentTrackData?.imageAlt }\n\t\t\t\t\t\twaveformStyle={ waveformStyle }\n\t\t\t\t\t\tcolor={ waveformColor }\n\t\t\t\t\t\tgradient={ waveformGradientValue }\n\t\t\t\t\t\tbackgroundColor={ waveformBackgroundColor }\n\t\t\t\t\t\tbackgroundGradient={ waveformBackgroundGradientValue }\n\t\t\t\t\t\tonEnded={ onTrackEnded }\n\t\t\t\t\t\tshowPlayButtonArtwork={ showPlayButtonArtwork === true }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t\t{ showTracklist && (\n\t\t\t\t\t<ol\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-playlist__tracklist', {\n\t\t\t\t\t\t\t'wp-block-playlist__tracklist-show-numbers':\n\t\t\t\t\t\t\t\tshowNumbers,\n\t\t\t\t\t\t\t'wp-block-playlist__tracklist-length-is-hidden':\n\t\t\t\t\t\t\t\t! showTrackLength,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PlaylistContext.Provider value={ playlistContext }>\n\t\t\t\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t\t\t</PlaylistContext.Provider>\n\t\t\t\t\t</ol>\n\t\t\t\t) }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Playlist caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t\t\tstyle={ { marginTop: 16 } }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n};\n\nexport default PlaylistEdit;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAA0D;AAC1D,0BAYO;AACP,wBAMO;AACP,kBAAuC;AACvC,qBAAsC;AACtC,kBAAuB;AACvB,mBAAiC;AACjC,oBAA4B;AAK5B,qBAAwB;AACxB,mBAA+C;AAC/C,6BAA+B;AAC/B,qBAAgC;AAChC,mBAAmC;AAuUvB;AArUZ,IAAM,sBAAsB,CAAE,OAAQ;AACtC,IAAM,yBAAyB;AAC/B,IAAM,yBAAyB;AAAA,EAC9B,EAAE,WAAO,gBAAI,QAAQ,uBAAwB,GAAG,OAAO,OAAO;AAAA,EAC9D,EAAE,WAAO,gBAAI,UAAU,uBAAwB,GAAG,OAAO,SAAS;AAAA,EAClE,EAAE,WAAO,gBAAI,QAAQ,uBAAwB,GAAG,OAAO,OAAO;AAAA,EAC9D,EAAE,WAAO,gBAAI,UAAU,uBAAwB,GAAG,OAAO,SAAS;AAAA,EAClE,EAAE,WAAO,gBAAI,QAAQ,uBAAwB,GAAG,OAAO,OAAO;AAAA,EAC9D,EAAE,WAAO,gBAAI,WAAW,uBAAwB,GAAG,OAAO,UAAU;AACrE;AAEA,IAAM,eAAe,CAAE;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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;AAAA,kBACR,SAAU;AAAA,kBACV,UAAW;AAAA;AAAA,cACZ;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD,GACD;AAAA,IACA,6CAAC,YAAS,GAAG,YACZ;AAAA,kDAAC,8BAAS,YAAa,CAAE,YACxB;AAAA,QAAC;AAAA;AAAA,UACA,KAAM,kBAAkB;AAAA,UACxB,OAAQ,kBAAkB;AAAA,UAC1B,QAAS,kBAAkB;AAAA,UAC3B,OAAQ,kBAAkB;AAAA,UAC1B,UAAW,kBAAkB;AAAA,UAC7B;AAAA,UACA,OAAQ;AAAA,UACR,UAAW;AAAA,UACX,iBAAkB;AAAA,UAClB,oBAAqB;AAAA,UACrB,SAAU;AAAA,UACV,uBAAwB,0BAA0B;AAAA;AAAA,MACnD,GACD;AAAA,MACE,iBACD;AAAA,QAAC;AAAA;AAAA,UACA,eAAY,YAAAH,SAAM,gCAAgC;AAAA,YACjD,6CACC;AAAA,YACD,iDACC,CAAE;AAAA,UACJ,CAAE;AAAA,UAEF,sDAAC,+BAAgB,UAAhB,EAAyB,OAAQ,iBAC/B,2BAAiB,UACpB;AAAA;AAAA,MACD;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAQ,gBAAI,uBAAwB;AAAA,UACpC,mBAAoB;AAAA,UACpB,OAAQ,EAAE,WAAW,GAAG;AAAA;AAAA,MACzB;AAAA,OACD;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
|
+
"names": ["blockEditorStore", "noticesStore", "useMultipleOriginColorsAndGradients", "clsx", "icon", "ToolsPanel", "ToolsPanelItem", "ColorGradientSettingsDropdown"]
|
|
7
7
|
}
|
package/build/playlist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@ var import_edit = __toESM(require("./edit.cjs"));
|
|
|
43
43
|
var import_save = __toESM(require("./save.cjs"));
|
|
44
44
|
var { name } = import_block.default;
|
|
45
45
|
var settings = {
|
|
46
|
-
icon: import_icons.
|
|
46
|
+
icon: import_icons.playlist,
|
|
47
47
|
edit: import_edit.default,
|
|
48
48
|
save: import_save.default
|
|
49
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/playlist/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { playlist as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAAiC;AAKjC,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,kBAAiB;AAEjB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAGV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
6
|
"names": ["metadata", "icon", "edit", "save", "initBlock", "metadata"]
|
|
7
7
|
}
|
package/build/playlist/utils.cjs
CHANGED
|
@@ -20,29 +20,40 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// packages/block-library/src/playlist/utils.js
|
|
21
21
|
var utils_exports = {};
|
|
22
22
|
__export(utils_exports, {
|
|
23
|
-
getTrackAttributes: () => getTrackAttributes
|
|
23
|
+
getTrackAttributes: () => getTrackAttributes,
|
|
24
|
+
getTrackImageAttributes: () => getTrackImageAttributes
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(utils_exports);
|
|
26
|
-
var import_uuid = require("uuid");
|
|
27
27
|
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
function getTrackImageAttributes(image) {
|
|
29
|
+
const imageSrc = image?.src ?? image?.url;
|
|
30
|
+
if (imageSrc?.endsWith("/images/media/audio.svg")) {
|
|
31
|
+
return {
|
|
32
|
+
image: "",
|
|
33
|
+
imageAlt: ""
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
// Note: Image is not available when a new track is uploaded.
|
|
38
|
+
image: imageSrc,
|
|
39
|
+
imageAlt: imageSrc ? image?.alt || image?.alt_text || "" : void 0
|
|
40
|
+
};
|
|
41
|
+
}
|
|
28
42
|
function getTrackAttributes(media) {
|
|
29
43
|
return {
|
|
30
44
|
id: media.id || media.url,
|
|
31
45
|
// Attachment ID or URL.
|
|
32
|
-
uniqueId: (0, import_uuid.v4)(),
|
|
33
|
-
// Unique ID for the track.
|
|
34
46
|
src: media.url,
|
|
35
47
|
title: media.title,
|
|
36
48
|
artist: media.artist || media?.meta?.artist || media?.media_details?.artist || (0, import_i18n.__)("Unknown artist"),
|
|
37
49
|
album: media.album || media?.meta?.album || media?.media_details?.album || (0, import_i18n.__)("Unknown album"),
|
|
38
50
|
length: media?.fileLength || media?.media_details?.length_formatted,
|
|
39
|
-
|
|
40
|
-
// Note: Image is not available when a new track is uploaded.
|
|
41
|
-
image: media?.image?.src && media?.image?.src.endsWith("/images/media/audio.svg") ? "" : media?.image?.src
|
|
51
|
+
...getTrackImageAttributes(media?.image)
|
|
42
52
|
};
|
|
43
53
|
}
|
|
44
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
55
|
0 && (module.exports = {
|
|
46
|
-
getTrackAttributes
|
|
56
|
+
getTrackAttributes,
|
|
57
|
+
getTrackImageAttributes
|
|
47
58
|
});
|
|
48
59
|
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/playlist/utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Transform media library image data into track image attributes.\n *\n * @param {Object} image - Image object from the media library.\n * @return {Object} Track image attributes for the playlist-track block.\n */\nexport function getTrackImageAttributes( image ) {\n\tconst imageSrc = image?.src ?? image?.url;\n\n\t// Prevent using the default media attachment icon as the track image.\n\tif ( imageSrc?.endsWith( '/images/media/audio.svg' ) ) {\n\t\treturn {\n\t\t\timage: '',\n\t\t\timageAlt: '',\n\t\t};\n\t}\n\n\treturn {\n\t\t// Note: Image is not available when a new track is uploaded.\n\t\timage: imageSrc,\n\t\timageAlt: imageSrc ? image?.alt || image?.alt_text || '' : undefined,\n\t};\n}\n\n/**\n * Transform media library data into track block attributes.\n *\n * @param {Object} media - Media object from the media library.\n * @return {Object} Track attributes for the playlist-track block.\n */\nexport function getTrackAttributes( media ) {\n\treturn {\n\t\tid: media.id || media.url, // Attachment ID or URL.\n\t\tsrc: media.url,\n\t\ttitle: media.title,\n\t\tartist:\n\t\t\tmedia.artist ||\n\t\t\tmedia?.meta?.artist ||\n\t\t\tmedia?.media_details?.artist ||\n\t\t\t__( 'Unknown artist' ),\n\t\talbum:\n\t\t\tmedia.album ||\n\t\t\tmedia?.meta?.album ||\n\t\t\tmedia?.media_details?.album ||\n\t\t\t__( 'Unknown album' ),\n\t\tlength: media?.fileLength || media?.media_details?.length_formatted,\n\t\t...getTrackImageAttributes( media?.image ),\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAQZ,SAAS,wBAAyB,OAAQ;AAChD,QAAM,WAAW,OAAO,OAAO,OAAO;AAGtC,MAAK,UAAU,SAAU,yBAA0B,GAAI;AACtD,WAAO;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,IACX;AAAA,EACD;AAEA,SAAO;AAAA;AAAA,IAEN,OAAO;AAAA,IACP,UAAU,WAAW,OAAO,OAAO,OAAO,YAAY,KAAK;AAAA,EAC5D;AACD;AAQO,SAAS,mBAAoB,OAAQ;AAC3C,SAAO;AAAA,IACN,IAAI,MAAM,MAAM,MAAM;AAAA;AAAA,IACtB,KAAK,MAAM;AAAA,IACX,OAAO,MAAM;AAAA,IACb,QACC,MAAM,UACN,OAAO,MAAM,UACb,OAAO,eAAe,cACtB,gBAAI,gBAAiB;AAAA,IACtB,OACC,MAAM,SACN,OAAO,MAAM,SACb,OAAO,eAAe,aACtB,gBAAI,eAAgB;AAAA,IACrB,QAAQ,OAAO,cAAc,OAAO,eAAe;AAAA,IACnD,GAAG,wBAAyB,OAAO,KAAM;AAAA,EAC1C;AACD;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/build/playlist/view.cjs
CHANGED
|
@@ -4,20 +4,42 @@
|
|
|
4
4
|
var import_interactivity = require("@wordpress/interactivity");
|
|
5
5
|
var import_waveform_utils = require("../utils/waveform-utils.cjs");
|
|
6
6
|
var playerState = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
var playlistPlayerState = /* @__PURE__ */ new Map();
|
|
7
8
|
var { state } = (0, import_interactivity.store)(
|
|
8
9
|
"core/playlist",
|
|
9
10
|
{
|
|
10
11
|
state: {
|
|
11
12
|
playlists: {},
|
|
12
13
|
get isCurrentTrack() {
|
|
13
|
-
const { currentId,
|
|
14
|
-
return currentId ===
|
|
14
|
+
const { currentId, trackId } = (0, import_interactivity.getContext)();
|
|
15
|
+
return currentId === trackId;
|
|
16
|
+
},
|
|
17
|
+
get isCurrentTrackPlaying() {
|
|
18
|
+
const { currentId, isPlaying, trackId } = (0, import_interactivity.getContext)();
|
|
19
|
+
return currentId === trackId && !!isPlaying;
|
|
20
|
+
},
|
|
21
|
+
get trackButtonActionLabel() {
|
|
22
|
+
const { labelPauseTrack, labelSelectTrack } = (0, import_interactivity.getContext)();
|
|
23
|
+
return state.isCurrentTrackPlaying ? labelPauseTrack : labelSelectTrack;
|
|
15
24
|
}
|
|
16
25
|
},
|
|
17
26
|
actions: {
|
|
18
27
|
changeTrack() {
|
|
19
28
|
const context = (0, import_interactivity.getContext)();
|
|
20
|
-
context.currentId
|
|
29
|
+
if (context.currentId === context.trackId) {
|
|
30
|
+
const player = playlistPlayerState.get(
|
|
31
|
+
context.playlistId
|
|
32
|
+
)?.instance;
|
|
33
|
+
if (player?.isPlaying) {
|
|
34
|
+
context.isPlaying = false;
|
|
35
|
+
player.pause();
|
|
36
|
+
} else {
|
|
37
|
+
player?.play()?.catch(import_waveform_utils.logPlayError);
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
context.isPlaying = false;
|
|
42
|
+
context.currentId = context.trackId;
|
|
21
43
|
}
|
|
22
44
|
},
|
|
23
45
|
callbacks: {
|
|
@@ -44,32 +66,63 @@ var { state } = (0, import_interactivity.store)(
|
|
|
44
66
|
);
|
|
45
67
|
function initPlayer(ref, track, shouldAutoPlay, context) {
|
|
46
68
|
const existing = playerState.get(ref);
|
|
69
|
+
const showPlayButtonArtwork = context.showPlayButtonArtwork === true;
|
|
70
|
+
const playerArtwork = showPlayButtonArtwork ? "" : track.image;
|
|
47
71
|
if (existing?.instance) {
|
|
48
|
-
existing.instance.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
const shouldRecreatePlayer = !!existing.instance.artworkEl !== !!playerArtwork;
|
|
73
|
+
if (shouldRecreatePlayer) {
|
|
74
|
+
existing.destroy?.();
|
|
75
|
+
playerState.delete(ref);
|
|
76
|
+
} else {
|
|
77
|
+
playlistPlayerState.set(context.playlistId, existing);
|
|
78
|
+
existing.instance.loadTrack(track.url, track.title, track.artist, {
|
|
79
|
+
artwork: playerArtwork,
|
|
80
|
+
artworkAlt: playerArtwork ? track.imageAlt : ""
|
|
81
|
+
}).then(() => {
|
|
82
|
+
existing.url = track.url;
|
|
83
|
+
if (existing.instance.artworkEl) {
|
|
84
|
+
existing.instance.artworkEl.alt = track.imageAlt || "";
|
|
85
|
+
}
|
|
86
|
+
(0, import_waveform_utils.updateSeekControlLabel)(
|
|
87
|
+
existing.instance,
|
|
88
|
+
track.title || ref.dataset.labelSeek
|
|
89
|
+
);
|
|
90
|
+
if (showPlayButtonArtwork) {
|
|
91
|
+
(0, import_waveform_utils.setupPlayButtonArtwork)(
|
|
92
|
+
existing.container,
|
|
93
|
+
track.image
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (shouldAutoPlay) {
|
|
97
|
+
existing.instance.play()?.catch(import_waveform_utils.logPlayError);
|
|
98
|
+
}
|
|
99
|
+
}).catch(import_waveform_utils.logPlayError);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
57
102
|
}
|
|
58
103
|
const labels = {
|
|
59
104
|
play: ref.dataset.labelPlay,
|
|
60
|
-
pause: ref.dataset.labelPause
|
|
105
|
+
pause: ref.dataset.labelPause,
|
|
106
|
+
seek: ref.dataset.labelSeek,
|
|
107
|
+
seekValueText: ref.dataset.labelSeekValue
|
|
61
108
|
};
|
|
62
109
|
const player = (0, import_waveform_utils.initWaveformPlayer)(ref, {
|
|
63
110
|
src: track.url,
|
|
64
111
|
title: track.title,
|
|
65
112
|
artist: track.artist,
|
|
66
113
|
image: track.image,
|
|
114
|
+
imageAlt: track.imageAlt,
|
|
115
|
+
waveformColor: ref.dataset.waveformPlayerColor,
|
|
116
|
+
waveformGradient: ref.dataset.waveformPlayerGradient,
|
|
117
|
+
backgroundColor: ref.dataset.waveformPlayerBackgroundColor,
|
|
118
|
+
backgroundGradient: ref.dataset.waveformPlayerBackgroundGradient,
|
|
67
119
|
autoPlay: shouldAutoPlay,
|
|
68
120
|
labels,
|
|
69
121
|
waveformStyle: context.waveformStyle,
|
|
122
|
+
showPlayButtonArtwork,
|
|
70
123
|
onEnded: () => {
|
|
71
124
|
const currentIndex = context.tracks.findIndex(
|
|
72
|
-
(
|
|
125
|
+
(trackId) => trackId === context.currentId
|
|
73
126
|
);
|
|
74
127
|
const nextTrack = context.tracks[currentIndex + 1];
|
|
75
128
|
if (nextTrack) {
|
|
@@ -77,10 +130,27 @@ function initPlayer(ref, track, shouldAutoPlay, context) {
|
|
|
77
130
|
}
|
|
78
131
|
}
|
|
79
132
|
});
|
|
80
|
-
|
|
133
|
+
const setIsPlaying = (isPlaying) => {
|
|
134
|
+
context.isPlaying = isPlaying;
|
|
135
|
+
};
|
|
136
|
+
const onPlay = () => setIsPlaying(true);
|
|
137
|
+
const onPause = () => setIsPlaying(false);
|
|
138
|
+
player.container.addEventListener("waveformplayer:play", onPlay);
|
|
139
|
+
player.container.addEventListener("waveformplayer:pause", onPause);
|
|
140
|
+
player.container.addEventListener("waveformplayer:ended", onPause);
|
|
141
|
+
const destroy = () => {
|
|
142
|
+
player.container.removeEventListener("waveformplayer:play", onPlay);
|
|
143
|
+
player.container.removeEventListener("waveformplayer:pause", onPause);
|
|
144
|
+
player.container.removeEventListener("waveformplayer:ended", onPause);
|
|
145
|
+
player.destroy();
|
|
146
|
+
};
|
|
147
|
+
const nextState = {
|
|
81
148
|
url: track.url,
|
|
82
149
|
instance: player.instance,
|
|
83
|
-
|
|
84
|
-
|
|
150
|
+
container: player.container,
|
|
151
|
+
destroy
|
|
152
|
+
};
|
|
153
|
+
playerState.set(ref, nextState);
|
|
154
|
+
playlistPlayerState.set(context.playlistId, nextState);
|
|
85
155
|
}
|
|
86
156
|
//# sourceMappingURL=view.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/playlist/view.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;AAGA,2BAA8C;AAK9C,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport {\n\tinitWaveformPlayer,\n\tlogPlayError,\n\tsetupPlayButtonArtwork,\n\tupdateSeekControlLabel,\n} from '../utils/waveform-utils';\n\n/**\n * Store player state for each element.\n */\nconst playerState = new WeakMap();\nconst playlistPlayerState = new Map();\n\nconst { state } = store(\n\t'core/playlist',\n\t{\n\t\tstate: {\n\t\t\tplaylists: {},\n\t\t\tget isCurrentTrack() {\n\t\t\t\tconst { currentId, trackId } = getContext();\n\t\t\t\treturn currentId === trackId;\n\t\t\t},\n\t\t\tget isCurrentTrackPlaying() {\n\t\t\t\tconst { currentId, isPlaying, trackId } = getContext();\n\t\t\t\treturn currentId === trackId && !! isPlaying;\n\t\t\t},\n\t\t\tget trackButtonActionLabel() {\n\t\t\t\tconst { labelPauseTrack, labelSelectTrack } = getContext();\n\t\t\t\treturn state.isCurrentTrackPlaying\n\t\t\t\t\t? labelPauseTrack\n\t\t\t\t\t: labelSelectTrack;\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tchangeTrack() {\n\t\t\t\tconst context = getContext();\n\t\t\t\tif ( context.currentId === context.trackId ) {\n\t\t\t\t\tconst player = playlistPlayerState.get(\n\t\t\t\t\t\tcontext.playlistId\n\t\t\t\t\t)?.instance;\n\t\t\t\t\tif ( player?.isPlaying ) {\n\t\t\t\t\t\tcontext.isPlaying = false;\n\t\t\t\t\t\tplayer.pause();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tplayer?.play()?.catch( logPlayError );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontext.isPlaying = false;\n\t\t\t\tcontext.currentId = context.trackId;\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tinitWaveformPlayer() {\n\t\t\t\tconst context = getContext();\n\t\t\t\tconst { ref } = getElement();\n\n\t\t\t\tif ( ! context.currentId || ! ref ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst track =\n\t\t\t\t\tstate.playlists[ context.playlistId ]?.tracks[\n\t\t\t\t\t\tcontext.currentId\n\t\t\t\t\t];\n\t\t\t\tif ( ! track?.url ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst existing = playerState.get( ref );\n\n\t\t\t\t// Skip if we already initialized with this exact URL.\n\t\t\t\tif ( existing?.url === track.url ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Autoplay if we're switching from a different track (user action),\n\t\t\t\t// but not on initial page load (when existing has no URL).\n\t\t\t\tconst shouldAutoPlay = !! existing?.url;\n\n\t\t\t\tinitPlayer( ref, track, shouldAutoPlay, context );\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n\n/**\n * Initialize the waveform player for a given element.\n *\n * @param {Element} ref - The container element.\n * @param {Object} track - The track data.\n * @param {boolean} shouldAutoPlay - Whether to auto-play after initialization.\n * @param {Object} context - The Interactivity API context.\n */\nfunction initPlayer( ref, track, shouldAutoPlay, context ) {\n\tconst existing = playerState.get( ref );\n\tconst showPlayButtonArtwork = context.showPlayButtonArtwork === true;\n\tconst playerArtwork = showPlayButtonArtwork ? '' : track.image;\n\n\t// If a player already exists, load the new track without recreating.\n\tif ( existing?.instance ) {\n\t\tconst shouldRecreatePlayer =\n\t\t\t!! existing.instance.artworkEl !== !! playerArtwork;\n\n\t\tif ( shouldRecreatePlayer ) {\n\t\t\texisting.destroy?.();\n\t\t\tplayerState.delete( ref );\n\t\t} else {\n\t\t\tplaylistPlayerState.set( context.playlistId, existing );\n\t\t\texisting.instance\n\t\t\t\t.loadTrack( track.url, track.title, track.artist, {\n\t\t\t\t\tartwork: playerArtwork,\n\t\t\t\t\tartworkAlt: playerArtwork ? track.imageAlt : '',\n\t\t\t\t} )\n\t\t\t\t.then( () => {\n\t\t\t\t\texisting.url = track.url;\n\t\t\t\t\tif ( existing.instance.artworkEl ) {\n\t\t\t\t\t\texisting.instance.artworkEl.alt = track.imageAlt || '';\n\t\t\t\t\t}\n\t\t\t\t\t// loadTrack() preserves the previous explicit seekLabel option.\n\t\t\t\t\tupdateSeekControlLabel(\n\t\t\t\t\t\texisting.instance,\n\t\t\t\t\t\ttrack.title || ref.dataset.labelSeek\n\t\t\t\t\t);\n\t\t\t\t\tif ( showPlayButtonArtwork ) {\n\t\t\t\t\t\tsetupPlayButtonArtwork(\n\t\t\t\t\t\t\texisting.container,\n\t\t\t\t\t\t\ttrack.image\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif ( shouldAutoPlay ) {\n\t\t\t\t\t\texisting.instance.play()?.catch( logPlayError );\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t\t.catch( logPlayError );\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Read translated labels from server-rendered data attributes.\n\tconst labels = {\n\t\tplay: ref.dataset.labelPlay,\n\t\tpause: ref.dataset.labelPause,\n\t\tseek: ref.dataset.labelSeek,\n\t\tseekValueText: ref.dataset.labelSeekValue,\n\t};\n\n\t// Initialize using the shared core.\n\tconst player = initWaveformPlayer( ref, {\n\t\tsrc: track.url,\n\t\ttitle: track.title,\n\t\tartist: track.artist,\n\t\timage: track.image,\n\t\timageAlt: track.imageAlt,\n\t\twaveformColor: ref.dataset.waveformPlayerColor,\n\t\twaveformGradient: ref.dataset.waveformPlayerGradient,\n\t\tbackgroundColor: ref.dataset.waveformPlayerBackgroundColor,\n\t\tbackgroundGradient: ref.dataset.waveformPlayerBackgroundGradient,\n\t\tautoPlay: shouldAutoPlay,\n\t\tlabels,\n\t\twaveformStyle: context.waveformStyle,\n\t\tshowPlayButtonArtwork,\n\t\tonEnded: () => {\n\t\t\t// Advance to next track (autoPlay handles playback).\n\t\t\tconst currentIndex = context.tracks.findIndex(\n\t\t\t\t( trackId ) => trackId === context.currentId\n\t\t\t);\n\t\t\tconst nextTrack = context.tracks[ currentIndex + 1 ];\n\t\t\tif ( nextTrack ) {\n\t\t\t\tcontext.currentId = nextTrack;\n\t\t\t}\n\t\t},\n\t} );\n\tconst setIsPlaying = ( isPlaying ) => {\n\t\tcontext.isPlaying = isPlaying;\n\t};\n\tconst onPlay = () => setIsPlaying( true );\n\tconst onPause = () => setIsPlaying( false );\n\tplayer.container.addEventListener( 'waveformplayer:play', onPlay );\n\tplayer.container.addEventListener( 'waveformplayer:pause', onPause );\n\tplayer.container.addEventListener( 'waveformplayer:ended', onPause );\n\tconst destroy = () => {\n\t\tplayer.container.removeEventListener( 'waveformplayer:play', onPlay );\n\t\tplayer.container.removeEventListener( 'waveformplayer:pause', onPause );\n\t\tplayer.container.removeEventListener( 'waveformplayer:ended', onPause );\n\t\tplayer.destroy();\n\t};\n\n\t// Store state for cleanup, including instance for loadTrack reuse.\n\tconst nextState = {\n\t\turl: track.url,\n\t\tinstance: player.instance,\n\t\tcontainer: player.container,\n\t\tdestroy,\n\t};\n\tplayerState.set( ref, nextState );\n\tplaylistPlayerState.set( context.playlistId, nextState );\n}\n"],
|
|
5
|
+
"mappings": ";;;AAGA,2BAA8C;AAK9C,4BAKO;AAKP,IAAM,cAAc,oBAAI,QAAQ;AAChC,IAAM,sBAAsB,oBAAI,IAAI;AAEpC,IAAM,EAAE,MAAM,QAAI;AAAA,EACjB;AAAA,EACA;AAAA,IACC,OAAO;AAAA,MACN,WAAW,CAAC;AAAA,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4
|
"name": "core/playlist-track",
|
|
6
5
|
"title": "Playlist track",
|
|
7
6
|
"category": "media",
|
|
@@ -9,7 +8,7 @@
|
|
|
9
8
|
"description": "Playlist track.",
|
|
10
9
|
"keywords": [ "music", "sound" ],
|
|
11
10
|
"textdomain": "default",
|
|
12
|
-
"usesContext": [ "showArtists", "
|
|
11
|
+
"usesContext": [ "showArtists", "showImages" ],
|
|
13
12
|
"attributes": {
|
|
14
13
|
"blob": {
|
|
15
14
|
"type": "string",
|
|
@@ -18,9 +17,6 @@
|
|
|
18
17
|
"id": {
|
|
19
18
|
"type": "number"
|
|
20
19
|
},
|
|
21
|
-
"uniqueId": {
|
|
22
|
-
"type": "string"
|
|
23
|
-
},
|
|
24
20
|
"src": {
|
|
25
21
|
"type": "string"
|
|
26
22
|
},
|
|
@@ -37,6 +33,9 @@
|
|
|
37
33
|
"image": {
|
|
38
34
|
"type": "string"
|
|
39
35
|
},
|
|
36
|
+
"imageAlt": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
40
39
|
"length": {
|
|
41
40
|
"type": "string"
|
|
42
41
|
},
|