@wordpress/block-library 11.0.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 +29 -0
- package/README.md +7 -7
- 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/archives/edit.cjs.map +3 -3
- package/build/audio/block.json +8 -0
- package/build/audio/edit.cjs.map +3 -3
- package/build/avatar/hooks.cjs.map +2 -2
- package/build/breadcrumbs/block.json +3 -0
- package/build/breadcrumbs/edit.cjs.map +3 -3
- package/build/button/edit.cjs.map +2 -2
- package/build/buttons/block.json +9 -0
- package/build/categories/block.json +12 -1
- package/build/categories/edit.cjs.map +3 -3
- package/build/code/block.json +10 -0
- package/build/code/save.cjs.map +2 -2
- 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/comment-template/hooks.cjs.map +2 -2
- 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/cover/transforms.cjs.map +2 -2
- package/build/details/block.json +12 -0
- package/build/details/index.cjs.map +2 -2
- package/build/embed/embed-controls.cjs.map +2 -2
- package/build/file/block.json +9 -0
- 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 +10 -0
- package/build/footnotes/edit.cjs.map +2 -2
- package/build/gallery/block.json +9 -0
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +65 -39
- 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/group/block.json +1 -0
- package/build/heading/block.json +11 -0
- package/build/heading/index.cjs.map +2 -2
- package/build/home-link/block.json +18 -0
- package/build/home-link/edit.cjs.map +3 -3
- 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 +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/index.cjs.map +2 -2
- package/build/latest-comments/block.json +10 -0
- package/build/latest-comments/edit.cjs.map +3 -3
- package/build/latest-posts/block.json +10 -0
- 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/loginout/block.json +10 -0
- package/build/math/block.json +12 -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/block.json +1 -0
- 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 +1 -4
- 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/link-ui/page-creator.cjs.map +3 -3
- package/build/navigation-link/shared/controls.cjs.map +3 -3
- package/build/navigation-link/shared/invalid-draft-display.cjs.map +2 -2
- 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/block.json +1 -0
- package/build/paragraph/edit.cjs +1 -2
- 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/block.json +1 -0
- 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-biography/block.json +4 -0
- package/build/post-author-name/block.json +5 -0
- package/build/post-author-name/edit.cjs.map +2 -2
- package/build/post-comments-count/block.json +3 -0
- package/build/post-comments-form/block.json +10 -0
- package/build/post-content/block.json +3 -0
- package/build/post-date/block.json +3 -0
- package/build/post-date/edit.cjs.map +2 -2
- package/build/post-excerpt/block.json +6 -0
- package/build/post-excerpt/edit.cjs.map +2 -2
- 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-time-to-read/edit.cjs.map +2 -2
- package/build/post-title/block.json +10 -0
- package/build/preformatted/block.json +7 -0
- package/build/pullquote/block.json +1 -0
- 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-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-title/use-archive-label.cjs.map +2 -2
- package/build/query-total/block.json +6 -0
- package/build/quote/block.json +1 -0
- package/build/quote/deprecated.cjs.map +2 -2
- package/build/quote/transforms.cjs.map +2 -2
- package/build/read-more/block.json +6 -0
- package/build/rss/block.json +6 -0
- package/build/search/edit.cjs.map +3 -3
- package/build/separator/edit.cjs.map +3 -3
- 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 +3 -3
- 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/state.cjs.map +2 -2
- package/build/table-of-contents/block.json +7 -0
- package/build/table-of-contents/edit.cjs.map +3 -3
- package/build/table-of-contents/utils.cjs.map +2 -2
- package/build/tabs/block.json +24 -1
- package/build/tabs/use-tab-actions.cjs.map +2 -2
- package/build/tag-cloud/block.json +19 -0
- 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/template-part/edit/selection-modal.cjs.map +1 -1
- package/build/term-count/block.json +7 -0
- package/build/term-count/use-term-count.cjs.map +2 -2
- package/build/term-description/block.json +9 -0
- package/build/term-description/use-term-description.cjs.map +2 -2
- package/build/term-name/block.json +10 -0
- package/build/term-name/use-term-name.cjs.map +2 -2
- package/build/term-template/block.json +10 -1
- 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/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/verse/block.json +1 -0
- package/build/video/block.json +6 -0
- package/build/video/edit-common-settings.cjs.map +3 -3
- 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/video/tracks-editor.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/archives/edit.mjs +2 -2
- package/build-module/archives/edit.mjs.map +2 -2
- package/build-module/audio/block.json +8 -0
- 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/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/button/edit.mjs.map +2 -2
- package/build-module/buttons/block.json +9 -0
- package/build-module/categories/block.json +12 -1
- package/build-module/categories/edit.mjs +2 -2
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/code/block.json +10 -0
- package/build-module/code/save.mjs.map +2 -2
- 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/comment-template/hooks.mjs.map +2 -2
- 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/cover/transforms.mjs.map +2 -2
- package/build-module/details/block.json +12 -0
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/embed/embed-controls.mjs.map +2 -2
- package/build-module/file/block.json +9 -0
- 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 +10 -0
- package/build-module/footnotes/edit.mjs.map +2 -2
- package/build-module/gallery/block.json +9 -0
- 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 +68 -42
- 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/group/block.json +1 -0
- package/build-module/heading/block.json +11 -0
- package/build-module/heading/index.mjs.map +2 -2
- 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/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 +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/index.mjs.map +2 -2
- package/build-module/latest-comments/block.json +10 -0
- package/build-module/latest-comments/edit.mjs +2 -2
- package/build-module/latest-comments/edit.mjs.map +2 -2
- package/build-module/latest-posts/block.json +10 -0
- 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/loginout/block.json +10 -0
- package/build-module/math/block.json +12 -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/block.json +1 -0
- 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 +1 -4
- 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/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/invalid-draft-display.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/block.json +1 -0
- package/build-module/paragraph/edit.mjs +1 -2
- 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/block.json +1 -0
- 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-biography/block.json +4 -0
- package/build-module/post-author-name/block.json +5 -0
- package/build-module/post-author-name/edit.mjs.map +2 -2
- 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 +3 -0
- package/build-module/post-date/block.json +3 -0
- package/build-module/post-date/edit.mjs.map +2 -2
- package/build-module/post-excerpt/block.json +6 -0
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- 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 +19 -5
- 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-time-to-read/edit.mjs.map +2 -2
- 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/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-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-title/use-archive-label.mjs.map +2 -2
- package/build-module/query-total/block.json +6 -0
- package/build-module/quote/block.json +1 -0
- package/build-module/quote/deprecated.mjs.map +2 -2
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/read-more/block.json +6 -0
- package/build-module/rss/block.json +6 -0
- 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/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 +4 -5
- 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/state.mjs.map +2 -2
- package/build-module/table-of-contents/block.json +7 -0
- 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/block.json +24 -1
- package/build-module/tabs/use-tab-actions.mjs.map +2 -2
- package/build-module/tag-cloud/block.json +19 -0
- 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/template-part/edit/selection-modal.mjs.map +1 -1
- package/build-module/term-count/block.json +7 -0
- package/build-module/term-count/use-term-count.mjs.map +2 -2
- package/build-module/term-description/block.json +9 -0
- package/build-module/term-description/use-term-description.mjs.map +2 -2
- package/build-module/term-name/block.json +10 -0
- package/build-module/term-name/use-term-name.mjs.map +2 -2
- package/build-module/term-template/block.json +10 -1
- 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/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/verse/block.json +1 -0
- package/build-module/video/block.json +6 -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/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-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 +21 -7
- package/build-style/editor.css +21 -7
- 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/editor-rtl.css +6 -0
- package/build-style/image/editor.css +6 -0
- 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 +19 -4
- package/build-style/navigation/style.css +19 -4
- 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/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 +47 -23
- package/build-style/style.css +47 -23
- package/build-style/tab-panel/style-rtl.css +2 -0
- package/build-style/tab-panel/style.css +2 -0
- 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 +42 -43
- 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/archives/edit.jsx +2 -2
- package/src/audio/README.md +4 -0
- package/src/audio/block.json +8 -0
- package/src/audio/edit.jsx +2 -2
- package/src/avatar/hooks.js +2 -2
- 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/button/edit.jsx +1 -1
- package/src/button/style.scss +2 -2
- package/src/buttons/README.md +4 -0
- package/src/buttons/block.json +9 -0
- package/src/calendar/index.php +1 -1
- package/src/categories/README.md +6 -0
- package/src/categories/block.json +12 -1
- package/src/categories/edit.jsx +2 -2
- package/src/code/README.md +5 -0
- package/src/code/block.json +10 -0
- package/src/code/save.jsx +1 -1
- 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/columns/style.scss +2 -3
- 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/comment-template/hooks.js +1 -1
- package/src/comments/README.md +5 -0
- package/src/comments/block.json +10 -0
- package/src/comments/style.scss +1 -1
- 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/common.scss +1 -2
- package/src/cover/edit/index.jsx +5 -2
- package/src/cover/edit/inspector-controls.jsx +66 -15
- package/src/cover/style.scss +10 -0
- package/src/cover/test/{edit.jsdom.test.js → edit.browser.test.js} +122 -147
- package/src/cover/transforms.js +3 -3
- package/src/details/README.md +7 -0
- package/src/details/block.json +12 -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/README.md +4 -0
- package/src/file/block.json +9 -0
- 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 +5 -0
- package/src/footnotes/block.json +10 -0
- package/src/footnotes/edit.jsx +1 -1
- package/src/gallery/README.md +4 -0
- package/src/gallery/block.json +9 -0
- package/src/gallery/dynamic-gallery.jsx +4 -4
- package/src/gallery/edit.jsx +122 -70
- 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/group/README.md +1 -0
- package/src/group/block.json +1 -0
- package/src/heading/README.md +6 -0
- package/src/heading/block.json +11 -0
- package/src/heading/index.js +2 -2
- 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/html/modal.jsx +0 -3
- package/src/icon/index.php +9 -0
- package/src/image/edit.jsx +1 -1
- package/src/image/editor.scss +8 -0
- package/src/image/image.jsx +20 -18
- 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 +140 -1
- package/src/image/use-open-image-media-editor-modal.js +37 -0
- package/src/index.jsx +1 -1
- package/src/latest-comments/README.md +5 -0
- package/src/latest-comments/block.json +10 -0
- package/src/latest-comments/edit.jsx +2 -2
- package/src/latest-posts/README.md +5 -0
- package/src/latest-posts/block.json +10 -0
- 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/loginout/README.md +5 -0
- package/src/loginout/block.json +10 -0
- package/src/math/README.md +7 -2
- package/src/math/block.json +12 -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/README.md +1 -0
- package/src/media-text/block.json +1 -0
- 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 +3 -5
- 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 +41 -5
- 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/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/invalid-draft-display.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-link/test/__snapshots__/hooks.jsdom.test.js.snap +41 -11
- 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 +12 -2
- 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/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/edit.jsx +2 -4
- package/src/paragraph/index.js +7 -0
- package/src/pattern/index.php +2 -2
- package/src/playlist/README.md +1 -0
- package/src/playlist/block.json +1 -0
- 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-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-author-name/edit.jsx +1 -1
- 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 +3 -0
- package/src/post-content/block.json +3 -0
- package/src/post-date/README.md +2 -0
- package/src/post-date/block.json +3 -0
- package/src/post-date/edit.jsx +2 -2
- package/src/post-excerpt/README.md +5 -0
- package/src/post-excerpt/block.json +6 -0
- package/src/post-excerpt/edit.jsx +1 -1
- package/src/post-featured-image/edit.jsx +13 -11
- 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 +27 -6
- 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-time-to-read/edit.jsx +2 -2
- package/src/post-title/README.md +5 -0
- package/src/post-title/block.json +10 -0
- package/src/post-title/style.scss +2 -3
- 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/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-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/editor.scss +0 -3
- 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-title/use-archive-label.js +1 -1
- 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/quote/deprecated.jsx +2 -2
- package/src/quote/transforms.js +3 -3
- 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/search/edit.jsx +6 -6
- package/src/search/theme.scss +1 -1
- package/src/separator/edit.jsx +7 -4
- 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 +4 -5
- 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/state.js +1 -1
- package/src/table-of-contents/README.md +6 -0
- package/src/table-of-contents/block.json +7 -0
- package/src/table-of-contents/edit.jsx +6 -6
- package/src/table-of-contents/utils.ts +2 -2
- package/src/tabs/README.md +9 -0
- package/src/tabs/block.json +24 -1
- package/src/tabs/use-tab-actions.js +1 -1
- package/src/tag-cloud/README.md +9 -0
- package/src/tag-cloud/block.json +19 -0
- 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/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-count/use-term-count.js +1 -1
- package/src/term-description/README.md +5 -0
- package/src/term-description/block.json +9 -0
- package/src/term-description/use-term-description.js +1 -1
- 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-name/use-term-name.js +1 -1
- package/src/term-template/README.md +5 -0
- package/src/term-template/block.json +10 -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/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/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/README.md +7 -0
- package/src/video/block.json +6 -0
- package/src/video/edit-common-settings.jsx +3 -3
- package/src/video/edit.jsx +56 -51
- package/src/video/index.js +0 -2
- package/src/video/save.jsx +10 -1
- package/src/video/tracks-editor.jsx +2 -2
- package/build/gallery/flex-styles.cjs.map +0 -7
- package/build/video/variations.cjs +0 -75
- package/build/video/variations.cjs.map +0 -7
- package/build-module/gallery/flex-styles.mjs.map +0 -7
- package/build-module/video/variations.mjs +0 -50
- package/build-module/video/variations.mjs.map +0 -7
- package/src/gallery/flex-styles.js +0 -99
- package/src/video/test/variations.js +0 -63
- package/src/video/variations.js +0 -62
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { screen,
|
|
4
|
-
import
|
|
1
|
+
import { beforeEach, describe, expect, test } from 'vitest';
|
|
2
|
+
import { userEvent } from 'vitest/browser';
|
|
3
|
+
import { screen, act, within, waitFor } from '@testing-library/react';
|
|
4
|
+
import { createBlock } from '@wordpress/blocks';
|
|
5
5
|
import {
|
|
6
6
|
initializeEditor,
|
|
7
7
|
selectBlock,
|
|
8
8
|
} from '@wordpress/integration-tests/helpers/integration-test-editor';
|
|
9
|
-
|
|
10
|
-
globalThis.wpVitest.mockCSSSupports();
|
|
11
|
-
globalThis.wpVitest.mockResizeObserver();
|
|
12
|
-
globalThis.wpVitest.mockVisibleElements();
|
|
13
|
-
|
|
9
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
14
10
|
const defaultSettings = {
|
|
15
11
|
__experimentalFeatures: {
|
|
16
12
|
color: {
|
|
@@ -38,63 +34,26 @@ const disabledColorSettings = {
|
|
|
38
34
|
disableCustomGradients: true,
|
|
39
35
|
};
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* In a browser, Ariakit normalizes the matrix's roving tabindex in a
|
|
46
|
-
* `requestAnimationFrame` before `useFocusOnMount`'s `setTimeout( 0 )` focuses
|
|
47
|
-
* the active (center) cell, so opening the dropdown leaves the content position
|
|
48
|
-
* untouched. JSDOM implements `requestAnimationFrame` as a ~16ms timer, which
|
|
49
|
-
* inverts the ordering and would otherwise focus and select the first DOM cell.
|
|
50
|
-
*
|
|
51
|
-
* @param {() => ( Promise< unknown > | unknown )} callback
|
|
52
|
-
* @return {Promise< unknown >} Resolves with the callback's return value.
|
|
53
|
-
*/
|
|
54
|
-
async function withAnimationFramesBeforeTimers( callback ) {
|
|
55
|
-
const originalRequestAnimationFrame = global.requestAnimationFrame;
|
|
56
|
-
|
|
57
|
-
let flushing = false;
|
|
58
|
-
global.requestAnimationFrame = ( frameCallback ) => {
|
|
59
|
-
// Frames scheduled while flushing fall back to the real implementation
|
|
60
|
-
// so self-rescheduling loops (e.g. Popover's Floating UI `autoUpdate`)
|
|
61
|
-
// don't spin forever on the microtask queue.
|
|
62
|
-
if ( flushing ) {
|
|
63
|
-
return originalRequestAnimationFrame( frameCallback );
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
queueMicrotask( () => {
|
|
67
|
-
flushing = true;
|
|
68
|
-
try {
|
|
69
|
-
frameCallback( performance.now() );
|
|
70
|
-
} finally {
|
|
71
|
-
flushing = false;
|
|
72
|
-
}
|
|
73
|
-
} );
|
|
74
|
-
|
|
75
|
-
return 0;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
try {
|
|
79
|
-
return await callback();
|
|
80
|
-
} finally {
|
|
81
|
-
global.requestAnimationFrame = originalRequestAnimationFrame;
|
|
82
|
-
}
|
|
37
|
+
async function setup( attributes, customSettings, innerBlocks = [] ) {
|
|
38
|
+
const testBlock = { name: 'core/cover', attributes, innerBlocks };
|
|
39
|
+
const settings = customSettings || defaultSettings;
|
|
40
|
+
return initializeEditor( testBlock, false, settings );
|
|
83
41
|
}
|
|
84
42
|
|
|
85
|
-
async function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
43
|
+
async function activateWithKeyboard( element ) {
|
|
44
|
+
act( () => element.focus() );
|
|
45
|
+
expect( element ).toHaveFocus();
|
|
46
|
+
await userEvent.keyboard( '{Enter}' );
|
|
89
47
|
}
|
|
90
48
|
|
|
91
49
|
async function createAndSelectBlock() {
|
|
92
|
-
await
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
97
|
-
await
|
|
50
|
+
const view = await setup( { overlayColor: 'black' }, undefined, [
|
|
51
|
+
createBlock( 'core/paragraph' ),
|
|
52
|
+
] );
|
|
53
|
+
const cover = screen.getByLabelText( 'Block: Cover' );
|
|
54
|
+
await act( async () => cover.focus() );
|
|
55
|
+
await waitFor( () => expect( cover ).toHaveClass( 'is-selected' ) );
|
|
56
|
+
return view;
|
|
98
57
|
}
|
|
99
58
|
|
|
100
59
|
async function openStylesTabIfAvailable() {
|
|
@@ -107,7 +66,19 @@ async function openStylesTabIfAvailable() {
|
|
|
107
66
|
}
|
|
108
67
|
}
|
|
109
68
|
|
|
69
|
+
async function openSettingsTabIfAvailable() {
|
|
70
|
+
const settingsTab = screen.queryByRole( 'tab', {
|
|
71
|
+
name: 'Settings',
|
|
72
|
+
} );
|
|
73
|
+
|
|
74
|
+
if ( settingsTab ) {
|
|
75
|
+
await userEvent.click( settingsTab );
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
110
79
|
describe( 'Cover block', () => {
|
|
80
|
+
beforeEach( () => registerCoreBlocks() );
|
|
81
|
+
|
|
111
82
|
describe( 'Editor canvas', () => {
|
|
112
83
|
test( 'shows placeholder if background image and color not set', async () => {
|
|
113
84
|
await setup();
|
|
@@ -120,38 +91,46 @@ describe( 'Cover block', () => {
|
|
|
120
91
|
} );
|
|
121
92
|
|
|
122
93
|
test( 'can set overlay color using color picker on block placeholder', async () => {
|
|
123
|
-
|
|
94
|
+
await setup();
|
|
124
95
|
const colorPicker = screen.getByRole( 'button', {
|
|
125
96
|
name: 'Black',
|
|
126
97
|
} );
|
|
127
|
-
await
|
|
98
|
+
await activateWithKeyboard( colorPicker );
|
|
128
99
|
const color = colorPicker.style.backgroundColor;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
)
|
|
100
|
+
await waitFor( () =>
|
|
101
|
+
expect(
|
|
102
|
+
screen.getByLabelText( 'Block: Cover' )
|
|
103
|
+
).not.toHaveClass( 'is-placeholder' )
|
|
104
|
+
);
|
|
134
105
|
|
|
106
|
+
const coverBlock = screen.getByLabelText( 'Block: Cover' );
|
|
135
107
|
// eslint-disable-next-line testing-library/no-node-access
|
|
136
|
-
const overlay =
|
|
137
|
-
'wp-block-cover__background'
|
|
108
|
+
const overlay = coverBlock.querySelector(
|
|
109
|
+
'.wp-block-cover__background'
|
|
110
|
+
);
|
|
111
|
+
await waitFor( () =>
|
|
112
|
+
expect(
|
|
113
|
+
window.getComputedStyle( overlay ).backgroundColor
|
|
114
|
+
).toBe( color )
|
|
138
115
|
);
|
|
139
|
-
expect( overlay[ 0 ].style.backgroundColor ).toBe( color );
|
|
140
116
|
} );
|
|
141
117
|
|
|
142
118
|
test( 'can have the title edited', async () => {
|
|
143
119
|
await setup();
|
|
144
120
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
121
|
+
const colorButton = screen.getByRole( 'button', { name: 'Black' } );
|
|
122
|
+
await activateWithKeyboard( colorButton );
|
|
123
|
+
await waitFor( () =>
|
|
124
|
+
expect(
|
|
125
|
+
screen.getByLabelText( 'Block: Cover' )
|
|
126
|
+
).not.toHaveClass( 'is-placeholder' )
|
|
149
127
|
);
|
|
150
128
|
|
|
151
129
|
const title = screen.getByLabelText( 'Empty block;', {
|
|
152
130
|
exact: false,
|
|
153
131
|
} );
|
|
154
|
-
|
|
132
|
+
act( () => title.focus() );
|
|
133
|
+
expect( title ).toHaveFocus();
|
|
155
134
|
await userEvent.keyboard( 'abc' );
|
|
156
135
|
expect( title ).toHaveTextContent( 'abc' );
|
|
157
136
|
} );
|
|
@@ -159,48 +138,46 @@ describe( 'Cover block', () => {
|
|
|
159
138
|
|
|
160
139
|
describe( 'Block toolbar', () => {
|
|
161
140
|
test( 'full height toggle sets minHeight style attribute to 100vh when clicked', async () => {
|
|
162
|
-
await setup();
|
|
163
141
|
await createAndSelectBlock();
|
|
164
142
|
|
|
165
143
|
const cover = screen.getByLabelText( 'Block: Cover' );
|
|
166
|
-
expect( cover.
|
|
144
|
+
expect( window.getComputedStyle( cover ).minHeight ).not.toBe(
|
|
145
|
+
`${ window.innerHeight }px`
|
|
146
|
+
);
|
|
167
147
|
|
|
168
148
|
await userEvent.click( screen.getByLabelText( 'Full height' ) );
|
|
169
149
|
|
|
170
|
-
|
|
150
|
+
await waitFor( () =>
|
|
151
|
+
expect(
|
|
152
|
+
window.getComputedStyle(
|
|
153
|
+
screen.getByLabelText( 'Block: Cover' )
|
|
154
|
+
).minHeight
|
|
155
|
+
).toBe( `${ window.innerHeight }px` )
|
|
156
|
+
);
|
|
171
157
|
} );
|
|
172
158
|
|
|
173
159
|
test( 'content position button sets content position', async () => {
|
|
174
|
-
await setup();
|
|
175
160
|
await createAndSelectBlock();
|
|
161
|
+
const cover = screen.getByLabelText( 'Block: Cover' );
|
|
176
162
|
|
|
177
|
-
|
|
178
|
-
// focus-on-mount lands on the active cell instead of dirtying the
|
|
179
|
-
// content position.
|
|
180
|
-
await withAnimationFramesBeforeTimers( () =>
|
|
181
|
-
userEvent.click(
|
|
182
|
-
screen.getByLabelText( 'Change content position' )
|
|
183
|
-
)
|
|
184
|
-
);
|
|
163
|
+
expect( cover ).not.toHaveClass( 'has-custom-content-position' );
|
|
185
164
|
|
|
186
|
-
|
|
187
|
-
'
|
|
165
|
+
await userEvent.click(
|
|
166
|
+
screen.getByLabelText( 'Change content position' )
|
|
188
167
|
);
|
|
168
|
+
expect( cover ).not.toHaveClass( 'has-custom-content-position' );
|
|
189
169
|
|
|
190
|
-
await
|
|
191
|
-
within( screen.getByRole( 'grid' ) )
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
} )
|
|
195
|
-
.focus()
|
|
170
|
+
await userEvent.click(
|
|
171
|
+
within( screen.getByRole( 'grid' ) ).getByRole( 'gridcell', {
|
|
172
|
+
name: 'top left',
|
|
173
|
+
} )
|
|
196
174
|
);
|
|
197
175
|
|
|
198
|
-
|
|
199
|
-
'has-custom-content-position'
|
|
200
|
-
);
|
|
201
|
-
expect( screen.getByLabelText( 'Block: Cover' ) ).toHaveClass(
|
|
202
|
-
'is-position-top-left'
|
|
176
|
+
await waitFor( () =>
|
|
177
|
+
expect( cover ).toHaveClass( 'has-custom-content-position' )
|
|
203
178
|
);
|
|
179
|
+
|
|
180
|
+
expect( cover ).toHaveClass( 'is-position-top-left' );
|
|
204
181
|
} );
|
|
205
182
|
|
|
206
183
|
test( 'clears media when clear media button clicked', async () => {
|
|
@@ -218,10 +195,8 @@ describe( 'Cover block', () => {
|
|
|
218
195
|
await userEvent.click(
|
|
219
196
|
screen.getByRole( 'button', { name: 'Replace' } )
|
|
220
197
|
);
|
|
221
|
-
await
|
|
222
|
-
screen.getByRole( 'menuitem', {
|
|
223
|
-
name: 'Reset',
|
|
224
|
-
} )
|
|
198
|
+
await activateWithKeyboard(
|
|
199
|
+
screen.getByRole( 'menuitem', { name: 'Reset' } )
|
|
225
200
|
);
|
|
226
201
|
|
|
227
202
|
expect(
|
|
@@ -242,12 +217,12 @@ describe( 'Cover block', () => {
|
|
|
242
217
|
} )
|
|
243
218
|
).not.toBeInTheDocument();
|
|
244
219
|
} );
|
|
245
|
-
test( 'does not display settings tab when
|
|
246
|
-
await setup();
|
|
220
|
+
test( 'does not display settings panel in the settings tab when the block has no media', async () => {
|
|
247
221
|
await createAndSelectBlock();
|
|
248
222
|
|
|
223
|
+
await openSettingsTabIfAvailable();
|
|
249
224
|
expect(
|
|
250
|
-
screen.queryByRole( '
|
|
225
|
+
screen.queryByRole( 'heading', {
|
|
251
226
|
name: 'Settings',
|
|
252
227
|
} )
|
|
253
228
|
).not.toBeInTheDocument();
|
|
@@ -263,6 +238,7 @@ describe( 'Cover block', () => {
|
|
|
263
238
|
} );
|
|
264
239
|
|
|
265
240
|
await selectBlock( 'Block: Cover' );
|
|
241
|
+
await openSettingsTabIfAvailable();
|
|
266
242
|
expect(
|
|
267
243
|
await screen.findByRole( 'heading', { name: 'Settings' } )
|
|
268
244
|
).toBeInTheDocument();
|
|
@@ -277,6 +253,7 @@ describe( 'Cover block', () => {
|
|
|
277
253
|
'has-parallax'
|
|
278
254
|
);
|
|
279
255
|
await selectBlock( 'Block: Cover' );
|
|
256
|
+
await openSettingsTabIfAvailable();
|
|
280
257
|
await userEvent.click(
|
|
281
258
|
await screen.findByLabelText( 'Fixed background' )
|
|
282
259
|
);
|
|
@@ -293,6 +270,7 @@ describe( 'Cover block', () => {
|
|
|
293
270
|
'is-repeated'
|
|
294
271
|
);
|
|
295
272
|
await selectBlock( 'Block: Cover' );
|
|
273
|
+
await openSettingsTabIfAvailable();
|
|
296
274
|
await userEvent.click(
|
|
297
275
|
await screen.findByLabelText( 'Repeated background' )
|
|
298
276
|
);
|
|
@@ -307,13 +285,16 @@ describe( 'Cover block', () => {
|
|
|
307
285
|
} );
|
|
308
286
|
|
|
309
287
|
await selectBlock( 'Block: Cover' );
|
|
288
|
+
await openSettingsTabIfAvailable();
|
|
310
289
|
await userEvent.clear( await screen.findByLabelText( 'Left' ) );
|
|
311
290
|
await userEvent.type( screen.getByLabelText( 'Left' ), '100' );
|
|
312
291
|
|
|
313
292
|
const image = within(
|
|
314
293
|
screen.getByLabelText( 'Block: Cover' )
|
|
315
294
|
).getByRole( 'presentation' );
|
|
316
|
-
expect( image.
|
|
295
|
+
expect( window.getComputedStyle( image ).objectPosition ).toBe(
|
|
296
|
+
'100% 50%'
|
|
297
|
+
);
|
|
317
298
|
} );
|
|
318
299
|
|
|
319
300
|
test( 'sets alt attribute if text entered in alt text box', async () => {
|
|
@@ -322,6 +303,7 @@ describe( 'Cover block', () => {
|
|
|
322
303
|
} );
|
|
323
304
|
|
|
324
305
|
await selectBlock( 'Block: Cover' );
|
|
306
|
+
await openSettingsTabIfAvailable();
|
|
325
307
|
await userEvent.type(
|
|
326
308
|
await screen.findByLabelText( 'Alternative text' ),
|
|
327
309
|
'Me'
|
|
@@ -331,9 +313,7 @@ describe( 'Cover block', () => {
|
|
|
331
313
|
|
|
332
314
|
describe( 'Color panel', () => {
|
|
333
315
|
test( 'applies selected opacity to block when number control value changed', async () => {
|
|
334
|
-
const { container } = await
|
|
335
|
-
|
|
336
|
-
await createAndSelectBlock();
|
|
316
|
+
const { container } = await createAndSelectBlock();
|
|
337
317
|
|
|
338
318
|
// eslint-disable-next-line testing-library/no-node-access
|
|
339
319
|
const overlay = container.getElementsByClassName(
|
|
@@ -343,26 +323,18 @@ describe( 'Cover block', () => {
|
|
|
343
323
|
expect( overlay[ 0 ] ).toHaveClass( 'has-background-dim-100' );
|
|
344
324
|
|
|
345
325
|
await openStylesTabIfAvailable();
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
} ),
|
|
353
|
-
{
|
|
354
|
-
target: { value: '40' },
|
|
355
|
-
}
|
|
356
|
-
);
|
|
357
|
-
} );
|
|
326
|
+
await userEvent.fill(
|
|
327
|
+
screen.getByRole( 'spinbutton', {
|
|
328
|
+
name: 'Overlay opacity',
|
|
329
|
+
} ),
|
|
330
|
+
'40'
|
|
331
|
+
);
|
|
358
332
|
|
|
359
333
|
expect( overlay[ 0 ] ).toHaveClass( 'has-background-dim-40' );
|
|
360
334
|
} );
|
|
361
335
|
|
|
362
336
|
test( 'applies selected opacity to block when slider moved', async () => {
|
|
363
|
-
const { container } = await
|
|
364
|
-
|
|
365
|
-
await createAndSelectBlock();
|
|
337
|
+
const { container } = await createAndSelectBlock();
|
|
366
338
|
|
|
367
339
|
// eslint-disable-next-line testing-library/no-node-access
|
|
368
340
|
const overlay = container.getElementsByClassName(
|
|
@@ -373,23 +345,19 @@ describe( 'Cover block', () => {
|
|
|
373
345
|
|
|
374
346
|
await openStylesTabIfAvailable();
|
|
375
347
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
} ),
|
|
383
|
-
{ target: { value: 30 } }
|
|
384
|
-
);
|
|
385
|
-
} );
|
|
348
|
+
await userEvent.fill(
|
|
349
|
+
screen.getByRole( 'slider', {
|
|
350
|
+
name: 'Overlay opacity',
|
|
351
|
+
} ),
|
|
352
|
+
'30'
|
|
353
|
+
);
|
|
386
354
|
|
|
387
355
|
expect( overlay[ 0 ] ).toHaveClass( 'has-background-dim-30' );
|
|
388
356
|
} );
|
|
389
357
|
|
|
390
358
|
describe( 'when colors are disabled', () => {
|
|
391
359
|
test( 'does not render overlay control', async () => {
|
|
392
|
-
await setup( undefined,
|
|
360
|
+
await setup( undefined, disabledColorSettings );
|
|
393
361
|
await selectBlock( 'Block: Cover' );
|
|
394
362
|
await openStylesTabIfAvailable();
|
|
395
363
|
|
|
@@ -400,7 +368,7 @@ describe( 'Cover block', () => {
|
|
|
400
368
|
expect( overlayControl ).not.toBeInTheDocument();
|
|
401
369
|
} );
|
|
402
370
|
test( 'does not render opacity control', async () => {
|
|
403
|
-
await setup( undefined,
|
|
371
|
+
await setup( undefined, disabledColorSettings );
|
|
404
372
|
await selectBlock( 'Block: Cover' );
|
|
405
373
|
await openStylesTabIfAvailable();
|
|
406
374
|
|
|
@@ -415,7 +383,6 @@ describe( 'Cover block', () => {
|
|
|
415
383
|
|
|
416
384
|
describe( 'Dimensions panel', () => {
|
|
417
385
|
test( 'sets minHeight attribute when number control value changed', async () => {
|
|
418
|
-
await setup();
|
|
419
386
|
await createAndSelectBlock();
|
|
420
387
|
await openStylesTabIfAvailable();
|
|
421
388
|
await userEvent.clear(
|
|
@@ -427,7 +394,9 @@ describe( 'Cover block', () => {
|
|
|
427
394
|
);
|
|
428
395
|
|
|
429
396
|
expect(
|
|
430
|
-
|
|
397
|
+
window.getComputedStyle(
|
|
398
|
+
screen.getByLabelText( 'Block: Cover' )
|
|
399
|
+
).minHeight
|
|
431
400
|
).toBe( '300px' );
|
|
432
401
|
} );
|
|
433
402
|
} );
|
|
@@ -439,12 +408,15 @@ describe( 'Cover block', () => {
|
|
|
439
408
|
const colorPicker = screen.getByRole( 'button', {
|
|
440
409
|
name: 'White',
|
|
441
410
|
} );
|
|
442
|
-
await
|
|
411
|
+
await activateWithKeyboard( colorPicker );
|
|
443
412
|
|
|
413
|
+
await waitFor( () =>
|
|
414
|
+
expect( screen.getByLabelText( 'Block: Cover' ) ).toHaveClass(
|
|
415
|
+
'is-light'
|
|
416
|
+
)
|
|
417
|
+
);
|
|
444
418
|
const coverBlock = screen.getByLabelText( 'Block: Cover' );
|
|
445
419
|
|
|
446
|
-
expect( coverBlock ).toHaveClass( 'is-light' );
|
|
447
|
-
|
|
448
420
|
await selectBlock( 'Block: Cover' );
|
|
449
421
|
await openStylesTabIfAvailable();
|
|
450
422
|
await userEvent.click( screen.getByText( 'Overlay' ) );
|
|
@@ -459,9 +431,13 @@ describe( 'Cover block', () => {
|
|
|
459
431
|
const colorPicker = screen.getByRole( 'button', {
|
|
460
432
|
name: 'White',
|
|
461
433
|
} );
|
|
462
|
-
await
|
|
434
|
+
await activateWithKeyboard( colorPicker );
|
|
435
|
+
await waitFor( () =>
|
|
436
|
+
expect( screen.getByLabelText( 'Block: Cover' ) ).toHaveClass(
|
|
437
|
+
'is-light'
|
|
438
|
+
)
|
|
439
|
+
);
|
|
463
440
|
const coverBlock = screen.getByLabelText( 'Block: Cover' );
|
|
464
|
-
expect( coverBlock ).toHaveClass( 'is-light' );
|
|
465
441
|
await selectBlock( 'Block: Cover' );
|
|
466
442
|
await openStylesTabIfAvailable();
|
|
467
443
|
await userEvent.click( screen.getByText( 'Overlay' ) );
|
|
@@ -475,4 +451,3 @@ describe( 'Cover block', () => {
|
|
|
475
451
|
} );
|
|
476
452
|
} );
|
|
477
453
|
} );
|
|
478
|
-
/* eslint-enable jest-dom/prefer-to-have-style */
|
package/src/cover/transforms.js
CHANGED
|
@@ -119,7 +119,7 @@ const transforms = {
|
|
|
119
119
|
...style?.color,
|
|
120
120
|
background: undefined,
|
|
121
121
|
gradient: undefined,
|
|
122
|
-
|
|
122
|
+
}
|
|
123
123
|
: undefined,
|
|
124
124
|
} ),
|
|
125
125
|
};
|
|
@@ -234,7 +234,7 @@ const transforms = {
|
|
|
234
234
|
attributes?.customOverlayColor,
|
|
235
235
|
gradient: attributes?.customGradient,
|
|
236
236
|
...attributes?.style?.color,
|
|
237
|
-
|
|
237
|
+
}
|
|
238
238
|
: undefined,
|
|
239
239
|
} ),
|
|
240
240
|
};
|
|
@@ -280,7 +280,7 @@ const transforms = {
|
|
|
280
280
|
?.style?.color,
|
|
281
281
|
...groupAttributes?.style
|
|
282
282
|
?.color,
|
|
283
|
-
|
|
283
|
+
}
|
|
284
284
|
: undefined,
|
|
285
285
|
} ),
|
|
286
286
|
},
|
package/src/details/README.md
CHANGED
|
@@ -26,10 +26,17 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
26
26
|
|
|
27
27
|
- [`align`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#align): `"wide"`, `"full"`
|
|
28
28
|
- [`anchor`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#anchor): `true`
|
|
29
|
+
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#background):
|
|
30
|
+
- `backgroundImage`: `true`
|
|
31
|
+
- `backgroundSize`: `true`
|
|
32
|
+
- `gradient`: `true`
|
|
29
33
|
- [`color`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color):
|
|
30
34
|
- [`gradients`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-gradients): `true`
|
|
31
35
|
- [`link`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-link): `true`
|
|
36
|
+
- [`heading`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-heading): `true`
|
|
37
|
+
- [`button`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#color-button): `true`
|
|
32
38
|
- [`html`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#html): `false`
|
|
39
|
+
- [`shadow`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#shadow): `true`
|
|
33
40
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
34
41
|
- `margin`: `true`
|
|
35
42
|
- `padding`: `true`
|
package/src/details/block.json
CHANGED
|
@@ -32,9 +32,20 @@
|
|
|
32
32
|
"__experimentalOnEnter": true,
|
|
33
33
|
"align": [ "wide", "full" ],
|
|
34
34
|
"anchor": true,
|
|
35
|
+
"background": {
|
|
36
|
+
"backgroundImage": true,
|
|
37
|
+
"backgroundSize": true,
|
|
38
|
+
"gradient": true,
|
|
39
|
+
"__experimentalDefaultControls": {
|
|
40
|
+
"backgroundImage": true,
|
|
41
|
+
"gradient": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
35
44
|
"color": {
|
|
36
45
|
"gradients": true,
|
|
37
46
|
"link": true,
|
|
47
|
+
"heading": true,
|
|
48
|
+
"button": true,
|
|
38
49
|
"__experimentalDefaultControls": {
|
|
39
50
|
"background": true,
|
|
40
51
|
"text": true
|
|
@@ -46,6 +57,7 @@
|
|
|
46
57
|
"style": true
|
|
47
58
|
},
|
|
48
59
|
"html": false,
|
|
60
|
+
"shadow": true,
|
|
49
61
|
"spacing": {
|
|
50
62
|
"margin": true,
|
|
51
63
|
"padding": true,
|
package/src/details/index.js
CHANGED
package/src/embed/editor.scss
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
// Stops long URLs from breaking out of the no preview available screen
|
|
22
22
|
.components-placeholder__error {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
word-break: normal;
|
|
24
|
+
overflow-wrap: break-word;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -14,10 +14,10 @@ function getResponsiveHelp( checked ) {
|
|
|
14
14
|
return checked
|
|
15
15
|
? __(
|
|
16
16
|
'This embed will preserve its aspect ratio when the browser is resized.'
|
|
17
|
-
|
|
17
|
+
)
|
|
18
18
|
: __(
|
|
19
19
|
'This embed may not preserve its aspect ratio when the browser is resized.'
|
|
20
|
-
|
|
20
|
+
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const EmbedControls = ( {
|
package/src/file/README.md
CHANGED
|
@@ -33,6 +33,10 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
33
33
|
|
|
34
34
|
- [`anchor`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#anchor): `true`
|
|
35
35
|
- [`align`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#align): `true`
|
|
36
|
+
- [`background`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#background):
|
|
37
|
+
- `backgroundImage`: `true`
|
|
38
|
+
- `backgroundSize`: `true`
|
|
39
|
+
- `gradient`: `true`
|
|
36
40
|
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
|
|
37
41
|
- `margin`: `true`
|
|
38
42
|
- `padding`: `true`
|
package/src/file/block.json
CHANGED
|
@@ -65,6 +65,15 @@
|
|
|
65
65
|
"supports": {
|
|
66
66
|
"anchor": true,
|
|
67
67
|
"align": true,
|
|
68
|
+
"background": {
|
|
69
|
+
"backgroundImage": true,
|
|
70
|
+
"backgroundSize": true,
|
|
71
|
+
"gradient": true,
|
|
72
|
+
"__experimentalDefaultControls": {
|
|
73
|
+
"backgroundImage": true,
|
|
74
|
+
"gradient": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
68
77
|
"spacing": {
|
|
69
78
|
"margin": true,
|
|
70
79
|
"padding": true
|
package/src/file/deprecated.jsx
CHANGED
|
@@ -78,7 +78,7 @@ const v3 = {
|
|
|
78
78
|
/* translators: %s: filename. */
|
|
79
79
|
__( 'Embed of %s.' ),
|
|
80
80
|
fileName
|
|
81
|
-
|
|
81
|
+
);
|
|
82
82
|
|
|
83
83
|
const hasFilename = ! RichText.isEmpty( fileName );
|
|
84
84
|
|
|
@@ -209,7 +209,7 @@ const v2 = {
|
|
|
209
209
|
/* translators: %s: filename. */
|
|
210
210
|
__( 'Embed of %s.' ),
|
|
211
211
|
fileName
|
|
212
|
-
|
|
212
|
+
);
|
|
213
213
|
|
|
214
214
|
const hasFilename = ! RichText.isEmpty( fileName );
|
|
215
215
|
|
|
@@ -329,7 +329,7 @@ const v1 = {
|
|
|
329
329
|
/* translators: %s: filename. */
|
|
330
330
|
__( 'Embed of %s.' ),
|
|
331
331
|
fileName
|
|
332
|
-
|
|
332
|
+
);
|
|
333
333
|
|
|
334
334
|
return (
|
|
335
335
|
href && (
|
package/src/file/edit.jsx
CHANGED
|
@@ -72,7 +72,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
72
72
|
'attachment',
|
|
73
73
|
id,
|
|
74
74
|
{ context: 'view' }
|
|
75
|
-
|
|
75
|
+
)
|
|
76
76
|
: undefined,
|
|
77
77
|
} ),
|
|
78
78
|
[ id ]
|
|
@@ -114,9 +114,11 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
114
114
|
getFilename( newMedia.url ).toLowerCase().endsWith( '.pdf' );
|
|
115
115
|
const pdfAttributes = {
|
|
116
116
|
displayPreview: isPdf
|
|
117
|
-
? attributes.displayPreview ?? true
|
|
117
|
+
? ( attributes.displayPreview ?? true )
|
|
118
|
+
: undefined,
|
|
119
|
+
previewHeight: isPdf
|
|
120
|
+
? ( attributes.previewHeight ?? 600 )
|
|
118
121
|
: undefined,
|
|
119
|
-
previewHeight: isPdf ? attributes.previewHeight ?? 600 : undefined,
|
|
120
122
|
};
|
|
121
123
|
|
|
122
124
|
setAttributes( {
|