@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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/comment-template/hooks.js"],
|
|
4
|
-
"sourcesContent": ["import { useState, useEffect, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\n\n// This is limited by WP REST API\nconst MAX_COMMENTS_PER_PAGE = 100;\n\n/**\n * Return an object with the query args needed to fetch the default page of\n * comments.\n *\n * @param {Object} props Hook props.\n * @param {number} props.postId ID of the post that contains the comments.\n * discussion settings.\n *\n * @return {Object} Query args to retrieve the comments.\n */\nexport const useCommentQueryArgs = ( { postId } ) => {\n\t// Initialize the query args that are not going to change.\n\tconst queryArgs = {\n\t\tstatus: 'approve',\n\t\torder: 'asc',\n\t\tcontext: 'embed',\n\t\tparent: 0,\n\t\t_embed: 'children',\n\t};\n\n\t// Get the Discussion settings that may be needed to query the comments.\n\tconst {\n\t\tpageComments,\n\t\tcommentsPerPage,\n\t\tdefaultCommentsPage: defaultPage,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings ?? {};\n\t}, [] );\n\n\t// WP REST API doesn't allow fetching more than max items limit set per single page of data.\n\t// As for the editor performance is more important than completeness of data and fetching only the\n\t// max allowed for single page should be enough for the purpose of design and laying out the page.\n\t// Fetching over the limit would return an error here but would work with backend query.\n\tconst perPage = pageComments\n\t\t? Math.min( commentsPerPage, MAX_COMMENTS_PER_PAGE )\n\t\t: MAX_COMMENTS_PER_PAGE;\n\n\t// Get the number of the default page.\n\tconst page = useDefaultPageIndex( {\n\t\tdefaultPage,\n\t\tpostId,\n\t\tperPage,\n\t\tqueryArgs,\n\t} );\n\n\t// Merge, memoize and return all query arguments, unless the default page's\n\t// number is not known yet.\n\treturn useMemo( () => {\n\t\treturn page\n\t\t\t? {\n\t\t\t\t\t...queryArgs,\n\t\t\t\t\tpost: postId,\n\t\t\t\t\tper_page: perPage,\n\t\t\t\t\tpage,\n\t\t\t
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU,WAAW,eAAe;AAC7C,SAAS,iBAAiB;AAC1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,oBAAoB;AAC7B,OAAO,cAAc;AAGrB,IAAM,wBAAwB;AAYvB,IAAM,sBAAsB,CAAE,EAAE,OAAO,MAAO;AAEpD,QAAM,YAAY;AAAA,IACjB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT;AAGA,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,EACtB,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,YAAY,IAAI,OAAQ,gBAAiB;AACjD,UAAM,EAAE,iCAAiC,IAAI,YAAY;AACzD,WAAO,oCAAoC,CAAC;AAAA,EAC7C,GAAG,CAAC,CAAE;AAMN,QAAM,UAAU,eACb,KAAK,IAAK,iBAAiB,qBAAsB,IACjD;AAGH,QAAM,OAAO,oBAAqB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAIF,SAAO,QAAS,MAAM;AACrB,WAAO,OACJ;AAAA,MACA,GAAG;AAAA,MACH,MAAM;AAAA,MACN,UAAU;AAAA,MACV;AAAA,
|
|
4
|
+
"sourcesContent": ["import { useState, useEffect, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\n\n// This is limited by WP REST API\nconst MAX_COMMENTS_PER_PAGE = 100;\n\n/**\n * Return an object with the query args needed to fetch the default page of\n * comments.\n *\n * @param {Object} props Hook props.\n * @param {number} props.postId ID of the post that contains the comments.\n * discussion settings.\n *\n * @return {Object} Query args to retrieve the comments.\n */\nexport const useCommentQueryArgs = ( { postId } ) => {\n\t// Initialize the query args that are not going to change.\n\tconst queryArgs = {\n\t\tstatus: 'approve',\n\t\torder: 'asc',\n\t\tcontext: 'embed',\n\t\tparent: 0,\n\t\t_embed: 'children',\n\t};\n\n\t// Get the Discussion settings that may be needed to query the comments.\n\tconst {\n\t\tpageComments,\n\t\tcommentsPerPage,\n\t\tdefaultCommentsPage: defaultPage,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings ?? {};\n\t}, [] );\n\n\t// WP REST API doesn't allow fetching more than max items limit set per single page of data.\n\t// As for the editor performance is more important than completeness of data and fetching only the\n\t// max allowed for single page should be enough for the purpose of design and laying out the page.\n\t// Fetching over the limit would return an error here but would work with backend query.\n\tconst perPage = pageComments\n\t\t? Math.min( commentsPerPage, MAX_COMMENTS_PER_PAGE )\n\t\t: MAX_COMMENTS_PER_PAGE;\n\n\t// Get the number of the default page.\n\tconst page = useDefaultPageIndex( {\n\t\tdefaultPage,\n\t\tpostId,\n\t\tperPage,\n\t\tqueryArgs,\n\t} );\n\n\t// Merge, memoize and return all query arguments, unless the default page's\n\t// number is not known yet.\n\treturn useMemo( () => {\n\t\treturn page\n\t\t\t? {\n\t\t\t\t\t...queryArgs,\n\t\t\t\t\tpost: postId,\n\t\t\t\t\tper_page: perPage,\n\t\t\t\t\tpage,\n\t\t\t\t}\n\t\t\t: null;\n\t}, [ postId, perPage, page ] );\n};\n\n/**\n * Return the index of the default page, depending on whether `defaultPage` is\n * `newest` or `oldest`. In the first case, the only way to know the page's\n * index is by using the `X-WP-TotalPages` header, which forces to make an\n * additional request.\n *\n * @param {Object} props Hook props.\n * @param {string} props.defaultPage Page shown by default (newest/oldest).\n * @param {number} props.postId ID of the post that contains the comments.\n * @param {number} props.perPage The number of comments included per page.\n * @param {Object} props.queryArgs Other query args.\n *\n * @return {number} Index of the default comments page.\n */\nconst useDefaultPageIndex = ( { defaultPage, postId, perPage, queryArgs } ) => {\n\t// Store the default page indices.\n\tconst [ defaultPages, setDefaultPages ] = useState( {} );\n\tconst key = `${ postId }_${ perPage }`;\n\tconst page = defaultPages[ key ] || 0;\n\n\tuseEffect( () => {\n\t\t// Do nothing if the page is already known or not the newest page.\n\t\tif ( page || defaultPage !== 'newest' ) {\n\t\t\treturn;\n\t\t}\n\t\t// We need to fetch comments to know the index. Use HEAD and limit\n\t\t// fields just to ID, to make this call as light as possible.\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\t...queryArgs,\n\t\t\t\tpost: postId,\n\t\t\t\tper_page: perPage,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} )\n\t\t\t.then( ( res ) => {\n\t\t\t\tconst pages = parseInt( res.headers.get( 'X-WP-TotalPages' ) );\n\t\t\t\tsetDefaultPages( {\n\t\t\t\t\t...defaultPages,\n\t\t\t\t\t[ key ]: pages <= 1 ? 1 : pages, // If there are 0 pages, it means that there are no comments, but there is no 0th page.\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\t// There's no 0th page, but we can't know the number of pages, fallback to 1.\n\t\t\t\tsetDefaultPages( {\n\t\t\t\t\t...defaultPages,\n\t\t\t\t\t[ key ]: 1,\n\t\t\t\t} );\n\t\t\t} );\n\t}, [ defaultPage, postId, perPage, setDefaultPages ] );\n\n\t// The oldest one is always the first one.\n\treturn defaultPage === 'newest' ? page : 1;\n};\n\n/**\n * Generate a tree structure of comment IDs from a list of comment entities. The\n * children of each comment are obtained from `_embedded`.\n *\n * @typedef {{ commentId: number, children: CommentNode }} CommentNode\n *\n * @param {Object[]} topLevelComments List of comment entities.\n * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.\n */\nexport const useCommentTree = ( topLevelComments ) => {\n\tconst commentTree = useMemo(\n\t\t() =>\n\t\t\ttopLevelComments?.map( ( { id, _embedded } ) => {\n\t\t\t\tconst [ children ] = _embedded?.children || [ [] ];\n\t\t\t\treturn {\n\t\t\t\t\tcommentId: id,\n\t\t\t\t\tchildren: children.map( ( child ) => ( {\n\t\t\t\t\t\tcommentId: child.id,\n\t\t\t\t\t} ) ),\n\t\t\t\t};\n\t\t\t} ),\n\t\t[ topLevelComments ]\n\t);\n\n\treturn commentTree;\n};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,WAAW,eAAe;AAC7C,SAAS,iBAAiB;AAC1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,oBAAoB;AAC7B,OAAO,cAAc;AAGrB,IAAM,wBAAwB;AAYvB,IAAM,sBAAsB,CAAE,EAAE,OAAO,MAAO;AAEpD,QAAM,YAAY;AAAA,IACjB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT;AAGA,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,EACtB,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,YAAY,IAAI,OAAQ,gBAAiB;AACjD,UAAM,EAAE,iCAAiC,IAAI,YAAY;AACzD,WAAO,oCAAoC,CAAC;AAAA,EAC7C,GAAG,CAAC,CAAE;AAMN,QAAM,UAAU,eACb,KAAK,IAAK,iBAAiB,qBAAsB,IACjD;AAGH,QAAM,OAAO,oBAAqB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAIF,SAAO,QAAS,MAAM;AACrB,WAAO,OACJ;AAAA,MACA,GAAG;AAAA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tC,WAAW,MAAM;AAAA,QAClB,EAAI;AAAA,MACL;AAAA,IACD,CAAE;AAAA,IACH,CAAE,gBAAiB;AAAA,EACpB;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -20,8 +20,18 @@
|
|
|
20
20
|
"anchor": true,
|
|
21
21
|
"align": [ "wide", "full" ],
|
|
22
22
|
"html": false,
|
|
23
|
+
"background": {
|
|
24
|
+
"backgroundImage": true,
|
|
25
|
+
"backgroundSize": true,
|
|
26
|
+
"gradient": true,
|
|
27
|
+
"__experimentalDefaultControls": {
|
|
28
|
+
"backgroundImage": true,
|
|
29
|
+
"gradient": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
23
32
|
"color": {
|
|
24
33
|
"gradients": true,
|
|
34
|
+
"button": true,
|
|
25
35
|
"heading": true,
|
|
26
36
|
"link": true,
|
|
27
37
|
"__experimentalDefaultControls": {
|
|
@@ -504,10 +504,13 @@ function CoverEdit({
|
|
|
504
504
|
setOverlayColor: onSetOverlayColor,
|
|
505
505
|
coverRef: ref,
|
|
506
506
|
currentSettings,
|
|
507
|
+
onSelectMedia,
|
|
508
|
+
onUploadError,
|
|
507
509
|
toggleUseFeaturedImage,
|
|
508
510
|
updateDimRatio: onUpdateDimRatio,
|
|
509
511
|
onClearMedia,
|
|
510
|
-
featuredImage: media
|
|
512
|
+
featuredImage: media,
|
|
513
|
+
isSelected
|
|
511
514
|
}
|
|
512
515
|
);
|
|
513
516
|
const resizableCoverProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cover/edit/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { Placeholder, SandBox, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tEMBED_VIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\nimport { getBackgroundEmbedHtml } from '../embed-video-utils';\nimport { unlock } from '../../lock-unlock';\n\nconst { openMediaEditorModalKey } = unlock( blockEditorPrivateApis );\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\tstyle: {\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t\tposter,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst openMediaEditorModal = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()[ openMediaEditorModalKey ],\n\t\t[]\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tconst registry = useRegistry();\n\n\t// Ref to access latest values after async operations (e.g. getMediaColor),\n\t// avoiding stale values that could overwrite concurrent remote changes.\n\tconst propsRef = useRef( { attributes, overlayColor } );\n\tuseLayoutEffect( () => {\n\t\tpropsRef.current = { attributes, overlayColor };\n\t} );\n\n\tconst { media } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage && useFeaturedImage\n\t\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tfeaturedImage,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, useFeaturedImage ]\n\t);\n\tconst mediaUrl =\n\t\tmedia?.media_details?.sizes?.[ sizeSlug ]?.source_url ??\n\t\tmedia?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\t// Read latest values after await to avoid stale closures.\n\t\t\tconst { attributes: currentAttrs, overlayColor: currentOverlay } =\n\t\t\t\tpropsRef.current;\n\n\t\t\tlet newOverlayColor = currentOverlay.color;\n\t\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tcurrentAttrs.dimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: currentAttrs.isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t\t// The other dependencies are stable references (dispatch actions / setters).\n\t}, [\n\t\tmediaUrl,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t\tsetOverlayColor,\n\t\tuseFeaturedImage,\n\t] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\t// Create the initial inner paragraph when the block gains a background\n\t// and has no content yet.\n\tconst scaffoldInnerBlocks = () => {\n\t\tconst {\n\t\t\tgetBlocks,\n\t\t\tisBlockSelected,\n\t\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t} = registry.select( blockEditorStore );\n\t\tif ( getBlocks( clientId ).length > 0 ) {\n\t\t\treturn;\n\t\t}\n\t\t// Check for fontSize support before we pass a fontSize attribute to\n\t\t// the innerBlocks.\n\t\tconst [ fontSizes ] = unlock(\n\t\t\tregistry.select( blockEditorStore )\n\t\t).getBlockSettings( clientId, 'typography.fontSizes' );\n\t\tconst hasFontSizes = fontSizes?.length > 0;\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\tgetInnerBlocksTemplate( {\n\t\t\t\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t\t\t\t} )\n\t\t\t),\n\t\t\tisBlockSelected( clientId ),\n\t\t\tgetSelectedBlocksInitialCaretPosition()\n\t\t);\n\t};\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\t// Read latest values to avoid stale closures.\n\t\tconst { attributes: currentAttrs, overlayColor: currentOverlay } =\n\t\t\tpropsRef.current;\n\n\t\tlet newOverlayColor = currentOverlay.color;\n\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\tcurrentAttrs.url === undefined && currentAttrs.dimRatio === 100\n\t\t\t\t? 50\n\t\t\t\t: currentAttrs.dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( {\n\t\t\t\t...mediaAttributes,\n\t\t\t\tfocalPoint: undefined,\n\t\t\t\tuseFeaturedImage: undefined,\n\t\t\t\tdimRatio: newDimRatio,\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: currentAttrs.isUserOverlayColor || false,\n\t\t\t} );\n\n\t\t\tscaffoldInnerBlocks();\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\n\t\t// Skip for embeds, which never auto-assign an overlay color; otherwise\n\t\t// the non-persistent flag lands on the media reset itself (unsaveable).\n\t\tif ( ! isUserOverlayColor && overlayColor.color ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\n\t\t// Read latest dimRatio after await to avoid stale closure.\n\t\tconst { attributes: currentAttrs } = propsRef.current;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tcurrentAttrs.dimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( {\n\t\t\t\tisUserOverlayColor: true,\n\t\t\t\tisDark: newIsDark,\n\t\t\t} );\n\n\t\t\t// Skip when the color is cleared: that returns the block to its\n\t\t\t// placeholder, which only renders while there is no content.\n\t\t\tif ( newOverlayColor ) {\n\t\t\t\tscaffoldInnerBlocks();\n\t\t\t}\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\n\t\t// Read latest overlayColor after await to avoid stale closure.\n\t\tconst { overlayColor: currentOverlay } = propsRef.current;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tcurrentOverlay.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst onSelectEmbedUrl = ( embedUrl ) => {\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\t// Set initial attributes with URL\n\t\tsetAttributes( {\n\t\t\turl: embedUrl,\n\t\t\tbackgroundType: EMBED_VIDEO_BACKGROUND_TYPE,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tid: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t} );\n\t};\n\n\t// Fetch embed preview for embed videos\n\tconst { embedPreview, isFetchingEmbed } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( backgroundType !== EMBED_VIDEO_BACKGROUND_TYPE || ! url ) {\n\t\t\t\treturn {\n\t\t\t\t\tembedPreview: undefined,\n\t\t\t\t\tisFetchingEmbed: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getEmbedPreview, isRequestingEmbedPreview } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tembedPreview: getEmbedPreview( url ),\n\t\t\t\tisFetchingEmbed: isRequestingEmbedPreview( url ),\n\t\t\t};\n\t\t},\n\t\t[ url, backgroundType ]\n\t);\n\n\t// Compute embed HTML for editor display via SandBox\n\tconst embedHtml = useMemo( () => {\n\t\tif (\n\t\t\tbackgroundType !== EMBED_VIDEO_BACKGROUND_TYPE ||\n\t\t\t! embedPreview?.html\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\t\treturn getBackgroundEmbedHtml( embedPreview.html );\n\t}, [ embedPreview, backgroundType ] );\n\n\t// Set while the media editor has pointed the cover at a freshly\n\t// generated file the browser hasn't finished loading; cleared by the\n\t// background <img> load/error handlers (or immediately after\n\t// setAttributes for CSS backgrounds, which never fire load events).\n\tconst [ isSwappingMedia, setIsSwappingMedia ] = useState( false );\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\tconst isEmbedVideoBackground =\n\t\tEMBED_VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' && minHeight ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst editMediaButtonRef = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst openCoverMediaEditorModal = useCallback( () => {\n\t\tif ( ! id || ! openMediaEditorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\topenMediaEditorModal( {\n\t\t\tid,\n\t\t\tonClose: () => {\n\t\t\t\teditMediaButtonRef.current?.focus();\n\t\t\t},\n\t\t\tonUpdate: async ( { id: newId, url: newUrl } ) => {\n\t\t\t\tif ( typeof newId !== 'number' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( newId !== id && newUrl ) {\n\t\t\t\t\tsetIsSwappingMedia( true );\n\t\t\t\t}\n\n\t\t\t\tconst nextAttributes = {\n\t\t\t\t\tid: newId,\n\t\t\t\t\tbackgroundType: IMAGE_BACKGROUND_TYPE,\n\t\t\t\t\t...( newUrl ? { url: newUrl } : {} ),\n\t\t\t\t\t...( newId !== id\n\t\t\t\t\t\t? { sizeSlug: DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t: {} ),\n\t\t\t\t};\n\n\t\t\t\tif ( newUrl ) {\n\t\t\t\t\tconst averageBackgroundColor =\n\t\t\t\t\t\tawait getMediaColor( newUrl );\n\n\t\t\t\t\t// Read latest values after await to avoid stale closures.\n\t\t\t\t\tconst {\n\t\t\t\t\t\tattributes: currentAttrs,\n\t\t\t\t\t\toverlayColor: currentOverlay,\n\t\t\t\t\t} = propsRef.current;\n\n\t\t\t\t\tlet newOverlayColor = currentOverlay.color;\n\t\t\t\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t}\n\n\t\t\t\t\tnextAttributes.isDark = compositeIsDark(\n\t\t\t\t\t\tcurrentAttrs.dimRatio,\n\t\t\t\t\t\tnewOverlayColor,\n\t\t\t\t\t\taverageBackgroundColor\n\t\t\t\t\t);\n\t\t\t\t\tnextAttributes.isUserOverlayColor =\n\t\t\t\t\t\tcurrentAttrs.isUserOverlayColor || false;\n\t\t\t\t}\n\n\t\t\t\tsetAttributes( nextAttributes );\n\n\t\t\t\t// A CSS background (parallax/repeated) renders as a div and\n\t\t\t\t// never fires a load event; getMediaColor already fetched\n\t\t\t\t// the file, so the swap is done once attributes are set.\n\t\t\t\tconst {\n\t\t\t\t\thasParallax: currentHasParallax,\n\t\t\t\t\tisRepeated: currentIsRepeated,\n\t\t\t\t} = propsRef.current.attributes;\n\t\t\t\tif ( currentHasParallax || currentIsRepeated ) {\n\t\t\t\t\tsetIsSwappingMedia( false );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\t}, [\n\t\tid,\n\t\topenMediaEditorModal,\n\t\tsetAttributes,\n\t\tsetOverlayColor,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\tconst showEditMediaButton =\n\t\thasNonContentControls &&\n\t\t! useFeaturedImage &&\n\t\tisImageBackground &&\n\t\t!! id &&\n\t\t!! url &&\n\t\t! isUploadingMedia &&\n\t\t!! openMediaEditorModal;\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\t// Read latest values after await to avoid stale closures.\n\t\tconst { attributes: currentAttrs, overlayColor: currentOverlay } =\n\t\t\tpropsRef.current;\n\n\t\tconst newOverlayColor = ! currentAttrs.isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: currentOverlay.color;\n\n\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio =\n\t\t\tcurrentAttrs.dimRatio === 100 ? 50 : currentAttrs.dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( {\n\t\t\t\tid: undefined,\n\t\t\t\turl: undefined,\n\t\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\t\tdimRatio: newDimRatio,\n\t\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t\t: undefined,\n\t\t\t\tisDark: newIsDark,\n\t\t\t} );\n\n\t\t\t// Skip when the featured image is disabled: that can return the\n\t\t\t// block to its placeholder, which only renders while there is no\n\t\t\t// content.\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tscaffoldInnerBlocks();\n\t\t\t}\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tonSelectEmbedUrl={ onSelectEmbedUrl }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t\tblockEditingMode={ blockEditingMode }\n\t\t\tonEditMedia={ openCoverMediaEditorModal }\n\t\t\teditMediaButtonRef={ editMediaButtonRef }\n\t\t\tshowEditMediaButton={ showEditMediaButton }\n\t\t\tisEditMediaDisabled={ isSwappingMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t\tfeaturedImage={ media }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tpresentation=\"toggle-buttons\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Overlay color' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia || isSwappingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t\tonLoad={ () => setIsSwappingMedia( false ) }\n\t\t\t\t\t\t\tonError={ () => setIsSwappingMedia( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isEmbedVideoBackground && embedHtml && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background wp-block-cover__embed-background\"\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SandBox\n\t\t\t\t\t\t\tallowSameOrigin\n\t\t\t\t\t\t\thtml={ embedHtml }\n\t\t\t\t\t\t\ttitle=\"Background video\"\n\t\t\t\t\t\t\tstyles={ [\n\t\t\t\t\t\t\t\t'iframe{position:fixed;top:0;left:0;width:100%;height:100%;}',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ isEmbedVideoBackground && ! embedHtml && isFetchingEmbed && (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ ( isUploadingMedia || isSwappingMedia ) && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,eAAe,SAAS,iBAAiB;AAClD;AAAA,EAC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tD;AAAA,YAAC;AAAA;AAAA,cACA,qBAAmB;AAAA,cACnB;AAAA,cACA,SAAU;AAAA,cACV;AAAA;AAAA,UACD;AAAA,UACA,oBAAC,SAAM,GAAG,kBAAmB;AAAA;AAAA;AAAA,IAC9B;AAAA,IACE,yBAAyB,cAC1B,oBAAC,yBAAwB,GAAG,qBAAsB;AAAA,KAEpD;AAEF;AAEA,IAAO,eAAQ,QAAS;AAAA,EACvB,WAAY,EAAE,cAAc,mBAAmB,CAAE;AAClD,CAAE,EAAG,SAAU;",
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { Placeholder, SandBox, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tEMBED_VIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\nimport { getBackgroundEmbedHtml } from '../embed-video-utils';\nimport { unlock } from '../../lock-unlock';\n\nconst { openMediaEditorModalKey } = unlock( blockEditorPrivateApis );\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\tstyle: {\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t\tposter,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst openMediaEditorModal = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()[ openMediaEditorModalKey ],\n\t\t[]\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tconst registry = useRegistry();\n\n\t// Ref to access latest values after async operations (e.g. getMediaColor),\n\t// avoiding stale values that could overwrite concurrent remote changes.\n\tconst propsRef = useRef( { attributes, overlayColor } );\n\tuseLayoutEffect( () => {\n\t\tpropsRef.current = { attributes, overlayColor };\n\t} );\n\n\tconst { media } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage && useFeaturedImage\n\t\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tfeaturedImage,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, useFeaturedImage ]\n\t);\n\tconst mediaUrl =\n\t\tmedia?.media_details?.sizes?.[ sizeSlug ]?.source_url ??\n\t\tmedia?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\t// Read latest values after await to avoid stale closures.\n\t\t\tconst { attributes: currentAttrs, overlayColor: currentOverlay } =\n\t\t\t\tpropsRef.current;\n\n\t\t\tlet newOverlayColor = currentOverlay.color;\n\t\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tcurrentAttrs.dimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: currentAttrs.isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t\t// The other dependencies are stable references (dispatch actions / setters).\n\t}, [\n\t\tmediaUrl,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t\tsetOverlayColor,\n\t\tuseFeaturedImage,\n\t] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t\toriginalUrl?.replaceAll( '&', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\t// Create the initial inner paragraph when the block gains a background\n\t// and has no content yet.\n\tconst scaffoldInnerBlocks = () => {\n\t\tconst {\n\t\t\tgetBlocks,\n\t\t\tisBlockSelected,\n\t\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t} = registry.select( blockEditorStore );\n\t\tif ( getBlocks( clientId ).length > 0 ) {\n\t\t\treturn;\n\t\t}\n\t\t// Check for fontSize support before we pass a fontSize attribute to\n\t\t// the innerBlocks.\n\t\tconst [ fontSizes ] = unlock(\n\t\t\tregistry.select( blockEditorStore )\n\t\t).getBlockSettings( clientId, 'typography.fontSizes' );\n\t\tconst hasFontSizes = fontSizes?.length > 0;\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\tgetInnerBlocksTemplate( {\n\t\t\t\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t\t\t\t} )\n\t\t\t),\n\t\t\tisBlockSelected( clientId ),\n\t\t\tgetSelectedBlocksInitialCaretPosition()\n\t\t);\n\t};\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\t// Read latest values to avoid stale closures.\n\t\tconst { attributes: currentAttrs, overlayColor: currentOverlay } =\n\t\t\tpropsRef.current;\n\n\t\tlet newOverlayColor = currentOverlay.color;\n\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\tcurrentAttrs.url === undefined && currentAttrs.dimRatio === 100\n\t\t\t\t? 50\n\t\t\t\t: currentAttrs.dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( {\n\t\t\t\t...mediaAttributes,\n\t\t\t\tfocalPoint: undefined,\n\t\t\t\tuseFeaturedImage: undefined,\n\t\t\t\tdimRatio: newDimRatio,\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: currentAttrs.isUserOverlayColor || false,\n\t\t\t} );\n\n\t\t\tscaffoldInnerBlocks();\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\n\t\t// Skip for embeds, which never auto-assign an overlay color; otherwise\n\t\t// the non-persistent flag lands on the media reset itself (unsaveable).\n\t\tif ( ! isUserOverlayColor && overlayColor.color ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\n\t\t// Read latest dimRatio after await to avoid stale closure.\n\t\tconst { attributes: currentAttrs } = propsRef.current;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tcurrentAttrs.dimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( {\n\t\t\t\tisUserOverlayColor: true,\n\t\t\t\tisDark: newIsDark,\n\t\t\t} );\n\n\t\t\t// Skip when the color is cleared: that returns the block to its\n\t\t\t// placeholder, which only renders while there is no content.\n\t\t\tif ( newOverlayColor ) {\n\t\t\t\tscaffoldInnerBlocks();\n\t\t\t}\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\n\t\t// Read latest overlayColor after await to avoid stale closure.\n\t\tconst { overlayColor: currentOverlay } = propsRef.current;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tcurrentOverlay.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst onSelectEmbedUrl = ( embedUrl ) => {\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\t// Set initial attributes with URL\n\t\tsetAttributes( {\n\t\t\turl: embedUrl,\n\t\t\tbackgroundType: EMBED_VIDEO_BACKGROUND_TYPE,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tid: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t} );\n\t};\n\n\t// Fetch embed preview for embed videos\n\tconst { embedPreview, isFetchingEmbed } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( backgroundType !== EMBED_VIDEO_BACKGROUND_TYPE || ! url ) {\n\t\t\t\treturn {\n\t\t\t\t\tembedPreview: undefined,\n\t\t\t\t\tisFetchingEmbed: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getEmbedPreview, isRequestingEmbedPreview } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tembedPreview: getEmbedPreview( url ),\n\t\t\t\tisFetchingEmbed: isRequestingEmbedPreview( url ),\n\t\t\t};\n\t\t},\n\t\t[ url, backgroundType ]\n\t);\n\n\t// Compute embed HTML for editor display via SandBox\n\tconst embedHtml = useMemo( () => {\n\t\tif (\n\t\t\tbackgroundType !== EMBED_VIDEO_BACKGROUND_TYPE ||\n\t\t\t! embedPreview?.html\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\t\treturn getBackgroundEmbedHtml( embedPreview.html );\n\t}, [ embedPreview, backgroundType ] );\n\n\t// Set while the media editor has pointed the cover at a freshly\n\t// generated file the browser hasn't finished loading; cleared by the\n\t// background <img> load/error handlers (or immediately after\n\t// setAttributes for CSS backgrounds, which never fire load events).\n\tconst [ isSwappingMedia, setIsSwappingMedia ] = useState( false );\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\tconst isEmbedVideoBackground =\n\t\tEMBED_VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' && minHeight ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst editMediaButtonRef = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst openCoverMediaEditorModal = useCallback( () => {\n\t\tif ( ! id || ! openMediaEditorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\topenMediaEditorModal( {\n\t\t\tid,\n\t\t\tonClose: () => {\n\t\t\t\teditMediaButtonRef.current?.focus();\n\t\t\t},\n\t\t\tonUpdate: async ( { id: newId, url: newUrl } ) => {\n\t\t\t\tif ( typeof newId !== 'number' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( newId !== id && newUrl ) {\n\t\t\t\t\tsetIsSwappingMedia( true );\n\t\t\t\t}\n\n\t\t\t\tconst nextAttributes = {\n\t\t\t\t\tid: newId,\n\t\t\t\t\tbackgroundType: IMAGE_BACKGROUND_TYPE,\n\t\t\t\t\t...( newUrl ? { url: newUrl } : {} ),\n\t\t\t\t\t...( newId !== id\n\t\t\t\t\t\t? { sizeSlug: DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t: {} ),\n\t\t\t\t};\n\n\t\t\t\tif ( newUrl ) {\n\t\t\t\t\tconst averageBackgroundColor =\n\t\t\t\t\t\tawait getMediaColor( newUrl );\n\n\t\t\t\t\t// Read latest values after await to avoid stale closures.\n\t\t\t\t\tconst {\n\t\t\t\t\t\tattributes: currentAttrs,\n\t\t\t\t\t\toverlayColor: currentOverlay,\n\t\t\t\t\t} = propsRef.current;\n\n\t\t\t\t\tlet newOverlayColor = currentOverlay.color;\n\t\t\t\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t}\n\n\t\t\t\t\tnextAttributes.isDark = compositeIsDark(\n\t\t\t\t\t\tcurrentAttrs.dimRatio,\n\t\t\t\t\t\tnewOverlayColor,\n\t\t\t\t\t\taverageBackgroundColor\n\t\t\t\t\t);\n\t\t\t\t\tnextAttributes.isUserOverlayColor =\n\t\t\t\t\t\tcurrentAttrs.isUserOverlayColor || false;\n\t\t\t\t}\n\n\t\t\t\tsetAttributes( nextAttributes );\n\n\t\t\t\t// A CSS background (parallax/repeated) renders as a div and\n\t\t\t\t// never fires a load event; getMediaColor already fetched\n\t\t\t\t// the file, so the swap is done once attributes are set.\n\t\t\t\tconst {\n\t\t\t\t\thasParallax: currentHasParallax,\n\t\t\t\t\tisRepeated: currentIsRepeated,\n\t\t\t\t} = propsRef.current.attributes;\n\t\t\t\tif ( currentHasParallax || currentIsRepeated ) {\n\t\t\t\t\tsetIsSwappingMedia( false );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\t}, [\n\t\tid,\n\t\topenMediaEditorModal,\n\t\tsetAttributes,\n\t\tsetOverlayColor,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\tconst showEditMediaButton =\n\t\thasNonContentControls &&\n\t\t! useFeaturedImage &&\n\t\tisImageBackground &&\n\t\t!! id &&\n\t\t!! url &&\n\t\t! isUploadingMedia &&\n\t\t!! openMediaEditorModal;\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\t// Read latest values after await to avoid stale closures.\n\t\tconst { attributes: currentAttrs, overlayColor: currentOverlay } =\n\t\t\tpropsRef.current;\n\n\t\tconst newOverlayColor = ! currentAttrs.isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: currentOverlay.color;\n\n\t\tif ( ! currentAttrs.isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\t\t\t// Fold next attribute change into the same undo level as the setOverlayColor above.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio =\n\t\t\tcurrentAttrs.dimRatio === 100 ? 50 : currentAttrs.dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tregistry.batch( () => {\n\t\t\tsetAttributes( {\n\t\t\t\tid: undefined,\n\t\t\t\turl: undefined,\n\t\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\t\tdimRatio: newDimRatio,\n\t\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t\t: undefined,\n\t\t\t\tisDark: newIsDark,\n\t\t\t} );\n\n\t\t\t// Skip when the featured image is disabled: that can return the\n\t\t\t// block to its placeholder, which only renders while there is no\n\t\t\t// content.\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tscaffoldInnerBlocks();\n\t\t\t}\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tonSelectEmbedUrl={ onSelectEmbedUrl }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t\tblockEditingMode={ blockEditingMode }\n\t\t\tonEditMedia={ openCoverMediaEditorModal }\n\t\t\teditMediaButtonRef={ editMediaButtonRef }\n\t\t\tshowEditMediaButton={ showEditMediaButton }\n\t\t\tisEditMediaDisabled={ isSwappingMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tonUploadError={ onUploadError }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t\tfeaturedImage={ media }\n\t\t\tisSelected={ isSelected }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tpresentation=\"toggle-buttons\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Overlay color' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia || isSwappingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t\tonLoad={ () => setIsSwappingMedia( false ) }\n\t\t\t\t\t\t\tonError={ () => setIsSwappingMedia( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isEmbedVideoBackground && embedHtml && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background wp-block-cover__embed-background\"\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SandBox\n\t\t\t\t\t\t\tallowSameOrigin\n\t\t\t\t\t\t\thtml={ embedHtml }\n\t\t\t\t\t\t\ttitle=\"Background video\"\n\t\t\t\t\t\t\tstyles={ [\n\t\t\t\t\t\t\t\t'iframe{position:fixed;top:0;left:0;width:100%;height:100%;}',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ isEmbedVideoBackground && ! embedHtml && isFetchingEmbed && (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ ( isUploadingMedia || isSwappingMedia ) && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,eAAe,SAAS,iBAAiB;AAClD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa,SAAS,eAAe;AAC9C,SAAS,SAAS,yBAAyB;AAC3C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,eAAe;AAAA,OACT;AACP,SAAS,UAAU;AACnB,SAAS,WAAW,aAAa,mBAAmB;AACpD,SAAS,2CAA2C;AACpD,SAAS,iBAAiB;AAC1B,SAAS,SAAS,oBAAoB;AACtC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,4BAA4B;AACnC,OAAO,wBAAwB;AAC/B,OAAO,sBAAsB;AAC7B,OAAO,2BAA2B;AAClC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,+BAA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AAA;AAAA,kBACA,iBAAe;AAAA,kBACf,MAAO;AAAA,kBACP,OAAM;AAAA,kBACN,QAAS;AAAA,oBACR;AAAA,kBACD;AAAA;AAAA,cACD;AAAA;AAAA,UACD;AAAA,UAEC,0BAA0B,CAAE,aAAa,mBAC1C,oBAAC,WAAQ;AAAA,UAGR,eACD;AAAA,YAAC;AAAA;AAAA,cACA,eAAY;AAAA,cACZ,WAAY;AAAA,gBACX;AAAA,gBACA,gBAAiB,QAAS;AAAA,gBAC1B;AAAA,kBACC,CAAE,aAAa,KAAM,GAAG,aAAa;AAAA,kBACrC,sBAAsB,aAAa;AAAA;AAAA;AAAA;AAAA,kBAInC,uCACC,OAAO,iBAAiB,aAAa;AAAA,kBACtC,2BAA2B;AAAA,kBAC3B,CAAE,aAAc,GAAG;AAAA,gBACpB;AAAA,cACD;AAAA,cACA,OAAQ,EAAE,iBAAiB,eAAe,GAAG,QAAQ;AAAA;AAAA,UACtD;AAAA,WAGG,oBAAoB,oBAAqB,oBAAC,WAAQ;AAAA,UAEtD;AAAA,YAAC;AAAA;AAAA,cACA,qBAAmB;AAAA,cACnB;AAAA,cACA,SAAU;AAAA,cACV;AAAA;AAAA,UACD;AAAA,UACA,oBAAC,SAAM,GAAG,kBAAmB;AAAA;AAAA;AAAA,IAC9B;AAAA,IACE,yBAAyB,cAC1B,oBAAC,yBAAwB,GAAG,qBAAsB;AAAA,KAEpD;AAEF;AAEA,IAAO,eAAQ,QAAS;AAAA,EACvB,WAAY,EAAE,cAAc,mBAAmB,CAAE;AAClD,CAAE,EAAG,SAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,8 +24,13 @@ import {
|
|
|
24
24
|
import { __ } from "@wordpress/i18n";
|
|
25
25
|
import { useSelect } from "@wordpress/data";
|
|
26
26
|
import { store as coreStore } from "@wordpress/core-data";
|
|
27
|
+
import { getFilename } from "@wordpress/url";
|
|
27
28
|
import { Link } from "@wordpress/ui";
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
ALLOWED_MEDIA_TYPES,
|
|
31
|
+
COVER_MIN_HEIGHT,
|
|
32
|
+
mediaPosition
|
|
33
|
+
} from "../shared.mjs";
|
|
29
34
|
import { unlock } from "../../lock-unlock.mjs";
|
|
30
35
|
import { useToolsPanelDropdownMenuProps } from "../../utils/hooks.mjs";
|
|
31
36
|
import {
|
|
@@ -36,13 +41,11 @@ import {
|
|
|
36
41
|
} from "../../utils/style-state.mjs";
|
|
37
42
|
import { DEFAULT_MEDIA_SIZE_SLUG } from "../constants.mjs";
|
|
38
43
|
import PosterImage from "../../utils/poster-image.mjs";
|
|
44
|
+
import { MediaControl } from "../../utils/media-control.mjs";
|
|
39
45
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
-
var {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ResolutionTool,
|
|
44
|
-
HTMLElementControl
|
|
45
|
-
} = unlock(blockEditorPrivateApis);
|
|
46
|
+
var { cleanEmptyObject, ResolutionTool, HTMLElementControl } = unlock(
|
|
47
|
+
blockEditorPrivateApis
|
|
48
|
+
);
|
|
46
49
|
function CoverHeightInput({
|
|
47
50
|
onChange,
|
|
48
51
|
onUnitChange,
|
|
@@ -90,8 +93,13 @@ function CoverInspectorControls({
|
|
|
90
93
|
setOverlayColor,
|
|
91
94
|
coverRef,
|
|
92
95
|
currentSettings,
|
|
96
|
+
onSelectMedia,
|
|
97
|
+
onUploadError,
|
|
98
|
+
toggleUseFeaturedImage,
|
|
93
99
|
updateDimRatio,
|
|
94
|
-
|
|
100
|
+
onClearMedia,
|
|
101
|
+
featuredImage,
|
|
102
|
+
isSelected
|
|
95
103
|
}) {
|
|
96
104
|
const {
|
|
97
105
|
useFeaturedImage,
|
|
@@ -115,19 +123,21 @@ function CoverInspectorControls({
|
|
|
115
123
|
} = currentSettings;
|
|
116
124
|
const sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
|
|
117
125
|
const { gradientValue, setGradient } = __experimentalUseGradient();
|
|
118
|
-
const { imageSizes, selectedStyleState } = useSelect(
|
|
126
|
+
const { imageSizes, selectedStyleState, hasSelectedStyleState } = useSelect(
|
|
119
127
|
(select) => {
|
|
120
|
-
const {
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
const {
|
|
129
|
+
getSettings,
|
|
130
|
+
getSelectedBlockStyleState,
|
|
131
|
+
hasSelectedBlockStyleState
|
|
132
|
+
} = select(blockEditorStore);
|
|
123
133
|
return {
|
|
124
134
|
imageSizes: getSettings()?.imageSizes,
|
|
125
|
-
selectedStyleState: getSelectedBlockStyleState(clientId)
|
|
135
|
+
selectedStyleState: getSelectedBlockStyleState(clientId),
|
|
136
|
+
hasSelectedStyleState: hasSelectedBlockStyleState(clientId)
|
|
126
137
|
};
|
|
127
138
|
},
|
|
128
139
|
[clientId]
|
|
129
140
|
);
|
|
130
|
-
const hasSelectedStyleState = !isDefaultBlockStyleState(selectedStyleState);
|
|
131
141
|
const selectedStyleStateKey = getStyleStateKey(selectedStyleState);
|
|
132
142
|
const stateMinHeight = getActiveDimensionValue({
|
|
133
143
|
attributes,
|
|
@@ -228,7 +238,40 @@ function CoverInspectorControls({
|
|
|
228
238
|
});
|
|
229
239
|
};
|
|
230
240
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
241
|
+
const mediaInspectorPanel = isSelected ? /* @__PURE__ */ jsx(InspectorControls, { group: "content", children: /* @__PURE__ */ jsx(
|
|
242
|
+
ToolsPanel,
|
|
243
|
+
{
|
|
244
|
+
label: __("Media"),
|
|
245
|
+
resetAll: onClearMedia,
|
|
246
|
+
dropdownMenuProps,
|
|
247
|
+
children: /* @__PURE__ */ jsx(
|
|
248
|
+
ToolsPanelItem,
|
|
249
|
+
{
|
|
250
|
+
label: __("Media"),
|
|
251
|
+
hasValue: () => !!url || !!useFeaturedImage,
|
|
252
|
+
onDeselect: onClearMedia,
|
|
253
|
+
isShownByDefault: true,
|
|
254
|
+
children: /* @__PURE__ */ jsx(
|
|
255
|
+
MediaControl,
|
|
256
|
+
{
|
|
257
|
+
mediaId: id,
|
|
258
|
+
mediaUrl: url,
|
|
259
|
+
filename: image?.media_details?.sizes?.full?.file || image?.slug || getFilename(url),
|
|
260
|
+
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
261
|
+
onSelect: onSelectMedia,
|
|
262
|
+
onError: onUploadError,
|
|
263
|
+
onReset: onClearMedia,
|
|
264
|
+
useFeaturedImage,
|
|
265
|
+
onToggleFeaturedImage: toggleUseFeaturedImage,
|
|
266
|
+
emptyLabel: __("Add media")
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
) }) : null;
|
|
231
273
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
274
|
+
mediaInspectorPanel,
|
|
232
275
|
(!!url || useFeaturedImage) && /* @__PURE__ */ jsx(InspectorControls, { children: /* @__PURE__ */ jsxs(
|
|
233
276
|
ToolsPanel,
|
|
234
277
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cover/edit/inspector-controls.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from '@wordpress/element';\nimport {\n\tFocalPointPicker,\n\tRangeControl,\n\tTextareaControl as WCTextareaControl,\n\tToggleControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\tstore as blockEditorStore,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseGradient,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Link } from '@wordpress/ui';\nimport { COVER_MIN_HEIGHT, mediaPosition } from '../shared';\nimport { unlock } from '../../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../../utils/hooks';\nimport {\n\tgetActiveDimensionValue,\n\tgetDimensionResetAttributes,\n\tgetDimensionUpdateAttributes,\n\tgetStyleStateKey,\n} from '../../utils/style-state';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\nimport PosterImage from '../../utils/poster-image';\n\nconst {\n\tcleanEmptyObject,\n\tisDefaultBlockStyleState,\n\tResolutionTool,\n\tHTMLElementControl,\n} = unlock( blockEditorPrivateApis );\n\nfunction CoverHeightInput( {\n\tonChange,\n\tonUnitChange,\n\tunit = 'px',\n\tvalue = '',\n} ) {\n\tconst instanceId = useInstanceId( UnitControl );\n\tconst inputId = `block-cover-height-input-${ instanceId }`;\n\tconst isPx = unit === 'px';\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],\n\t\tdefaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== ''\n\t\t\t\t? parseFloat( unprocessedValue )\n\t\t\t\t: undefined;\n\n\t\tif ( isNaN( inputValue ) && inputValue !== undefined ) {\n\t\t\treturn;\n\t\t}\n\t\tonChange( inputValue );\n\t};\n\n\tconst computedValue = useMemo( () => {\n\t\tconst [ parsedQuantity ] = parseQuantityAndUnitFromRawValue( value );\n\t\treturn [ parsedQuantity, unit ].join( '' );\n\t}, [ unit, value ] );\n\n\tconst min = isPx ? COVER_MIN_HEIGHT : 0;\n\n\treturn (\n\t\t<UnitControl\n\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\tid={ inputId }\n\t\t\tisResetValueOnUnitChange\n\t\t\tmin={ min }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ onUnitChange }\n\t\t\tunits={ units }\n\t\t\tvalue={ computedValue }\n\t\t/>\n\t);\n}\nexport default function CoverInspectorControls( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tsetOverlayColor,\n\tcoverRef,\n\tcurrentSettings,\n\tupdateDimRatio,\n\tfeaturedImage,\n} ) {\n\tconst {\n\t\tuseFeaturedImage,\n\t\tid,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\ttagName,\n\t\tposter,\n\t} = attributes;\n\tconst {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\turl,\n\t\toverlayColor,\n\t} = currentSettings;\n\n\tconst sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;\n\n\tconst { gradientValue, setGradient } = __experimentalUseGradient();\n\tconst { imageSizes, selectedStyleState } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, getSelectedBlockStyleState } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\timageSizes: getSettings()?.imageSizes,\n\t\t\t\tselectedStyleState: getSelectedBlockStyleState( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst hasSelectedStyleState =\n\t\t! isDefaultBlockStyleState( selectedStyleState );\n\tconst selectedStyleStateKey = getStyleStateKey( selectedStyleState );\n\tconst stateMinHeight = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'minHeight',\n\t\tstyleKey: 'minHeight',\n\t\trootValue: undefined,\n\t} );\n\tconst [ stateMinHeightValue, stateMinHeightUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( stateMinHeight || '' );\n\tconst activeMinHeight = hasSelectedStyleState\n\t\t? stateMinHeightValue\n\t\t: minHeight;\n\tconst activeMinHeightUnit = hasSelectedStyleState\n\t\t? stateMinHeightUnit || minHeightUnit\n\t\t: minHeightUnit;\n\tconst activeAspectRatio = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'aspectRatio',\n\t\trootValue: attributes?.style?.dimensions?.aspectRatio,\n\t} );\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isImageBackground\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\tid,\n\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t )\n\t\t\t\t: null,\n\t\t[ id, isImageBackground ]\n\t);\n\n\tconst currentBackgroundImage = useFeaturedImage ? featuredImage : image;\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl =\n\t\t\tcurrentBackgroundImage?.media_details?.sizes?.[ newSizeSlug ]\n\t\t\t\t?.source_url;\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\turl: newUrl,\n\t\t\tsizeSlug: newSizeSlug,\n\t\t} );\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t?.filter(\n\t\t\t( { slug } ) =>\n\t\t\t\tcurrentBackgroundImage?.media_details?.sizes?.[ slug ]\n\t\t\t\t\t?.source_url\n\t\t)\n\t\t?.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\tconst toggleParallax = () => {\n\t\tsetAttributes( {\n\t\t\thasParallax: ! hasParallax,\n\t\t\t...( ! hasParallax ? { focalPoint: undefined } : {} ),\n\t\t} );\n\t};\n\n\tconst toggleIsRepeated = () => {\n\t\tsetAttributes( {\n\t\t\tisRepeated: ! isRepeated,\n\t\t} );\n\t};\n\n\tconst showFocalPointPicker = isVideoBackground || isImageBackground;\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst [ styleOfRef, property ] = mediaElement.current\n\t\t\t? [ mediaElement.current.style, 'objectPosition' ]\n\t\t\t: [ coverRef.current.style, 'backgroundPosition' ];\n\t\tstyleOfRef[ property ] = mediaPosition( value );\n\t};\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\tconst showOverlayControls =\n\t\tcolorGradientSettings.hasColorsOrGradients && ! hasSelectedStyleState;\n\n\tconst setMinHeightAttributes = ( nextMinHeight, nextUnit ) => {\n\t\tif ( hasSelectedStyleState ) {\n\t\t\tsetAttributes(\n\t\t\t\tgetDimensionUpdateAttributes( {\n\t\t\t\t\tstyle: attributes.style,\n\t\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\t\thasSelectedStyleState,\n\t\t\t\t\tnextDimensions: {\n\t\t\t\t\t\tminHeight:\n\t\t\t\t\t\t\tnextMinHeight === undefined\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: `${ nextMinHeight }${\n\t\t\t\t\t\t\t\t\t\tnextUnit || activeMinHeightUnit || 'px'\n\t\t\t\t\t\t\t\t }`,\n\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t},\n\t\t\t\t} )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tminHeight: nextMinHeight,\n\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t...attributes?.style,\n\t\t\t\tdimensions: {\n\t\t\t\t\t...attributes?.style?.dimensions,\n\t\t\t\t\taspectRatio: undefined, // Reset aspect ratio when minHeight is set.\n\t\t\t\t},\n\t\t\t} ),\n\t\t} );\n\t};\n\n\tconst getResetMinHeightAttributes = ( attrs = attributes ) => {\n\t\treturn getDimensionResetAttributes( {\n\t\t\tstyle: attrs.style,\n\t\t\tselectedState: selectedStyleState,\n\t\t\thasSelectedStyleState,\n\t\t\tkeys: [ 'minHeight' ],\n\t\t\tdefaultAttributes: {\n\t\t\t\tminHeight: undefined,\n\t\t\t\tminHeightUnit: undefined,\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t{ ( !! url || useFeaturedImage ) && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\tisRepeated: false,\n\t\t\t\t\t\t\t\talt: '',\n\t\t\t\t\t\t\t\tposter: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isImageBackground && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => !! hasParallax }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ !! hasParallax }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleParallax }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => isRepeated }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tisRepeated: false,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ isRepeated }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showFocalPointPicker && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isVideoBackground && (\n\t\t\t\t\t\t\t<PosterImage\n\t\t\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tposter: posterImage?.url,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! useFeaturedImage && url && ! isVideoBackground && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: '' } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WCTextareaControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\t\t\t\tonChange={ ( newAlt ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( { alt: newAlt } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Leave empty if decorative.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ !! imageSizeOptions?.length && (\n\t\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ showOverlayControls && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolorValue: overlayColor.color,\n\t\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\t\tlabel: __( 'Overlay' ),\n\t\t\t\t\t\t\t\tonColorChange: setOverlayColor,\n\t\t\t\t\t\t\t\tonGradientChange: setGradient,\n\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\t\t\t\t\toverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tcustomOverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t\t\tcustomGradient: undefined,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\t\tclearable: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => {\n\t\t\t\t\t\t\t// If there's a media background the dimRatio will be\n\t\t\t\t\t\t\t// defaulted to 50 whereas it will be 100 for colors.\n\t\t\t\t\t\t\treturn dimRatio === undefined\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: dimRatio !== ( url ? 50 : 100 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\tonDeselect={ () => updateDimRatio( url ? 50 : 100 ) }\n\t\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\t\tdimRatio: url ? 50 : 100,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\t\tvalue={ dimRatio }\n\t\t\t\t\t\t\tonChange={ ( newDimRatio ) =>\n\t\t\t\t\t\t\t\tupdateDimRatio( newDimRatio )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\tstep={ 10 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tkey={ selectedStyleStateKey }\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\thasValue={ () => !! activeMinHeight }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( getResetMinHeightAttributes() )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ getResetMinHeightAttributes }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<CoverHeightInput\n\t\t\t\t\t\tvalue={ activeAspectRatio ? '' : activeMinHeight }\n\t\t\t\t\t\tunit={ activeMinHeightUnit }\n\t\t\t\t\t\tonChange={ ( newMinHeight ) =>\n\t\t\t\t\t\t\tsetMinHeightAttributes( newMinHeight )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonUnitChange={ ( nextUnit ) => {\n\t\t\t\t\t\t\tif ( hasSelectedStyleState ) {\n\t\t\t\t\t\t\t\tif ( activeMinHeight !== undefined ) {\n\t\t\t\t\t\t\t\t\tsetMinHeightAttributes(\n\t\t\t\t\t\t\t\t\t\tactiveMinHeight,\n\t\t\t\t\t\t\t\t\t\tnextUnit\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeightUnit: nextUnit,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,eAAe;AACxB;AAAA,EACC;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA,gCAAgC;AAAA,EAChC,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,kDAAkD;AAAA,OAC5C;AACP,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,+CAA+C;AAAA,EAC/C;AAAA,EACA,qDAAqD;AAAA,EACrD,eAAe;AAAA,OACT;AACP,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,YAAY;AACrB,
|
|
4
|
+
"sourcesContent": ["import { useMemo } from '@wordpress/element';\nimport {\n\tFocalPointPicker,\n\tRangeControl,\n\tTextareaControl as WCTextareaControl,\n\tToggleControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\tstore as blockEditorStore,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseGradient,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { getFilename } from '@wordpress/url';\nimport { Link } from '@wordpress/ui';\nimport {\n\tALLOWED_MEDIA_TYPES,\n\tCOVER_MIN_HEIGHT,\n\tmediaPosition,\n} from '../shared';\nimport { unlock } from '../../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../../utils/hooks';\nimport {\n\tgetActiveDimensionValue,\n\tgetDimensionResetAttributes,\n\tgetDimensionUpdateAttributes,\n\tgetStyleStateKey,\n} from '../../utils/style-state';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\nimport PosterImage from '../../utils/poster-image';\nimport { MediaControl } from '../../utils/media-control';\n\nconst { cleanEmptyObject, ResolutionTool, HTMLElementControl } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction CoverHeightInput( {\n\tonChange,\n\tonUnitChange,\n\tunit = 'px',\n\tvalue = '',\n} ) {\n\tconst instanceId = useInstanceId( UnitControl );\n\tconst inputId = `block-cover-height-input-${ instanceId }`;\n\tconst isPx = unit === 'px';\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],\n\t\tdefaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== ''\n\t\t\t\t? parseFloat( unprocessedValue )\n\t\t\t\t: undefined;\n\n\t\tif ( isNaN( inputValue ) && inputValue !== undefined ) {\n\t\t\treturn;\n\t\t}\n\t\tonChange( inputValue );\n\t};\n\n\tconst computedValue = useMemo( () => {\n\t\tconst [ parsedQuantity ] = parseQuantityAndUnitFromRawValue( value );\n\t\treturn [ parsedQuantity, unit ].join( '' );\n\t}, [ unit, value ] );\n\n\tconst min = isPx ? COVER_MIN_HEIGHT : 0;\n\n\treturn (\n\t\t<UnitControl\n\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\tid={ inputId }\n\t\t\tisResetValueOnUnitChange\n\t\t\tmin={ min }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ onUnitChange }\n\t\t\tunits={ units }\n\t\t\tvalue={ computedValue }\n\t\t/>\n\t);\n}\nexport default function CoverInspectorControls( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tsetOverlayColor,\n\tcoverRef,\n\tcurrentSettings,\n\tonSelectMedia,\n\tonUploadError,\n\ttoggleUseFeaturedImage,\n\tupdateDimRatio,\n\tonClearMedia,\n\tfeaturedImage,\n\tisSelected,\n} ) {\n\tconst {\n\t\tuseFeaturedImage,\n\t\tid,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\ttagName,\n\t\tposter,\n\t} = attributes;\n\tconst {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\turl,\n\t\toverlayColor,\n\t} = currentSettings;\n\n\tconst sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;\n\n\tconst { gradientValue, setGradient } = __experimentalUseGradient();\n\tconst { imageSizes, selectedStyleState, hasSelectedStyleState } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSettings,\n\t\t\t\tgetSelectedBlockStyleState,\n\t\t\t\thasSelectedBlockStyleState,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\timageSizes: getSettings()?.imageSizes,\n\t\t\t\tselectedStyleState: getSelectedBlockStyleState( clientId ),\n\t\t\t\thasSelectedStyleState: hasSelectedBlockStyleState( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst selectedStyleStateKey = getStyleStateKey( selectedStyleState );\n\tconst stateMinHeight = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'minHeight',\n\t\tstyleKey: 'minHeight',\n\t\trootValue: undefined,\n\t} );\n\tconst [ stateMinHeightValue, stateMinHeightUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( stateMinHeight || '' );\n\tconst activeMinHeight = hasSelectedStyleState\n\t\t? stateMinHeightValue\n\t\t: minHeight;\n\tconst activeMinHeightUnit = hasSelectedStyleState\n\t\t? stateMinHeightUnit || minHeightUnit\n\t\t: minHeightUnit;\n\tconst activeAspectRatio = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'aspectRatio',\n\t\trootValue: attributes?.style?.dimensions?.aspectRatio,\n\t} );\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isImageBackground\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\tid,\n\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t)\n\t\t\t\t: null,\n\t\t[ id, isImageBackground ]\n\t);\n\n\tconst currentBackgroundImage = useFeaturedImage ? featuredImage : image;\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl =\n\t\t\tcurrentBackgroundImage?.media_details?.sizes?.[ newSizeSlug ]\n\t\t\t\t?.source_url;\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\turl: newUrl,\n\t\t\tsizeSlug: newSizeSlug,\n\t\t} );\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t?.filter(\n\t\t\t( { slug } ) =>\n\t\t\t\tcurrentBackgroundImage?.media_details?.sizes?.[ slug ]\n\t\t\t\t\t?.source_url\n\t\t)\n\t\t?.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\tconst toggleParallax = () => {\n\t\tsetAttributes( {\n\t\t\thasParallax: ! hasParallax,\n\t\t\t...( ! hasParallax ? { focalPoint: undefined } : {} ),\n\t\t} );\n\t};\n\n\tconst toggleIsRepeated = () => {\n\t\tsetAttributes( {\n\t\t\tisRepeated: ! isRepeated,\n\t\t} );\n\t};\n\n\tconst showFocalPointPicker = isVideoBackground || isImageBackground;\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst [ styleOfRef, property ] = mediaElement.current\n\t\t\t? [ mediaElement.current.style, 'objectPosition' ]\n\t\t\t: [ coverRef.current.style, 'backgroundPosition' ];\n\t\tstyleOfRef[ property ] = mediaPosition( value );\n\t};\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\tconst showOverlayControls =\n\t\tcolorGradientSettings.hasColorsOrGradients && ! hasSelectedStyleState;\n\n\tconst setMinHeightAttributes = ( nextMinHeight, nextUnit ) => {\n\t\tif ( hasSelectedStyleState ) {\n\t\t\tsetAttributes(\n\t\t\t\tgetDimensionUpdateAttributes( {\n\t\t\t\t\tstyle: attributes.style,\n\t\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\t\thasSelectedStyleState,\n\t\t\t\t\tnextDimensions: {\n\t\t\t\t\t\tminHeight:\n\t\t\t\t\t\t\tnextMinHeight === undefined\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: `${ nextMinHeight }${\n\t\t\t\t\t\t\t\t\t\tnextUnit || activeMinHeightUnit || 'px'\n\t\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t},\n\t\t\t\t} )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tminHeight: nextMinHeight,\n\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t...attributes?.style,\n\t\t\t\tdimensions: {\n\t\t\t\t\t...attributes?.style?.dimensions,\n\t\t\t\t\taspectRatio: undefined, // Reset aspect ratio when minHeight is set.\n\t\t\t\t},\n\t\t\t} ),\n\t\t} );\n\t};\n\n\tconst getResetMinHeightAttributes = ( attrs = attributes ) => {\n\t\treturn getDimensionResetAttributes( {\n\t\t\tstyle: attrs.style,\n\t\t\tselectedState: selectedStyleState,\n\t\t\thasSelectedStyleState,\n\t\t\tkeys: [ 'minHeight' ],\n\t\t\tdefaultAttributes: {\n\t\t\t\tminHeight: undefined,\n\t\t\t\tminHeightUnit: undefined,\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t/*\n\t * Rendered whether or not media has been set, so that a cover in its setup\n\t * state can be given media from the inspector as well as from the toolbar.\n\t * The settings below stay behind their own condition, having nothing to\n\t * configure until there is media to configure.\n\t */\n\tconst mediaInspectorPanel = isSelected ? (\n\t\t<InspectorControls group=\"content\">\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\tresetAll={ onClearMedia }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\t\thasValue={ () => !! url || !! useFeaturedImage }\n\t\t\t\t\tonDeselect={ onClearMedia }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<MediaControl\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaUrl={ url }\n\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\timage?.media_details?.sizes?.full?.file ||\n\t\t\t\t\t\t\timage?.slug ||\n\t\t\t\t\t\t\tgetFilename( url )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tonSelect={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\tonReset={ onClearMedia }\n\t\t\t\t\t\tuseFeaturedImage={ useFeaturedImage }\n\t\t\t\t\t\tonToggleFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t\temptyLabel={ __( 'Add media' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t{ mediaInspectorPanel }\n\t\t\t{ ( !! url || useFeaturedImage ) && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\tisRepeated: false,\n\t\t\t\t\t\t\t\talt: '',\n\t\t\t\t\t\t\t\tposter: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isImageBackground && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => !! hasParallax }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ !! hasParallax }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleParallax }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => isRepeated }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tisRepeated: false,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ isRepeated }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showFocalPointPicker && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isVideoBackground && (\n\t\t\t\t\t\t\t<PosterImage\n\t\t\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tposter: posterImage?.url,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! useFeaturedImage && url && ! isVideoBackground && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: '' } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WCTextareaControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\t\t\t\tonChange={ ( newAlt ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( { alt: newAlt } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Leave empty if decorative.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ !! imageSizeOptions?.length && (\n\t\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ showOverlayControls && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolorValue: overlayColor.color,\n\t\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\t\tlabel: __( 'Overlay' ),\n\t\t\t\t\t\t\t\tonColorChange: setOverlayColor,\n\t\t\t\t\t\t\t\tonGradientChange: setGradient,\n\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\t\t\t\t\toverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tcustomOverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t\t\tcustomGradient: undefined,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\t\tclearable: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => {\n\t\t\t\t\t\t\t// If there's a media background the dimRatio will be\n\t\t\t\t\t\t\t// defaulted to 50 whereas it will be 100 for colors.\n\t\t\t\t\t\t\treturn dimRatio === undefined\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: dimRatio !== ( url ? 50 : 100 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\tonDeselect={ () => updateDimRatio( url ? 50 : 100 ) }\n\t\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\t\tdimRatio: url ? 50 : 100,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\t\tvalue={ dimRatio }\n\t\t\t\t\t\t\tonChange={ ( newDimRatio ) =>\n\t\t\t\t\t\t\t\tupdateDimRatio( newDimRatio )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\tstep={ 10 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tkey={ selectedStyleStateKey }\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\thasValue={ () => !! activeMinHeight }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( getResetMinHeightAttributes() )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ getResetMinHeightAttributes }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<CoverHeightInput\n\t\t\t\t\t\tvalue={ activeAspectRatio ? '' : activeMinHeight }\n\t\t\t\t\t\tunit={ activeMinHeightUnit }\n\t\t\t\t\t\tonChange={ ( newMinHeight ) =>\n\t\t\t\t\t\t\tsetMinHeightAttributes( newMinHeight )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonUnitChange={ ( nextUnit ) => {\n\t\t\t\t\t\t\tif ( hasSelectedStyleState ) {\n\t\t\t\t\t\t\t\tif ( activeMinHeight !== undefined ) {\n\t\t\t\t\t\t\t\t\tsetMinHeightAttributes(\n\t\t\t\t\t\t\t\t\t\tactiveMinHeight,\n\t\t\t\t\t\t\t\t\t\tnextUnit\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeightUnit: nextUnit,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AACxB;AAAA,EACC;AAAA,EACA;AAA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