@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/video/edit-common-settings.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tToggleControl,\n\tSelectControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useMemo, useCallback } from '@wordpress/element';\n\nconst options = [\n\t{ value: 'auto', label: __( 'Auto' ) },\n\t{ value: 'metadata', label: __( 'Metadata' ) },\n\t{ value: 'none', label: _x( 'None', 'Preload value' ) },\n];\n\nconst VideoSettings = ( { setAttributes, attributes } ) => {\n\tconst { autoplay, controls, loop, muted, playsInline, preload } =\n\t\tattributes;\n\n\tconst autoPlayHelpText = __(\n\t\t'Autoplay may cause usability issues for some users.'\n\t);\n\n\tconst getAutoplayHelp = useCallback( ( checked ) => {\n\t\treturn checked ? autoPlayHelpText : null;\n\t}, [] );\n\n\tconst toggleFactory = useMemo( () => {\n\t\tconst toggleAttribute = ( attribute ) => {\n\t\t\treturn ( newValue ) => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\t[ attribute ]: newValue,\n\t\t\t\t\t// Set muted and playsInLine when autoplay changes\n\t\t\t\t\t// playsInline is set to true when autoplay is true to support iOS devices\n\t\t\t\t\t...( attribute === 'autoplay' && {\n\t\t\t\t\t\tmuted: newValue,\n\t\t\t\t\t\tplaysInline: newValue,\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t};\n\t\t};\n\n\t\treturn {\n\t\t\tautoplay: toggleAttribute( 'autoplay' ),\n\t\t\tloop: toggleAttribute( 'loop' ),\n\t\t\tmuted: toggleAttribute( 'muted' ),\n\t\t\tcontrols: toggleAttribute( 'controls' ),\n\t\t\tplaysInline: toggleAttribute( 'playsInline' ),\n\t\t};\n\t}, [] );\n\n\tconst onChangePreload = useCallback( ( value ) => {\n\t\tsetAttributes( { preload: value } );\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Autoplay' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! autoplay }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { autoplay: false, muted: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Autoplay' ) }\n\t\t\t\t\tonChange={ toggleFactory.autoplay }\n\t\t\t\t\tchecked={ !! autoplay }\n\t\t\t\t\thelp={ getAutoplayHelp }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Loop' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! loop }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { loop: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Loop' ) }\n\t\t\t\t\tonChange={ toggleFactory.loop }\n\t\t\t\t\tchecked={ !! loop }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Muted' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! muted }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { muted: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Muted' ) }\n\t\t\t\t\tonChange={ toggleFactory.muted }\n\t\t\t\t\tchecked={ !! muted }\n\t\t\t\t\tdisabled={ autoplay }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tautoplay ? __( 'Muted because of Autoplay.' ) : null\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Playback controls' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => ! controls }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { controls: true } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Playback controls' ) }\n\t\t\t\t\tonChange={ toggleFactory.controls }\n\t\t\t\t\tchecked={ !! controls }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Play inline' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! playsInline }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { playsInline: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t/* translators: Setting to play videos within the webpage on mobile browsers rather than opening in a fullscreen player. */\n\t\t\t\t\tlabel={ __( 'Play inline' ) }\n\t\t\t\t\tonChange={ toggleFactory.playsInline }\n\t\t\t\t\tchecked={ !! playsInline }\n\t\t\t\t\tdisabled={ autoplay }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tautoplay\n\t\t\t\t\t\t\t? __( 'Play inline enabled because of Autoplay.' )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Preload' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => preload !== 'metadata' }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { preload: 'metadata' } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<SelectControl\n\t\t\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,IAAI,UAAU;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA,gCAAgC;AAAA,OAC1B;AACP,SAAS,SAAS,mBAAmB;AAiDnC,mBASE,KATF;AA/CF,IAAM,UAAU;AAAA,EACf,EAAE,OAAO,QAAQ,OAAO,GAAI,MAAO,EAAE;AAAA,EACrC,EAAE,OAAO,YAAY,OAAO,GAAI,UAAW,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CAAC,CAAE;AAAA,QACpB,YAAa,MAAM;AAClB,wBAAe,EAAE,aAAa,MAAM,CAAE;AAAA,QACvC;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YAEA,OAAQ,GAAI,aAAc;AAAA,YAC1B,UAAW,cAAc;AAAA,YACzB,SAAU,CAAC,CAAE;AAAA,YACb,UAAW;AAAA,YACX,MACC,WACG,GAAI,0CAA2C,IAC/C;AAAA,cACA;AAAA,YACA;AAAA;AAAA,QAEL;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,SAAU;AAAA,QACtB,kBAAgB;AAAA,QAChB,UAAW,MAAM,YAAY;AAAA,QAC7B,YAAa,MAAM;AAClB,wBAAe,EAAE,SAAS,WAAW,CAAE;AAAA,QACxC;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tToggleControl,\n\tSelectControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useMemo, useCallback } from '@wordpress/element';\n\nconst options = [\n\t{ value: 'auto', label: __( 'Auto' ) },\n\t{ value: 'metadata', label: __( 'Metadata' ) },\n\t{ value: 'none', label: _x( 'None', 'Preload value' ) },\n];\n\nconst VideoSettings = ( { setAttributes, attributes } ) => {\n\tconst { autoplay, controls, loop, muted, playsInline, preload } =\n\t\tattributes;\n\n\tconst autoPlayHelpText = __(\n\t\t'Autoplay may cause usability issues for some users.'\n\t);\n\n\tconst getAutoplayHelp = useCallback( ( checked ) => {\n\t\treturn checked ? autoPlayHelpText : null;\n\t}, [] );\n\n\tconst toggleFactory = useMemo( () => {\n\t\tconst toggleAttribute = ( attribute ) => {\n\t\t\treturn ( newValue ) => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\t[ attribute ]: newValue,\n\t\t\t\t\t// Set muted and playsInLine when autoplay changes\n\t\t\t\t\t// playsInline is set to true when autoplay is true to support iOS devices\n\t\t\t\t\t...( attribute === 'autoplay' && {\n\t\t\t\t\t\tmuted: newValue,\n\t\t\t\t\t\tplaysInline: newValue,\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t};\n\t\t};\n\n\t\treturn {\n\t\t\tautoplay: toggleAttribute( 'autoplay' ),\n\t\t\tloop: toggleAttribute( 'loop' ),\n\t\t\tmuted: toggleAttribute( 'muted' ),\n\t\t\tcontrols: toggleAttribute( 'controls' ),\n\t\t\tplaysInline: toggleAttribute( 'playsInline' ),\n\t\t};\n\t}, [] );\n\n\tconst onChangePreload = useCallback( ( value ) => {\n\t\tsetAttributes( { preload: value } );\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Autoplay' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! autoplay }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { autoplay: false, muted: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Autoplay' ) }\n\t\t\t\t\tonChange={ toggleFactory.autoplay }\n\t\t\t\t\tchecked={ !! autoplay }\n\t\t\t\t\thelp={ getAutoplayHelp }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Loop' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! loop }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { loop: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Loop' ) }\n\t\t\t\t\tonChange={ toggleFactory.loop }\n\t\t\t\t\tchecked={ !! loop }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Muted' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! muted }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { muted: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Muted' ) }\n\t\t\t\t\tonChange={ toggleFactory.muted }\n\t\t\t\t\tchecked={ !! muted }\n\t\t\t\t\tdisabled={ autoplay }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tautoplay ? __( 'Muted because of Autoplay.' ) : null\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Playback controls' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => ! controls }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { controls: true } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Playback controls' ) }\n\t\t\t\t\tonChange={ toggleFactory.controls }\n\t\t\t\t\tchecked={ !! controls }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Play inline' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! playsInline }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { playsInline: false } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t/* translators: Setting to play videos within the webpage on mobile browsers rather than opening in a fullscreen player. */\n\t\t\t\t\tlabel={ __( 'Play inline' ) }\n\t\t\t\t\tonChange={ toggleFactory.playsInline }\n\t\t\t\t\tchecked={ !! playsInline }\n\t\t\t\t\tdisabled={ autoplay }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tautoplay\n\t\t\t\t\t\t\t? __( 'Play inline enabled because of Autoplay.' )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Preload' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => preload !== 'metadata' }\n\t\t\t\tonDeselect={ () => {\n\t\t\t\t\tsetAttributes( { preload: 'metadata' } );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'Preload' ) }\n\t\t\t\t\tvalue={ preload }\n\t\t\t\t\tonChange={ onChangePreload }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\thideCancelButton\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</>\n\t);\n};\n\nexport default VideoSettings;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,IAAI,UAAU;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA,gCAAgC;AAAA,OAC1B;AACP,SAAS,SAAS,mBAAmB;AAiDnC,mBASE,KATF;AA/CF,IAAM,UAAU;AAAA,EACf,EAAE,OAAO,QAAQ,OAAO,GAAI,MAAO,EAAE;AAAA,EACrC,EAAE,OAAO,YAAY,OAAO,GAAI,UAAW,EAAE;AAAA,EAC7C,EAAE,OAAO,QAAQ,OAAO,GAAI,QAAQ,eAAgB,EAAE;AACvD;AAEA,IAAM,gBAAgB,CAAE,EAAE,eAAe,WAAW,MAAO;AAC1D,QAAM,EAAE,UAAU,UAAU,MAAM,OAAO,aAAa,QAAQ,IAC7D;AAED,QAAM,mBAAmB;AAAA,IACxB;AAAA,EACD;AAEA,QAAM,kBAAkB,YAAa,CAAE,YAAa;AACnD,WAAO,UAAU,mBAAmB;AAAA,EACrC,GAAG,CAAC,CAAE;AAEN,QAAM,gBAAgB,QAAS,MAAM;AACpC,UAAM,kBAAkB,CAAE,cAAe;AACx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AAAA,QAChB,UAAW,MAAM,YAAY;AAAA,QAC7B,YAAa,MAAM;AAClB,wBAAe,EAAE,SAAS,WAAW,CAAE;AAAA,QACxC;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,SAAU;AAAA,YACtB,OAAQ;AAAA,YACR,UAAW;AAAA,YACX;AAAA,YACA,kBAAgB;AAAA;AAAA,QACjB;AAAA;AAAA,IACD;AAAA,KACD;AAEF;AAEA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,6 +31,7 @@ import TracksEditor from "./tracks-editor.mjs";
|
|
|
31
31
|
import Tracks from "./tracks.mjs";
|
|
32
32
|
import { Caption } from "../utils/caption.mjs";
|
|
33
33
|
import PosterImage from "../utils/poster-image.mjs";
|
|
34
|
+
import { isGifVariation } from "./variations.mjs";
|
|
34
35
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
35
36
|
var ALLOWED_MEDIA_TYPES = ["video"];
|
|
36
37
|
function VideoEdit({
|
|
@@ -42,7 +43,9 @@ function VideoEdit({
|
|
|
42
43
|
onReplace
|
|
43
44
|
}) {
|
|
44
45
|
const videoPlayer = useRef();
|
|
45
|
-
const { id, controls, poster, src, tracks } = attributes;
|
|
46
|
+
const { id, controls, poster, src, tracks, width, height } = attributes;
|
|
47
|
+
const isGif = isGifVariation(attributes);
|
|
48
|
+
const aspectRatio = width && height ? `${width} / ${height}` : void 0;
|
|
46
49
|
const [temporaryURL, setTemporaryURL] = useState(attributes.blob);
|
|
47
50
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
48
51
|
const blockEditingMode = useBlockEditingMode();
|
|
@@ -58,6 +61,12 @@ function VideoEdit({
|
|
|
58
61
|
videoPlayer.current.load();
|
|
59
62
|
}
|
|
60
63
|
}, [poster]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (isGif) {
|
|
66
|
+
videoPlayer.current?.play().catch(() => {
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, [isGif, src, poster]);
|
|
61
70
|
function onSelectVideo(media) {
|
|
62
71
|
if (!media || !media.url) {
|
|
63
72
|
setAttributes({
|
|
@@ -213,6 +222,13 @@ function VideoEdit({
|
|
|
213
222
|
poster,
|
|
214
223
|
src: src || temporaryURL,
|
|
215
224
|
ref: videoPlayer,
|
|
225
|
+
autoPlay: isGif,
|
|
226
|
+
loop: isGif,
|
|
227
|
+
muted: isGif,
|
|
228
|
+
playsInline: isGif,
|
|
229
|
+
width,
|
|
230
|
+
height,
|
|
231
|
+
style: aspectRatio ? { aspectRatio } : void 0,
|
|
216
232
|
children: /* @__PURE__ */ jsx(Tracks, { tracks })
|
|
217
233
|
}
|
|
218
234
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/video/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tSpinner,\n\tPlaceholder,\n\t__experimentalToolsPanel as ToolsPanel,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { prependHTTPS } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport {\n\tuseUploadMediaFromBlobURL,\n\tuseToolsPanelDropdownMenuProps,\n} from '../utils/hooks';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\nimport { Caption } from '../utils/caption';\nimport PosterImage from '../utils/poster-image';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\n\nfunction VideoEdit( {\n\tisSelected: isSingleSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst videoPlayer = useRef();\n\tconst { id, controls, poster, src, tracks } = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectVideo,\n\t\tonError: onUploadError,\n\t} );\n\n\tuseEffect( () => {\n\t\t// Placeholder may be rendered.\n\t\tif ( videoPlayer.current ) {\n\t\t\tvideoPlayer.current.load();\n\t\t}\n\t}, [ poster ] );\n\n\t// TODO: Whether the video was obtained from the media library or was provided by URL, obtain the `videoWidth` and `videoHeight` of the video once its metadata has loaded and persist in the block attributes.\n\tfunction onSelectVideo( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error\n\t\t\t// previous attributes should be removed\n\t\t\t// because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tposter:\n\t\t\t\tmedia.image?.src !== media.icon ? media.image?.src : undefined,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\tif ( newSrc !== src ) {\n\t\t\tconst url = prependHTTPS( newSrc );\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\tsrc: url,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\t\twithIllustration={ ! isSingleSelected }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ __( 'Video' ) }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Drag and drop a video, upload, or choose from your library.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\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{ isSingleSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<TracksEditor\n\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ () => onSelectVideo( undefined ) }\n\t\t\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\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\tautoplay: false,\n\t\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\t\tmuted: false,\n\t\t\t\t\t\t\tplaysInline: false,\n\t\t\t\t\t\t\tpreload: 'metadata',\n\t\t\t\t\t\t\tposter: undefined,\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<VideoCommonSettings\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t\t<PosterImage\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tposter: posterImage?.url,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t<video\n\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\tinert={ ! isSingleSelected ? 'true' : undefined }\n\t\t\t\t\tposter={ poster }\n\t\t\t\t\tsrc={ src || temporaryURL }\n\t\t\t\t\tref={ videoPlayer }\n\t\t\t\t>\n\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t</video>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\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={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Video caption text' ) }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\tisSingleSelected && hasNonContentControls\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,OACtB;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,QAAQ,WAAW,gBAAgB;AAC5C,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,SAAS,YAAY;AAC9B,SAAS,SAAS,oBAAoB;AACtC,SAAS,oBAAoB;AAK7B,SAAS,gCAAgC;AACzC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,yBAAyB;AAChC,OAAO,kBAAkB;AACzB,OAAO,YAAY;AACnB,SAAS,eAAe;AACxB,OAAO,iBAAiB;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tSpinner,\n\tPlaceholder,\n\t__experimentalToolsPanel as ToolsPanel,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { prependHTTPS } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport {\n\tuseUploadMediaFromBlobURL,\n\tuseToolsPanelDropdownMenuProps,\n} from '../utils/hooks';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\nimport { Caption } from '../utils/caption';\nimport PosterImage from '../utils/poster-image';\nimport { isGifVariation } from './variations';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\n\nfunction VideoEdit( {\n\tisSelected: isSingleSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst videoPlayer = useRef();\n\tconst { id, controls, poster, src, tracks, width, height } = attributes;\n\tconst isGif = isGifVariation( attributes );\n\t// Give the <video> an explicit (non-`auto`) aspect ratio derived from the\n\t// stored dimensions. The width/height attributes alone only yield\n\t// `aspect-ratio: auto W/H`, whose `auto` keyword defers to the element's\n\t// natural ratio while the poster/metadata load - during which Chrome briefly\n\t// computes a runaway height (tens of thousands of pixels) before settling.\n\t// That spike is what reads as a duplicated image during the GIF-to-video\n\t// swap. A non-`auto` ratio governs the box height throughout the load.\n\tconst aspectRatio =\n\t\twidth && height ? `${ width } / ${ height }` : undefined;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectVideo,\n\t\tonError: onUploadError,\n\t} );\n\n\tuseEffect( () => {\n\t\t// Placeholder may be rendered.\n\t\tif ( videoPlayer.current ) {\n\t\t\tvideoPlayer.current.load();\n\t\t}\n\t}, [ poster ] );\n\n\t// The GIF variation plays like an animated GIF in the editor (the playback\n\t// attributes are applied to the preview <video> below). Regular videos do\n\t// not autoplay in the editor, so only nudge GIFs into playing after a\n\t// source change in case the muted autoplay did not start on its own.\n\tuseEffect( () => {\n\t\tif ( isGif ) {\n\t\t\t// Browsers allow muted videos to be played programmatically.\n\t\t\tvideoPlayer.current?.play().catch( () => {} );\n\t\t}\n\t}, [ isGif, src, poster ] );\n\n\t// TODO: Whether the video was obtained from the media library or was provided by URL, obtain the `videoWidth` and `videoHeight` of the video once its metadata has loaded and persist in the block attributes.\n\tfunction onSelectVideo( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error\n\t\t\t// previous attributes should be removed\n\t\t\t// because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tposter:\n\t\t\t\tmedia.image?.src !== media.icon ? media.image?.src : undefined,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\tif ( newSrc !== src ) {\n\t\t\tconst url = prependHTTPS( newSrc );\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\tsrc: url,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\t\twithIllustration={ ! isSingleSelected }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ __( 'Video' ) }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Drag and drop a video, upload, or choose from your library.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\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{ isSingleSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<TracksEditor\n\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ () => onSelectVideo( undefined ) }\n\t\t\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\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\tautoplay: false,\n\t\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\t\tmuted: false,\n\t\t\t\t\t\t\tplaysInline: false,\n\t\t\t\t\t\t\tpreload: 'metadata',\n\t\t\t\t\t\t\tposter: undefined,\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<VideoCommonSettings\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t\t<PosterImage\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tposter: posterImage?.url,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t<video\n\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\tinert={ ! isSingleSelected ? 'true' : undefined }\n\t\t\t\t\tposter={ poster }\n\t\t\t\t\tsrc={ src || temporaryURL }\n\t\t\t\t\tref={ videoPlayer }\n\t\t\t\t\tautoPlay={ isGif }\n\t\t\t\t\tloop={ isGif }\n\t\t\t\t\tmuted={ isGif }\n\t\t\t\t\tplaysInline={ isGif }\n\t\t\t\t\twidth={ width }\n\t\t\t\t\theight={ height }\n\t\t\t\t\tstyle={ aspectRatio ? { aspectRatio } : undefined }\n\t\t\t\t>\n\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t</video>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\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={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Video caption text' ) }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\tisSingleSelected && hasNonContentControls\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,OACtB;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,QAAQ,WAAW,gBAAgB;AAC5C,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,SAAS,YAAY;AAC9B,SAAS,SAAS,oBAAoB;AACtC,SAAS,oBAAoB;AAK7B,SAAS,gCAAgC;AACzC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,yBAAyB;AAChC,OAAO,kBAAkB;AACzB,OAAO,YAAY;AACnB,SAAS,eAAe;AACxB,OAAO,iBAAiB;AACxB,SAAS,sBAAsB;AAsH5B,SA0CC,UA1CD,KA0CC,YA1CD;AApHH,IAAM,sBAAsB,CAAE,OAAQ;AAEtC,SAAS,UAAW;AAAA,EACnB,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,cAAc,OAAO;AAC3B,QAAM,EAAE,IAAI,UAAU,QAAQ,KAAK,QAAQ,OAAO,OAAO,IAAI;AAC7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ACjC,mBACC,oBAAoB;AAAA;AAAA,MAEtB;AAAA,OACD;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,6 +8,7 @@ import edit from "./edit.mjs";
|
|
|
8
8
|
import metadata from "./block.json";
|
|
9
9
|
import save from "./save.mjs";
|
|
10
10
|
import transforms from "./transforms.mjs";
|
|
11
|
+
import variations from "./variations.mjs";
|
|
11
12
|
import { unlock } from "../lock-unlock.mjs";
|
|
12
13
|
var { fieldsKey, formKey } = unlock(blocksPrivateApis);
|
|
13
14
|
var { name } = metadata;
|
|
@@ -21,6 +22,7 @@ var settings = {
|
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
transforms,
|
|
25
|
+
variations,
|
|
24
26
|
deprecated,
|
|
25
27
|
edit,
|
|
26
28
|
save
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/video/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { video as icon } from '@wordpress/icons';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport { unlock } from '../lock-unlock';\n\nconst { fieldsKey, formKey } = unlock( blocksPrivateApis );\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsrc: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',\n\t\t\t// translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.\n\t\t\tcaption: __( 'Wood thrush singing in Central Park, NYC.' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nif ( window.__experimentalContentOnlyInspectorFields ) {\n\tsettings[ fieldsKey ] = [\n\t\t{\n\t\t\tid: 'video',\n\t\t\tlabel: __( 'Video' ),\n\t\t\ttype: 'media',\n\t\t\tEdit: {\n\t\t\t\tcontrol: 'media', // TODO: replace with custom component\n\t\t\t\tallowedTypes: [ 'video' ],\n\t\t\t\tmultiple: false,\n\t\t\t},\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\tid: item.id,\n\t\t\t\turl: item.src,\n\t\t\t\tcaption: item.caption,\n\t\t\t\tposter: item.poster,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\tid: value.id,\n\t\t\t\tsrc: value.url,\n\t\t\t\tcaption: value.caption,\n\t\t\t\tposter: value.poster,\n\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\tid: 'caption',\n\t\t\tlabel: __( 'Caption' ),\n\t\t\ttype: 'text',\n\t\t\tEdit: 'rich-text', // TODO: replace with custom component\n\t\t},\n\t];\n\tsettings[ formKey ] = {\n\t\tfields: [ 'video', 'caption' ],\n\t};\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,SAAS,YAAY;AAC9B,SAAS,eAAe,yBAAyB;AAKjD,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,SAAS,cAAc;AAEvB,IAAM,EAAE,WAAW,QAAQ,IAAI,OAAQ,iBAAkB;AAEzD,IAAM,EAAE,KAAK,IAAI;AAIV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,KAAK;AAAA;AAAA,MAEL,SAAS,GAAI,2CAA4C;AAAA,IAC1D;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAK,OAAO,0CAA2C;AACtD,WAAU,SAAU,IAAI;AAAA,IACvB;AAAA,MACC,IAAI;AAAA,MACJ,OAAO,GAAI,OAAQ;AAAA,MACnB,MAAM;AAAA,MACN,MAAM;AAAA,QACL,SAAS;AAAA;AAAA,QACT,cAAc,CAAE,OAAQ;AAAA,QACxB,UAAU;AAAA,MACX;AAAA,MACA,UAAU,CAAE,EAAE,KAAK,OAAS;AAAA,QAC3B,IAAI,KAAK;AAAA,QACT,KAAK,KAAK;AAAA,QACV,SAAS,KAAK;AAAA,QACd,QAAQ,KAAK;AAAA,MACd;AAAA,MACA,UAAU,CAAE,EAAE,MAAM,OAAS;AAAA,QAC5B,IAAI,MAAM;AAAA,QACV,KAAK,MAAM;AAAA,QACX,SAAS,MAAM;AAAA,QACf,QAAQ,MAAM;AAAA,MACf;AAAA,IACD;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,OAAO,GAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,MAAM;AAAA;AAAA,IACP;AAAA,EACD;AACA,WAAU,OAAQ,IAAI;AAAA,IACrB,QAAQ,CAAE,SAAS,SAAU;AAAA,EAC9B;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { video as icon } from '@wordpress/icons';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\nimport { unlock } from '../lock-unlock';\n\nconst { fieldsKey, formKey } = unlock( blocksPrivateApis );\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsrc: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',\n\t\t\t// translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.\n\t\t\tcaption: __( 'Wood thrush singing in Central Park, NYC.' ),\n\t\t},\n\t},\n\ttransforms,\n\tvariations,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nif ( window.__experimentalContentOnlyInspectorFields ) {\n\tsettings[ fieldsKey ] = [\n\t\t{\n\t\t\tid: 'video',\n\t\t\tlabel: __( 'Video' ),\n\t\t\ttype: 'media',\n\t\t\tEdit: {\n\t\t\t\tcontrol: 'media', // TODO: replace with custom component\n\t\t\t\tallowedTypes: [ 'video' ],\n\t\t\t\tmultiple: false,\n\t\t\t},\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\tid: item.id,\n\t\t\t\turl: item.src,\n\t\t\t\tcaption: item.caption,\n\t\t\t\tposter: item.poster,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\tid: value.id,\n\t\t\t\tsrc: value.url,\n\t\t\t\tcaption: value.caption,\n\t\t\t\tposter: value.poster,\n\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\tid: 'caption',\n\t\t\tlabel: __( 'Caption' ),\n\t\t\ttype: 'text',\n\t\t\tEdit: 'rich-text', // TODO: replace with custom component\n\t\t},\n\t];\n\tsettings[ formKey ] = {\n\t\tfields: [ 'video', 'caption' ],\n\t};\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,SAAS,YAAY;AAC9B,SAAS,eAAe,yBAAyB;AAKjD,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,cAAc;AAEvB,IAAM,EAAE,WAAW,QAAQ,IAAI,OAAQ,iBAAkB;AAEzD,IAAM,EAAE,KAAK,IAAI;AAIV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,KAAK;AAAA;AAAA,MAEL,SAAS,GAAI,2CAA4C;AAAA,IAC1D;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAK,OAAO,0CAA2C;AACtD,WAAU,SAAU,IAAI;AAAA,IACvB;AAAA,MACC,IAAI;AAAA,MACJ,OAAO,GAAI,OAAQ;AAAA,MACnB,MAAM;AAAA,MACN,MAAM;AAAA,QACL,SAAS;AAAA;AAAA,QACT,cAAc,CAAE,OAAQ;AAAA,QACxB,UAAU;AAAA,MACX;AAAA,MACA,UAAU,CAAE,EAAE,KAAK,OAAS;AAAA,QAC3B,IAAI,KAAK;AAAA,QACT,KAAK,KAAK;AAAA,QACV,SAAS,KAAK;AAAA,QACd,QAAQ,KAAK;AAAA,MACd;AAAA,MACA,UAAU,CAAE,EAAE,MAAM,OAAS;AAAA,QAC5B,IAAI,MAAM;AAAA,QACV,KAAK,MAAM;AAAA,QACX,SAAS,MAAM;AAAA,QACf,QAAQ,MAAM;AAAA,MACf;AAAA,IACD;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,OAAO,GAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,MAAM;AAAA;AAAA,IACP;AAAA,EACD;AACA,WAAU,OAAQ,IAAI;AAAA,IACrB,QAAQ,CAAE,SAAS,SAAU;AAAA,EAC9B;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,8 +17,11 @@ function save({ attributes }) {
|
|
|
17
17
|
preload,
|
|
18
18
|
src,
|
|
19
19
|
playsInline,
|
|
20
|
-
tracks
|
|
20
|
+
tracks,
|
|
21
|
+
width,
|
|
22
|
+
height
|
|
21
23
|
} = attributes;
|
|
24
|
+
const aspectRatio = width && height ? `${width} / ${height}` : void 0;
|
|
22
25
|
return /* @__PURE__ */ jsxs("figure", { ...useBlockProps.save(), children: [
|
|
23
26
|
src && /* @__PURE__ */ jsx(
|
|
24
27
|
"video",
|
|
@@ -31,6 +34,9 @@ function save({ attributes }) {
|
|
|
31
34
|
preload: preload !== "metadata" ? preload : void 0,
|
|
32
35
|
src,
|
|
33
36
|
playsInline,
|
|
37
|
+
width,
|
|
38
|
+
height,
|
|
39
|
+
style: aspectRatio ? { aspectRatio } : void 0,
|
|
34
40
|
children: /* @__PURE__ */ jsx(Tracks, { tracks })
|
|
35
41
|
}
|
|
36
42
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/video/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Tracks from './tracks';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\tautoplay,\n\t\tcaption,\n\t\tcontrols,\n\t\tloop,\n\t\tmuted,\n\t\tposter,\n\t\tpreload,\n\t\tsrc,\n\t\tplaysInline,\n\t\ttracks,\n\t} = attributes;\n\treturn (\n\t\t<figure { ...useBlockProps.save() }>\n\t\t\t{ src && (\n\t\t\t\t<video\n\t\t\t\t\tautoPlay={ autoplay }\n\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\tloop={ loop }\n\t\t\t\t\tmuted={ muted }\n\t\t\t\t\tposter={ poster }\n\t\t\t\t\tpreload={ preload !== 'metadata' ? preload : undefined }\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tplaysInline={ playsInline }\n\t\t\t\t>\n\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t</video>\n\t\t\t) }\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,OAAO,YAAY;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Tracks from './tracks';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\tautoplay,\n\t\tcaption,\n\t\tcontrols,\n\t\tloop,\n\t\tmuted,\n\t\tposter,\n\t\tpreload,\n\t\tsrc,\n\t\tplaysInline,\n\t\ttracks,\n\t\twidth,\n\t\theight,\n\t} = attributes;\n\t// Match the editor: an explicit (non-`auto`) aspect ratio keeps the\n\t// converted GIF video from briefly blowing up to a runaway height while the\n\t// poster/metadata load, which would otherwise flash on the front end and\n\t// cause layout shift. The width/height attributes only yield\n\t// `aspect-ratio: auto W/H`, whose `auto` keyword is unreliable during load.\n\tconst aspectRatio =\n\t\twidth && height ? `${ width } / ${ height }` : undefined;\n\treturn (\n\t\t<figure { ...useBlockProps.save() }>\n\t\t\t{ src && (\n\t\t\t\t<video\n\t\t\t\t\tautoPlay={ autoplay }\n\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\tloop={ loop }\n\t\t\t\t\tmuted={ muted }\n\t\t\t\t\tposter={ poster }\n\t\t\t\t\tpreload={ preload !== 'metadata' ? preload : undefined }\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tplaysInline={ playsInline }\n\t\t\t\t\twidth={ width }\n\t\t\t\t\theight={ height }\n\t\t\t\t\tstyle={ aspectRatio ? { aspectRatio } : undefined }\n\t\t\t\t>\n\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t</video>\n\t\t\t) }\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,OAAO,YAAY;AAyBjB,SAeG,KAfH;AAvBa,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAMJ,QAAM,cACL,SAAS,SAAS,GAAI,KAAM,MAAO,MAAO,KAAK;AAChD,SACC,qBAAC,YAAS,GAAG,cAAc,KAAK,GAC7B;AAAA,WACD;AAAA,MAAC;AAAA;AAAA,QACA,UAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAU,YAAY,aAAa,UAAU;AAAA,QAC7C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAQ,cAAc,EAAE,YAAY,IAAI;AAAA,QAExC,8BAAC,UAAO,QAAkB;AAAA;AAAA,IAC3B;AAAA,IAEC,CAAE,SAAS,QAAS,OAAQ,KAC7B;AAAA,MAAC,SAAS;AAAA,MAAT;AAAA,QACA,WAAY,kCAAmC,SAAU;AAAA,QACzD,SAAQ;AAAA,QACR,OAAQ;AAAA;AAAA,IACT;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/video/tracks-editor.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tNavigableMenu,\n\tMenuItem,\n\tFormFileUpload,\n\tMenuGroup,\n\tToolbarGroup,\n\tToolbarButton,\n\tDropdown,\n\tButton,\n\tTextControl,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalGrid as Grid,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { upload, media } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport { getFilename } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\n\nconst ALLOWED_TYPES = [ 'text/vtt' ];\n\nconst DEFAULT_KIND = 'subtitles';\n\nconst KIND_OPTIONS = [\n\t{ label: __( 'Subtitles' ), value: 'subtitles' },\n\t{ label: __( 'Captions' ), value: 'captions' },\n\t{ label: __( 'Descriptions' ), value: 'descriptions' },\n\t{ label: __( 'Chapters' ), value: 'chapters' },\n\t{ label: __( 'Metadata' ), value: 'metadata' },\n];\n\nconst DEFAULT_TRACK = {\n\tsrc: '',\n\tlabel: '',\n\tsrcLang: 'en',\n\tkind: DEFAULT_KIND,\n\tdefault: false,\n};\n\nfunction TrackList( { tracks, onEditPress } ) {\n\tconst content = tracks.map( ( track, index ) => {\n\t\treturn (\n\t\t\t<HStack\n\t\t\t\tkey={ track.id ?? track.src }\n\t\t\t\tclassName=\"block-library-video-tracks-editor__track-list-track\"\n\t\t\t>\n\t\t\t\t<span>{ track.label }</span>\n\t\t\t\t<HStack justify=\"flex-end\">\n\t\t\t\t\t{ track.default && <WCBadge>{ __( 'Default' ) }</WCBadge> }\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => onEditPress( index ) }\n\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the video text track e.g: \"French subtitles\". */\n\t\t\t\t\t\t\t_x( 'Edit %s', 'text tracks' ),\n\t\t\t\t\t\t\ttrack.label\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t);\n\t} );\n\n\treturn (\n\t\t<MenuGroup\n\t\t\tlabel={ __( 'Text tracks' ) }\n\t\t\tclassName=\"block-library-video-tracks-editor__track-list\"\n\t\t>\n\t\t\t{ content }\n\t\t</MenuGroup>\n\t);\n}\n\nfunction SingleTrackEditor( {\n\ttrack,\n\tonChange,\n\tonClose,\n\tonRemove,\n\tallowSettingDefault,\n} ) {\n\tconst [ trackState, setTrackState ] = useState( {\n\t\t...DEFAULT_TRACK,\n\t\t...track,\n\t} );\n\n\tconst { src, label, srcLang, kind, default: isDefaultTrack } = trackState;\n\tconst fileName = src.startsWith( 'blob:' ) ? '' : getFilename( src ) || '';\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"block-library-video-tracks-editor__single-track-editor\"\n\t\t\tspacing=\"4\"\n\t\t>\n\t\t\t<span className=\"block-library-video-tracks-editor__single-track-editor-edit-track-label\">\n\t\t\t\t{ __( 'Edit track' ) }\n\t\t\t</span>\n\t\t\t<span>\n\t\t\t\t{ __( 'File' ) }: <b>{ fileName }</b>\n\t\t\t</span>\n\t\t\t<Grid columns={ 2 } gap={ 4 }>\n\t\t\t\t<TextControl\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tlabel: newLabel,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\thelp={ __( 'Title of track' ) }\n\t\t\t\t/>\n\t\t\t\t<TextControl\n\t\t\t\t\tonChange={ ( newSrcLang ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tsrcLang: newSrcLang,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t\tlabel={ __( 'Source language' ) }\n\t\t\t\t\tvalue={ srcLang }\n\t\t\t\t\thelp={ __( 'Language tag (en, fr, etc.)' ) }\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"block-library-video-tracks-editor__single-track-editor-kind-select\"\n\t\t\t\t\toptions={ KIND_OPTIONS }\n\t\t\t\t\tvalue={ kind }\n\t\t\t\t\tlabel={ __( 'Kind' ) }\n\t\t\t\t\tonChange={ ( newKind ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tkind: newKind,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Set as default track' ) }\n\t\t\t\t\tchecked={ isDefaultTrack }\n\t\t\t\t\tdisabled={ ! allowSettingDefault }\n\t\t\t\t\tonChange={ ( defaultTrack ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tdefault: defaultTrack,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<HStack className=\"block-library-video-tracks-editor__single-track-editor-buttons-container\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove track' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( trackState );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</VStack>\n\t);\n}\n\nexport default function TracksEditor( { tracks = [], onChange } ) {\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).getSettings().mediaUpload;\n\t}, [] );\n\tconst [ trackBeingEdited, setTrackBeingEdited ] = useState( null );\n\tconst dropdownPopoverRef = useRef();\n\n\tconst handleTrackSelect = ( selectedTracks = [], appendTracks = false ) => {\n\t\tconst existingTracksMap = new Map(\n\t\t\ttracks.map( ( track ) => [ track.id, track ] )\n\t\t);\n\t\tconst tracksToAdd = selectedTracks.map( ( { id, title, url } ) => {\n\t\t\t// Reuse existing tracks to preserve user-configured metadata.\n\t\t\tif ( existingTracksMap.has( id ) ) {\n\t\t\t\treturn existingTracksMap.get( id );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...DEFAULT_TRACK,\n\t\t\t\tid,\n\t\t\t\tlabel: title || '',\n\t\t\t\tsrc: url,\n\t\t\t};\n\t\t} );\n\n\t\tif ( tracksToAdd.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonChange( [ ...( appendTracks ? tracks : [] ), ...tracksToAdd ] );\n\t};\n\n\tfunction uploadFiles( event ) {\n\t\tconst files = event.target.files;\n\t\tmediaUpload( {\n\t\t\tallowedTypes: ALLOWED_TYPES,\n\t\t\tfilesList: files,\n\t\t\tonFileChange: ( selectedTracks ) => {\n\t\t\t\tif ( ! Array.isArray( selectedTracks ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Wait until the track has been uploaded.\n\t\t\t\tconst uploadedTracks = selectedTracks.filter(\n\t\t\t\t\t( track ) => !! track?.id\n\t\t\t\t);\n\n\t\t\t\tif ( ! uploadedTracks.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thandleTrackSelect( uploadedTracks, true );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tdropdownPopoverRef.current?.focus();\n\t}, [ trackBeingEdited ] );\n\n\tif ( ! mediaUpload ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"block-library-video-tracks-editor\"\n\t\t\tfocusOnMount\n\t\t\tpopoverProps={ {\n\t\t\t\tref: dropdownPopoverRef,\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst handleOnToggle = () => {\n\t\t\t\t\tif ( ! isOpen ) {\n\t\t\t\t\t\t// When the Popover opens make sure the initial view is\n\t\t\t\t\t\t// always the track list rather than the edit track UI.\n\t\t\t\t\t\tsetTrackBeingEdited( null );\n\t\t\t\t\t}\n\t\t\t\t\tonToggle();\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Text tracks' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => {\n\t\t\t\tif ( trackBeingEdited !== null ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<SingleTrackEditor\n\t\t\t\t\t\t\ttrack={ tracks[ trackBeingEdited ] }\n\t\t\t\t\t\t\tonChange={ ( newTrack ) => {\n\t\t\t\t\t\t\t\tconst newTracks = [ ...tracks ];\n\t\t\t\t\t\t\t\tnewTracks[ trackBeingEdited ] = newTrack;\n\t\t\t\t\t\t\t\tonChange( newTracks );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonClose={ () => setTrackBeingEdited( null ) }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\ttracks.filter(\n\t\t\t\t\t\t\t\t\t\t( _track, index ) =>\n\t\t\t\t\t\t\t\t\t\t\tindex !== trackBeingEdited\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetTrackBeingEdited( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tallowSettingDefault={\n\t\t\t\t\t\t\t\t! tracks.some( ( track ) => track.default ) ||\n\t\t\t\t\t\t\t\ttracks[ trackBeingEdited ].default\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ tracks.length === 0 && (\n\t\t\t\t\t\t\t<div className=\"block-library-video-tracks-editor__tracks-informative-message\">\n\t\t\t\t\t\t\t\t<h2 className=\"block-library-video-tracks-editor__tracks-informative-message-title\">\n\t\t\t\t\t\t\t\t\t{ __( 'Text tracks' ) }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t<p className=\"block-library-video-tracks-editor__tracks-informative-message-description\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NavigableMenu>\n\t\t\t\t\t\t\t<TrackList\n\t\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\t\tonEditPress={ setTrackBeingEdited }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup\n\t\t\t\t\t\t\t\tclassName=\"block-library-video-tracks-editor__add-tracks-container\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Add tracks' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MediaUploadCheck>\n\t\t\t\t\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\t\t\t\t\tonSelect={ handleTrackSelect }\n\t\t\t\t\t\t\t\t\t\tallowedTypes={ ALLOWED_TYPES }\n\t\t\t\t\t\t\t\t\t\tvalue={ tracks.map( ( { id } ) => id ) }\n\t\t\t\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ media }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Open Media Library' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\t\t\t\t\tonChange={ uploadFiles }\n\t\t\t\t\t\t\t\t\t\taccept=\".vtt,text/vtt\"\n\t\t\t\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\t\t\t\trender={ ( { openFileDialog } ) => {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ openFileDialog }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ _x( 'Upload', 'verb' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</MediaUploadCheck>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,IAAI,IAAI,eAAe;AAChC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,eAAe;AAAA,OACT;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,QAAQ,aAAa;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,UAAU,QAAQ,iBAAiB;AAC5C,SAAS,mBAAmB;AAK5B,SAAS,cAAc;AA+BnB,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tNavigableMenu,\n\tMenuItem,\n\tFormFileUpload,\n\tMenuGroup,\n\tToolbarGroup,\n\tToolbarButton,\n\tDropdown,\n\tButton,\n\tTextControl,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalGrid as Grid,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { upload, media } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport { getFilename } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\n\nconst ALLOWED_TYPES = [ 'text/vtt' ];\n\nconst DEFAULT_KIND = 'subtitles';\n\nconst KIND_OPTIONS = [\n\t{ label: __( 'Subtitles' ), value: 'subtitles' },\n\t{ label: __( 'Captions' ), value: 'captions' },\n\t{ label: __( 'Descriptions' ), value: 'descriptions' },\n\t{ label: __( 'Chapters' ), value: 'chapters' },\n\t{ label: __( 'Metadata' ), value: 'metadata' },\n];\n\nconst DEFAULT_TRACK = {\n\tsrc: '',\n\tlabel: '',\n\tsrcLang: 'en',\n\tkind: DEFAULT_KIND,\n\tdefault: false,\n};\n\nfunction TrackList( { tracks, onEditPress } ) {\n\tconst content = tracks.map( ( track, index ) => {\n\t\treturn (\n\t\t\t<HStack\n\t\t\t\tkey={ track.id ?? track.src }\n\t\t\t\tclassName=\"block-library-video-tracks-editor__track-list-track\"\n\t\t\t>\n\t\t\t\t<span>{ track.label }</span>\n\t\t\t\t<HStack justify=\"flex-end\">\n\t\t\t\t\t{ track.default && <WCBadge>{ __( 'Default' ) }</WCBadge> }\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => onEditPress( index ) }\n\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the video text track e.g: \"French subtitles\". */\n\t\t\t\t\t\t\t_x( 'Edit %s', 'text tracks' ),\n\t\t\t\t\t\t\ttrack.label\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t);\n\t} );\n\n\treturn (\n\t\t<MenuGroup\n\t\t\tlabel={ __( 'Text tracks' ) }\n\t\t\tclassName=\"block-library-video-tracks-editor__track-list\"\n\t\t>\n\t\t\t{ content }\n\t\t</MenuGroup>\n\t);\n}\n\nfunction SingleTrackEditor( {\n\ttrack,\n\tonChange,\n\tonClose,\n\tonRemove,\n\tallowSettingDefault,\n} ) {\n\tconst [ trackState, setTrackState ] = useState( {\n\t\t...DEFAULT_TRACK,\n\t\t...track,\n\t} );\n\n\tconst { src, label, srcLang, kind, default: isDefaultTrack } = trackState;\n\tconst fileName = src.startsWith( 'blob:' ) ? '' : getFilename( src ) || '';\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"block-library-video-tracks-editor__single-track-editor\"\n\t\t\tspacing=\"4\"\n\t\t>\n\t\t\t<span className=\"block-library-video-tracks-editor__single-track-editor-edit-track-label\">\n\t\t\t\t{ __( 'Edit track' ) }\n\t\t\t</span>\n\t\t\t<span>\n\t\t\t\t{ __( 'File' ) }: <b>{ fileName }</b>\n\t\t\t</span>\n\t\t\t<Grid columns={ 2 } gap={ 4 }>\n\t\t\t\t<TextControl\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tlabel: newLabel,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\thelp={ __( 'Title of track' ) }\n\t\t\t\t/>\n\t\t\t\t<TextControl\n\t\t\t\t\tonChange={ ( newSrcLang ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tsrcLang: newSrcLang,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t\tlabel={ __( 'Source language' ) }\n\t\t\t\t\tvalue={ srcLang }\n\t\t\t\t\thelp={ __( 'Language tag (en, fr, etc.)' ) }\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<SelectControl\n\t\t\t\t\tclassName=\"block-library-video-tracks-editor__single-track-editor-kind-select\"\n\t\t\t\t\toptions={ KIND_OPTIONS }\n\t\t\t\t\tvalue={ kind }\n\t\t\t\t\tlabel={ __( 'Kind' ) }\n\t\t\t\t\tonChange={ ( newKind ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tkind: newKind,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Set as default track' ) }\n\t\t\t\t\tchecked={ isDefaultTrack }\n\t\t\t\t\tdisabled={ ! allowSettingDefault }\n\t\t\t\t\tonChange={ ( defaultTrack ) =>\n\t\t\t\t\t\tsetTrackState( ( prevTrackState ) => ( {\n\t\t\t\t\t\t\t...prevTrackState,\n\t\t\t\t\t\t\tdefault: defaultTrack,\n\t\t\t\t\t\t} ) )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<HStack className=\"block-library-video-tracks-editor__single-track-editor-buttons-container\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove track' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( trackState );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</VStack>\n\t);\n}\n\nexport default function TracksEditor( { tracks = [], onChange } ) {\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).getSettings().mediaUpload;\n\t}, [] );\n\tconst [ trackBeingEdited, setTrackBeingEdited ] = useState( null );\n\tconst dropdownPopoverRef = useRef();\n\n\tconst handleTrackSelect = ( selectedTracks = [], appendTracks = false ) => {\n\t\tconst existingTracksMap = new Map(\n\t\t\ttracks.map( ( track ) => [ track.id, track ] )\n\t\t);\n\t\tconst tracksToAdd = selectedTracks.map( ( { id, title, url } ) => {\n\t\t\t// Reuse existing tracks to preserve user-configured metadata.\n\t\t\tif ( existingTracksMap.has( id ) ) {\n\t\t\t\treturn existingTracksMap.get( id );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...DEFAULT_TRACK,\n\t\t\t\tid,\n\t\t\t\tlabel: title || '',\n\t\t\t\tsrc: url,\n\t\t\t};\n\t\t} );\n\n\t\tif ( tracksToAdd.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonChange( [ ...( appendTracks ? tracks : [] ), ...tracksToAdd ] );\n\t};\n\n\tfunction uploadFiles( event ) {\n\t\tconst files = event.target.files;\n\t\tmediaUpload( {\n\t\t\tallowedTypes: ALLOWED_TYPES,\n\t\t\tfilesList: files,\n\t\t\tonFileChange: ( selectedTracks ) => {\n\t\t\t\tif ( ! Array.isArray( selectedTracks ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Wait until the track has been uploaded.\n\t\t\t\tconst uploadedTracks = selectedTracks.filter(\n\t\t\t\t\t( track ) => !! track?.id\n\t\t\t\t);\n\n\t\t\t\tif ( ! uploadedTracks.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thandleTrackSelect( uploadedTracks, true );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tdropdownPopoverRef.current?.focus();\n\t}, [ trackBeingEdited ] );\n\n\tif ( ! mediaUpload ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"block-library-video-tracks-editor\"\n\t\t\tfocusOnMount\n\t\t\tpopoverProps={ {\n\t\t\t\tref: dropdownPopoverRef,\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst handleOnToggle = () => {\n\t\t\t\t\tif ( ! isOpen ) {\n\t\t\t\t\t\t// When the Popover opens make sure the initial view is\n\t\t\t\t\t\t// always the track list rather than the edit track UI.\n\t\t\t\t\t\tsetTrackBeingEdited( null );\n\t\t\t\t\t}\n\t\t\t\t\tonToggle();\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Text tracks' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => {\n\t\t\t\tif ( trackBeingEdited !== null ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<SingleTrackEditor\n\t\t\t\t\t\t\ttrack={ tracks[ trackBeingEdited ] }\n\t\t\t\t\t\t\tonChange={ ( newTrack ) => {\n\t\t\t\t\t\t\t\tconst newTracks = [ ...tracks ];\n\t\t\t\t\t\t\t\tnewTracks[ trackBeingEdited ] = newTrack;\n\t\t\t\t\t\t\t\tonChange( newTracks );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonClose={ () => setTrackBeingEdited( null ) }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\ttracks.filter(\n\t\t\t\t\t\t\t\t\t\t( _track, index ) =>\n\t\t\t\t\t\t\t\t\t\t\tindex !== trackBeingEdited\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetTrackBeingEdited( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tallowSettingDefault={\n\t\t\t\t\t\t\t\t! tracks.some( ( track ) => track.default ) ||\n\t\t\t\t\t\t\t\ttracks[ trackBeingEdited ].default\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ tracks.length === 0 && (\n\t\t\t\t\t\t\t<div className=\"block-library-video-tracks-editor__tracks-informative-message\">\n\t\t\t\t\t\t\t\t<h2 className=\"block-library-video-tracks-editor__tracks-informative-message-title\">\n\t\t\t\t\t\t\t\t\t{ __( 'Text tracks' ) }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t<p className=\"block-library-video-tracks-editor__tracks-informative-message-description\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NavigableMenu>\n\t\t\t\t\t\t\t<TrackList\n\t\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\t\tonEditPress={ setTrackBeingEdited }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup\n\t\t\t\t\t\t\t\tclassName=\"block-library-video-tracks-editor__add-tracks-container\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Add tracks' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MediaUploadCheck>\n\t\t\t\t\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\t\t\t\t\tonSelect={ handleTrackSelect }\n\t\t\t\t\t\t\t\t\t\tallowedTypes={ ALLOWED_TYPES }\n\t\t\t\t\t\t\t\t\t\tvalue={ tracks.map( ( { id } ) => id ) }\n\t\t\t\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ media }\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Open Media Library' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\t\t\t\t\tonChange={ uploadFiles }\n\t\t\t\t\t\t\t\t\t\taccept=\".vtt,text/vtt\"\n\t\t\t\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\t\t\t\trender={ ( { openFileDialog } ) => {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ openFileDialog }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ _x( 'Upload', 'verb' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\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BAAO,WAAW,KACnB,qBAAC,SAAI,WAAU,iEACd;AAAA,gCAAC,QAAG,WAAU,uEACX,aAAI,aAAc,GACrB;AAAA,YACA,oBAAC,OAAE,WAAU,6EACV;AAAA,cACD;AAAA,YACD,GACD;AAAA,aACD;AAAA,UAED,qBAAC,iBACA;AAAA;AAAA,cAAC;AAAA;AAAA,gBACA;AAAA,gBACA,aAAc;AAAA;AAAA,YACf;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,OAAQ,GAAI,YAAa;AAAA,gBAEzB,+BAAC,oBACA;AAAA;AAAA,oBAAC;AAAA;AAAA,sBACA,UAAW;AAAA,sBACX,cAAe;AAAA,sBACf,OAAQ,OAAO,IAAK,CAAE,EAAE,GAAG,MAAO,EAAG;AAAA,sBACrC,UAAQ;AAAA,sBACR,QAAS,CAAE,EAAE,KAAK,MACjB;AAAA,wBAAC;AAAA;AAAA,0BACA,MAAO;AAAA,0BACP,SAAU;AAAA,0BAER,aAAI,oBAAqB;AAAA;AAAA,sBAC5B;AAAA;AAAA,kBAEF;AAAA,kBACA;AAAA,oBAAC;AAAA;AAAA,sBACA,UAAW;AAAA,sBACX,QAAO;AAAA,sBACP,UAAQ;AAAA,sBACR,QAAS,CAAE,EAAE,eAAe,MAAO;AAClC,+BACC;AAAA,0BAAC;AAAA;AAAA,4BACA,MAAO;AAAA,4BACP,SAAU;AAAA,4BAER,aAAI,UAAU,MAAO;AAAA;AAAA,wBACxB;AAAA,sBAEF;AAAA;AAAA,kBACD;AAAA,mBACD;AAAA;AAAA,YACD;AAAA,aACD;AAAA,WACD;AAAA,MAEF;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// packages/block-library/src/video/variations.js
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
|
+
import { video as videoIcon } from "@wordpress/icons";
|
|
4
|
+
var isGifVariation = ({
|
|
5
|
+
controls,
|
|
6
|
+
loop,
|
|
7
|
+
autoplay,
|
|
8
|
+
muted,
|
|
9
|
+
playsInline
|
|
10
|
+
} = {}) => !controls && !!loop && !!autoplay && !!muted && !!playsInline;
|
|
11
|
+
var variations = [
|
|
12
|
+
{
|
|
13
|
+
name: "video",
|
|
14
|
+
title: __("Video"),
|
|
15
|
+
description: __(
|
|
16
|
+
"Embed a video from your media library or upload a new one."
|
|
17
|
+
),
|
|
18
|
+
icon: videoIcon,
|
|
19
|
+
attributes: { controls: true },
|
|
20
|
+
isActive: (blockAttributes) => !isGifVariation(blockAttributes),
|
|
21
|
+
// Not offered in the inserter; used to label a regular video and to
|
|
22
|
+
// switch a GIF back to a standard video.
|
|
23
|
+
scope: ["block", "transform"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "gif",
|
|
27
|
+
title: __("GIF"),
|
|
28
|
+
description: __(
|
|
29
|
+
"A muted, looping video that plays automatically like an animated GIF."
|
|
30
|
+
),
|
|
31
|
+
icon: videoIcon,
|
|
32
|
+
keywords: [__("animated"), "gif"],
|
|
33
|
+
attributes: {
|
|
34
|
+
controls: false,
|
|
35
|
+
loop: true,
|
|
36
|
+
autoplay: true,
|
|
37
|
+
muted: true,
|
|
38
|
+
playsInline: true
|
|
39
|
+
},
|
|
40
|
+
isActive: (blockAttributes) => isGifVariation(blockAttributes),
|
|
41
|
+
// Created by converting an uploaded GIF, not inserted directly.
|
|
42
|
+
scope: ["block", "transform"]
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
var variations_default = variations;
|
|
46
|
+
export {
|
|
47
|
+
variations_default as default,
|
|
48
|
+
isGifVariation
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=variations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/video/variations.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { video as videoIcon } from '@wordpress/icons';\n\n/**\n * Whether a set of Video block attributes describes a GIF-behaving video: a\n * muted, looping, autoplaying, inline video with no controls. An animated GIF\n * uploaded through the editor is converted to a video and presented with these\n * attributes so it plays like the original GIF.\n *\n * @param {Object} attributes Video block attributes.\n * @param {boolean} attributes.controls Whether playback controls are shown.\n * @param {boolean} attributes.loop Whether the video loops.\n * @param {boolean} attributes.autoplay Whether the video autoplays.\n * @param {boolean} attributes.muted Whether the video is muted.\n * @param {boolean} attributes.playsInline Whether the video plays inline.\n *\n * @return {boolean} Whether the attributes describe a GIF-behaving video.\n */\nexport const isGifVariation = ( {\n\tcontrols,\n\tloop,\n\tautoplay,\n\tmuted,\n\tplaysInline,\n} = {} ) => ! controls && !! loop && !! autoplay && !! muted && !! playsInline;\n\nconst variations = [\n\t{\n\t\tname: 'video',\n\t\ttitle: __( 'Video' ),\n\t\tdescription: __(\n\t\t\t'Embed a video from your media library or upload a new one.'\n\t\t),\n\t\ticon: videoIcon,\n\t\tattributes: { controls: true },\n\t\tisActive: ( blockAttributes ) => ! isGifVariation( blockAttributes ),\n\t\t// Not offered in the inserter; used to label a regular video and to\n\t\t// switch a GIF back to a standard video.\n\t\tscope: [ 'block', 'transform' ],\n\t},\n\t{\n\t\tname: 'gif',\n\t\ttitle: __( 'GIF' ),\n\t\tdescription: __(\n\t\t\t'A muted, looping video that plays automatically like an animated GIF.'\n\t\t),\n\t\ticon: videoIcon,\n\t\tkeywords: [ __( 'animated' ), 'gif' ],\n\t\tattributes: {\n\t\t\tcontrols: false,\n\t\t\tloop: true,\n\t\t\tautoplay: true,\n\t\t\tmuted: true,\n\t\t\tplaysInline: true,\n\t\t},\n\t\tisActive: ( blockAttributes ) => isGifVariation( blockAttributes ),\n\t\t// Created by converting an uploaded GIF, not inserted directly.\n\t\tscope: [ 'block', 'transform' ],\n\t},\n];\n\nexport default variations;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,SAAS,iBAAiB;AAiB5B,IAAM,iBAAiB,CAAE;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,IAAI,CAAC,MAAO,CAAE,YAAY,CAAC,CAAE,QAAQ,CAAC,CAAE,YAAY,CAAC,CAAE,SAAS,CAAC,CAAE;AAEnE,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,OAAO,GAAI,OAAQ;AAAA,IACnB,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,YAAY,EAAE,UAAU,KAAK;AAAA,IAC7B,UAAU,CAAE,oBAAqB,CAAE,eAAgB,eAAgB;AAAA;AAAA;AAAA,IAGnE,OAAO,CAAE,SAAS,WAAY;AAAA,EAC/B;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,OAAO,GAAI,KAAM;AAAA,IACjB,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,UAAU,CAAE,GAAI,UAAW,GAAG,KAAM;AAAA,IACpC,YAAY;AAAA,MACX,UAAU;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA,UAAU,CAAE,oBAAqB,eAAgB,eAAgB;AAAA;AAAA,IAEjE,OAAO,CAAE,SAAS,WAAY;AAAA,EAC/B;AACD;AAEA,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -331,15 +337,11 @@ html :where(img[class*=wp-image-]) {
|
|
|
331
337
|
}
|
|
332
338
|
|
|
333
339
|
html :where(.is-position-sticky) {
|
|
334
|
-
/* stylelint-disable length-zero-no-unit -- 0px is set explicitly so that it can be used in a calc value. */
|
|
335
340
|
--wp-admin--admin-bar--position-offset: var(--wp-admin--admin-bar--height, 0px);
|
|
336
|
-
/* stylelint-enable length-zero-no-unit */
|
|
337
341
|
}
|
|
338
342
|
|
|
339
343
|
@media screen and (max-width: 600px) {
|
|
340
344
|
html :where(.is-position-sticky) {
|
|
341
|
-
/* stylelint-disable length-zero-no-unit -- 0px is set explicitly so that it can be used in a calc value. */
|
|
342
345
|
--wp-admin--admin-bar--position-offset: 0px;
|
|
343
|
-
/* stylelint-enable length-zero-no-unit */
|
|
344
346
|
}
|
|
345
347
|
}
|
package/build-style/common.css
CHANGED
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
|
@@ -337,15 +343,11 @@ html :where(img[class*=wp-image-]) {
|
|
|
337
343
|
}
|
|
338
344
|
|
|
339
345
|
html :where(.is-position-sticky) {
|
|
340
|
-
/* stylelint-disable length-zero-no-unit -- 0px is set explicitly so that it can be used in a calc value. */
|
|
341
346
|
--wp-admin--admin-bar--position-offset: var(--wp-admin--admin-bar--height, 0px);
|
|
342
|
-
/* stylelint-enable length-zero-no-unit */
|
|
343
347
|
}
|
|
344
348
|
|
|
345
349
|
@media screen and (max-width: 600px) {
|
|
346
350
|
html :where(.is-position-sticky) {
|
|
347
|
-
/* stylelint-disable length-zero-no-unit -- 0px is set explicitly so that it can be used in a calc value. */
|
|
348
351
|
--wp-admin--admin-bar--position-offset: 0px;
|
|
349
|
-
/* stylelint-enable length-zero-no-unit */
|
|
350
352
|
}
|
|
351
353
|
}
|