@wordpress/block-library 10.1.1-next.v.202607070741.0 → 10.3.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 +25 -0
- package/build/accordion/block.json +1 -0
- package/build/accordion-panel/block.json +1 -0
- package/build/button/edit.cjs +18 -8
- package/build/button/edit.cjs.map +2 -2
- package/build/code/edit.cjs +3 -1
- package/build/code/edit.cjs.map +2 -2
- package/build/cover/block.json +12 -0
- package/build/cover/edit/block-controls.cjs +14 -5
- 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 +76 -32
- package/build/cover/edit/index.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 -3
- package/build/details/transforms.cjs.map +2 -2
- package/build/embed/edit.cjs +1 -1
- package/build/embed/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +1 -2
- package/build/embed/embed-placeholder.cjs.map +2 -2
- package/build/file/edit.cjs +4 -3
- package/build/file/edit.cjs.map +2 -2
- package/build/file/transforms.cjs +25 -60
- package/build/file/transforms.cjs.map +2 -2
- package/build/gallery/block.json +4 -2
- package/build/gallery/dynamic-gallery.cjs +104 -61
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +1 -1
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/gap-styles.cjs +49 -13
- package/build/gallery/gap-styles.cjs.map +3 -3
- package/build/gallery/use-dynamic-gallery.cjs +15 -8
- package/build/gallery/use-dynamic-gallery.cjs.map +2 -2
- package/build/group/transforms.cjs +1 -1
- package/build/group/transforms.cjs.map +2 -2
- package/build/heading/edit.cjs +1 -1
- package/build/heading/edit.cjs.map +2 -2
- package/build/html/modal.cjs +63 -54
- package/build/html/modal.cjs.map +3 -3
- package/build/icon/block.json +5 -3
- 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/edit.cjs +1 -35
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +23 -18
- 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/image/use-open-image-media-editor-modal.cjs +6 -2
- package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
- package/build/index.cjs +18 -8
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +5 -8
- package/build/latest-posts/edit.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-indent-list-item.cjs +10 -2
- package/build/list-item/hooks/use-indent-list-item.cjs.map +2 -2
- package/build/list-item/hooks/use-space.cjs +3 -2
- package/build/list-item/hooks/use-space.cjs.map +3 -3
- package/build/math/edit.cjs +39 -56
- package/build/math/edit.cjs.map +3 -3
- package/build/media-text/edit.cjs +2 -1
- package/build/media-text/edit.cjs.map +2 -2
- package/build/more/edit.cjs +2 -2
- package/build/more/edit.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +30 -16
- package/build/navigation/edit/index.cjs.map +3 -3
- package/build/navigation/edit/use-layout-custom-properties.cjs +72 -0
- package/build/navigation/edit/use-layout-custom-properties.cjs.map +7 -0
- package/build/navigation/view.cjs +9 -6
- package/build/navigation/view.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +3 -3
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/link-ui/index.cjs +2 -2
- package/build/navigation-link/link-ui/index.cjs.map +2 -2
- package/build/paragraph/edit.cjs +5 -2
- package/build/paragraph/edit.cjs.map +3 -3
- package/build/paragraph/index.cjs +4 -1
- package/build/paragraph/index.cjs.map +2 -2
- package/build/paragraph/use-enter.cjs +3 -7
- package/build/paragraph/use-enter.cjs.map +3 -3
- package/build/playlist/block.json +29 -10
- package/build/playlist/context.cjs +2 -1
- package/build/playlist/context.cjs.map +2 -2
- package/build/playlist/edit.cjs +328 -39
- 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 +37 -8
- package/build/playlist/utils.cjs.map +2 -2
- package/build/playlist/view.cjs +83 -13
- package/build/playlist/view.cjs.map +2 -2
- package/build/playlist-track/block.json +4 -2
- package/build/playlist-track/edit.cjs +115 -70
- package/build/playlist-track/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-content/edit.cjs +36 -15
- package/build/post-content/edit.cjs.map +2 -2
- package/build/post-featured-image/edit.cjs +3 -2
- package/build/post-featured-image/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/post-terms/edit.cjs +2 -2
- package/build/post-terms/edit.cjs.map +2 -2
- package/build/post-title/edit.cjs +2 -2
- package/build/post-title/edit.cjs.map +2 -2
- package/build/preformatted/edit.cjs +3 -1
- package/build/preformatted/edit.cjs.map +2 -2
- package/build/pullquote/block.json +3 -1
- package/build/pullquote/edit.cjs +5 -3
- package/build/pullquote/edit.cjs.map +2 -2
- package/build/query/block.json +3 -2
- package/build/query/edit/inspector-controls/index.cjs +42 -5
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/inspector-controls/offset-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/offset-controls.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/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/quote/block.json +3 -1
- package/build/quote/transforms.cjs +1 -3
- package/build/quote/transforms.cjs.map +2 -2
- package/build/read-more/edit.cjs +3 -1
- package/build/read-more/edit.cjs.map +2 -2
- package/build/rss/edit.cjs +0 -1
- package/build/rss/edit.cjs.map +2 -2
- package/build/site-tagline/edit.cjs +3 -1
- package/build/site-tagline/edit.cjs.map +2 -2
- package/build/site-title/edit.cjs +3 -1
- package/build/site-title/edit.cjs.map +2 -2
- package/build/social-links/edit.cjs +11 -4
- package/build/social-links/edit.cjs.map +2 -2
- package/build/tab-list/block.json +4 -3
- package/build/tab-list/edit.cjs +67 -11
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/tab-movers.cjs +87 -0
- package/build/tab-list/tab-movers.cjs.map +7 -0
- package/build/tab-panel/block.json +1 -6
- package/build/tab-panel/edit.cjs +16 -24
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tab-panels/block.json +0 -1
- package/build/table/edit.cjs +1 -1
- package/build/table/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -5
- package/build/tabs/edit.cjs +4 -39
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/use-tab-actions.cjs +23 -1
- package/build/tabs/use-tab-actions.cjs.map +2 -2
- package/build/tabs/use-tab-list-items-sync.cjs +19 -1
- package/build/tabs/use-tab-list-items-sync.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/utils/caption.cjs +2 -2
- package/build/utils/caption.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/edit.cjs +3 -1
- package/build/verse/edit.cjs.map +2 -2
- package/build/video/edit.cjs +2 -11
- package/build/video/edit.cjs.map +3 -3
- package/build/video/tracks-editor.cjs +0 -1
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build-module/accordion/block.json +1 -0
- package/build-module/accordion-panel/block.json +1 -0
- package/build-module/button/edit.mjs +19 -14
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/code/edit.mjs +3 -1
- package/build-module/code/edit.mjs.map +2 -2
- package/build-module/cover/block.json +12 -0
- package/build-module/cover/edit/block-controls.mjs +14 -5
- 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 +79 -35
- package/build-module/cover/edit/index.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 -7
- package/build-module/details/transforms.mjs.map +2 -2
- package/build-module/embed/edit.mjs +1 -1
- package/build-module/embed/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +1 -2
- 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/transforms.mjs +25 -60
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/gallery/block.json +4 -2
- package/build-module/gallery/dynamic-gallery.mjs +104 -61
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/gallery/edit.mjs +3 -3
- package/build-module/gallery/edit.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/use-dynamic-gallery.mjs +16 -9
- package/build-module/gallery/use-dynamic-gallery.mjs.map +2 -2
- package/build-module/group/transforms.mjs +2 -5
- package/build-module/group/transforms.mjs.map +2 -2
- package/build-module/heading/edit.mjs +1 -1
- package/build-module/heading/edit.mjs.map +2 -2
- package/build-module/html/modal.mjs +68 -55
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +5 -3
- 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/edit.mjs +1 -35
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +23 -18
- 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/image/use-open-image-media-editor-modal.mjs +6 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
- package/build-module/index.mjs +18 -8
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +5 -8
- package/build-module/latest-posts/edit.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-indent-list-item.mjs +10 -2
- package/build-module/list-item/hooks/use-indent-list-item.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/math/edit.mjs +41 -60
- package/build-module/math/edit.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +2 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/more/edit.mjs +2 -2
- package/build-module/more/edit.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +30 -16
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/use-layout-custom-properties.mjs +51 -0
- package/build-module/navigation/edit/use-layout-custom-properties.mjs.map +7 -0
- package/build-module/navigation/view.mjs +9 -6
- package/build-module/navigation/view.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs +3 -3
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/index.mjs +2 -2
- package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
- package/build-module/paragraph/edit.mjs +6 -2
- package/build-module/paragraph/edit.mjs.map +2 -2
- package/build-module/paragraph/index.mjs +4 -1
- package/build-module/paragraph/index.mjs.map +2 -2
- 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 +29 -10
- package/build-module/playlist/context.mjs +2 -1
- package/build-module/playlist/context.mjs.map +2 -2
- package/build-module/playlist/edit.mjs +331 -41
- 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 +35 -7
- package/build-module/playlist/utils.mjs.map +2 -2
- package/build-module/playlist/view.mjs +89 -14
- package/build-module/playlist/view.mjs.map +2 -2
- package/build-module/playlist-track/block.json +4 -2
- package/build-module/playlist-track/edit.mjs +117 -71
- package/build-module/playlist-track/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-content/edit.mjs +37 -15
- package/build-module/post-content/edit.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs +3 -2
- package/build-module/post-featured-image/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/post-terms/edit.mjs +2 -2
- package/build-module/post-terms/edit.mjs.map +2 -2
- package/build-module/post-title/edit.mjs +2 -2
- package/build-module/post-title/edit.mjs.map +2 -2
- package/build-module/preformatted/edit.mjs +3 -1
- package/build-module/preformatted/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +3 -1
- package/build-module/pullquote/edit.mjs +5 -3
- package/build-module/pullquote/edit.mjs.map +2 -2
- package/build-module/query/block.json +3 -2
- package/build-module/query/edit/inspector-controls/index.mjs +44 -6
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/offset-controls.mjs +2 -3
- package/build-module/query/edit/inspector-controls/offset-controls.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/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/quote/block.json +3 -1
- package/build-module/quote/transforms.mjs +2 -4
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/read-more/edit.mjs +3 -1
- package/build-module/read-more/edit.mjs.map +2 -2
- package/build-module/rss/edit.mjs +0 -1
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +3 -1
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +3 -1
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +11 -4
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +4 -3
- package/build-module/tab-list/edit.mjs +74 -13
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/tab-movers.mjs +59 -0
- package/build-module/tab-list/tab-movers.mjs.map +7 -0
- package/build-module/tab-panel/block.json +1 -6
- package/build-module/tab-panel/edit.mjs +17 -25
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panels/block.json +0 -1
- package/build-module/table/edit.mjs +1 -1
- package/build-module/table/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -5
- package/build-module/tabs/edit.mjs +5 -45
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/use-tab-actions.mjs +23 -1
- package/build-module/tabs/use-tab-actions.mjs.map +2 -2
- package/build-module/tabs/use-tab-list-items-sync.mjs +19 -1
- package/build-module/tabs/use-tab-list-items-sync.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/utils/caption.mjs +2 -2
- package/build-module/utils/caption.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/edit.mjs +3 -1
- package/build-module/verse/edit.mjs.map +2 -2
- package/build-module/video/edit.mjs +2 -11
- package/build-module/video/edit.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-style/cover/editor-rtl.css +3 -0
- package/build-style/cover/editor.css +3 -0
- package/build-style/editor-rtl.css +61 -59
- package/build-style/editor.css +61 -59
- package/build-style/icon/editor-rtl.css +80 -10
- package/build-style/icon/editor.css +80 -10
- package/build-style/image/editor-rtl.css +3 -32
- package/build-style/image/editor.css +3 -32
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +3 -4
- package/build-style/navigation/editor.css +3 -4
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/playlist/editor-rtl.css +4 -3
- package/build-style/playlist/editor.css +4 -3
- package/build-style/playlist/style-rtl.css +81 -5
- package/build-style/playlist/style.css +81 -5
- package/build-style/playlist-track/style-rtl.css +10 -0
- package/build-style/playlist-track/style.css +10 -0
- package/build-style/pullquote/editor-rtl.css +4 -0
- package/build-style/pullquote/editor.css +4 -0
- package/build-style/style-rtl.css +91 -5
- package/build-style/style.css +91 -5
- package/build-style/tab-list/editor-rtl.css +101 -0
- package/build-style/tab-list/editor.css +101 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- 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 +47 -45
- package/src/accordion/README.md +1 -0
- package/src/accordion/block.json +1 -0
- package/src/accordion-panel/block.json +1 -0
- package/src/breadcrumbs/index.php +3 -1
- package/src/button/edit.js +21 -15
- package/src/button/index.php +1 -1
- package/src/code/edit.js +7 -2
- package/src/cover/README.md +60 -0
- package/src/cover/block.json +12 -0
- package/src/cover/edit/block-controls.js +26 -11
- package/src/cover/edit/embed-video-url-input.js +5 -4
- package/src/cover/edit/index.js +109 -46
- package/src/cover/editor.scss +6 -0
- package/src/cover/embed-video-utils.js +38 -13
- package/src/cover/index.php +9 -2
- package/src/details/transforms.js +2 -7
- package/src/editor.scss +1 -0
- package/src/embed/edit.js +3 -1
- package/src/embed/embed-placeholder.js +9 -8
- package/src/file/edit.js +8 -8
- package/src/file/transforms.js +28 -60
- package/src/form/index.php +6 -4
- package/src/gallery/README.md +1 -1
- package/src/gallery/block.json +4 -2
- package/src/gallery/dynamic-gallery.js +133 -74
- package/src/gallery/edit.js +3 -3
- package/src/gallery/gap-styles.js +79 -20
- package/src/gallery/index.php +103 -43
- package/src/gallery/use-dynamic-gallery.js +27 -12
- package/src/group/transforms.js +2 -5
- package/src/heading/edit.js +1 -1
- package/src/html/modal.js +13 -2
- package/src/icon/README.md +1 -3
- package/src/icon/block.json +5 -3
- 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 -11
- package/src/image/README.md +1 -1
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -57
- package/src/image/editor.scss +6 -44
- package/src/image/image.js +56 -27
- package/src/image/test/use-open-image-media-editor-modal.js +37 -1
- package/src/image/transforms.js +128 -0
- package/src/image/use-open-image-media-editor-modal.js +8 -1
- package/src/index.js +19 -7
- package/src/latest-posts/edit.js +5 -8
- package/src/latest-posts/index.php +49 -18
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-enter.js +15 -22
- package/src/list-item/hooks/use-indent-list-item.js +10 -1
- package/src/list-item/hooks/use-space.js +4 -6
- package/src/math/edit.js +42 -59
- package/src/media-text/edit.js +1 -0
- package/src/media-text/editor.scss +1 -0
- package/src/media-text/index.php +11 -2
- package/src/more/edit.js +7 -4
- package/src/more/editor.scss +1 -1
- package/src/navigation/edit/index.js +52 -36
- package/src/navigation/edit/test/layout-custom-properties.js +138 -0
- package/src/navigation/edit/use-layout-custom-properties.js +84 -0
- package/src/navigation/editor.scss +1 -2
- package/src/navigation/index.php +123 -12
- package/src/navigation/test/view.js +51 -0
- package/src/navigation/view.js +15 -14
- package/src/navigation-link/edit.js +11 -7
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/index.php +70 -3
- package/src/navigation-link/link-ui/index.js +2 -1
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +1 -1
- package/src/navigation-submenu/index.php +6 -3
- package/src/nextpage/editor.scss +1 -1
- package/src/page-list/index.php +4 -3
- package/src/paragraph/edit.js +9 -2
- package/src/paragraph/index.js +4 -1
- package/src/paragraph/use-enter.js +4 -11
- package/src/pattern/index.php +5 -5
- package/src/playlist/README.md +17 -18
- package/src/playlist/block.json +29 -10
- package/src/playlist/context.js +1 -0
- package/src/playlist/edit.js +395 -59
- package/src/playlist/editor.scss +4 -5
- package/src/playlist/index.js +1 -1
- package/src/playlist/index.php +71 -22
- package/src/playlist/style.scss +54 -1
- package/src/playlist/test/edit-component.js +139 -0
- package/src/playlist/test/edit.js +43 -2
- package/src/playlist/utils.js +49 -10
- package/src/playlist/view.js +97 -16
- package/src/playlist-track/README.md +3 -3
- package/src/playlist-track/block.json +4 -2
- package/src/playlist-track/edit.js +116 -75
- package/src/playlist-track/index.php +26 -11
- package/src/playlist-track/style.scss +10 -0
- package/src/playlist-track/test/edit.js +253 -0
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-content/edit.js +45 -16
- package/src/post-excerpt/index.php +4 -1
- package/src/post-featured-image/edit.js +3 -2
- package/src/post-featured-image/index.php +4 -1
- 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/post-terms/edit.js +7 -4
- package/src/post-title/edit.js +5 -3
- package/src/preformatted/edit.js +7 -2
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +3 -1
- package/src/pullquote/edit.js +9 -4
- package/src/pullquote/editor.scss +6 -0
- package/src/query/README.md +2 -1
- package/src/query/block.json +3 -2
- package/src/query/edit/inspector-controls/index.js +47 -4
- package/src/query/edit/inspector-controls/offset-controls.js +2 -3
- package/src/query/edit/inspector-controls/pages-control.js +0 -1
- package/src/query/edit/query-content.js +19 -3
- package/src/query/index.js +1 -0
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +3 -1
- package/src/quote/transforms.js +2 -4
- package/src/read-more/edit.js +7 -2
- package/src/rss/edit.js +0 -1
- package/src/rss/index.php +10 -4
- package/src/site-tagline/edit.js +7 -2
- package/src/site-title/edit.js +7 -2
- package/src/social-link/index.php +19 -9
- package/src/social-links/edit.js +21 -12
- package/src/tab-list/README.md +4 -5
- package/src/tab-list/block.json +4 -3
- package/src/tab-list/edit.js +92 -28
- package/src/tab-list/editor.scss +9 -0
- package/src/tab-list/index.php +9 -4
- package/src/tab-list/tab-movers.js +72 -0
- package/src/tab-panel/README.md +4 -6
- package/src/tab-panel/block.json +1 -6
- package/src/tab-panel/edit.js +20 -33
- package/src/tab-panels/README.md +5 -3
- package/src/tab-panels/block.json +0 -1
- package/src/table/edit.js +1 -1
- package/src/table-of-contents/index.php +386 -1
- package/src/tabs/README.md +18 -9
- package/src/tabs/block.json +0 -5
- package/src/tabs/edit.js +7 -64
- package/src/tabs/use-tab-actions.js +32 -3
- package/src/tabs/use-tab-list-items-sync.js +24 -4
- package/src/tag-cloud/index.php +3 -2
- package/src/template-part/index.php +3 -17
- 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/utils/caption.js +7 -4
- package/src/utils/media-control.scss +1 -5
- package/src/utils/test/waveform-player.js +297 -34
- package/src/utils/test/waveform-utils.js +473 -5
- package/src/utils/waveform-player.js +189 -59
- package/src/utils/waveform-utils.js +443 -40
- package/src/verse/edit.js +7 -2
- package/src/video/edit.js +0 -8
- package/src/video/editor.scss +1 -1
- package/src/video/index.php +2 -2
- package/src/video/tracks-editor.js +0 -1
- package/build/image/animated-gif-convert-control.cjs +0 -105
- package/build/image/animated-gif-convert-control.cjs.map +0 -7
- package/build/utils/gif-conversion-attributes.cjs +0 -40
- package/build/utils/gif-conversion-attributes.cjs.map +0 -7
- package/build/video/gif-restore-control.cjs +0 -73
- package/build/video/gif-restore-control.cjs.map +0 -7
- package/build-module/image/animated-gif-convert-control.mjs +0 -87
- package/build-module/image/animated-gif-convert-control.mjs.map +0 -7
- package/build-module/utils/gif-conversion-attributes.mjs +0 -15
- package/build-module/utils/gif-conversion-attributes.mjs.map +0 -7
- package/build-module/video/gif-restore-control.mjs +0 -55
- package/build-module/video/gif-restore-control.mjs.map +0 -7
- package/src/image/animated-gif-convert-control.js +0 -135
- package/src/image/test/animated-gif-convert-control.js +0 -276
- package/src/utils/gif-conversion-attributes.js +0 -30
- package/src/utils/test/gif-conversion-attributes.js +0 -60
- package/src/video/gif-restore-control.js +0 -92
package/build/playlist/edit.cjs
CHANGED
|
@@ -42,6 +42,7 @@ var import_notices = require("@wordpress/notices");
|
|
|
42
42
|
var import_i18n = require("@wordpress/i18n");
|
|
43
43
|
var import_icons = require("@wordpress/icons");
|
|
44
44
|
var import_blocks = require("@wordpress/blocks");
|
|
45
|
+
var import_blob = require("@wordpress/blob");
|
|
45
46
|
var import_caption = require("../utils/caption.cjs");
|
|
46
47
|
var import_hooks = require("../utils/hooks.cjs");
|
|
47
48
|
var import_waveform_player = require("../utils/waveform-player.cjs");
|
|
@@ -49,6 +50,26 @@ var import_context = require("./context.cjs");
|
|
|
49
50
|
var import_utils = require("./utils.cjs");
|
|
50
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
52
|
var ALLOWED_MEDIA_TYPES = ["audio"];
|
|
53
|
+
var AUDIO_FILE_EXTENSION = /\.(aac|aif|aiff|flac|m4a|m4b|mp3|oga|ogg|opus|wav|weba)$/i;
|
|
54
|
+
var DEFAULT_WAVEFORM_STYLE = "bars";
|
|
55
|
+
var FILE_LIST_OBJECT_NAME = "[object FileList]";
|
|
56
|
+
var WAVEFORM_STYLE_OPTIONS = [
|
|
57
|
+
{ label: (0, import_i18n._x)("Bars", "waveform style option"), value: "bars" },
|
|
58
|
+
{ label: (0, import_i18n._x)("Mirror", "waveform style option"), value: "mirror" },
|
|
59
|
+
{ label: (0, import_i18n._x)("Line", "waveform style option"), value: "line" },
|
|
60
|
+
{ label: (0, import_i18n._x)("Blocks", "waveform style option"), value: "blocks" },
|
|
61
|
+
{ label: (0, import_i18n._x)("Dots", "waveform style option"), value: "dots" },
|
|
62
|
+
{ label: (0, import_i18n._x)("Seekbar", "waveform style option"), value: "seekbar" }
|
|
63
|
+
];
|
|
64
|
+
function isFile(value) {
|
|
65
|
+
return Object.prototype.toString.call(value) === "[object File]" || typeof File !== "undefined" && value instanceof File;
|
|
66
|
+
}
|
|
67
|
+
function isAudioFile(file) {
|
|
68
|
+
return file.type ? file.type.startsWith("audio/") : AUDIO_FILE_EXTENSION.test(file.name);
|
|
69
|
+
}
|
|
70
|
+
function getTrackIdentifier(track) {
|
|
71
|
+
return track.id ?? track.src ?? track.blob;
|
|
72
|
+
}
|
|
52
73
|
var PlaylistEdit = ({
|
|
53
74
|
attributes,
|
|
54
75
|
setAttributes,
|
|
@@ -61,17 +82,45 @@ var PlaylistEdit = ({
|
|
|
61
82
|
showTracklist,
|
|
62
83
|
showNumbers,
|
|
63
84
|
showImages,
|
|
85
|
+
showPlayButtonArtwork,
|
|
64
86
|
showArtists,
|
|
65
|
-
showTrackLength
|
|
87
|
+
showTrackLength,
|
|
88
|
+
waveformStyle = DEFAULT_WAVEFORM_STYLE,
|
|
89
|
+
waveformColor,
|
|
90
|
+
waveformGradient,
|
|
91
|
+
waveformBackgroundColor,
|
|
92
|
+
waveformBackgroundGradient
|
|
66
93
|
} = attributes;
|
|
67
|
-
const waveformStyle = attributes.className?.match(/is-style-([\w-]+)/)?.[1] || "bars";
|
|
68
94
|
const blockProps = (0, import_block_editor.useBlockProps)();
|
|
69
|
-
const
|
|
95
|
+
const waveformPanelId = `${clientId}-waveform`;
|
|
96
|
+
const { replaceInnerBlocks, selectBlock } = (0, import_data.useDispatch)(import_block_editor.store);
|
|
70
97
|
const { createErrorNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
71
98
|
const dropdownMenuProps = (0, import_hooks.useToolsPanelDropdownMenuProps)();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
99
|
+
const colorGradientSettings = (0, import_block_editor.__experimentalUseMultipleOriginColorsAndGradients)();
|
|
100
|
+
const colors = (0, import_element.useMemo)(
|
|
101
|
+
() => colorGradientSettings.colors.flatMap(
|
|
102
|
+
(origin) => origin?.colors ?? []
|
|
103
|
+
),
|
|
104
|
+
[colorGradientSettings.colors]
|
|
105
|
+
);
|
|
106
|
+
const gradients = (0, import_element.useMemo)(
|
|
107
|
+
() => colorGradientSettings.gradients.flatMap(
|
|
108
|
+
(origin) => origin?.gradients ?? []
|
|
109
|
+
),
|
|
110
|
+
[colorGradientSettings.gradients]
|
|
111
|
+
);
|
|
112
|
+
const hasColors = colors.length > 0 || !colorGradientSettings.disableCustomColors;
|
|
113
|
+
const hasGradients = gradients.length > 0 || !colorGradientSettings.disableCustomGradients;
|
|
114
|
+
const waveformGradientValue = waveformGradient;
|
|
115
|
+
const waveformBackgroundGradientValue = waveformBackgroundGradient;
|
|
116
|
+
let waveformColorGradientChange;
|
|
117
|
+
let waveformBackgroundColorGradientChange;
|
|
118
|
+
const onUploadError = (0, import_element.useCallback)(
|
|
119
|
+
(message) => {
|
|
120
|
+
createErrorNotice(message, { type: "snackbar" });
|
|
121
|
+
},
|
|
122
|
+
[createErrorNotice]
|
|
123
|
+
);
|
|
75
124
|
const [currentTrackClientId, setCurrentTrackClientId] = (0, import_element.useState)(null);
|
|
76
125
|
const { innerBlockTracks } = (0, import_data.useSelect)(
|
|
77
126
|
(select) => {
|
|
@@ -109,26 +158,89 @@ var PlaylistEdit = ({
|
|
|
109
158
|
setCurrentTrackClientId(validTracks[0].clientId);
|
|
110
159
|
}
|
|
111
160
|
}, [currentTrackClientId, setCurrentTrackClientId, validTracks]);
|
|
112
|
-
const
|
|
113
|
-
() =>
|
|
114
|
-
|
|
161
|
+
const createTrackBlocks = (0, import_element.useCallback)(
|
|
162
|
+
(media) => {
|
|
163
|
+
if (!media) {
|
|
164
|
+
return [];
|
|
165
|
+
}
|
|
166
|
+
let mediaItems = [media];
|
|
167
|
+
if (Object.prototype.toString.call(media) === FILE_LIST_OBJECT_NAME) {
|
|
168
|
+
mediaItems = Array.from(media);
|
|
169
|
+
} else if (Array.isArray(media)) {
|
|
170
|
+
mediaItems = media;
|
|
171
|
+
}
|
|
172
|
+
let hasInvalidFile = false;
|
|
173
|
+
const blocks = mediaItems.map((mediaItem) => {
|
|
174
|
+
if (isFile(mediaItem)) {
|
|
175
|
+
if (!isAudioFile(mediaItem)) {
|
|
176
|
+
hasInvalidFile = true;
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
return (0, import_blocks.createBlock)("core/playlist-track", {
|
|
180
|
+
blob: (0, import_blob.createBlobURL)(mediaItem),
|
|
181
|
+
title: mediaItem.name
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const track = (0, import_utils.getTrackAttributes)(mediaItem);
|
|
185
|
+
return track.src ? (0, import_blocks.createBlock)("core/playlist-track", track) : null;
|
|
186
|
+
}).filter(Boolean);
|
|
187
|
+
if (hasInvalidFile) {
|
|
188
|
+
onUploadError(
|
|
189
|
+
(0, import_i18n.__)("Only audio files can be added to a playlist.")
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
return blocks;
|
|
193
|
+
},
|
|
194
|
+
[onUploadError]
|
|
115
195
|
);
|
|
116
196
|
const onSelectTracks = (0, import_element.useCallback)(
|
|
117
197
|
(media) => {
|
|
118
|
-
|
|
198
|
+
const newBlocks = createTrackBlocks(media);
|
|
199
|
+
if (newBlocks.length === 0) {
|
|
119
200
|
return;
|
|
120
201
|
}
|
|
121
|
-
if (!Array.isArray(media)) {
|
|
122
|
-
media = [media];
|
|
123
|
-
}
|
|
124
|
-
const trackList = media.map(import_utils.getTrackAttributes);
|
|
125
|
-
const newBlocks = trackList.map(
|
|
126
|
-
(track) => (0, import_blocks.createBlock)("core/playlist-track", track)
|
|
127
|
-
);
|
|
128
202
|
setCurrentTrackClientId(newBlocks[0]?.clientId ?? null);
|
|
129
203
|
replaceInnerBlocks(clientId, newBlocks);
|
|
130
204
|
},
|
|
131
|
-
[
|
|
205
|
+
[
|
|
206
|
+
clientId,
|
|
207
|
+
createTrackBlocks,
|
|
208
|
+
replaceInnerBlocks,
|
|
209
|
+
setCurrentTrackClientId
|
|
210
|
+
]
|
|
211
|
+
);
|
|
212
|
+
const onAddTracks = (0, import_element.useCallback)(
|
|
213
|
+
(media) => {
|
|
214
|
+
const existingIds = new Set(
|
|
215
|
+
validTracks.map((block) => getTrackIdentifier(block.attributes)).filter(Boolean)
|
|
216
|
+
);
|
|
217
|
+
const newBlocks = createTrackBlocks(media).filter(
|
|
218
|
+
(block) => !existingIds.has(getTrackIdentifier(block.attributes))
|
|
219
|
+
);
|
|
220
|
+
if (newBlocks.length === 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const nextBlocks = [...validTracks, ...newBlocks];
|
|
224
|
+
setCurrentTrackClientId(newBlocks[0].clientId);
|
|
225
|
+
replaceInnerBlocks(clientId, nextBlocks);
|
|
226
|
+
selectBlock(newBlocks[0].clientId);
|
|
227
|
+
},
|
|
228
|
+
[
|
|
229
|
+
clientId,
|
|
230
|
+
createTrackBlocks,
|
|
231
|
+
replaceInnerBlocks,
|
|
232
|
+
selectBlock,
|
|
233
|
+
setCurrentTrackClientId,
|
|
234
|
+
validTracks
|
|
235
|
+
]
|
|
236
|
+
);
|
|
237
|
+
const playlistContext = (0, import_element.useMemo)(
|
|
238
|
+
() => ({
|
|
239
|
+
currentTrackClientId,
|
|
240
|
+
setCurrentTrackClientId,
|
|
241
|
+
addTracks: onAddTracks
|
|
242
|
+
}),
|
|
243
|
+
[currentTrackClientId, onAddTracks, setCurrentTrackClientId]
|
|
132
244
|
);
|
|
133
245
|
const currentTrackData = tracks.find((track) => track.clientId === currentTrackClientId) ?? tracks[0];
|
|
134
246
|
const onTrackEnded = (0, import_element.useCallback)(() => {
|
|
@@ -169,14 +281,98 @@ var PlaylistEdit = ({
|
|
|
169
281
|
setAttributes({ [attribute]: newValue });
|
|
170
282
|
};
|
|
171
283
|
}
|
|
172
|
-
const
|
|
173
|
-
(
|
|
174
|
-
|
|
284
|
+
const onChangeWaveformStyle = (0, import_element.useCallback)(
|
|
285
|
+
(newWaveformStyle) => {
|
|
286
|
+
setAttributes({
|
|
287
|
+
waveformStyle: newWaveformStyle === DEFAULT_WAVEFORM_STYLE ? void 0 : newWaveformStyle
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
[setAttributes]
|
|
175
291
|
);
|
|
176
|
-
|
|
292
|
+
function updateWaveformColor(colorValue) {
|
|
293
|
+
const isSettingColor = colorValue !== void 0;
|
|
294
|
+
if (!isSettingColor && waveformColorGradientChange === "gradient") {
|
|
295
|
+
waveformColorGradientChange = void 0;
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
waveformColorGradientChange = "color";
|
|
299
|
+
setAttributes({
|
|
300
|
+
waveformColor: colorValue,
|
|
301
|
+
waveformGradient: void 0
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
function updateWaveformGradient(gradientValue) {
|
|
305
|
+
const isSettingGradient = gradientValue !== void 0;
|
|
306
|
+
if (!isSettingGradient && waveformColorGradientChange === "color") {
|
|
307
|
+
waveformColorGradientChange = void 0;
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
waveformColorGradientChange = "gradient";
|
|
311
|
+
setAttributes({
|
|
312
|
+
waveformGradient: gradientValue,
|
|
313
|
+
waveformColor: void 0
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function updateWaveformBackgroundColor(colorValue) {
|
|
317
|
+
const isSettingColor = colorValue !== void 0;
|
|
318
|
+
if (!isSettingColor && waveformBackgroundColorGradientChange === "gradient") {
|
|
319
|
+
waveformBackgroundColorGradientChange = void 0;
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
waveformBackgroundColorGradientChange = "color";
|
|
323
|
+
setAttributes({
|
|
324
|
+
waveformBackgroundColor: colorValue,
|
|
325
|
+
waveformBackgroundGradient: void 0
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function updateWaveformBackgroundGradient(gradientValue) {
|
|
329
|
+
const isSettingGradient = gradientValue !== void 0;
|
|
330
|
+
if (!isSettingGradient && waveformBackgroundColorGradientChange === "color") {
|
|
331
|
+
waveformBackgroundColorGradientChange = void 0;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
waveformBackgroundColorGradientChange = "gradient";
|
|
335
|
+
setAttributes({
|
|
336
|
+
waveformBackgroundGradient: gradientValue,
|
|
337
|
+
waveformBackgroundColor: void 0
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
const colorSettings = [];
|
|
341
|
+
if (hasColors || hasGradients) {
|
|
342
|
+
colorSettings.push(
|
|
343
|
+
{
|
|
344
|
+
colorValue: hasColors ? waveformColor : void 0,
|
|
345
|
+
gradientValue: hasGradients ? waveformGradientValue : void 0,
|
|
346
|
+
label: (0, import_i18n.__)("Waveform & Play button"),
|
|
347
|
+
onColorChange: hasColors ? updateWaveformColor : void 0,
|
|
348
|
+
onGradientChange: hasGradients ? updateWaveformGradient : void 0,
|
|
349
|
+
isShownByDefault: true,
|
|
350
|
+
clearable: true,
|
|
351
|
+
enableAlpha: true,
|
|
352
|
+
resetAllFilter: () => ({
|
|
353
|
+
waveformColor: void 0,
|
|
354
|
+
waveformGradient: void 0
|
|
355
|
+
})
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
colorValue: hasColors ? waveformBackgroundColor : void 0,
|
|
359
|
+
gradientValue: hasGradients ? waveformBackgroundGradientValue : void 0,
|
|
360
|
+
label: (0, import_i18n.__)("Waveform background"),
|
|
361
|
+
onColorChange: hasColors ? updateWaveformBackgroundColor : void 0,
|
|
362
|
+
onGradientChange: hasGradients ? updateWaveformBackgroundGradient : void 0,
|
|
363
|
+
isShownByDefault: true,
|
|
364
|
+
clearable: true,
|
|
365
|
+
enableAlpha: true,
|
|
366
|
+
resetAllFilter: () => ({
|
|
367
|
+
waveformBackgroundColor: void 0,
|
|
368
|
+
waveformBackgroundGradient: void 0
|
|
369
|
+
})
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
}
|
|
177
373
|
const innerBlocksProps = (0, import_block_editor.useInnerBlocksProps)(blockProps, {
|
|
178
374
|
__experimentalAppenderTagName: "li",
|
|
179
|
-
renderAppender:
|
|
375
|
+
renderAppender: false
|
|
180
376
|
});
|
|
181
377
|
if (tracks.length === 0) {
|
|
182
378
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -187,7 +383,7 @@ var PlaylistEdit = ({
|
|
|
187
383
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
188
384
|
import_block_editor.MediaPlaceholder,
|
|
189
385
|
{
|
|
190
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockIcon, { icon: import_icons.
|
|
386
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockIcon, { icon: import_icons.playlist }),
|
|
191
387
|
labels: {
|
|
192
388
|
title: (0, import_i18n.__)("Playlist"),
|
|
193
389
|
instructions: (0, import_i18n.__)(
|
|
@@ -197,6 +393,7 @@ var PlaylistEdit = ({
|
|
|
197
393
|
onSelect: onSelectTracks,
|
|
198
394
|
accept: "audio/*",
|
|
199
395
|
multiple: true,
|
|
396
|
+
handleUpload: false,
|
|
200
397
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
201
398
|
onError: onUploadError
|
|
202
399
|
}
|
|
@@ -208,11 +405,11 @@ var PlaylistEdit = ({
|
|
|
208
405
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
209
406
|
import_block_editor.MediaReplaceFlow,
|
|
210
407
|
{
|
|
211
|
-
name: (0, import_i18n.__)("
|
|
212
|
-
onSelect:
|
|
408
|
+
name: (0, import_i18n.__)("Add"),
|
|
409
|
+
onSelect: onAddTracks,
|
|
213
410
|
accept: "audio/*",
|
|
214
411
|
multiple: true,
|
|
215
|
-
|
|
412
|
+
handleUpload: false,
|
|
216
413
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
217
414
|
onError: onUploadError
|
|
218
415
|
}
|
|
@@ -228,6 +425,7 @@ var PlaylistEdit = ({
|
|
|
228
425
|
showNumbers: true,
|
|
229
426
|
showTrackLength: true,
|
|
230
427
|
showImages: true,
|
|
428
|
+
showPlayButtonArtwork: false,
|
|
231
429
|
order: "asc"
|
|
232
430
|
});
|
|
233
431
|
},
|
|
@@ -236,14 +434,14 @@ var PlaylistEdit = ({
|
|
|
236
434
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
237
435
|
import_components.__experimentalToolsPanelItem,
|
|
238
436
|
{
|
|
239
|
-
label: (0, import_i18n.__)("Show
|
|
437
|
+
label: (0, import_i18n.__)("Show tracklist"),
|
|
240
438
|
isShownByDefault: true,
|
|
241
439
|
hasValue: () => showTracklist !== true,
|
|
242
440
|
onDeselect: () => setAttributes({ showTracklist: true }),
|
|
243
441
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
244
442
|
import_components.ToggleControl,
|
|
245
443
|
{
|
|
246
|
-
label: (0, import_i18n.__)("Show
|
|
444
|
+
label: (0, import_i18n.__)("Show tracklist"),
|
|
247
445
|
onChange: toggleAttribute("showTracklist"),
|
|
248
446
|
checked: showTracklist
|
|
249
447
|
}
|
|
@@ -254,7 +452,7 @@ var PlaylistEdit = ({
|
|
|
254
452
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
255
453
|
import_components.__experimentalToolsPanelItem,
|
|
256
454
|
{
|
|
257
|
-
label: (0, import_i18n.__)("Show artist name in
|
|
455
|
+
label: (0, import_i18n.__)("Show artist name in tracklist"),
|
|
258
456
|
isShownByDefault: true,
|
|
259
457
|
hasValue: () => showArtists !== true,
|
|
260
458
|
onDeselect: () => setAttributes({ showArtists: true }),
|
|
@@ -262,7 +460,7 @@ var PlaylistEdit = ({
|
|
|
262
460
|
import_components.ToggleControl,
|
|
263
461
|
{
|
|
264
462
|
label: (0, import_i18n.__)(
|
|
265
|
-
"Show artist name in
|
|
463
|
+
"Show artist name in tracklist"
|
|
266
464
|
),
|
|
267
465
|
onChange: toggleAttribute(
|
|
268
466
|
"showArtists"
|
|
@@ -275,14 +473,18 @@ var PlaylistEdit = ({
|
|
|
275
473
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
276
474
|
import_components.__experimentalToolsPanelItem,
|
|
277
475
|
{
|
|
278
|
-
label: (0, import_i18n.__)(
|
|
476
|
+
label: (0, import_i18n.__)(
|
|
477
|
+
"Show track numbers in tracklist"
|
|
478
|
+
),
|
|
279
479
|
isShownByDefault: true,
|
|
280
480
|
hasValue: () => showNumbers !== true,
|
|
281
481
|
onDeselect: () => setAttributes({ showNumbers: true }),
|
|
282
482
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
283
483
|
import_components.ToggleControl,
|
|
284
484
|
{
|
|
285
|
-
label: (0, import_i18n.__)(
|
|
485
|
+
label: (0, import_i18n.__)(
|
|
486
|
+
"Show track numbers in tracklist"
|
|
487
|
+
),
|
|
286
488
|
onChange: toggleAttribute(
|
|
287
489
|
"showNumbers"
|
|
288
490
|
),
|
|
@@ -294,7 +496,9 @@ var PlaylistEdit = ({
|
|
|
294
496
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
295
497
|
import_components.__experimentalToolsPanelItem,
|
|
296
498
|
{
|
|
297
|
-
label: (0, import_i18n.__)(
|
|
499
|
+
label: (0, import_i18n.__)(
|
|
500
|
+
"Show track duration in tracklist"
|
|
501
|
+
),
|
|
298
502
|
isShownByDefault: true,
|
|
299
503
|
hasValue: () => showTrackLength !== true,
|
|
300
504
|
onDeselect: () => setAttributes({ showTrackLength: true }),
|
|
@@ -302,7 +506,7 @@ var PlaylistEdit = ({
|
|
|
302
506
|
import_components.ToggleControl,
|
|
303
507
|
{
|
|
304
508
|
label: (0, import_i18n.__)(
|
|
305
|
-
"Show track
|
|
509
|
+
"Show track duration in tracklist"
|
|
306
510
|
),
|
|
307
511
|
onChange: toggleAttribute(
|
|
308
512
|
"showTrackLength"
|
|
@@ -316,20 +520,39 @@ var PlaylistEdit = ({
|
|
|
316
520
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
317
521
|
import_components.__experimentalToolsPanelItem,
|
|
318
522
|
{
|
|
319
|
-
label: (0, import_i18n.__)("Show images"),
|
|
523
|
+
label: (0, import_i18n.__)("Show tracklist images"),
|
|
320
524
|
isShownByDefault: true,
|
|
321
525
|
hasValue: () => showImages !== true,
|
|
322
526
|
onDeselect: () => setAttributes({ showImages: true }),
|
|
323
527
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
324
528
|
import_components.ToggleControl,
|
|
325
529
|
{
|
|
326
|
-
label: (0, import_i18n.__)("Show images"),
|
|
530
|
+
label: (0, import_i18n.__)("Show tracklist images"),
|
|
327
531
|
onChange: toggleAttribute("showImages"),
|
|
328
532
|
checked: showImages
|
|
329
533
|
}
|
|
330
534
|
)
|
|
331
535
|
}
|
|
332
536
|
),
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
538
|
+
import_components.__experimentalToolsPanelItem,
|
|
539
|
+
{
|
|
540
|
+
label: (0, import_i18n.__)("Show track image on play button"),
|
|
541
|
+
isShownByDefault: true,
|
|
542
|
+
hasValue: () => showPlayButtonArtwork === true,
|
|
543
|
+
onDeselect: () => setAttributes({ showPlayButtonArtwork: false }),
|
|
544
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
545
|
+
import_components.ToggleControl,
|
|
546
|
+
{
|
|
547
|
+
label: (0, import_i18n.__)("Show track image on play button"),
|
|
548
|
+
onChange: toggleAttribute(
|
|
549
|
+
"showPlayButtonArtwork"
|
|
550
|
+
),
|
|
551
|
+
checked: showPlayButtonArtwork === true
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
}
|
|
555
|
+
),
|
|
333
556
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
334
557
|
import_components.__experimentalToolsPanelItem,
|
|
335
558
|
{
|
|
@@ -354,7 +577,66 @@ var PlaylistEdit = ({
|
|
|
354
577
|
]
|
|
355
578
|
}
|
|
356
579
|
) }),
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InspectorControls, { group: "styles", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
581
|
+
import_components.__experimentalToolsPanel,
|
|
582
|
+
{
|
|
583
|
+
label: (0, import_i18n.__)("Waveform"),
|
|
584
|
+
resetAll: () => {
|
|
585
|
+
setAttributes({
|
|
586
|
+
waveformStyle: void 0,
|
|
587
|
+
waveformColor: void 0,
|
|
588
|
+
waveformGradient: void 0,
|
|
589
|
+
waveformBackgroundColor: void 0,
|
|
590
|
+
waveformBackgroundGradient: void 0
|
|
591
|
+
});
|
|
592
|
+
},
|
|
593
|
+
panelId: waveformPanelId,
|
|
594
|
+
dropdownMenuProps,
|
|
595
|
+
children: [
|
|
596
|
+
colorSettings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "wp-block-playlist__waveform-color-controls", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
597
|
+
import_block_editor.__experimentalColorGradientSettingsDropdown,
|
|
598
|
+
{
|
|
599
|
+
__experimentalIsRenderedInSidebar: true,
|
|
600
|
+
settings: colorSettings,
|
|
601
|
+
panelId: waveformPanelId,
|
|
602
|
+
...colorGradientSettings
|
|
603
|
+
}
|
|
604
|
+
) }),
|
|
605
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
606
|
+
import_components.__experimentalToolsPanelItem,
|
|
607
|
+
{
|
|
608
|
+
label: (0, import_i18n.__)("Shape"),
|
|
609
|
+
isShownByDefault: true,
|
|
610
|
+
hasValue: () => waveformStyle !== DEFAULT_WAVEFORM_STYLE,
|
|
611
|
+
onDeselect: () => onChangeWaveformStyle(DEFAULT_WAVEFORM_STYLE),
|
|
612
|
+
panelId: waveformPanelId,
|
|
613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
614
|
+
import_components.SelectControl,
|
|
615
|
+
{
|
|
616
|
+
label: (0, import_i18n.__)("Shape"),
|
|
617
|
+
value: waveformStyle,
|
|
618
|
+
options: WAVEFORM_STYLE_OPTIONS,
|
|
619
|
+
onChange: onChangeWaveformStyle
|
|
620
|
+
}
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
)
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
) }),
|
|
357
627
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", { ...blockProps, children: [
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
629
|
+
import_block_editor.MediaPlaceholder,
|
|
630
|
+
{
|
|
631
|
+
onSelect: onAddTracks,
|
|
632
|
+
accept: "audio/*",
|
|
633
|
+
multiple: true,
|
|
634
|
+
handleUpload: false,
|
|
635
|
+
disableMediaButtons: true,
|
|
636
|
+
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
637
|
+
onError: onUploadError
|
|
638
|
+
}
|
|
639
|
+
),
|
|
358
640
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Disabled, { isDisabled: !isSelected, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
359
641
|
import_waveform_player.WaveformPlayer,
|
|
360
642
|
{
|
|
@@ -362,14 +644,21 @@ var PlaylistEdit = ({
|
|
|
362
644
|
title: currentTrackData?.title,
|
|
363
645
|
artist: currentTrackData?.artist,
|
|
364
646
|
image: currentTrackData?.image,
|
|
647
|
+
imageAlt: currentTrackData?.imageAlt,
|
|
365
648
|
waveformStyle,
|
|
366
|
-
|
|
649
|
+
color: waveformColor,
|
|
650
|
+
gradient: waveformGradientValue,
|
|
651
|
+
backgroundColor: waveformBackgroundColor,
|
|
652
|
+
backgroundGradient: waveformBackgroundGradientValue,
|
|
653
|
+
onEnded: onTrackEnded,
|
|
654
|
+
showPlayButtonArtwork: showPlayButtonArtwork === true
|
|
367
655
|
}
|
|
368
656
|
) }),
|
|
369
|
-
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
370
658
|
"ol",
|
|
371
659
|
{
|
|
372
660
|
className: (0, import_clsx.default)("wp-block-playlist__tracklist", {
|
|
661
|
+
"wp-block-playlist__tracklist-is-hidden": !showTracklist,
|
|
373
662
|
"wp-block-playlist__tracklist-show-numbers": showNumbers,
|
|
374
663
|
"wp-block-playlist__tracklist-length-is-hidden": !showTrackLength
|
|
375
664
|
}),
|