@wordpress/block-library 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +7 -1
- package/build/audio/edit.js +1 -1
- package/build/audio/edit.js.map +1 -1
- package/build/button/index.js +5 -1
- package/build/button/index.js.map +1 -1
- package/build/calendar/index.js +4 -1
- package/build/calendar/index.js.map +1 -1
- package/build/calendar/transforms.js +27 -0
- package/build/calendar/transforms.js.map +1 -0
- package/build/code/index.js +5 -1
- package/build/code/index.js.map +1 -1
- package/build/code/transforms.js +1 -1
- package/build/code/transforms.js.map +1 -1
- package/build/column/index.js +5 -1
- package/build/column/index.js.map +1 -1
- package/build/columns/index.js +5 -1
- package/build/columns/index.js.map +1 -1
- package/build/comment-author-avatar/index.js +4 -1
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/index.js +6 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +5 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +6 -1
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +5 -1
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +5 -1
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/edit.js +49 -11
- package/build/comment-template/edit.js.map +1 -1
- package/build/comments-pagination/index.js +6 -1
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +4 -1
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +4 -1
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/comments-query-loop/index.js +6 -1
- package/build/comments-query-loop/index.js.map +1 -1
- package/build/cover/deprecated.js +181 -15
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit.js +7 -4
- package/build/cover/edit.js.map +1 -1
- package/build/cover/save.js +8 -3
- package/build/cover/save.js.map +1 -1
- package/build/gallery/constants.js +5 -1
- package/build/gallery/constants.js.map +1 -1
- package/build/gallery/edit.js +26 -14
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/shared.js +1 -1
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +8 -2
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/utils.js +4 -3
- package/build/gallery/utils.js.map +1 -1
- package/build/group/index.js +5 -1
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +18 -3
- package/build/group/variations.js.map +1 -1
- package/build/heading/index.js +5 -1
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +7 -5
- package/build/heading/transforms.js.map +1 -1
- package/build/image/edit.native.js +55 -15
- package/build/image/edit.native.js.map +1 -1
- package/build/index.js +7 -3
- package/build/index.js.map +1 -1
- package/build/latest-posts/edit.js +46 -57
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/index.js +5 -1
- package/build/list/index.js.map +1 -1
- package/build/media-text/index.js +5 -1
- package/build/media-text/index.js.map +1 -1
- package/build/navigation/edit/existing-menus-options.js +62 -0
- package/build/navigation/edit/existing-menus-options.js.map +1 -0
- package/build/navigation/edit/index.js +4 -5
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +7 -3
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +25 -33
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/overlay-menu-icon.js +0 -1
- package/build/navigation/edit/overlay-menu-icon.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +26 -71
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/placeholder/placeholder-preview.js +8 -12
- package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build/paragraph/index.js +5 -1
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +5 -1
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-author/index.js +5 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/edit.js +76 -0
- package/build/post-author-biography/edit.js.map +1 -0
- package/build/post-author-biography/index.js +68 -0
- package/build/post-author-biography/index.js.map +1 -0
- package/build/post-author-name/index.js +6 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments/index.js +5 -1
- package/build/post-comments/index.js.map +1 -1
- package/build/post-comments-count/index.js +5 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +5 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +5 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +9 -3
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/index.js +6 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/index.js +6 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-terms/index.js +9 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/edit.js +10 -7
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +6 -1
- package/build/post-title/index.js.map +1 -1
- package/build/preformatted/index.js +5 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/index.js +5 -1
- package/build/pullquote/index.js.map +1 -1
- package/build/query/index.js +5 -1
- package/build/query/index.js.map +1 -1
- package/build/query-pagination/index.js +6 -1
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination-next/index.js +4 -1
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +4 -1
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/index.js +8 -1
- package/build/query-title/index.js.map +1 -1
- package/build/quote/index.js +1 -5
- package/build/quote/index.js.map +1 -1
- package/build/read-more/edit.js +55 -0
- package/build/read-more/edit.js.map +1 -0
- package/build/read-more/index.js +87 -0
- package/build/read-more/index.js.map +1 -0
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +5 -1
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +4 -8
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +7 -2
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/index.js +5 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +6 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +8 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +1 -1
- package/build/social-links/edit.js +7 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +5 -0
- package/build/social-links/index.js.map +1 -1
- package/build/social-links/save.js +2 -0
- package/build/social-links/save.js.map +1 -1
- package/build/table/index.js +5 -1
- package/build/table/index.js.map +1 -1
- package/build/tag-cloud/index.js +12 -1
- package/build/tag-cloud/index.js.map +1 -1
- package/build/tag-cloud/transforms.js +27 -0
- package/build/tag-cloud/transforms.js.map +1 -0
- package/build/term-description/index.js +5 -1
- package/build/term-description/index.js.map +1 -1
- package/build/verse/index.js +5 -1
- package/build/verse/index.js.map +1 -1
- package/build-module/audio/edit.js +1 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/button/index.js +5 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/calendar/index.js +3 -1
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/calendar/transforms.js +18 -0
- package/build-module/calendar/transforms.js.map +1 -0
- package/build-module/code/index.js +5 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/code/transforms.js +1 -1
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/column/index.js +5 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/index.js +5 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +4 -1
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +6 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +5 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +6 -1
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +5 -1
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +5 -1
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/edit.js +48 -13
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comments-pagination/index.js +6 -1
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +4 -1
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +4 -1
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/comments-query-loop/index.js +6 -1
- package/build-module/comments-query-loop/index.js.map +1 -1
- package/build-module/cover/deprecated.js +185 -17
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit.js +7 -4
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/save.js +8 -3
- package/build-module/cover/save.js.map +1 -1
- package/build-module/gallery/constants.js +2 -0
- package/build-module/gallery/constants.js.map +1 -1
- package/build-module/gallery/edit.js +25 -14
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/shared.js +1 -1
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +8 -2
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/utils.js +5 -4
- package/build-module/gallery/utils.js.map +1 -1
- package/build-module/group/index.js +5 -1
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +18 -3
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/index.js +5 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +7 -5
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/edit.native.js +54 -15
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/index.js +5 -3
- package/build-module/index.js.map +1 -1
- package/build-module/latest-posts/edit.js +47 -58
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/index.js +5 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/media-text/index.js +5 -1
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/navigation/edit/existing-menus-options.js +53 -0
- package/build-module/navigation/edit/existing-menus-options.js.map +1 -0
- package/build-module/navigation/edit/index.js +4 -5
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +8 -4
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +26 -33
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-icon.js +0 -1
- package/build-module/navigation/edit/overlay-menu-icon.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +26 -71
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/placeholder/placeholder-preview.js +8 -13
- package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build-module/paragraph/index.js +5 -1
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +5 -1
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-author/index.js +5 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/edit.js +64 -0
- package/build-module/post-author-biography/edit.js.map +1 -0
- package/build-module/post-author-biography/index.js +59 -0
- package/build-module/post-author-biography/index.js.map +1 -0
- package/build-module/post-author-name/index.js +6 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments/index.js +5 -1
- package/build-module/post-comments/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +5 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +5 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +5 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +6 -4
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/index.js +6 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/index.js +6 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-terms/index.js +12 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/edit.js +10 -8
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +6 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/preformatted/index.js +5 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/index.js +5 -1
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/query/index.js +5 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query-pagination/index.js +6 -1
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination-next/index.js +4 -1
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +4 -1
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/index.js +11 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/index.js +1 -5
- package/build-module/quote/index.js.map +1 -1
- package/build-module/read-more/edit.js +41 -0
- package/build-module/read-more/edit.js.map +1 -0
- package/build-module/read-more/index.js +74 -0
- package/build-module/read-more/index.js.map +1 -0
- package/build-module/search/edit.js +1 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +5 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +4 -8
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +6 -2
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +5 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +6 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +8 -1
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +1 -1
- package/build-module/social-links/edit.js +7 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +5 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/social-links/save.js +2 -0
- package/build-module/social-links/save.js.map +1 -1
- package/build-module/table/index.js +5 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/tag-cloud/index.js +11 -1
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/tag-cloud/transforms.js +18 -0
- package/build-module/tag-cloud/transforms.js.map +1 -0
- package/build-module/term-description/index.js +5 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/verse/index.js +5 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-style/common-rtl.css +8 -0
- package/build-style/common.css +8 -0
- package/build-style/cover/style-rtl.css +115 -11
- package/build-style/cover/style.css +115 -11
- package/build-style/editor-rtl.css +77 -67
- package/build-style/editor.css +77 -67
- package/build-style/gallery/style-rtl.css +2 -1
- package/build-style/gallery/style.css +2 -1
- package/build-style/image/style-rtl.css +0 -2
- package/build-style/image/style.css +0 -2
- package/build-style/navigation/editor-rtl.css +77 -67
- package/build-style/navigation/editor.css +77 -67
- package/build-style/quote/style-rtl.css +5 -5
- package/build-style/quote/style.css +5 -5
- package/build-style/read-more/style-rtl.css +87 -0
- package/build-style/read-more/style.css +87 -0
- package/build-style/separator/style-rtl.css +0 -3
- package/build-style/separator/style.css +0 -3
- package/build-style/social-links/style-rtl.css +7 -1
- package/build-style/social-links/style.css +7 -1
- package/build-style/style-rtl.css +149 -23
- package/build-style/style.css +149 -23
- package/package.json +28 -30
- package/src/audio/edit.js +1 -1
- package/src/block/test/edit.native.js +7 -3
- package/src/button/block.json +5 -1
- package/src/buttons/test/edit.native.js +2 -2
- package/src/calendar/index.js +2 -0
- package/src/calendar/transforms.js +23 -0
- package/src/code/block.json +5 -1
- package/src/code/transforms.js +1 -1
- package/src/column/block.json +5 -1
- package/src/columns/block.json +5 -1
- package/src/comment-author-avatar/block.json +4 -1
- package/src/comment-author-name/block.json +6 -1
- package/src/comment-content/block.json +5 -1
- package/src/comment-date/block.json +6 -1
- package/src/comment-date/index.php +1 -1
- package/src/comment-edit-link/block.json +5 -1
- package/src/comment-reply-link/block.json +5 -1
- package/src/comment-template/edit.js +59 -14
- package/src/comments-pagination/block.json +6 -1
- package/src/comments-pagination-next/block.json +4 -1
- package/src/comments-pagination-previous/block.json +4 -1
- package/src/comments-query-loop/block.json +6 -1
- package/src/common.scss +9 -0
- package/src/cover/deprecated.js +211 -1
- package/src/cover/edit.js +8 -4
- package/src/cover/save.js +10 -4
- package/src/cover/style.scss +20 -2
- package/src/cover/test/__snapshots__/edit.native.js.snap +4 -4
- package/src/cover/test/edit.native.js +8 -4
- package/src/embed/test/index.native.js +6 -6
- package/src/gallery/constants.js +2 -0
- package/src/gallery/edit.js +31 -13
- package/src/gallery/shared.js +1 -1
- package/src/gallery/style.scss +4 -1
- package/src/gallery/test/__snapshots__/index.native.js.snap +7 -0
- package/src/gallery/test/index.native.js +128 -0
- package/src/gallery/transforms.js +7 -1
- package/src/gallery/utils.js +7 -3
- package/src/group/block.json +5 -1
- package/src/group/variations.js +11 -1
- package/src/heading/block.json +5 -1
- package/src/heading/transforms.js +2 -5
- package/src/image/edit.native.js +65 -15
- package/src/image/index.php +1 -1
- package/src/image/style.scss +0 -2
- package/src/image/test/edit.native.js +157 -8
- package/src/index.js +35 -31
- package/src/latest-comments/index.php +4 -4
- package/src/latest-posts/edit.js +51 -63
- package/src/latest-posts/index.php +3 -3
- package/src/list/block.json +5 -1
- package/src/media-text/block.json +5 -1
- package/src/missing/test/edit-integration.native.js +2 -2
- package/src/navigation/edit/existing-menus-options.js +70 -0
- package/src/navigation/edit/index.js +4 -3
- package/src/navigation/edit/inner-blocks.js +16 -3
- package/src/navigation/edit/navigation-menu-selector.js +38 -62
- package/src/navigation/edit/overlay-menu-icon.js +0 -1
- package/src/navigation/edit/placeholder/index.js +39 -108
- package/src/navigation/edit/placeholder/placeholder-preview.js +8 -10
- package/src/navigation/editor.scss +119 -100
- package/src/navigation/index.php +3 -3
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/index.php +1 -1
- package/src/page-list/index.php +5 -5
- package/src/paragraph/block.json +5 -1
- package/src/post-author/block.json +5 -1
- package/src/post-author-biography/block.json +41 -0
- package/src/post-author-biography/edit.js +63 -0
- package/src/post-author-biography/index.js +18 -0
- package/src/post-author-biography/index.php +48 -0
- package/src/post-author-name/block.json +6 -1
- package/src/post-comments/block.json +5 -1
- package/src/post-comments-count/block.json +5 -1
- package/src/post-comments-form/block.json +5 -1
- package/src/post-comments-link/block.json +5 -1
- package/src/post-comments-link/index.php +2 -2
- package/src/post-content/edit.js +4 -4
- package/src/post-date/block.json +6 -1
- package/src/post-date/index.php +1 -1
- package/src/post-excerpt/block.json +6 -1
- package/src/post-excerpt/index.php +1 -1
- package/src/post-terms/block.json +6 -1
- package/src/post-terms/index.js +6 -0
- package/src/post-title/block.json +6 -1
- package/src/post-title/edit.js +8 -7
- package/src/post-title/index.php +1 -1
- package/src/preformatted/block.json +5 -1
- package/src/pullquote/block.json +5 -1
- package/src/query/block.json +5 -1
- package/src/query-pagination/block.json +6 -1
- package/src/query-pagination-next/block.json +4 -1
- package/src/query-pagination-next/index.php +2 -2
- package/src/query-pagination-previous/block.json +4 -1
- package/src/query-pagination-previous/index.php +2 -2
- package/src/query-title/block.json +5 -1
- package/src/query-title/index.js +6 -0
- package/src/quote/block.json +1 -2
- package/src/quote/index.js +0 -1
- package/src/quote/style.scss +3 -3
- package/src/quote/theme.scss +1 -1
- package/src/read-more/block.json +56 -0
- package/src/read-more/edit.js +50 -0
- package/src/read-more/index.js +18 -0
- package/src/read-more/index.php +45 -0
- package/src/read-more/style.scss +12 -0
- package/src/search/block.json +5 -1
- package/src/search/edit.js +2 -1
- package/src/search/index.php +5 -3
- package/src/separator/style.scss +0 -5
- package/src/site-logo/edit.js +4 -8
- package/src/site-tagline/block.json +5 -1
- package/src/site-tagline/edit.js +10 -1
- package/src/site-tagline/index.php +1 -1
- package/src/site-title/block.json +6 -1
- package/src/site-title/index.php +2 -2
- package/src/social-link/block.json +1 -0
- package/src/social-link/edit.js +14 -2
- package/src/social-link/index.php +55 -52
- package/src/social-links/block.json +5 -0
- package/src/social-links/edit.js +8 -1
- package/src/social-links/save.js +7 -1
- package/src/social-links/style.scss +8 -1
- package/src/style.scss +1 -0
- package/src/table/block.json +5 -1
- package/src/tag-cloud/block.json +4 -0
- package/src/tag-cloud/index.js +2 -0
- package/src/tag-cloud/index.php +0 -9
- package/src/tag-cloud/transforms.js +23 -0
- package/src/term-description/block.json +5 -1
- package/src/verse/block.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/image/edit.native.js"],"names":["getUrlForSlug","image","sizeSlug","undefined","media_details","sizes","source_url","LinkSettings","attributes","isLinkSheetVisible","setMappedAttributes","route","href","url","label","linkDestination","linkTarget","rel","inputValue","newUrl","params","newLinkDestination","LINK_DESTINATION_MEDIA","link","LINK_DESTINATION_ATTACHMENT","LINK_DESTINATION_NONE","LINK_DESTINATION_CUSTOM","valueMask","linkSettingsOptions","autoFocus","autoFill","openInNewTab","linkRel","placeholder","navigation","navigate","blockSettingsScreens","imageLinkDestinations","imageUrl","attachmentPageUrl","ImageEdit","Component","constructor","props","state","isCaptionSelected","finishMediaUploadWithSuccess","bind","finishMediaUploadWithFailure","mediaUploadStateReset","onSelectMediaUploadOption","updateMediaProgress","updateImageURL","onSetNewTab","onSetSizeSlug","onImagePressed","onSetFeatured","onFocusCaption","updateAlignment","accessibilityLabelCreator","onSizeChangeValue","componentDidMount","setAttributes","id","console","warn","componentWillUnmount","isUploadInProgress","componentDidUpdate","previousProps","getDerivedStateFromProps","isSelected","caption","trim","length","setState","payload","mediaUrl","mediaServerId","mediaId","width","height","nextAlign","extraUpdatedAttributes","Object","values","WIDE_ALIGNMENTS","alignments","includes","align","value","updatedLinkTarget","media","imageDefaultSize","destination","mediaAttributes","additionalAttributes","onFocus","getPlaceholderIcon","placeholderIcon","getStylesFromColorScheme","styles","iconPlaceholder","iconPlaceholderDark","getWidth","restAttributes","getAltTextSettings","alt","updateAlt","newAlt","textColor","newValue","closeSettingsBottomSheet","getFeaturedButtonPanel","isFeaturedImage","setFeaturedButtonStyle","setFeaturedButton","setFeaturedButtonDark","removeFeaturedButton","setFeaturedButtonCellContainer","MEDIA_ID_NO_FEATURED_IMAGE_SET","render","clientId","context","featuredImageId","wasBlockJustInserted","className","hasImageContext","keys","imageSizes","Array","isArray","sizeOptions","filter","slug","map","name","selectedSizeOption","sizeOptionsValid","find","option","canImageBeFeatured","getToolbarEditButton","open","replace","getInspectorControls","panelBody","fullscreen","featuredImagePanelTitle","content","MEDIA_TYPE_IMAGE","alignToFlex","left","center","right","full","wide","additionalImageProps","resizeMode","imageCrop","imageContainerStyles","fixedHeight","getImageComponent","openMediaOptions","getMediaOptions","isUploadFailed","retryMessage","onBlur","insertBlocksAfter","select","getMedia","coreStore","getSettings","blockEditorStore","getEditedPostAttribute","isNotFileUrl","shouldGetMedia","dispatch","editPostStore","closeGeneralSidebar","withPreferredColorScheme"],"mappings":";;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AAQA;;AAeA;;AAaA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAKA;;AACA;;AAEA;;AAlEA;AACA;AACA;;AAIA;AACA;AACA;;AAoDA;AACA;AACA;AAYA,MAAMA,aAAa,GAAG,CAAEC,KAAF,EAASC,QAAT,KAAuB;AAAA;;AAC5C,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAOC,SAAP;AACA;;AACD,SAAOF,KAAP,aAAOA,KAAP,+CAAOA,KAAK,CAAEG,aAAd,kFAAO,qBAAsBC,KAA7B,oFAAO,sBAA+BH,QAA/B,CAAP,2DAAO,uBAA2CI,UAAlD;AACA,CALD;;AAOA,SAASC,YAAT,OAKI;AAAA;;AAAA,MALmB;AACtBC,IAAAA,UADsB;AAEtBP,IAAAA,KAFsB;AAGtBQ,IAAAA,kBAHs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B,GAAG;AAC1BiE,MAAAA,QAAQ,CAAEC,eAAF,CAAR,CAA0BC,mBAA1B;AACA;;AAHK,GAAP;AAKA,CAND,CApCuB,EA2CvBC,iCA3CuB,CAAT,EA4CV5I,SA5CU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View, TouchableWithoutFeedback } from 'react-native';\nimport { useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { Component, useEffect } from '@wordpress/element';\nimport {\n\trequestMediaImport,\n\tmediaUploadSync,\n\trequestImageFailedRetryDialog,\n\trequestImageUploadCancelDialog,\n\trequestImageFullscreenPreview,\n\tsetFeaturedImage,\n} from '@wordpress/react-native-bridge';\nimport {\n\tIcon,\n\tPanelBody,\n\tToolbarButton,\n\tToolbarGroup,\n\tImage,\n\tWIDE_ALIGNMENTS,\n\tLinkSettingsNavigation,\n\tBottomSheet,\n\tBottomSheetTextControl,\n\tBottomSheetSelectControl,\n\tFooterMessageControl,\n\tFooterMessageLink,\n\tBadge,\n} from '@wordpress/components';\nimport {\n\tBlockCaption,\n\tMediaPlaceholder,\n\tMediaUpload,\n\tMediaUploadProgress,\n\tMEDIA_TYPE_IMAGE,\n\tBlockControls,\n\tInspectorControls,\n\tBlockAlignmentToolbar,\n\tBlockStyles,\n\tstore as blockEditorStore,\n\tblockSettingsScreens,\n} from '@wordpress/block-editor';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getProtocol, hasQueryArg } from '@wordpress/url';\nimport { doAction, hasAction } from '@wordpress/hooks';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport {\n\timage as placeholderIcon,\n\treplace,\n\tfullscreen,\n\ttextColor,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editPostStore } from '@wordpress/edit-post';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { getUpdatedLinkTargetSettings } from './utils';\n\nimport {\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_CUSTOM,\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tMEDIA_ID_NO_FEATURED_IMAGE_SET,\n} from './constants';\n\nconst getUrlForSlug = ( image, sizeSlug ) => {\n\tif ( ! sizeSlug ) {\n\t\treturn undefined;\n\t}\n\treturn image?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n};\n\nfunction LinkSettings( {\n\tattributes,\n\timage,\n\tisLinkSheetVisible,\n\tsetMappedAttributes,\n} ) {\n\tconst route = useRoute();\n\tconst { href: url, label, linkDestination, linkTarget, rel } = attributes;\n\n\t// Persist attributes passed from child screen\n\tuseEffect( () => {\n\t\tconst { inputValue: newUrl } = route.params || {};\n\n\t\tlet newLinkDestination;\n\t\tswitch ( newUrl ) {\n\t\t\tcase attributes.url:\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_MEDIA;\n\t\t\t\tbreak;\n\t\t\tcase image?.link:\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_ATTACHMENT;\n\t\t\t\tbreak;\n\t\t\tcase '':\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_NONE;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_CUSTOM;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tsetMappedAttributes( {\n\t\t\turl: newUrl,\n\t\t\tlinkDestination: newLinkDestination,\n\t\t} );\n\t}, [ route.params?.inputValue ] );\n\n\tlet valueMask;\n\tswitch ( linkDestination ) {\n\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\tvalueMask = __( 'Media File' );\n\t\t\tbreak;\n\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\tvalueMask = __( 'Attachment Page' );\n\t\t\tbreak;\n\t\tcase LINK_DESTINATION_CUSTOM:\n\t\t\tvalueMask = __( 'Custom URL' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tvalueMask = __( 'None' );\n\t\t\tbreak;\n\t}\n\n\tconst linkSettingsOptions = {\n\t\turl: {\n\t\t\tvalueMask,\n\t\t\tautoFocus: false,\n\t\t\tautoFill: false,\n\t\t},\n\t\topenInNewTab: {\n\t\t\tlabel: __( 'Open in new tab' ),\n\t\t},\n\t\tlinkRel: {\n\t\t\tlabel: __( 'Link Rel' ),\n\t\t\tplaceholder: _x( 'None', 'Link rel attribute value placeholder' ),\n\t\t},\n\t};\n\n\treturn (\n\t\t<PanelBody title={ __( 'Link Settings' ) }>\n\t\t\t<LinkSettingsNavigation\n\t\t\t\tisVisible={ isLinkSheetVisible }\n\t\t\t\turl={ url }\n\t\t\t\trel={ rel }\n\t\t\t\tlabel={ label }\n\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\tsetAttributes={ setMappedAttributes }\n\t\t\t\twithBottomSheet={ false }\n\t\t\t\thasPicker\n\t\t\t\toptions={ linkSettingsOptions }\n\t\t\t\tshowIcon={ false }\n\t\t\t\tonLinkCellPressed={ ( { navigation } ) => {\n\t\t\t\t\tnavigation.navigate(\n\t\t\t\t\t\tblockSettingsScreens.imageLinkDestinations,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinputValue: attributes.href,\n\t\t\t\t\t\t\tlinkDestination: attributes.linkDestination,\n\t\t\t\t\t\t\timageUrl: attributes.url,\n\t\t\t\t\t\t\tattachmentPageUrl: image?.link,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport class ImageEdit extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.state = {\n\t\t\tisCaptionSelected: false,\n\t\t};\n\n\t\tthis.finishMediaUploadWithSuccess = this.finishMediaUploadWithSuccess.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.finishMediaUploadWithFailure = this.finishMediaUploadWithFailure.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.mediaUploadStateReset = this.mediaUploadStateReset.bind( this );\n\t\tthis.onSelectMediaUploadOption = this.onSelectMediaUploadOption.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.updateMediaProgress = this.updateMediaProgress.bind( this );\n\t\tthis.updateImageURL = this.updateImageURL.bind( this );\n\t\tthis.onSetNewTab = this.onSetNewTab.bind( this );\n\t\tthis.onSetSizeSlug = this.onSetSizeSlug.bind( this );\n\t\tthis.onImagePressed = this.onImagePressed.bind( this );\n\t\tthis.onSetFeatured = this.onSetFeatured.bind( this );\n\t\tthis.onFocusCaption = this.onFocusCaption.bind( this );\n\t\tthis.updateAlignment = this.updateAlignment.bind( this );\n\t\tthis.accessibilityLabelCreator = this.accessibilityLabelCreator.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.setMappedAttributes = this.setMappedAttributes.bind( this );\n\t\tthis.onSizeChangeValue = this.onSizeChangeValue.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { attributes, setAttributes } = this.props;\n\t\t// This will warn when we have `id` defined, while `url` is undefined.\n\t\t// This may help track this issue: https://github.com/wordpress-mobile/WordPress-Android/issues/9768\n\t\t// where a cancelled image upload was resulting in a subsequent crash.\n\t\tif ( attributes.id && ! attributes.url ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn( 'Attributes has id with no url.' );\n\t\t}\n\n\t\t// Detect any pasted image and start an upload\n\t\tif (\n\t\t\t! attributes.id &&\n\t\t\tattributes.url &&\n\t\t\tgetProtocol( attributes.url ) === 'file:'\n\t\t) {\n\t\t\trequestMediaImport( attributes.url, ( id, url ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\tsetAttributes( { id, url } );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Make sure we mark any temporary images as failed if they failed while\n\t\t// the editor wasn't open\n\t\tif (\n\t\t\tattributes.id &&\n\t\t\tattributes.url &&\n\t\t\tgetProtocol( attributes.url ) === 'file:'\n\t\t) {\n\t\t\tmediaUploadSync();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\t// this action will only exist if the user pressed the trash button on the block holder\n\t\tif (\n\t\t\thasAction( 'blocks.onRemoveBlockCheckUpload' ) &&\n\t\t\tthis.state.isUploadInProgress\n\t\t) {\n\t\t\tdoAction(\n\t\t\t\t'blocks.onRemoveBlockCheckUpload',\n\t\t\t\tthis.props.attributes.id\n\t\t\t);\n\t\t}\n\t}\n\n\tcomponentDidUpdate( previousProps ) {\n\t\tconst { image, attributes, setAttributes } = this.props;\n\t\tif ( ! previousProps.image && image ) {\n\t\t\tconst url =\n\t\t\t\tgetUrlForSlug( image, attributes?.sizeSlug ) ||\n\t\t\t\timage.source_url;\n\t\t\tsetAttributes( { url } );\n\t\t}\n\t}\n\n\tstatic getDerivedStateFromProps( props, state ) {\n\t\t// Avoid a UI flicker in the toolbar by insuring that isCaptionSelected\n\t\t// is updated immediately any time the isSelected prop becomes false\n\t\treturn {\n\t\t\tisCaptionSelected: props.isSelected && state.isCaptionSelected,\n\t\t};\n\t}\n\n\taccessibilityLabelCreator( caption ) {\n\t\t// Checks if caption is empty.\n\t\treturn ( typeof caption === 'string' && caption.trim().length === 0 ) ||\n\t\t\tcaption === undefined ||\n\t\t\tcaption === null\n\t\t\t? /* translators: accessibility text. Empty image caption. */\n\t\t\t 'Image caption. Empty'\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: image caption. */\n\t\t\t\t\t__( 'Image caption. %s' ),\n\t\t\t\t\tcaption\n\t\t\t );\n\t}\n\n\tonImagePressed() {\n\t\tconst { attributes, image } = this.props;\n\n\t\tif ( this.state.isUploadInProgress ) {\n\t\t\trequestImageUploadCancelDialog( attributes.id );\n\t\t} else if (\n\t\t\tattributes.id &&\n\t\t\tgetProtocol( attributes.url ) === 'file:'\n\t\t) {\n\t\t\trequestImageFailedRetryDialog( attributes.id );\n\t\t} else if ( ! this.state.isCaptionSelected ) {\n\t\t\trequestImageFullscreenPreview(\n\t\t\t\tattributes.url,\n\t\t\t\timage && image.source_url\n\t\t\t);\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tisCaptionSelected: false,\n\t\t} );\n\t}\n\n\tupdateMediaProgress( payload ) {\n\t\tconst { setAttributes } = this.props;\n\t\tif ( payload.mediaUrl ) {\n\t\t\tsetAttributes( { url: payload.mediaUrl } );\n\t\t}\n\n\t\tif ( ! this.state.isUploadInProgress ) {\n\t\t\tthis.setState( { isUploadInProgress: true } );\n\t\t}\n\t}\n\n\tfinishMediaUploadWithSuccess( payload ) {\n\t\tconst { setAttributes } = this.props;\n\n\t\tsetAttributes( { url: payload.mediaUrl, id: payload.mediaServerId } );\n\t\tthis.setState( { isUploadInProgress: false } );\n\t}\n\n\tfinishMediaUploadWithFailure( payload ) {\n\t\tconst { setAttributes } = this.props;\n\n\t\tsetAttributes( { id: payload.mediaId } );\n\t\tthis.setState( { isUploadInProgress: false } );\n\t}\n\n\tmediaUploadStateReset() {\n\t\tconst { setAttributes } = this.props;\n\n\t\tsetAttributes( { id: null, url: null } );\n\t\tthis.setState( { isUploadInProgress: false } );\n\t}\n\n\tupdateImageURL( url ) {\n\t\tthis.props.setAttributes( {\n\t\t\turl,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t} );\n\t}\n\n\tupdateAlignment( nextAlign ) {\n\t\tconst extraUpdatedAttributes = Object.values(\n\t\t\tWIDE_ALIGNMENTS.alignments\n\t\t).includes( nextAlign )\n\t\t\t? { width: undefined, height: undefined }\n\t\t\t: {};\n\t\tthis.props.setAttributes( {\n\t\t\t...extraUpdatedAttributes,\n\t\t\talign: nextAlign,\n\t\t} );\n\t}\n\n\tonSetNewTab( value ) {\n\t\tconst updatedLinkTarget = getUpdatedLinkTargetSettings(\n\t\t\tvalue,\n\t\t\tthis.props.attributes\n\t\t);\n\t\tthis.props.setAttributes( updatedLinkTarget );\n\t}\n\n\tonSetSizeSlug( sizeSlug ) {\n\t\tconst { image, setAttributes } = this.props;\n\n\t\tconst url = getUrlForSlug( image, sizeSlug );\n\t\tif ( ! url ) {\n\t\t\treturn null;\n\t\t}\n\t\tsetAttributes( {\n\t\t\turl,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tsizeSlug,\n\t\t} );\n\t}\n\n\tonSelectMediaUploadOption( media ) {\n\t\tconst { imageDefaultSize } = this.props;\n\t\tconst { id, url, destination } = this.props.attributes;\n\t\tconst mediaAttributes = {\n\t\t\tid: media.id,\n\t\t\turl: media.url,\n\t\t\tcaption: media.caption,\n\t\t};\n\n\t\tlet additionalAttributes;\n\t\t// Reset the dimension attributes if changing to a different image.\n\t\tif ( ! media.id || media.id !== id ) {\n\t\t\tadditionalAttributes = {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t\tsizeSlug: imageDefaultSize,\n\t\t\t};\n\t\t} else {\n\t\t\t// Keep the same url when selecting the same file, so \"Image Size\" option is not changed.\n\t\t\tadditionalAttributes = { url };\n\t\t}\n\n\t\tlet href;\n\t\tswitch ( destination ) {\n\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\thref = media.url;\n\t\t\t\tbreak;\n\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\thref = media.link;\n\t\t\t\tbreak;\n\t\t}\n\t\tmediaAttributes.href = href;\n\n\t\tthis.props.setAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\t...additionalAttributes,\n\t\t} );\n\t}\n\n\tonFocusCaption() {\n\t\tif ( this.props.onFocus ) {\n\t\t\tthis.props.onFocus();\n\t\t}\n\t\tif ( ! this.state.isCaptionSelected ) {\n\t\t\tthis.setState( {\n\t\t\t\tisCaptionSelected: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetPlaceholderIcon() {\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\ticon={ placeholderIcon }\n\t\t\t\t{ ...this.props.getStylesFromColorScheme(\n\t\t\t\t\tstyles.iconPlaceholder,\n\t\t\t\t\tstyles.iconPlaceholderDark\n\t\t\t\t) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tgetWidth() {\n\t\tconst { attributes } = this.props;\n\t\tconst { align, width } = attributes;\n\n\t\treturn Object.values( WIDE_ALIGNMENTS.alignments ).includes( align )\n\t\t\t? '100%'\n\t\t\t: width;\n\t}\n\n\tsetMappedAttributes( { url: href, linkDestination, ...restAttributes } ) {\n\t\tconst { setAttributes } = this.props;\n\t\tif ( ! href && ! linkDestination ) {\n\t\t\tlinkDestination = LINK_DESTINATION_NONE;\n\t\t} else if ( ! linkDestination ) {\n\t\t\tlinkDestination = LINK_DESTINATION_CUSTOM;\n\t\t}\n\n\t\treturn href === undefined || href === this.props.attributes.href\n\t\t\t? setAttributes( restAttributes )\n\t\t\t: setAttributes( {\n\t\t\t\t\t...restAttributes,\n\t\t\t\t\tlinkDestination,\n\t\t\t\t\thref,\n\t\t\t } );\n\t}\n\n\tgetAltTextSettings() {\n\t\tconst {\n\t\t\tattributes: { alt },\n\t\t} = this.props;\n\n\t\tconst updateAlt = ( newAlt ) => {\n\t\t\tthis.props.setAttributes( { alt: newAlt } );\n\t\t};\n\n\t\treturn (\n\t\t\t<BottomSheetTextControl\n\t\t\t\tinitialValue={ alt }\n\t\t\t\tonChange={ updateAlt }\n\t\t\t\tplaceholder={ __( 'Add alt text' ) }\n\t\t\t\tlabel={ __( 'Alt Text' ) }\n\t\t\t\ticon={ textColor }\n\t\t\t\tfooterNote={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Describe the purpose of the image. Leave empty if the image is purely decorative.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<FooterMessageLink\n\t\t\t\t\t\t\thref={\n\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}\n\t\t\t\t\t\t\tvalue={ __( 'What is alt text?' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\tonSizeChangeValue( newValue ) {\n\t\tthis.onSetSizeSlug( newValue );\n\t}\n\n\tonSetFeatured( mediaId ) {\n\t\tconst { closeSettingsBottomSheet } = this.props;\n\t\tsetFeaturedImage( mediaId );\n\t\tcloseSettingsBottomSheet();\n\t}\n\n\tgetFeaturedButtonPanel( isFeaturedImage ) {\n\t\tconst { attributes, getStylesFromColorScheme } = this.props;\n\n\t\tconst setFeaturedButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.setFeaturedButton,\n\t\t\tstyles.setFeaturedButtonDark\n\t\t);\n\n\t\tconst removeFeaturedButton = () => (\n\t\t\t<BottomSheet.Cell\n\t\t\t\tlabel={ __( 'Remove as Featured Image' ) }\n\t\t\t\tlabelStyle={ [\n\t\t\t\t\tsetFeaturedButtonStyle,\n\t\t\t\t\tstyles.removeFeaturedButton,\n\t\t\t\t] }\n\t\t\t\tcellContainerStyle={ styles.setFeaturedButtonCellContainer }\n\t\t\t\tseparatorType={ 'none' }\n\t\t\t\tonPress={ () =>\n\t\t\t\t\tthis.onSetFeatured( MEDIA_ID_NO_FEATURED_IMAGE_SET )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\n\t\tconst setFeaturedButton = () => (\n\t\t\t<BottomSheet.Cell\n\t\t\t\tlabel={ __( 'Set as Featured Image' ) }\n\t\t\t\tlabelStyle={ setFeaturedButtonStyle }\n\t\t\t\tcellContainerStyle={ styles.setFeaturedButtonCellContainer }\n\t\t\t\tseparatorType={ 'none' }\n\t\t\t\tonPress={ () => this.onSetFeatured( attributes.id ) }\n\t\t\t/>\n\t\t);\n\n\t\treturn isFeaturedImage ? removeFeaturedButton() : setFeaturedButton();\n\t}\n\n\trender() {\n\t\tconst { isCaptionSelected } = this.state;\n\t\tconst {\n\t\t\tattributes,\n\t\t\tisSelected,\n\t\t\timage,\n\t\t\tclientId,\n\t\t\timageDefaultSize,\n\t\t\tcontext,\n\t\t\tfeaturedImageId,\n\t\t\twasBlockJustInserted,\n\t\t} = this.props;\n\t\tconst { align, url, alt, id, sizeSlug, className } = attributes;\n\t\tconst hasImageContext = context\n\t\t\t? Object.keys( context ).length > 0\n\t\t\t: false;\n\n\t\tconst imageSizes = Array.isArray( this.props.imageSizes )\n\t\t\t? this.props.imageSizes\n\t\t\t: [];\n\t\t// Only map available image sizes for the user to choose.\n\t\tconst sizeOptions = imageSizes\n\t\t\t.filter( ( { slug } ) => getUrlForSlug( image, slug ) )\n\t\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\t\tlet selectedSizeOption = sizeSlug || imageDefaultSize;\n\t\tlet sizeOptionsValid = sizeOptions.find(\n\t\t\t( option ) => option.value === selectedSizeOption\n\t\t);\n\n\t\tif ( ! sizeOptionsValid ) {\n\t\t\t// Default to 'full' size if the default large size is not available.\n\t\t\tsizeOptionsValid = sizeOptions.find(\n\t\t\t\t( option ) => option.value === 'full'\n\t\t\t);\n\t\t\tselectedSizeOption = 'full';\n\t\t}\n\n\t\t// By default, it's only possible to set images that have been uploaded to a site's library as featured.\n\t\t// The 'canImageBeFeatured' check filters out images that haven't been uploaded based on the following:\n\t\t// - Images that are embedded in a post but are uploaded elsewhere have an id of 'undefined'.\n\t\t// - Image that are uploading or have failed to upload are given a temporary negative ID.\n\t\tconst canImageBeFeatured =\n\t\t\ttypeof attributes.id !== 'undefined' && attributes.id > 0;\n\n\t\tconst isFeaturedImage =\n\t\t\tcanImageBeFeatured && featuredImageId === attributes.id;\n\n\t\tconst getToolbarEditButton = ( open ) => (\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Edit image' ) }\n\t\t\t\t\t\ticon={ replace }\n\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ this.updateAlignment }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\n\t\tconst getInspectorControls = () => (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Image settings' ) } />\n\t\t\t\t<PanelBody style={ styles.panelBody }>\n\t\t\t\t\t<BlockStyles clientId={ clientId } url={ url } />\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t{ image && sizeOptionsValid && (\n\t\t\t\t\t\t<BottomSheetSelectControl\n\t\t\t\t\t\t\ticon={ fullscreen }\n\t\t\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\t\t\toptions={ sizeOptions }\n\t\t\t\t\t\t\tonChange={ this.onSizeChangeValue }\n\t\t\t\t\t\t\tvalue={ selectedSizeOption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ this.getAltTextSettings() }\n\t\t\t\t</PanelBody>\n\t\t\t\t<LinkSettings\n\t\t\t\t\tattributes={ this.props.attributes }\n\t\t\t\t\timage={ this.props.image }\n\t\t\t\t\tisLinkSheetVisible={ this.state.isLinkSheetVisible }\n\t\t\t\t\tsetMappedAttributes={ this.setMappedAttributes }\n\t\t\t\t/>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Featured Image' ) }\n\t\t\t\t\ttitleStyle={ styles.featuredImagePanelTitle }\n\t\t\t\t>\n\t\t\t\t\t{ canImageBeFeatured &&\n\t\t\t\t\t\tthis.getFeaturedButtonPanel( isFeaturedImage ) }\n\t\t\t\t\t<FooterMessageControl\n\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t'Changes to featured image will not be affected by the undo/redo buttons.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tcellContainerStyle={\n\t\t\t\t\t\t\tstyles.setFeaturedButtonCellContainer\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\n\t\tif ( ! url ) {\n\t\t\treturn (\n\t\t\t\t<View style={ styles.content }>\n\t\t\t\t\t<MediaPlaceholder\n\t\t\t\t\t\tallowedTypes={ [ MEDIA_TYPE_IMAGE ] }\n\t\t\t\t\t\tonSelect={ this.onSelectMediaUploadOption }\n\t\t\t\t\t\ticon={ this.getPlaceholderIcon() }\n\t\t\t\t\t\tonFocus={ this.props.onFocus }\n\t\t\t\t\t\tautoOpenMediaUpload={\n\t\t\t\t\t\t\tisSelected && wasBlockJustInserted\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\tconst alignToFlex = {\n\t\t\tleft: 'flex-start',\n\t\t\tcenter: 'center',\n\t\t\tright: 'flex-end',\n\t\t\tfull: 'center',\n\t\t\twide: 'center',\n\t\t};\n\n\t\tconst additionalImageProps = {\n\t\t\theight: '100%',\n\t\t\tresizeMode: context?.imageCrop ? 'cover' : 'contain',\n\t\t};\n\n\t\tconst imageContainerStyles = [\n\t\t\tcontext?.fixedHeight && styles.fixedHeight,\n\t\t];\n\n\t\tconst getImageComponent = ( openMediaOptions, getMediaOptions ) => (\n\t\t\t<Badge label={ __( 'Featured' ) } show={ isFeaturedImage }>\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\taccessible={ ! isSelected }\n\t\t\t\t\tonPress={ this.onImagePressed }\n\t\t\t\t\tonLongPress={ openMediaOptions }\n\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles.content }>\n\t\t\t\t\t\t{ isSelected && getInspectorControls() }\n\t\t\t\t\t\t{ isSelected && getMediaOptions() }\n\t\t\t\t\t\t{ ! this.state.isCaptionSelected &&\n\t\t\t\t\t\t\tgetToolbarEditButton( openMediaOptions ) }\n\t\t\t\t\t\t<MediaUploadProgress\n\t\t\t\t\t\t\tcoverUrl={ url }\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tonUpdateMediaProgress={ this.updateMediaProgress }\n\t\t\t\t\t\t\tonFinishMediaUploadWithSuccess={\n\t\t\t\t\t\t\t\tthis.finishMediaUploadWithSuccess\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFinishMediaUploadWithFailure={\n\t\t\t\t\t\t\t\tthis.finishMediaUploadWithFailure\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMediaUploadStateReset={\n\t\t\t\t\t\t\t\tthis.mediaUploadStateReset\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trenderContent={ ( {\n\t\t\t\t\t\t\t\tisUploadInProgress,\n\t\t\t\t\t\t\t\tisUploadFailed,\n\t\t\t\t\t\t\t\tretryMessage,\n\t\t\t\t\t\t\t} ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<View style={ imageContainerStyles }>\n\t\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\t\talign={\n\t\t\t\t\t\t\t\t\t\t\t\talign && alignToFlex[ align ]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t\t\t\t\tisSelected={\n\t\t\t\t\t\t\t\t\t\t\t\tisSelected &&\n\t\t\t\t\t\t\t\t\t\t\t\t! isCaptionSelected\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tisUploadFailed={ isUploadFailed }\n\t\t\t\t\t\t\t\t\t\t\tisUploadInProgress={\n\t\t\t\t\t\t\t\t\t\t\t\tisUploadInProgress\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonSelectMediaUploadOption={\n\t\t\t\t\t\t\t\t\t\t\t\tthis.onSelectMediaUploadOption\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\topenMediaOptions={\n\t\t\t\t\t\t\t\t\t\t\t\topenMediaOptions\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tretryMessage={ retryMessage }\n\t\t\t\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\t\t\t\tshapeStyle={\n\t\t\t\t\t\t\t\t\t\t\t\tstyles[ className ] || className\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\twidth={ this.getWidth() }\n\t\t\t\t\t\t\t\t\t\t\t{ ...( hasImageContext\n\t\t\t\t\t\t\t\t\t\t\t\t? additionalImageProps\n\t\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</View>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t<BlockCaption\n\t\t\t\t\tclientId={ this.props.clientId }\n\t\t\t\t\tisSelected={ this.state.isCaptionSelected }\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityLabelCreator={ this.accessibilityLabelCreator }\n\t\t\t\t\tonFocus={ this.onFocusCaption }\n\t\t\t\t\tonBlur={ this.props.onBlur } // always assign onBlur as props\n\t\t\t\t\tinsertBlocksAfter={ this.props.insertBlocksAfter }\n\t\t\t\t/>\n\t\t\t</Badge>\n\t\t);\n\n\t\treturn (\n\t\t\t<MediaUpload\n\t\t\t\tallowedTypes={ [ MEDIA_TYPE_IMAGE ] }\n\t\t\t\tisReplacingMedia={ true }\n\t\t\t\tonSelect={ this.onSelectMediaUploadOption }\n\t\t\t\trender={ ( { open, getMediaOptions } ) => {\n\t\t\t\t\treturn getImageComponent( open, getMediaOptions );\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, props ) => {\n\t\tconst { getMedia } = select( coreStore );\n\t\tconst { getSettings, wasBlockJustInserted } = select(\n\t\t\tblockEditorStore\n\t\t);\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\t\tconst {\n\t\t\tattributes: { id, url },\n\t\t\tisSelected,\n\t\t\tclientId,\n\t\t} = props;\n\t\tconst { imageSizes, imageDefaultSize } = getSettings();\n\t\tconst isNotFileUrl = id && getProtocol( url ) !== 'file:';\n\t\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\t\tconst shouldGetMedia =\n\t\t\t( isSelected && isNotFileUrl ) ||\n\t\t\t// Edge case to update the image after uploading if the block gets unselected\n\t\t\t// Check if it's the original image and not the resized one with queryparams\n\t\t\t( ! isSelected &&\n\t\t\t\tisNotFileUrl &&\n\t\t\t\turl &&\n\t\t\t\t! hasQueryArg( url, 'w' ) );\n\n\t\treturn {\n\t\t\timage: shouldGetMedia ? getMedia( id ) : null,\n\t\t\timageSizes,\n\t\t\timageDefaultSize,\n\t\t\tfeaturedImageId,\n\t\t\twasBlockJustInserted: wasBlockJustInserted(\n\t\t\t\tclientId,\n\t\t\t\t'inserter_menu'\n\t\t\t),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\treturn {\n\t\t\tcloseSettingsBottomSheet() {\n\t\t\t\tdispatch( editPostStore ).closeGeneralSidebar();\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( ImageEdit );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/image/edit.native.js"],"names":["getUrlForSlug","image","sizeSlug","undefined","media_details","sizes","source_url","LinkSettings","attributes","isLinkSheetVisible","setMappedAttributes","route","href","url","label","linkDestination","linkTarget","rel","inputValue","newUrl","params","newLinkDestination","LINK_DESTINATION_MEDIA","link","LINK_DESTINATION_ATTACHMENT","LINK_DESTINATION_NONE","LINK_DESTINATION_CUSTOM","valueMask","linkSettingsOptions","autoFocus","autoFill","openInNewTab","linkRel","placeholder","navigation","navigate","blockSettingsScreens","imageLinkDestinations","imageUrl","attachmentPageUrl","UPLOAD_STATE_IDLE","UPLOAD_STATE_UPLOADING","UPLOAD_STATE_SUCCEEDED","UPLOAD_STATE_FAILED","ImageEdit","Component","constructor","props","state","isCaptionSelected","uploadStatus","replacedFeaturedImage","finishMediaUploadWithSuccess","bind","finishMediaUploadWithFailure","mediaUploadStateReset","onSelectMediaUploadOption","updateMediaProgress","updateImageURL","onSetNewTab","onSetSizeSlug","onImagePressed","onSetFeatured","onFocusCaption","updateAlignment","accessibilityLabelCreator","onSizeChangeValue","componentDidMount","setAttributes","id","console","warn","componentWillUnmount","componentDidUpdate","previousProps","featuredImageId","previousId","canImageBeFeatured","getDerivedStateFromProps","isSelected","caption","trim","length","setState","payload","mediaUrl","mediaServerId","mediaId","width","height","nextAlign","extraUpdatedAttributes","Object","values","WIDE_ALIGNMENTS","alignments","includes","align","value","updatedLinkTarget","media","imageDefaultSize","destination","mediaAttributes","additionalAttributes","onFocus","getPlaceholderIcon","placeholderIcon","getStylesFromColorScheme","styles","iconPlaceholder","iconPlaceholderDark","getWidth","restAttributes","getAltTextSettings","alt","updateAlt","newAlt","textColor","newValue","closeSettingsBottomSheet","getFeaturedButtonPanel","isFeaturedImage","setFeaturedButtonStyle","setFeaturedButton","setFeaturedButtonDark","removeFeaturedButton","setFeaturedButtonCellContainer","MEDIA_ID_NO_FEATURED_IMAGE_SET","render","clientId","context","wasBlockJustInserted","className","hasImageContext","keys","imageSizes","Array","isArray","sizeOptions","filter","slug","map","name","selectedSizeOption","sizeOptionsValid","find","option","getToolbarEditButton","open","replace","getInspectorControls","panelBody","fullscreen","featuredImagePanelTitle","content","MEDIA_TYPE_IMAGE","alignToFlex","left","center","right","full","wide","additionalImageProps","resizeMode","imageCrop","imageContainerStyles","fixedHeight","getImageComponent","openMediaOptions","getMediaOptions","isUploadInProgress","isUploadFailed","retryMessage","onBlur","insertBlocksAfter","select","getMedia","coreStore","getSettings","blockEditorStore","getEditedPostAttribute","isNotFileUrl","shouldGetMedia","dispatch","editPostStore","closeGeneralSidebar","withPreferredColorScheme"],"mappings":";;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AAQA;;AAeA;;AAaA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;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AAA,oBAAoB,EAAEA,oBAAoB,CACzCF,QADyC,EAEzC,eAFyC;AALpC,GAAP;AAUA,CAlCD,CADuB,EAoCvB,wBAAgBsD,QAAF,IAAgB;AAC7B,SAAO;AACNhE,IAAAA,wBAAwB,GAAG;AAC1BgE,MAAAA,QAAQ,CAAEC,eAAF,CAAR,CAA0BC,mBAA1B;AACA;;AAHK,GAAP;AAKA,CAND,CApCuB,EA2CvBC,iCA3CuB,CAAT,EA4CV/I,SA5CU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View, TouchableWithoutFeedback } from 'react-native';\nimport { useRoute } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { Component, useEffect } from '@wordpress/element';\nimport {\n\trequestMediaImport,\n\tmediaUploadSync,\n\trequestImageFailedRetryDialog,\n\trequestImageUploadCancelDialog,\n\trequestImageFullscreenPreview,\n\tsetFeaturedImage,\n} from '@wordpress/react-native-bridge';\nimport {\n\tIcon,\n\tPanelBody,\n\tToolbarButton,\n\tToolbarGroup,\n\tImage,\n\tWIDE_ALIGNMENTS,\n\tLinkSettingsNavigation,\n\tBottomSheet,\n\tBottomSheetTextControl,\n\tBottomSheetSelectControl,\n\tFooterMessageControl,\n\tFooterMessageLink,\n\tBadge,\n} from '@wordpress/components';\nimport {\n\tBlockCaption,\n\tMediaPlaceholder,\n\tMediaUpload,\n\tMediaUploadProgress,\n\tMEDIA_TYPE_IMAGE,\n\tBlockControls,\n\tInspectorControls,\n\tBlockAlignmentToolbar,\n\tBlockStyles,\n\tstore as blockEditorStore,\n\tblockSettingsScreens,\n} from '@wordpress/block-editor';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getProtocol, hasQueryArg } from '@wordpress/url';\nimport { doAction, hasAction } from '@wordpress/hooks';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport {\n\timage as placeholderIcon,\n\treplace,\n\tfullscreen,\n\ttextColor,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editPostStore } from '@wordpress/edit-post';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { getUpdatedLinkTargetSettings } from './utils';\n\nimport {\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_CUSTOM,\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tMEDIA_ID_NO_FEATURED_IMAGE_SET,\n} from './constants';\n\nconst getUrlForSlug = ( image, sizeSlug ) => {\n\tif ( ! sizeSlug ) {\n\t\treturn undefined;\n\t}\n\treturn image?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n};\n\nfunction LinkSettings( {\n\tattributes,\n\timage,\n\tisLinkSheetVisible,\n\tsetMappedAttributes,\n} ) {\n\tconst route = useRoute();\n\tconst { href: url, label, linkDestination, linkTarget, rel } = attributes;\n\n\t// Persist attributes passed from child screen\n\tuseEffect( () => {\n\t\tconst { inputValue: newUrl } = route.params || {};\n\n\t\tlet newLinkDestination;\n\t\tswitch ( newUrl ) {\n\t\t\tcase attributes.url:\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_MEDIA;\n\t\t\t\tbreak;\n\t\t\tcase image?.link:\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_ATTACHMENT;\n\t\t\t\tbreak;\n\t\t\tcase '':\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_NONE;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnewLinkDestination = LINK_DESTINATION_CUSTOM;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tsetMappedAttributes( {\n\t\t\turl: newUrl,\n\t\t\tlinkDestination: newLinkDestination,\n\t\t} );\n\t}, [ route.params?.inputValue ] );\n\n\tlet valueMask;\n\tswitch ( linkDestination ) {\n\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\tvalueMask = __( 'Media File' );\n\t\t\tbreak;\n\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\tvalueMask = __( 'Attachment Page' );\n\t\t\tbreak;\n\t\tcase LINK_DESTINATION_CUSTOM:\n\t\t\tvalueMask = __( 'Custom URL' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tvalueMask = __( 'None' );\n\t\t\tbreak;\n\t}\n\n\tconst linkSettingsOptions = {\n\t\turl: {\n\t\t\tvalueMask,\n\t\t\tautoFocus: false,\n\t\t\tautoFill: false,\n\t\t},\n\t\topenInNewTab: {\n\t\t\tlabel: __( 'Open in new tab' ),\n\t\t},\n\t\tlinkRel: {\n\t\t\tlabel: __( 'Link Rel' ),\n\t\t\tplaceholder: _x( 'None', 'Link rel attribute value placeholder' ),\n\t\t},\n\t};\n\n\treturn (\n\t\t<PanelBody title={ __( 'Link Settings' ) }>\n\t\t\t<LinkSettingsNavigation\n\t\t\t\tisVisible={ isLinkSheetVisible }\n\t\t\t\turl={ url }\n\t\t\t\trel={ rel }\n\t\t\t\tlabel={ label }\n\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\tsetAttributes={ setMappedAttributes }\n\t\t\t\twithBottomSheet={ false }\n\t\t\t\thasPicker\n\t\t\t\toptions={ linkSettingsOptions }\n\t\t\t\tshowIcon={ false }\n\t\t\t\tonLinkCellPressed={ ( { navigation } ) => {\n\t\t\t\t\tnavigation.navigate(\n\t\t\t\t\t\tblockSettingsScreens.imageLinkDestinations,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinputValue: attributes.href,\n\t\t\t\t\t\t\tlinkDestination: attributes.linkDestination,\n\t\t\t\t\t\t\timageUrl: attributes.url,\n\t\t\t\t\t\t\tattachmentPageUrl: image?.link,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nconst UPLOAD_STATE_IDLE = 0;\nconst UPLOAD_STATE_UPLOADING = 1;\nconst UPLOAD_STATE_SUCCEEDED = 2;\nconst UPLOAD_STATE_FAILED = 3;\n\nexport class ImageEdit extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.state = {\n\t\t\tisCaptionSelected: false,\n\t\t\tuploadStatus: UPLOAD_STATE_IDLE,\n\t\t};\n\n\t\tthis.replacedFeaturedImage = false;\n\n\t\tthis.finishMediaUploadWithSuccess = this.finishMediaUploadWithSuccess.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.finishMediaUploadWithFailure = this.finishMediaUploadWithFailure.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.mediaUploadStateReset = this.mediaUploadStateReset.bind( this );\n\t\tthis.onSelectMediaUploadOption = this.onSelectMediaUploadOption.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.updateMediaProgress = this.updateMediaProgress.bind( this );\n\t\tthis.updateImageURL = this.updateImageURL.bind( this );\n\t\tthis.onSetNewTab = this.onSetNewTab.bind( this );\n\t\tthis.onSetSizeSlug = this.onSetSizeSlug.bind( this );\n\t\tthis.onImagePressed = this.onImagePressed.bind( this );\n\t\tthis.onSetFeatured = this.onSetFeatured.bind( this );\n\t\tthis.onFocusCaption = this.onFocusCaption.bind( this );\n\t\tthis.updateAlignment = this.updateAlignment.bind( this );\n\t\tthis.accessibilityLabelCreator = this.accessibilityLabelCreator.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.setMappedAttributes = this.setMappedAttributes.bind( this );\n\t\tthis.onSizeChangeValue = this.onSizeChangeValue.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { attributes, setAttributes } = this.props;\n\t\t// This will warn when we have `id` defined, while `url` is undefined.\n\t\t// This may help track this issue: https://github.com/wordpress-mobile/WordPress-Android/issues/9768\n\t\t// where a cancelled image upload was resulting in a subsequent crash.\n\t\tif ( attributes.id && ! attributes.url ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn( 'Attributes has id with no url.' );\n\t\t}\n\n\t\t// Detect any pasted image and start an upload\n\t\tif (\n\t\t\t! attributes.id &&\n\t\t\tattributes.url &&\n\t\t\tgetProtocol( attributes.url ) === 'file:'\n\t\t) {\n\t\t\trequestMediaImport( attributes.url, ( id, url ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\tsetAttributes( { id, url } );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Make sure we mark any temporary images as failed if they failed while\n\t\t// the editor wasn't open\n\t\tif (\n\t\t\tattributes.id &&\n\t\t\tattributes.url &&\n\t\t\tgetProtocol( attributes.url ) === 'file:'\n\t\t) {\n\t\t\tmediaUploadSync();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\t// this action will only exist if the user pressed the trash button on the block holder\n\t\tif (\n\t\t\thasAction( 'blocks.onRemoveBlockCheckUpload' ) &&\n\t\t\tthis.state.uploadStatus === UPLOAD_STATE_UPLOADING\n\t\t) {\n\t\t\tdoAction(\n\t\t\t\t'blocks.onRemoveBlockCheckUpload',\n\t\t\t\tthis.props.attributes.id\n\t\t\t);\n\t\t}\n\t}\n\n\tcomponentDidUpdate( previousProps ) {\n\t\tconst {\n\t\t\timage,\n\t\t\tattributes,\n\t\t\tsetAttributes,\n\t\t\tfeaturedImageId,\n\t\t} = this.props;\n\t\tif ( ! previousProps.image && image ) {\n\t\t\tconst url =\n\t\t\t\tgetUrlForSlug( image, attributes?.sizeSlug ) ||\n\t\t\t\timage.source_url;\n\t\t\tsetAttributes( { url } );\n\t\t}\n\n\t\tconst { id } = attributes;\n\t\tconst { id: previousId } = previousProps.attributes;\n\n\t\t// The media changed and the previous media was set as the Featured Image,\n\t\t// we must keep track of the previous media's featured status to act on it\n\t\t// once the new media has a finalized ID.\n\t\tif (\n\t\t\t!! id &&\n\t\t\tid !== previousId &&\n\t\t\t!! featuredImageId &&\n\t\t\tfeaturedImageId === previousId\n\t\t) {\n\t\t\tthis.replacedFeaturedImage = true;\n\t\t}\n\n\t\t// The media changed and now has a finalized ID (e.g. upload completed), we\n\t\t// should attempt to replace the featured image if applicable.\n\t\tif (\n\t\t\tthis.replacedFeaturedImage &&\n\t\t\t!! image &&\n\t\t\tthis.canImageBeFeatured()\n\t\t) {\n\t\t\tthis.replacedFeaturedImage = false;\n\t\t\tsetFeaturedImage( id );\n\t\t}\n\t}\n\n\tstatic getDerivedStateFromProps( props, state ) {\n\t\t// Avoid a UI flicker in the toolbar by insuring that isCaptionSelected\n\t\t// is updated immediately any time the isSelected prop becomes false\n\t\treturn {\n\t\t\tisCaptionSelected: props.isSelected && state.isCaptionSelected,\n\t\t};\n\t}\n\n\taccessibilityLabelCreator( caption ) {\n\t\t// Checks if caption is empty.\n\t\treturn ( typeof caption === 'string' && caption.trim().length === 0 ) ||\n\t\t\tcaption === undefined ||\n\t\t\tcaption === null\n\t\t\t? /* translators: accessibility text. Empty image caption. */\n\t\t\t 'Image caption. Empty'\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: image caption. */\n\t\t\t\t\t__( 'Image caption. %s' ),\n\t\t\t\t\tcaption\n\t\t\t );\n\t}\n\n\tonImagePressed() {\n\t\tconst { attributes, image } = this.props;\n\n\t\tif ( this.state.uploadStatus === UPLOAD_STATE_UPLOADING ) {\n\t\t\trequestImageUploadCancelDialog( attributes.id );\n\t\t} else if (\n\t\t\tattributes.id &&\n\t\t\tgetProtocol( attributes.url ) === 'file:'\n\t\t) {\n\t\t\trequestImageFailedRetryDialog( attributes.id );\n\t\t} else if ( ! this.state.isCaptionSelected ) {\n\t\t\trequestImageFullscreenPreview(\n\t\t\t\tattributes.url,\n\t\t\t\timage && image.source_url\n\t\t\t);\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tisCaptionSelected: false,\n\t\t} );\n\t}\n\n\tupdateMediaProgress( payload ) {\n\t\tconst { setAttributes } = this.props;\n\t\tif ( payload.mediaUrl ) {\n\t\t\tsetAttributes( { url: payload.mediaUrl } );\n\t\t}\n\n\t\tif ( this.state.uploadStatus !== UPLOAD_STATE_UPLOADING ) {\n\t\t\tthis.setState( { uploadStatus: UPLOAD_STATE_UPLOADING } );\n\t\t}\n\t}\n\n\tfinishMediaUploadWithSuccess( payload ) {\n\t\tconst { setAttributes } = this.props;\n\n\t\tsetAttributes( { url: payload.mediaUrl, id: payload.mediaServerId } );\n\t\tthis.setState( { uploadStatus: UPLOAD_STATE_SUCCEEDED } );\n\t}\n\n\tfinishMediaUploadWithFailure( payload ) {\n\t\tconst { setAttributes } = this.props;\n\n\t\tsetAttributes( { id: payload.mediaId } );\n\t\tthis.setState( { uploadStatus: UPLOAD_STATE_FAILED } );\n\t}\n\n\tmediaUploadStateReset() {\n\t\tconst { setAttributes } = this.props;\n\n\t\tsetAttributes( { id: null, url: null } );\n\t\tthis.setState( { uploadStatus: UPLOAD_STATE_IDLE } );\n\t}\n\n\tupdateImageURL( url ) {\n\t\tthis.props.setAttributes( {\n\t\t\turl,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t} );\n\t}\n\n\tupdateAlignment( nextAlign ) {\n\t\tconst extraUpdatedAttributes = Object.values(\n\t\t\tWIDE_ALIGNMENTS.alignments\n\t\t).includes( nextAlign )\n\t\t\t? { width: undefined, height: undefined }\n\t\t\t: {};\n\t\tthis.props.setAttributes( {\n\t\t\t...extraUpdatedAttributes,\n\t\t\talign: nextAlign,\n\t\t} );\n\t}\n\n\tonSetNewTab( value ) {\n\t\tconst updatedLinkTarget = getUpdatedLinkTargetSettings(\n\t\t\tvalue,\n\t\t\tthis.props.attributes\n\t\t);\n\t\tthis.props.setAttributes( updatedLinkTarget );\n\t}\n\n\tonSetSizeSlug( sizeSlug ) {\n\t\tconst { image, setAttributes } = this.props;\n\n\t\tconst url = getUrlForSlug( image, sizeSlug );\n\t\tif ( ! url ) {\n\t\t\treturn null;\n\t\t}\n\t\tsetAttributes( {\n\t\t\turl,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tsizeSlug,\n\t\t} );\n\t}\n\n\tonSelectMediaUploadOption( media ) {\n\t\tconst { imageDefaultSize } = this.props;\n\t\tconst { id, url, destination } = this.props.attributes;\n\t\tconst mediaAttributes = {\n\t\t\tid: media.id,\n\t\t\turl: media.url,\n\t\t\tcaption: media.caption,\n\t\t};\n\n\t\tlet additionalAttributes;\n\t\t// Reset the dimension attributes if changing to a different image.\n\t\tif ( ! media.id || media.id !== id ) {\n\t\t\tadditionalAttributes = {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t\tsizeSlug: imageDefaultSize,\n\t\t\t};\n\t\t} else {\n\t\t\t// Keep the same url when selecting the same file, so \"Image Size\" option is not changed.\n\t\t\tadditionalAttributes = { url };\n\t\t}\n\n\t\tlet href;\n\t\tswitch ( destination ) {\n\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\thref = media.url;\n\t\t\t\tbreak;\n\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\thref = media.link;\n\t\t\t\tbreak;\n\t\t}\n\t\tmediaAttributes.href = href;\n\n\t\tthis.props.setAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\t...additionalAttributes,\n\t\t} );\n\t}\n\n\tonFocusCaption() {\n\t\tif ( this.props.onFocus ) {\n\t\t\tthis.props.onFocus();\n\t\t}\n\t\tif ( ! this.state.isCaptionSelected ) {\n\t\t\tthis.setState( {\n\t\t\t\tisCaptionSelected: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetPlaceholderIcon() {\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\ticon={ placeholderIcon }\n\t\t\t\t{ ...this.props.getStylesFromColorScheme(\n\t\t\t\t\tstyles.iconPlaceholder,\n\t\t\t\t\tstyles.iconPlaceholderDark\n\t\t\t\t) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tgetWidth() {\n\t\tconst { attributes } = this.props;\n\t\tconst { align, width } = attributes;\n\n\t\treturn Object.values( WIDE_ALIGNMENTS.alignments ).includes( align )\n\t\t\t? '100%'\n\t\t\t: width;\n\t}\n\n\tsetMappedAttributes( { url: href, linkDestination, ...restAttributes } ) {\n\t\tconst { setAttributes } = this.props;\n\t\tif ( ! href && ! linkDestination ) {\n\t\t\tlinkDestination = LINK_DESTINATION_NONE;\n\t\t} else if ( ! linkDestination ) {\n\t\t\tlinkDestination = LINK_DESTINATION_CUSTOM;\n\t\t}\n\n\t\treturn href === undefined || href === this.props.attributes.href\n\t\t\t? setAttributes( restAttributes )\n\t\t\t: setAttributes( {\n\t\t\t\t\t...restAttributes,\n\t\t\t\t\tlinkDestination,\n\t\t\t\t\thref,\n\t\t\t } );\n\t}\n\n\tgetAltTextSettings() {\n\t\tconst {\n\t\t\tattributes: { alt },\n\t\t} = this.props;\n\n\t\tconst updateAlt = ( newAlt ) => {\n\t\t\tthis.props.setAttributes( { alt: newAlt } );\n\t\t};\n\n\t\treturn (\n\t\t\t<BottomSheetTextControl\n\t\t\t\tinitialValue={ alt }\n\t\t\t\tonChange={ updateAlt }\n\t\t\t\tplaceholder={ __( 'Add alt text' ) }\n\t\t\t\tlabel={ __( 'Alt Text' ) }\n\t\t\t\ticon={ textColor }\n\t\t\t\tfooterNote={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Describe the purpose of the image. Leave empty if the image is purely decorative.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<FooterMessageLink\n\t\t\t\t\t\t\thref={\n\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}\n\t\t\t\t\t\t\tvalue={ __( 'What is alt text?' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\tonSizeChangeValue( newValue ) {\n\t\tthis.onSetSizeSlug( newValue );\n\t}\n\n\tonSetFeatured( mediaId ) {\n\t\tconst { closeSettingsBottomSheet } = this.props;\n\t\tsetFeaturedImage( mediaId );\n\t\tcloseSettingsBottomSheet();\n\t}\n\n\tgetFeaturedButtonPanel( isFeaturedImage ) {\n\t\tconst { attributes, getStylesFromColorScheme } = this.props;\n\n\t\tconst setFeaturedButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.setFeaturedButton,\n\t\t\tstyles.setFeaturedButtonDark\n\t\t);\n\n\t\tconst removeFeaturedButton = () => (\n\t\t\t<BottomSheet.Cell\n\t\t\t\tlabel={ __( 'Remove as Featured Image' ) }\n\t\t\t\tlabelStyle={ [\n\t\t\t\t\tsetFeaturedButtonStyle,\n\t\t\t\t\tstyles.removeFeaturedButton,\n\t\t\t\t] }\n\t\t\t\tcellContainerStyle={ styles.setFeaturedButtonCellContainer }\n\t\t\t\tseparatorType={ 'none' }\n\t\t\t\tonPress={ () =>\n\t\t\t\t\tthis.onSetFeatured( MEDIA_ID_NO_FEATURED_IMAGE_SET )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\n\t\tconst setFeaturedButton = () => (\n\t\t\t<BottomSheet.Cell\n\t\t\t\tlabel={ __( 'Set as Featured Image' ) }\n\t\t\t\tlabelStyle={ setFeaturedButtonStyle }\n\t\t\t\tcellContainerStyle={ styles.setFeaturedButtonCellContainer }\n\t\t\t\tseparatorType={ 'none' }\n\t\t\t\tonPress={ () => this.onSetFeatured( attributes.id ) }\n\t\t\t/>\n\t\t);\n\n\t\treturn isFeaturedImage ? removeFeaturedButton() : setFeaturedButton();\n\t}\n\n\t/**\n\t * Featured images must be set to a successfully uploaded self-hosted image,\n\t * which has an ID.\n\t *\n\t * @return {boolean} Boolean indicating whether or not the current may be set as featured.\n\t */\n\tcanImageBeFeatured() {\n\t\tconst {\n\t\t\tattributes: { id },\n\t\t} = this.props;\n\t\treturn (\n\t\t\ttypeof id !== 'undefined' &&\n\t\t\tthis.state.uploadStatus !== UPLOAD_STATE_UPLOADING &&\n\t\t\tthis.state.uploadStatus !== UPLOAD_STATE_FAILED\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { isCaptionSelected } = this.state;\n\t\tconst {\n\t\t\tattributes,\n\t\t\tisSelected,\n\t\t\timage,\n\t\t\tclientId,\n\t\t\timageDefaultSize,\n\t\t\tcontext,\n\t\t\tfeaturedImageId,\n\t\t\twasBlockJustInserted,\n\t\t} = this.props;\n\t\tconst { align, url, alt, id, sizeSlug, className } = attributes;\n\t\tconst hasImageContext = context\n\t\t\t? Object.keys( context ).length > 0\n\t\t\t: false;\n\n\t\tconst imageSizes = Array.isArray( this.props.imageSizes )\n\t\t\t? this.props.imageSizes\n\t\t\t: [];\n\t\t// Only map available image sizes for the user to choose.\n\t\tconst sizeOptions = imageSizes\n\t\t\t.filter( ( { slug } ) => getUrlForSlug( image, slug ) )\n\t\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\t\tlet selectedSizeOption = sizeSlug || imageDefaultSize;\n\t\tlet sizeOptionsValid = sizeOptions.find(\n\t\t\t( option ) => option.value === selectedSizeOption\n\t\t);\n\n\t\tif ( ! sizeOptionsValid ) {\n\t\t\t// Default to 'full' size if the default large size is not available.\n\t\t\tsizeOptionsValid = sizeOptions.find(\n\t\t\t\t( option ) => option.value === 'full'\n\t\t\t);\n\t\t\tselectedSizeOption = 'full';\n\t\t}\n\n\t\tconst canImageBeFeatured = this.canImageBeFeatured();\n\t\tconst isFeaturedImage =\n\t\t\tcanImageBeFeatured && featuredImageId === attributes.id;\n\n\t\tconst getToolbarEditButton = ( open ) => (\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Edit image' ) }\n\t\t\t\t\t\ticon={ replace }\n\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ this.updateAlignment }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\n\t\tconst getInspectorControls = () => (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Image settings' ) } />\n\t\t\t\t<PanelBody style={ styles.panelBody }>\n\t\t\t\t\t<BlockStyles clientId={ clientId } url={ url } />\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t{ image && sizeOptionsValid && (\n\t\t\t\t\t\t<BottomSheetSelectControl\n\t\t\t\t\t\t\ticon={ fullscreen }\n\t\t\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\t\t\toptions={ sizeOptions }\n\t\t\t\t\t\t\tonChange={ this.onSizeChangeValue }\n\t\t\t\t\t\t\tvalue={ selectedSizeOption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ this.getAltTextSettings() }\n\t\t\t\t</PanelBody>\n\t\t\t\t<LinkSettings\n\t\t\t\t\tattributes={ this.props.attributes }\n\t\t\t\t\timage={ this.props.image }\n\t\t\t\t\tisLinkSheetVisible={ this.state.isLinkSheetVisible }\n\t\t\t\t\tsetMappedAttributes={ this.setMappedAttributes }\n\t\t\t\t/>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Featured Image' ) }\n\t\t\t\t\ttitleStyle={ styles.featuredImagePanelTitle }\n\t\t\t\t>\n\t\t\t\t\t{ canImageBeFeatured &&\n\t\t\t\t\t\tthis.getFeaturedButtonPanel( isFeaturedImage ) }\n\t\t\t\t\t<FooterMessageControl\n\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t'Changes to featured image will not be affected by the undo/redo buttons.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tcellContainerStyle={\n\t\t\t\t\t\t\tstyles.setFeaturedButtonCellContainer\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\n\t\tif ( ! url ) {\n\t\t\treturn (\n\t\t\t\t<View style={ styles.content }>\n\t\t\t\t\t<MediaPlaceholder\n\t\t\t\t\t\tallowedTypes={ [ MEDIA_TYPE_IMAGE ] }\n\t\t\t\t\t\tonSelect={ this.onSelectMediaUploadOption }\n\t\t\t\t\t\ticon={ this.getPlaceholderIcon() }\n\t\t\t\t\t\tonFocus={ this.props.onFocus }\n\t\t\t\t\t\tautoOpenMediaUpload={\n\t\t\t\t\t\t\tisSelected && wasBlockJustInserted\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\tconst alignToFlex = {\n\t\t\tleft: 'flex-start',\n\t\t\tcenter: 'center',\n\t\t\tright: 'flex-end',\n\t\t\tfull: 'center',\n\t\t\twide: 'center',\n\t\t};\n\n\t\tconst additionalImageProps = {\n\t\t\theight: '100%',\n\t\t\tresizeMode: context?.imageCrop ? 'cover' : 'contain',\n\t\t};\n\n\t\tconst imageContainerStyles = [\n\t\t\tcontext?.fixedHeight && styles.fixedHeight,\n\t\t];\n\n\t\tconst getImageComponent = ( openMediaOptions, getMediaOptions ) => (\n\t\t\t<Badge label={ __( 'Featured' ) } show={ isFeaturedImage }>\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\taccessible={ ! isSelected }\n\t\t\t\t\tonPress={ this.onImagePressed }\n\t\t\t\t\tonLongPress={ openMediaOptions }\n\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles.content }>\n\t\t\t\t\t\t{ isSelected && getInspectorControls() }\n\t\t\t\t\t\t{ isSelected && getMediaOptions() }\n\t\t\t\t\t\t{ ! this.state.isCaptionSelected &&\n\t\t\t\t\t\t\tgetToolbarEditButton( openMediaOptions ) }\n\t\t\t\t\t\t<MediaUploadProgress\n\t\t\t\t\t\t\tcoverUrl={ url }\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tonUpdateMediaProgress={ this.updateMediaProgress }\n\t\t\t\t\t\t\tonFinishMediaUploadWithSuccess={\n\t\t\t\t\t\t\t\tthis.finishMediaUploadWithSuccess\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFinishMediaUploadWithFailure={\n\t\t\t\t\t\t\t\tthis.finishMediaUploadWithFailure\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMediaUploadStateReset={\n\t\t\t\t\t\t\t\tthis.mediaUploadStateReset\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trenderContent={ ( {\n\t\t\t\t\t\t\t\tisUploadInProgress,\n\t\t\t\t\t\t\t\tisUploadFailed,\n\t\t\t\t\t\t\t\tretryMessage,\n\t\t\t\t\t\t\t} ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<View style={ imageContainerStyles }>\n\t\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\t\talign={\n\t\t\t\t\t\t\t\t\t\t\t\talign && alignToFlex[ align ]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t\t\t\t\tisSelected={\n\t\t\t\t\t\t\t\t\t\t\t\tisSelected &&\n\t\t\t\t\t\t\t\t\t\t\t\t! isCaptionSelected\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tisUploadFailed={ isUploadFailed }\n\t\t\t\t\t\t\t\t\t\t\tisUploadInProgress={\n\t\t\t\t\t\t\t\t\t\t\t\tisUploadInProgress\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonSelectMediaUploadOption={\n\t\t\t\t\t\t\t\t\t\t\t\tthis.onSelectMediaUploadOption\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\topenMediaOptions={\n\t\t\t\t\t\t\t\t\t\t\t\topenMediaOptions\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tretryMessage={ retryMessage }\n\t\t\t\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\t\t\t\tshapeStyle={\n\t\t\t\t\t\t\t\t\t\t\t\tstyles[ className ] || className\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\twidth={ this.getWidth() }\n\t\t\t\t\t\t\t\t\t\t\t{ ...( hasImageContext\n\t\t\t\t\t\t\t\t\t\t\t\t? additionalImageProps\n\t\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</View>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t<BlockCaption\n\t\t\t\t\tclientId={ this.props.clientId }\n\t\t\t\t\tisSelected={ this.state.isCaptionSelected }\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityLabelCreator={ this.accessibilityLabelCreator }\n\t\t\t\t\tonFocus={ this.onFocusCaption }\n\t\t\t\t\tonBlur={ this.props.onBlur } // always assign onBlur as props\n\t\t\t\t\tinsertBlocksAfter={ this.props.insertBlocksAfter }\n\t\t\t\t/>\n\t\t\t</Badge>\n\t\t);\n\n\t\treturn (\n\t\t\t<MediaUpload\n\t\t\t\tallowedTypes={ [ MEDIA_TYPE_IMAGE ] }\n\t\t\t\tisReplacingMedia={ true }\n\t\t\t\tonSelect={ this.onSelectMediaUploadOption }\n\t\t\t\trender={ ( { open, getMediaOptions } ) => {\n\t\t\t\t\treturn getImageComponent( open, getMediaOptions );\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, props ) => {\n\t\tconst { getMedia } = select( coreStore );\n\t\tconst { getSettings, wasBlockJustInserted } = select(\n\t\t\tblockEditorStore\n\t\t);\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\t\tconst {\n\t\t\tattributes: { id, url },\n\t\t\tisSelected,\n\t\t\tclientId,\n\t\t} = props;\n\t\tconst { imageSizes, imageDefaultSize } = getSettings();\n\t\tconst isNotFileUrl = id && getProtocol( url ) !== 'file:';\n\t\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\t\tconst shouldGetMedia =\n\t\t\t( isSelected && isNotFileUrl ) ||\n\t\t\t// Edge case to update the image after uploading if the block gets unselected\n\t\t\t// Check if it's the original image and not the resized one with queryparams\n\t\t\t( ! isSelected &&\n\t\t\t\tisNotFileUrl &&\n\t\t\t\turl &&\n\t\t\t\t! hasQueryArg( url, 'w' ) );\n\n\t\treturn {\n\t\t\timage: shouldGetMedia ? getMedia( id ) : null,\n\t\t\timageSizes,\n\t\t\timageDefaultSize,\n\t\t\tfeaturedImageId,\n\t\t\twasBlockJustInserted: wasBlockJustInserted(\n\t\t\t\tclientId,\n\t\t\t\t'inserter_menu'\n\t\t\t),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\treturn {\n\t\t\tcloseSettingsBottomSheet() {\n\t\t\t\tdispatch( editPostStore ).closeGeneralSidebar();\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( ImageEdit );\n"]}
|
package/build/index.js
CHANGED
|
@@ -103,6 +103,8 @@ var postAuthor = _interopRequireWildcard(require("./post-author"));
|
|
|
103
103
|
|
|
104
104
|
var postAuthorName = _interopRequireWildcard(require("./post-author-name"));
|
|
105
105
|
|
|
106
|
+
var postAuthorBiography = _interopRequireWildcard(require("./post-author-biography"));
|
|
107
|
+
|
|
106
108
|
var postComment = _interopRequireWildcard(require("./post-comment"));
|
|
107
109
|
|
|
108
110
|
var postComments = _interopRequireWildcard(require("./post-comments"));
|
|
@@ -149,6 +151,8 @@ var quote = _interopRequireWildcard(require("./quote"));
|
|
|
149
151
|
|
|
150
152
|
var reusableBlock = _interopRequireWildcard(require("./block"));
|
|
151
153
|
|
|
154
|
+
var readMore = _interopRequireWildcard(require("./read-more"));
|
|
155
|
+
|
|
152
156
|
var rss = _interopRequireWildcard(require("./rss"));
|
|
153
157
|
|
|
154
158
|
var search = _interopRequireWildcard(require("./search"));
|
|
@@ -235,7 +239,7 @@ paragraph, image, heading, gallery, list, quote, // Register all remaining core
|
|
|
235
239
|
archives, audio, button, buttons, calendar, categories, window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context
|
|
236
240
|
code, column, columns, cover, embed, file, group, html, latestComments, latestPosts, mediaText, missing, more, nextpage, pageList, pattern, preformatted, pullquote, reusableBlock, rss, search, separator, shortcode, socialLink, socialLinks, spacer, table, // tableOfContents,
|
|
237
241
|
tagCloud, textColumns, verse, video, // theme blocks
|
|
238
|
-
navigation, navigationLink, navigationSubmenu, siteLogo, siteTitle, siteTagline, query, templatePart, postTitle, postExcerpt, postFeaturedImage, postContent, postAuthor, postDate, postTerms, postNavigationLink, postTemplate, queryPagination, queryPaginationNext, queryPaginationNumbers, queryPaginationPrevious, postComments, logInOut, termDescription, queryTitle, postAuthorName];
|
|
242
|
+
navigation, navigationLink, navigationSubmenu, siteLogo, siteTitle, siteTagline, query, templatePart, postTitle, postExcerpt, postFeaturedImage, postContent, postAuthor, postDate, postTerms, postNavigationLink, postTemplate, queryPagination, queryPaginationNext, queryPaginationNumbers, queryPaginationPrevious, postComments, logInOut, termDescription, queryTitle, postAuthorName, postAuthorBiography];
|
|
239
243
|
/**
|
|
240
244
|
* Function to register core blocks provided by the block editor.
|
|
241
245
|
*
|
|
@@ -279,13 +283,13 @@ const registerCoreBlocks = function () {
|
|
|
279
283
|
|
|
280
284
|
exports.registerCoreBlocks = registerCoreBlocks;
|
|
281
285
|
|
|
282
|
-
const __experimentalRegisterExperimentalCoreBlocks = process.env.
|
|
286
|
+
const __experimentalRegisterExperimentalCoreBlocks = process.env.IS_GUTENBERG_PLUGIN ? function () {
|
|
283
287
|
let {
|
|
284
288
|
enableFSEBlocks
|
|
285
289
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
286
290
|
[// Experimental blocks.
|
|
287
291
|
homeLink, // Full Site Editing blocks.
|
|
288
|
-
...(enableFSEBlocks ? [commentAuthorAvatar, commentAuthorName, commentContent, commentDate, commentEditLink, commentReplyLink, commentTemplate, commentsQueryLoop, commentsPagination, commentsPaginationNext, commentsPaginationNumbers, commentsPaginationPrevious, navigationArea, postComment, postCommentsCount, postCommentsForm, postCommentsLink] : [])].forEach(registerBlock);
|
|
292
|
+
...(enableFSEBlocks ? [commentAuthorAvatar, commentAuthorName, commentContent, commentDate, commentEditLink, commentReplyLink, commentTemplate, commentsQueryLoop, commentsPagination, commentsPaginationNext, commentsPaginationNumbers, commentsPaginationPrevious, navigationArea, postComment, postCommentsCount, postCommentsForm, postCommentsLink, readMore] : [])].forEach(registerBlock);
|
|
289
293
|
} : undefined;
|
|
290
294
|
|
|
291
295
|
exports.__experimentalRegisterExperimentalCoreBlocks = __experimentalRegisterExperimentalCoreBlocks;
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","paragraph","image","heading","gallery","list","quote","archives","audio","button","buttons","calendar","categories","window","wp","oldEditor","classic","code","column","columns","cover","embed","file","group","html","latestComments","latestPosts","mediaText","missing","more","nextpage","pageList","pattern","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","socialLink","socialLinks","spacer","table","tagCloud","textColumns","verse","video","navigation","navigationLink","navigationSubmenu","siteLogo","siteTitle","siteTagline","query","templatePart","postTitle","postExcerpt","postFeaturedImage","postContent","postAuthor","postDate","postTerms","postNavigationLink","postTemplate","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","postComments","logInOut","termDescription","queryTitle","postAuthorName","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","GUTENBERG_PHASE","enableFSEBlocks","homeLink","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsPaginationPrevious","navigationArea","postComment","postCommentsCount","postCommentsForm","postCommentsLink","undefined"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAtGA;AACA;AACA;;AASA;AACA;AACA;AAmFA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAKC,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BH,KAArC;AACA,iCAAmB;AAAEG,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAnB,EAA0CC,QAA1C;AACA,CAND;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,2BAA2B,GAAG,MAAM,CAChD;AACA;AACAC,SAHgD,EAIhDC,KAJgD,EAKhDC,OALgD,EAMhDC,OANgD,EAOhDC,IAPgD,EAQhDC,KARgD,EAUhD;AACAC,QAXgD,EAYhDC,KAZgD,EAahDC,MAbgD,EAchDC,OAdgD,EAehDC,QAfgD,EAgBhDC,UAhBgD,EAiBhDC,MAAM,CAACC,EAAP,IAAaD,MAAM,CAACC,EAAP,CAAUC,SAAvB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,OAAP,CAAgBjF,aAAhB;AAEA,mCAAqBM,SAAS,CAACF,IAA/B;;AACA,MAAKc,MAAM,CAACC,EAAP,IAAaD,MAAM,CAACC,EAAP,CAAUC,SAA5B,EAAwC;AACvC,+CAA+BC,OAAO,CAACjB,IAAvC;AACA;;AACD,8CAAgC6B,OAAO,CAAC7B,IAAxC;AACA,oCAAsBwB,KAAK,CAACxB,IAA5B;AACA,CAXM;AAaP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM8E,4CAA4C,GACxDC,OAAO,CAACC,GAAR,CAAYC,eAAZ,KAAgC,CAAhC,GACG,YAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B,uEAAR,EAAQ;AAChC,GACC;AACAC,EAAAA,QAFD,EAIC;AACA,MAAKD,eAAe,GACjB,CACAE,mBADA,EAEAC,iBAFA,EAGAC,cAHA,EAIAC,WAJA,EAKAC,eALA,EAMAC,gBANA,EAOAC,eAPA,EAQAC,iBARA,EASAC,kBATA,EAUAC,sBAVA,EAWAC,yBAXA,EAYAC,0BAZA,EAaAC,cAbA,EAcAC,WAdA,EAeAC,iBAfA,EAgBAC,gBAhBA,EAiBAC,gBAjBA,CADiB,GAoBjB,EApBH,CALD,EA0BEvB,OA1BF,CA0BWjF,aA1BX;AA2BC,CA7BJ,GA8BGyG,SA/BG","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\n// import * as tableOfContents from './table-of-contents';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tpostComments,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorName,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks =\n\tprocess.env.GUTENBERG_PHASE === 2\n\t\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t\t[\n\t\t\t\t\t// Experimental blocks.\n\t\t\t\t\thomeLink,\n\n\t\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\t\tcommentAuthorName,\n\t\t\t\t\t\t\t\tcommentContent,\n\t\t\t\t\t\t\t\tcommentDate,\n\t\t\t\t\t\t\t\tcommentEditLink,\n\t\t\t\t\t\t\t\tcommentReplyLink,\n\t\t\t\t\t\t\t\tcommentTemplate,\n\t\t\t\t\t\t\t\tcommentsQueryLoop,\n\t\t\t\t\t\t\t\tcommentsPagination,\n\t\t\t\t\t\t\t\tcommentsPaginationNext,\n\t\t\t\t\t\t\t\tcommentsPaginationNumbers,\n\t\t\t\t\t\t\t\tcommentsPaginationPrevious,\n\t\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t].forEach( registerBlock );\n\t\t }\n\t\t: undefined;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","paragraph","image","heading","gallery","list","quote","archives","audio","button","buttons","calendar","categories","window","wp","oldEditor","classic","code","column","columns","cover","embed","file","group","html","latestComments","latestPosts","mediaText","missing","more","nextpage","pageList","pattern","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","socialLink","socialLinks","spacer","table","tagCloud","textColumns","verse","video","navigation","navigationLink","navigationSubmenu","siteLogo","siteTitle","siteTagline","query","templatePart","postTitle","postExcerpt","postFeaturedImage","postContent","postAuthor","postDate","postTerms","postNavigationLink","postTemplate","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","postComments","logInOut","termDescription","queryTitle","postAuthorName","postAuthorBiography","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","homeLink","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsPaginationPrevious","navigationArea","postComment","postCommentsCount","postCommentsForm","postCommentsLink","readMore","undefined"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAxGA;AACA;AACA;;AASA;AACA;AACA;AAqFA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAKC,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BH,KAArC;AACA,iCAAmB;AAAEG,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAnB,EAA0CC,QAA1C;AACA,CAND;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,2BAA2B,GAAG,MAAM,CAChD;AACA;AACAC,SAHgD,EAIhDC,KAJgD,EAKhDC,OALgD,EAMhDC,OANgD,EAOhDC,IAPgD,EAQhDC,KARgD,EAUh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9EgD,CAA1C;AAiFP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,kBAAkB,GAAG,YAE7B;AAAA,MADJC,MACI,uEADK5E,2BAA2B,EAChC;AACJ4E,EAAAA,MAAM,CAACC,OAAP,CAAgBlF,aAAhB;AAEA,mCAAqBM,SAAS,CAACF,IAA/B;;AACA,MAAKc,MAAM,CAACC,EAAP,IAAaD,MAAM,CAACC,EAAP,CAAUC,SAA5B,EAAwC;AACvC,+CAA+BC,OAAO,CAACjB,IAAvC;AACA;;AACD,8CAAgC6B,OAAO,CAAC7B,IAAxC;AACA,oCAAsBwB,KAAK,CAACxB,IAA5B;AACA,CAXM;AAaP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM+E,4CAA4C,GAAGC,OAAO,CAACC,GAAR,CAC1DC,mBAD0D,GAEzD,YAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B,uEAAR,EAAQ;AAChC,GACC;AACAC,EAAAA,QAFD,EAIC;AACA,MAAKD,eAAe,GACjB,CACAE,mBADA,EAEAC,iBAFA,EAGAC,cAHA,EAIAC,WAJA,EAKAC,eALA,EAMAC,gBANA,EAOAC,eAPA,EAQAC,iBARA,EASAC,kBATA,EAUAC,sBAVA,EAWAC,yBAXA,EAYAC,0BAZA,EAaAC,cAbA,EAcAC,WAdA,EAeAC,iBAfA,EAgBAC,gBAhBA,EAiBAC,gBAjBA,EAkBAC,QAlBA,CADiB,GAqBjB,EArBH,CALD,EA2BExB,OA3BF,CA2BWlF,aA3BX;AA4BC,CA/BwD,GAgCzD2G,SAhCI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\n// import * as tableOfContents from './table-of-contents';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tpostComments,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorName,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\thomeLink,\n\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tcommentAuthorName,\n\t\t\t\t\t\t\tcommentContent,\n\t\t\t\t\t\t\tcommentDate,\n\t\t\t\t\t\t\tcommentEditLink,\n\t\t\t\t\t\t\tcommentReplyLink,\n\t\t\t\t\t\t\tcommentTemplate,\n\t\t\t\t\t\t\tcommentsQueryLoop,\n\t\t\t\t\t\t\tcommentsPagination,\n\t\t\t\t\t\t\tcommentsPaginationNext,\n\t\t\t\t\t\t\tcommentsPaginationNumbers,\n\t\t\t\t\t\t\tcommentsPaginationPrevious,\n\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t\t\treadMore,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}
|
|
@@ -54,6 +54,16 @@ const USERS_LIST_QUERY = {
|
|
|
54
54
|
context: 'view'
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
function getFeaturedImageDetails(post, size) {
|
|
58
|
+
var _image$media_details$, _image$media_details, _image$media_details$2, _image$media_details$3;
|
|
59
|
+
|
|
60
|
+
const image = (0, _lodash.get)(post, ['_embedded', 'wp:featuredmedia', '0']);
|
|
61
|
+
return {
|
|
62
|
+
url: (_image$media_details$ = image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$2 = _image$media_details.sizes) === null || _image$media_details$2 === void 0 ? void 0 : (_image$media_details$3 = _image$media_details$2[size]) === null || _image$media_details$3 === void 0 ? void 0 : _image$media_details$3.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image === null || image === void 0 ? void 0 : image.source_url,
|
|
63
|
+
alt: image === null || image === void 0 ? void 0 : image.alt_text
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
57
67
|
function LatestPostsEdit(_ref) {
|
|
58
68
|
var _categoriesList$reduc;
|
|
59
69
|
|
|
@@ -82,7 +92,7 @@ function LatestPostsEdit(_ref) {
|
|
|
82
92
|
addLinkToFeaturedImage
|
|
83
93
|
} = attributes;
|
|
84
94
|
const {
|
|
85
|
-
|
|
95
|
+
imageSizes,
|
|
86
96
|
latestPosts,
|
|
87
97
|
defaultImageWidth,
|
|
88
98
|
defaultImageHeight,
|
|
@@ -91,65 +101,42 @@ function LatestPostsEdit(_ref) {
|
|
|
91
101
|
} = (0, _data.useSelect)(select => {
|
|
92
102
|
const {
|
|
93
103
|
getEntityRecords,
|
|
94
|
-
getMedia,
|
|
95
104
|
getUsers
|
|
96
105
|
} = select(_coreData.store);
|
|
97
|
-
const
|
|
98
|
-
getSettings
|
|
99
|
-
} = select(_blockEditor.store);
|
|
100
|
-
const {
|
|
101
|
-
imageSizes,
|
|
102
|
-
imageDimensions
|
|
103
|
-
} = getSettings();
|
|
106
|
+
const settings = select(_blockEditor.store).getSettings();
|
|
104
107
|
const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : [];
|
|
105
108
|
const latestPostsQuery = (0, _lodash.pickBy)({
|
|
106
109
|
categories: catIds,
|
|
107
110
|
author: selectedAuthor,
|
|
108
111
|
order,
|
|
109
112
|
orderby: orderBy,
|
|
110
|
-
per_page: postsToShow
|
|
113
|
+
per_page: postsToShow,
|
|
114
|
+
_embed: 'wp:featuredmedia'
|
|
111
115
|
}, value => !(0, _lodash.isUndefined)(value));
|
|
112
|
-
const posts = getEntityRecords('postType', 'post', latestPostsQuery);
|
|
113
116
|
return {
|
|
114
|
-
defaultImageWidth: (0, _lodash.get)(imageDimensions, [featuredImageSizeSlug, 'width'], 0),
|
|
115
|
-
defaultImageHeight: (0, _lodash.get)(imageDimensions, [featuredImageSizeSlug, 'height'], 0),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
slug
|
|
119
|
-
} = _ref2;
|
|
120
|
-
return slug !== 'full';
|
|
121
|
-
}).map(_ref3 => {
|
|
122
|
-
let {
|
|
123
|
-
name,
|
|
124
|
-
slug
|
|
125
|
-
} = _ref3;
|
|
126
|
-
return {
|
|
127
|
-
value: slug,
|
|
128
|
-
label: name
|
|
129
|
-
};
|
|
130
|
-
}),
|
|
131
|
-
latestPosts: !Array.isArray(posts) ? posts : posts.map(post => {
|
|
132
|
-
if (!post.featured_media) return post;
|
|
133
|
-
const image = getMedia(post.featured_media);
|
|
134
|
-
let url = (0, _lodash.get)(image, ['media_details', 'sizes', featuredImageSizeSlug, 'source_url'], null);
|
|
135
|
-
|
|
136
|
-
if (!url) {
|
|
137
|
-
url = (0, _lodash.get)(image, 'source_url', null);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const featuredImageInfo = {
|
|
141
|
-
url,
|
|
142
|
-
// eslint-disable-next-line camelcase
|
|
143
|
-
alt: image === null || image === void 0 ? void 0 : image.alt_text
|
|
144
|
-
};
|
|
145
|
-
return { ...post,
|
|
146
|
-
featuredImageInfo
|
|
147
|
-
};
|
|
148
|
-
}),
|
|
117
|
+
defaultImageWidth: (0, _lodash.get)(settings.imageDimensions, [featuredImageSizeSlug, 'width'], 0),
|
|
118
|
+
defaultImageHeight: (0, _lodash.get)(settings.imageDimensions, [featuredImageSizeSlug, 'height'], 0),
|
|
119
|
+
imageSizes: settings.imageSizes,
|
|
120
|
+
latestPosts: getEntityRecords('postType', 'post', latestPostsQuery),
|
|
149
121
|
categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY),
|
|
150
122
|
authorList: getUsers(USERS_LIST_QUERY)
|
|
151
123
|
};
|
|
152
124
|
}, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]);
|
|
125
|
+
const imageSizeOptions = imageSizes.filter(_ref2 => {
|
|
126
|
+
let {
|
|
127
|
+
slug
|
|
128
|
+
} = _ref2;
|
|
129
|
+
return slug !== 'full';
|
|
130
|
+
}).map(_ref3 => {
|
|
131
|
+
let {
|
|
132
|
+
name,
|
|
133
|
+
slug
|
|
134
|
+
} = _ref3;
|
|
135
|
+
return {
|
|
136
|
+
value: slug,
|
|
137
|
+
label: name
|
|
138
|
+
};
|
|
139
|
+
});
|
|
153
140
|
const categorySuggestions = (_categoriesList$reduc = categoriesList === null || categoriesList === void 0 ? void 0 : categoriesList.reduce((accumulator, category) => ({ ...accumulator,
|
|
154
141
|
[category.name]: category
|
|
155
142
|
}), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {};
|
|
@@ -347,11 +334,9 @@ function LatestPostsEdit(_ref) {
|
|
|
347
334
|
excerptElement.innerHTML = excerpt;
|
|
348
335
|
excerpt = excerptElement.textContent || excerptElement.innerText || '';
|
|
349
336
|
const {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
} = {}
|
|
354
|
-
} = post;
|
|
337
|
+
url: imageSourceUrl,
|
|
338
|
+
alt: featuredImageAlt
|
|
339
|
+
} = getFeaturedImageDetails(post, featuredImageSizeSlug);
|
|
355
340
|
const imageClasses = (0, _classnames.default)({
|
|
356
341
|
'wp-block-latest-posts__featured-image': true,
|
|
357
342
|
[`align${featuredImageAlign}`]: !!featuredImageAlign
|
|
@@ -379,8 +364,11 @@ function LatestPostsEdit(_ref) {
|
|
|
379
364
|
rel: "noreferrer noopener"
|
|
380
365
|
}, featuredImage) : featuredImage), (0, _element.createElement)("a", {
|
|
381
366
|
href: post.link,
|
|
382
|
-
rel: "noreferrer noopener"
|
|
383
|
-
|
|
367
|
+
rel: "noreferrer noopener",
|
|
368
|
+
dangerouslySetInnerHTML: !!titleTrimmed ? {
|
|
369
|
+
__html: titleTrimmed
|
|
370
|
+
} : undefined
|
|
371
|
+
}, !titleTrimmed ? (0, _i18n.__)('(no title)') : null), displayAuthor && currentAuthor && (0, _element.createElement)("div", {
|
|
384
372
|
className: "wp-block-latest-posts__post-author"
|
|
385
373
|
}, (0, _i18n.sprintf)(
|
|
386
374
|
/* translators: byline. %s: current author. */
|
|
@@ -390,10 +378,11 @@ function LatestPostsEdit(_ref) {
|
|
|
390
378
|
}, (0, _date.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0, _element.createElement)("div", {
|
|
391
379
|
className: "wp-block-latest-posts__post-excerpt"
|
|
392
380
|
}, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0, _element.createElement)("div", {
|
|
393
|
-
className: "wp-block-latest-posts__post-full-content"
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
381
|
+
className: "wp-block-latest-posts__post-full-content",
|
|
382
|
+
dangerouslySetInnerHTML: {
|
|
383
|
+
__html: post.content.raw.trim()
|
|
384
|
+
}
|
|
385
|
+
}));
|
|
397
386
|
})));
|
|
398
387
|
}
|
|
399
388
|
//# sourceMappingURL=edit.js.map
|