@wordpress/block-library 11.0.0 → 11.0.2-next.v.202609171837.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/README.md +7 -7
- package/build/archives/edit.cjs.map +3 -3
- package/build/audio/edit.cjs.map +3 -3
- package/build/avatar/hooks.cjs.map +2 -2
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs.map +3 -3
- package/build/code/block.json +1 -0
- package/build/code/save.cjs.map +2 -2
- package/build/comment-template/hooks.cjs.map +2 -2
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/cover/transforms.cjs.map +2 -2
- package/build/details/block.json +1 -0
- package/build/details/index.cjs.map +2 -2
- package/build/embed/embed-controls.cjs.map +2 -2
- package/build/file/deprecated.cjs.map +2 -2
- package/build/file/edit.cjs.map +2 -2
- package/build/file/inspector.cjs.map +3 -3
- package/build/file/save.cjs.map +2 -2
- package/build/footnotes/block.json +1 -0
- package/build/footnotes/edit.cjs.map +2 -2
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +64 -37
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/{flex-styles.cjs → gallery-styles.cjs} +31 -32
- package/build/gallery/gallery-styles.cjs.map +7 -0
- package/build/gallery/responsive-styles.cjs +27 -5
- package/build/gallery/responsive-styles.cjs.map +2 -2
- package/build/heading/block.json +2 -0
- package/build/heading/index.cjs.map +2 -2
- package/build/html/modal.cjs +3 -6
- package/build/html/modal.cjs.map +2 -2
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs.map +2 -2
- package/build/index.cjs.map +2 -2
- package/build/latest-comments/edit.cjs.map +3 -3
- package/build/latest-posts/edit.cjs.map +2 -2
- package/build/list/ordered-list-settings.cjs.map +3 -3
- package/build/list-item/hooks/use-enter.cjs.map +2 -2
- package/build/math/block.json +2 -0
- package/build/math/deprecated.cjs +29 -12
- package/build/math/deprecated.cjs.map +2 -2
- package/build/math/edit.cjs +67 -46
- package/build/math/edit.cjs.map +2 -2
- package/build/math/save.cjs +2 -2
- package/build/math/save.cjs.map +2 -2
- package/build/media-text/constants.cjs +3 -0
- package/build/media-text/constants.cjs.map +2 -2
- package/build/media-text/deprecated.cjs.map +2 -2
- package/build/media-text/edit.cjs +40 -0
- package/build/media-text/edit.cjs.map +3 -3
- package/build/media-text/image-fill.cjs.map +2 -2
- package/build/media-text/media-container.cjs +3 -3
- package/build/media-text/media-container.cjs.map +2 -2
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/menu-inspector-controls.cjs.map +2 -2
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +3 -3
- package/build/navigation/edit/responsive-wrapper.cjs.map +2 -2
- package/build/navigation/edit/use-generate-default-navigation-title.cjs.map +2 -2
- package/build/navigation/view.cjs +2 -2
- package/build/navigation/view.cjs.map +2 -2
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/shared/invalid-draft-display.cjs.map +2 -2
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/edit.cjs.map +2 -2
- package/build/paragraph/index.cjs +6 -0
- package/build/paragraph/index.cjs.map +3 -3
- package/build/playlist/edit.cjs +2 -1
- package/build/playlist/edit.cjs.map +3 -3
- package/build/post-author/edit.cjs.map +3 -3
- package/build/post-author-name/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-date/edit.cjs.map +2 -2
- package/build/post-excerpt/block.json +1 -0
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-time-to-read/edit.cjs.map +2 -2
- package/build/pullquote/deprecated.cjs.map +2 -2
- package/build/query/deprecated.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs.map +3 -3
- package/build/query/edit/inspector-controls/order-control.cjs.map +3 -3
- package/build/query/edit/inspector-controls/sticky-control.cjs.map +3 -3
- package/build/query/view.cjs.map +2 -2
- package/build/query-title/use-archive-label.cjs.map +2 -2
- package/build/quote/deprecated.cjs.map +2 -2
- package/build/quote/transforms.cjs.map +2 -2
- package/build/search/edit.cjs.map +3 -3
- package/build/separator/edit.cjs.map +3 -3
- package/build/social-links/edit.cjs.map +3 -3
- package/build/table/state.cjs.map +2 -2
- package/build/table-of-contents/edit.cjs.map +3 -3
- package/build/table-of-contents/utils.cjs.map +2 -2
- package/build/tabs/use-tab-actions.cjs.map +2 -2
- package/build/tag-cloud/edit.cjs.map +3 -3
- package/build/template-part/edit/advanced-controls.cjs.map +3 -3
- package/build/template-part/edit/import-controls.cjs.map +3 -3
- package/build/template-part/edit/index.cjs.map +2 -2
- package/build/template-part/edit/inner-blocks.cjs.map +2 -2
- package/build/template-part/edit/placeholder.cjs.map +2 -2
- package/build/term-count/use-term-count.cjs.map +2 -2
- package/build/term-description/use-term-description.cjs.map +2 -2
- package/build/term-name/use-term-name.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +3 -3
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +3 -3
- package/build/utils/hooks.cjs.map +2 -2
- package/build/utils/media-control.cjs +5 -1
- package/build/utils/media-control.cjs.map +2 -2
- package/build/utils/poster-image.cjs.map +2 -2
- package/build/verse/block.json +1 -0
- package/build/video/edit-common-settings.cjs.map +3 -3
- package/build/video/tracks-editor.cjs.map +3 -3
- package/build-module/archives/edit.mjs +2 -2
- package/build-module/archives/edit.mjs.map +2 -2
- package/build-module/audio/edit.mjs +2 -2
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/avatar/hooks.mjs.map +2 -2
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +2 -2
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/code/block.json +1 -0
- package/build-module/code/save.mjs.map +2 -2
- package/build-module/comment-template/hooks.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/cover/transforms.mjs.map +2 -2
- package/build-module/details/block.json +1 -0
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/embed/embed-controls.mjs.map +2 -2
- package/build-module/file/deprecated.mjs.map +2 -2
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/inspector.mjs +2 -2
- package/build-module/file/inspector.mjs.map +2 -2
- package/build-module/file/save.mjs.map +2 -2
- package/build-module/footnotes/block.json +1 -0
- package/build-module/footnotes/edit.mjs.map +2 -2
- package/build-module/gallery/dynamic-gallery.mjs +2 -2
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/gallery/edit.mjs +67 -40
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/{flex-styles.mjs → gallery-styles.mjs} +29 -30
- package/build-module/gallery/gallery-styles.mjs.map +7 -0
- package/build-module/gallery/responsive-styles.mjs +25 -4
- package/build-module/gallery/responsive-styles.mjs.map +2 -2
- package/build-module/heading/block.json +2 -0
- package/build-module/heading/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +3 -6
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-comments/edit.mjs +2 -2
- package/build-module/latest-comments/edit.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs.map +2 -2
- package/build-module/list/ordered-list-settings.mjs +2 -2
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/math/block.json +2 -0
- package/build-module/math/deprecated.mjs +29 -12
- package/build-module/math/deprecated.mjs.map +2 -2
- package/build-module/math/edit.mjs +68 -47
- package/build-module/math/edit.mjs.map +2 -2
- package/build-module/math/save.mjs +2 -2
- package/build-module/math/save.mjs.map +2 -2
- package/build-module/media-text/constants.mjs +2 -0
- package/build-module/media-text/constants.mjs.map +2 -2
- package/build-module/media-text/deprecated.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +42 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/media-text/image-fill.mjs.map +2 -2
- package/build-module/media-text/media-container.mjs +1 -1
- package/build-module/media-text/media-container.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/menu-inspector-controls.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
- package/build-module/navigation/edit/responsive-wrapper.mjs.map +2 -2
- package/build-module/navigation/edit/use-generate-default-navigation-title.mjs.map +2 -2
- package/build-module/navigation/view.mjs +2 -2
- package/build-module/navigation/view.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/shared/invalid-draft-display.mjs.map +2 -2
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/edit.mjs.map +2 -2
- package/build-module/paragraph/index.mjs +6 -0
- package/build-module/paragraph/index.mjs.map +2 -2
- package/build-module/playlist/edit.mjs +5 -4
- package/build-module/playlist/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +2 -2
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-author-name/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-date/edit.mjs.map +2 -2
- package/build-module/post-excerpt/block.json +1 -0
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +2 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-time-to-read/edit.mjs.map +2 -2
- package/build-module/pullquote/deprecated.mjs.map +2 -2
- package/build-module/query/deprecated.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
- package/build-module/query/view.mjs.map +2 -2
- package/build-module/query-title/use-archive-label.mjs.map +2 -2
- package/build-module/quote/deprecated.mjs.map +2 -2
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/search/edit.mjs +3 -3
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/separator/edit.mjs +5 -2
- package/build-module/separator/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +2 -2
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/table/state.mjs.map +2 -2
- package/build-module/table-of-contents/edit.mjs +2 -2
- package/build-module/table-of-contents/edit.mjs.map +2 -2
- package/build-module/table-of-contents/utils.mjs.map +2 -2
- package/build-module/tabs/use-tab-actions.mjs.map +2 -2
- package/build-module/tag-cloud/edit.mjs +2 -2
- package/build-module/tag-cloud/edit.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +5 -2
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/import-controls.mjs +2 -2
- package/build-module/template-part/edit/import-controls.mjs.map +2 -2
- package/build-module/template-part/edit/index.mjs.map +2 -2
- package/build-module/template-part/edit/inner-blocks.mjs.map +2 -2
- package/build-module/template-part/edit/placeholder.mjs.map +2 -2
- package/build-module/term-count/use-term-count.mjs.map +2 -2
- package/build-module/term-description/use-term-description.mjs.map +2 -2
- package/build-module/term-name/use-term-name.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +2 -2
- 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 +2 -2
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
- package/build-module/utils/hooks.mjs.map +2 -2
- package/build-module/utils/media-control.mjs +5 -1
- package/build-module/utils/media-control.mjs.map +2 -2
- package/build-module/utils/poster-image.mjs.map +2 -2
- package/build-module/verse/block.json +1 -0
- package/build-module/video/edit-common-settings.mjs +2 -2
- package/build-module/video/edit-common-settings.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +2 -2
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/button/style-rtl.css +2 -1
- package/build-style/button/style.css +2 -1
- package/build-style/columns/style-rtl.css +1 -1
- package/build-style/columns/style.css +1 -1
- package/build-style/comments/editor-rtl.css +1 -1
- package/build-style/comments/editor.css +1 -1
- package/build-style/comments/style-rtl.css +1 -1
- package/build-style/comments/style.css +1 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/style-rtl.css +6 -0
- package/build-style/cover/style.css +6 -0
- package/build-style/editor-rtl.css +9 -5
- package/build-style/editor.css +9 -5
- package/build-style/embed/editor-rtl.css +2 -1
- package/build-style/embed/editor.css +2 -1
- package/build-style/gallery/style-rtl.css +1 -2
- package/build-style/gallery/style.css +1 -2
- package/build-style/image/style-rtl.css +6 -9
- package/build-style/image/style.css +6 -9
- package/build-style/math/editor-rtl.css +5 -0
- package/build-style/math/editor.css +5 -0
- package/build-style/navigation/editor-rtl.css +1 -0
- package/build-style/navigation/editor.css +1 -0
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/post-title/style-rtl.css +2 -2
- package/build-style/post-title/style.css +2 -2
- package/build-style/query-pagination/editor-rtl.css +0 -3
- package/build-style/query-pagination/editor.css +0 -3
- package/build-style/search/theme-rtl.css +1 -1
- package/build-style/search/theme.css +1 -1
- package/build-style/style-rtl.css +23 -19
- package/build-style/style.css +23 -19
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/build-style/verse/style-rtl.css +2 -1
- package/build-style/verse/style.css +2 -1
- package/package.json +40 -40
- package/src/archives/edit.jsx +2 -2
- package/src/audio/edit.jsx +2 -2
- package/src/avatar/hooks.js +2 -2
- package/src/button/edit.jsx +1 -1
- package/src/button/style.scss +2 -2
- package/src/calendar/index.php +1 -1
- package/src/categories/edit.jsx +2 -2
- package/src/code/README.md +1 -0
- package/src/code/block.json +1 -0
- package/src/code/save.jsx +1 -1
- package/src/columns/style.scss +2 -3
- package/src/comment-template/hooks.js +1 -1
- package/src/comments/style.scss +1 -1
- package/src/common.scss +1 -2
- package/src/cover/edit/index.jsx +2 -2
- package/src/cover/edit/inspector-controls.jsx +2 -2
- package/src/cover/style.scss +10 -0
- package/src/cover/test/{edit.jsdom.test.js → edit.browser.test.js} +104 -145
- package/src/cover/transforms.js +3 -3
- package/src/details/README.md +1 -0
- package/src/details/block.json +1 -0
- package/src/details/index.js +1 -1
- package/src/embed/editor.scss +2 -2
- package/src/embed/embed-controls.jsx +2 -2
- package/src/file/deprecated.jsx +3 -3
- package/src/file/edit.jsx +5 -3
- package/src/file/inspector.jsx +3 -3
- package/src/file/save.jsx +2 -2
- package/src/footnotes/README.md +1 -0
- package/src/footnotes/block.json +1 -0
- package/src/footnotes/edit.jsx +1 -1
- package/src/gallery/dynamic-gallery.jsx +4 -4
- package/src/gallery/edit.jsx +121 -68
- package/src/gallery/gallery-styles.js +117 -0
- package/src/gallery/index.php +181 -67
- package/src/gallery/responsive-styles.js +59 -5
- package/src/gallery/test/edit.jsdom.test.js +71 -3
- package/src/gallery/test/responsive-styles.js +59 -5
- package/src/heading/README.md +2 -0
- package/src/heading/block.json +2 -0
- package/src/heading/index.js +2 -2
- package/src/html/modal.jsx +0 -3
- package/src/image/edit.jsx +1 -1
- package/src/image/image.jsx +7 -7
- package/src/image/index.php +10 -4
- package/src/image/style.scss +1 -0
- package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +1 -1
- package/src/index.jsx +1 -1
- package/src/latest-comments/edit.jsx +2 -2
- package/src/latest-posts/edit.jsx +1 -1
- package/src/list/ordered-list-settings.jsx +2 -2
- package/src/list-item/hooks/use-enter.js +1 -1
- package/src/math/README.md +2 -2
- package/src/math/block.json +2 -0
- package/src/math/deprecated.jsx +38 -12
- package/src/math/edit.jsx +49 -20
- package/src/math/editor.scss +5 -0
- package/src/math/save.jsx +20 -4
- package/src/media-text/constants.js +1 -0
- package/src/media-text/deprecated.jsx +3 -3
- package/src/media-text/edit.jsx +48 -3
- package/src/media-text/image-fill.js +2 -2
- package/src/media-text/media-container.jsx +1 -1
- package/src/navigation/edit/index.jsx +1 -1
- package/src/navigation/edit/menu-inspector-controls.jsx +2 -2
- package/src/navigation/edit/overlay-template-part-selector.jsx +3 -3
- package/src/navigation/edit/responsive-wrapper.jsx +1 -1
- package/src/navigation/edit/use-generate-default-navigation-title.js +2 -2
- package/src/navigation/editor.scss +1 -0
- package/src/navigation/index.php +12 -0
- package/src/navigation/style.scss +1 -1
- package/src/navigation/test/use-navigation-menu.jsdom.test.js +6 -28
- package/src/navigation/test/view.jsdom.test.js +23 -0
- package/src/navigation/view.js +9 -6
- package/src/navigation-link/edit.jsx +1 -1
- package/src/navigation-link/shared/invalid-draft-display.jsx +2 -2
- package/src/navigation-link/test/__snapshots__/hooks.jsdom.test.js.snap +41 -11
- package/src/navigation-submenu/edit.jsx +1 -1
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/edit.jsx +1 -1
- package/src/paragraph/index.js +7 -0
- package/src/pattern/index.php +2 -2
- package/src/playlist/edit.jsx +6 -4
- package/src/playlist-track/test/edit.jsdom.test.jsx +2 -3
- package/src/post-author/edit.jsx +2 -2
- package/src/post-author-name/edit.jsx +1 -1
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-date/edit.jsx +2 -2
- package/src/post-excerpt/README.md +1 -0
- package/src/post-excerpt/block.json +1 -0
- package/src/post-excerpt/edit.jsx +1 -1
- package/src/post-featured-image/edit.jsx +2 -2
- package/src/post-navigation-link/edit.jsx +4 -4
- package/src/post-time-to-read/edit.jsx +2 -2
- package/src/post-title/style.scss +2 -3
- package/src/pullquote/deprecated.jsx +1 -1
- package/src/query/deprecated.jsx +1 -1
- package/src/query/edit/inspector-controls/index.jsx +4 -4
- package/src/query/edit/inspector-controls/order-control.jsx +2 -2
- package/src/query/edit/inspector-controls/sticky-control.jsx +2 -2
- package/src/query/view.js +6 -9
- package/src/query-pagination/editor.scss +0 -3
- package/src/query-title/use-archive-label.js +1 -1
- package/src/quote/deprecated.jsx +2 -2
- package/src/quote/transforms.js +3 -3
- package/src/search/edit.jsx +6 -6
- package/src/search/theme.scss +1 -1
- package/src/separator/edit.jsx +7 -4
- package/src/social-links/edit.jsx +2 -2
- package/src/table/state.js +1 -1
- package/src/table-of-contents/edit.jsx +6 -6
- package/src/table-of-contents/utils.ts +2 -2
- package/src/tabs/use-tab-actions.js +1 -1
- package/src/tag-cloud/edit.jsx +2 -2
- package/src/template-part/edit/advanced-controls.jsx +5 -2
- package/src/template-part/edit/import-controls.jsx +2 -2
- package/src/template-part/edit/index.jsx +2 -2
- package/src/template-part/edit/inner-blocks.jsx +1 -1
- package/src/template-part/edit/placeholder.jsx +2 -2
- package/src/term-count/use-term-count.js +1 -1
- package/src/term-description/use-term-description.js +1 -1
- package/src/term-name/use-term-name.js +1 -1
- package/src/terms-query/edit/inspector-controls/index.jsx +2 -2
- package/src/terms-query/edit/inspector-controls/inherit-control.jsx +1 -1
- package/src/terms-query/edit/inspector-controls/order-control.jsx +2 -2
- package/src/terms-query/edit/inspector-controls/taxonomy-control.jsx +2 -2
- package/src/utils/hooks.js +1 -1
- package/src/utils/media-control.jsx +16 -10
- package/src/utils/poster-image.jsx +2 -2
- package/src/utils/test/waveform-player.jsdom.test.jsx +36 -38
- package/src/utils/test/{waveform-utils.jsdom.test.js → waveform-utils.browser.test.js} +64 -44
- package/src/verse/README.md +1 -0
- package/src/verse/block.json +1 -0
- package/src/verse/style.scss +2 -2
- package/src/video/edit-common-settings.jsx +3 -3
- package/src/video/tracks-editor.jsx +2 -2
- package/build/gallery/flex-styles.cjs.map +0 -7
- package/build-module/gallery/flex-styles.mjs.map +0 -7
- package/src/gallery/flex-styles.js +0 -99
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import '@testing-library/jest-dom/vitest';
|
|
2
3
|
import { act, render } from '@testing-library/react';
|
|
3
4
|
import { WaveformPlayer } from '../waveform-player';
|
|
4
5
|
import {
|
|
@@ -7,11 +8,11 @@ import {
|
|
|
7
8
|
setupPlayButtonArtwork,
|
|
8
9
|
} from '../waveform-utils';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
applyWaveformPlayerStyles:
|
|
12
|
-
initWaveformPlayer:
|
|
13
|
-
setupPlayButtonArtwork:
|
|
14
|
-
updateSeekControlLabel:
|
|
11
|
+
vi.mock( import( '../waveform-utils' ), () => ( {
|
|
12
|
+
applyWaveformPlayerStyles: vi.fn(),
|
|
13
|
+
initWaveformPlayer: vi.fn(),
|
|
14
|
+
setupPlayButtonArtwork: vi.fn(),
|
|
15
|
+
updateSeekControlLabel: vi.fn(),
|
|
15
16
|
} ) );
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -51,8 +52,8 @@ function createFakePlayer( options, element ) {
|
|
|
51
52
|
titleEl,
|
|
52
53
|
artistEl: artistEl || null,
|
|
53
54
|
artworkEl: artworkEl || null,
|
|
54
|
-
pause:
|
|
55
|
-
syncArtist:
|
|
55
|
+
pause: vi.fn(),
|
|
56
|
+
syncArtist: vi.fn( ( artist ) => {
|
|
56
57
|
if ( ! artist ) {
|
|
57
58
|
instance.artistEl?.remove();
|
|
58
59
|
instance.artistEl = null;
|
|
@@ -65,7 +66,7 @@ function createFakePlayer( options, element ) {
|
|
|
65
66
|
instance.artistEl.textContent = artist;
|
|
66
67
|
instance.artistEl.style.display = '';
|
|
67
68
|
} ),
|
|
68
|
-
syncArtwork:
|
|
69
|
+
syncArtwork: vi.fn( ( image, imageAlt = '' ) => {
|
|
69
70
|
if ( ! image ) {
|
|
70
71
|
instance.artworkEl?.remove();
|
|
71
72
|
instance.artworkEl = null;
|
|
@@ -78,7 +79,7 @@ function createFakePlayer( options, element ) {
|
|
|
78
79
|
instance.artworkEl.src = image;
|
|
79
80
|
instance.artworkEl.alt = imageAlt || '';
|
|
80
81
|
} ),
|
|
81
|
-
loadTrack:
|
|
82
|
+
loadTrack: vi.fn( async ( src, title, artist, trackOptions ) => {
|
|
82
83
|
titleEl.textContent = title;
|
|
83
84
|
instance.syncArtist( artist );
|
|
84
85
|
instance.syncArtwork(
|
|
@@ -91,21 +92,21 @@ function createFakePlayer( options, element ) {
|
|
|
91
92
|
return {
|
|
92
93
|
instance,
|
|
93
94
|
container: element,
|
|
94
|
-
destroy:
|
|
95
|
+
destroy: vi.fn(),
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
describe( 'WaveformPlayer', () => {
|
|
99
100
|
beforeEach( () => {
|
|
100
|
-
|
|
101
|
+
vi.useFakeTimers();
|
|
101
102
|
initWaveformPlayer.mockImplementation( ( element, options ) =>
|
|
102
103
|
createFakePlayer( options, element )
|
|
103
104
|
);
|
|
104
105
|
} );
|
|
105
106
|
|
|
106
107
|
afterEach( () => {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
vi.runOnlyPendingTimers();
|
|
109
|
+
vi.useRealTimers();
|
|
109
110
|
applyWaveformPlayerStyles.mockReset();
|
|
110
111
|
initWaveformPlayer.mockReset();
|
|
111
112
|
setupPlayButtonArtwork.mockReset();
|
|
@@ -124,7 +125,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
124
125
|
render( <WaveformPlayer { ...baseProps } /> );
|
|
125
126
|
|
|
126
127
|
act( () => {
|
|
127
|
-
|
|
128
|
+
vi.advanceTimersByTime( 100 );
|
|
128
129
|
} );
|
|
129
130
|
|
|
130
131
|
expect( initWaveformPlayer ).toHaveBeenCalledTimes( 1 );
|
|
@@ -145,7 +146,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
145
146
|
render( <WaveformPlayer { ...baseProps } showPlayButtonArtwork /> );
|
|
146
147
|
|
|
147
148
|
act( () => {
|
|
148
|
-
|
|
149
|
+
vi.advanceTimersByTime( 100 );
|
|
149
150
|
} );
|
|
150
151
|
|
|
151
152
|
expect( initWaveformPlayer ).toHaveBeenCalledWith(
|
|
@@ -169,7 +170,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
169
170
|
);
|
|
170
171
|
|
|
171
172
|
act( () => {
|
|
172
|
-
|
|
173
|
+
vi.advanceTimersByTime( 100 );
|
|
173
174
|
} );
|
|
174
175
|
|
|
175
176
|
expect( initWaveformPlayer ).toHaveBeenCalledWith(
|
|
@@ -190,7 +191,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
190
191
|
render( <WaveformPlayer { ...baseProps } showPlayButtonArtwork /> );
|
|
191
192
|
|
|
192
193
|
act( () => {
|
|
193
|
-
|
|
194
|
+
vi.advanceTimersByTime( 100 );
|
|
194
195
|
} );
|
|
195
196
|
|
|
196
197
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -204,7 +205,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
204
205
|
);
|
|
205
206
|
|
|
206
207
|
act( () => {
|
|
207
|
-
|
|
208
|
+
vi.advanceTimersByTime( 100 );
|
|
208
209
|
} );
|
|
209
210
|
|
|
210
211
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -228,7 +229,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
228
229
|
const { rerender } = render( <WaveformPlayer { ...baseProps } /> );
|
|
229
230
|
|
|
230
231
|
act( () => {
|
|
231
|
-
|
|
232
|
+
vi.advanceTimersByTime( 100 );
|
|
232
233
|
} );
|
|
233
234
|
|
|
234
235
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -262,7 +263,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
262
263
|
const { rerender } = render( <WaveformPlayer { ...baseProps } /> );
|
|
263
264
|
|
|
264
265
|
act( () => {
|
|
265
|
-
|
|
266
|
+
vi.advanceTimersByTime( 100 );
|
|
266
267
|
} );
|
|
267
268
|
|
|
268
269
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -275,7 +276,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
275
276
|
);
|
|
276
277
|
|
|
277
278
|
act( () => {
|
|
278
|
-
|
|
279
|
+
vi.advanceTimersByTime( 100 );
|
|
279
280
|
} );
|
|
280
281
|
|
|
281
282
|
expect( player.destroy ).not.toHaveBeenCalled();
|
|
@@ -297,7 +298,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
297
298
|
);
|
|
298
299
|
|
|
299
300
|
act( () => {
|
|
300
|
-
|
|
301
|
+
vi.advanceTimersByTime( 100 );
|
|
301
302
|
} );
|
|
302
303
|
|
|
303
304
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -305,7 +306,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
305
306
|
rerender( <WaveformPlayer { ...baseProps } showPlayButtonArtwork /> );
|
|
306
307
|
|
|
307
308
|
act( () => {
|
|
308
|
-
|
|
309
|
+
vi.advanceTimersByTime( 100 );
|
|
309
310
|
} );
|
|
310
311
|
|
|
311
312
|
expect( player.destroy ).toHaveBeenCalledTimes( 1 );
|
|
@@ -326,7 +327,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
326
327
|
);
|
|
327
328
|
|
|
328
329
|
act( () => {
|
|
329
|
-
|
|
330
|
+
vi.advanceTimersByTime( 100 );
|
|
330
331
|
} );
|
|
331
332
|
|
|
332
333
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -334,7 +335,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
334
335
|
rerender( <WaveformPlayer { ...baseProps } color="#0000ff" /> );
|
|
335
336
|
|
|
336
337
|
act( () => {
|
|
337
|
-
|
|
338
|
+
vi.advanceTimersByTime( 100 );
|
|
338
339
|
} );
|
|
339
340
|
|
|
340
341
|
expect( player.destroy ).toHaveBeenCalledTimes( 1 );
|
|
@@ -353,7 +354,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
353
354
|
);
|
|
354
355
|
|
|
355
356
|
act( () => {
|
|
356
|
-
|
|
357
|
+
vi.advanceTimersByTime( 100 );
|
|
357
358
|
} );
|
|
358
359
|
|
|
359
360
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -385,7 +386,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
385
386
|
);
|
|
386
387
|
|
|
387
388
|
act( () => {
|
|
388
|
-
|
|
389
|
+
vi.advanceTimersByTime( 100 );
|
|
389
390
|
} );
|
|
390
391
|
|
|
391
392
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -398,7 +399,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
398
399
|
);
|
|
399
400
|
|
|
400
401
|
act( () => {
|
|
401
|
-
|
|
402
|
+
vi.advanceTimersByTime( 100 );
|
|
402
403
|
} );
|
|
403
404
|
|
|
404
405
|
expect( player.destroy ).toHaveBeenCalledTimes( 1 );
|
|
@@ -418,7 +419,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
418
419
|
);
|
|
419
420
|
|
|
420
421
|
act( () => {
|
|
421
|
-
|
|
422
|
+
vi.advanceTimersByTime( 100 );
|
|
422
423
|
} );
|
|
423
424
|
|
|
424
425
|
const firstPlayer = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -433,7 +434,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
433
434
|
);
|
|
434
435
|
|
|
435
436
|
act( () => {
|
|
436
|
-
|
|
437
|
+
vi.advanceTimersByTime( 100 );
|
|
437
438
|
} );
|
|
438
439
|
|
|
439
440
|
expect( firstPlayer.destroy ).not.toHaveBeenCalled();
|
|
@@ -448,7 +449,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
448
449
|
const { rerender } = render( <WaveformPlayer { ...baseProps } /> );
|
|
449
450
|
|
|
450
451
|
act( () => {
|
|
451
|
-
|
|
452
|
+
vi.advanceTimersByTime( 100 );
|
|
452
453
|
} );
|
|
453
454
|
|
|
454
455
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -456,7 +457,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
456
457
|
rerender( <WaveformPlayer { ...baseProps } image="" /> );
|
|
457
458
|
|
|
458
459
|
act( () => {
|
|
459
|
-
|
|
460
|
+
vi.advanceTimersByTime( 100 );
|
|
460
461
|
} );
|
|
461
462
|
|
|
462
463
|
expect( player.destroy ).not.toHaveBeenCalled();
|
|
@@ -470,7 +471,7 @@ describe( 'WaveformPlayer', () => {
|
|
|
470
471
|
);
|
|
471
472
|
|
|
472
473
|
act( () => {
|
|
473
|
-
|
|
474
|
+
vi.advanceTimersByTime( 100 );
|
|
474
475
|
} );
|
|
475
476
|
|
|
476
477
|
const firstPlayer = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -483,16 +484,13 @@ describe( 'WaveformPlayer', () => {
|
|
|
483
484
|
expect( firstPlayer.instance.artistEl ).toHaveTextContent(
|
|
484
485
|
'New Artist'
|
|
485
486
|
);
|
|
486
|
-
expect( firstPlayer.instance.artistEl ).not.toHaveStyle( {
|
|
487
|
-
display: 'none',
|
|
488
|
-
} );
|
|
489
487
|
} );
|
|
490
488
|
|
|
491
489
|
it( 'updates the player in place when the artist is removed', () => {
|
|
492
490
|
const { rerender } = render( <WaveformPlayer { ...baseProps } /> );
|
|
493
491
|
|
|
494
492
|
act( () => {
|
|
495
|
-
|
|
493
|
+
vi.advanceTimersByTime( 100 );
|
|
496
494
|
} );
|
|
497
495
|
|
|
498
496
|
const player = initWaveformPlayer.mock.results[ 0 ].value;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import '@testing-library/jest-dom/vitest';
|
|
2
3
|
import {
|
|
3
4
|
applyWaveformPlayerStyles,
|
|
4
5
|
createWaveformContainer,
|
|
@@ -20,6 +21,21 @@ const basePlayerData = {
|
|
|
20
21
|
buttonColor: '#000000',
|
|
21
22
|
};
|
|
22
23
|
|
|
24
|
+
function readStyle( element ) {
|
|
25
|
+
if ( ! element.isConnected ) {
|
|
26
|
+
let root = element;
|
|
27
|
+
while ( root.parentElement ) {
|
|
28
|
+
root = root.parentElement;
|
|
29
|
+
}
|
|
30
|
+
document.body.appendChild( root );
|
|
31
|
+
}
|
|
32
|
+
return window.getComputedStyle( element );
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
afterEach( () => {
|
|
36
|
+
document.body.replaceChildren();
|
|
37
|
+
} );
|
|
38
|
+
|
|
23
39
|
describe( 'Waveform utilities', () => {
|
|
24
40
|
describe( 'createWaveformContainer', () => {
|
|
25
41
|
it( 'should create a container with required data attributes', () => {
|
|
@@ -224,9 +240,9 @@ describe( 'Waveform utilities', () => {
|
|
|
224
240
|
backgroundColor: '#ffeeaa',
|
|
225
241
|
} );
|
|
226
242
|
|
|
227
|
-
expect( waveformContainer ).
|
|
228
|
-
|
|
229
|
-
|
|
243
|
+
expect( readStyle( waveformContainer ).backgroundColor ).toBe(
|
|
244
|
+
'rgb(255, 238, 170)'
|
|
245
|
+
);
|
|
230
246
|
} );
|
|
231
247
|
|
|
232
248
|
it( 'applies the waveform background gradient', () => {
|
|
@@ -240,9 +256,9 @@ describe( 'Waveform utilities', () => {
|
|
|
240
256
|
'linear-gradient(90deg,#ff0000 0%,#0000ff 100%)',
|
|
241
257
|
} );
|
|
242
258
|
|
|
243
|
-
expect( waveformContainer ).
|
|
244
|
-
|
|
245
|
-
|
|
259
|
+
expect( readStyle( waveformContainer ).backgroundImage ).toBe(
|
|
260
|
+
'linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(0, 0, 255) 100%)'
|
|
261
|
+
);
|
|
246
262
|
} );
|
|
247
263
|
|
|
248
264
|
it( 'applies the waveform player text color variables', () => {
|
|
@@ -252,10 +268,13 @@ describe( 'Waveform utilities', () => {
|
|
|
252
268
|
textColor: '#0000ff',
|
|
253
269
|
} );
|
|
254
270
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
'
|
|
258
|
-
|
|
271
|
+
const style = readStyle( container );
|
|
272
|
+
expect( style.getPropertyValue( '--wfp-text-color' ) ).toBe(
|
|
273
|
+
'#0000ff'
|
|
274
|
+
);
|
|
275
|
+
expect(
|
|
276
|
+
style.getPropertyValue( '--wfp-text-secondary-color' )
|
|
277
|
+
).toBe( '#0000ff' );
|
|
259
278
|
} );
|
|
260
279
|
|
|
261
280
|
it( 'applies the waveform player play button color variable', () => {
|
|
@@ -265,9 +284,9 @@ describe( 'Waveform utilities', () => {
|
|
|
265
284
|
playButtonColor: '#ff0000',
|
|
266
285
|
} );
|
|
267
286
|
|
|
268
|
-
expect(
|
|
269
|
-
'--wfp-button-color'
|
|
270
|
-
|
|
287
|
+
expect(
|
|
288
|
+
readStyle( container ).getPropertyValue( '--wfp-button-color' )
|
|
289
|
+
).toBe( '#ff0000' );
|
|
271
290
|
} );
|
|
272
291
|
|
|
273
292
|
it( 'applies the waveform player play button gradient', () => {
|
|
@@ -281,12 +300,12 @@ describe( 'Waveform utilities', () => {
|
|
|
281
300
|
'linear-gradient(90deg,#ff0000 0%,#0000ff 100%)',
|
|
282
301
|
} );
|
|
283
302
|
|
|
284
|
-
expect( playButton ).
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
expect(
|
|
288
|
-
'--wfp-button-color'
|
|
289
|
-
|
|
303
|
+
expect( readStyle( playButton ).backgroundImage ).toBe(
|
|
304
|
+
'linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(0, 0, 255) 100%)'
|
|
305
|
+
);
|
|
306
|
+
expect(
|
|
307
|
+
readStyle( container ).getPropertyValue( '--wfp-button-color' )
|
|
308
|
+
).toBe( '#0000ff' );
|
|
290
309
|
} );
|
|
291
310
|
|
|
292
311
|
it( 'removes the waveform background color when cleared', () => {
|
|
@@ -298,9 +317,9 @@ describe( 'Waveform utilities', () => {
|
|
|
298
317
|
|
|
299
318
|
applyWaveformPlayerStyles( container );
|
|
300
319
|
|
|
301
|
-
expect( waveformContainer ).not.
|
|
302
|
-
|
|
303
|
-
|
|
320
|
+
expect( readStyle( waveformContainer ).backgroundColor ).not.toBe(
|
|
321
|
+
'rgb(255, 238, 170)'
|
|
322
|
+
);
|
|
304
323
|
} );
|
|
305
324
|
|
|
306
325
|
it( 'removes the waveform player text color variables when cleared', () => {
|
|
@@ -313,10 +332,11 @@ describe( 'Waveform utilities', () => {
|
|
|
313
332
|
|
|
314
333
|
applyWaveformPlayerStyles( container );
|
|
315
334
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
335
|
+
const style = readStyle( container );
|
|
336
|
+
expect( style.getPropertyValue( '--wfp-text-color' ) ).toBe( '' );
|
|
337
|
+
expect(
|
|
338
|
+
style.getPropertyValue( '--wfp-text-secondary-color' )
|
|
339
|
+
).toBe( '' );
|
|
320
340
|
} );
|
|
321
341
|
|
|
322
342
|
it( 'removes the waveform player play button color variable when cleared', () => {
|
|
@@ -325,9 +345,9 @@ describe( 'Waveform utilities', () => {
|
|
|
325
345
|
|
|
326
346
|
applyWaveformPlayerStyles( container );
|
|
327
347
|
|
|
328
|
-
expect(
|
|
329
|
-
'--wfp-button-color'
|
|
330
|
-
|
|
348
|
+
expect(
|
|
349
|
+
readStyle( container ).getPropertyValue( '--wfp-button-color' )
|
|
350
|
+
).toBe( '' );
|
|
331
351
|
} );
|
|
332
352
|
} );
|
|
333
353
|
|
|
@@ -347,7 +367,7 @@ describe( 'Waveform utilities', () => {
|
|
|
347
367
|
|
|
348
368
|
styleSvgIcons( container, '#000000' );
|
|
349
369
|
|
|
350
|
-
expect( path ).
|
|
370
|
+
expect( readStyle( path ).fill ).toBe( 'rgb(255, 255, 255)' );
|
|
351
371
|
} );
|
|
352
372
|
|
|
353
373
|
it( 'should set black fill for light button colors', () => {
|
|
@@ -365,7 +385,7 @@ describe( 'Waveform utilities', () => {
|
|
|
365
385
|
|
|
366
386
|
styleSvgIcons( container, '#ffffff' );
|
|
367
387
|
|
|
368
|
-
expect( path ).
|
|
388
|
+
expect( readStyle( path ).fill ).toBe( 'rgb(0, 0, 0)' );
|
|
369
389
|
} );
|
|
370
390
|
|
|
371
391
|
it( 'should style multiple SVG paths', () => {
|
|
@@ -388,8 +408,8 @@ describe( 'Waveform utilities', () => {
|
|
|
388
408
|
|
|
389
409
|
styleSvgIcons( container, '#000000' );
|
|
390
410
|
|
|
391
|
-
expect( path1 ).
|
|
392
|
-
expect( path2 ).
|
|
411
|
+
expect( readStyle( path1 ).fill ).toBe( 'rgb(255, 255, 255)' );
|
|
412
|
+
expect( readStyle( path2 ).fill ).toBe( 'rgb(255, 255, 255)' );
|
|
393
413
|
} );
|
|
394
414
|
|
|
395
415
|
it( 'should handle container with no SVG paths', () => {
|
|
@@ -417,7 +437,7 @@ describe( 'Waveform utilities', () => {
|
|
|
417
437
|
// A dark blue color.
|
|
418
438
|
styleSvgIcons( container, '#000080' );
|
|
419
439
|
|
|
420
|
-
expect( path ).
|
|
440
|
+
expect( readStyle( path ).fill ).toBe( 'rgb(255, 255, 255)' );
|
|
421
441
|
} );
|
|
422
442
|
|
|
423
443
|
it( 'should use black for mid-light colors', () => {
|
|
@@ -436,7 +456,7 @@ describe( 'Waveform utilities', () => {
|
|
|
436
456
|
// A light yellow color.
|
|
437
457
|
styleSvgIcons( container, '#ffff00' );
|
|
438
458
|
|
|
439
|
-
expect( path ).
|
|
459
|
+
expect( readStyle( path ).fill ).toBe( 'rgb(0, 0, 0)' );
|
|
440
460
|
} );
|
|
441
461
|
} );
|
|
442
462
|
|
|
@@ -455,7 +475,7 @@ describe( 'Waveform utilities', () => {
|
|
|
455
475
|
const instance = {
|
|
456
476
|
container,
|
|
457
477
|
options: {},
|
|
458
|
-
applySeekLabel:
|
|
478
|
+
applySeekLabel: vi.fn( ( label ) => {
|
|
459
479
|
seekControl.setAttribute( 'aria-label', label );
|
|
460
480
|
} ),
|
|
461
481
|
};
|
|
@@ -614,7 +634,7 @@ describe( 'Waveform utilities', () => {
|
|
|
614
634
|
'https://example.com/cover.jpg'
|
|
615
635
|
);
|
|
616
636
|
|
|
617
|
-
expect( path ).not.
|
|
637
|
+
expect( readStyle( path ).fill ).not.toBe( 'rgb(255, 255, 255)' );
|
|
618
638
|
} );
|
|
619
639
|
|
|
620
640
|
it( 'should set artwork state when play button is missing', () => {
|
|
@@ -684,19 +704,19 @@ describe( 'Waveform utilities', () => {
|
|
|
684
704
|
// from running so the test only exercises the synchronous
|
|
685
705
|
// construction path, where the crossOrigin behavior is decided
|
|
686
706
|
// before any request is made.
|
|
687
|
-
|
|
707
|
+
vi.useFakeTimers();
|
|
688
708
|
|
|
689
709
|
// jsdom does not implement canvas rendering or media playback;
|
|
690
710
|
// stub them out so the library's construction and destroy paths
|
|
691
711
|
// do not emit "Not implemented" console errors.
|
|
692
712
|
jsdomStubs = [
|
|
693
|
-
|
|
713
|
+
vi
|
|
694
714
|
.spyOn( window.HTMLCanvasElement.prototype, 'getContext' )
|
|
695
715
|
.mockReturnValue( null ),
|
|
696
|
-
|
|
716
|
+
vi
|
|
697
717
|
.spyOn( window.HTMLMediaElement.prototype, 'pause' )
|
|
698
718
|
.mockImplementation( () => {} ),
|
|
699
|
-
|
|
719
|
+
vi
|
|
700
720
|
.spyOn( window.HTMLMediaElement.prototype, 'load' )
|
|
701
721
|
.mockImplementation( () => {} ),
|
|
702
722
|
];
|
|
@@ -704,7 +724,7 @@ describe( 'Waveform utilities', () => {
|
|
|
704
724
|
|
|
705
725
|
afterEach( () => {
|
|
706
726
|
jsdomStubs.forEach( ( stub ) => stub.mockRestore() );
|
|
707
|
-
|
|
727
|
+
vi.useRealTimers();
|
|
708
728
|
document.body.innerHTML = '';
|
|
709
729
|
} );
|
|
710
730
|
|
|
@@ -740,7 +760,7 @@ describe( 'Waveform utilities', () => {
|
|
|
740
760
|
let consoleErrorSpy;
|
|
741
761
|
|
|
742
762
|
beforeEach( () => {
|
|
743
|
-
consoleErrorSpy =
|
|
763
|
+
consoleErrorSpy = vi
|
|
744
764
|
.spyOn( console, 'error' )
|
|
745
765
|
.mockImplementation( () => {} );
|
|
746
766
|
} );
|
package/src/verse/README.md
CHANGED
|
@@ -35,6 +35,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
35
35
|
- [`fontSize`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-fontsize): `true`
|
|
36
36
|
- [`lineHeight`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-lineheight): `true`
|
|
37
37
|
- [`textAlign`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-textalign): `true`
|
|
38
|
+
- [`shadow`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#shadow): `true`
|
|
38
39
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
39
40
|
- `margin`: `true`
|
|
40
41
|
- `padding`: `true`
|
package/src/verse/block.json
CHANGED
package/src/verse/style.scss
CHANGED
|
@@ -5,8 +5,8 @@ pre.wp-block-verse {
|
|
|
5
5
|
|
|
6
6
|
// Prevent text overflow off-screen when the previous block has float.
|
|
7
7
|
min-width: 1em;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
word-break: normal;
|
|
9
|
+
overflow-wrap: break-word;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
:where(pre.wp-block-verse) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __, _x } from '@wordpress/i18n';
|
|
2
2
|
import {
|
|
3
3
|
ToggleControl,
|
|
4
|
-
SelectControl,
|
|
4
|
+
SelectControl as WCSelectControl,
|
|
5
5
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
6
6
|
} from '@wordpress/components';
|
|
7
7
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
@@ -134,7 +134,7 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
|
|
|
134
134
|
? __( 'Play inline enabled because of Autoplay.' )
|
|
135
135
|
: __(
|
|
136
136
|
'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'
|
|
137
|
-
|
|
137
|
+
)
|
|
138
138
|
}
|
|
139
139
|
/>
|
|
140
140
|
</ToolsPanelItem>
|
|
@@ -146,7 +146,7 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
|
|
|
146
146
|
setAttributes( { preload: 'metadata' } );
|
|
147
147
|
} }
|
|
148
148
|
>
|
|
149
|
-
<
|
|
149
|
+
<WCSelectControl
|
|
150
150
|
label={ __( 'Preload' ) }
|
|
151
151
|
value={ preload }
|
|
152
152
|
onChange={ onChangePreload }
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Dropdown,
|
|
10
10
|
Button,
|
|
11
11
|
TextControl,
|
|
12
|
-
SelectControl,
|
|
12
|
+
SelectControl as WCSelectControl,
|
|
13
13
|
ToggleControl,
|
|
14
14
|
__experimentalGrid as Grid,
|
|
15
15
|
__experimentalHStack as HStack,
|
|
@@ -135,7 +135,7 @@ function SingleTrackEditor( {
|
|
|
135
135
|
/>
|
|
136
136
|
</Grid>
|
|
137
137
|
<VStack spacing="4">
|
|
138
|
-
<
|
|
138
|
+
<WCSelectControl
|
|
139
139
|
className="block-library-video-tracks-editor__single-track-editor-kind-select"
|
|
140
140
|
options={ KIND_OPTIONS }
|
|
141
141
|
value={ kind }
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/gallery/flex-styles.js"],
|
|
4
|
-
"sourcesContent": ["import {\n\t__experimentalGetGapCSSValue as getGapCSSValue,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tuseStyleOverride,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';\nimport { unlock } from '../lock-unlock';\nimport { getGalleryResponsiveFlexCSS } from './responsive-styles';\n\nconst { getResponsiveMediaQueries } = unlock( globalStylesEnginePrivateApis );\nconst { globalStylesDataKey } = unlock( blockEditorPrivateApis );\nconst GALLERY_BLOCK_NAME = 'core/gallery';\n\n// --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default\n// gap on the gallery.\nconst FALLBACK_VALUE = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;\n\nfunction getGalleryGapCustomPropertyStyle( selector, blockGap ) {\n\tlet column = FALLBACK_VALUE;\n\tif ( blockGap ) {\n\t\tcolumn =\n\t\t\ttypeof blockGap === 'string'\n\t\t\t\t? getGapCSSValue( blockGap ) || FALLBACK_VALUE\n\t\t\t\t: getGapCSSValue( blockGap?.left ) || FALLBACK_VALUE;\n\t}\n\n\t// The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`.\n\treturn `${ selector } {\n\t\t--wp--style--unstable-gallery-gap: ${ column === '0' ? '0px' : column }\n\t}`;\n}\n\nfunction getBlockGapValue( style ) {\n\tif ( ! Object.hasOwn( style?.spacing || {}, 'blockGap' ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn style.spacing.blockGap;\n}\n\nexport default function GalleryFlexStyles( { style, clientId } ) {\n\tconst selector = `.wp-block-gallery-${ clientId }`;\n\tconst [ viewportSettings ] = useSettings( 'viewport' );\n\tconst globalStyles = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()?.[ globalStylesDataKey ],\n\t\t[]\n\t);\n\tconst globalGalleryStyles =\n\t\tglobalStyles?.blocks?.[ GALLERY_BLOCK_NAME ] || {};\n\tconst styleBlockGap = getBlockGapValue( style );\n\tconst globalGalleryBlockGap =\n\t\tglobalGalleryStyles?.spacing?.blockGap ?? FALLBACK_VALUE;\n\t// Prefer the block's own gap value, then Gallery global styles. Missing\n\t// values fall back to the Gallery blockGap default.\n\tconst blockGap =\n\t\tstyleBlockGap === undefined ? globalGalleryBlockGap : styleBlockGap;\n\tlet css = getGalleryGapCustomPropertyStyle( selector, blockGap );\n\tconst responsiveMediaQueries =\n\t\tgetResponsiveMediaQueries( viewportSettings );\n\n\tObject.entries( responsiveMediaQueries ).forEach(\n\t\t( [ viewport, mediaQuery ] ) => {\n\t\t\tconst styleViewportBlockGap = getBlockGapValue(\n\t\t\t\tstyle?.[ viewport ]\n\t\t\t);\n\t\t\t// Viewport-specific block values win. Gallery global viewport values\n\t\t\t// only apply when the block has no base gap, so they do not override an instance value.\n\t\t\tconst globalViewportBlockGap =\n\t\t\t\tstyleBlockGap === undefined\n\t\t\t\t\t? globalGalleryStyles?.[ viewport ]?.spacing?.blockGap\n\t\t\t\t\t: undefined;\n\t\t\tconst viewportBlockGap =\n\t\t\t\tstyleViewportBlockGap === undefined\n\t\t\t\t\t? globalViewportBlockGap\n\t\t\t\t\t: styleViewportBlockGap;\n\t\t\tif ( viewportBlockGap === undefined || viewportBlockGap === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcss += `${ mediaQuery }{${ getGalleryGapCustomPropertyStyle(\n\t\t\t\tselector,\n\t\t\t\tviewportBlockGap\n\t\t\t) }}`;\n\t\t}\n\t);\n\tcss += getGalleryResponsiveFlexCSS(\n\t\tselector,\n\t\tstyle,\n\t\tresponsiveMediaQueries\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMO;AACP,kBAA0B;AAC1B,kCAA6D;AAC7D,yBAAuB;AACvB,+BAA4C;AAE5C,IAAM,EAAE,0BAA0B,QAAI,2BAAQ,4BAAAA,WAA8B;AAC5E,IAAM,EAAE,oBAAoB,QAAI,2BAAQ,oBAAAC,WAAuB;AAC/D,IAAM,qBAAqB;AAI3B,IAAM,iBAAiB;AAEvB,SAAS,iCAAkC,UAAU,UAAW;AAC/D,MAAI,SAAS;AACb,MAAK,UAAW;AACf,aACC,OAAO,aAAa,eACjB,oBAAAC,8BAAgB,QAAS,KAAK,qBAC9B,oBAAAA,8BAAgB,UAAU,IAAK,KAAK;AAAA,EACzC;AAGA,SAAO,GAAI,QAAS;AAAA,uCACmB,WAAW,MAAM,QAAQ,MAAO;AAAA;AAExE;AAEA,SAAS,iBAAkB,OAAQ;AAClC,MAAK,CAAE,OAAO,OAAQ,OAAO,WAAW,CAAC,GAAG,UAAW,GAAI;AAC1D,WAAO;AAAA,EACR;AAEA,SAAO,MAAM,QAAQ;AACtB;AAEe,SAAR,kBAAoC,EAAE,OAAO,SAAS,GAAI;AAChE,QAAM,WAAW,qBAAsB,QAAS;AAChD,QAAM,CAAE,gBAAiB,QAAI,iCAAa,UAAW;AACrD,QAAM,mBAAe;AAAA,IACpB,CAAE,WACD,OAAQ,oBAAAC,KAAiB,EAAE,YAAY,IAAK,mBAAoB;AAAA,IACjE,CAAC;AAAA,EACF;AACA,QAAM,sBACL,cAAc,SAAU,kBAAmB,KAAK,CAAC;AAClD,QAAM,gBAAgB,iBAAkB,KAAM;AAC9C,QAAM,wBACL,qBAAqB,SAAS,YAAY;AAG3C,QAAM,WACL,kBAAkB,SAAY,wBAAwB;AACvD,MAAI,MAAM,iCAAkC,UAAU,QAAS;AAC/D,QAAM,yBACL,0BAA2B,gBAAiB;AAE7C,SAAO,QAAS,sBAAuB,EAAE;AAAA,IACxC,CAAE,CAAE,UAAU,UAAW,MAAO;AAC/B,YAAM,wBAAwB;AAAA,QAC7B,QAAS,QAAS;AAAA,MACnB;AAGA,YAAM,yBACL,kBAAkB,SACf,sBAAuB,QAAS,GAAG,SAAS,WAC5C;AACJ,YAAM,mBACL,0BAA0B,SACvB,yBACA;AACJ,UAAK,qBAAqB,UAAa,qBAAqB,MAAO;AAClE;AAAA,MACD;AAEA,aAAO,GAAI,UAAW,IAAK;AAAA,QAC1B;AAAA,QACA;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD;AACA,aAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,4CAAkB,EAAE,IAAI,CAAE;AAE1B,SAAO;AACR;",
|
|
6
|
-
"names": ["globalStylesEnginePrivateApis", "blockEditorPrivateApis", "getGapCSSValue", "blockEditorStore"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/gallery/flex-styles.js"],
|
|
4
|
-
"sourcesContent": ["import {\n\t__experimentalGetGapCSSValue as getGapCSSValue,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tuseStyleOverride,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';\nimport { unlock } from '../lock-unlock';\nimport { getGalleryResponsiveFlexCSS } from './responsive-styles';\n\nconst { getResponsiveMediaQueries } = unlock( globalStylesEnginePrivateApis );\nconst { globalStylesDataKey } = unlock( blockEditorPrivateApis );\nconst GALLERY_BLOCK_NAME = 'core/gallery';\n\n// --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default\n// gap on the gallery.\nconst FALLBACK_VALUE = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;\n\nfunction getGalleryGapCustomPropertyStyle( selector, blockGap ) {\n\tlet column = FALLBACK_VALUE;\n\tif ( blockGap ) {\n\t\tcolumn =\n\t\t\ttypeof blockGap === 'string'\n\t\t\t\t? getGapCSSValue( blockGap ) || FALLBACK_VALUE\n\t\t\t\t: getGapCSSValue( blockGap?.left ) || FALLBACK_VALUE;\n\t}\n\n\t// The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`.\n\treturn `${ selector } {\n\t\t--wp--style--unstable-gallery-gap: ${ column === '0' ? '0px' : column }\n\t}`;\n}\n\nfunction getBlockGapValue( style ) {\n\tif ( ! Object.hasOwn( style?.spacing || {}, 'blockGap' ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn style.spacing.blockGap;\n}\n\nexport default function GalleryFlexStyles( { style, clientId } ) {\n\tconst selector = `.wp-block-gallery-${ clientId }`;\n\tconst [ viewportSettings ] = useSettings( 'viewport' );\n\tconst globalStyles = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()?.[ globalStylesDataKey ],\n\t\t[]\n\t);\n\tconst globalGalleryStyles =\n\t\tglobalStyles?.blocks?.[ GALLERY_BLOCK_NAME ] || {};\n\tconst styleBlockGap = getBlockGapValue( style );\n\tconst globalGalleryBlockGap =\n\t\tglobalGalleryStyles?.spacing?.blockGap ?? FALLBACK_VALUE;\n\t// Prefer the block's own gap value, then Gallery global styles. Missing\n\t// values fall back to the Gallery blockGap default.\n\tconst blockGap =\n\t\tstyleBlockGap === undefined ? globalGalleryBlockGap : styleBlockGap;\n\tlet css = getGalleryGapCustomPropertyStyle( selector, blockGap );\n\tconst responsiveMediaQueries =\n\t\tgetResponsiveMediaQueries( viewportSettings );\n\n\tObject.entries( responsiveMediaQueries ).forEach(\n\t\t( [ viewport, mediaQuery ] ) => {\n\t\t\tconst styleViewportBlockGap = getBlockGapValue(\n\t\t\t\tstyle?.[ viewport ]\n\t\t\t);\n\t\t\t// Viewport-specific block values win. Gallery global viewport values\n\t\t\t// only apply when the block has no base gap, so they do not override an instance value.\n\t\t\tconst globalViewportBlockGap =\n\t\t\t\tstyleBlockGap === undefined\n\t\t\t\t\t? globalGalleryStyles?.[ viewport ]?.spacing?.blockGap\n\t\t\t\t\t: undefined;\n\t\t\tconst viewportBlockGap =\n\t\t\t\tstyleViewportBlockGap === undefined\n\t\t\t\t\t? globalViewportBlockGap\n\t\t\t\t\t: styleViewportBlockGap;\n\t\t\tif ( viewportBlockGap === undefined || viewportBlockGap === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcss += `${ mediaQuery }{${ getGalleryGapCustomPropertyStyle(\n\t\t\t\tselector,\n\t\t\t\tviewportBlockGap\n\t\t\t) }}`;\n\t\t}\n\t);\n\tcss += getGalleryResponsiveFlexCSS(\n\t\tselector,\n\t\tstyle,\n\t\tresponsiveMediaQueries\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": ";AAAA;AAAA,EACC,gCAAgC;AAAA,EAChC,eAAe;AAAA,EACf,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACM;AACP,SAAS,iBAAiB;AAC1B,SAAS,eAAe,qCAAqC;AAC7D,SAAS,cAAc;AACvB,SAAS,mCAAmC;AAE5C,IAAM,EAAE,0BAA0B,IAAI,OAAQ,6BAA8B;AAC5E,IAAM,EAAE,oBAAoB,IAAI,OAAQ,sBAAuB;AAC/D,IAAM,qBAAqB;AAI3B,IAAM,iBAAiB;AAEvB,SAAS,iCAAkC,UAAU,UAAW;AAC/D,MAAI,SAAS;AACb,MAAK,UAAW;AACf,aACC,OAAO,aAAa,WACjB,eAAgB,QAAS,KAAK,iBAC9B,eAAgB,UAAU,IAAK,KAAK;AAAA,EACzC;AAGA,SAAO,GAAI,QAAS;AAAA,uCACmB,WAAW,MAAM,QAAQ,MAAO;AAAA;AAExE;AAEA,SAAS,iBAAkB,OAAQ;AAClC,MAAK,CAAE,OAAO,OAAQ,OAAO,WAAW,CAAC,GAAG,UAAW,GAAI;AAC1D,WAAO;AAAA,EACR;AAEA,SAAO,MAAM,QAAQ;AACtB;AAEe,SAAR,kBAAoC,EAAE,OAAO,SAAS,GAAI;AAChE,QAAM,WAAW,qBAAsB,QAAS;AAChD,QAAM,CAAE,gBAAiB,IAAI,YAAa,UAAW;AACrD,QAAM,eAAe;AAAA,IACpB,CAAE,WACD,OAAQ,gBAAiB,EAAE,YAAY,IAAK,mBAAoB;AAAA,IACjE,CAAC;AAAA,EACF;AACA,QAAM,sBACL,cAAc,SAAU,kBAAmB,KAAK,CAAC;AAClD,QAAM,gBAAgB,iBAAkB,KAAM;AAC9C,QAAM,wBACL,qBAAqB,SAAS,YAAY;AAG3C,QAAM,WACL,kBAAkB,SAAY,wBAAwB;AACvD,MAAI,MAAM,iCAAkC,UAAU,QAAS;AAC/D,QAAM,yBACL,0BAA2B,gBAAiB;AAE7C,SAAO,QAAS,sBAAuB,EAAE;AAAA,IACxC,CAAE,CAAE,UAAU,UAAW,MAAO;AAC/B,YAAM,wBAAwB;AAAA,QAC7B,QAAS,QAAS;AAAA,MACnB;AAGA,YAAM,yBACL,kBAAkB,SACf,sBAAuB,QAAS,GAAG,SAAS,WAC5C;AACJ,YAAM,mBACL,0BAA0B,SACvB,yBACA;AACJ,UAAK,qBAAqB,UAAa,qBAAqB,MAAO;AAClE;AAAA,MACD;AAEA,aAAO,GAAI,UAAW,IAAK;AAAA,QAC1B;AAAA,QACA;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD;AACA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,mBAAkB,EAAE,IAAI,CAAE;AAE1B,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|