@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
package/src/image/edit.native.js
CHANGED
|
@@ -174,14 +174,22 @@ function LinkSettings( {
|
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
const UPLOAD_STATE_IDLE = 0;
|
|
178
|
+
const UPLOAD_STATE_UPLOADING = 1;
|
|
179
|
+
const UPLOAD_STATE_SUCCEEDED = 2;
|
|
180
|
+
const UPLOAD_STATE_FAILED = 3;
|
|
181
|
+
|
|
177
182
|
export class ImageEdit extends Component {
|
|
178
183
|
constructor( props ) {
|
|
179
184
|
super( props );
|
|
180
185
|
|
|
181
186
|
this.state = {
|
|
182
187
|
isCaptionSelected: false,
|
|
188
|
+
uploadStatus: UPLOAD_STATE_IDLE,
|
|
183
189
|
};
|
|
184
190
|
|
|
191
|
+
this.replacedFeaturedImage = false;
|
|
192
|
+
|
|
185
193
|
this.finishMediaUploadWithSuccess = this.finishMediaUploadWithSuccess.bind(
|
|
186
194
|
this
|
|
187
195
|
);
|
|
@@ -245,7 +253,7 @@ export class ImageEdit extends Component {
|
|
|
245
253
|
// this action will only exist if the user pressed the trash button on the block holder
|
|
246
254
|
if (
|
|
247
255
|
hasAction( 'blocks.onRemoveBlockCheckUpload' ) &&
|
|
248
|
-
this.state.
|
|
256
|
+
this.state.uploadStatus === UPLOAD_STATE_UPLOADING
|
|
249
257
|
) {
|
|
250
258
|
doAction(
|
|
251
259
|
'blocks.onRemoveBlockCheckUpload',
|
|
@@ -255,13 +263,44 @@ export class ImageEdit extends Component {
|
|
|
255
263
|
}
|
|
256
264
|
|
|
257
265
|
componentDidUpdate( previousProps ) {
|
|
258
|
-
const {
|
|
266
|
+
const {
|
|
267
|
+
image,
|
|
268
|
+
attributes,
|
|
269
|
+
setAttributes,
|
|
270
|
+
featuredImageId,
|
|
271
|
+
} = this.props;
|
|
259
272
|
if ( ! previousProps.image && image ) {
|
|
260
273
|
const url =
|
|
261
274
|
getUrlForSlug( image, attributes?.sizeSlug ) ||
|
|
262
275
|
image.source_url;
|
|
263
276
|
setAttributes( { url } );
|
|
264
277
|
}
|
|
278
|
+
|
|
279
|
+
const { id } = attributes;
|
|
280
|
+
const { id: previousId } = previousProps.attributes;
|
|
281
|
+
|
|
282
|
+
// The media changed and the previous media was set as the Featured Image,
|
|
283
|
+
// we must keep track of the previous media's featured status to act on it
|
|
284
|
+
// once the new media has a finalized ID.
|
|
285
|
+
if (
|
|
286
|
+
!! id &&
|
|
287
|
+
id !== previousId &&
|
|
288
|
+
!! featuredImageId &&
|
|
289
|
+
featuredImageId === previousId
|
|
290
|
+
) {
|
|
291
|
+
this.replacedFeaturedImage = true;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// The media changed and now has a finalized ID (e.g. upload completed), we
|
|
295
|
+
// should attempt to replace the featured image if applicable.
|
|
296
|
+
if (
|
|
297
|
+
this.replacedFeaturedImage &&
|
|
298
|
+
!! image &&
|
|
299
|
+
this.canImageBeFeatured()
|
|
300
|
+
) {
|
|
301
|
+
this.replacedFeaturedImage = false;
|
|
302
|
+
setFeaturedImage( id );
|
|
303
|
+
}
|
|
265
304
|
}
|
|
266
305
|
|
|
267
306
|
static getDerivedStateFromProps( props, state ) {
|
|
@@ -289,7 +328,7 @@ export class ImageEdit extends Component {
|
|
|
289
328
|
onImagePressed() {
|
|
290
329
|
const { attributes, image } = this.props;
|
|
291
330
|
|
|
292
|
-
if ( this.state.
|
|
331
|
+
if ( this.state.uploadStatus === UPLOAD_STATE_UPLOADING ) {
|
|
293
332
|
requestImageUploadCancelDialog( attributes.id );
|
|
294
333
|
} else if (
|
|
295
334
|
attributes.id &&
|
|
@@ -314,8 +353,8 @@ export class ImageEdit extends Component {
|
|
|
314
353
|
setAttributes( { url: payload.mediaUrl } );
|
|
315
354
|
}
|
|
316
355
|
|
|
317
|
-
if (
|
|
318
|
-
this.setState( {
|
|
356
|
+
if ( this.state.uploadStatus !== UPLOAD_STATE_UPLOADING ) {
|
|
357
|
+
this.setState( { uploadStatus: UPLOAD_STATE_UPLOADING } );
|
|
319
358
|
}
|
|
320
359
|
}
|
|
321
360
|
|
|
@@ -323,21 +362,21 @@ export class ImageEdit extends Component {
|
|
|
323
362
|
const { setAttributes } = this.props;
|
|
324
363
|
|
|
325
364
|
setAttributes( { url: payload.mediaUrl, id: payload.mediaServerId } );
|
|
326
|
-
this.setState( {
|
|
365
|
+
this.setState( { uploadStatus: UPLOAD_STATE_SUCCEEDED } );
|
|
327
366
|
}
|
|
328
367
|
|
|
329
368
|
finishMediaUploadWithFailure( payload ) {
|
|
330
369
|
const { setAttributes } = this.props;
|
|
331
370
|
|
|
332
371
|
setAttributes( { id: payload.mediaId } );
|
|
333
|
-
this.setState( {
|
|
372
|
+
this.setState( { uploadStatus: UPLOAD_STATE_FAILED } );
|
|
334
373
|
}
|
|
335
374
|
|
|
336
375
|
mediaUploadStateReset() {
|
|
337
376
|
const { setAttributes } = this.props;
|
|
338
377
|
|
|
339
378
|
setAttributes( { id: null, url: null } );
|
|
340
|
-
this.setState( {
|
|
379
|
+
this.setState( { uploadStatus: UPLOAD_STATE_IDLE } );
|
|
341
380
|
}
|
|
342
381
|
|
|
343
382
|
updateImageURL( url ) {
|
|
@@ -550,6 +589,23 @@ export class ImageEdit extends Component {
|
|
|
550
589
|
return isFeaturedImage ? removeFeaturedButton() : setFeaturedButton();
|
|
551
590
|
}
|
|
552
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Featured images must be set to a successfully uploaded self-hosted image,
|
|
594
|
+
* which has an ID.
|
|
595
|
+
*
|
|
596
|
+
* @return {boolean} Boolean indicating whether or not the current may be set as featured.
|
|
597
|
+
*/
|
|
598
|
+
canImageBeFeatured() {
|
|
599
|
+
const {
|
|
600
|
+
attributes: { id },
|
|
601
|
+
} = this.props;
|
|
602
|
+
return (
|
|
603
|
+
typeof id !== 'undefined' &&
|
|
604
|
+
this.state.uploadStatus !== UPLOAD_STATE_UPLOADING &&
|
|
605
|
+
this.state.uploadStatus !== UPLOAD_STATE_FAILED
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
553
609
|
render() {
|
|
554
610
|
const { isCaptionSelected } = this.state;
|
|
555
611
|
const {
|
|
@@ -588,13 +644,7 @@ export class ImageEdit extends Component {
|
|
|
588
644
|
selectedSizeOption = 'full';
|
|
589
645
|
}
|
|
590
646
|
|
|
591
|
-
|
|
592
|
-
// The 'canImageBeFeatured' check filters out images that haven't been uploaded based on the following:
|
|
593
|
-
// - Images that are embedded in a post but are uploaded elsewhere have an id of 'undefined'.
|
|
594
|
-
// - Image that are uploading or have failed to upload are given a temporary negative ID.
|
|
595
|
-
const canImageBeFeatured =
|
|
596
|
-
typeof attributes.id !== 'undefined' && attributes.id > 0;
|
|
597
|
-
|
|
647
|
+
const canImageBeFeatured = this.canImageBeFeatured();
|
|
598
648
|
const isFeaturedImage =
|
|
599
649
|
canImageBeFeatured && featuredImageId === attributes.id;
|
|
600
650
|
|
package/src/image/index.php
CHANGED
|
@@ -20,7 +20,7 @@ function render_block_core_image( $attributes, $content ) {
|
|
|
20
20
|
// which now wraps Image Blocks within innerBlocks.
|
|
21
21
|
// The data-id attribute is added in a core/gallery `render_block_data` hook.
|
|
22
22
|
$data_id_attribute = 'data-id="' . esc_attr( $attributes['data-id'] ) . '"';
|
|
23
|
-
if (
|
|
23
|
+
if ( false === strpos( $content, $data_id_attribute ) ) {
|
|
24
24
|
$content = str_replace( '<img', '<img ' . $data_id_attribute . ' ', $content );
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/image/style.scss
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
act,
|
|
6
|
+
fireEvent,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
getEditorHtml,
|
|
9
|
+
render,
|
|
10
|
+
} from 'test/helpers';
|
|
5
11
|
import { Image } from 'react-native';
|
|
6
12
|
import Clipboard from '@react-native-clipboard/clipboard';
|
|
7
13
|
|
|
@@ -10,11 +16,29 @@ import Clipboard from '@react-native-clipboard/clipboard';
|
|
|
10
16
|
*/
|
|
11
17
|
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
12
18
|
import { apiFetch } from '@wordpress/data-controls';
|
|
19
|
+
import {
|
|
20
|
+
setFeaturedImage,
|
|
21
|
+
sendMediaUpload,
|
|
22
|
+
subscribeMediaUpload,
|
|
23
|
+
} from '@wordpress/react-native-bridge';
|
|
24
|
+
import { select } from '@wordpress/data';
|
|
25
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
26
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
27
|
+
import '@wordpress/jest-console';
|
|
13
28
|
|
|
14
29
|
/**
|
|
15
30
|
* Internal dependencies
|
|
16
31
|
*/
|
|
17
32
|
import { registerCoreBlocks } from '../..';
|
|
33
|
+
import ImageEdit from '../edit';
|
|
34
|
+
|
|
35
|
+
let uploadCallBack;
|
|
36
|
+
subscribeMediaUpload.mockImplementation( ( callback ) => {
|
|
37
|
+
uploadCallBack = callback;
|
|
38
|
+
} );
|
|
39
|
+
sendMediaUpload.mockImplementation( ( payload ) => {
|
|
40
|
+
uploadCallBack( payload );
|
|
41
|
+
} );
|
|
18
42
|
|
|
19
43
|
jest.mock( '@wordpress/data-controls', () => {
|
|
20
44
|
const dataControls = jest.requireActual( '@wordpress/data-controls' );
|
|
@@ -67,7 +91,7 @@ describe( 'Image Block', () => {
|
|
|
67
91
|
</a>
|
|
68
92
|
<figcaption>Mountain</figcaption></figure>
|
|
69
93
|
<!-- /wp:image -->`;
|
|
70
|
-
const screen = initializeEditor( { initialHtml } );
|
|
94
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
71
95
|
// We must await the image fetch via `getMedia`
|
|
72
96
|
await act( () => apiFetchPromise );
|
|
73
97
|
|
|
@@ -93,7 +117,7 @@ describe( 'Image Block', () => {
|
|
|
93
117
|
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
94
118
|
<figcaption>Mountain</figcaption></figure>
|
|
95
119
|
<!-- /wp:image -->`;
|
|
96
|
-
const screen = initializeEditor( { initialHtml } );
|
|
120
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
97
121
|
// We must await the image fetch via `getMedia`
|
|
98
122
|
await act( () => apiFetchPromise );
|
|
99
123
|
|
|
@@ -119,7 +143,7 @@ describe( 'Image Block', () => {
|
|
|
119
143
|
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
120
144
|
<figcaption>Mountain</figcaption></figure>
|
|
121
145
|
<!-- /wp:image -->`;
|
|
122
|
-
const screen = initializeEditor( { initialHtml } );
|
|
146
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
123
147
|
// We must await the image fetch via `getMedia`
|
|
124
148
|
await act( () => apiFetchPromise );
|
|
125
149
|
|
|
@@ -152,7 +176,7 @@ describe( 'Image Block', () => {
|
|
|
152
176
|
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
153
177
|
<figcaption>Mountain</figcaption></figure>
|
|
154
178
|
<!-- /wp:image -->`;
|
|
155
|
-
const screen = initializeEditor( { initialHtml } );
|
|
179
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
156
180
|
// We must await the image fetch via `getMedia`
|
|
157
181
|
await act( () => apiFetchPromise );
|
|
158
182
|
|
|
@@ -192,7 +216,7 @@ describe( 'Image Block', () => {
|
|
|
192
216
|
</a>
|
|
193
217
|
<figcaption>Mountain</figcaption></figure>
|
|
194
218
|
<!-- /wp:image -->`;
|
|
195
|
-
const screen = initializeEditor( { initialHtml } );
|
|
219
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
196
220
|
// We must await the image fetch via `getMedia`
|
|
197
221
|
await act( () => apiFetchPromise );
|
|
198
222
|
|
|
@@ -216,7 +240,7 @@ describe( 'Image Block', () => {
|
|
|
216
240
|
</a>
|
|
217
241
|
<figcaption>Mountain</figcaption></figure>
|
|
218
242
|
<!-- /wp:image -->`;
|
|
219
|
-
const screen = initializeEditor( { initialHtml } );
|
|
243
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
220
244
|
// We must await the image fetch via `getMedia`
|
|
221
245
|
await act( () => apiFetchPromise );
|
|
222
246
|
|
|
@@ -247,7 +271,7 @@ describe( 'Image Block', () => {
|
|
|
247
271
|
<figcaption>Mountain</figcaption>
|
|
248
272
|
</figure>
|
|
249
273
|
<!-- /wp:image -->`;
|
|
250
|
-
const screen = initializeEditor( { initialHtml } );
|
|
274
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
251
275
|
// We must await the image fetch via `getMedia`
|
|
252
276
|
await act( () => apiFetchPromise );
|
|
253
277
|
|
|
@@ -267,4 +291,129 @@ describe( 'Image Block', () => {
|
|
|
267
291
|
<!-- /wp:image -->`;
|
|
268
292
|
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
269
293
|
} );
|
|
294
|
+
|
|
295
|
+
describe( "when replacing media for an image set as the post's featured image", () => {
|
|
296
|
+
function mockFeaturedMedia( featuredImageId ) {
|
|
297
|
+
jest.spyOn(
|
|
298
|
+
select( editorStore ),
|
|
299
|
+
'getEditedPostAttribute'
|
|
300
|
+
).mockImplementation( ( attributeName ) =>
|
|
301
|
+
attributeName === 'featured_media' ? featuredImageId : undefined
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function mockGetMedia( media ) {
|
|
306
|
+
jest.spyOn( select( coreStore ), 'getMedia' ).mockReturnValueOnce(
|
|
307
|
+
media
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
it( 'does not prompt to replace featured image during a new image upload', () => {
|
|
312
|
+
// Arrange
|
|
313
|
+
const INITIAL_IMAGE = { id: 1, url: 'mock-url-1' };
|
|
314
|
+
const NEW_IMAGE_PENDING = { id: 2, url: 'mock-url-2' };
|
|
315
|
+
mockFeaturedMedia( INITIAL_IMAGE.id );
|
|
316
|
+
const screen = render( <ImageEdit attributes={ INITIAL_IMAGE } /> );
|
|
317
|
+
|
|
318
|
+
// Act
|
|
319
|
+
screen.update( <ImageEdit attributes={ NEW_IMAGE_PENDING } /> );
|
|
320
|
+
const MEDIA_UPLOAD_STATE_UPLOADING = 1;
|
|
321
|
+
sendMediaUpload( {
|
|
322
|
+
state: MEDIA_UPLOAD_STATE_UPLOADING,
|
|
323
|
+
mediaId: NEW_IMAGE_PENDING.id,
|
|
324
|
+
progress: 0.1,
|
|
325
|
+
} );
|
|
326
|
+
|
|
327
|
+
// Assert
|
|
328
|
+
expect( setFeaturedImage ).not.toHaveBeenCalled();
|
|
329
|
+
} );
|
|
330
|
+
|
|
331
|
+
it( 'does not prompt to replace featured image after a new image upload fails', () => {
|
|
332
|
+
// Arrange
|
|
333
|
+
const INITIAL_IMAGE = { id: 1, url: 'mock-url-1' };
|
|
334
|
+
const NEW_IMAGE_PENDING = { id: 2, url: 'mock-url-2' };
|
|
335
|
+
mockFeaturedMedia( INITIAL_IMAGE.id );
|
|
336
|
+
const screen = render(
|
|
337
|
+
<ImageEdit
|
|
338
|
+
attributes={ INITIAL_IMAGE }
|
|
339
|
+
setAttributes={ () => {} }
|
|
340
|
+
/>
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
// Act
|
|
344
|
+
screen.update(
|
|
345
|
+
<ImageEdit
|
|
346
|
+
attributes={ NEW_IMAGE_PENDING }
|
|
347
|
+
setAttributes={ () => {} }
|
|
348
|
+
/>
|
|
349
|
+
);
|
|
350
|
+
const MEDIA_UPLOAD_STATE_UPLOADING = 1;
|
|
351
|
+
sendMediaUpload( {
|
|
352
|
+
state: MEDIA_UPLOAD_STATE_UPLOADING,
|
|
353
|
+
mediaId: NEW_IMAGE_PENDING.id,
|
|
354
|
+
progress: 0.1,
|
|
355
|
+
} );
|
|
356
|
+
const MEDIA_UPLOAD_STATE_FAILED = 3;
|
|
357
|
+
sendMediaUpload( {
|
|
358
|
+
state: MEDIA_UPLOAD_STATE_FAILED,
|
|
359
|
+
mediaId: NEW_IMAGE_PENDING.id,
|
|
360
|
+
} );
|
|
361
|
+
|
|
362
|
+
// Assert
|
|
363
|
+
expect( setFeaturedImage ).not.toHaveBeenCalled();
|
|
364
|
+
} );
|
|
365
|
+
|
|
366
|
+
it( 'prompts to replace featured image after a new image upload succeeds', () => {
|
|
367
|
+
// Arrange
|
|
368
|
+
const INITIAL_IMAGE = { id: 1, url: 'mock-url-1' };
|
|
369
|
+
const NEW_IMAGE_PENDING = { id: 2, url: 'mock-url-2' };
|
|
370
|
+
const NEW_IMAGE_RESOLVED = { id: 3, url: 'mock-url-2' };
|
|
371
|
+
mockFeaturedMedia( INITIAL_IMAGE.id );
|
|
372
|
+
const screen = render( <ImageEdit attributes={ INITIAL_IMAGE } /> );
|
|
373
|
+
|
|
374
|
+
// Act
|
|
375
|
+
screen.update( <ImageEdit attributes={ NEW_IMAGE_PENDING } /> );
|
|
376
|
+
mockGetMedia( { id: NEW_IMAGE_RESOLVED.id } );
|
|
377
|
+
screen.update(
|
|
378
|
+
<ImageEdit
|
|
379
|
+
attributes={ NEW_IMAGE_RESOLVED }
|
|
380
|
+
setAttributes={ () => {} }
|
|
381
|
+
/>
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
// Assert
|
|
385
|
+
expect( setFeaturedImage ).toHaveBeenCalledTimes( 1 );
|
|
386
|
+
expect( setFeaturedImage ).toHaveBeenCalledWith(
|
|
387
|
+
NEW_IMAGE_RESOLVED.id
|
|
388
|
+
);
|
|
389
|
+
} );
|
|
390
|
+
|
|
391
|
+
it( 'prompts to replace featured image for a cached image', () => {
|
|
392
|
+
// Arrange
|
|
393
|
+
const INITIAL_IMAGE = { id: 1, url: 'mock-url-1' };
|
|
394
|
+
const NEW_IMAGE_RESOLVED = { id: 3, url: 'mock-url-2' };
|
|
395
|
+
mockFeaturedMedia( INITIAL_IMAGE.id );
|
|
396
|
+
const screen = render(
|
|
397
|
+
<ImageEdit
|
|
398
|
+
attributes={ INITIAL_IMAGE }
|
|
399
|
+
setAttributes={ () => {} }
|
|
400
|
+
/>
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
// Act
|
|
404
|
+
mockGetMedia( { id: NEW_IMAGE_RESOLVED.id } );
|
|
405
|
+
screen.update(
|
|
406
|
+
<ImageEdit
|
|
407
|
+
attributes={ NEW_IMAGE_RESOLVED }
|
|
408
|
+
setAttributes={ () => {} }
|
|
409
|
+
/>
|
|
410
|
+
);
|
|
411
|
+
|
|
412
|
+
// Assert
|
|
413
|
+
expect( setFeaturedImage ).toHaveBeenCalledTimes( 1 );
|
|
414
|
+
expect( setFeaturedImage ).toHaveBeenCalledWith(
|
|
415
|
+
NEW_IMAGE_RESOLVED.id
|
|
416
|
+
);
|
|
417
|
+
} );
|
|
418
|
+
} );
|
|
270
419
|
} );
|
package/src/index.js
CHANGED
|
@@ -60,6 +60,7 @@ import * as pageList from './page-list';
|
|
|
60
60
|
import * as paragraph from './paragraph';
|
|
61
61
|
import * as postAuthor from './post-author';
|
|
62
62
|
import * as postAuthorName from './post-author-name';
|
|
63
|
+
import * as postAuthorBiography from './post-author-biography';
|
|
63
64
|
import * as postComment from './post-comment';
|
|
64
65
|
import * as postComments from './post-comments';
|
|
65
66
|
import * as postCommentsCount from './post-comments-count';
|
|
@@ -83,6 +84,7 @@ import * as queryPaginationPrevious from './query-pagination-previous';
|
|
|
83
84
|
import * as queryTitle from './query-title';
|
|
84
85
|
import * as quote from './quote';
|
|
85
86
|
import * as reusableBlock from './block';
|
|
87
|
+
import * as readMore from './read-more';
|
|
86
88
|
import * as rss from './rss';
|
|
87
89
|
import * as search from './search';
|
|
88
90
|
import * as separator from './separator';
|
|
@@ -204,6 +206,7 @@ export const __experimentalGetCoreBlocks = () => [
|
|
|
204
206
|
termDescription,
|
|
205
207
|
queryTitle,
|
|
206
208
|
postAuthorName,
|
|
209
|
+
postAuthorBiography,
|
|
207
210
|
];
|
|
208
211
|
|
|
209
212
|
/**
|
|
@@ -242,35 +245,36 @@ export const registerCoreBlocks = (
|
|
|
242
245
|
* __experimentalRegisterExperimentalCoreBlocks( settings );
|
|
243
246
|
* ```
|
|
244
247
|
*/
|
|
245
|
-
export const __experimentalRegisterExperimentalCoreBlocks =
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
export const __experimentalRegisterExperimentalCoreBlocks = process.env
|
|
249
|
+
.IS_GUTENBERG_PLUGIN
|
|
250
|
+
? ( { enableFSEBlocks } = {} ) => {
|
|
251
|
+
[
|
|
252
|
+
// Experimental blocks.
|
|
253
|
+
homeLink,
|
|
251
254
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
255
|
+
// Full Site Editing blocks.
|
|
256
|
+
...( enableFSEBlocks
|
|
257
|
+
? [
|
|
258
|
+
commentAuthorAvatar,
|
|
259
|
+
commentAuthorName,
|
|
260
|
+
commentContent,
|
|
261
|
+
commentDate,
|
|
262
|
+
commentEditLink,
|
|
263
|
+
commentReplyLink,
|
|
264
|
+
commentTemplate,
|
|
265
|
+
commentsQueryLoop,
|
|
266
|
+
commentsPagination,
|
|
267
|
+
commentsPaginationNext,
|
|
268
|
+
commentsPaginationNumbers,
|
|
269
|
+
commentsPaginationPrevious,
|
|
270
|
+
navigationArea,
|
|
271
|
+
postComment,
|
|
272
|
+
postCommentsCount,
|
|
273
|
+
postCommentsForm,
|
|
274
|
+
postCommentsLink,
|
|
275
|
+
readMore,
|
|
276
|
+
]
|
|
277
|
+
: [] ),
|
|
278
|
+
].forEach( registerBlock );
|
|
279
|
+
}
|
|
280
|
+
: undefined;
|
|
@@ -86,14 +86,14 @@ function render_block_core_latest_comments( $attributes = array() ) {
|
|
|
86
86
|
|
|
87
87
|
$author_markup = '';
|
|
88
88
|
if ( $author_url ) {
|
|
89
|
-
$author_markup .= '<a class="wp-block-latest-comments__comment-author" href="' . esc_url( $author_url ) . '">' .
|
|
89
|
+
$author_markup .= '<a class="wp-block-latest-comments__comment-author" href="' . esc_url( $author_url ) . '">' . get_comment_author( $comment ) . '</a>';
|
|
90
90
|
} else {
|
|
91
|
-
$author_markup .= '<span class="wp-block-latest-comments__comment-author">' .
|
|
91
|
+
$author_markup .= '<span class="wp-block-latest-comments__comment-author">' . get_comment_author( $comment ) . '</span>';
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in
|
|
95
95
|
// `esc_html`.
|
|
96
|
-
$post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' .
|
|
96
|
+
$post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . '</a>';
|
|
97
97
|
|
|
98
98
|
$list_items_markup .= sprintf(
|
|
99
99
|
/* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
|
|
@@ -106,7 +106,7 @@ function render_block_core_latest_comments( $attributes = array() ) {
|
|
|
106
106
|
$list_items_markup .= sprintf(
|
|
107
107
|
'<time datetime="%1$s" class="wp-block-latest-comments__comment-date">%2$s</time>',
|
|
108
108
|
esc_attr( get_comment_date( 'c', $comment ) ),
|
|
109
|
-
|
|
109
|
+
date_i18n( get_option( 'date_format' ), get_comment_date( 'U', $comment ) )
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
112
|
$list_items_markup .= '</footer>';
|