@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/cover/edit.js
CHANGED
|
@@ -726,14 +726,18 @@ function CoverEdit( {
|
|
|
726
726
|
<span
|
|
727
727
|
aria-hidden="true"
|
|
728
728
|
className={ classnames(
|
|
729
|
+
'wp-block-cover__background',
|
|
729
730
|
dimRatioToClass( dimRatio ),
|
|
730
|
-
{ [ overlayColor.class ]: overlayColor.class },
|
|
731
|
-
'wp-block-cover__gradient-background',
|
|
732
|
-
gradientClass,
|
|
733
731
|
{
|
|
732
|
+
[ overlayColor.class ]: overlayColor.class,
|
|
734
733
|
'has-background-dim': dimRatio !== undefined,
|
|
734
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
735
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
736
|
+
// media, a gradient and a dim.
|
|
737
|
+
'wp-block-cover__gradient-background':
|
|
738
|
+
url && gradientValue && dimRatio !== 0,
|
|
735
739
|
'has-background-gradient': gradientValue,
|
|
736
|
-
[ gradientClass ]:
|
|
740
|
+
[ gradientClass ]: gradientClass,
|
|
737
741
|
}
|
|
738
742
|
) }
|
|
739
743
|
style={ { backgroundImage: gradientValue, ...bgStyle } }
|
package/src/cover/save.js
CHANGED
|
@@ -88,19 +88,25 @@ export default function save( { attributes } ) {
|
|
|
88
88
|
getPositionClassName( contentPosition )
|
|
89
89
|
);
|
|
90
90
|
|
|
91
|
+
const gradientValue = gradient || customGradient;
|
|
92
|
+
|
|
91
93
|
return (
|
|
92
94
|
<div { ...useBlockProps.save( { className: classes, style } ) }>
|
|
93
95
|
<span
|
|
94
96
|
aria-hidden="true"
|
|
95
97
|
className={ classnames(
|
|
98
|
+
'wp-block-cover__background',
|
|
96
99
|
overlayColorClass,
|
|
97
100
|
dimRatioToClass( dimRatio ),
|
|
98
|
-
'wp-block-cover__gradient-background',
|
|
99
|
-
gradientClass,
|
|
100
101
|
{
|
|
101
102
|
'has-background-dim': dimRatio !== undefined,
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
104
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
105
|
+
// media, a gradient and a dim.
|
|
106
|
+
'wp-block-cover__gradient-background':
|
|
107
|
+
url && gradientValue && dimRatio !== 0,
|
|
108
|
+
'has-background-gradient': gradientValue,
|
|
109
|
+
[ gradientClass ]: gradientClass,
|
|
104
110
|
}
|
|
105
111
|
) }
|
|
106
112
|
style={ bgStyle }
|
package/src/cover/style.scss
CHANGED
|
@@ -57,9 +57,11 @@
|
|
|
57
57
|
background-color: inherit;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
//
|
|
60
|
+
// The first selector is required for old Cover markup/
|
|
61
|
+
// Keep .wp-block-cover__gradient-background for v8 deprecation.
|
|
61
62
|
&.has-background-dim:not(.has-background-gradient)::before,
|
|
62
63
|
.has-background-dim:not(.has-background-gradient)::before,
|
|
64
|
+
.wp-block-cover__background,
|
|
63
65
|
.wp-block-cover__gradient-background {
|
|
64
66
|
position: absolute;
|
|
65
67
|
top: 0;
|
|
@@ -70,8 +72,24 @@
|
|
|
70
72
|
opacity: 0.5;
|
|
71
73
|
}
|
|
72
74
|
|
|
75
|
+
// The following styles are needed to support legacy blocks added prior to the update
|
|
76
|
+
// that moved opacity to a nested span.
|
|
77
|
+
// https://github.com/WordPress/gutenberg/pull/35065
|
|
78
|
+
// https://github.com/WordPress/gutenberg/pull/38362
|
|
79
|
+
@for $i from 1 through 10 {
|
|
80
|
+
&.has-background-dim.has-background-dim-#{ $i * 10 } {
|
|
81
|
+
&:not(.has-background-gradient)::before,
|
|
82
|
+
.wp-block-cover__background,
|
|
83
|
+
.wp-block-cover__gradient-background {
|
|
84
|
+
opacity: $i * 0.1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
73
89
|
@for $i from 0 through 10 {
|
|
74
|
-
.wp-block-cover__gradient-background
|
|
90
|
+
// Keep .wp-block-cover__gradient-background for v8 deprecation
|
|
91
|
+
.wp-block-cover__gradient-background.has-background-dim.has-background-dim-#{ $i * 10 },
|
|
92
|
+
.wp-block-cover__background.has-background-dim.has-background-dim-#{ $i * 10 } {
|
|
75
93
|
opacity: $i * 0.1;
|
|
76
94
|
}
|
|
77
95
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`color settings clears the selected overlay color and mantains the inner blocks 1`] = `
|
|
4
4
|
"<!-- wp:cover -->
|
|
5
|
-
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"has-background-dim-100
|
|
5
|
+
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
|
|
6
6
|
<p class=\\"has-text-align-center\\"></p>
|
|
7
7
|
<!-- /wp:paragraph --></div></div>
|
|
8
8
|
<!-- /wp:cover -->"
|
|
@@ -10,7 +10,7 @@ exports[`color settings clears the selected overlay color and mantains the inner
|
|
|
10
10
|
|
|
11
11
|
exports[`color settings sets a color for the overlay background when the placeholder is visible 1`] = `
|
|
12
12
|
"<!-- wp:cover {\\"overlayColor\\":\\"vivid-red\\"} -->
|
|
13
|
-
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"has-vivid-red-background-color has-background-dim-100
|
|
13
|
+
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-vivid-red-background-color has-background-dim-100 has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
|
|
14
14
|
<p class=\\"has-text-align-center\\"></p>
|
|
15
15
|
<!-- /wp:paragraph --></div></div>
|
|
16
16
|
<!-- /wp:cover -->"
|
|
@@ -18,7 +18,7 @@ exports[`color settings sets a color for the overlay background when the placeho
|
|
|
18
18
|
|
|
19
19
|
exports[`color settings sets a gradient overlay background when a solid background was already selected 1`] = `
|
|
20
20
|
"<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\"} -->
|
|
21
|
-
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"
|
|
21
|
+
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
|
|
22
22
|
<p class=\\"has-text-align-center\\"></p>
|
|
23
23
|
<!-- /wp:paragraph --></div></div>
|
|
24
24
|
<!-- /wp:cover -->"
|
|
@@ -26,7 +26,7 @@ exports[`color settings sets a gradient overlay background when a solid backgrou
|
|
|
26
26
|
|
|
27
27
|
exports[`color settings toggles between solid colors and gradients 1`] = `
|
|
28
28
|
"<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\"} -->
|
|
29
|
-
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"
|
|
29
|
+
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
|
|
30
30
|
<p class=\\"has-text-align-center\\"></p>
|
|
31
31
|
<!-- /wp:paragraph --></div></div>
|
|
32
32
|
<!-- /wp:cover -->"
|
|
@@ -295,7 +295,7 @@ describe( 'when an image is attached', () => {
|
|
|
295
295
|
|
|
296
296
|
describe( 'color settings', () => {
|
|
297
297
|
it( 'sets a color for the overlay background when the placeholder is visible', async () => {
|
|
298
|
-
const { getByTestId, getByA11yLabel } = initializeEditor( {
|
|
298
|
+
const { getByTestId, getByA11yLabel } = await initializeEditor( {
|
|
299
299
|
initialHtml: COVER_BLOCK_PLACEHOLDER_HTML,
|
|
300
300
|
} );
|
|
301
301
|
|
|
@@ -350,7 +350,7 @@ describe( 'color settings', () => {
|
|
|
350
350
|
} );
|
|
351
351
|
|
|
352
352
|
it( 'sets a gradient overlay background when a solid background was already selected', async () => {
|
|
353
|
-
const { getByTestId, getByA11yLabel } = initializeEditor( {
|
|
353
|
+
const { getByTestId, getByA11yLabel } = await initializeEditor( {
|
|
354
354
|
initialHtml: COVER_BLOCK_SOLID_COLOR_HTML,
|
|
355
355
|
} );
|
|
356
356
|
|
|
@@ -407,7 +407,7 @@ describe( 'color settings', () => {
|
|
|
407
407
|
} );
|
|
408
408
|
|
|
409
409
|
it( 'toggles between solid colors and gradients', async () => {
|
|
410
|
-
const { getByTestId, getByA11yLabel } = initializeEditor( {
|
|
410
|
+
const { getByTestId, getByA11yLabel } = await initializeEditor( {
|
|
411
411
|
initialHtml: COVER_BLOCK_PLACEHOLDER_HTML,
|
|
412
412
|
} );
|
|
413
413
|
|
|
@@ -493,7 +493,11 @@ describe( 'color settings', () => {
|
|
|
493
493
|
} );
|
|
494
494
|
|
|
495
495
|
it( 'clears the selected overlay color and mantains the inner blocks', async () => {
|
|
496
|
-
const {
|
|
496
|
+
const {
|
|
497
|
+
getByTestId,
|
|
498
|
+
getByA11yLabel,
|
|
499
|
+
getByText,
|
|
500
|
+
} = await initializeEditor( {
|
|
497
501
|
initialHtml: COVER_BLOCK_SOLID_COLOR_HTML,
|
|
498
502
|
} );
|
|
499
503
|
|
|
@@ -142,7 +142,7 @@ const mockEmbedResponses = ( mockedResponses ) => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
const insertEmbedBlock = async ( blockTitle = 'Embed' ) => {
|
|
145
|
-
const editor = initializeEditor( {
|
|
145
|
+
const editor = await initializeEditor( {
|
|
146
146
|
initialHtml: '',
|
|
147
147
|
} );
|
|
148
148
|
const { getByA11yLabel, getByText } = editor;
|
|
@@ -162,7 +162,7 @@ const insertEmbedBlock = async ( blockTitle = 'Embed' ) => {
|
|
|
162
162
|
};
|
|
163
163
|
|
|
164
164
|
const initializeWithEmbedBlock = async ( initialHtml, selectBlock = true ) => {
|
|
165
|
-
const editor = initializeEditor( { initialHtml } );
|
|
165
|
+
const editor = await initializeEditor( { initialHtml } );
|
|
166
166
|
const { getByA11yLabel } = editor;
|
|
167
167
|
|
|
168
168
|
const block = await waitFor( () =>
|
|
@@ -871,7 +871,7 @@ describe( 'Embed block', () => {
|
|
|
871
871
|
getByPlaceholderText,
|
|
872
872
|
getByTestId,
|
|
873
873
|
getByText,
|
|
874
|
-
} = initializeEditor( {
|
|
874
|
+
} = await initializeEditor( {
|
|
875
875
|
initialHtml: EMPTY_PARAGRAPH_HTML,
|
|
876
876
|
} );
|
|
877
877
|
|
|
@@ -914,7 +914,7 @@ describe( 'Embed block', () => {
|
|
|
914
914
|
getByPlaceholderText,
|
|
915
915
|
getByTestId,
|
|
916
916
|
getByText,
|
|
917
|
-
} = initializeEditor( {
|
|
917
|
+
} = await initializeEditor( {
|
|
918
918
|
initialHtml: EMPTY_PARAGRAPH_HTML,
|
|
919
919
|
} );
|
|
920
920
|
|
|
@@ -959,7 +959,7 @@ describe( 'Embed block', () => {
|
|
|
959
959
|
getByPlaceholderText,
|
|
960
960
|
getByA11yLabel,
|
|
961
961
|
getByText,
|
|
962
|
-
} = initializeEditor( { initialHtml: EMPTY_PARAGRAPH_HTML } );
|
|
962
|
+
} = await initializeEditor( { initialHtml: EMPTY_PARAGRAPH_HTML } );
|
|
963
963
|
|
|
964
964
|
const paragraphText = getByPlaceholderText( 'Start writing…' );
|
|
965
965
|
fireEvent( paragraphText, 'focus' );
|
|
@@ -1001,7 +1001,7 @@ describe( 'Embed block', () => {
|
|
|
1001
1001
|
getByPlaceholderText,
|
|
1002
1002
|
getByA11yLabel,
|
|
1003
1003
|
getByText,
|
|
1004
|
-
} = initializeEditor( {
|
|
1004
|
+
} = await initializeEditor( {
|
|
1005
1005
|
initialHtml: EMPTY_PARAGRAPH_HTML,
|
|
1006
1006
|
} );
|
|
1007
1007
|
|
package/src/gallery/constants.js
CHANGED
package/src/gallery/edit.js
CHANGED
|
@@ -155,6 +155,14 @@ function GalleryEdit( props ) {
|
|
|
155
155
|
align: undefined,
|
|
156
156
|
} );
|
|
157
157
|
} );
|
|
158
|
+
|
|
159
|
+
// If new blocks added select the first of these so they scroll into view.
|
|
160
|
+
if ( newImages?.length ) {
|
|
161
|
+
multiSelect(
|
|
162
|
+
newImages[ 0 ].clientId,
|
|
163
|
+
newImages[ newImages?.length - 1 ].clientId
|
|
164
|
+
);
|
|
165
|
+
}
|
|
158
166
|
}, [ newImages ] );
|
|
159
167
|
|
|
160
168
|
const shortCodeImages = useShortCodeTransform( shortCodeTransforms );
|
|
@@ -296,14 +304,6 @@ function GalleryEdit( props ) {
|
|
|
296
304
|
newOrderMap[ b.attributes.id ]
|
|
297
305
|
)
|
|
298
306
|
);
|
|
299
|
-
|
|
300
|
-
// If new blocks added select the first of these so they scroll into view.
|
|
301
|
-
if ( newBlocks?.length && existingImageBlocks?.length ) {
|
|
302
|
-
multiSelect(
|
|
303
|
-
newBlocks[ 0 ].clientId,
|
|
304
|
-
newBlocks[ newBlocks.length - 1 ].clientId
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
function onUploadError( message ) {
|
|
@@ -429,11 +429,26 @@ function GalleryEdit( props ) {
|
|
|
429
429
|
( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0
|
|
430
430
|
);
|
|
431
431
|
|
|
432
|
+
// MediaPlaceholder props are different between web and native hence, we provide a platform-specific set.
|
|
433
|
+
const mediaPlaceholderProps = Platform.select( {
|
|
434
|
+
web: {
|
|
435
|
+
addToGallery: false,
|
|
436
|
+
disableMediaButtons: imagesUploading,
|
|
437
|
+
value: {},
|
|
438
|
+
},
|
|
439
|
+
native: {
|
|
440
|
+
addToGallery: hasImageIds,
|
|
441
|
+
isAppender: hasImages,
|
|
442
|
+
disableMediaButtons:
|
|
443
|
+
( hasImages && ! isSelected ) || imagesUploading,
|
|
444
|
+
value: hasImageIds ? images : {},
|
|
445
|
+
autoOpenMediaUpload:
|
|
446
|
+
! hasImages && isSelected && wasBlockJustInserted,
|
|
447
|
+
},
|
|
448
|
+
} );
|
|
432
449
|
const mediaPlaceholder = (
|
|
433
450
|
<MediaPlaceholder
|
|
434
|
-
addToGallery={ false }
|
|
435
451
|
handleUpload={ false }
|
|
436
|
-
disableMediaButtons={ imagesUploading }
|
|
437
452
|
icon={ sharedIcon }
|
|
438
453
|
labels={ {
|
|
439
454
|
title: __( 'Gallery' ),
|
|
@@ -443,10 +458,9 @@ function GalleryEdit( props ) {
|
|
|
443
458
|
accept="image/*"
|
|
444
459
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
445
460
|
multiple
|
|
446
|
-
value={ {} }
|
|
447
461
|
onError={ onUploadError }
|
|
448
462
|
notices={ noticeUI }
|
|
449
|
-
|
|
463
|
+
{ ...mediaPlaceholderProps }
|
|
450
464
|
/>
|
|
451
465
|
);
|
|
452
466
|
|
|
@@ -537,7 +551,11 @@ function GalleryEdit( props ) {
|
|
|
537
551
|
<Gallery
|
|
538
552
|
{ ...props }
|
|
539
553
|
images={ images }
|
|
540
|
-
mediaPlaceholder={
|
|
554
|
+
mediaPlaceholder={
|
|
555
|
+
! hasImages || Platform.isNative
|
|
556
|
+
? mediaPlaceholder
|
|
557
|
+
: undefined
|
|
558
|
+
}
|
|
541
559
|
blockProps={ blockProps }
|
|
542
560
|
insertBlocksAfter={ insertBlocksAfter }
|
|
543
561
|
/>
|
package/src/gallery/shared.js
CHANGED
|
@@ -31,7 +31,7 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
|
31
31
|
export function isGalleryV2Enabled() {
|
|
32
32
|
// Only run the Gallery version compat check if the plugin is running, otherwise
|
|
33
33
|
// assume we are in 5.9 core and enable by default.
|
|
34
|
-
if ( process.env.
|
|
34
|
+
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
35
35
|
// We want to fail early here, at least during beta testing phase, to ensure
|
|
36
36
|
// there aren't instances where undefined values cause false negatives.
|
|
37
37
|
if (
|
package/src/gallery/style.scss
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
margin-top: auto;
|
|
31
31
|
margin-bottom: auto;
|
|
32
32
|
flex-direction: column;
|
|
33
|
+
max-width: 100%;
|
|
33
34
|
|
|
34
35
|
> div,
|
|
35
36
|
> a {
|
|
@@ -41,7 +42,9 @@
|
|
|
41
42
|
img {
|
|
42
43
|
display: block;
|
|
43
44
|
height: auto;
|
|
44
|
-
max-width
|
|
45
|
+
// Ensure max-width is not overridden on the img when the parent gallery has
|
|
46
|
+
// wide or full alignment.
|
|
47
|
+
max-width: 100% !important;
|
|
45
48
|
width: auto;
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
getEditorHtml,
|
|
6
|
+
initializeEditor,
|
|
7
|
+
fireEvent,
|
|
8
|
+
waitFor,
|
|
9
|
+
within,
|
|
10
|
+
} from 'test/helpers';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
16
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
17
|
+
|
|
18
|
+
beforeAll( () => {
|
|
19
|
+
// Register all core blocks
|
|
20
|
+
registerCoreBlocks();
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
afterAll( () => {
|
|
24
|
+
// Clean up registered blocks
|
|
25
|
+
getBlockTypes().forEach( ( block ) => {
|
|
26
|
+
unregisterBlockType( block.name );
|
|
27
|
+
} );
|
|
28
|
+
} );
|
|
29
|
+
|
|
30
|
+
const GALLERY_WITH_ONE_IMAGE = `<!-- wp:gallery {"linkTo":"none"} -->
|
|
31
|
+
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"id":1} -->
|
|
32
|
+
<figure class="wp-block-image"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></figure>
|
|
33
|
+
<!-- /wp:image --></figure>
|
|
34
|
+
<!-- /wp:gallery -->`;
|
|
35
|
+
|
|
36
|
+
const addGalleryBlock = async () => {
|
|
37
|
+
const screen = await initializeEditor();
|
|
38
|
+
const { getByA11yLabel, getByTestId, getByText } = screen;
|
|
39
|
+
|
|
40
|
+
fireEvent.press( getByA11yLabel( 'Add block' ) );
|
|
41
|
+
|
|
42
|
+
const blockList = getByTestId( 'InserterUI-Blocks' );
|
|
43
|
+
// onScroll event used to force the FlatList to render all items
|
|
44
|
+
fireEvent.scroll( blockList, {
|
|
45
|
+
nativeEvent: {
|
|
46
|
+
contentOffset: { y: 0, x: 0 },
|
|
47
|
+
contentSize: { width: 100, height: 100 },
|
|
48
|
+
layoutMeasurement: { width: 100, height: 100 },
|
|
49
|
+
},
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
fireEvent.press( await waitFor( () => getByText( 'Gallery' ) ) );
|
|
53
|
+
|
|
54
|
+
return screen;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
describe( 'Gallery block', () => {
|
|
58
|
+
it( 'inserts block', async () => {
|
|
59
|
+
const { getByA11yLabel } = await addGalleryBlock();
|
|
60
|
+
|
|
61
|
+
const galleryBlock = await waitFor( () =>
|
|
62
|
+
getByA11yLabel( /Gallery Block\. Row 1/ )
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect( galleryBlock ).toHaveProperty( 'type', 'View' );
|
|
66
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
67
|
+
} );
|
|
68
|
+
|
|
69
|
+
it( 'selects a gallery item', async () => {
|
|
70
|
+
const { getByA11yLabel } = await initializeEditor( {
|
|
71
|
+
initialHtml: GALLERY_WITH_ONE_IMAGE,
|
|
72
|
+
} );
|
|
73
|
+
|
|
74
|
+
const galleryBlock = await waitFor( () =>
|
|
75
|
+
getByA11yLabel( /Gallery Block\. Row 1/ )
|
|
76
|
+
);
|
|
77
|
+
fireEvent.press( galleryBlock );
|
|
78
|
+
|
|
79
|
+
const innerBlockListWrapper = await waitFor( () =>
|
|
80
|
+
within( galleryBlock ).getByTestId( 'block-list-wrapper' )
|
|
81
|
+
);
|
|
82
|
+
fireEvent( innerBlockListWrapper, 'layout', {
|
|
83
|
+
nativeEvent: {
|
|
84
|
+
layout: {
|
|
85
|
+
width: 100,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
} );
|
|
89
|
+
|
|
90
|
+
const galleryItem = await waitFor( () =>
|
|
91
|
+
getByA11yLabel( /Image Block\. Row 1/ )
|
|
92
|
+
);
|
|
93
|
+
fireEvent.press( galleryItem );
|
|
94
|
+
|
|
95
|
+
expect( galleryItem ).toHaveProperty( 'type', 'View' );
|
|
96
|
+
} );
|
|
97
|
+
|
|
98
|
+
it( 'shows appender button when gallery has images', async () => {
|
|
99
|
+
const { getByA11yLabel, getByText } = await initializeEditor( {
|
|
100
|
+
initialHtml: GALLERY_WITH_ONE_IMAGE,
|
|
101
|
+
} );
|
|
102
|
+
|
|
103
|
+
const galleryBlock = await waitFor( () =>
|
|
104
|
+
getByA11yLabel( /Gallery Block\. Row 1/ )
|
|
105
|
+
);
|
|
106
|
+
fireEvent.press( galleryBlock );
|
|
107
|
+
|
|
108
|
+
const innerBlockListWrapper = await waitFor( () =>
|
|
109
|
+
within( galleryBlock ).getByTestId( 'block-list-wrapper' )
|
|
110
|
+
);
|
|
111
|
+
fireEvent( innerBlockListWrapper, 'layout', {
|
|
112
|
+
nativeEvent: {
|
|
113
|
+
layout: {
|
|
114
|
+
width: 100,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
} );
|
|
118
|
+
|
|
119
|
+
const appenderButton = await waitFor( () =>
|
|
120
|
+
within( galleryBlock ).getByA11yLabel( /Gallery block\. Empty/ )
|
|
121
|
+
);
|
|
122
|
+
fireEvent.press( appenderButton );
|
|
123
|
+
|
|
124
|
+
expect( getByText( 'Choose from device' ) ).toBeDefined();
|
|
125
|
+
expect( getByText( 'Take a Photo' ) ).toBeDefined();
|
|
126
|
+
expect( getByText( 'WordPress Media Library' ) ).toBeDefined();
|
|
127
|
+
} );
|
|
128
|
+
} );
|
|
@@ -291,7 +291,10 @@ const transforms = {
|
|
|
291
291
|
url,
|
|
292
292
|
alt,
|
|
293
293
|
caption,
|
|
294
|
-
imageSizeSlug,
|
|
294
|
+
sizeSlug: imageSizeSlug,
|
|
295
|
+
linkDestination,
|
|
296
|
+
href,
|
|
297
|
+
linkTarget,
|
|
295
298
|
},
|
|
296
299
|
} ) =>
|
|
297
300
|
createBlock( 'core/image', {
|
|
@@ -301,6 +304,9 @@ const transforms = {
|
|
|
301
304
|
caption,
|
|
302
305
|
sizeSlug: imageSizeSlug,
|
|
303
306
|
align,
|
|
307
|
+
linkDestination,
|
|
308
|
+
href,
|
|
309
|
+
linkTarget,
|
|
304
310
|
} )
|
|
305
311
|
);
|
|
306
312
|
}
|
package/src/gallery/utils.js
CHANGED
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
LINK_DESTINATION_ATTACHMENT,
|
|
6
6
|
LINK_DESTINATION_MEDIA,
|
|
7
7
|
LINK_DESTINATION_NONE,
|
|
8
|
+
LINK_DESTINATION_MEDIA_WP_CORE,
|
|
9
|
+
LINK_DESTINATION_ATTACHMENT_WP_CORE,
|
|
8
10
|
} from './constants';
|
|
9
11
|
import {
|
|
10
12
|
LINK_DESTINATION_ATTACHMENT as IMAGE_LINK_DESTINATION_ATTACHMENT,
|
|
@@ -21,15 +23,17 @@ import {
|
|
|
21
23
|
* @return {Object} New attributes to assign to image block.
|
|
22
24
|
*/
|
|
23
25
|
export function getHrefAndDestination( image, destination ) {
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
|
|
26
|
+
// Gutenberg and WordPress use different constants so if image_default_link_type
|
|
27
|
+
// option is set we need to map from the WP Core values.
|
|
28
|
+
|
|
27
29
|
switch ( destination ) {
|
|
30
|
+
case LINK_DESTINATION_MEDIA_WP_CORE:
|
|
28
31
|
case LINK_DESTINATION_MEDIA:
|
|
29
32
|
return {
|
|
30
33
|
href: image?.source_url || image?.url, // eslint-disable-line camelcase
|
|
31
34
|
linkDestination: IMAGE_LINK_DESTINATION_MEDIA,
|
|
32
35
|
};
|
|
36
|
+
case LINK_DESTINATION_ATTACHMENT_WP_CORE:
|
|
33
37
|
case LINK_DESTINATION_ATTACHMENT:
|
|
34
38
|
return {
|
|
35
39
|
href: image?.link,
|
package/src/group/block.json
CHANGED
package/src/group/variations.js
CHANGED
|
@@ -4,12 +4,22 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
const variations = [
|
|
7
|
+
{
|
|
8
|
+
name: 'group',
|
|
9
|
+
title: __( 'Group' ),
|
|
10
|
+
description: __( 'Blocks shown in a column.' ),
|
|
11
|
+
attributes: { layout: { type: 'default' } },
|
|
12
|
+
scope: [ 'transform' ],
|
|
13
|
+
isActive: ( blockAttributes ) =>
|
|
14
|
+
! blockAttributes.layout ||
|
|
15
|
+
blockAttributes.layout?.type === 'default',
|
|
16
|
+
},
|
|
7
17
|
{
|
|
8
18
|
name: 'group-row',
|
|
9
19
|
title: __( 'Row' ),
|
|
10
20
|
description: __( 'Blocks shown in a row.' ),
|
|
11
21
|
attributes: { layout: { type: 'flex', allowOrientation: false } },
|
|
12
|
-
scope: [ 'inserter' ],
|
|
22
|
+
scope: [ 'inserter', 'transform' ],
|
|
13
23
|
isActive: ( blockAttributes ) =>
|
|
14
24
|
blockAttributes.layout?.type === 'flex',
|
|
15
25
|
},
|
package/src/heading/block.json
CHANGED
|
@@ -84,11 +84,8 @@ const transforms = {
|
|
|
84
84
|
isMultiBlock: true,
|
|
85
85
|
blocks: [ 'core/paragraph' ],
|
|
86
86
|
transform: ( attributes ) =>
|
|
87
|
-
attributes.map( ( { content
|
|
88
|
-
createBlock( 'core/paragraph', {
|
|
89
|
-
content,
|
|
90
|
-
anchor,
|
|
91
|
-
} )
|
|
87
|
+
attributes.map( ( { content } ) =>
|
|
88
|
+
createBlock( 'core/paragraph', { content } )
|
|
92
89
|
),
|
|
93
90
|
},
|
|
94
91
|
],
|