@wordpress/block-library 7.1.0 → 7.3.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 +13 -0
- package/README.md +1 -1
- package/build/archives/edit.js +21 -1
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +5 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/edit.native.js +0 -5
- package/build/audio/edit.native.js.map +1 -1
- package/build/avatar/edit.js +211 -0
- package/build/avatar/edit.js.map +1 -0
- package/build/avatar/hooks.js +111 -0
- package/build/avatar/hooks.js.map +1 -0
- package/build/avatar/index.js +83 -0
- package/build/avatar/index.js.map +1 -0
- package/build/avatar/user-control.js +63 -0
- package/build/avatar/user-control.js.map +1 -0
- package/build/block/edit.js +2 -1
- package/build/block/edit.js.map +1 -1
- package/build/column/index.js +3 -1
- package/build/column/index.js.map +1 -1
- package/build/comment-author-avatar/index.js +4 -3
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/index.js +7 -3
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +1 -1
- package/build/comment-date/edit.js +10 -25
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +7 -3
- 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 +86 -66
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/hooks.js +7 -23
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comment-template/index.js +2 -2
- package/build/comments-pagination-next/index.js +2 -2
- package/build/comments-pagination-numbers/index.js +1 -1
- package/build/comments-pagination-previous/index.js +1 -1
- package/build/comments-query-loop/edit/comments-inspector-controls.js +2 -69
- package/build/comments-query-loop/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-query-loop/edit.js +22 -1
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-query-loop/index.js +1 -23
- package/build/comments-query-loop/index.js.map +1 -1
- package/build/cover/edit.js +58 -39
- package/build/cover/edit.js.map +1 -1
- package/build/cover/index.js +5 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +3 -2
- package/build/cover/save.js.map +1 -1
- package/build/embed/variations.js +2 -2
- package/build/embed/variations.js.map +1 -1
- package/build/gallery/edit.js +18 -5
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/gap-styles.js +35 -0
- package/build/gallery/gap-styles.js.map +1 -0
- package/build/gallery/index.js +18 -1
- package/build/gallery/index.js.map +1 -1
- package/build/group/edit.js +3 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +1 -1
- package/build/group/variations.js +30 -9
- package/build/group/variations.js.map +1 -1
- package/build/heading/edit.js +1 -1
- package/build/heading/edit.js.map +1 -1
- package/build/html/edit.js +3 -2
- package/build/html/edit.js.map +1 -1
- package/build/image/edit.native.js +8 -10
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +3 -1
- package/build/image/image.js.map +1 -1
- package/build/index.js +10 -4
- package/build/index.js.map +1 -1
- package/build/list/deprecated.js +2 -2
- package/build/list/deprecated.js.map +1 -1
- package/build/list/index.js +5 -7
- package/build/list/index.js.map +1 -1
- package/build/list/v2/deprecated.js +117 -0
- package/build/list/v2/deprecated.js.map +1 -0
- package/build/list/v2/edit.js +188 -0
- package/build/list/v2/edit.js.map +1 -0
- package/build/list/v2/index.js +36 -0
- package/build/list/v2/index.js.map +1 -0
- package/build/list/v2/migrate.js +85 -0
- package/build/list/v2/migrate.js.map +1 -0
- package/build/list/v2/save.js +34 -0
- package/build/list/v2/save.js.map +1 -0
- package/build/list/v2/transforms.js +121 -0
- package/build/list/v2/transforms.js.map +1 -0
- package/build/list-item/edit.js +96 -0
- package/build/list-item/edit.js.map +1 -0
- package/build/list-item/hooks/index.js +32 -0
- package/build/list-item/hooks/index.js.map +1 -0
- package/build/list-item/hooks/use-enter.js +93 -0
- package/build/list-item/hooks/use-enter.js.map +1 -0
- package/build/list-item/hooks/use-indent-list-item.js +74 -0
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js +77 -0
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -0
- package/build/list-item/index.js +67 -0
- package/build/list-item/index.js.map +1 -0
- package/build/list-item/save.js +23 -0
- package/build/list-item/save.js.map +1 -0
- package/build/list-item/utils.js +16 -0
- package/build/list-item/utils.js.map +1 -0
- package/build/media-text/edit.js +3 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/media-container.native.js +1 -16
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js +36 -17
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +34 -7
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +9 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-entities.js +26 -54
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +1 -0
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +95 -37
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-submenu/edit.js +5 -9
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +1 -1
- package/build/post-comment/edit.js +2 -2
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +3 -2
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-date/edit.js +31 -37
- package/build/post-date/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +2 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -1
- package/build/post-template/edit.js +7 -2
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +3 -1
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/variations.js +1 -1
- package/build/post-terms/variations.js.map +1 -1
- package/build/pullquote/edit.js +5 -3
- package/build/pullquote/edit.js.map +1 -1
- package/build/query/variations.js +4 -4
- package/build/query/variations.js.map +1 -1
- package/build/query-no-results/edit.js +28 -0
- package/build/query-no-results/edit.js.map +1 -0
- package/build/query-no-results/index.js +54 -0
- package/build/query-no-results/index.js.map +1 -0
- package/build/query-no-results/save.js +18 -0
- package/build/query-no-results/save.js.map +1 -0
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination-numbers/index.js +19 -1
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/quote/index.js +15 -8
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/deprecated.js +133 -0
- package/build/quote/v2/deprecated.js.map +1 -0
- package/build/quote/v2/edit.js +131 -0
- package/build/quote/v2/edit.js.map +1 -0
- package/build/quote/v2/index.js +49 -0
- package/build/quote/v2/index.js.map +1 -0
- package/build/quote/v2/save.js +43 -0
- package/build/quote/v2/save.js.map +1 -0
- package/build/quote/v2/transforms.js +156 -0
- package/build/quote/v2/transforms.js.map +1 -0
- package/build/read-more/index.js +1 -1
- package/build/rss/edit.js +6 -1
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +2 -3
- package/build/search/edit.js.map +1 -1
- package/build/separator/deprecated.js +83 -0
- package/build/separator/deprecated.js.map +1 -0
- package/build/separator/edit.js +31 -23
- package/build/separator/edit.js.map +1 -1
- package/build/separator/index.js +17 -7
- package/build/separator/index.js.map +1 -1
- package/build/separator/save.js +18 -13
- package/build/separator/save.js.map +1 -1
- package/build/separator/use-deprecated-opacity.js +39 -0
- package/build/separator/use-deprecated-opacity.js.map +1 -0
- package/build/site-logo/edit.js +3 -2
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -1
- package/build/social-links/edit.js +14 -3
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +2 -1
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/controls.js +6 -16
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +3 -1
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.js +4 -5
- package/build/spacer/edit.js.map +1 -1
- package/build/table/deprecated.js +1 -1
- package/build/table/deprecated.js.map +1 -1
- package/build/tag-cloud/edit.js +58 -2
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +8 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +5 -2
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/archives/edit.js +22 -2
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +5 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/edit.native.js +0 -5
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/avatar/edit.js +195 -0
- package/build-module/avatar/edit.js.map +1 -0
- package/build-module/avatar/hooks.js +99 -0
- package/build-module/avatar/hooks.js.map +1 -0
- package/build-module/avatar/index.js +70 -0
- package/build-module/avatar/index.js.map +1 -0
- package/build-module/avatar/user-control.js +52 -0
- package/build-module/avatar/user-control.js.map +1 -0
- package/build-module/block/edit.js +4 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/column/index.js +3 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +4 -3
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +7 -3
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +1 -1
- package/build-module/comment-date/edit.js +13 -30
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +7 -3
- 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 +86 -66
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/hooks.js +7 -23
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comment-template/index.js +2 -2
- package/build-module/comments-pagination-next/index.js +2 -2
- package/build-module/comments-pagination-numbers/index.js +1 -1
- package/build-module/comments-pagination-previous/index.js +1 -1
- package/build-module/comments-query-loop/edit/comments-inspector-controls.js +4 -70
- package/build-module/comments-query-loop/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-query-loop/edit.js +22 -1
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-query-loop/index.js +1 -23
- package/build-module/comments-query-loop/index.js.map +1 -1
- package/build-module/cover/edit.js +58 -41
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/index.js +5 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +3 -2
- package/build-module/cover/save.js.map +1 -1
- package/build-module/embed/variations.js +2 -2
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/gallery/edit.js +17 -5
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +1 -1
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/gap-styles.js +28 -0
- package/build-module/gallery/gap-styles.js.map +1 -0
- package/build-module/gallery/index.js +18 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/edit.js +3 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +1 -1
- package/build-module/group/variations.js +29 -9
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/edit.js +1 -1
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/html/edit.js +4 -3
- package/build-module/html/edit.js.map +1 -1
- package/build-module/image/edit.native.js +8 -10
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +3 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +7 -4
- package/build-module/index.js.map +1 -1
- package/build-module/list/deprecated.js +2 -2
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/index.js +5 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/v2/deprecated.js +104 -0
- package/build-module/list/v2/deprecated.js.map +1 -0
- package/build-module/list/v2/edit.js +168 -0
- package/build-module/list/v2/edit.js.map +1 -0
- package/build-module/list/v2/index.js +21 -0
- package/build-module/list/v2/index.js.map +1 -0
- package/build-module/list/v2/migrate.js +77 -0
- package/build-module/list/v2/migrate.js.map +1 -0
- package/build-module/list/v2/save.js +23 -0
- package/build-module/list/v2/save.js.map +1 -0
- package/build-module/list/v2/transforms.js +111 -0
- package/build-module/list/v2/transforms.js.map +1 -0
- package/build-module/list-item/edit.js +83 -0
- package/build-module/list-item/edit.js.map +1 -0
- package/build-module/list-item/hooks/index.js +4 -0
- package/build-module/list-item/hooks/index.js.map +1 -0
- package/build-module/list-item/hooks/use-enter.js +77 -0
- package/build-module/list-item/hooks/use-enter.js.map +1 -0
- package/build-module/list-item/hooks/use-indent-list-item.js +62 -0
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js +66 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -0
- package/build-module/list-item/index.js +53 -0
- package/build-module/list-item/index.js.map +1 -0
- package/build-module/list-item/save.js +15 -0
- package/build-module/list-item/save.js.map +1 -0
- package/build-module/list-item/utils.js +8 -0
- package/build-module/list-item/utils.js.map +1 -0
- package/build-module/media-text/edit.js +3 -1
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -14
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +37 -17
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +35 -8
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +9 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-entities.js +27 -54
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +1 -0
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +95 -36
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-submenu/edit.js +6 -10
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +1 -1
- package/build-module/post-comment/edit.js +2 -2
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +3 -2
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-date/edit.js +32 -43
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +2 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -1
- package/build-module/post-template/edit.js +7 -2
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +4 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/variations.js +3 -3
- package/build-module/post-terms/variations.js.map +1 -1
- package/build-module/pullquote/edit.js +6 -3
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/query/variations.js +4 -4
- package/build-module/query/variations.js.map +1 -1
- package/build-module/query-no-results/edit.js +18 -0
- package/build-module/query-no-results/edit.js.map +1 -0
- package/build-module/query-no-results/index.js +40 -0
- package/build-module/query-no-results/index.js.map +1 -0
- package/build-module/query-no-results/save.js +10 -0
- package/build-module/query-no-results/save.js.map +1 -0
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +19 -1
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/quote/index.js +13 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/deprecated.js +116 -0
- package/build-module/quote/v2/deprecated.js.map +1 -0
- package/build-module/quote/v2/edit.js +115 -0
- package/build-module/quote/v2/edit.js.map +1 -0
- package/build-module/quote/v2/index.js +33 -0
- package/build-module/quote/v2/index.js.map +1 -0
- package/build-module/quote/v2/save.js +30 -0
- package/build-module/quote/v2/save.js.map +1 -0
- package/build-module/quote/v2/transforms.js +147 -0
- package/build-module/quote/v2/transforms.js.map +1 -0
- package/build-module/read-more/index.js +1 -1
- package/build-module/rss/edit.js +5 -1
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +2 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/deprecated.js +70 -0
- package/build-module/separator/deprecated.js.map +1 -0
- package/build-module/separator/edit.js +31 -22
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/separator/index.js +16 -7
- package/build-module/separator/index.js.map +1 -1
- package/build-module/separator/save.js +19 -14
- package/build-module/separator/save.js.map +1 -1
- package/build-module/separator/use-deprecated-opacity.js +30 -0
- package/build-module/separator/use-deprecated-opacity.js.map +1 -0
- package/build-module/site-logo/edit.js +3 -2
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -1
- package/build-module/social-links/edit.js +15 -4
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +2 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/controls.js +8 -19
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +2 -1
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.js +3 -3
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table/deprecated.js +1 -1
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/tag-cloud/edit.js +60 -4
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +8 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +5 -2
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-style/avatar/editor-rtl.css +83 -0
- package/build-style/avatar/editor.css +83 -0
- package/build-style/avatar/style-rtl.css +79 -0
- package/build-style/avatar/style.css +79 -0
- package/build-style/editor-rtl.css +53 -11
- package/build-style/editor.css +53 -11
- package/build-style/gallery/editor-rtl.css +0 -1
- package/build-style/gallery/editor.css +0 -1
- package/build-style/gallery/style-rtl.css +102 -169
- package/build-style/gallery/style.css +102 -169
- package/build-style/group/editor-rtl.css +26 -0
- package/build-style/group/editor.css +26 -0
- package/build-style/heading/style-rtl.css +0 -8
- package/build-style/heading/style.css +0 -8
- package/build-style/image/style-rtl.css +2 -0
- package/build-style/image/style.css +2 -0
- package/build-style/list/style-rtl.css +1 -1
- package/build-style/list/style.css +1 -1
- package/build-style/navigation/style-rtl.css +11 -9
- package/build-style/navigation/style.css +11 -9
- package/build-style/navigation-link/editor-rtl.css +13 -0
- package/build-style/navigation-link/editor.css +13 -0
- package/build-style/navigation-link/style-rtl.css +3 -0
- package/build-style/navigation-link/style.css +3 -0
- package/build-style/paragraph/style-rtl.css +0 -4
- package/build-style/paragraph/style.css +0 -4
- package/build-style/pullquote/style-rtl.css +0 -4
- package/build-style/pullquote/style.css +0 -4
- package/build-style/quote/style-rtl.css +1 -0
- package/build-style/quote/style.css +1 -0
- package/build-style/reset-rtl.css +1 -1
- package/build-style/reset.css +1 -1
- package/build-style/separator/editor-rtl.css +3 -0
- package/build-style/separator/editor.css +3 -0
- package/build-style/separator/theme-rtl.css +7 -1
- package/build-style/separator/theme.css +7 -1
- package/build-style/site-logo/editor-rtl.css +3 -1
- package/build-style/site-logo/editor.css +3 -1
- package/build-style/style-rtl.css +124 -195
- package/build-style/style.css +124 -195
- package/build-style/template-part/editor-rtl.css +0 -9
- package/build-style/template-part/editor.css +0 -9
- package/build-style/theme-rtl.css +7 -1
- package/build-style/theme.css +7 -1
- package/package.json +28 -28
- package/src/archives/block.json +5 -1
- package/src/archives/edit.js +20 -2
- package/src/archives/index.php +4 -4
- package/src/audio/edit.native.js +0 -5
- package/src/avatar/block.json +53 -0
- package/src/avatar/edit.js +230 -0
- package/src/avatar/editor.scss +9 -0
- package/src/avatar/hooks.js +96 -0
- package/src/avatar/index.js +18 -0
- package/src/avatar/index.php +146 -0
- package/src/avatar/style.scss +5 -0
- package/src/avatar/user-control.js +56 -0
- package/src/block/edit.js +21 -11
- package/src/column/block.json +3 -1
- package/src/comment-author-avatar/block.json +4 -3
- package/src/comment-author-name/block.json +7 -3
- package/src/comment-author-name/index.php +3 -0
- package/src/comment-content/block.json +1 -1
- package/src/comment-date/block.json +7 -3
- package/src/comment-date/edit.js +20 -30
- package/src/comment-date/index.php +6 -1
- package/src/comment-edit-link/block.json +5 -1
- package/src/comment-edit-link/index.php +3 -0
- package/src/comment-reply-link/block.json +5 -1
- package/src/comment-reply-link/index.php +4 -1
- package/src/comment-template/block.json +2 -8
- package/src/comment-template/edit.js +77 -64
- package/src/comment-template/hooks.js +8 -24
- package/src/comment-template/index.php +1 -3
- package/src/comments-pagination-next/block.json +2 -9
- package/src/comments-pagination-numbers/block.json +2 -8
- package/src/comments-pagination-previous/block.json +2 -2
- package/src/comments-query-loop/block.json +1 -23
- package/src/comments-query-loop/edit/comments-inspector-controls.js +2 -83
- package/src/comments-query-loop/edit.js +54 -1
- package/src/cover/block.json +5 -0
- package/src/cover/edit.js +103 -60
- package/src/cover/index.php +85 -0
- package/src/cover/save.js +18 -14
- package/src/editor.scss +1 -0
- package/src/embed/variations.js +2 -2
- package/src/gallery/block.json +18 -1
- package/src/gallery/deprecated.scss +2 -2
- package/src/gallery/edit.js +15 -8
- package/src/gallery/editor.scss +0 -1
- package/src/gallery/gallery.js +8 -7
- package/src/gallery/gap-styles.js +26 -0
- package/src/gallery/index.php +43 -1
- package/src/gallery/style.scss +11 -44
- package/src/group/block.json +1 -1
- package/src/group/edit.js +4 -1
- package/src/group/editor.scss +31 -0
- package/src/group/variations.js +21 -4
- package/src/heading/edit.js +1 -1
- package/src/heading/style.scss +0 -3
- package/src/html/edit.js +22 -30
- package/src/image/edit.native.js +7 -11
- package/src/image/image.js +4 -1
- package/src/image/style.scss +3 -0
- package/src/index.js +19 -14
- package/src/list/deprecated.js +2 -2
- package/src/list/index.js +6 -1
- package/src/list/style.scss +1 -2
- package/src/list/test/migrate.js +159 -0
- package/src/list/v2/deprecated.js +89 -0
- package/src/list/v2/edit.js +186 -0
- package/src/list/v2/index.js +22 -0
- package/src/list/v2/migrate.js +87 -0
- package/src/list/v2/save.js +18 -0
- package/src/list/v2/transforms.js +116 -0
- package/src/list-item/block.json +26 -0
- package/src/list-item/edit.js +93 -0
- package/src/list-item/hooks/index.js +3 -0
- package/src/list-item/hooks/use-enter.js +94 -0
- package/src/list-item/hooks/use-indent-list-item.js +89 -0
- package/src/list-item/hooks/use-outdent-list-item.js +95 -0
- package/src/list-item/index.js +27 -0
- package/src/list-item/save.js +13 -0
- package/src/list-item/utils.js +14 -0
- package/src/media-text/edit.js +1 -1
- package/src/media-text/media-container.native.js +1 -14
- package/src/navigation/block.json +9 -1
- package/src/navigation/edit/index.js +50 -14
- package/src/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/src/navigation/edit/unsaved-inner-blocks.js +57 -8
- package/src/navigation/index.php +28 -3
- package/src/navigation/style.scss +15 -13
- package/src/navigation/use-navigation-entities.js +37 -73
- package/src/navigation/use-navigation-menu.js +4 -0
- package/src/navigation-link/block.json +1 -0
- package/src/navigation-link/edit.js +156 -64
- package/src/navigation-link/editor.scss +11 -0
- package/src/navigation-link/index.php +8 -0
- package/src/navigation-link/style.scss +6 -0
- package/src/navigation-submenu/block.json +1 -0
- package/src/navigation-submenu/edit.js +7 -9
- package/src/paragraph/style.scss +0 -5
- package/src/post-author/index.php +0 -1
- package/src/post-comment/edit.js +2 -2
- package/src/post-comments-form/edit.js +6 -3
- package/src/post-date/edit.js +63 -52
- package/src/post-date/index.php +1 -1
- package/src/post-date/test/edit.js +17 -0
- package/src/post-featured-image/block.json +1 -1
- package/src/post-featured-image/edit.js +9 -1
- package/src/post-featured-image/index.php +2 -1
- package/src/post-template/edit.js +7 -1
- package/src/post-terms/edit.js +4 -1
- package/src/post-terms/variations.js +3 -3
- package/src/pullquote/edit.js +4 -3
- package/src/pullquote/style.scss +0 -5
- package/src/query/variations.js +4 -0
- package/src/query-no-results/block.json +20 -0
- package/src/query-no-results/edit.js +28 -0
- package/src/query-no-results/index.js +20 -0
- package/src/query-no-results/index.php +59 -0
- package/src/query-no-results/save.js +8 -0
- package/src/query-pagination/edit.js +1 -1
- package/src/query-pagination/index.php +9 -2
- package/src/query-pagination-numbers/block.json +19 -1
- package/src/quote/block.json +8 -0
- package/src/quote/index.js +6 -1
- package/src/quote/style.scss +1 -0
- package/src/quote/v2/deprecated.js +107 -0
- package/src/quote/v2/edit.js +136 -0
- package/src/quote/v2/index.js +36 -0
- package/src/quote/v2/save.js +26 -0
- package/src/quote/v2/test/migrate.js +92 -0
- package/src/quote/v2/transforms.js +155 -0
- package/src/read-more/block.json +1 -1
- package/src/reset.scss +1 -1
- package/src/rss/edit.js +3 -1
- package/src/rss/index.php +14 -1
- package/src/search/edit.js +1 -2
- package/src/separator/block.json +13 -6
- package/src/separator/deprecated.js +57 -0
- package/src/separator/deprecated.scss +6 -0
- package/src/separator/edit.js +36 -14
- package/src/separator/editor.scss +6 -0
- package/src/separator/index.js +2 -0
- package/src/separator/save.js +22 -14
- package/src/separator/test/edit.js +113 -0
- package/src/separator/theme.scss +7 -1
- package/src/separator/use-deprecated-opacity.js +41 -0
- package/src/site-logo/block.json +1 -1
- package/src/site-logo/edit.js +2 -1
- package/src/site-logo/editor.scss +3 -1
- package/src/site-logo/index.php +0 -4
- package/src/social-link/index.php +1 -2
- package/src/social-links/block.json +2 -1
- package/src/social-links/edit.js +15 -5
- package/src/spacer/controls.js +12 -18
- package/src/spacer/controls.native.js +2 -1
- package/src/spacer/edit.js +3 -6
- package/src/spacer/test/__snapshots__/index.native.js.snap +31 -0
- package/src/spacer/test/index.native.js +180 -0
- package/src/style.scss +1 -0
- package/src/table/deprecated.js +5 -1
- package/src/tag-cloud/block.json +8 -0
- package/src/tag-cloud/edit.js +82 -2
- package/src/tag-cloud/index.php +6 -0
- package/src/template-part/edit/utils/hooks.js +6 -1
- package/src/template-part/editor.scss +0 -10
- package/build/navigation/edit/use-list-view-modal.js +0 -73
- package/build/navigation/edit/use-list-view-modal.js.map +0 -1
- package/build/separator/separator-settings.js +0 -36
- package/build/separator/separator-settings.js.map +0 -1
- package/build-module/navigation/edit/use-list-view-modal.js +0 -63
- package/build-module/navigation/edit/use-list-view-modal.js.map +0 -1
- package/build-module/separator/separator-settings.js +0 -27
- package/build-module/separator/separator-settings.js.map +0 -1
- package/src/navigation/edit/use-list-view-modal.js +0 -72
- package/src/separator/separator-settings.js +0 -24
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
.wp-block[data-align="center"] > .wp-block-site-logo
|
|
1
|
+
.wp-block[data-align="center"] > .wp-block-site-logo,
|
|
2
|
+
.wp-block-site-logo.aligncenter > div {
|
|
2
3
|
display: table;
|
|
3
4
|
margin-left: auto;
|
|
4
5
|
margin-right: auto;
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
|
|
46
47
|
// Style the placeholder.
|
|
47
48
|
.components-placeholder {
|
|
49
|
+
display: flex;
|
|
48
50
|
justify-content: center;
|
|
49
51
|
align-items: center;
|
|
50
52
|
box-shadow: none;
|
package/src/site-logo/index.php
CHANGED
|
@@ -44,10 +44,6 @@ function render_block_core_site_logo( $attributes ) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
$classnames = array();
|
|
47
|
-
if ( ! empty( $attributes['className'] ) ) {
|
|
48
|
-
$classnames[] = $attributes['className'];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
47
|
if ( empty( $attributes['width'] ) ) {
|
|
52
48
|
$classnames[] = 'is-default-size';
|
|
53
49
|
}
|
|
@@ -21,7 +21,6 @@ function render_block_core_social_link( $attributes, $content, $block ) {
|
|
|
21
21
|
$url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
|
|
22
22
|
$label = ( isset( $attributes['label'] ) ) ? $attributes['label'] : block_core_social_link_get_name( $service );
|
|
23
23
|
$show_labels = array_key_exists( 'showLabels', $block->context ) ? $block->context['showLabels'] : false;
|
|
24
|
-
$class_name = isset( $attributes['className'] ) ? ' ' . $attributes['className'] : false;
|
|
25
24
|
|
|
26
25
|
// Don't render a link if there is no URL set.
|
|
27
26
|
if ( ! $url ) {
|
|
@@ -36,7 +35,7 @@ function render_block_core_social_link( $attributes, $content, $block ) {
|
|
|
36
35
|
$icon = block_core_social_link_get_icon( $service );
|
|
37
36
|
$wrapper_attributes = get_block_wrapper_attributes(
|
|
38
37
|
array(
|
|
39
|
-
'class' => 'wp-social-link wp-social-link-' . $service
|
|
38
|
+
'class' => 'wp-social-link wp-social-link-' . $service,
|
|
40
39
|
'style' => block_core_social_link_get_color_styles( $block->context ),
|
|
41
40
|
)
|
|
42
41
|
);
|
|
@@ -51,12 +51,13 @@
|
|
|
51
51
|
"__experimentalLayout": {
|
|
52
52
|
"allowSwitching": false,
|
|
53
53
|
"allowInheriting": false,
|
|
54
|
+
"allowVerticalAlignment": false,
|
|
54
55
|
"default": {
|
|
55
56
|
"type": "flex"
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
59
|
"spacing": {
|
|
59
|
-
"blockGap":
|
|
60
|
+
"blockGap": [ "horizontal", "vertical" ],
|
|
60
61
|
"margin": [ "top", "bottom" ],
|
|
61
62
|
"units": [ "px", "em", "rem", "vh", "vw" ],
|
|
62
63
|
"__experimentalDefaultControls": {
|
package/src/social-links/edit.js
CHANGED
|
@@ -7,7 +7,7 @@ import classNames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
10
|
-
import { Fragment, useEffect } from '@wordpress/element';
|
|
10
|
+
import { Fragment, useEffect, useRef } from '@wordpress/element';
|
|
11
11
|
import {
|
|
12
12
|
BlockControls,
|
|
13
13
|
useInnerBlocksProps,
|
|
@@ -58,6 +58,7 @@ export function SocialLinksEdit( props ) {
|
|
|
58
58
|
|
|
59
59
|
const {
|
|
60
60
|
iconBackgroundColorValue,
|
|
61
|
+
customIconBackgroundColor,
|
|
61
62
|
iconColorValue,
|
|
62
63
|
openInNewTab,
|
|
63
64
|
showLabels,
|
|
@@ -66,18 +67,27 @@ export function SocialLinksEdit( props ) {
|
|
|
66
67
|
} = attributes;
|
|
67
68
|
const usedLayout = layout || getDefaultBlockLayout( name );
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const logosOnly = attributes.className?.includes( 'is-style-logos-only' );
|
|
71
|
+
|
|
72
|
+
// Remove icon background color when logos only style is selected or
|
|
73
|
+
// restore it when any other style is selected.
|
|
74
|
+
const backgroundBackup = useRef( {} );
|
|
72
75
|
useEffect( () => {
|
|
73
76
|
if ( logosOnly ) {
|
|
77
|
+
backgroundBackup.current = {
|
|
78
|
+
iconBackgroundColor,
|
|
79
|
+
iconBackgroundColorValue,
|
|
80
|
+
customIconBackgroundColor,
|
|
81
|
+
};
|
|
74
82
|
setAttributes( {
|
|
75
83
|
iconBackgroundColor: undefined,
|
|
76
84
|
customIconBackgroundColor: undefined,
|
|
77
85
|
iconBackgroundColorValue: undefined,
|
|
78
86
|
} );
|
|
87
|
+
} else {
|
|
88
|
+
setAttributes( { ...backgroundBackup.current } );
|
|
79
89
|
}
|
|
80
|
-
}, [ logosOnly
|
|
90
|
+
}, [ logosOnly ] );
|
|
81
91
|
|
|
82
92
|
const SocialPlaceholder = (
|
|
83
93
|
<li className="wp-block-social-links__social-placeholder">
|
package/src/spacer/controls.js
CHANGED
|
@@ -8,18 +8,16 @@ import {
|
|
|
8
8
|
PanelBody,
|
|
9
9
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
10
10
|
__experimentalUnitControl as UnitControl,
|
|
11
|
+
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
11
12
|
} from '@wordpress/components';
|
|
12
13
|
import { useInstanceId } from '@wordpress/compose';
|
|
13
|
-
import { useState } from '@wordpress/element';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { MIN_SPACER_SIZE } from './edit';
|
|
19
19
|
|
|
20
20
|
function DimensionInput( { label, onChange, isResizing, value = '' } ) {
|
|
21
|
-
const [ temporaryInput, setTemporaryInput ] = useState( null );
|
|
22
|
-
|
|
23
21
|
const inputId = useInstanceId( UnitControl, 'block-spacer-height-input' );
|
|
24
22
|
|
|
25
23
|
// In most contexts the spacer size cannot meaningfully be set to a
|
|
@@ -41,32 +39,28 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
|
|
|
41
39
|
} );
|
|
42
40
|
|
|
43
41
|
const handleOnChange = ( unprocessedValue ) => {
|
|
44
|
-
setTemporaryInput( null );
|
|
45
42
|
onChange( unprocessedValue );
|
|
46
43
|
};
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
// Force the unit to update to `px` when the Spacer is being resized.
|
|
46
|
+
const [ parsedQuantity, parsedUnit ] = parseQuantityAndUnitFromRawValue(
|
|
47
|
+
value
|
|
48
|
+
);
|
|
49
|
+
const computedValue = [
|
|
50
|
+
parsedQuantity,
|
|
51
|
+
isResizing ? 'px' : parsedUnit,
|
|
52
|
+
].join( '' );
|
|
55
53
|
|
|
56
54
|
return (
|
|
57
55
|
<BaseControl label={ label } id={ inputId }>
|
|
58
56
|
<UnitControl
|
|
59
57
|
id={ inputId }
|
|
60
58
|
isResetValueOnUnitChange
|
|
61
|
-
min={
|
|
62
|
-
max={ MAX_SPACER_SIZE }
|
|
63
|
-
onBlur={ handleOnBlur }
|
|
59
|
+
min={ MIN_SPACER_SIZE }
|
|
64
60
|
onChange={ handleOnChange }
|
|
65
61
|
style={ { maxWidth: 80 } }
|
|
66
|
-
value={
|
|
62
|
+
value={ computedValue }
|
|
67
63
|
units={ units }
|
|
68
|
-
// Force the unit to update to `px` when the Spacer is being resized.
|
|
69
|
-
unit={ isResizing ? 'px' : undefined }
|
|
70
64
|
/>
|
|
71
65
|
</BaseControl>
|
|
72
66
|
);
|
|
@@ -14,6 +14,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
|
+
import { MIN_SPACER_SIZE } from './edit.js';
|
|
17
18
|
import styles from './style.scss';
|
|
18
19
|
|
|
19
20
|
const DEFAULT_VALUES = { px: 100, em: 10, rem: 10, vw: 10, vh: 25 };
|
|
@@ -66,7 +67,7 @@ function Controls( { attributes, context, setAttributes } ) {
|
|
|
66
67
|
<PanelBody title={ __( 'Dimensions' ) }>
|
|
67
68
|
<UnitControl
|
|
68
69
|
label={ label }
|
|
69
|
-
min={
|
|
70
|
+
min={ MIN_SPACER_SIZE }
|
|
70
71
|
value={ value }
|
|
71
72
|
onChange={ handleChange }
|
|
72
73
|
onUnitChange={ handleUnitChange }
|
package/src/spacer/edit.js
CHANGED
|
@@ -16,8 +16,7 @@ import { View } from '@wordpress/primitives';
|
|
|
16
16
|
*/
|
|
17
17
|
import SpacerControls from './controls';
|
|
18
18
|
|
|
19
|
-
export const MIN_SPACER_SIZE =
|
|
20
|
-
export const MAX_SPACER_SIZE = 500;
|
|
19
|
+
export const MIN_SPACER_SIZE = 0;
|
|
21
20
|
|
|
22
21
|
const ResizableSpacer = ( {
|
|
23
22
|
orientation,
|
|
@@ -58,10 +57,7 @@ const ResizableSpacer = ( {
|
|
|
58
57
|
}
|
|
59
58
|
} }
|
|
60
59
|
onResizeStop={ ( _event, _direction, elt ) => {
|
|
61
|
-
const nextVal =
|
|
62
|
-
MAX_SPACER_SIZE,
|
|
63
|
-
getCurrentSize( elt )
|
|
64
|
-
);
|
|
60
|
+
const nextVal = getCurrentSize( elt );
|
|
65
61
|
onResizeStop( `${ nextVal }px` );
|
|
66
62
|
setIsResizing( false );
|
|
67
63
|
} }
|
|
@@ -147,6 +143,7 @@ const SpacerEdit = ( {
|
|
|
147
143
|
return (
|
|
148
144
|
<>
|
|
149
145
|
<ResizableSpacer
|
|
146
|
+
minHeight={ MIN_SPACER_SIZE }
|
|
150
147
|
enable={ {
|
|
151
148
|
top: false,
|
|
152
149
|
right: false,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Spacer block decrements height 1`] = `
|
|
4
|
+
"<!-- wp:spacer {\\"height\\":\\"99px\\"} -->
|
|
5
|
+
<div style=\\"height:99px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
6
|
+
<!-- /wp:spacer -->"
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
exports[`Spacer block increments height 1`] = `
|
|
10
|
+
"<!-- wp:spacer {\\"height\\":\\"101px\\"} -->
|
|
11
|
+
<div style=\\"height:101px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
12
|
+
<!-- /wp:spacer -->"
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`Spacer block inserts block 1`] = `
|
|
16
|
+
"<!-- wp:spacer -->
|
|
17
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
18
|
+
<!-- /wp:spacer -->"
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
exports[`Spacer block updates height to 25vh 1`] = `
|
|
22
|
+
"<!-- wp:spacer {\\"height\\":\\"25vh\\"} -->
|
|
23
|
+
<div style=\\"height:25vh\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
24
|
+
<!-- /wp:spacer -->"
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`Spacer block updates height to 50px 1`] = `
|
|
28
|
+
"<!-- wp:spacer {\\"height\\":\\"50px\\"} -->
|
|
29
|
+
<div style=\\"height:50px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
30
|
+
<!-- /wp:spacer -->"
|
|
31
|
+
`;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
fireEvent,
|
|
6
|
+
getEditorHtml,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
waitFor,
|
|
9
|
+
} from 'test/helpers';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
15
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
16
|
+
|
|
17
|
+
beforeAll( () => {
|
|
18
|
+
// Register all core blocks
|
|
19
|
+
registerCoreBlocks();
|
|
20
|
+
} );
|
|
21
|
+
|
|
22
|
+
afterAll( () => {
|
|
23
|
+
// Clean up registered blocks
|
|
24
|
+
getBlockTypes().forEach( ( block ) => {
|
|
25
|
+
unregisterBlockType( block.name );
|
|
26
|
+
} );
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
describe( 'Spacer block', () => {
|
|
30
|
+
it( 'inserts block', async () => {
|
|
31
|
+
const {
|
|
32
|
+
getByA11yLabel,
|
|
33
|
+
getByTestId,
|
|
34
|
+
getByText,
|
|
35
|
+
} = await initializeEditor();
|
|
36
|
+
|
|
37
|
+
fireEvent.press( getByA11yLabel( 'Add block' ) );
|
|
38
|
+
|
|
39
|
+
const blockList = getByTestId( 'InserterUI-Blocks' );
|
|
40
|
+
// onScroll event used to force the FlatList to render all items
|
|
41
|
+
fireEvent.scroll( blockList, {
|
|
42
|
+
nativeEvent: {
|
|
43
|
+
contentOffset: { y: 0, x: 0 },
|
|
44
|
+
contentSize: { width: 100, height: 100 },
|
|
45
|
+
layoutMeasurement: { width: 100, height: 100 },
|
|
46
|
+
},
|
|
47
|
+
} );
|
|
48
|
+
|
|
49
|
+
fireEvent.press( await waitFor( () => getByText( 'Spacer' ) ) );
|
|
50
|
+
|
|
51
|
+
expect( getByA11yLabel( /Spacer Block\. Row 1/ ) ).toBeVisible();
|
|
52
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
it( 'updates height to 50px', async () => {
|
|
56
|
+
const initialHtml = `<!-- wp:spacer -->
|
|
57
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
58
|
+
<!-- /wp:spacer -->`;
|
|
59
|
+
const {
|
|
60
|
+
getByA11yLabel,
|
|
61
|
+
getByDisplayValue,
|
|
62
|
+
getByTestId,
|
|
63
|
+
getByText,
|
|
64
|
+
} = await initializeEditor( {
|
|
65
|
+
initialHtml,
|
|
66
|
+
} );
|
|
67
|
+
|
|
68
|
+
// Select Spacer block
|
|
69
|
+
const spacerBlock = getByA11yLabel( /Spacer Block\. Row 1/ );
|
|
70
|
+
fireEvent.press( spacerBlock );
|
|
71
|
+
|
|
72
|
+
// Open block settings
|
|
73
|
+
fireEvent.press( getByA11yLabel( 'Open Settings' ) );
|
|
74
|
+
await waitFor(
|
|
75
|
+
() => getByTestId( 'block-settings-modal' ).props.isVisible
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// Update height attribute
|
|
79
|
+
fireEvent.press( getByText( '100' ) );
|
|
80
|
+
const heightTextInput = getByDisplayValue( '100' );
|
|
81
|
+
fireEvent.changeText( heightTextInput, '50' );
|
|
82
|
+
|
|
83
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
84
|
+
} );
|
|
85
|
+
|
|
86
|
+
it( 'updates height to 25vh', async () => {
|
|
87
|
+
const initialHtml = `<!-- wp:spacer -->
|
|
88
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
89
|
+
<!-- /wp:spacer -->`;
|
|
90
|
+
const {
|
|
91
|
+
getByA11yLabel,
|
|
92
|
+
getByDisplayValue,
|
|
93
|
+
getByTestId,
|
|
94
|
+
getByText,
|
|
95
|
+
} = await initializeEditor( {
|
|
96
|
+
initialHtml,
|
|
97
|
+
} );
|
|
98
|
+
|
|
99
|
+
// Select Spacer block
|
|
100
|
+
const spacerBlock = getByA11yLabel( /Spacer Block\. Row 1/ );
|
|
101
|
+
fireEvent.press( spacerBlock );
|
|
102
|
+
|
|
103
|
+
// Open block settings
|
|
104
|
+
fireEvent.press( getByA11yLabel( 'Open Settings' ) );
|
|
105
|
+
await waitFor(
|
|
106
|
+
() => getByTestId( 'block-settings-modal' ).props.isVisible
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// Set vh unit
|
|
110
|
+
fireEvent.press( getByText( 'px' ) );
|
|
111
|
+
fireEvent.press( getByText( 'Viewport height (vh)' ) );
|
|
112
|
+
|
|
113
|
+
// Update height attribute
|
|
114
|
+
fireEvent.press( getByText( '100' ) );
|
|
115
|
+
const heightTextInput = getByDisplayValue( '100' );
|
|
116
|
+
fireEvent.changeText( heightTextInput, '25' );
|
|
117
|
+
|
|
118
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
119
|
+
} );
|
|
120
|
+
|
|
121
|
+
it( 'increments height', async () => {
|
|
122
|
+
const initialHtml = `<!-- wp:spacer -->
|
|
123
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
124
|
+
<!-- /wp:spacer -->`;
|
|
125
|
+
const { getByA11yLabel, getByTestId } = await initializeEditor( {
|
|
126
|
+
initialHtml,
|
|
127
|
+
} );
|
|
128
|
+
|
|
129
|
+
// Select Spacer block
|
|
130
|
+
const spacerBlock = getByA11yLabel( /Spacer Block\. Row 1/ );
|
|
131
|
+
fireEvent.press( spacerBlock );
|
|
132
|
+
|
|
133
|
+
// Open block settings
|
|
134
|
+
fireEvent.press( getByA11yLabel( 'Open Settings' ) );
|
|
135
|
+
await waitFor(
|
|
136
|
+
() => getByTestId( 'block-settings-modal' ).props.isVisible
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
// Increment height
|
|
140
|
+
fireEvent(
|
|
141
|
+
getByA11yLabel( /Height\. Value is 100 Pixels \(px\)/ ),
|
|
142
|
+
'accessibilityAction',
|
|
143
|
+
{
|
|
144
|
+
nativeEvent: { actionName: 'increment' },
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
149
|
+
} );
|
|
150
|
+
|
|
151
|
+
it( 'decrements height', async () => {
|
|
152
|
+
const initialHtml = `<!-- wp:spacer -->
|
|
153
|
+
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
154
|
+
<!-- /wp:spacer -->`;
|
|
155
|
+
const { getByA11yLabel, getByTestId } = await initializeEditor( {
|
|
156
|
+
initialHtml,
|
|
157
|
+
} );
|
|
158
|
+
|
|
159
|
+
// Select Spacer block
|
|
160
|
+
const spacerBlock = getByA11yLabel( /Spacer Block\. Row 1/ );
|
|
161
|
+
fireEvent.press( spacerBlock );
|
|
162
|
+
|
|
163
|
+
// Open block settings
|
|
164
|
+
fireEvent.press( getByA11yLabel( 'Open Settings' ) );
|
|
165
|
+
await waitFor(
|
|
166
|
+
() => getByTestId( 'block-settings-modal' ).props.isVisible
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
// Increment height
|
|
170
|
+
fireEvent(
|
|
171
|
+
getByA11yLabel( /Height\. Value is 100 Pixels \(px\)/ ),
|
|
172
|
+
'accessibilityAction',
|
|
173
|
+
{
|
|
174
|
+
nativeEvent: { actionName: 'decrement' },
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
179
|
+
} );
|
|
180
|
+
} );
|
package/src/style.scss
CHANGED
package/src/table/deprecated.js
CHANGED
|
@@ -244,7 +244,11 @@ const deprecated = [
|
|
|
244
244
|
);
|
|
245
245
|
},
|
|
246
246
|
isEligible: ( attributes ) => {
|
|
247
|
-
return
|
|
247
|
+
return (
|
|
248
|
+
attributes.backgroundColor &&
|
|
249
|
+
attributes.backgroundColor in oldColors &&
|
|
250
|
+
! attributes.style
|
|
251
|
+
);
|
|
248
252
|
},
|
|
249
253
|
|
|
250
254
|
// This version is the first to introduce the style attribute to the
|
package/src/tag-cloud/block.json
CHANGED
package/src/tag-cloud/edit.js
CHANGED
|
@@ -7,14 +7,23 @@ import { map, filter } from 'lodash';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
+
Flex,
|
|
11
|
+
FlexItem,
|
|
10
12
|
PanelBody,
|
|
11
13
|
ToggleControl,
|
|
12
14
|
SelectControl,
|
|
13
15
|
RangeControl,
|
|
16
|
+
__experimentalUnitControl as UnitControl,
|
|
17
|
+
__experimentalUseCustomUnits as useCustomUnits,
|
|
18
|
+
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
14
19
|
} from '@wordpress/components';
|
|
15
20
|
import { withSelect } from '@wordpress/data';
|
|
16
21
|
import { __ } from '@wordpress/i18n';
|
|
17
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
InspectorControls,
|
|
24
|
+
useBlockProps,
|
|
25
|
+
useSetting,
|
|
26
|
+
} from '@wordpress/block-editor';
|
|
18
27
|
import ServerSideRender from '@wordpress/server-side-render';
|
|
19
28
|
import { store as coreStore } from '@wordpress/core-data';
|
|
20
29
|
|
|
@@ -32,8 +41,26 @@ const MIN_TAGS = 1;
|
|
|
32
41
|
*/
|
|
33
42
|
const MAX_TAGS = 100;
|
|
34
43
|
|
|
44
|
+
const MIN_FONT_SIZE = 0.1;
|
|
45
|
+
const MAX_FONT_SIZE = 100;
|
|
46
|
+
|
|
35
47
|
function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
|
|
36
|
-
const {
|
|
48
|
+
const {
|
|
49
|
+
taxonomy,
|
|
50
|
+
showTagCounts,
|
|
51
|
+
numberOfTags,
|
|
52
|
+
smallestFontSize,
|
|
53
|
+
largestFontSize,
|
|
54
|
+
} = attributes;
|
|
55
|
+
|
|
56
|
+
const units = useCustomUnits( {
|
|
57
|
+
availableUnits: useSetting( 'spacing.units' ) || [
|
|
58
|
+
'%',
|
|
59
|
+
'px',
|
|
60
|
+
'em',
|
|
61
|
+
'rem',
|
|
62
|
+
],
|
|
63
|
+
} );
|
|
37
64
|
|
|
38
65
|
const getTaxonomyOptions = () => {
|
|
39
66
|
const selectOption = {
|
|
@@ -54,6 +81,33 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
|
|
|
54
81
|
return [ selectOption, ...taxonomyOptions ];
|
|
55
82
|
};
|
|
56
83
|
|
|
84
|
+
const onFontSizeChange = ( fontSizeLabel, newValue ) => {
|
|
85
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
86
|
+
const [ quantity, newUnit ] = parseQuantityAndUnitFromRawValue(
|
|
87
|
+
newValue
|
|
88
|
+
);
|
|
89
|
+
if ( ! Number.isFinite( quantity ) ) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const updateObj = { [ fontSizeLabel ]: newValue };
|
|
93
|
+
// We need to keep in sync the `unit` changes to both `smallestFontSize`
|
|
94
|
+
// and `largestFontSize` attributes.
|
|
95
|
+
Object.entries( {
|
|
96
|
+
smallestFontSize,
|
|
97
|
+
largestFontSize,
|
|
98
|
+
} ).forEach( ( [ attribute, currentValue ] ) => {
|
|
99
|
+
const [
|
|
100
|
+
currentQuantity,
|
|
101
|
+
currentUnit,
|
|
102
|
+
] = parseQuantityAndUnitFromRawValue( currentValue );
|
|
103
|
+
// Only add an update if the other font size attribute has a different unit.
|
|
104
|
+
if ( attribute !== fontSizeLabel && currentUnit !== newUnit ) {
|
|
105
|
+
updateObj[ attribute ] = `${ currentQuantity }${ newUnit }`;
|
|
106
|
+
}
|
|
107
|
+
} );
|
|
108
|
+
setAttributes( updateObj );
|
|
109
|
+
};
|
|
110
|
+
|
|
57
111
|
const inspectorControls = (
|
|
58
112
|
<InspectorControls>
|
|
59
113
|
<PanelBody title={ __( 'Tag Cloud settings' ) }>
|
|
@@ -82,6 +136,32 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
|
|
|
82
136
|
max={ MAX_TAGS }
|
|
83
137
|
required
|
|
84
138
|
/>
|
|
139
|
+
<Flex>
|
|
140
|
+
<FlexItem isBlock>
|
|
141
|
+
<UnitControl
|
|
142
|
+
label={ __( 'Smallest size' ) }
|
|
143
|
+
value={ smallestFontSize }
|
|
144
|
+
onChange={ ( value ) => {
|
|
145
|
+
onFontSizeChange( 'smallestFontSize', value );
|
|
146
|
+
} }
|
|
147
|
+
units={ units }
|
|
148
|
+
min={ MIN_FONT_SIZE }
|
|
149
|
+
max={ MAX_FONT_SIZE }
|
|
150
|
+
/>
|
|
151
|
+
</FlexItem>
|
|
152
|
+
<FlexItem isBlock>
|
|
153
|
+
<UnitControl
|
|
154
|
+
label={ __( 'Largest size' ) }
|
|
155
|
+
value={ largestFontSize }
|
|
156
|
+
onChange={ ( value ) => {
|
|
157
|
+
onFontSizeChange( 'largestFontSize', value );
|
|
158
|
+
} }
|
|
159
|
+
units={ units }
|
|
160
|
+
min={ MIN_FONT_SIZE }
|
|
161
|
+
max={ MAX_FONT_SIZE }
|
|
162
|
+
/>
|
|
163
|
+
</FlexItem>
|
|
164
|
+
</Flex>
|
|
85
165
|
</PanelBody>
|
|
86
166
|
</InspectorControls>
|
|
87
167
|
);
|
package/src/tag-cloud/index.php
CHANGED
|
@@ -13,11 +13,17 @@
|
|
|
13
13
|
* @return string Returns the tag cloud for selected taxonomy.
|
|
14
14
|
*/
|
|
15
15
|
function render_block_core_tag_cloud( $attributes ) {
|
|
16
|
+
$smallest_font_size = $attributes['smallestFontSize'];
|
|
17
|
+
$unit = ( preg_match( '/^[0-9.]+(?P<unit>[a-z%]+)$/i', $smallest_font_size, $m ) ? $m['unit'] : 'pt' );
|
|
18
|
+
|
|
16
19
|
$args = array(
|
|
17
20
|
'echo' => false,
|
|
21
|
+
'unit' => $unit,
|
|
18
22
|
'taxonomy' => $attributes['taxonomy'],
|
|
19
23
|
'show_count' => $attributes['showTagCounts'],
|
|
20
24
|
'number' => $attributes['numberOfTags'],
|
|
25
|
+
'smallest' => floatVal( $attributes['smallestFontSize'] ),
|
|
26
|
+
'largest' => floatVal( $attributes['largestFontSize'] ),
|
|
21
27
|
);
|
|
22
28
|
$tag_cloud = wp_tag_cloud( $args );
|
|
23
29
|
|
|
@@ -102,13 +102,18 @@ export function useCreateTemplatePartFromBlocks( area, setAttributes ) {
|
|
|
102
102
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
103
103
|
|
|
104
104
|
return async ( blocks = [], title = __( 'Untitled Template Part' ) ) => {
|
|
105
|
+
// Currently template parts only allow latin chars.
|
|
106
|
+
// Fallback slug will receive suffix by default.
|
|
107
|
+
const cleanSlug =
|
|
108
|
+
kebabCase( title ).replace( /[^\w-]+/g, '' ) || 'wp-custom-part';
|
|
109
|
+
|
|
105
110
|
// If we have `area` set from block attributes, means an exposed
|
|
106
111
|
// block variation was inserted. So add this prop to the template
|
|
107
112
|
// part entity on creation. Afterwards remove `area` value from
|
|
108
113
|
// block attributes.
|
|
109
114
|
const record = {
|
|
110
115
|
title,
|
|
111
|
-
slug:
|
|
116
|
+
slug: cleanSlug,
|
|
112
117
|
content: serialize( blocks ),
|
|
113
118
|
// `area` is filterable on the server and defaults to `UNCATEGORIZED`
|
|
114
119
|
// if provided value is not allowed.
|
|
@@ -12,13 +12,3 @@
|
|
|
12
12
|
height: 70%;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
.block-library-template-part__selection-content .block-editor-block-patterns-list {
|
|
17
|
-
display: grid;
|
|
18
|
-
grid-template-columns: 1fr 1fr;
|
|
19
|
-
grid-gap: $grid-unit-10;
|
|
20
|
-
|
|
21
|
-
.block-editor-block-patterns-list__list-item {
|
|
22
|
-
margin-bottom: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|