@wordpress/block-library 11.0.2-next.v.202609171837.0 → 11.1.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 +12 -1
- package/build/accordion/block.json +4 -1
- package/build/accordion-item/block.json +7 -1
- package/build/accordion-panel/block.json +9 -1
- package/build/archives/block.json +9 -0
- package/build/audio/block.json +8 -0
- package/build/breadcrumbs/block.json +3 -0
- package/build/breadcrumbs/edit.cjs.map +3 -3
- package/build/buttons/block.json +9 -0
- package/build/categories/block.json +12 -1
- package/build/code/block.json +9 -0
- package/build/column/block.json +9 -0
- package/build/columns/block.json +9 -0
- package/build/comment-author-name/block.json +3 -0
- package/build/comment-content/block.json +5 -0
- package/build/comment-date/block.json +3 -0
- package/build/comment-edit-link/block.json +3 -0
- package/build/comment-reply-link/block.json +3 -0
- package/build/comments/block.json +10 -0
- package/build/comments-pagination/block.json +3 -0
- package/build/comments-pagination-next/block.json +3 -0
- package/build/comments-pagination-numbers/block.json +3 -0
- package/build/comments-pagination-previous/block.json +6 -0
- package/build/comments-title/block.json +3 -0
- package/build/cover/edit/index.cjs +4 -1
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +52 -13
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/details/block.json +11 -0
- package/build/file/block.json +9 -0
- package/build/footnotes/block.json +9 -0
- package/build/gallery/block.json +9 -0
- package/build/gallery/edit.cjs +1 -2
- package/build/gallery/edit.cjs.map +2 -2
- package/build/group/block.json +1 -0
- package/build/heading/block.json +9 -0
- package/build/home-link/block.json +18 -0
- package/build/home-link/edit.cjs.map +3 -3
- package/build/image/image.cjs +10 -8
- package/build/image/image.cjs.map +3 -3
- package/build/image/use-open-image-media-editor-modal.cjs +20 -0
- package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
- package/build/latest-comments/block.json +10 -0
- package/build/latest-posts/block.json +10 -0
- package/build/loginout/block.json +10 -0
- package/build/math/block.json +10 -0
- package/build/media-text/block.json +1 -0
- package/build/navigation/edit/index.cjs +1 -4
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation-link/link-ui/page-creator.cjs.map +3 -3
- package/build/navigation-link/shared/controls.cjs.map +3 -3
- package/build/navigation-link/shared/use-link-preview.cjs +13 -13
- package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
- package/build/navigation-overlay-close/block.json +7 -0
- package/build/navigation-submenu/block.json +6 -0
- package/build/navigation-submenu/edit.cjs +9 -1
- package/build/navigation-submenu/edit.cjs.map +3 -3
- package/build/page-list/block.json +10 -0
- package/build/paragraph/edit.cjs +1 -2
- package/build/paragraph/edit.cjs.map +2 -2
- package/build/playlist/block.json +1 -0
- package/build/post-author-biography/block.json +4 -0
- package/build/post-author-name/block.json +5 -0
- package/build/post-comments-count/block.json +3 -0
- package/build/post-comments-form/block.json +10 -0
- package/build/post-content/block.json +2 -0
- package/build/post-date/block.json +3 -0
- package/build/post-excerpt/block.json +5 -0
- package/build/post-featured-image/edit.cjs +11 -9
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-navigation-link/block.json +30 -0
- package/build/post-navigation-link/edit.cjs +13 -2
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-template/block.json +13 -1
- package/build/post-terms/block.json +6 -0
- package/build/post-time-to-read/block.json +6 -0
- package/build/post-title/block.json +10 -0
- package/build/preformatted/block.json +7 -0
- package/build/pullquote/block.json +1 -0
- package/build/query-no-results/block.json +10 -2
- package/build/query-pagination/block.json +3 -0
- package/build/query-pagination-next/block.json +3 -0
- package/build/query-pagination-numbers/block.json +3 -0
- package/build/query-pagination-previous/block.json +3 -0
- package/build/query-title/block.json +3 -0
- package/build/query-total/block.json +6 -0
- package/build/quote/block.json +1 -0
- package/build/read-more/block.json +6 -0
- package/build/rss/block.json +6 -0
- package/build/site-tagline/block.json +8 -1
- package/build/site-title/block.json +7 -1
- package/build/social-links/block.json +3 -0
- package/build/social-links/edit.cjs +2 -3
- package/build/social-links/edit.cjs.map +2 -2
- package/build/tab-panel/block.json +25 -0
- package/build/tab-panel/controls.cjs.map +3 -3
- package/build/tab-panels/block.json +18 -1
- package/build/table-of-contents/block.json +7 -0
- package/build/tabs/block.json +24 -1
- package/build/tag-cloud/block.json +19 -0
- package/build/template-part/edit/selection-modal.cjs.map +1 -1
- package/build/term-count/block.json +7 -0
- package/build/term-description/block.json +9 -0
- package/build/term-name/block.json +10 -0
- package/build/term-template/block.json +10 -1
- package/build/utils/search-patterns.cjs +7 -43
- package/build/utils/search-patterns.cjs.map +3 -3
- package/build/utils/style-state.cjs +4 -6
- package/build/utils/style-state.cjs.map +2 -2
- package/build/video/block.json +6 -0
- package/build/video/edit.cjs +23 -15
- package/build/video/edit.cjs.map +3 -3
- package/build/video/index.cjs +0 -2
- package/build/video/index.cjs.map +3 -3
- package/build/video/save.cjs +5 -1
- package/build/video/save.cjs.map +3 -3
- package/build-module/accordion/block.json +4 -1
- package/build-module/accordion-item/block.json +7 -1
- package/build-module/accordion-panel/block.json +9 -1
- package/build-module/archives/block.json +9 -0
- package/build-module/audio/block.json +8 -0
- package/build-module/breadcrumbs/block.json +3 -0
- package/build-module/breadcrumbs/edit.mjs +3 -3
- package/build-module/breadcrumbs/edit.mjs.map +2 -2
- package/build-module/buttons/block.json +9 -0
- package/build-module/categories/block.json +12 -1
- package/build-module/code/block.json +9 -0
- package/build-module/column/block.json +9 -0
- package/build-module/columns/block.json +9 -0
- package/build-module/comment-author-name/block.json +3 -0
- package/build-module/comment-content/block.json +5 -0
- package/build-module/comment-date/block.json +3 -0
- package/build-module/comment-edit-link/block.json +3 -0
- package/build-module/comment-reply-link/block.json +3 -0
- package/build-module/comments/block.json +10 -0
- package/build-module/comments-pagination/block.json +3 -0
- package/build-module/comments-pagination-next/block.json +3 -0
- package/build-module/comments-pagination-numbers/block.json +3 -0
- package/build-module/comments-pagination-previous/block.json +6 -0
- package/build-module/comments-title/block.json +3 -0
- package/build-module/cover/edit/index.mjs +4 -1
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +57 -14
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/details/block.json +11 -0
- package/build-module/file/block.json +9 -0
- package/build-module/footnotes/block.json +9 -0
- package/build-module/gallery/block.json +9 -0
- package/build-module/gallery/edit.mjs +1 -2
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/group/block.json +1 -0
- package/build-module/heading/block.json +9 -0
- package/build-module/home-link/block.json +18 -0
- package/build-module/home-link/edit.mjs +2 -2
- package/build-module/home-link/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +12 -10
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs +20 -0
- package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
- package/build-module/latest-comments/block.json +10 -0
- package/build-module/latest-posts/block.json +10 -0
- package/build-module/loginout/block.json +10 -0
- package/build-module/math/block.json +10 -0
- package/build-module/media-text/block.json +1 -0
- package/build-module/navigation/edit/index.mjs +1 -4
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/page-creator.mjs +2 -2
- package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
- package/build-module/navigation-link/shared/controls.mjs +2 -2
- package/build-module/navigation-link/shared/controls.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-link-preview.mjs +13 -13
- package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
- package/build-module/navigation-overlay-close/block.json +7 -0
- package/build-module/navigation-submenu/block.json +6 -0
- package/build-module/navigation-submenu/edit.mjs +11 -2
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/page-list/block.json +10 -0
- package/build-module/paragraph/edit.mjs +1 -2
- package/build-module/paragraph/edit.mjs.map +2 -2
- package/build-module/playlist/block.json +1 -0
- package/build-module/post-author-biography/block.json +4 -0
- package/build-module/post-author-name/block.json +5 -0
- package/build-module/post-comments-count/block.json +3 -0
- package/build-module/post-comments-form/block.json +10 -0
- package/build-module/post-content/block.json +2 -0
- package/build-module/post-date/block.json +3 -0
- package/build-module/post-excerpt/block.json +5 -0
- package/build-module/post-featured-image/edit.mjs +11 -9
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/block.json +30 -0
- package/build-module/post-navigation-link/edit.mjs +17 -3
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-template/block.json +13 -1
- package/build-module/post-terms/block.json +6 -0
- package/build-module/post-time-to-read/block.json +6 -0
- package/build-module/post-title/block.json +10 -0
- package/build-module/preformatted/block.json +7 -0
- package/build-module/pullquote/block.json +1 -0
- package/build-module/query-no-results/block.json +10 -2
- package/build-module/query-pagination/block.json +3 -0
- package/build-module/query-pagination-next/block.json +3 -0
- package/build-module/query-pagination-numbers/block.json +3 -0
- package/build-module/query-pagination-previous/block.json +3 -0
- package/build-module/query-title/block.json +3 -0
- package/build-module/query-total/block.json +6 -0
- package/build-module/quote/block.json +1 -0
- package/build-module/read-more/block.json +6 -0
- package/build-module/rss/block.json +6 -0
- package/build-module/site-tagline/block.json +8 -1
- package/build-module/site-title/block.json +7 -1
- package/build-module/social-links/block.json +3 -0
- package/build-module/social-links/edit.mjs +2 -3
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/tab-panel/block.json +25 -0
- package/build-module/tab-panel/controls.mjs +2 -2
- package/build-module/tab-panel/controls.mjs.map +2 -2
- package/build-module/tab-panels/block.json +18 -1
- package/build-module/table-of-contents/block.json +7 -0
- package/build-module/tabs/block.json +24 -1
- package/build-module/tag-cloud/block.json +19 -0
- package/build-module/template-part/edit/selection-modal.mjs.map +1 -1
- package/build-module/term-count/block.json +7 -0
- package/build-module/term-description/block.json +9 -0
- package/build-module/term-name/block.json +10 -0
- package/build-module/term-template/block.json +10 -1
- package/build-module/utils/search-patterns.mjs +7 -32
- package/build-module/utils/search-patterns.mjs.map +2 -2
- package/build-module/utils/style-state.mjs +6 -4
- package/build-module/utils/style-state.mjs.map +2 -2
- package/build-module/video/block.json +6 -0
- package/build-module/video/edit.mjs +25 -16
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/index.mjs +0 -2
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/save.mjs +7 -2
- package/build-module/video/save.mjs.map +2 -2
- package/build-style/editor-rtl.css +12 -2
- package/build-style/editor.css +12 -2
- package/build-style/image/editor-rtl.css +6 -0
- package/build-style/image/editor.css +6 -0
- package/build-style/navigation/style-rtl.css +18 -3
- package/build-style/navigation/style.css +18 -3
- package/build-style/navigation-link/editor-rtl.css +3 -1
- package/build-style/navigation-link/editor.css +3 -1
- package/build-style/navigation-overlay-close/style-rtl.css +1 -1
- package/build-style/navigation-overlay-close/style.css +1 -1
- package/build-style/navigation-submenu/editor-rtl.css +3 -1
- package/build-style/navigation-submenu/editor.css +3 -1
- package/build-style/post-navigation-link/style-rtl.css +3 -0
- package/build-style/post-navigation-link/style.css +3 -0
- package/build-style/style-rtl.css +24 -4
- package/build-style/style.css +24 -4
- package/build-style/tab-panel/style-rtl.css +2 -0
- package/build-style/tab-panel/style.css +2 -0
- package/package.json +41 -42
- package/src/accordion/README.md +3 -0
- package/src/accordion/block.json +4 -1
- package/src/accordion-item/README.md +5 -0
- package/src/accordion-item/block.json +7 -1
- package/src/accordion-panel/README.md +7 -0
- package/src/accordion-panel/block.json +9 -1
- package/src/archives/README.md +4 -0
- package/src/archives/block.json +9 -0
- package/src/audio/README.md +4 -0
- package/src/audio/block.json +8 -0
- package/src/breadcrumbs/README.md +2 -0
- package/src/breadcrumbs/block.json +3 -0
- package/src/breadcrumbs/edit.jsx +3 -3
- package/src/breadcrumbs/index.php +1 -1
- package/src/buttons/README.md +4 -0
- package/src/buttons/block.json +9 -0
- package/src/categories/README.md +6 -0
- package/src/categories/block.json +12 -1
- package/src/code/README.md +4 -0
- package/src/code/block.json +9 -0
- package/src/column/README.md +4 -0
- package/src/column/block.json +9 -0
- package/src/columns/README.md +4 -0
- package/src/columns/block.json +9 -0
- package/src/comment-author-name/README.md +2 -0
- package/src/comment-author-name/block.json +3 -0
- package/src/comment-content/README.md +4 -0
- package/src/comment-content/block.json +5 -0
- package/src/comment-date/README.md +2 -0
- package/src/comment-date/block.json +3 -0
- package/src/comment-edit-link/README.md +2 -0
- package/src/comment-edit-link/block.json +3 -0
- package/src/comment-reply-link/README.md +2 -0
- package/src/comment-reply-link/block.json +3 -0
- package/src/comments/README.md +5 -0
- package/src/comments/block.json +10 -0
- package/src/comments-pagination/README.md +2 -0
- package/src/comments-pagination/block.json +3 -0
- package/src/comments-pagination-next/README.md +2 -0
- package/src/comments-pagination-next/block.json +3 -0
- package/src/comments-pagination-numbers/README.md +2 -0
- package/src/comments-pagination-numbers/block.json +3 -0
- package/src/comments-pagination-previous/README.md +2 -0
- package/src/comments-pagination-previous/block.json +6 -0
- package/src/comments-title/README.md +2 -0
- package/src/comments-title/block.json +3 -0
- package/src/cover/edit/index.jsx +3 -0
- package/src/cover/edit/inspector-controls.jsx +64 -13
- package/src/cover/test/edit.browser.test.js +18 -2
- package/src/details/README.md +6 -0
- package/src/details/block.json +11 -0
- package/src/file/README.md +4 -0
- package/src/file/block.json +9 -0
- package/src/footnotes/README.md +4 -0
- package/src/footnotes/block.json +9 -0
- package/src/gallery/README.md +4 -0
- package/src/gallery/block.json +9 -0
- package/src/gallery/edit.jsx +1 -2
- package/src/group/README.md +1 -0
- package/src/group/block.json +1 -0
- package/src/heading/README.md +4 -0
- package/src/heading/block.json +9 -0
- package/src/home-link/README.md +5 -0
- package/src/home-link/block.json +18 -0
- package/src/home-link/edit.jsx +2 -2
- package/src/icon/index.php +9 -0
- package/src/image/editor.scss +8 -0
- package/src/image/image.jsx +13 -11
- package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +139 -0
- package/src/image/use-open-image-media-editor-modal.js +37 -0
- package/src/latest-comments/README.md +5 -0
- package/src/latest-comments/block.json +10 -0
- package/src/latest-posts/README.md +5 -0
- package/src/latest-posts/block.json +10 -0
- package/src/loginout/README.md +5 -0
- package/src/loginout/block.json +10 -0
- package/src/math/README.md +5 -0
- package/src/math/block.json +10 -0
- package/src/media-text/README.md +1 -0
- package/src/media-text/block.json +1 -0
- package/src/navigation/edit/index.jsx +2 -4
- package/src/navigation/style.scss +40 -4
- package/src/navigation-link/editor.scss +6 -1
- package/src/navigation-link/link-ui/page-creator.jsx +2 -2
- package/src/navigation-link/shared/controls.jsx +2 -2
- package/src/navigation-link/shared/test/use-link-preview.jsdom.test.js +22 -22
- package/src/navigation-link/shared/use-link-preview.js +15 -14
- package/src/navigation-overlay-close/README.md +1 -0
- package/src/navigation-overlay-close/block.json +7 -0
- package/src/navigation-overlay-close/style.scss +1 -1
- package/src/navigation-submenu/README.md +7 -0
- package/src/navigation-submenu/block.json +6 -0
- package/src/navigation-submenu/edit.jsx +11 -1
- package/src/navigation-submenu/editor.scss +6 -1
- package/src/navigation-submenu/index.php +11 -0
- package/src/page-list/README.md +5 -0
- package/src/page-list/block.json +10 -0
- package/src/paragraph/edit.jsx +1 -3
- package/src/playlist/README.md +1 -0
- package/src/playlist/block.json +1 -0
- package/src/post-author-biography/README.md +3 -0
- package/src/post-author-biography/block.json +4 -0
- package/src/post-author-name/README.md +4 -0
- package/src/post-author-name/block.json +5 -0
- package/src/post-comments-count/README.md +2 -0
- package/src/post-comments-count/block.json +3 -0
- package/src/post-comments-form/README.md +5 -0
- package/src/post-comments-form/block.json +10 -0
- package/src/post-content/README.md +2 -0
- package/src/post-content/block.json +2 -0
- package/src/post-date/README.md +2 -0
- package/src/post-date/block.json +3 -0
- package/src/post-excerpt/README.md +4 -0
- package/src/post-excerpt/block.json +5 -0
- package/src/post-featured-image/edit.jsx +11 -9
- package/src/post-navigation-link/README.md +12 -0
- package/src/post-navigation-link/block.json +30 -0
- package/src/post-navigation-link/edit.jsx +23 -2
- package/src/post-navigation-link/index.php +94 -5
- package/src/post-navigation-link/style.scss +2 -0
- package/src/post-template/README.md +7 -0
- package/src/post-template/block.json +13 -1
- package/src/post-terms/README.md +5 -0
- package/src/post-terms/block.json +6 -0
- package/src/post-time-to-read/README.md +5 -0
- package/src/post-time-to-read/block.json +6 -0
- package/src/post-title/README.md +5 -0
- package/src/post-title/block.json +10 -0
- package/src/preformatted/README.md +6 -0
- package/src/preformatted/block.json +7 -0
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +1 -0
- package/src/query-no-results/README.md +7 -0
- package/src/query-no-results/block.json +10 -2
- package/src/query-pagination/README.md +2 -0
- package/src/query-pagination/block.json +3 -0
- package/src/query-pagination-next/README.md +2 -0
- package/src/query-pagination-next/block.json +3 -0
- package/src/query-pagination-numbers/README.md +2 -0
- package/src/query-pagination-numbers/block.json +3 -0
- package/src/query-pagination-previous/README.md +2 -0
- package/src/query-pagination-previous/block.json +3 -0
- package/src/query-title/README.md +2 -0
- package/src/query-title/block.json +3 -0
- package/src/query-total/README.md +5 -0
- package/src/query-total/block.json +6 -0
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +1 -0
- package/src/read-more/README.md +5 -0
- package/src/read-more/block.json +6 -0
- package/src/rss/README.md +5 -0
- package/src/rss/block.json +6 -0
- package/src/site-tagline/README.md +6 -0
- package/src/site-tagline/block.json +8 -1
- package/src/site-title/README.md +5 -0
- package/src/site-title/block.json +7 -1
- package/src/social-links/README.md +2 -0
- package/src/social-links/block.json +3 -0
- package/src/social-links/edit.jsx +2 -3
- package/src/tab-panel/README.md +9 -0
- package/src/tab-panel/block.json +25 -0
- package/src/tab-panel/controls.jsx +2 -2
- package/src/tab-panel/style.scss +5 -2
- package/src/tab-panels/README.md +7 -0
- package/src/tab-panels/block.json +18 -1
- package/src/table-of-contents/README.md +6 -0
- package/src/table-of-contents/block.json +7 -0
- package/src/tabs/README.md +9 -0
- package/src/tabs/block.json +24 -1
- package/src/tag-cloud/README.md +9 -0
- package/src/tag-cloud/block.json +19 -0
- package/src/template-part/edit/selection-modal.jsx +1 -1
- package/src/term-count/README.md +6 -0
- package/src/term-count/block.json +7 -0
- package/src/term-description/README.md +5 -0
- package/src/term-description/block.json +9 -0
- package/src/term-name/README.md +5 -0
- package/src/term-name/block.json +10 -0
- package/src/term-name/index.php +1 -1
- package/src/term-template/README.md +5 -0
- package/src/term-template/block.json +10 -1
- package/src/utils/search-patterns.js +9 -53
- package/src/utils/style-state.js +6 -4
- package/src/utils/test/{search-patterns.js → search-patterns.jsdom.test.js} +1 -22
- package/src/video/README.md +7 -0
- package/src/video/block.json +6 -0
- package/src/video/edit.jsx +56 -51
- package/src/video/index.js +0 -2
- package/src/video/save.jsx +10 -1
- package/build/video/variations.cjs +0 -75
- package/build/video/variations.cjs.map +0 -7
- package/build-module/video/variations.mjs +0 -50
- package/build-module/video/variations.mjs.map +0 -7
- package/src/video/test/variations.js +0 -63
- package/src/video/variations.js +0 -62
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/block-library/src/video/variations.js
|
|
21
|
-
var variations_exports = {};
|
|
22
|
-
__export(variations_exports, {
|
|
23
|
-
default: () => variations_default,
|
|
24
|
-
isGifVariation: () => isGifVariation
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(variations_exports);
|
|
27
|
-
var import_i18n = require("@wordpress/i18n");
|
|
28
|
-
var import_icons = require("@wordpress/icons");
|
|
29
|
-
var isGifVariation = ({
|
|
30
|
-
controls,
|
|
31
|
-
loop,
|
|
32
|
-
autoplay,
|
|
33
|
-
muted,
|
|
34
|
-
playsInline
|
|
35
|
-
} = {}) => !controls && !!loop && !!autoplay && !!muted && !!playsInline;
|
|
36
|
-
var variations = [
|
|
37
|
-
{
|
|
38
|
-
name: "video",
|
|
39
|
-
title: (0, import_i18n.__)("Video"),
|
|
40
|
-
description: (0, import_i18n.__)(
|
|
41
|
-
"A video with customizable playback and interaction controls."
|
|
42
|
-
),
|
|
43
|
-
icon: import_icons.video,
|
|
44
|
-
attributes: { controls: true },
|
|
45
|
-
isActive: (blockAttributes) => !isGifVariation(blockAttributes),
|
|
46
|
-
// Not offered in the inserter; used to label a regular video and to
|
|
47
|
-
// switch a GIF back to a standard video.
|
|
48
|
-
scope: ["block", "transform"]
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "gif",
|
|
52
|
-
title: (0, import_i18n.__)("GIF"),
|
|
53
|
-
description: (0, import_i18n.__)(
|
|
54
|
-
"A muted, looping video that plays automatically like an animated GIF."
|
|
55
|
-
),
|
|
56
|
-
icon: import_icons.video,
|
|
57
|
-
keywords: [(0, import_i18n.__)("animated"), "gif"],
|
|
58
|
-
attributes: {
|
|
59
|
-
controls: false,
|
|
60
|
-
loop: true,
|
|
61
|
-
autoplay: true,
|
|
62
|
-
muted: true,
|
|
63
|
-
playsInline: true
|
|
64
|
-
},
|
|
65
|
-
isActive: (blockAttributes) => isGifVariation(blockAttributes),
|
|
66
|
-
// Created by converting an uploaded GIF, not inserted directly.
|
|
67
|
-
scope: ["block", "transform"]
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
var variations_default = variations;
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
isGifVariation
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=variations.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/video/variations.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } 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'A video with customizable playback and interaction controls.'\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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAmC;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,WAAO,gBAAI,OAAQ;AAAA,IACnB,iBAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM,aAAAA;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,WAAO,gBAAI,KAAM;AAAA,IACjB,iBAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM,aAAAA;AAAA,IACN,UAAU,KAAE,gBAAI,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": ["videoIcon"]
|
|
7
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
"A video with customizable playback and interaction controls."
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/video/variations.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } 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'A video with customizable playback and interaction controls.'\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": ";AAAA,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
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import variations, { isGifVariation } from '../variations';
|
|
3
|
-
|
|
4
|
-
const GIF_ATTRIBUTES = {
|
|
5
|
-
controls: false,
|
|
6
|
-
loop: true,
|
|
7
|
-
autoplay: true,
|
|
8
|
-
muted: true,
|
|
9
|
-
playsInline: true,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
describe( 'isGifVariation', () => {
|
|
13
|
-
it( 'matches a muted, looping, autoplaying, inline video without controls', () => {
|
|
14
|
-
expect( isGifVariation( GIF_ATTRIBUTES ) ).toBe( true );
|
|
15
|
-
} );
|
|
16
|
-
|
|
17
|
-
it( 'does not match when controls are shown', () => {
|
|
18
|
-
expect( isGifVariation( { ...GIF_ATTRIBUTES, controls: true } ) ).toBe(
|
|
19
|
-
false
|
|
20
|
-
);
|
|
21
|
-
} );
|
|
22
|
-
|
|
23
|
-
it.each( [ 'loop', 'autoplay', 'muted', 'playsInline' ] )(
|
|
24
|
-
'does not match when %s is missing',
|
|
25
|
-
( attribute ) => {
|
|
26
|
-
expect(
|
|
27
|
-
isGifVariation( { ...GIF_ATTRIBUTES, [ attribute ]: false } )
|
|
28
|
-
).toBe( false );
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
it( 'does not match a default video block', () => {
|
|
33
|
-
expect( isGifVariation( { controls: true } ) ).toBe( false );
|
|
34
|
-
} );
|
|
35
|
-
|
|
36
|
-
it( 'handles missing attributes', () => {
|
|
37
|
-
expect( isGifVariation() ).toBe( false );
|
|
38
|
-
expect( isGifVariation( {} ) ).toBe( false );
|
|
39
|
-
} );
|
|
40
|
-
} );
|
|
41
|
-
|
|
42
|
-
describe( 'video variations', () => {
|
|
43
|
-
it( 'registers exactly one active variation for any attributes', () => {
|
|
44
|
-
const active = variations.filter( ( variation ) =>
|
|
45
|
-
variation.isActive( GIF_ATTRIBUTES )
|
|
46
|
-
);
|
|
47
|
-
expect( active ).toHaveLength( 1 );
|
|
48
|
-
expect( active[ 0 ].name ).toBe( 'gif' );
|
|
49
|
-
|
|
50
|
-
const activeForVideo = variations.filter( ( variation ) =>
|
|
51
|
-
variation.isActive( { controls: true } )
|
|
52
|
-
);
|
|
53
|
-
expect( activeForVideo ).toHaveLength( 1 );
|
|
54
|
-
expect( activeForVideo[ 0 ].name ).toBe( 'video' );
|
|
55
|
-
} );
|
|
56
|
-
|
|
57
|
-
it( 'keeps the GIF variation out of the inserter', () => {
|
|
58
|
-
const gif = variations.find(
|
|
59
|
-
( variation ) => variation.name === 'gif'
|
|
60
|
-
);
|
|
61
|
-
expect( gif.scope ).not.toContain( 'inserter' );
|
|
62
|
-
} );
|
|
63
|
-
} );
|
package/src/video/variations.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import { video as videoIcon } from '@wordpress/icons';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Whether a set of Video block attributes describes a GIF-behaving video: a
|
|
6
|
-
* muted, looping, autoplaying, inline video with no controls. An animated GIF
|
|
7
|
-
* uploaded through the editor is converted to a video and presented with these
|
|
8
|
-
* attributes so it plays like the original GIF.
|
|
9
|
-
*
|
|
10
|
-
* @param {Object} attributes Video block attributes.
|
|
11
|
-
* @param {boolean} attributes.controls Whether playback controls are shown.
|
|
12
|
-
* @param {boolean} attributes.loop Whether the video loops.
|
|
13
|
-
* @param {boolean} attributes.autoplay Whether the video autoplays.
|
|
14
|
-
* @param {boolean} attributes.muted Whether the video is muted.
|
|
15
|
-
* @param {boolean} attributes.playsInline Whether the video plays inline.
|
|
16
|
-
*
|
|
17
|
-
* @return {boolean} Whether the attributes describe a GIF-behaving video.
|
|
18
|
-
*/
|
|
19
|
-
export const isGifVariation = ( {
|
|
20
|
-
controls,
|
|
21
|
-
loop,
|
|
22
|
-
autoplay,
|
|
23
|
-
muted,
|
|
24
|
-
playsInline,
|
|
25
|
-
} = {} ) => ! controls && !! loop && !! autoplay && !! muted && !! playsInline;
|
|
26
|
-
|
|
27
|
-
const variations = [
|
|
28
|
-
{
|
|
29
|
-
name: 'video',
|
|
30
|
-
title: __( 'Video' ),
|
|
31
|
-
description: __(
|
|
32
|
-
'A video with customizable playback and interaction controls.'
|
|
33
|
-
),
|
|
34
|
-
icon: videoIcon,
|
|
35
|
-
attributes: { controls: true },
|
|
36
|
-
isActive: ( blockAttributes ) => ! isGifVariation( blockAttributes ),
|
|
37
|
-
// Not offered in the inserter; used to label a regular video and to
|
|
38
|
-
// switch a GIF back to a standard video.
|
|
39
|
-
scope: [ 'block', 'transform' ],
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'gif',
|
|
43
|
-
title: __( 'GIF' ),
|
|
44
|
-
description: __(
|
|
45
|
-
'A muted, looping video that plays automatically like an animated GIF.'
|
|
46
|
-
),
|
|
47
|
-
icon: videoIcon,
|
|
48
|
-
keywords: [ __( 'animated' ), 'gif' ],
|
|
49
|
-
attributes: {
|
|
50
|
-
controls: false,
|
|
51
|
-
loop: true,
|
|
52
|
-
autoplay: true,
|
|
53
|
-
muted: true,
|
|
54
|
-
playsInline: true,
|
|
55
|
-
},
|
|
56
|
-
isActive: ( blockAttributes ) => isGifVariation( blockAttributes ),
|
|
57
|
-
// Created by converting an uploaded GIF, not inserted directly.
|
|
58
|
-
scope: [ 'block', 'transform' ],
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
export default variations;
|