@wordpress/block-library 9.5.0 → 9.6.1
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 +2 -0
- package/build/archives/edit.js +1 -0
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +1 -0
- package/build/audio/edit.js.map +1 -1
- package/build/avatar/user-control.js +1 -0
- package/build/avatar/user-control.js.map +1 -1
- package/build/button/edit.js +1 -0
- package/build/button/edit.js.map +1 -1
- package/build/comment-author-name/index.js +14 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +14 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +14 -1
- package/build/comment-date/index.js.map +1 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +0 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/embed/edit.js +12 -4
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-placeholder.js +6 -3
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/embed-preview.js +4 -18
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/index.js +12 -0
- package/build/file/index.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/form/edit.js +2 -0
- package/build/form/edit.js.map +1 -1
- package/build/form-input/edit.js +1 -0
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js +2 -6
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js +4 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/group/edit.js +1 -1
- package/build/group/edit.js.map +1 -1
- package/build/image/image.js +6 -1
- package/build/image/image.js.map +1 -1
- package/build/image/transforms.js +4 -0
- package/build/image/transforms.js.map +1 -1
- package/build/latest-posts/edit.js +37 -11
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/index.js +9 -0
- package/build/list/index.js.map +1 -1
- package/build/list-item/index.js +8 -1
- package/build/list-item/index.js.map +1 -1
- package/build/media-text/edit.js +0 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/missing/edit.js +10 -19
- package/build/missing/edit.js.map +1 -1
- package/build/navigation/edit/index.js +3 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-name-control.js +1 -0
- package/build/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +2 -0
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/post-author/edit.js +60 -53
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +13 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +14 -1
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +14 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comment/edit.js +2 -0
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -0
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +9 -2
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -0
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/edit.js +5 -2
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-terms/edit.js +1 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-title/edit.js +1 -0
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/index.js +12 -0
- package/build/preformatted/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +1 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/query-content.js +1 -1
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +1 -0
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/index.js +12 -0
- package/build/query-title/index.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/transforms.js +4 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/search/edit.js +9 -5
- package/build/search/edit.js.map +1 -1
- package/build/social-link/edit.js +2 -0
- package/build/social-link/edit.js.map +1 -1
- package/build/table/edit.js +6 -5
- package/build/table/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +44 -33
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +12 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -0
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/video/edit-common-settings.js +1 -0
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +3 -0
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/transforms.js +4 -0
- package/build/video/transforms.js.map +1 -1
- package/build-module/archives/edit.js +1 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +1 -0
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +1 -0
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/button/edit.js +1 -0
- package/build-module/button/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +14 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +14 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +14 -1
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +0 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/embed/edit.js +13 -5
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +7 -4
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/embed-preview.js +5 -19
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/index.js +12 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/form/edit.js +2 -0
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form-input/edit.js +1 -0
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js +3 -7
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js +4 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/image/image.js +7 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/transforms.js +5 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/latest-posts/edit.js +40 -14
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/index.js +9 -0
- package/build-module/list/index.js.map +1 -1
- package/build-module/list-item/index.js +8 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/media-text/edit.js +0 -1
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/missing/edit.js +10 -19
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/navigation/edit/index.js +3 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-name-control.js +1 -0
- package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +2 -0
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/post-author/edit.js +61 -54
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +13 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +14 -1
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +14 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comment/edit.js +2 -0
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -0
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +9 -2
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -0
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +5 -2
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +1 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-title/edit.js +1 -0
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/preformatted/index.js +12 -0
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +1 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -1
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -0
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/index.js +12 -0
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/transforms.js +4 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/search/edit.js +10 -6
- package/build-module/search/edit.js.map +1 -1
- package/build-module/social-link/edit.js +2 -0
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/table/edit.js +6 -5
- package/build-module/table/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +45 -34
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +12 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +2 -0
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/video/edit-common-settings.js +1 -0
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +3 -0
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-module/video/transforms.js +5 -1
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/archives/editor-rtl.css +2 -2
- package/build-style/archives/editor.css +2 -2
- package/build-style/archives/style-rtl.css +2 -2
- package/build-style/archives/style.css +2 -2
- package/build-style/audio/editor-rtl.css +2 -2
- package/build-style/audio/editor.css +2 -2
- package/build-style/audio/style-rtl.css +2 -2
- package/build-style/audio/style.css +2 -2
- package/build-style/audio/theme-rtl.css +2 -2
- package/build-style/audio/theme.css +2 -2
- package/build-style/avatar/editor-rtl.css +2 -2
- package/build-style/avatar/editor.css +2 -2
- package/build-style/avatar/style-rtl.css +2 -2
- package/build-style/avatar/style.css +2 -2
- package/build-style/button/editor-rtl.css +2 -2
- package/build-style/button/editor.css +2 -2
- package/build-style/button/style-rtl.css +2 -2
- package/build-style/button/style.css +2 -2
- package/build-style/buttons/editor-rtl.css +2 -2
- package/build-style/buttons/editor.css +2 -2
- package/build-style/buttons/style-rtl.css +2 -2
- package/build-style/buttons/style.css +2 -2
- package/build-style/calendar/style-rtl.css +2 -2
- package/build-style/calendar/style.css +2 -2
- package/build-style/categories/editor-rtl.css +2 -2
- package/build-style/categories/editor.css +2 -2
- package/build-style/categories/style-rtl.css +2 -2
- package/build-style/categories/style.css +2 -2
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/code/editor-rtl.css +2 -2
- package/build-style/code/editor.css +2 -2
- package/build-style/code/style-rtl.css +2 -2
- package/build-style/code/style.css +2 -2
- package/build-style/code/theme-rtl.css +2 -2
- package/build-style/code/theme.css +2 -2
- package/build-style/columns/editor-rtl.css +2 -2
- package/build-style/columns/editor.css +2 -2
- package/build-style/columns/style-rtl.css +2 -2
- package/build-style/columns/style.css +2 -2
- package/build-style/comment-author-avatar/editor-rtl.css +2 -2
- package/build-style/comment-author-avatar/editor.css +2 -2
- package/build-style/comment-author-name/style-rtl.css +94 -0
- package/build-style/comment-author-name/style.css +94 -0
- package/build-style/comment-content/style-rtl.css +6 -2
- package/build-style/comment-content/style.css +6 -2
- package/build-style/comment-date/style-rtl.css +94 -0
- package/build-style/comment-date/style.css +94 -0
- package/build-style/comment-template/style-rtl.css +2 -2
- package/build-style/comment-template/style.css +2 -2
- package/build-style/comments/editor-rtl.css +2 -2
- package/build-style/comments/editor.css +2 -2
- package/build-style/comments/style-rtl.css +2 -2
- package/build-style/comments/style.css +2 -2
- package/build-style/comments-pagination/editor-rtl.css +2 -2
- package/build-style/comments-pagination/editor.css +2 -2
- package/build-style/comments-pagination/style-rtl.css +2 -2
- package/build-style/comments-pagination/style.css +2 -2
- package/build-style/comments-pagination-numbers/editor-rtl.css +2 -2
- package/build-style/comments-pagination-numbers/editor.css +2 -2
- package/build-style/comments-title/editor-rtl.css +2 -2
- package/build-style/comments-title/editor.css +2 -2
- package/build-style/common-rtl.css +2 -2
- package/build-style/common.css +2 -2
- package/build-style/cover/editor-rtl.css +2 -2
- package/build-style/cover/editor.css +2 -2
- package/build-style/cover/style-rtl.css +2 -2
- package/build-style/cover/style.css +2 -2
- package/build-style/details/editor-rtl.css +2 -2
- package/build-style/details/editor.css +2 -2
- package/build-style/details/style-rtl.css +2 -2
- package/build-style/details/style.css +2 -2
- package/build-style/editor-elements-rtl.css +2 -2
- package/build-style/editor-elements.css +2 -2
- package/build-style/editor-rtl.css +31 -15
- package/build-style/editor.css +31 -15
- package/build-style/elements-rtl.css +2 -2
- package/build-style/elements.css +2 -2
- package/build-style/embed/editor-rtl.css +5 -2
- package/build-style/embed/editor.css +5 -2
- package/build-style/embed/style-rtl.css +2 -2
- package/build-style/embed/style.css +2 -2
- package/build-style/embed/theme-rtl.css +2 -2
- package/build-style/embed/theme.css +2 -2
- package/build-style/file/editor-rtl.css +2 -2
- package/build-style/file/editor.css +2 -2
- package/build-style/file/style-rtl.css +2 -2
- package/build-style/file/style.css +2 -2
- package/build-style/footnotes/style-rtl.css +2 -2
- package/build-style/footnotes/style.css +2 -2
- package/build-style/form-input/editor-rtl.css +2 -2
- package/build-style/form-input/editor.css +2 -2
- package/build-style/form-input/style-rtl.css +2 -2
- package/build-style/form-input/style.css +2 -2
- package/build-style/form-submission-notification/editor-rtl.css +2 -2
- package/build-style/form-submission-notification/editor.css +2 -2
- package/build-style/form-submit-button/style-rtl.css +2 -2
- package/build-style/form-submit-button/style.css +2 -2
- package/build-style/freeform/editor-rtl.css +2 -2
- package/build-style/freeform/editor.css +2 -2
- package/build-style/gallery/editor-rtl.css +2 -2
- package/build-style/gallery/editor.css +2 -2
- package/build-style/gallery/style-rtl.css +26 -9
- package/build-style/gallery/style.css +26 -9
- package/build-style/gallery/theme-rtl.css +2 -2
- package/build-style/gallery/theme.css +2 -2
- package/build-style/group/editor-rtl.css +2 -2
- package/build-style/group/editor.css +2 -2
- package/build-style/group/style-rtl.css +2 -2
- package/build-style/group/style.css +2 -2
- package/build-style/group/theme-rtl.css +2 -2
- package/build-style/group/theme.css +2 -2
- package/build-style/heading/style-rtl.css +2 -2
- package/build-style/heading/style.css +2 -2
- package/build-style/html/editor-rtl.css +2 -2
- package/build-style/html/editor.css +2 -2
- package/build-style/image/editor-rtl.css +2 -2
- package/build-style/image/editor.css +2 -2
- package/build-style/image/style-rtl.css +2 -2
- package/build-style/image/style.css +2 -2
- package/build-style/image/theme-rtl.css +2 -2
- package/build-style/image/theme.css +2 -2
- package/build-style/latest-comments/style-rtl.css +2 -2
- package/build-style/latest-comments/style.css +2 -2
- package/build-style/latest-posts/editor-rtl.css +9 -6
- package/build-style/latest-posts/editor.css +9 -6
- package/build-style/latest-posts/style-rtl.css +2 -2
- package/build-style/latest-posts/style.css +2 -2
- package/build-style/list/style-rtl.css +2 -2
- package/build-style/list/style.css +2 -2
- package/build-style/loginout/style-rtl.css +2 -2
- package/build-style/loginout/style.css +2 -2
- package/build-style/media-text/editor-rtl.css +2 -2
- package/build-style/media-text/editor.css +2 -2
- package/build-style/media-text/style-rtl.css +2 -2
- package/build-style/media-text/style.css +2 -2
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +6 -2
- package/build-style/navigation/editor.css +6 -2
- package/build-style/navigation/style-rtl.css +2 -2
- package/build-style/navigation/style.css +2 -2
- package/build-style/navigation-link/editor-rtl.css +2 -5
- package/build-style/navigation-link/editor.css +2 -5
- package/build-style/navigation-link/style-rtl.css +2 -2
- package/build-style/navigation-link/style.css +2 -2
- package/build-style/navigation-submenu/editor-rtl.css +2 -2
- package/build-style/navigation-submenu/editor.css +2 -2
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/page-list/editor-rtl.css +2 -2
- package/build-style/page-list/editor.css +2 -2
- package/build-style/page-list/style-rtl.css +2 -2
- package/build-style/page-list/style.css +2 -2
- package/build-style/paragraph/editor-rtl.css +2 -2
- package/build-style/paragraph/editor.css +2 -2
- package/build-style/paragraph/style-rtl.css +2 -2
- package/build-style/paragraph/style.css +2 -2
- package/build-style/post-author/editor-rtl.css +95 -0
- package/build-style/post-author/editor.css +95 -0
- package/build-style/post-author/style-rtl.css +3 -2
- package/build-style/post-author/style.css +3 -2
- package/build-style/post-author-biography/style-rtl.css +94 -0
- package/build-style/post-author-biography/style.css +94 -0
- package/build-style/post-author-name/style-rtl.css +94 -0
- package/build-style/post-author-name/style.css +94 -0
- package/build-style/post-comments-form/editor-rtl.css +2 -2
- package/build-style/post-comments-form/editor.css +2 -2
- package/build-style/post-comments-form/style-rtl.css +2 -2
- package/build-style/post-comments-form/style.css +2 -2
- package/build-style/post-content/editor-rtl.css +2 -2
- package/build-style/post-content/editor.css +2 -2
- package/build-style/post-content/style-rtl.css +2 -2
- package/build-style/post-content/style.css +2 -2
- package/build-style/post-date/style-rtl.css +2 -2
- package/build-style/post-date/style.css +2 -2
- package/build-style/post-excerpt/editor-rtl.css +2 -2
- package/build-style/post-excerpt/editor.css +2 -2
- package/build-style/post-excerpt/style-rtl.css +2 -2
- package/build-style/post-excerpt/style.css +2 -2
- package/build-style/post-featured-image/editor-rtl.css +2 -2
- package/build-style/post-featured-image/editor.css +2 -2
- package/build-style/post-featured-image/style-rtl.css +2 -2
- package/build-style/post-featured-image/style.css +2 -2
- package/build-style/post-navigation-link/style-rtl.css +2 -2
- package/build-style/post-navigation-link/style.css +2 -2
- package/build-style/post-template/editor-rtl.css +2 -2
- package/build-style/post-template/editor.css +2 -2
- package/build-style/post-template/style-rtl.css +2 -2
- package/build-style/post-template/style.css +2 -2
- package/build-style/post-terms/style-rtl.css +2 -2
- package/build-style/post-terms/style.css +2 -2
- package/build-style/post-time-to-read/style-rtl.css +2 -2
- package/build-style/post-time-to-read/style.css +2 -2
- package/build-style/post-title/style-rtl.css +2 -2
- package/build-style/post-title/style.css +2 -2
- package/build-style/preformatted/style-rtl.css +2 -2
- package/build-style/preformatted/style.css +2 -2
- package/build-style/pullquote/editor-rtl.css +2 -2
- package/build-style/pullquote/editor.css +2 -2
- package/build-style/pullquote/style-rtl.css +2 -2
- package/build-style/pullquote/style.css +2 -2
- package/build-style/pullquote/theme-rtl.css +2 -2
- package/build-style/pullquote/theme.css +2 -2
- package/build-style/query/editor-rtl.css +2 -2
- package/build-style/query/editor.css +2 -2
- package/build-style/query-pagination/editor-rtl.css +2 -2
- package/build-style/query-pagination/editor.css +2 -2
- package/build-style/query-pagination/style-rtl.css +2 -2
- package/build-style/query-pagination/style.css +2 -2
- package/build-style/query-pagination-numbers/editor-rtl.css +2 -2
- package/build-style/query-pagination-numbers/editor.css +2 -2
- package/build-style/query-title/style-rtl.css +2 -2
- package/build-style/query-title/style.css +2 -2
- package/build-style/quote/style-rtl.css +2 -2
- package/build-style/quote/style.css +2 -2
- package/build-style/quote/theme-rtl.css +2 -2
- package/build-style/quote/theme.css +2 -2
- package/build-style/read-more/style-rtl.css +2 -2
- package/build-style/read-more/style.css +2 -2
- package/build-style/reset-rtl.css +2 -2
- package/build-style/reset.css +2 -2
- package/build-style/rss/editor-rtl.css +2 -2
- package/build-style/rss/editor.css +2 -2
- package/build-style/rss/style-rtl.css +2 -2
- package/build-style/rss/style.css +2 -2
- package/build-style/search/editor-rtl.css +5 -4
- package/build-style/search/editor.css +5 -4
- package/build-style/search/style-rtl.css +2 -2
- package/build-style/search/style.css +2 -2
- package/build-style/search/theme-rtl.css +2 -2
- package/build-style/search/theme.css +2 -2
- package/build-style/separator/editor-rtl.css +2 -2
- package/build-style/separator/editor.css +2 -2
- package/build-style/separator/style-rtl.css +2 -2
- package/build-style/separator/style.css +2 -2
- package/build-style/separator/theme-rtl.css +2 -2
- package/build-style/separator/theme.css +2 -2
- package/build-style/shortcode/editor-rtl.css +2 -2
- package/build-style/shortcode/editor.css +2 -2
- package/build-style/site-logo/editor-rtl.css +2 -2
- package/build-style/site-logo/editor.css +2 -2
- package/build-style/site-logo/style-rtl.css +2 -2
- package/build-style/site-logo/style.css +2 -2
- package/build-style/site-tagline/editor-rtl.css +2 -2
- package/build-style/site-tagline/editor.css +2 -2
- package/build-style/site-tagline/style-rtl.css +2 -2
- package/build-style/site-tagline/style.css +2 -2
- package/build-style/site-title/editor-rtl.css +2 -2
- package/build-style/site-title/editor.css +2 -2
- package/build-style/site-title/style-rtl.css +2 -2
- package/build-style/site-title/style.css +2 -2
- package/build-style/social-link/editor-rtl.css +2 -2
- package/build-style/social-link/editor.css +2 -2
- package/build-style/social-links/editor-rtl.css +2 -2
- package/build-style/social-links/editor.css +2 -2
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/spacer/editor-rtl.css +2 -2
- package/build-style/spacer/editor.css +2 -2
- package/build-style/spacer/style-rtl.css +2 -2
- package/build-style/spacer/style.css +2 -2
- package/build-style/style-rtl.css +53 -9
- package/build-style/style.css +53 -9
- package/build-style/table/editor-rtl.css +2 -2
- package/build-style/table/editor.css +2 -2
- package/build-style/table/style-rtl.css +2 -2
- package/build-style/table/style.css +2 -2
- package/build-style/table/theme-rtl.css +2 -2
- package/build-style/table/theme.css +2 -2
- package/build-style/table-of-contents/style-rtl.css +2 -2
- package/build-style/table-of-contents/style.css +2 -2
- package/build-style/tag-cloud/editor-rtl.css +9 -2
- package/build-style/tag-cloud/editor.css +9 -2
- package/build-style/tag-cloud/style-rtl.css +2 -2
- package/build-style/tag-cloud/style.css +2 -2
- package/build-style/template-part/editor-rtl.css +2 -6
- package/build-style/template-part/editor.css +2 -6
- package/build-style/template-part/theme-rtl.css +2 -2
- package/build-style/template-part/theme.css +2 -2
- package/build-style/term-description/style-rtl.css +2 -2
- package/build-style/term-description/style.css +2 -2
- package/build-style/text-columns/editor-rtl.css +2 -2
- package/build-style/text-columns/editor.css +2 -2
- package/build-style/text-columns/style-rtl.css +2 -2
- package/build-style/text-columns/style.css +2 -2
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/build-style/verse/style-rtl.css +2 -2
- package/build-style/verse/style.css +2 -2
- package/build-style/video/editor-rtl.css +2 -2
- package/build-style/video/editor.css +2 -2
- package/build-style/video/style-rtl.css +2 -2
- package/build-style/video/style.css +2 -2
- package/build-style/video/theme-rtl.css +2 -2
- package/build-style/video/theme.css +2 -2
- package/package.json +35 -35
- package/src/archives/edit.js +1 -0
- package/src/audio/edit.js +4 -3
- package/src/avatar/user-control.js +1 -0
- package/src/button/edit.js +1 -0
- package/src/comment-author-name/block.json +14 -1
- package/src/comment-author-name/style.scss +4 -0
- package/src/comment-content/block.json +14 -1
- package/src/comment-content/style.scss +5 -0
- package/src/comment-date/block.json +14 -1
- package/src/comment-date/index.php +1 -1
- package/src/comment-date/style.scss +4 -0
- package/src/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/src/cover/edit/inspector-controls.js +0 -1
- package/src/editor.scss +1 -0
- package/src/embed/edit.js +10 -1
- package/src/embed/editor.scss +4 -0
- package/src/embed/embed-placeholder.js +7 -4
- package/src/embed/embed-preview.js +3 -37
- package/src/file/block.json +12 -0
- package/src/file/inspector.js +1 -0
- package/src/form/edit.js +2 -0
- package/src/form/index.php +2 -2
- package/src/form-input/edit.js +1 -0
- package/src/gallery/edit.js +5 -9
- package/src/gallery/editor.scss +1 -1
- package/src/gallery/gallery.native.js +2 -1
- package/src/gallery/style.scss +33 -7
- package/src/group/edit.js +1 -1
- package/src/image/image.js +7 -1
- package/src/image/transforms.js +7 -1
- package/src/latest-posts/edit.js +60 -17
- package/src/latest-posts/editor.scss +11 -6
- package/src/list/block.json +9 -0
- package/src/list-item/block.json +8 -1
- package/src/media-text/edit.js +0 -1
- package/src/missing/edit.js +12 -18
- package/src/navigation/edit/index.js +3 -3
- package/src/navigation/edit/navigation-menu-name-control.js +1 -0
- package/src/navigation/edit/overlay-menu-preview.js +2 -0
- package/src/navigation/editor.scss +5 -0
- package/src/navigation/index.php +10 -27
- package/src/navigation-link/editor.scss +0 -3
- package/src/post-author/block.json +13 -0
- package/src/post-author/edit.js +68 -57
- package/src/post-author/editor.scss +7 -0
- package/src/post-author/style.scss +1 -0
- package/src/post-author-biography/block.json +14 -1
- package/src/post-author-biography/style.scss +4 -0
- package/src/post-author-name/block.json +14 -1
- package/src/post-author-name/style.scss +4 -0
- package/src/post-comment/edit.js +2 -0
- package/src/post-date/index.php +3 -3
- package/src/post-excerpt/edit.js +1 -0
- package/src/post-featured-image/dimension-controls.js +5 -0
- package/src/post-featured-image/edit.js +1 -0
- package/src/post-navigation-link/edit.js +6 -2
- package/src/post-terms/edit.js +1 -0
- package/src/post-title/edit.js +1 -0
- package/src/preformatted/block.json +12 -0
- package/src/query/edit/inspector-controls/parent-control.js +1 -0
- package/src/query/edit/query-content.js +1 -1
- package/src/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/src/query-pagination-numbers/edit.js +1 -0
- package/src/query-title/block.json +12 -0
- package/src/quote/block.json +1 -0
- package/src/quote/test/transforms.native.js +1 -1
- package/src/quote/transforms.js +11 -2
- package/src/search/edit.js +9 -9
- package/src/search/editor.scss +5 -2
- package/src/social-link/edit.js +2 -0
- package/src/style.scss +5 -0
- package/src/table/edit.js +5 -4
- package/src/tag-cloud/block.json +12 -0
- package/src/tag-cloud/edit.js +46 -34
- package/src/tag-cloud/editor.scss +11 -1
- package/src/template-part/edit/advanced-controls.js +2 -0
- package/src/template-part/editor.scss +0 -5
- package/src/video/edit-common-settings.js +1 -0
- package/src/video/edit.js +2 -2
- package/src/video/tracks-editor.js +3 -0
- package/src/video/transforms.js +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","defaultColumnsNumber","styles","__","sprintf","BlockCaption","RichText","useInnerBlocksProps","useState","useEffect","mediaUploadSync","WIDE_ALIGNMENTS","useResizeObserver","jsx","_jsx","jsxs","_jsxs","TILE_SPACING","MAX_DISPLAYED_COLUMNS","MAX_DISPLAYED_COLUMNS_NARROW","Gallery","props","isCaptionSelected","setIsCaptionSelected","resizeObserver","sizes","maxWidth","setMaxWidth","mediaPlaceholder","attributes","images","isNarrow","onBlur","insertBlocksAfter","clientId","width","align","columns","length","displayedColumns","Math","min","innerBlocksProps","contentResizeMode","orientation","renderAppender","numColumns","marginHorizontal","marginVertical","layout","type","alignments","gridProperties","parentWidth","focusGalleryCaption","isFullWidth","full","style","fullWidth","children","galleryAppender","isSelected","accessible","accessibilityLabelCreator","caption","isEmpty","onFocus"],"sources":["@wordpress/block-library/src/gallery/gallery.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport { defaultColumnsNumber } from './shared';\nimport styles from './gallery-styles.scss';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockCaption,\n\tRichText,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { mediaUploadSync } from '@wordpress/react-native-bridge';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst TILE_SPACING = 8;\n\n// we must limit displayed columns since readable content max-width is 580px\nconst MAX_DISPLAYED_COLUMNS = 4;\nconst MAX_DISPLAYED_COLUMNS_NARROW = 2;\n\nexport const Gallery = ( props ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ maxWidth, setMaxWidth ] = useState( 0 );\n\tuseEffect( mediaUploadSync, [] );\n\n\tconst {\n\t\tmediaPlaceholder,\n\t\tattributes,\n\t\timages,\n\t\tisNarrow,\n\t\tonBlur,\n\t\tinsertBlocksAfter,\n\t\tclientId,\n\t} = props;\n\n\tuseEffect( () => {\n\t\tconst { width } = sizes || {};\n\t\tif ( width ) {\n\t\t\tsetMaxWidth( width );\n\t\t}\n\t}, [ sizes ] );\n\n\tconst { align, columns = defaultColumnsNumber( images.length ) } =\n\t\tattributes;\n\n\tconst displayedColumns = Math.min(\n\t\tcolumns,\n\t\tisNarrow ? MAX_DISPLAYED_COLUMNS_NARROW : MAX_DISPLAYED_COLUMNS\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tcontentResizeMode: 'stretch',\n\t\t\torientation: 'horizontal',\n\t\t\trenderAppender: false,\n\t\t\tnumColumns: displayedColumns,\n\t\t\tmarginHorizontal: TILE_SPACING,\n\t\t\tmarginVertical: TILE_SPACING,\n\t\t\tlayout: { type: 'default', alignments: [] },\n\t\t\tgridProperties: {\n\t\t\t\tnumColumns: displayedColumns,\n\t\t\t},\n\t\t\tparentWidth: maxWidth + 2 * TILE_SPACING,\n\t\t}\n\t);\n\n\tconst focusGalleryCaption = () => {\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t};\n\n\tconst isFullWidth = align === WIDE_ALIGNMENTS.alignments.full;\n\n\treturn (\n\t\t<View style={ isFullWidth && styles.fullWidth }>\n\t\t\t{ resizeObserver }\n\t\t\t<View { ...innerBlocksProps } />\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tisFullWidth && styles.fullWidth,\n\t\t\t\t\tstyles.galleryAppender,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<BlockCaption\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\taccessible\n\t\t\t\taccessibilityLabelCreator={ ( caption ) =>\n\t\t\t\t\tRichText.isEmpty( caption )\n\t\t\t\t\t\t? /* translators: accessibility text. Empty gallery caption. */\n\n\t\t\t\t\t\t 'Gallery caption. Empty'\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: accessibility text. %s: gallery caption. */\n\t\t\t\t\t\t\t\t__( 'Gallery caption. %s' ),\n\t\t\t\t\t\t\t\tcaption\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tonFocus={ focusGalleryCaption }\n\t\t\t\tonBlur={ onBlur } // Always assign onBlur as props.\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default Gallery;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,UAAU;AAC/C,OAAOC,MAAM,MAAM,uBAAuB;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YAAY,EACZC,QAAQ,EACRC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,iBAAiB,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["View","defaultColumnsNumber","styles","__","sprintf","BlockCaption","RichText","useInnerBlocksProps","useState","useEffect","mediaUploadSync","WIDE_ALIGNMENTS","useResizeObserver","withViewportMatch","jsx","_jsx","jsxs","_jsxs","TILE_SPACING","MAX_DISPLAYED_COLUMNS","MAX_DISPLAYED_COLUMNS_NARROW","Gallery","props","isCaptionSelected","setIsCaptionSelected","resizeObserver","sizes","maxWidth","setMaxWidth","mediaPlaceholder","attributes","images","isNarrow","onBlur","insertBlocksAfter","clientId","width","align","columns","length","displayedColumns","Math","min","innerBlocksProps","contentResizeMode","orientation","renderAppender","numColumns","marginHorizontal","marginVertical","layout","type","alignments","gridProperties","parentWidth","focusGalleryCaption","isFullWidth","full","style","fullWidth","children","galleryAppender","isSelected","accessible","accessibilityLabelCreator","caption","isEmpty","onFocus"],"sources":["@wordpress/block-library/src/gallery/gallery.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport { defaultColumnsNumber } from './shared';\nimport styles from './gallery-styles.scss';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockCaption,\n\tRichText,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { mediaUploadSync } from '@wordpress/react-native-bridge';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\nimport { useResizeObserver } from '@wordpress/compose';\nimport { withViewportMatch } from '@wordpress/viewport';\n\nconst TILE_SPACING = 8;\n\n// we must limit displayed columns since readable content max-width is 580px\nconst MAX_DISPLAYED_COLUMNS = 4;\nconst MAX_DISPLAYED_COLUMNS_NARROW = 2;\n\nexport const Gallery = ( props ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ maxWidth, setMaxWidth ] = useState( 0 );\n\tuseEffect( mediaUploadSync, [] );\n\n\tconst {\n\t\tmediaPlaceholder,\n\t\tattributes,\n\t\timages,\n\t\tisNarrow,\n\t\tonBlur,\n\t\tinsertBlocksAfter,\n\t\tclientId,\n\t} = props;\n\n\tuseEffect( () => {\n\t\tconst { width } = sizes || {};\n\t\tif ( width ) {\n\t\t\tsetMaxWidth( width );\n\t\t}\n\t}, [ sizes ] );\n\n\tconst { align, columns = defaultColumnsNumber( images.length ) } =\n\t\tattributes;\n\n\tconst displayedColumns = Math.min(\n\t\tcolumns,\n\t\tisNarrow ? MAX_DISPLAYED_COLUMNS_NARROW : MAX_DISPLAYED_COLUMNS\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tcontentResizeMode: 'stretch',\n\t\t\torientation: 'horizontal',\n\t\t\trenderAppender: false,\n\t\t\tnumColumns: displayedColumns,\n\t\t\tmarginHorizontal: TILE_SPACING,\n\t\t\tmarginVertical: TILE_SPACING,\n\t\t\tlayout: { type: 'default', alignments: [] },\n\t\t\tgridProperties: {\n\t\t\t\tnumColumns: displayedColumns,\n\t\t\t},\n\t\t\tparentWidth: maxWidth + 2 * TILE_SPACING,\n\t\t}\n\t);\n\n\tconst focusGalleryCaption = () => {\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t};\n\n\tconst isFullWidth = align === WIDE_ALIGNMENTS.alignments.full;\n\n\treturn (\n\t\t<View style={ isFullWidth && styles.fullWidth }>\n\t\t\t{ resizeObserver }\n\t\t\t<View { ...innerBlocksProps } />\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tisFullWidth && styles.fullWidth,\n\t\t\t\t\tstyles.galleryAppender,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<BlockCaption\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\taccessible\n\t\t\t\taccessibilityLabelCreator={ ( caption ) =>\n\t\t\t\t\tRichText.isEmpty( caption )\n\t\t\t\t\t\t? /* translators: accessibility text. Empty gallery caption. */\n\n\t\t\t\t\t\t 'Gallery caption. Empty'\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: accessibility text. %s: gallery caption. */\n\t\t\t\t\t\t\t\t__( 'Gallery caption. %s' ),\n\t\t\t\t\t\t\t\tcaption\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tonFocus={ focusGalleryCaption }\n\t\t\t\tonBlur={ onBlur } // Always assign onBlur as props.\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default withViewportMatch( { isNarrow: '< small' } )( Gallery );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,UAAU;AAC/C,OAAOC,MAAM,MAAM,uBAAuB;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YAAY,EACZC,QAAQ,EACRC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,iBAAiB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExD,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,4BAA4B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P;IACb,CAAC;IACDc,WAAW,EAAE3B,QAAQ,GAAG,CAAC,GAAGT;EAC7B,CACD,CAAC;EAED,MAAMqC,mBAAmB,GAAGA,CAAA,KAAM;IACjC,IAAK,CAAEhC,iBAAiB,EAAG;MAC1BC,oBAAoB,CAAE,IAAK,CAAC;IAC7B;EACD,CAAC;EAED,MAAMgC,WAAW,GAAGnB,KAAK,KAAK1B,eAAe,CAACyC,UAAU,CAACK,IAAI;EAE7D,oBACCxC,KAAA,CAACjB,IAAI;IAAC0D,KAAK,EAAGF,WAAW,IAAItD,MAAM,CAACyD,SAAW;IAAAC,QAAA,GAC5CnC,cAAc,eAChBV,IAAA,CAACf,IAAI;MAAA,GAAM2C;IAAgB,CAAI,CAAC,eAChC5B,IAAA,CAACf,IAAI;MACJ0D,KAAK,EAAG,CACPF,WAAW,IAAItD,MAAM,CAACyD,SAAS,EAC/BzD,MAAM,CAAC2D,eAAe,CACpB;MAAAD,QAAA,EAED/B;IAAgB,CACb,CAAC,eACPd,IAAA,CAACV,YAAY;MACZ8B,QAAQ,EAAGA,QAAU;MACrB2B,UAAU,EAAGvC,iBAAmB;MAChCwC,UAAU;MACVC,yBAAyB,EAAKC,OAAO,IACpC3D,QAAQ,CAAC4D,OAAO,CAAED,OAAQ,CAAC,GACxB;;MAEA,wBAAwB,GACxB7D,OAAO,EACP;MACAD,EAAE,CAAE,qBAAsB,CAAC,EAC3B8D,OACA,CACH;MACDE,OAAO,EAAGZ,mBAAqB;MAC/BtB,MAAM,EAAGA,MAAQ,CAAC;MAAA;MAClBC,iBAAiB,EAAGA;IAAmB,CACvC,CAAC;EAAA,CACG,CAAC;AAET,CAAC;AAED,eAAerB,iBAAiB,CAAE;EAAEmB,QAAQ,EAAE;AAAU,CAAE,CAAC,CAAEX,OAAQ,CAAC","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ function GroupEditControls({
|
|
|
31
31
|
}) {
|
|
32
32
|
const htmlElementMessages = {
|
|
33
33
|
header: __('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
|
|
34
|
-
main: __('The <main> element should be used for the primary content of your document only.
|
|
34
|
+
main: __('The <main> element should be used for the primary content of your document only.'),
|
|
35
35
|
section: __("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
|
|
36
36
|
article: __('The <article> element should represent a self-contained, syndicatable portion of the document.'),
|
|
37
37
|
aside: __("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","InnerBlocks","useBlockProps","InspectorControls","useInnerBlocksProps","store","blockEditorStore","SelectControl","useRef","__","View","GroupPlaceHolder","useShouldShowPlaceHolder","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","GroupEditControls","tagName","onSelectTagName","htmlElementMessages","header","main","section","article","aside","footer","group","children","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help","GroupEdit","attributes","name","setAttributes","clientId","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","block","innerBlocks","length","supportsLayout","TagName","templateLock","allowedBlocks","layout","type","layoutSupportEnabled","ref","blockProps","showPlaceholder","setShowPlaceholder","usedLayoutType","renderAppender","ButtonBlockAppender","innerBlocksProps","className","dropZoneElement","current","selectBlock","selectVariation","nextVariation","onSelect"],"sources":["@wordpress/block-library/src/group/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport GroupPlaceHolder, { useShouldShowPlaceHolder } from './placeholder';\n\n/**\n * Render inspector controls for the Group block.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The HTML tag name.\n * @param {Function} props.onSelectTagName onChange function for the SelectControl.\n *\n * @return {JSX.Element} The control group.\n */\nfunction GroupEditControls( { tagName, onSelectTagName } ) {\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<SelectControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ [\n\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t] }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onSelectTagName }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction GroupEdit( { attributes, name, setAttributes, clientId } ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\ttagName: TagName = 'div',\n\t\ttemplateLock,\n\t\tallowedBlocks,\n\t\tlayout = {},\n\t} = attributes;\n\n\t// Layout settings.\n\tconst { type = 'default' } = layout;\n\tconst layoutSupportEnabled =\n\t\tthemeSupportsLayout || type === 'flex' || type === 'grid';\n\n\t// Hooks.\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\tconst [ showPlaceholder, setShowPlaceholder ] = useShouldShowPlaceHolder( {\n\t\tattributes,\n\t\tusedLayoutType: type,\n\t\thasInnerBlocks,\n\t} );\n\n\t// Default to the regular appender being rendered.\n\tlet renderAppender;\n\tif ( showPlaceholder ) {\n\t\t// In the placeholder state, ensure the appender is not rendered.\n\t\t// This is needed because `...innerBlocksProps` is used in the placeholder\n\t\t// state so that blocks can dragged onto the placeholder area\n\t\t// from both the list view and in the editor canvas.\n\t\trenderAppender = false;\n\t} else if ( ! hasInnerBlocks ) {\n\t\t// When there is no placeholder, but the block is also empty,\n\t\t// use the larger button appender.\n\t\trenderAppender = InnerBlocks.ButtonBlockAppender;\n\t}\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\tdropZoneElement: ref.current,\n\t\t\ttemplateLock,\n\t\t\tallowedBlocks,\n\t\t\trenderAppender,\n\t\t}\n\t);\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tconst selectVariation = ( nextVariation ) => {\n\t\tsetAttributes( nextVariation.attributes );\n\t\tselectBlock( clientId, -1 );\n\t\tsetShowPlaceholder( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<GroupEditControls\n\t\t\t\ttagName={ TagName }\n\t\t\t\tonSelectTagName={ ( value ) =>\n\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ showPlaceholder && (\n\t\t\t\t<View>\n\t\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t\t<GroupPlaceHolder\n\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\tonSelect={ selectVariation }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...innerBlocksProps } />\n\t\t\t) }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EACjBC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,QAAQ,uBAAuB;;AAE5C;AACA;AACA;AACA,OAAOC,gBAAgB,IAAIC,wBAAwB,QAAQ,eAAe;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AASA,SAASC,iBAAiBA,CAAE;EAAEC,OAAO;EAAEC;AAAgB,CAAC,EAAG;EAC1D,MA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,OAAO;IAC5Bf,YAAY;IACZC,aAAa;IACbS;EACD,CACD,CAAC;EAED,MAAM;IAAEM;EAAY,CAAC,GAAGtE,WAAW,CAAEO,gBAAiB,CAAC;EAEvD,MAAMgE,eAAe,GAAKC,aAAa,IAAM;IAC5C9B,aAAa,CAAE8B,aAAa,CAAChC,UAAW,CAAC;IACzC8B,WAAW,CAAE3B,QAAQ,EAAE,CAAC,CAAE,CAAC;IAC3BmB,kBAAkB,CAAE,KAAM,CAAC;EAC5B,CAAC;EAED,oBACC7C,KAAA,CAAAE,SAAA;IAAAY,QAAA,gBACChB,IAAA,CAACK,iBAAiB;MACjBC,OAAO,EAAGgC,OAAS;MACnB/B,eAAe,EAAKc,KAAK,IACxBM,aAAa,CAAE;QAAErB,OAAO,EAAEe;MAAM,CAAE;IAClC,CACD,CAAC,EACAyB,eAAe,iBAChB5C,KAAA,CAACN,IAAI;MAAAoB,QAAA,GACFmC,gBAAgB,CAACnC,QAAQ,eAC3BhB,IAAA,CAACH,gBAAgB;QAChB6B,IAAI,EAAGA,IAAM;QACbgC,QAAQ,EAAGF;MAAiB,CAC5B,CAAC;IAAA,CACG,CACN,EACCb,oBAAoB,IAAI,CAAEG,eAAe,iBAC1C9C,IAAA,CAACsC,OAAO;MAAA,GAAMa;IAAgB,CAAI,CAClC,EAGC,CAAER,oBAAoB,IAAI,CAAEG,eAAe,iBAC5C9C,IAAA,CAACsC,OAAO;MAAA,GAAMO,UAAU;MAAA7B,QAAA,eACvBhB,IAAA;QAAA,GAAUmD;MAAgB,CAAI;IAAC,CACvB,CACT;EAAA,CACA,CAAC;AAEL;AAEA,eAAe3B,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","InnerBlocks","useBlockProps","InspectorControls","useInnerBlocksProps","store","blockEditorStore","SelectControl","useRef","__","View","GroupPlaceHolder","useShouldShowPlaceHolder","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","GroupEditControls","tagName","onSelectTagName","htmlElementMessages","header","main","section","article","aside","footer","group","children","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help","GroupEdit","attributes","name","setAttributes","clientId","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","block","innerBlocks","length","supportsLayout","TagName","templateLock","allowedBlocks","layout","type","layoutSupportEnabled","ref","blockProps","showPlaceholder","setShowPlaceholder","usedLayoutType","renderAppender","ButtonBlockAppender","innerBlocksProps","className","dropZoneElement","current","selectBlock","selectVariation","nextVariation","onSelect"],"sources":["@wordpress/block-library/src/group/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport GroupPlaceHolder, { useShouldShowPlaceHolder } from './placeholder';\n\n/**\n * Render inspector controls for the Group block.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The HTML tag name.\n * @param {Function} props.onSelectTagName onChange function for the SelectControl.\n *\n * @return {JSX.Element} The control group.\n */\nfunction GroupEditControls( { tagName, onSelectTagName } ) {\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<SelectControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ [\n\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t] }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onSelectTagName }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction GroupEdit( { attributes, name, setAttributes, clientId } ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\ttagName: TagName = 'div',\n\t\ttemplateLock,\n\t\tallowedBlocks,\n\t\tlayout = {},\n\t} = attributes;\n\n\t// Layout settings.\n\tconst { type = 'default' } = layout;\n\tconst layoutSupportEnabled =\n\t\tthemeSupportsLayout || type === 'flex' || type === 'grid';\n\n\t// Hooks.\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\tconst [ showPlaceholder, setShowPlaceholder ] = useShouldShowPlaceHolder( {\n\t\tattributes,\n\t\tusedLayoutType: type,\n\t\thasInnerBlocks,\n\t} );\n\n\t// Default to the regular appender being rendered.\n\tlet renderAppender;\n\tif ( showPlaceholder ) {\n\t\t// In the placeholder state, ensure the appender is not rendered.\n\t\t// This is needed because `...innerBlocksProps` is used in the placeholder\n\t\t// state so that blocks can dragged onto the placeholder area\n\t\t// from both the list view and in the editor canvas.\n\t\trenderAppender = false;\n\t} else if ( ! hasInnerBlocks ) {\n\t\t// When there is no placeholder, but the block is also empty,\n\t\t// use the larger button appender.\n\t\trenderAppender = InnerBlocks.ButtonBlockAppender;\n\t}\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\tdropZoneElement: ref.current,\n\t\t\ttemplateLock,\n\t\t\tallowedBlocks,\n\t\t\trenderAppender,\n\t\t}\n\t);\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tconst selectVariation = ( nextVariation ) => {\n\t\tsetAttributes( nextVariation.attributes );\n\t\tselectBlock( clientId, -1 );\n\t\tsetShowPlaceholder( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<GroupEditControls\n\t\t\t\ttagName={ TagName }\n\t\t\t\tonSelectTagName={ ( value ) =>\n\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ showPlaceholder && (\n\t\t\t\t<View>\n\t\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t\t<GroupPlaceHolder\n\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\tonSelect={ selectVariation }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...innerBlocksProps } />\n\t\t\t) }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EACjBC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,QAAQ,uBAAuB;;AAE5C;AACA;AACA;AACA,OAAOC,gBAAgB,IAAIC,wBAAwB,QAAQ,eAAe;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AASA,SAASC,iBAAiBA,CAAE;EAAEC,OAAO;EAAEC;AAAgB,CAAC,EAAG;EAC1D,MAAMC,mBAAmB,GAAG;IAC3BC,MAAM,EAAEd,EAAE,CACT,qHACD,CAAC;IACDe,IAAI,EAAEf,EAAE,CACP,kFACD,CAAC;IACDgB,OAAO,EAAEhB,EAAE,CACV,kIACD,CAAC;IACDiB,OAAO,EAAEjB,EAAE,CACV,gGACD,CAAC;IACDkB,KAAK,EAAElB,EAAE,CACR,uIACD,CAAC;IACDmB,MAAM,EAAEnB,EAAE,CACT,8HACD;EACD,CAAC;EACD,oBACCK,IAAA,CAACX,iBAAiB;IAAC0B,KAAK,EAAC,UAAU;IAAAC,QAAA,eAClChB,IAAA,CAACP,aAAa;MACbwB,uBAAuB;MACvBC,qBAAqB;MACrBC,KAAK,EAAGxB,EAAE,CAAE,cAAe,CAAG;MAC9ByB,OAAO,EAAG,CACT;QAAED,KAA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AClC,CACD,CAAC,EACAyB,eAAe,iBAChB5C,KAAA,CAACN,IAAI;MAAAoB,QAAA,GACFmC,gBAAgB,CAACnC,QAAQ,eAC3BhB,IAAA,CAACH,gBAAgB;QAChB6B,IAAI,EAAGA,IAAM;QACbgC,QAAQ,EAAGF;MAAiB,CAC5B,CAAC;IAAA,CACG,CACN,EACCb,oBAAoB,IAAI,CAAEG,eAAe,iBAC1C9C,IAAA,CAACsC,OAAO;MAAA,GAAMa;IAAgB,CAAI,CAClC,EAGC,CAAER,oBAAoB,IAAI,CAAEG,eAAe,iBAC5C9C,IAAA,CAACsC,OAAO;MAAA,GAAMO,UAAU;MAAA7B,QAAA,eACvBhB,IAAA;QAAA,GAAUmD;MAAgB,CAAI;IAAC,CACvB,CACT;EAAA,CACA,CAAC;AAEL;AAEA,eAAe3B,SAAS","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { isBlobURL } from '@wordpress/blob';
|
|
5
|
-
import { ExternalLink, ResizableBox, Spinner, TextareaControl, TextControl, ToolbarButton, ToolbarGroup, Dropdown, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalUseCustomUnits as useCustomUnits, Placeholder } from '@wordpress/components';
|
|
5
|
+
import { MenuItem, ExternalLink, ResizableBox, Spinner, TextareaControl, TextControl, ToolbarButton, ToolbarGroup, Dropdown, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalUseCustomUnits as useCustomUnits, Placeholder } from '@wordpress/components';
|
|
6
6
|
import { useViewportMatch } from '@wordpress/compose';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
8
|
import { BlockControls, InspectorControls, __experimentalImageURLInputUI as ImageURLInputUI, MediaReplaceFlow, store as blockEditorStore, useSettings, __experimentalImageEditor as ImageEditor, __experimentalUseBorderProps as useBorderProps, __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
@@ -495,7 +495,11 @@ export default function Image({
|
|
|
495
495
|
accept: "image/*",
|
|
496
496
|
onSelect: onSelectImage,
|
|
497
497
|
onSelectURL: onSelectURL,
|
|
498
|
-
onError: onUploadError
|
|
498
|
+
onError: onUploadError,
|
|
499
|
+
children: /*#__PURE__*/_jsx(MenuItem, {
|
|
500
|
+
onClick: () => onSelectImage(undefined),
|
|
501
|
+
children: __('Reset')
|
|
502
|
+
})
|
|
499
503
|
})
|
|
500
504
|
}), isSingleSelected && externalBlob && /*#__PURE__*/_jsx(BlockControls, {
|
|
501
505
|
children: /*#__PURE__*/_jsx(ToolbarGroup, {
|
|
@@ -569,6 +573,7 @@ export default function Image({
|
|
|
569
573
|
children: __('Title')
|
|
570
574
|
}),
|
|
571
575
|
renderContent: () => /*#__PURE__*/_jsx(TextControl, {
|
|
576
|
+
__next40pxDefaultSize: true,
|
|
572
577
|
className: "wp-block-image__toolbar_content_textarea",
|
|
573
578
|
__nextHasNoMarginBottom: true,
|
|
574
579
|
label: __('Title attribute'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isBlobURL","ExternalLink","ResizableBox","Spinner","TextareaControl","TextControl","ToolbarButton","ToolbarGroup","Dropdown","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalUseCustomUnits","useCustomUnits","Placeholder","useViewportMatch","useSelect","useDispatch","BlockControls","InspectorControls","__experimentalImageURLInputUI","ImageURLInputUI","MediaReplaceFlow","store","blockEditorStore","useSettings","__experimentalImageEditor","ImageEditor","__experimentalUseBorderProps","useBorderProps","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","privateApis","blockEditorPrivateApis","useEffect","useMemo","useState","useRef","__","_x","sprintf","isRTL","DOWN","getFilename","switchToBlockType","blocksStore","crop","overlayText","upload","noticesStore","coreStore","unlock","createUpgradedEmbedBlock","isExternalImage","Caption","useToolsPanelDropdownMenuProps","MIN_SIZE","ALLOWED_MEDIA_TYPES","evalAspectRatio","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DimensionsTool","ResolutionTool","scaleOptions","value","label","help","ImageWrapper","href","children","onClick","event","preventDefault","style","pointerEvents","cursor","display","Image","temporaryURL","attributes","setAttributes","isSingleSelected","insertBlocksAfter","onReplace","onSelectImage","onSelectURL","onUploadError","context","clientId","blockEditingMode","parentLayoutType","url","alt","align","id","rel","linkClass","linkDestination","title","width","height","aspectRatio","scale","linkTarget","sizeSlug","lightbox","metadata","numericWidth","parseInt","undefined","numericHeight","imageRef","allowResize","getBlock","getSettings","image","select","getMedia","canInsertCover","imageEditing","imageSizes","maxWidth","getBlockRootClientId","canInsertBlockType","rootClientId","settings","replaceBlocks","toggleSelection","createErrorNotice","createSuccessNotice","isLargeViewport","isWideAligned","includes","loadedNaturalWidth","loadedNaturalHeight","setLoadedNaturalSize","isEditingImage","setIsEditingImage","externalBlob","setExternalBlob","hasImageErrored","setHasImageErrored","hasNonContentControls","isContentOnlyMode","isResizable","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","mediaUpload","window","fetch","then","response","blob","catch","naturalWidth","naturalHeight","current","complete","onResizeStart","onResizeStop","onImageError","embedBlock","onImageLoad","target","onSetHref","props","onSetLightbox","enable","lightboxSetting","enabled","resetLightbox","allowEditing","onSetTitle","updateAlt","newAlt","updateImage","newSizeSlug","newUrl","uploadExternal","filesList","onFileChange","img","type","allowedTypes","onError","message","canEditImage","allowCrop","switchToCover","dimensionsUnitsOptions","availableUnits","showLightboxSetting","lightboxChecked","dropdownMenuProps","dimensionsControl","onChange","newWidth","newHeight","newScale","newAspectRatio","defaultScale","defaultAspectRatio","unitsOptions","aspectRatioControl","tools","resetAll","sizeControls","arePatternOverridesEnabled","bindings","__default","source","lockUrlControls","lockHrefControls","lockAltControls","lockAltControlsMessage","lockTitleControls","lockTitleControlsMessage","lockCaption","getBlockBindingsSource","urlBinding","altBinding","titleBinding","hasParentPattern","urlBindingSource","altBindingSource","titleBindingSource","canUserEditValue","args","showUrlInput","showCoverControls","showBlockControls","controls","group","onChangeUrl","mediaUrl","mediaLink","link","lightboxEnabled","icon","mediaId","mediaURL","accept","onSelect","popoverProps","position","renderToggle","isOpen","onToggle","onKeyDown","keyCode","renderContent","className","disabled","__nextHasNoMarginBottom","isShownByDefault","hasValue","onDeselect","readOnly","length","options","__next40pxDefaultSize","filename","defaultedAlt","borderProps","shadowProps","isRounded","withIllustration","src","onLoad","ref","objectFit","onSaveImage","imageAttributes","onFinishEditing","numericRatio","customRatio","naturalRatio","ratio","currentWidth","currentHeight","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","showHandle","maxHeight","lockAspectRatio","top","right","bottom","left","direction","elt","offsetWidth","String","resizeRatio","isSelected","showToolbarButton"],"sources":["@wordpress/block-library/src/image/image.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tExternalLink,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tToolbarButton,\n\tToolbarGroup,\n\tDropdown,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tPlaceholder,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tMediaReplaceFlow,\n\tstore as blockEditorStore,\n\tuseSettings,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo, useState, useRef } from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport { getFilename } from '@wordpress/url';\nimport { switchToBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { crop, overlayText, upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { isExternalImage } from './edit';\nimport { Caption } from '../utils/caption';\n\n/**\n * Module constants\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { MIN_SIZE, ALLOWED_MEDIA_TYPES } from './constants';\nimport { evalAspectRatio } from './utils';\n\nconst { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 'cover',\n\t\tlabel: _x( 'Cover', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image covers the space evenly.' ),\n\t},\n\t{\n\t\tvalue: 'contain',\n\t\tlabel: _x( 'Contain', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image is contained without distortion.' ),\n\t},\n];\n\n// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.\nconst ImageWrapper = ( { href, children } ) => {\n\tif ( ! href ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<a\n\t\t\thref={ href }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\taria-disabled\n\t\t\tstyle={ {\n\t\t\t\t// When the Image block is linked,\n\t\t\t\t// it's wrapped with a disabled <a /> tag.\n\t\t\t\t// Restore cursor style so it doesn't appear 'clickable'\n\t\t\t\t// and remove pointer events. Safari needs the display property.\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\tcursor: 'default',\n\t\t\t\tdisplay: 'inline',\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</a>\n\t);\n};\n\nexport default function Image( {\n\ttemporaryURL,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n\tparentLayoutType,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\talign,\n\t\tid,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\ttitle,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t} = attributes;\n\n\t// The only supported unit is px, so we can parseInt to strip the px here.\n\tconst numericWidth = width ? parseInt( width, 10 ) : undefined;\n\tconst numericHeight = height ? parseInt( height, 10 ) : undefined;\n\n\tconst imageRef = useRef();\n\tconst { allowResize = true } = context;\n\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isSingleSelected\n\t\t\t\t? select( coreStore ).getMedia( id, { context: 'view' } )\n\t\t\t\t: null,\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst { canInsertCover, imageEditing, imageSizes, maxWidth } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst settings = getSettings();\n\n\t\t\treturn {\n\t\t\t\timageEditing: settings.imageEditing,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmaxWidth: settings.maxWidth,\n\t\t\t\tcanInsertCover: canInsertBlockType(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks, toggleSelection } = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst [\n\t\t{ loadedNaturalWidth, loadedNaturalHeight },\n\t\tsetLoadedNaturalSize,\n\t] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst [ externalBlob, setExternalBlob ] = useState();\n\tconst [ hasImageErrored, setHasImageErrored ] = useState( false );\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\t// If an image is externally hosted, try to fetch the image data. This may\n\t// fail if the image host doesn't allow CORS with the domain. If it works,\n\t// we can enable a button in the toolbar to upload the image.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! isExternalImage( id, url ) ||\n\t\t\t! isSingleSelected ||\n\t\t\t! getSettings().mediaUpload\n\t\t) {\n\t\t\tsetExternalBlob();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( externalBlob ) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow\n\t\t\t// Avoid cache, which seems to help avoid CORS problems.\n\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t.then( ( response ) => response.blob() )\n\t\t\t.then( ( blob ) => setExternalBlob( blob ) )\n\t\t\t// Do nothing, cannot upload.\n\t\t\t.catch( () => {} );\n\t}, [ id, url, isSingleSelected, externalBlob ] );\n\n\t// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural\n\t// width and height. This resolves an issue in Safari where the loaded natural\n\t// width and height is otherwise lost when switching between alignments.\n\t// See: https://github.com/WordPress/gutenberg/pull/37210.\n\tconst { naturalWidth, naturalHeight } = useMemo( () => {\n\t\treturn {\n\t\t\tnaturalWidth:\n\t\t\t\timageRef.current?.naturalWidth ||\n\t\t\t\tloadedNaturalWidth ||\n\t\t\t\tundefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageRef.current?.naturalHeight ||\n\t\t\t\tloadedNaturalHeight ||\n\t\t\t\tundefined,\n\t\t};\n\t}, [\n\t\tloadedNaturalWidth,\n\t\tloadedNaturalHeight,\n\t\timageRef.current?.complete,\n\t] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tfunction onImageError() {\n\t\tsetHasImageErrored( true );\n\n\t\t// Check if there's an embed block that handles this URL, e.g., instagram URL.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/11472\n\t\tconst embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onImageLoad( event ) {\n\t\tsetHasImageErrored( false );\n\t\tsetLoadedNaturalSize( {\n\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\n\t\t} );\n\t}\n\n\tfunction onSetHref( props ) {\n\t\tsetAttributes( props );\n\t}\n\n\tfunction onSetLightbox( enable ) {\n\t\tif ( enable && ! lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: true },\n\t\t\t} );\n\t\t} else if ( ! enable && lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction resetLightbox() {\n\t\t// When deleting a link from an image while lightbox settings\n\t\t// are enabled by default, we should disable the lightbox,\n\t\t// otherwise the resulting UX looks like a mistake.\n\t\t// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.\n\t\tif ( lightboxSetting?.enabled && lightboxSetting?.allowEditing ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction onSetTitle( value ) {\n\t\t// This is the HTML title attribute, separate from the media object\n\t\t// title.\n\t\tsetAttributes( { title: value } );\n\t}\n\n\tfunction updateAlt( newAlt ) {\n\t\tsetAttributes( { alt: newAlt } );\n\t}\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl = image?.media_details?.sizes?.[ newSizeSlug ]?.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\tfunction uploadExternal() {\n\t\tconst { mediaUpload } = getSettings();\n\t\tif ( ! mediaUpload ) {\n\t\t\treturn;\n\t\t}\n\t\tmediaUpload( {\n\t\t\tfilesList: [ externalBlob ],\n\t\t\tonFileChange( [ img ] ) {\n\t\t\t\tonSelectImage( img );\n\n\t\t\t\tif ( isBlobURL( img.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetExternalBlob();\n\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t},\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tonError( message ) {\n\t\t\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tconst canEditImage = id && naturalWidth && naturalHeight && imageEditing;\n\tconst allowCrop = isSingleSelected && canEditImage && ! isEditingImage;\n\n\tfunction switchToCover() {\n\t\treplaceBlocks(\n\t\t\tclientId,\n\t\t\tswitchToBlockType( getBlock( clientId ), 'core/cover' )\n\t\t);\n\t}\n\n\t// TODO: Can allow more units after figuring out how they should interact\n\t// with the ResizableBox and ImageEditor components. Calculations later on\n\t// for those components are currently assuming px units.\n\tconst dimensionsUnitsOptions = useCustomUnits( {\n\t\tavailableUnits: [ 'px' ],\n\t} );\n\n\tconst [ lightboxSetting ] = useSettings( 'lightbox' );\n\n\tconst showLightboxSetting =\n\t\t// If a block-level override is set, we should give users the option to\n\t\t// remove that override, even if the lightbox UI is disabled in the settings.\n\t\t( !! lightbox && lightbox?.enabled !== lightboxSetting?.enabled ) ||\n\t\tlightboxSetting?.allowEditing;\n\n\tconst lightboxChecked =\n\t\t!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst dimensionsControl = (\n\t\t<DimensionsTool\n\t\t\tvalue={ { width, height, scale, aspectRatio } }\n\t\t\tonChange={ ( {\n\t\t\t\twidth: newWidth,\n\t\t\t\theight: newHeight,\n\t\t\t\tscale: newScale,\n\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t} ) => {\n\t\t\t\t// Rebuilding the object forces setting `undefined`\n\t\t\t\t// for values that are removed since setAttributes\n\t\t\t\t// doesn't do anything with keys that aren't set.\n\t\t\t\tsetAttributes( {\n\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\theight: newHeight,\n\t\t\t\t\tscale: newScale,\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdefaultScale=\"cover\"\n\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\tscaleOptions={ scaleOptions }\n\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t/>\n\t);\n\n\tconst aspectRatioControl = (\n\t\t<DimensionsTool\n\t\t\tvalue={ { aspectRatio } }\n\t\t\tonChange={ ( { aspectRatio: newAspectRatio } ) => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\tscale: 'cover',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\ttools={ [ 'aspectRatio' ] }\n\t\t/>\n\t);\n\n\tconst resetAll = () => {\n\t\tsetAttributes( {\n\t\t\talt: undefined,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tscale: undefined,\n\t\t\taspectRatio: undefined,\n\t\t\tlightbox: undefined,\n\t\t} );\n\t};\n\n\tconst sizeControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ resetAll }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t{ isResizable &&\n\t\t\t\t\t( parentLayoutType === 'grid'\n\t\t\t\t\t\t? aspectRatioControl\n\t\t\t\t\t\t: dimensionsControl ) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tconst arePatternOverridesEnabled =\n\t\tmetadata?.bindings?.__default?.source === 'core/pattern-overrides';\n\n\tconst {\n\t\tlockUrlControls = false,\n\t\tlockHrefControls = false,\n\t\tlockAltControls = false,\n\t\tlockAltControlsMessage,\n\t\tlockTitleControls = false,\n\t\tlockTitleControlsMessage,\n\t\tlockCaption = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\n\t\t\tconst urlBindingSource = getBlockBindingsSource(\n\t\t\t\turlBinding?.source\n\t\t\t);\n\t\t\tconst altBindingSource = getBlockBindingsSource(\n\t\t\t\taltBinding?.source\n\t\t\t);\n\t\t\tconst titleBindingSource = getBlockBindingsSource(\n\t\t\t\ttitleBinding?.source\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! urlBinding &&\n\t\t\t\t\t! urlBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: urlBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockHrefControls:\n\t\t\t\t\t// Disable editing the link of the URL if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the link on the frontend.\n\t\t\t\t\thasParentPattern || arePatternOverridesEnabled,\n\t\t\t\tlockCaption:\n\t\t\t\t\t// Disable editing the caption if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the caption on the frontend.\n\t\t\t\t\thasParentPattern,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t! altBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: altBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockAltControlsMessage: altBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\taltBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t\tlockTitleControls:\n\t\t\t\t\t!! titleBinding &&\n\t\t\t\t\t! titleBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: titleBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockTitleControlsMessage: titleBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\ttitleBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tarePatternOverridesEnabled,\n\t\t\tcontext,\n\t\t\tisSingleSelected,\n\t\t\tmetadata?.bindings,\n\t\t]\n\t);\n\n\tconst showUrlInput =\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockHrefControls &&\n\t\t! lockUrlControls;\n\n\tconst showCoverControls = isSingleSelected && canInsertCover;\n\n\tconst showBlockControls = showUrlInput || allowCrop || showCoverControls;\n\n\tconst controls = (\n\t\t<>\n\t\t\t{ showBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ showUrlInput && (\n\t\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\t\tmediaUrl={ ( image && image.source_url ) || url }\n\t\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\t\tshowLightboxSetting={ showLightboxSetting }\n\t\t\t\t\t\t\tlightboxEnabled={ lightboxChecked }\n\t\t\t\t\t\t\tonSetLightbox={ onSetLightbox }\n\t\t\t\t\t\t\tresetLightbox={ resetLightbox }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowCrop && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showCoverControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\t\tonClick={ switchToCover }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && ! isEditingImage && ! lockUrlControls && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && externalBlob && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ uploadExternal }\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tlabel={ __( 'Upload to Media Library' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isContentOnlyMode && (\n\t\t\t\t// Add some extra controls for content attributes when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit these attributes.\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ _x(\n\t\t\t\t\t\t\t\t\t'Alt',\n\t\t\t\t\t\t\t\t\t'Alternative text for an image. Block toolbar label, a low character count is preferred.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink\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</ExternalLink>\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\t__nextHasNoMarginBottom\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\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ __( 'Title' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\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\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\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'(Note: many devices and browsers do not display this text.)'\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</ExternalLink>\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/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ resetAll }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ isSingleSelected && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink\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</ExternalLink>\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\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable &&\n\t\t\t\t\t\t( parentLayoutType === 'grid'\n\t\t\t\t\t\t\t? aspectRatioControl\n\t\t\t\t\t\t\t: dimensionsControl ) }\n\t\t\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\treadOnly={ lockTitleControls }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t) : (\n\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'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'(Note: many devices and browsers do not display this text.)'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( alt ) {\n\t\tdefaultedAlt = alt;\n\t} else if ( filename ) {\n\t\tdefaultedAlt = sprintf(\n\t\t\t/* translators: %s: file name */\n\t\t\t__( 'This image has an empty alt attribute; its file name is %s' ),\n\t\t\tfilename\n\t\t);\n\t} else {\n\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t}\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst isRounded = attributes.className?.includes( 'is-style-rounded' );\n\n\tlet img =\n\t\ttemporaryURL && hasImageErrored ? (\n\t\t\t// Show a placeholder during upload when the blob URL can't be loaded. This can\n\t\t\t// happen when the user uploads a HEIC image in a browser that doesn't support them.\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-image__placeholder\"\n\t\t\t\twithIllustration\n\t\t\t>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t) : (\n\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t// should direct focus to block.\n\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t\t<>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\t\talt={ defaultedAlt }\n\t\t\t\t\tonError={ onImageError }\n\t\t\t\t\tonLoad={ onImageLoad }\n\t\t\t\t\tref={ imageRef }\n\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t( width && height ) || aspectRatio\n\t\t\t\t\t\t\t\t? '100%'\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t( width && height ) || aspectRatio\n\t\t\t\t\t\t\t\t? '100%'\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ temporaryURL && <Spinner /> }\n\t\t\t</>\n\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t);\n\n\tif ( canEditImage && isEditingImage ) {\n\t\timg = (\n\t\t\t<ImageWrapper href={ href }>\n\t\t\t\t<ImageEditor\n\t\t\t\t\tid={ id }\n\t\t\t\t\turl={ url }\n\t\t\t\t\twidth={ numericWidth }\n\t\t\t\t\theight={ numericHeight }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t\tonSaveImage={ ( imageAttributes ) =>\n\t\t\t\t\t\tsetAttributes( imageAttributes )\n\t\t\t\t\t}\n\t\t\t\t\tonFinishEditing={ () => {\n\t\t\t\t\t\tsetIsEditingImage( false );\n\t\t\t\t\t} }\n\t\t\t\t\tborderProps={ isRounded ? undefined : borderProps }\n\t\t\t\t/>\n\t\t\t</ImageWrapper>\n\t\t);\n\t} else if ( ! isResizable || parentLayoutType === 'grid' ) {\n\t\timg = (\n\t\t\t<div style={ { width, height, aspectRatio } }>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = numericWidth / numericHeight;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\n\t\tconst currentWidth =\n\t\t\t! numericWidth && numericHeight\n\t\t\t\t? numericHeight * ratio\n\t\t\t\t: numericWidth;\n\t\tconst currentHeight =\n\t\t\t! numericHeight && numericWidth\n\t\t\t\t? numericWidth / ratio\n\t\t\t\t: numericHeight;\n\n\t\tconst minWidth =\n\t\t\tnaturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\tconst minHeight =\n\t\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t// With the current implementation of ResizableBox, an image needs an\n\t\t// explicit pixel value for the max-width. In absence of being able to\n\t\t// set the content-width, this max-width is currently dictated by the\n\t\t// vanilla editor style. The following variable adds a buffer to this\n\t\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t\t// in most cases, allow you to scale the image beyond the width of the\n\t\t// main column, though not infinitely.\n\t\t// @todo It would be good to revisit this once a content-width variable\n\t\t// becomes available.\n\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\tlet showRightHandle = false;\n\t\tlet showLeftHandle = false;\n\n\t\t/* eslint-disable no-lonely-if */\n\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\tif ( align === 'center' ) {\n\t\t\t// When the image is centered, show both handles.\n\t\t\tshowRightHandle = true;\n\t\t\tshowLeftHandle = true;\n\t\t} else if ( isRTL() ) {\n\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t// Show the right handle and hide the left handle only when it is\n\t\t\t// aligned left. Otherwise always show the left handle.\n\t\t\tif ( align === 'left' ) {\n\t\t\t\tshowRightHandle = true;\n\t\t\t} else {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Show the left handle and hide the right handle only when the\n\t\t\t// image is aligned right. Otherwise always show the right handle.\n\t\t\tif ( align === 'right' ) {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t} else {\n\t\t\t\tshowRightHandle = true;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-lonely-if */\n\t\timg = (\n\t\t\t<ResizableBox\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t! width && ! height && aspectRatio\n\t\t\t\t\t\t\t? aspectRatio\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t} }\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth ?? 'auto',\n\t\t\t\t\theight: currentHeight ?? 'auto',\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSingleSelected }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio={ ratio }\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\t// Since the aspect ratio is locked when resizing, we can\n\t\t\t\t\t// use the width of the resized element to calculate the\n\t\t\t\t\t// height in CSS to prevent stretching when the max-width\n\t\t\t\t\t// is reached.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: `${ elt.offsetWidth }px`,\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t\tratio === naturalRatio\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: String( ratio ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tresizeRatio={ align === 'center' ? 2 : 1 }\n\t\t\t>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</ResizableBox>\n\t\t);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\t// Add all controls if the image attributes are connected.\n\t\treturn metadata?.bindings ? controls : sizeControls;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ img }\n\n\t\t\t<Caption\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\tshowToolbarButton={\n\t\t\t\t\tisSingleSelected &&\n\t\t\t\t\thasNonContentControls &&\n\t\t\t\t\t! arePatternOverridesEnabled\n\t\t\t\t}\n\t\t\t\treadOnly={ lockCaption }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,YAAY,EACZC,YAAY,EACZC,OAAO,EACPC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACRC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,4BAA4B,IAAIC,cAAc,EAC9CC,WAAW,QACL,uBAAuB;AAC9B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,iBAAiB,EACjBC,6BAA6B,IAAIC,eAAe,EAChDC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,EACXC,yBAAyB,IAAIC,WAAW,EACxCC,4BAA4B,IAAIC,cAAc,EAC9CC,uCAAuC,IAAIC,yBAAyB,EACpEC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACxD,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,iBAAiB,EAAErB,KAAK,IAAIsB,WAAW,QAAQ,mBAAmB;AAC3E,SAASC,IAAI,EAAEC,WAAW,EAAEC,MAAM,QAAQ,kBAAkB;AAC5D,SAASzB,KAAK,IAAI0B,YAAY,QAAQ,oBAAoB;AAC1D,SAAS1B,KAAK,IAAI2B,SAA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QACtBQ,MAAM,EAAE,IAAI;QACZC,IAAI,EAAER;MACP,CAAG;MACH9H,aAAa,EAAGA,aAAe;MAC/BC,YAAY,EAAGA,CAAE9F,KAAK,EAAEoO,SAAS,EAAEC,GAAG,KAAM;QAC3CvI,YAAY,CAAC,CAAC;QACd;QACA;QACA;QACA;QACArF,aAAa,CAAE;UACdmB,KAAK,EAAG,GAAGyM,GAAG,CAACC,WAAa,IAAG;UAC/BzM,MAAM,EAAE,MAAM;UACdC,WAAW,EACVsL,KAAK,KAAKD,YAAY,GACnB7K,SAAS,GACTiM,MAAM,CAAEnB,KAAM;QACnB,CAAE,CAAC;MACJ,CAAG;MACHoB,WAAW,EAAGlN,KAAK,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAG;MAAAxB,QAAA,eAE1Cb,IAAA,CAACW,YAAY;QAACC,IAAI,EAAGA,IAAM;QAAAC,QAAA,EAAGsH;MAAG,CAAgB;IAAC,CACrC,CACd;EACF;EAEA,IAAK,CAAEhG,GAAG,IAAI,CAAEb,YAAY,EAAG;IAC9B;IACA,OAAO4B,QAAQ,EAAE4G,QAAQ,GAAGuB,QAAQ,GAAGzB,YAAY;EACpD;EAEA,oBACC1J,KAAA,CAAAE,SAAA;IAAAS,QAAA,GACGwK,QAAQ,EACRlD,GAAG,eAELnI,IAAA,CAACN,OAAO;MACP6B,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA,aAAe;MAC/BgO,UAAU,EAAG/N,gBAAkB;MAC/BC,iBAAiB,EAAGA,iBAAmB;MACvCjB,KAAK,EAAG/B,EAAE,CAAE,oBAAqB,CAAG;MACpC+Q,iBAAiB,EAChBhO,gBAAgB,IAChB6D,qBAAqB,IACrB,CAAEuE,0BACF;MACDkD,QAAQ,EAAGxC;IAAa,CACxB,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isBlobURL","MenuItem","ExternalLink","ResizableBox","Spinner","TextareaControl","TextControl","ToolbarButton","ToolbarGroup","Dropdown","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalUseCustomUnits","useCustomUnits","Placeholder","useViewportMatch","useSelect","useDispatch","BlockControls","InspectorControls","__experimentalImageURLInputUI","ImageURLInputUI","MediaReplaceFlow","store","blockEditorStore","useSettings","__experimentalImageEditor","ImageEditor","__experimentalUseBorderProps","useBorderProps","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","privateApis","blockEditorPrivateApis","useEffect","useMemo","useState","useRef","__","_x","sprintf","isRTL","DOWN","getFilename","switchToBlockType","blocksStore","crop","overlayText","upload","noticesStore","coreStore","unlock","createUpgradedEmbedBlock","isExternalImage","Caption","useToolsPanelDropdownMenuProps","MIN_SIZE","ALLOWED_MEDIA_TYPES","evalAspectRatio","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DimensionsTool","ResolutionTool","scaleOptions","value","label","help","ImageWrapper","href","children","onClick","event","preventDefault","style","pointerEvents","cursor","display","Image","temporaryURL","attributes","setAttributes","isSingleSelected","insertBlocksAfter","onReplace","onSelectImage","onSelectURL","onUploadError","context","clientId","blockEditingMode","parentLayoutType","url","alt","align","id","rel","linkClass","linkDestination","title","width","height","aspectRatio","scale","linkTarget","sizeSlug","lightbox","metadata","numericWidth","parseInt","undefined","numericHeight","imageRef","allowResize","getBlock","getSettings","image","select","getMedia","canInsertCover","imageEditing","imageSizes","maxWidth","getBlockRootClientId","canInsertBlockType","rootClientId","settings","replaceBlocks","toggleSelection","createErrorNotice","createSuccessNotice","isLargeViewport","isWideAligned","includes","loadedNaturalWidth","loadedNaturalHeight","setLoadedNaturalSize","isEditingImage","setIsEditingImage","externalBlob","setExternalBlob","hasImageErrored","setHasImageErrored","hasNonContentControls","isContentOnlyMode","isResizable","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","mediaUpload","window","fetch","then","response","blob","catch","naturalWidth","naturalHeight","current","complete","onResizeStart","onResizeStop","onImageError","embedBlock","onImageLoad","target","onSetHref","props","onSetLightbox","enable","lightboxSetting","enabled","resetLightbox","allowEditing","onSetTitle","updateAlt","newAlt","updateImage","newSizeSlug","newUrl","uploadExternal","filesList","onFileChange","img","type","allowedTypes","onError","message","canEditImage","allowCrop","switchToCover","dimensionsUnitsOptions","availableUnits","showLightboxSetting","lightboxChecked","dropdownMenuProps","dimensionsControl","onChange","newWidth","newHeight","newScale","newAspectRatio","defaultScale","defaultAspectRatio","unitsOptions","aspectRatioControl","tools","resetAll","sizeControls","arePatternOverridesEnabled","bindings","__default","source","lockUrlControls","lockHrefControls","lockAltControls","lockAltControlsMessage","lockTitleControls","lockTitleControlsMessage","lockCaption","getBlockBindingsSource","urlBinding","altBinding","titleBinding","hasParentPattern","urlBindingSource","altBindingSource","titleBindingSource","canUserEditValue","args","showUrlInput","showCoverControls","showBlockControls","controls","group","onChangeUrl","mediaUrl","mediaLink","link","lightboxEnabled","icon","mediaId","mediaURL","accept","onSelect","popoverProps","position","renderToggle","isOpen","onToggle","onKeyDown","keyCode","renderContent","className","disabled","__nextHasNoMarginBottom","__next40pxDefaultSize","isShownByDefault","hasValue","onDeselect","readOnly","length","options","filename","defaultedAlt","borderProps","shadowProps","isRounded","withIllustration","src","onLoad","ref","objectFit","onSaveImage","imageAttributes","onFinishEditing","numericRatio","customRatio","naturalRatio","ratio","currentWidth","currentHeight","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","showHandle","maxHeight","lockAspectRatio","top","right","bottom","left","direction","elt","offsetWidth","String","resizeRatio","isSelected","showToolbarButton"],"sources":["@wordpress/block-library/src/image/image.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tMenuItem,\n\tExternalLink,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tToolbarButton,\n\tToolbarGroup,\n\tDropdown,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tPlaceholder,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tMediaReplaceFlow,\n\tstore as blockEditorStore,\n\tuseSettings,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo, useState, useRef } from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport { getFilename } from '@wordpress/url';\nimport { switchToBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { crop, overlayText, upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { isExternalImage } from './edit';\nimport { Caption } from '../utils/caption';\n\n/**\n * Module constants\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { MIN_SIZE, ALLOWED_MEDIA_TYPES } from './constants';\nimport { evalAspectRatio } from './utils';\n\nconst { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 'cover',\n\t\tlabel: _x( 'Cover', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image covers the space evenly.' ),\n\t},\n\t{\n\t\tvalue: 'contain',\n\t\tlabel: _x( 'Contain', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image is contained without distortion.' ),\n\t},\n];\n\n// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.\nconst ImageWrapper = ( { href, children } ) => {\n\tif ( ! href ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<a\n\t\t\thref={ href }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\taria-disabled\n\t\t\tstyle={ {\n\t\t\t\t// When the Image block is linked,\n\t\t\t\t// it's wrapped with a disabled <a /> tag.\n\t\t\t\t// Restore cursor style so it doesn't appear 'clickable'\n\t\t\t\t// and remove pointer events. Safari needs the display property.\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\tcursor: 'default',\n\t\t\t\tdisplay: 'inline',\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</a>\n\t);\n};\n\nexport default function Image( {\n\ttemporaryURL,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n\tparentLayoutType,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\talign,\n\t\tid,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\ttitle,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t} = attributes;\n\n\t// The only supported unit is px, so we can parseInt to strip the px here.\n\tconst numericWidth = width ? parseInt( width, 10 ) : undefined;\n\tconst numericHeight = height ? parseInt( height, 10 ) : undefined;\n\n\tconst imageRef = useRef();\n\tconst { allowResize = true } = context;\n\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isSingleSelected\n\t\t\t\t? select( coreStore ).getMedia( id, { context: 'view' } )\n\t\t\t\t: null,\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst { canInsertCover, imageEditing, imageSizes, maxWidth } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst settings = getSettings();\n\n\t\t\treturn {\n\t\t\t\timageEditing: settings.imageEditing,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmaxWidth: settings.maxWidth,\n\t\t\t\tcanInsertCover: canInsertBlockType(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks, toggleSelection } = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst [\n\t\t{ loadedNaturalWidth, loadedNaturalHeight },\n\t\tsetLoadedNaturalSize,\n\t] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst [ externalBlob, setExternalBlob ] = useState();\n\tconst [ hasImageErrored, setHasImageErrored ] = useState( false );\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\t// If an image is externally hosted, try to fetch the image data. This may\n\t// fail if the image host doesn't allow CORS with the domain. If it works,\n\t// we can enable a button in the toolbar to upload the image.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! isExternalImage( id, url ) ||\n\t\t\t! isSingleSelected ||\n\t\t\t! getSettings().mediaUpload\n\t\t) {\n\t\t\tsetExternalBlob();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( externalBlob ) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow\n\t\t\t// Avoid cache, which seems to help avoid CORS problems.\n\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t.then( ( response ) => response.blob() )\n\t\t\t.then( ( blob ) => setExternalBlob( blob ) )\n\t\t\t// Do nothing, cannot upload.\n\t\t\t.catch( () => {} );\n\t}, [ id, url, isSingleSelected, externalBlob ] );\n\n\t// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural\n\t// width and height. This resolves an issue in Safari where the loaded natural\n\t// width and height is otherwise lost when switching between alignments.\n\t// See: https://github.com/WordPress/gutenberg/pull/37210.\n\tconst { naturalWidth, naturalHeight } = useMemo( () => {\n\t\treturn {\n\t\t\tnaturalWidth:\n\t\t\t\timageRef.current?.naturalWidth ||\n\t\t\t\tloadedNaturalWidth ||\n\t\t\t\tundefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageRef.current?.naturalHeight ||\n\t\t\t\tloadedNaturalHeight ||\n\t\t\t\tundefined,\n\t\t};\n\t}, [\n\t\tloadedNaturalWidth,\n\t\tloadedNaturalHeight,\n\t\timageRef.current?.complete,\n\t] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tfunction onImageError() {\n\t\tsetHasImageErrored( true );\n\n\t\t// Check if there's an embed block that handles this URL, e.g., instagram URL.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/11472\n\t\tconst embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onImageLoad( event ) {\n\t\tsetHasImageErrored( false );\n\t\tsetLoadedNaturalSize( {\n\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\n\t\t} );\n\t}\n\n\tfunction onSetHref( props ) {\n\t\tsetAttributes( props );\n\t}\n\n\tfunction onSetLightbox( enable ) {\n\t\tif ( enable && ! lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: true },\n\t\t\t} );\n\t\t} else if ( ! enable && lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction resetLightbox() {\n\t\t// When deleting a link from an image while lightbox settings\n\t\t// are enabled by default, we should disable the lightbox,\n\t\t// otherwise the resulting UX looks like a mistake.\n\t\t// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.\n\t\tif ( lightboxSetting?.enabled && lightboxSetting?.allowEditing ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction onSetTitle( value ) {\n\t\t// This is the HTML title attribute, separate from the media object\n\t\t// title.\n\t\tsetAttributes( { title: value } );\n\t}\n\n\tfunction updateAlt( newAlt ) {\n\t\tsetAttributes( { alt: newAlt } );\n\t}\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl = image?.media_details?.sizes?.[ newSizeSlug ]?.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\tfunction uploadExternal() {\n\t\tconst { mediaUpload } = getSettings();\n\t\tif ( ! mediaUpload ) {\n\t\t\treturn;\n\t\t}\n\t\tmediaUpload( {\n\t\t\tfilesList: [ externalBlob ],\n\t\t\tonFileChange( [ img ] ) {\n\t\t\t\tonSelectImage( img );\n\n\t\t\t\tif ( isBlobURL( img.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetExternalBlob();\n\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t},\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tonError( message ) {\n\t\t\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tconst canEditImage = id && naturalWidth && naturalHeight && imageEditing;\n\tconst allowCrop = isSingleSelected && canEditImage && ! isEditingImage;\n\n\tfunction switchToCover() {\n\t\treplaceBlocks(\n\t\t\tclientId,\n\t\t\tswitchToBlockType( getBlock( clientId ), 'core/cover' )\n\t\t);\n\t}\n\n\t// TODO: Can allow more units after figuring out how they should interact\n\t// with the ResizableBox and ImageEditor components. Calculations later on\n\t// for those components are currently assuming px units.\n\tconst dimensionsUnitsOptions = useCustomUnits( {\n\t\tavailableUnits: [ 'px' ],\n\t} );\n\n\tconst [ lightboxSetting ] = useSettings( 'lightbox' );\n\n\tconst showLightboxSetting =\n\t\t// If a block-level override is set, we should give users the option to\n\t\t// remove that override, even if the lightbox UI is disabled in the settings.\n\t\t( !! lightbox && lightbox?.enabled !== lightboxSetting?.enabled ) ||\n\t\tlightboxSetting?.allowEditing;\n\n\tconst lightboxChecked =\n\t\t!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst dimensionsControl = (\n\t\t<DimensionsTool\n\t\t\tvalue={ { width, height, scale, aspectRatio } }\n\t\t\tonChange={ ( {\n\t\t\t\twidth: newWidth,\n\t\t\t\theight: newHeight,\n\t\t\t\tscale: newScale,\n\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t} ) => {\n\t\t\t\t// Rebuilding the object forces setting `undefined`\n\t\t\t\t// for values that are removed since setAttributes\n\t\t\t\t// doesn't do anything with keys that aren't set.\n\t\t\t\tsetAttributes( {\n\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\theight: newHeight,\n\t\t\t\t\tscale: newScale,\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdefaultScale=\"cover\"\n\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\tscaleOptions={ scaleOptions }\n\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t/>\n\t);\n\n\tconst aspectRatioControl = (\n\t\t<DimensionsTool\n\t\t\tvalue={ { aspectRatio } }\n\t\t\tonChange={ ( { aspectRatio: newAspectRatio } ) => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\tscale: 'cover',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\ttools={ [ 'aspectRatio' ] }\n\t\t/>\n\t);\n\n\tconst resetAll = () => {\n\t\tsetAttributes( {\n\t\t\talt: undefined,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tscale: undefined,\n\t\t\taspectRatio: undefined,\n\t\t\tlightbox: undefined,\n\t\t} );\n\t};\n\n\tconst sizeControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ resetAll }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t{ isResizable &&\n\t\t\t\t\t( parentLayoutType === 'grid'\n\t\t\t\t\t\t? aspectRatioControl\n\t\t\t\t\t\t: dimensionsControl ) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tconst arePatternOverridesEnabled =\n\t\tmetadata?.bindings?.__default?.source === 'core/pattern-overrides';\n\n\tconst {\n\t\tlockUrlControls = false,\n\t\tlockHrefControls = false,\n\t\tlockAltControls = false,\n\t\tlockAltControlsMessage,\n\t\tlockTitleControls = false,\n\t\tlockTitleControlsMessage,\n\t\tlockCaption = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\n\t\t\tconst urlBindingSource = getBlockBindingsSource(\n\t\t\t\turlBinding?.source\n\t\t\t);\n\t\t\tconst altBindingSource = getBlockBindingsSource(\n\t\t\t\taltBinding?.source\n\t\t\t);\n\t\t\tconst titleBindingSource = getBlockBindingsSource(\n\t\t\t\ttitleBinding?.source\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! urlBinding &&\n\t\t\t\t\t! urlBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: urlBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockHrefControls:\n\t\t\t\t\t// Disable editing the link of the URL if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the link on the frontend.\n\t\t\t\t\thasParentPattern || arePatternOverridesEnabled,\n\t\t\t\tlockCaption:\n\t\t\t\t\t// Disable editing the caption if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the caption on the frontend.\n\t\t\t\t\thasParentPattern,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t! altBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: altBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockAltControlsMessage: altBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\taltBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t\tlockTitleControls:\n\t\t\t\t\t!! titleBinding &&\n\t\t\t\t\t! titleBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: titleBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockTitleControlsMessage: titleBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\ttitleBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tarePatternOverridesEnabled,\n\t\t\tcontext,\n\t\t\tisSingleSelected,\n\t\t\tmetadata?.bindings,\n\t\t]\n\t);\n\n\tconst showUrlInput =\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockHrefControls &&\n\t\t! lockUrlControls;\n\n\tconst showCoverControls = isSingleSelected && canInsertCover;\n\n\tconst showBlockControls = showUrlInput || allowCrop || showCoverControls;\n\n\tconst controls = (\n\t\t<>\n\t\t\t{ showBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ showUrlInput && (\n\t\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\t\tmediaUrl={ ( image && image.source_url ) || url }\n\t\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\t\tshowLightboxSetting={ showLightboxSetting }\n\t\t\t\t\t\t\tlightboxEnabled={ lightboxChecked }\n\t\t\t\t\t\t\tonSetLightbox={ onSetLightbox }\n\t\t\t\t\t\t\tresetLightbox={ resetLightbox }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowCrop && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showCoverControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\t\tonClick={ switchToCover }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && ! isEditingImage && ! lockUrlControls && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MenuItem onClick={ () => onSelectImage( undefined ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && externalBlob && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ uploadExternal }\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tlabel={ __( 'Upload to Media Library' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isContentOnlyMode && (\n\t\t\t\t// Add some extra controls for content attributes when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit these attributes.\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ _x(\n\t\t\t\t\t\t\t\t\t'Alt',\n\t\t\t\t\t\t\t\t\t'Alternative text for an image. Block toolbar label, a low character count is preferred.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink\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</ExternalLink>\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\t__nextHasNoMarginBottom\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\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ __( 'Title' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\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\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\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'(Note: many devices and browsers do not display this text.)'\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</ExternalLink>\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/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ resetAll }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ isSingleSelected && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink\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</ExternalLink>\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\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable &&\n\t\t\t\t\t\t( parentLayoutType === 'grid'\n\t\t\t\t\t\t\t? aspectRatioControl\n\t\t\t\t\t\t\t: dimensionsControl ) }\n\t\t\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\treadOnly={ lockTitleControls }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t) : (\n\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'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'(Note: many devices and browsers do not display this text.)'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( alt ) {\n\t\tdefaultedAlt = alt;\n\t} else if ( filename ) {\n\t\tdefaultedAlt = sprintf(\n\t\t\t/* translators: %s: file name */\n\t\t\t__( 'This image has an empty alt attribute; its file name is %s' ),\n\t\t\tfilename\n\t\t);\n\t} else {\n\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t}\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst isRounded = attributes.className?.includes( 'is-style-rounded' );\n\n\tlet img =\n\t\ttemporaryURL && hasImageErrored ? (\n\t\t\t// Show a placeholder during upload when the blob URL can't be loaded. This can\n\t\t\t// happen when the user uploads a HEIC image in a browser that doesn't support them.\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-image__placeholder\"\n\t\t\t\twithIllustration\n\t\t\t>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t) : (\n\t\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t\t// should direct focus to block.\n\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t\t<>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\t\talt={ defaultedAlt }\n\t\t\t\t\tonError={ onImageError }\n\t\t\t\t\tonLoad={ onImageLoad }\n\t\t\t\t\tref={ imageRef }\n\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t( width && height ) || aspectRatio\n\t\t\t\t\t\t\t\t? '100%'\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t( width && height ) || aspectRatio\n\t\t\t\t\t\t\t\t? '100%'\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ temporaryURL && <Spinner /> }\n\t\t\t</>\n\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t);\n\n\tif ( canEditImage && isEditingImage ) {\n\t\timg = (\n\t\t\t<ImageWrapper href={ href }>\n\t\t\t\t<ImageEditor\n\t\t\t\t\tid={ id }\n\t\t\t\t\turl={ url }\n\t\t\t\t\twidth={ numericWidth }\n\t\t\t\t\theight={ numericHeight }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t\tonSaveImage={ ( imageAttributes ) =>\n\t\t\t\t\t\tsetAttributes( imageAttributes )\n\t\t\t\t\t}\n\t\t\t\t\tonFinishEditing={ () => {\n\t\t\t\t\t\tsetIsEditingImage( false );\n\t\t\t\t\t} }\n\t\t\t\t\tborderProps={ isRounded ? undefined : borderProps }\n\t\t\t\t/>\n\t\t\t</ImageWrapper>\n\t\t);\n\t} else if ( ! isResizable || parentLayoutType === 'grid' ) {\n\t\timg = (\n\t\t\t<div style={ { width, height, aspectRatio } }>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = numericWidth / numericHeight;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\n\t\tconst currentWidth =\n\t\t\t! numericWidth && numericHeight\n\t\t\t\t? numericHeight * ratio\n\t\t\t\t: numericWidth;\n\t\tconst currentHeight =\n\t\t\t! numericHeight && numericWidth\n\t\t\t\t? numericWidth / ratio\n\t\t\t\t: numericHeight;\n\n\t\tconst minWidth =\n\t\t\tnaturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\tconst minHeight =\n\t\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t// With the current implementation of ResizableBox, an image needs an\n\t\t// explicit pixel value for the max-width. In absence of being able to\n\t\t// set the content-width, this max-width is currently dictated by the\n\t\t// vanilla editor style. The following variable adds a buffer to this\n\t\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t\t// in most cases, allow you to scale the image beyond the width of the\n\t\t// main column, though not infinitely.\n\t\t// @todo It would be good to revisit this once a content-width variable\n\t\t// becomes available.\n\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\tlet showRightHandle = false;\n\t\tlet showLeftHandle = false;\n\n\t\t/* eslint-disable no-lonely-if */\n\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\tif ( align === 'center' ) {\n\t\t\t// When the image is centered, show both handles.\n\t\t\tshowRightHandle = true;\n\t\t\tshowLeftHandle = true;\n\t\t} else if ( isRTL() ) {\n\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t// Show the right handle and hide the left handle only when it is\n\t\t\t// aligned left. Otherwise always show the left handle.\n\t\t\tif ( align === 'left' ) {\n\t\t\t\tshowRightHandle = true;\n\t\t\t} else {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Show the left handle and hide the right handle only when the\n\t\t\t// image is aligned right. Otherwise always show the right handle.\n\t\t\tif ( align === 'right' ) {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t} else {\n\t\t\t\tshowRightHandle = true;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-lonely-if */\n\t\timg = (\n\t\t\t<ResizableBox\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t! width && ! height && aspectRatio\n\t\t\t\t\t\t\t? aspectRatio\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t} }\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth ?? 'auto',\n\t\t\t\t\theight: currentHeight ?? 'auto',\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSingleSelected }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio={ ratio }\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\t// Since the aspect ratio is locked when resizing, we can\n\t\t\t\t\t// use the width of the resized element to calculate the\n\t\t\t\t\t// height in CSS to prevent stretching when the max-width\n\t\t\t\t\t// is reached.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: `${ elt.offsetWidth }px`,\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t\tratio === naturalRatio\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: String( ratio ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tresizeRatio={ align === 'center' ? 2 : 1 }\n\t\t\t>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</ResizableBox>\n\t\t);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\t// Add all controls if the image attributes are connected.\n\t\treturn metadata?.bindings ? controls : sizeControls;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ img }\n\n\t\t\t<Caption\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\tshowToolbarButton={\n\t\t\t\t\tisSingleSelected &&\n\t\t\t\t\thasNonContentControls &&\n\t\t\t\t\t! arePatternOverridesEnabled\n\t\t\t\t}\n\t\t\t\treadOnly={ lockCaption }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,YAAY,EACZC,YAAY,EACZC,OAAO,EACPC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACRC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,4BAA4B,IAAIC,cAAc,EAC9CC,WAAW,QACL,uBAAuB;AAC9B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,iBAAiB,EACjBC,6BAA6B,IAAIC,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,KAAK,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAG;MAAAxB,QAAA,eAE1Cb,IAAA,CAACW,YAAY;QAACC,IAAI,EAAGA,IAAM;QAAAC,QAAA,EAAGsH;MAAG,CAAgB;IAAC,CACrC,CACd;EACF;EAEA,IAAK,CAAEhG,GAAG,IAAI,CAAEb,YAAY,EAAG;IAC9B;IACA,OAAO4B,QAAQ,EAAE4G,QAAQ,GAAGuB,QAAQ,GAAGzB,YAAY;EACpD;EAEA,oBACC1J,KAAA,CAAAE,SAAA;IAAAS,QAAA,GACGwK,QAAQ,EACRlD,GAAG,eAELnI,IAAA,CAACN,OAAO;MACP6B,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA,aAAe;MAC/BgO,UAAU,EAAG/N,gBAAkB;MAC/BC,iBAAiB,EAAGA,iBAAmB;MACvCjB,KAAK,EAAG/B,EAAE,CAAE,oBAAqB,CAAG;MACpC+Q,iBAAiB,EAChBhO,gBAAgB,IAChB6D,qBAAqB,IACrB,CAAEuE,0BACF;MACDmD,QAAQ,EAAGzC;IAAa,CACxB,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { createBlobURL } from '@wordpress/blob';
|
|
4
|
+
import { createBlobURL, isBlobURL } from '@wordpress/blob';
|
|
5
5
|
import { createBlock, getBlockAttributes } from '@wordpress/blocks';
|
|
6
6
|
import { dispatch } from '@wordpress/data';
|
|
7
7
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -87,6 +87,10 @@ const transforms = {
|
|
|
87
87
|
linkClass,
|
|
88
88
|
anchor
|
|
89
89
|
});
|
|
90
|
+
if (isBlobURL(attributes.url)) {
|
|
91
|
+
attributes.blob = attributes.url;
|
|
92
|
+
delete attributes.url;
|
|
93
|
+
}
|
|
90
94
|
return createBlock('core/image', attributes);
|
|
91
95
|
}
|
|
92
96
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createBlobURL","createBlock","getBlockAttributes","dispatch","store","noticesStore","__","stripFirstImage","attributes","shortcode","body","document","implementation","createHTMLDocument","innerHTML","content","nodeToRemove","querySelector","parentNode","removeChild","trim","getFirstAnchorAttributeFormHTML","html","attributeName","firstElementChild","nodeName","getAttribute","undefined","imageSchema","img","classes","schema","phrasingContentSchema","figure","require","children","a","figcaption","transforms","from","type","isMatch","node","transform","className","alignMatches","exec","anchor","id","align","idMatches","Number","anchorElement","linkDestination","href","rel","linkClass","outerHTML","files","some","file","indexOf","createErrorNotice","every","blocks","map","blob","tag","url","source","attribute","selector","alt","caption","named","parseInt","replace"],"sources":["@wordpress/block-library/src/image/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\nexport function stripFirstImage( attributes, { shortcode } ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = shortcode.content;\n\n\tlet nodeToRemove = body.querySelector( 'img' );\n\n\t// If an image has parents, find the topmost node to remove.\n\twhile (\n\t\tnodeToRemove &&\n\t\tnodeToRemove.parentNode &&\n\t\tnodeToRemove.parentNode !== body\n\t) {\n\t\tnodeToRemove = nodeToRemove.parentNode;\n\t}\n\n\tif ( nodeToRemove ) {\n\t\tnodeToRemove.parentNode.removeChild( nodeToRemove );\n\t}\n\n\treturn body.innerHTML.trim();\n}\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif ( firstElementChild && firstElementChild.nodeName === 'A' ) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt', 'title' ],\n\t\tclasses: [\n\t\t\t'alignleft',\n\t\t\t'aligncenter',\n\t\t\t'alignright',\n\t\t\t'alignnone',\n\t\t\t/^wp-image-\\d+$/,\n\t\t],\n\t},\n};\n\nconst schema = ( { phrasingContentSchema } ) => ( {\n\tfigure: {\n\t\trequire: [ 'img' ],\n\t\tchildren: {\n\t\t\t...imageSchema,\n\t\t\ta: {\n\t\t\t\tattributes: [ 'href', 'rel', 'target' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'FIGURE' && !! node.querySelector( 'img' ),\n\t\t\tschema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\t// Search both figure and image classes. Alignment could be\n\t\t\t\t// set on either. ID is set on the image.\n\t\t\t\tconst className =\n\t\t\t\t\tnode.className +\n\t\t\t\t\t' ' +\n\t\t\t\t\tnode.querySelector( 'img' ).className;\n\t\t\t\tconst alignMatches =\n\t\t\t\t\t/(?:^|\\s)align(left|center|right)(?:$|\\s)/.exec(\n\t\t\t\t\t\tclassName\n\t\t\t\t\t);\n\t\t\t\tconst anchor = node.id === '' ? undefined : node.id;\n\t\t\t\tconst align = alignMatches ? alignMatches[ 1 ] : undefined;\n\t\t\t\tconst idMatches = /(?:^|\\s)wp-image-(\\d+)(?:$|\\s)/.exec(\n\t\t\t\t\tclassName\n\t\t\t\t);\n\t\t\t\tconst id = idMatches ? Number( idMatches[ 1 ] ) : undefined;\n\t\t\t\tconst anchorElement = node.querySelector( 'a' );\n\t\t\t\tconst linkDestination =\n\t\t\t\t\tanchorElement && anchorElement.href ? 'custom' : undefined;\n\t\t\t\tconst href =\n\t\t\t\t\tanchorElement && anchorElement.href\n\t\t\t\t\t\t? anchorElement.href\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst rel =\n\t\t\t\t\tanchorElement && anchorElement.rel\n\t\t\t\t\t\t? anchorElement.rel\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst linkClass =\n\t\t\t\t\tanchorElement && anchorElement.className\n\t\t\t\t\t\t? anchorElement.className\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst attributes = getBlockAttributes(\n\t\t\t\t\t'core/image',\n\t\t\t\t\tnode.outerHTML,\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlinkDestination,\n\t\t\t\t\t\thref,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkClass,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn createBlock( 'core/image', attributes );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Note: when dragging and dropping multiple files onto a gallery this overrides the\n\t\t\t// gallery transform in order to add new images to the gallery instead of\n\t\t\t// creating a new gallery.\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\t// The following check is intended to catch non-image files when dropped together with images.\n\t\t\t\tif (\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t\t) &&\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) !== 0\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst { createErrorNotice } = dispatch( noticesStore );\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'gallery-transform-invalid-file',\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn files.every(\n\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst blocks = files.map( ( file ) => {\n\t\t\t\t\treturn createBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'caption',\n\t\t\tattributes: {\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'src',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\talt: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'alt',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\tcaption: {\n\t\t\t\t\tshortcode: stripFirstImage,\n\t\t\t\t},\n\t\t\t\thref: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'href'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trel: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'rel'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlinkClass: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'class'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tshortcode: ( { named: { id } } ) => {\n\t\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parseInt( id.replace( 'attachment_', '' ), 10 );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { align = 'alignnone' } } ) => {\n\t\t\t\t\t\treturn align.replace( 'align', '' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,mBAAmB;AACnE,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,SAASC,eAAeA,CAAEC,UAAU,EAAE;EAAEC;AAAU,CAAC,EAAG;EAC5D,MAAM;IAAEC;EAAK,CAAC,GAAGC,QAAQ,CAACC,cAAc,CAACC,kBAAkB,CAAE,EAAG,CAAC;EAEjEH,IAAI,CAACI,SAAS,GAAGL,SAAS,CAACM,OAAO;EAElC,IAAIC,YAAY,GAAGN,IAAI,CAACO,aAAa,CAAE,KAAM,CAAC;;EAE9C;EACA,OACCD,YAAY,IACZA,YAAY,CAACE,UAAU,IACvBF,YAAY,CAACE,UAAU,KAAKR,IAAI,EAC/B;IACDM,YAAY,GAAGA,YAAY,CAACE,UAAU;EACvC;EAEA,IAAKF,YAAY,EAAG;IACnBA,YAAY,CAACE,UAAU,CAACC,WAAW,CAAEH,YAAa,CAAC;EACpD;EAEA,OAAON,IAAI,CAACI,SAAS,CAACM,IAAI,CAAC,CAAC;AAC7B;AAEA,SAASC,+BA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,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,MACD,CAAC;QACF;MACD,CAAC;MACDwC,GAAG,EAAE;QACJ9C,SAAS,EAAEA,CAAED,UAAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,KACD,CAAC;QACF;MACD,CAAC;MACDyC,SAAS,EAAE;QACV/C,SAAS,EAAEA,CAAED,UAAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,OACD,CAAC;QACF;MACD,CAAC;MACDiC,EAAE,EAAE;QACHR,IAAI,EAAE,QAAQ;QACd/B,SAAS,EAAEA,CAAE;UAAEiE,KAAK,EAAE;YAAE1B;UAAG;QAAE,CAAC,KAAM;UACnC,IAAK,CAAEA,EAAE,EAAG;YACX;UACD;UAEA,OAAO2B,QAAQ,CAAE3B,EAAE,CAAC4B,OAAO,CAAE,aAAa,EAAE,EAAG,CAAC,EAAE,EAAG,CAAC;QACvD;MACD,CAAC;MACD3B,KAAK,EAAE;QACNT,IAAI,EAAE,QAAQ;QACd/B,SAAS,EAAEA,CAAE;UAAEiE,KAAK,EAAE;YAAEzB,KAAK,GAAG;UAAY;QAAE,CAAC,KAAM;UACpD,OAAOA,KAAK,CAAC2B,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC;QACpC;MACD;IACD;EACD,CAAC;AAEH,CAAC;AAED,eAAetC,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createBlobURL","isBlobURL","createBlock","getBlockAttributes","dispatch","store","noticesStore","__","stripFirstImage","attributes","shortcode","body","document","implementation","createHTMLDocument","innerHTML","content","nodeToRemove","querySelector","parentNode","removeChild","trim","getFirstAnchorAttributeFormHTML","html","attributeName","firstElementChild","nodeName","getAttribute","undefined","imageSchema","img","classes","schema","phrasingContentSchema","figure","require","children","a","figcaption","transforms","from","type","isMatch","node","transform","className","alignMatches","exec","anchor","id","align","idMatches","Number","anchorElement","linkDestination","href","rel","linkClass","outerHTML","url","blob","files","some","file","indexOf","createErrorNotice","every","blocks","map","tag","source","attribute","selector","alt","caption","named","parseInt","replace"],"sources":["@wordpress/block-library/src/image/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlobURL, isBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\nexport function stripFirstImage( attributes, { shortcode } ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = shortcode.content;\n\n\tlet nodeToRemove = body.querySelector( 'img' );\n\n\t// If an image has parents, find the topmost node to remove.\n\twhile (\n\t\tnodeToRemove &&\n\t\tnodeToRemove.parentNode &&\n\t\tnodeToRemove.parentNode !== body\n\t) {\n\t\tnodeToRemove = nodeToRemove.parentNode;\n\t}\n\n\tif ( nodeToRemove ) {\n\t\tnodeToRemove.parentNode.removeChild( nodeToRemove );\n\t}\n\n\treturn body.innerHTML.trim();\n}\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif ( firstElementChild && firstElementChild.nodeName === 'A' ) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt', 'title' ],\n\t\tclasses: [\n\t\t\t'alignleft',\n\t\t\t'aligncenter',\n\t\t\t'alignright',\n\t\t\t'alignnone',\n\t\t\t/^wp-image-\\d+$/,\n\t\t],\n\t},\n};\n\nconst schema = ( { phrasingContentSchema } ) => ( {\n\tfigure: {\n\t\trequire: [ 'img' ],\n\t\tchildren: {\n\t\t\t...imageSchema,\n\t\t\ta: {\n\t\t\t\tattributes: [ 'href', 'rel', 'target' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'FIGURE' && !! node.querySelector( 'img' ),\n\t\t\tschema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\t// Search both figure and image classes. Alignment could be\n\t\t\t\t// set on either. ID is set on the image.\n\t\t\t\tconst className =\n\t\t\t\t\tnode.className +\n\t\t\t\t\t' ' +\n\t\t\t\t\tnode.querySelector( 'img' ).className;\n\t\t\t\tconst alignMatches =\n\t\t\t\t\t/(?:^|\\s)align(left|center|right)(?:$|\\s)/.exec(\n\t\t\t\t\t\tclassName\n\t\t\t\t\t);\n\t\t\t\tconst anchor = node.id === '' ? undefined : node.id;\n\t\t\t\tconst align = alignMatches ? alignMatches[ 1 ] : undefined;\n\t\t\t\tconst idMatches = /(?:^|\\s)wp-image-(\\d+)(?:$|\\s)/.exec(\n\t\t\t\t\tclassName\n\t\t\t\t);\n\t\t\t\tconst id = idMatches ? Number( idMatches[ 1 ] ) : undefined;\n\t\t\t\tconst anchorElement = node.querySelector( 'a' );\n\t\t\t\tconst linkDestination =\n\t\t\t\t\tanchorElement && anchorElement.href ? 'custom' : undefined;\n\t\t\t\tconst href =\n\t\t\t\t\tanchorElement && anchorElement.href\n\t\t\t\t\t\t? anchorElement.href\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst rel =\n\t\t\t\t\tanchorElement && anchorElement.rel\n\t\t\t\t\t\t? anchorElement.rel\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst linkClass =\n\t\t\t\t\tanchorElement && anchorElement.className\n\t\t\t\t\t\t? anchorElement.className\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst attributes = getBlockAttributes(\n\t\t\t\t\t'core/image',\n\t\t\t\t\tnode.outerHTML,\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlinkDestination,\n\t\t\t\t\t\thref,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkClass,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( isBlobURL( attributes.url ) ) {\n\t\t\t\t\tattributes.blob = attributes.url;\n\t\t\t\t\tdelete attributes.url;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( 'core/image', attributes );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Note: when dragging and dropping multiple files onto a gallery this overrides the\n\t\t\t// gallery transform in order to add new images to the gallery instead of\n\t\t\t// creating a new gallery.\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\t// The following check is intended to catch non-image files when dropped together with images.\n\t\t\t\tif (\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t\t) &&\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) !== 0\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst { createErrorNotice } = dispatch( noticesStore );\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'gallery-transform-invalid-file',\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn files.every(\n\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst blocks = files.map( ( file ) => {\n\t\t\t\t\treturn createBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'caption',\n\t\t\tattributes: {\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'src',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\talt: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'alt',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\tcaption: {\n\t\t\t\t\tshortcode: stripFirstImage,\n\t\t\t\t},\n\t\t\t\thref: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'href'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trel: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'rel'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlinkClass: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'class'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tshortcode: ( { named: { id } } ) => {\n\t\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parseInt( id.replace( 'attachment_', '' ), 10 );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { align = 'alignnone' } } ) => {\n\t\t\t\t\t\treturn align.replace( 'align', '' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,SAAS,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,mBAAmB;AACnE,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,SAASC,eAAeA,CAAEC,UAAU,EAAE;EAAEC;AAAU,CAAC,EAAG;EAC5D,MAAM;IAAEC;EAAK,CAAC,GAAGC,QAAQ,CAACC,cAAc,CAACC,kBAAkB,CAAE,EAAG,CAAC;EAEjEH,IAAI,CAACI,SAAS,GAAGL,SAAS,CAACM,OAAO;EAElC,IAAIC,YAAY,GAAGN,IAAI,CAACO,aAAa,CAAE,KAAM,CAAC;;EAE9C;EACA,OACCD,YAAY,IACZA,YAAY,CAACE,UAAU,IACvBF,YAAY,CAACE,UAAU,KAAKR,IAAI,EAC/B;IACDM,YAAY,GAAGA,YAAY,CAACE,UAAU;EACvC;EAEA,IAAKF,YAAY,EAAG;IACnBA,YAAY,CAACE,UAAU,CAACC,WAAW,CAAEH,YAAa,CAAC;EACpD;EAEA,OAAON,IAAI,CAACI,SAAS,CAACM,IAAI,CAAC,CAAC;AAC7B;AAEA,SAASC,+BAA+BA,CAAEC,IAAI,EAAEC,aAAa,EAAG;EAC/D,MAAM;IAAEb;EAAK,CAAC,GAAGC,QAAQ,CAACC,cAAc,CAACC,kBAAkB,CAAE,EAAG,CAAC;EAEjEH,IAAI,CAACI,SAAS,GA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