@wordpress/block-library 7.12.0 → 7.13.1-next.957ca95e4c.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 +7 -1
- package/build/archives/index.js +5 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/index.js +4 -0
- package/build/audio/index.js.map +1 -1
- package/build/button/deprecated.js +14 -5
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +1 -1
- package/build/categories/edit.js +3 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +14 -1
- package/build/categories/index.js.map +1 -1
- package/build/code/index.js +4 -2
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +13 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/deprecated.js +16 -5
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +6 -2
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +6 -2
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/index.js +13 -0
- package/build/columns/index.js.map +1 -1
- package/build/columns/transforms.js +10 -1
- package/build/columns/transforms.js.map +1 -1
- package/build/comment-author-name/index.js +5 -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 +1 -0
- 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/index.js +14 -1
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/index.js +13 -0
- package/build/comments/index.js.map +1 -1
- package/build/comments-pagination/index.js +13 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +4 -2
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-numbers/edit.js +5 -1
- package/build/comments-pagination-numbers/edit.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +14 -1
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +4 -2
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/comments-title/deprecated.js +4 -2
- package/build/comments-title/deprecated.js.map +1 -1
- package/build/comments-title/index.js +4 -2
- package/build/comments-title/index.js.map +1 -1
- package/build/cover/deprecated.js +20 -5
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +9 -2
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/index.js +13 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/shared.js +1 -1
- package/build/cover/shared.js.map +1 -1
- package/build/embed/icons.js +1 -1
- package/build/embed/icons.js.map +1 -1
- package/build/gallery/deprecated.js +6 -1
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +15 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gap-styles.js +5 -4
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +5 -0
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/transforms.js +20 -7
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/utils.js +7 -6
- package/build/gallery/utils.js.map +1 -1
- package/build/group/deprecated.js +108 -12
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +23 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +10 -2
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +8 -8
- package/build/group/variations.js.map +1 -1
- package/build/heading/deprecated.js +5 -3
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/index.js +3 -1
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +3 -1
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/edit.js +8 -4
- package/build/home-link/edit.js.map +1 -1
- package/build/home-link/index.js +14 -1
- package/build/home-link/index.js.map +1 -1
- package/build/image/edit.js +16 -2
- package/build/image/edit.js.map +1 -1
- package/build/image/index.js +13 -7
- package/build/image/index.js.map +1 -1
- package/build/image/use-client-width.js +3 -1
- package/build/image/use-client-width.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js +9 -18
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/deprecated.js +14 -1
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +14 -1
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/deprecated.js +84 -1
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +153 -134
- package/build/list/edit.js.map +1 -1
- package/build/list/index.js +33 -34
- package/build/list/index.js.map +1 -1
- package/build/list/save.js +1 -5
- package/build/list/save.js.map +1 -1
- package/build/list/{v2/tag-name.js → tag-name.js} +0 -0
- package/build/list/tag-name.js.map +1 -0
- package/build/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
- package/build/list/tag-name.native.js.map +1 -0
- package/build/list/transforms.js +61 -95
- package/build/list/transforms.js.map +1 -1
- package/build/list/{v2/migrate.js → utils.js} +3 -2
- package/build/list/utils.js.map +1 -0
- package/build/list-item/edit.js +3 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +21 -3
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/index.js +8 -0
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-copy.js +44 -0
- package/build/list-item/hooks/use-copy.js.map +1 -0
- package/build/list-item/hooks/use-merge.js +0 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +0 -1
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +10 -1
- package/build/list-item/hooks/use-space.js.map +1 -1
- package/build/list-item/index.js +0 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/list-style-type.native.js +4 -1
- package/build/list-item/list-style-type.native.js.map +1 -1
- package/build/list-item/utils.js +4 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +5 -1
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/index.js +17 -0
- package/build/media-text/index.js.map +1 -1
- package/build/navigation/deprecated.js +6 -1
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +125 -41
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +6 -4
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +6 -16
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/index.js +1 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +1 -7
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +8 -7
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +6 -8
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -6
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +7 -3
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +18 -10
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +1 -0
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +7 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +7 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-author/index.js +4 -2
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +1 -0
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +5 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-count/edit.js +11 -1
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-count/index.js +4 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-link/index.js +4 -2
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-date/edit.js +9 -2
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +9 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/index.js +4 -2
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/edit.js +27 -12
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +12 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +3 -2
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +8 -4
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +14 -1
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/edit.js +0 -1
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +5 -3
- package/build/post-terms/index.js.map +1 -1
- package/build/post-terms/use-post-terms.js +4 -24
- package/build/post-terms/use-post-terms.js.map +1 -1
- package/build/post-title/index.js +2 -1
- package/build/post-title/index.js.map +1 -1
- package/build/preformatted/index.js +4 -2
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/deprecated.js +135 -25
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +1 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +0 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/pullquote/index.js +13 -6
- package/build/pullquote/index.js.map +1 -1
- package/build/pullquote/save.js +2 -2
- package/build/pullquote/save.js.map +1 -1
- package/build/pullquote/transforms.js +14 -33
- package/build/pullquote/transforms.js.map +1 -1
- package/build/query/deprecated.js +10 -9
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/index.js +19 -8
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-placeholder.js +6 -1
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/utils.js +35 -9
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/edit.js +1 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-no-results/index.js +13 -0
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +4 -2
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-title/edit.js +10 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +8 -2
- package/build/query-title/index.js.map +1 -1
- package/build/quote/deprecated.js +13 -6
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/index.js +4 -2
- package/build/quote/index.js.map +1 -1
- package/build/quote/transforms.js +22 -37
- package/build/quote/transforms.js.map +1 -1
- package/build/separator/deprecated.js +3 -4
- package/build/separator/deprecated.js.map +1 -1
- package/build/separator/index.js +1 -0
- package/build/separator/index.js.map +1 -1
- package/build/social-link/icons/reddit.js +1 -1
- package/build/social-link/icons/reddit.js.map +1 -1
- package/build/social-links/edit.js +43 -9
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +9 -0
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/index.js +7 -1
- package/build/spacer/index.js.map +1 -1
- package/build/table/index.js +4 -0
- package/build/table/index.js.map +1 -1
- package/build/table/state.js +9 -3
- package/build/table/state.js.map +1 -1
- package/build/table-of-contents/index.js +24 -1
- package/build/table-of-contents/index.js.map +1 -1
- package/build/tag-cloud/index.js +5 -1
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/index.js +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +10 -0
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/edit.js +3 -1
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js +3 -1
- package/build/text-columns/save.js.map +1 -1
- package/build/verse/index.js +2 -0
- package/build/verse/index.js.map +1 -1
- package/build/video/index.js +4 -0
- package/build/video/index.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/index.js +4 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/button/deprecated.js +14 -4
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/categories/edit.js +4 -2
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +14 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/index.js +4 -2
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +13 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/deprecated.js +16 -4
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +7 -3
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +7 -3
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/index.js +13 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/transforms.js +10 -1
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/comment-author-name/index.js +5 -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 +1 -0
- 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/index.js +14 -1
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/index.js +13 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-pagination/index.js +13 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +4 -2
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-numbers/edit.js +5 -1
- package/build-module/comments-pagination-numbers/edit.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +14 -1
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +4 -2
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/comments-title/deprecated.js +4 -2
- package/build-module/comments-title/deprecated.js.map +1 -1
- package/build-module/comments-title/index.js +4 -2
- package/build-module/comments-title/index.js.map +1 -1
- package/build-module/cover/deprecated.js +20 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +10 -3
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/index.js +13 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/shared.js +1 -1
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/embed/icons.js +1 -1
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/gallery/deprecated.js +7 -2
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +15 -2
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gap-styles.js +6 -5
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +5 -0
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/transforms.js +20 -7
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/utils.js +7 -6
- package/build-module/gallery/utils.js.map +1 -1
- package/build-module/group/deprecated.js +109 -12
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +25 -2
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +10 -2
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +8 -8
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/deprecated.js +5 -2
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/index.js +3 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +3 -1
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/edit.js +10 -6
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/home-link/index.js +14 -1
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/image/edit.js +18 -4
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/index.js +13 -7
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/use-client-width.js +3 -1
- package/build-module/image/use-client-width.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +9 -17
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +14 -1
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +14 -1
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/deprecated.js +83 -1
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +151 -134
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/index.js +33 -29
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/save.js +2 -6
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/{v2/tag-name.js → tag-name.js} +0 -0
- package/build-module/list/tag-name.js.map +1 -0
- package/build-module/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
- package/build-module/list/tag-name.native.js.map +1 -0
- package/build-module/list/transforms.js +62 -97
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/{v2/migrate.js → utils.js} +3 -2
- package/build-module/list/utils.js.map +1 -0
- package/build-module/list-item/edit.js +4 -2
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +19 -3
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/index.js +1 -0
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-copy.js +34 -0
- package/build-module/list-item/hooks/use-copy.js.map +1 -0
- package/build-module/list-item/hooks/use-merge.js +0 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +0 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +10 -1
- package/build-module/list-item/hooks/use-space.js.map +1 -1
- package/build-module/list-item/index.js +0 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/list-style-type.native.js +3 -1
- package/build-module/list-item/list-style-type.native.js.map +1 -1
- package/build-module/list-item/utils.js +4 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +6 -2
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/index.js +17 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/navigation/deprecated.js +7 -2
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +125 -43
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +6 -4
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +7 -16
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/index.js +1 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +1 -6
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +8 -7
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +7 -9
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +5 -7
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +7 -2
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js +18 -9
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -0
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +7 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +7 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-author/index.js +4 -2
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +1 -0
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +5 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-count/edit.js +10 -1
- package/build-module/post-comments-count/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +4 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +4 -2
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-date/edit.js +9 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +9 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/index.js +4 -2
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +28 -13
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +12 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +3 -2
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +8 -4
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +14 -1
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/edit.js +0 -1
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +5 -3
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-terms/use-post-terms.js +5 -25
- package/build-module/post-terms/use-post-terms.js.map +1 -1
- package/build-module/post-title/index.js +2 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/preformatted/index.js +4 -2
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +134 -25
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +1 -1
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +0 -1
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/pullquote/index.js +13 -6
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/pullquote/save.js +2 -2
- package/build-module/pullquote/save.js.map +1 -1
- package/build-module/pullquote/transforms.js +15 -34
- package/build-module/pullquote/transforms.js.map +1 -1
- package/build-module/query/deprecated.js +10 -8
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/index.js +23 -12
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +6 -1
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/utils.js +32 -7
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/edit.js +1 -1
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-no-results/index.js +13 -0
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +4 -2
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-title/edit.js +10 -1
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +8 -2
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/deprecated.js +13 -5
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/index.js +4 -2
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/transforms.js +23 -38
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/separator/deprecated.js +3 -3
- package/build-module/separator/deprecated.js.map +1 -1
- package/build-module/separator/index.js +1 -0
- package/build-module/separator/index.js.map +1 -1
- package/build-module/social-link/icons/reddit.js +1 -1
- package/build-module/social-link/icons/reddit.js.map +1 -1
- package/build-module/social-links/edit.js +45 -12
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +9 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/index.js +7 -1
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/table/index.js +4 -0
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/state.js +10 -4
- package/build-module/table/state.js.map +1 -1
- package/build-module/table-of-contents/index.js +24 -1
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/tag-cloud/index.js +5 -1
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/index.js +2 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +10 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/edit.js +4 -2
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/save.js +4 -2
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/verse/index.js +2 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/index.js +4 -0
- package/build-module/video/index.js.map +1 -1
- package/build-style/audio/style-rtl.css +3 -0
- package/build-style/audio/style.css +3 -0
- package/build-style/button/style-rtl.css +7 -10
- package/build-style/button/style.css +7 -10
- package/build-style/code/editor-rtl.css +79 -0
- package/build-style/code/editor.css +79 -0
- package/build-style/cover/editor-rtl.css +0 -3
- package/build-style/cover/editor.css +0 -3
- package/build-style/editor-rtl.css +94 -146
- package/build-style/editor.css +94 -146
- package/build-style/group/editor-rtl.css +9 -10
- package/build-style/group/editor.css +9 -10
- package/build-style/image/editor-rtl.css +21 -2
- package/build-style/image/editor.css +21 -2
- package/build-style/media-text/style-rtl.css +1 -0
- package/build-style/media-text/style.css +1 -0
- package/build-style/navigation/editor-rtl.css +11 -23
- package/build-style/navigation/editor.css +11 -23
- package/build-style/navigation/style-rtl.css +10 -3
- package/build-style/navigation/style.css +10 -3
- package/build-style/paragraph/editor-rtl.css +1 -1
- package/build-style/paragraph/editor.css +1 -1
- package/build-style/post-date/style-rtl.css +79 -0
- package/build-style/post-date/style.css +79 -0
- package/build-style/post-featured-image/editor-rtl.css +45 -43
- package/build-style/post-featured-image/editor.css +45 -43
- package/build-style/post-featured-image/style-rtl.css +1 -0
- package/build-style/post-featured-image/style.css +1 -0
- package/build-style/post-title/style-rtl.css +1 -0
- package/build-style/post-title/style.css +1 -0
- package/build-style/pullquote/editor-rtl.css +0 -12
- package/build-style/pullquote/editor.css +0 -12
- package/build-style/pullquote/style-rtl.css +1 -8
- package/build-style/pullquote/style.css +1 -8
- package/build-style/query-title/style-rtl.css +79 -0
- package/build-style/query-title/style.css +79 -0
- package/build-style/site-logo/editor-rtl.css +3 -52
- package/build-style/site-logo/editor.css +3 -52
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/style-rtl.css +37 -23
- package/build-style/style.css +37 -23
- package/build-style/video/style-rtl.css +3 -0
- package/build-style/video/style.css +3 -0
- package/package.json +30 -29
- package/src/archives/block.json +5 -1
- package/src/audio/block.json +4 -0
- package/src/audio/style.scss +2 -0
- package/src/button/block.json +1 -1
- package/src/button/deprecated.js +21 -22
- package/src/button/style.scss +7 -14
- package/src/calendar/index.php +2 -2
- package/src/categories/block.json +14 -1
- package/src/categories/edit.js +2 -2
- package/src/code/block.json +4 -2
- package/src/code/editor.scss +3 -0
- package/src/column/block.json +13 -0
- package/src/columns/block.json +13 -0
- package/src/columns/deprecated.js +10 -4
- package/src/columns/edit.js +7 -3
- package/src/columns/edit.native.js +7 -3
- package/src/columns/transforms.js +17 -3
- package/src/comment-author-name/block.json +5 -1
- package/src/comment-content/block.json +5 -1
- package/src/comment-date/block.json +1 -0
- package/src/comment-edit-link/block.json +5 -1
- package/src/comment-reply-link/block.json +5 -1
- package/src/comment-template/block.json +14 -1
- package/src/comments/block.json +13 -0
- package/src/comments/index.php +6 -5
- package/src/comments-pagination/block.json +13 -0
- package/src/comments-pagination-next/block.json +4 -2
- package/src/comments-pagination-numbers/block.json +14 -1
- package/src/comments-pagination-numbers/edit.js +12 -3
- package/src/comments-pagination-previous/block.json +4 -2
- package/src/comments-title/block.json +4 -2
- package/src/cover/block.json +13 -0
- package/src/cover/deprecated.js +11 -4
- package/src/cover/edit/block-controls.js +15 -3
- package/src/cover/editor.scss +0 -4
- package/src/cover/shared.js +2 -1
- package/src/editor.scss +1 -0
- package/src/embed/icons.js +1 -1
- package/src/gallery/block.json +5 -0
- package/src/gallery/deprecated.js +4 -2
- package/src/gallery/edit.js +22 -2
- package/src/gallery/gap-styles.js +10 -6
- package/src/gallery/index.php +23 -2
- package/src/gallery/transforms.js +18 -5
- package/src/gallery/utils.js +11 -7
- package/src/group/block.json +10 -2
- package/src/group/deprecated.js +89 -2
- package/src/group/edit.js +15 -2
- package/src/group/editor.scss +4 -6
- package/src/group/variations.js +4 -3
- package/src/heading/block.json +3 -1
- package/src/heading/deprecated.js +4 -2
- package/src/home-link/block.json +14 -1
- package/src/home-link/edit.js +19 -20
- package/src/image/block.json +13 -7
- package/src/image/edit.js +22 -4
- package/src/image/editor.scss +39 -3
- package/src/image/index.php +1 -1
- package/src/image/use-client-width.js +1 -1
- package/src/index.js +1 -4
- package/src/index.native.js +17 -23
- package/src/latest-posts/block.json +14 -1
- package/src/list/block.json +4 -0
- package/src/list/deprecated.js +71 -1
- package/src/list/edit.js +146 -133
- package/src/list/index.js +25 -24
- package/src/list/save.js +3 -4
- package/src/list/{v2/tag-name.js → tag-name.js} +0 -0
- package/src/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
- package/src/list/test/__snapshots__/edit.native.js.snap +14 -2
- package/src/list/test/edit.native.js +0 -154
- package/src/list/transforms.js +57 -111
- package/src/list/{v2/migrate.js → utils.js} +2 -2
- package/src/list-item/block.json +0 -1
- package/src/list-item/edit.js +2 -1
- package/src/list-item/edit.native.js +32 -2
- package/src/list-item/hooks/index.js +1 -0
- package/src/list-item/hooks/use-copy.js +38 -0
- package/src/list-item/hooks/use-space.js +10 -2
- package/src/list-item/list-style-type.native.js +8 -1
- package/src/list-item/style.native.scss +12 -0
- package/src/media-text/block.json +17 -0
- package/src/media-text/deprecated.js +3 -2
- package/src/media-text/style.scss +2 -0
- package/src/navigation/block.json +1 -0
- package/src/navigation/deprecated.js +4 -2
- package/src/navigation/edit/index.js +173 -85
- package/src/navigation/edit/responsive-wrapper.js +8 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +17 -25
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
- package/src/navigation/editor.scss +5 -25
- package/src/navigation/index.php +24 -24
- package/src/navigation/menu-items-to-blocks.js +3 -6
- package/src/navigation/style.scss +14 -4
- package/src/navigation/test/use-navigation-menu.js +18 -1
- package/src/navigation/use-navigation-menu.js +11 -8
- package/src/navigation-link/edit.js +9 -13
- package/src/navigation-submenu/edit.js +9 -13
- package/src/page-list/edit.js +6 -2
- package/src/paragraph/block.json +7 -0
- package/src/paragraph/deprecated.js +33 -35
- package/src/paragraph/edit.js +1 -0
- package/src/paragraph/editor.scss +5 -3
- package/src/post-author/block.json +4 -2
- package/src/post-author-biography/block.json +1 -0
- package/src/post-author-name/block.json +5 -1
- package/src/post-comments-count/block.json +4 -1
- package/src/post-comments-count/edit.js +10 -2
- package/src/post-comments-link/block.json +4 -2
- package/src/post-date/block.json +9 -0
- package/src/post-date/edit.js +12 -2
- package/src/post-date/index.php +10 -2
- package/src/post-date/style.scss +4 -0
- package/src/post-excerpt/block.json +4 -2
- package/src/post-featured-image/block.json +12 -0
- package/src/post-featured-image/edit.js +43 -13
- package/src/post-featured-image/editor.scss +44 -53
- package/src/post-featured-image/index.php +61 -4
- package/src/post-featured-image/style.scss +1 -0
- package/src/post-navigation-link/block.json +3 -2
- package/src/post-template/block.json +15 -1
- package/src/post-template/edit.js +6 -1
- package/src/post-template/index.php +7 -4
- package/src/post-terms/block.json +5 -3
- package/src/post-terms/edit.js +0 -1
- package/src/post-terms/use-post-terms.js +10 -15
- package/src/post-title/block.json +2 -1
- package/src/post-title/style.scss +2 -0
- package/src/preformatted/block.json +4 -2
- package/src/pullquote/block.json +11 -4
- package/src/pullquote/deprecated.js +490 -412
- package/src/pullquote/edit.js +1 -1
- package/src/pullquote/edit.native.js +0 -1
- package/src/pullquote/editor.scss +0 -16
- package/src/pullquote/index.js +1 -3
- package/src/pullquote/save.js +1 -1
- package/src/pullquote/style.scss +0 -11
- package/src/pullquote/transforms.js +17 -33
- package/src/query/deprecated.js +4 -9
- package/src/query/edit/index.js +28 -15
- package/src/query/edit/inspector-controls/taxonomy-controls.js +1 -1
- package/src/query/edit/query-placeholder.js +17 -2
- package/src/query/utils.js +29 -7
- package/src/query-no-results/block.json +13 -0
- package/src/query-no-results/edit.js +1 -1
- package/src/query-pagination-numbers/block.json +4 -2
- package/src/query-title/block.json +8 -2
- package/src/query-title/edit.js +19 -2
- package/src/query-title/index.php +11 -1
- package/src/query-title/style.scss +4 -0
- package/src/quote/block.json +4 -2
- package/src/quote/deprecated.js +6 -5
- package/src/quote/transforms.js +4 -18
- package/src/search/index.php +1 -1
- package/src/separator/block.json +1 -0
- package/src/separator/deprecated.js +2 -3
- package/src/site-logo/editor.scss +8 -66
- package/src/social-link/icons/reddit.js +1 -1
- package/src/social-link/index.php +1 -1
- package/src/social-link/socials-with-bg.scss +1 -1
- package/src/social-link/socials-without-bg.scss +1 -1
- package/src/social-links/block.json +9 -0
- package/src/social-links/edit.js +47 -19
- package/src/spacer/block.json +7 -1
- package/src/style.scss +2 -0
- package/src/table/block.json +4 -0
- package/src/table/state.js +21 -19
- package/src/table-of-contents/block.json +24 -1
- package/src/tag-cloud/block.json +5 -1
- package/src/template-part/index.js +3 -2
- package/src/term-description/block.json +10 -0
- package/src/text-columns/edit.js +2 -2
- package/src/text-columns/save.js +2 -2
- package/src/verse/block.json +2 -0
- package/src/video/block.json +4 -0
- package/src/video/style.scss +2 -0
- package/build/list/v2/deprecated.js +0 -117
- package/build/list/v2/deprecated.js.map +0 -1
- package/build/list/v2/edit.js +0 -200
- package/build/list/v2/edit.js.map +0 -1
- package/build/list/v2/index.js +0 -36
- package/build/list/v2/index.js.map +0 -1
- package/build/list/v2/migrate.js.map +0 -1
- package/build/list/v2/save.js +0 -34
- package/build/list/v2/save.js.map +0 -1
- package/build/list/v2/tag-name.js.map +0 -1
- package/build/list/v2/tag-name.native.js.map +0 -1
- package/build/list/v2/transforms.js +0 -137
- package/build/list/v2/transforms.js.map +0 -1
- package/build-module/list/v2/deprecated.js +0 -104
- package/build-module/list/v2/deprecated.js.map +0 -1
- package/build-module/list/v2/edit.js +0 -179
- package/build-module/list/v2/edit.js.map +0 -1
- package/build-module/list/v2/index.js +0 -21
- package/build-module/list/v2/index.js.map +0 -1
- package/build-module/list/v2/migrate.js.map +0 -1
- package/build-module/list/v2/save.js +0 -23
- package/build-module/list/v2/save.js.map +0 -1
- package/build-module/list/v2/tag-name.js.map +0 -1
- package/build-module/list/v2/tag-name.native.js.map +0 -1
- package/build-module/list/v2/transforms.js +0 -127
- package/build-module/list/v2/transforms.js.map +0 -1
- package/src/list/test/migrate.js +0 -158
- package/src/list/v2/deprecated.js +0 -89
- package/src/list/v2/edit.js +0 -192
- package/src/list/v2/index.js +0 -22
- package/src/list/v2/save.js +0 -18
- package/src/list/v2/transforms.js +0 -120
|
@@ -200,9 +200,9 @@ $color-control-label-height: 20px;
|
|
|
200
200
|
|
|
201
201
|
// Override inner padding on default appender.
|
|
202
202
|
// This should be a temporary fix, to be replaced by improvements to
|
|
203
|
-
// the sibling inserter.
|
|
203
|
+
// the sibling inserter. Or by the dropdown appender that is used in Group, instead of the "Button block appender".
|
|
204
204
|
// See https://github.com/WordPress/gutenberg/issues/37572.
|
|
205
|
-
.wp-block-navigation .block-editor-button-block-appender {
|
|
205
|
+
.wp-block-navigation .wp-block + .block-list-appender .block-editor-button-block-appender {
|
|
206
206
|
background-color: $gray-900;
|
|
207
207
|
color: $white;
|
|
208
208
|
|
|
@@ -290,9 +290,8 @@ $color-control-label-height: 20px;
|
|
|
290
290
|
right: 0;
|
|
291
291
|
bottom: 0;
|
|
292
292
|
left: 0;
|
|
293
|
-
border: $border-width dashed currentColor;
|
|
294
|
-
opacity: 0.4;
|
|
295
293
|
pointer-events: none;
|
|
294
|
+
@include placeholder-style();
|
|
296
295
|
|
|
297
296
|
// Inherit border radius from style variations.
|
|
298
297
|
border-radius: inherit;
|
|
@@ -300,7 +299,6 @@ $color-control-label-height: 20px;
|
|
|
300
299
|
|
|
301
300
|
> svg {
|
|
302
301
|
fill: currentColor;
|
|
303
|
-
opacity: 0.4;
|
|
304
302
|
}
|
|
305
303
|
}
|
|
306
304
|
|
|
@@ -520,6 +518,7 @@ body.editor-styles-wrapper
|
|
|
520
518
|
// so focus is applied naturally on the block container.
|
|
521
519
|
// It's important the right container has focus, otherwise you can't press
|
|
522
520
|
// "Delete" to remove the block.
|
|
521
|
+
.wp-block-navigation__responsive-container,
|
|
523
522
|
.wp-block-navigation__responsive-close {
|
|
524
523
|
@include break-small() {
|
|
525
524
|
pointer-events: none;
|
|
@@ -567,21 +566,6 @@ body.editor-styles-wrapper
|
|
|
567
566
|
padding: $grid-unit-10 $grid-unit-15;
|
|
568
567
|
}
|
|
569
568
|
|
|
570
|
-
.wp-block-navigation__unsaved-changes {
|
|
571
|
-
position: relative;
|
|
572
|
-
|
|
573
|
-
.components-spinner {
|
|
574
|
-
position: absolute;
|
|
575
|
-
top: calc(50% - #{$spinner-size} / 2);
|
|
576
|
-
left: calc(50% - #{$spinner-size} / 2);
|
|
577
|
-
|
|
578
|
-
// Delay showing the saving spinner until after 2 seconds.
|
|
579
|
-
// This should ensure it only shows for slow connections.
|
|
580
|
-
opacity: 0;
|
|
581
|
-
animation: 0.5s linear 2s normal forwards fadein;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
569
|
@keyframes fadeouthalf {
|
|
586
570
|
0% {
|
|
587
571
|
opacity: 1;
|
|
@@ -591,11 +575,6 @@ body.editor-styles-wrapper
|
|
|
591
575
|
}
|
|
592
576
|
}
|
|
593
577
|
|
|
594
|
-
.wp-block-navigation__unsaved-changes-overlay.is-saving {
|
|
595
|
-
opacity: 1;
|
|
596
|
-
animation: 0.5s linear 2s normal forwards fadeouthalf;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
578
|
.wp-block-navigation-delete-menu-button {
|
|
600
579
|
width: 100%;
|
|
601
580
|
justify-content: center;
|
|
@@ -605,6 +584,7 @@ body.editor-styles-wrapper
|
|
|
605
584
|
.wp-block-navigation__overlay-menu-preview {
|
|
606
585
|
display: flex;
|
|
607
586
|
align-items: center;
|
|
587
|
+
justify-content: space-between;
|
|
608
588
|
width: 100%;
|
|
609
589
|
background-color: $gray-100;
|
|
610
590
|
padding: 0 $grid-unit-30;
|
package/src/navigation/index.php
CHANGED
|
@@ -250,29 +250,24 @@ function block_core_navigation_render_submenu_icon() {
|
|
|
250
250
|
|
|
251
251
|
|
|
252
252
|
/**
|
|
253
|
-
* Finds the
|
|
253
|
+
* Finds the most recently published `wp_navigation` Post.
|
|
254
254
|
*
|
|
255
255
|
* @return WP_Post|null the first non-empty Navigation or null.
|
|
256
256
|
*/
|
|
257
|
-
function
|
|
258
|
-
//
|
|
259
|
-
// see:
|
|
260
|
-
// - https://github.com/WordPress/wordpress-develop/blob/ba943e113d3b31b121f77a2d30aebe14b047c69d/src/wp-includes/nav-menu.php#L613-L619.
|
|
261
|
-
// - https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters.
|
|
257
|
+
function block_core_navigation_get_most_recently_published_navigation() {
|
|
258
|
+
// We default to the most recently created menu.
|
|
262
259
|
$parsed_args = array(
|
|
263
260
|
'post_type' => 'wp_navigation',
|
|
264
261
|
'no_found_rows' => true,
|
|
265
|
-
'order' => '
|
|
266
|
-
'orderby' => '
|
|
262
|
+
'order' => 'DESC',
|
|
263
|
+
'orderby' => 'date',
|
|
267
264
|
'post_status' => 'publish',
|
|
268
|
-
'posts_per_page' =>
|
|
265
|
+
'posts_per_page' => 1, // get only the most recent.
|
|
269
266
|
);
|
|
270
267
|
|
|
271
|
-
$
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
return $navigation_post;
|
|
275
|
-
}
|
|
268
|
+
$navigation_post = new WP_Query( $parsed_args );
|
|
269
|
+
if ( count( $navigation_post->posts ) > 0 ) {
|
|
270
|
+
return $navigation_post->posts[0];
|
|
276
271
|
}
|
|
277
272
|
|
|
278
273
|
return null;
|
|
@@ -325,7 +320,7 @@ function block_core_navigation_get_fallback_blocks() {
|
|
|
325
320
|
|
|
326
321
|
// Default to a list of Pages.
|
|
327
322
|
|
|
328
|
-
$navigation_post =
|
|
323
|
+
$navigation_post = block_core_navigation_get_most_recently_published_navigation();
|
|
329
324
|
|
|
330
325
|
// Prefer using the first non-empty Navigation as fallback if available.
|
|
331
326
|
if ( $navigation_post ) {
|
|
@@ -377,7 +372,7 @@ function block_core_navigation_from_block_get_post_ids( $block ) {
|
|
|
377
372
|
}
|
|
378
373
|
|
|
379
374
|
if ( 'core/navigation-link' === $block->name || 'core/navigation-submenu' === $block->name ) {
|
|
380
|
-
if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] ) {
|
|
375
|
+
if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] && isset( $block->attributes['id'] ) ) {
|
|
381
376
|
$post_ids[] = $block->attributes['id'];
|
|
382
377
|
}
|
|
383
378
|
}
|
|
@@ -615,16 +610,20 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
|
|
615
610
|
$is_hidden_by_default ? 'always-shown' : '',
|
|
616
611
|
);
|
|
617
612
|
|
|
618
|
-
$
|
|
619
|
-
$
|
|
620
|
-
$toggle_button_content
|
|
613
|
+
$should_display_icon_label = isset( $attributes['hasIcon'] ) && true === $attributes['hasIcon'];
|
|
614
|
+
$toggle_button_icon = '<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="4" y="7.5" width="16" height="1.5" /><rect x="4" y="15" width="16" height="1.5" /></svg>';
|
|
615
|
+
$toggle_button_content = $should_display_icon_label ? $toggle_button_icon : __( 'Menu' );
|
|
616
|
+
$toggle_close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';
|
|
617
|
+
$toggle_close_button_content = $should_display_icon_label ? $toggle_close_button_icon : __( 'Close' );
|
|
618
|
+
$toggle_aria_label_open = $should_display_icon_label ? 'aria-label="' . __( 'Open menu' ) . '"' : ''; // Open button label.
|
|
619
|
+
$toggle_aria_label_close = $should_display_icon_label ? 'aria-label="' . __( 'Close menu' ) . '"' : ''; // Close button label.
|
|
621
620
|
|
|
622
621
|
$responsive_container_markup = sprintf(
|
|
623
|
-
'<button aria-haspopup="true"
|
|
622
|
+
'<button aria-haspopup="true" %3$s class="%6$s" data-micromodal-trigger="%1$s">%9$s</button>
|
|
624
623
|
<div class="%5$s" style="%7$s" id="%1$s">
|
|
625
624
|
<div class="wp-block-navigation__responsive-close" tabindex="-1" data-micromodal-close>
|
|
626
625
|
<div class="wp-block-navigation__responsive-dialog" aria-label="%8$s">
|
|
627
|
-
<button
|
|
626
|
+
<button %4$s data-micromodal-close class="wp-block-navigation__responsive-container-close">%10$s</button>
|
|
628
627
|
<div class="wp-block-navigation__responsive-container-content" id="%1$s-content">
|
|
629
628
|
%2$s
|
|
630
629
|
</div>
|
|
@@ -633,13 +632,14 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
|
|
633
632
|
</div>',
|
|
634
633
|
esc_attr( $modal_unique_id ),
|
|
635
634
|
$inner_blocks_html,
|
|
636
|
-
|
|
637
|
-
|
|
635
|
+
$toggle_aria_label_open,
|
|
636
|
+
$toggle_aria_label_close,
|
|
638
637
|
esc_attr( implode( ' ', $responsive_container_classes ) ),
|
|
639
638
|
esc_attr( implode( ' ', $open_button_classes ) ),
|
|
640
639
|
safecss_filter_attr( $colors['overlay_inline_styles'] ),
|
|
641
640
|
__( 'Menu' ),
|
|
642
|
-
$toggle_button_content
|
|
641
|
+
$toggle_button_content,
|
|
642
|
+
$toggle_close_button_content
|
|
643
643
|
);
|
|
644
644
|
|
|
645
645
|
return sprintf(
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { sortBy } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -40,7 +35,9 @@ function mapMenuItemsToBlocks( menuItems ) {
|
|
|
40
35
|
let mapping = {};
|
|
41
36
|
|
|
42
37
|
// The menuItem should be in menu_order sort order.
|
|
43
|
-
const sortedItems =
|
|
38
|
+
const sortedItems = [ ...menuItems ].sort(
|
|
39
|
+
( a, b ) => a.menu_order - b.menu_order
|
|
40
|
+
);
|
|
44
41
|
|
|
45
42
|
const innerBlocks = sortedItems.map( ( menuItem ) => {
|
|
46
43
|
if ( menuItem.type === 'block' ) {
|
|
@@ -341,16 +341,17 @@ button.wp-block-navigation-item__content {
|
|
|
341
341
|
// We use :where to keep specificity minimal, yet still scope it to only the navigation block.
|
|
342
342
|
// That way if padding is set in theme.json, it still wins.
|
|
343
343
|
// https://css-tricks.com/almanac/selectors/w/where/
|
|
344
|
+
// Note: .wp-block-navigation-item targets both Page List and custom menu items. .wp-block-navigation-link targets only custom.
|
|
344
345
|
|
|
345
346
|
// When the menu has a background, items have paddings, reduce margins to compensate.
|
|
346
347
|
// Treat margins and paddings differently when the block has a background.
|
|
347
|
-
:where(.wp-block-navigation.has-background .wp-block-navigation-
|
|
348
|
+
:where(.wp-block-navigation.has-background .wp-block-navigation-item a:not(.wp-element-button)),
|
|
348
349
|
:where(.wp-block-navigation.has-background .wp-block-navigation-submenu a:not(.wp-element-button)) {
|
|
349
350
|
padding: 0.5em 1em;
|
|
350
351
|
}
|
|
351
352
|
|
|
352
353
|
// Provide a default padding for submenus who should always have some, regardless of the top level menu items.
|
|
353
|
-
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-
|
|
354
|
+
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item a:not(.wp-element-button)),
|
|
354
355
|
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu a:not(.wp-element-button)) {
|
|
355
356
|
padding: 0.5em 1em;
|
|
356
357
|
}
|
|
@@ -467,8 +468,11 @@ button.wp-block-navigation-item__content {
|
|
|
467
468
|
flex-direction: column;
|
|
468
469
|
background-color: inherit;
|
|
469
470
|
|
|
470
|
-
//
|
|
471
|
-
padding: 2rem;
|
|
471
|
+
// Try to inherit any root paddings set, so the X can align to a top-right aligned menu.
|
|
472
|
+
padding-top: var(--wp--style--root--padding-top, 2rem);
|
|
473
|
+
padding-right: var(--wp--style--root--padding-right, 2rem);
|
|
474
|
+
padding-bottom: var(--wp--style--root--padding-bottom, 2rem);
|
|
475
|
+
padding-left: var(--wp--style--root--padding-left, 2rem);
|
|
472
476
|
|
|
473
477
|
// Allow modal to scroll.
|
|
474
478
|
overflow: auto;
|
|
@@ -612,6 +616,7 @@ button.wp-block-navigation-item__content {
|
|
|
612
616
|
border: none;
|
|
613
617
|
margin: 0;
|
|
614
618
|
padding: 0;
|
|
619
|
+
text-transform: inherit;
|
|
615
620
|
|
|
616
621
|
svg {
|
|
617
622
|
fill: currentColor;
|
|
@@ -645,6 +650,11 @@ button.wp-block-navigation-item__content {
|
|
|
645
650
|
.wp-block-navigation__responsive-close {
|
|
646
651
|
width: 100%;
|
|
647
652
|
|
|
653
|
+
// Try to inherit wide-width when defined, so the X can align to a top-right aligned menu.
|
|
654
|
+
max-width: var(--wp--style--global--wide-size, 100%);
|
|
655
|
+
margin-left: auto;
|
|
656
|
+
margin-right: auto;
|
|
657
|
+
|
|
648
658
|
// This element is not keyboard accessible, and is focusable only using the mouse.
|
|
649
659
|
// It is part of the MicroModal library that adds a scrim outside of a modal dialog that is not fullscreen,
|
|
650
660
|
// where clicking that scrim closes the overlay just like the close button.
|
|
@@ -49,6 +49,20 @@ function resolveRecords( registry, menus ) {
|
|
|
49
49
|
} );
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
function resolveReadPermission( registry, allowed ) {
|
|
53
|
+
const dispatch = registry.dispatch( coreStore );
|
|
54
|
+
dispatch.receiveUserPermission( 'create/navigation', allowed );
|
|
55
|
+
dispatch.startResolution( 'canUser', [ 'read', 'navigation' ] );
|
|
56
|
+
dispatch.finishResolution( 'canUser', [ 'read', 'navigation' ] );
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function resolveReadRecordPermission( registry, ref, allowed ) {
|
|
60
|
+
const dispatch = registry.dispatch( coreStore );
|
|
61
|
+
dispatch.receiveUserPermission( 'create/navigation', allowed );
|
|
62
|
+
dispatch.startResolution( 'canUser', [ 'read', 'navigation', ref ] );
|
|
63
|
+
dispatch.finishResolution( 'canUser', [ 'read', 'navigation', ref ] );
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
function resolveCreatePermission( registry, allowed ) {
|
|
53
67
|
const dispatch = registry.dispatch( coreStore );
|
|
54
68
|
dispatch.receiveUserPermission( 'create/navigation', allowed );
|
|
@@ -105,9 +119,10 @@ describe( 'useNavigationMenus', () => {
|
|
|
105
119
|
} );
|
|
106
120
|
} );
|
|
107
121
|
|
|
108
|
-
it( 'Should return information about all menus when ref is missing', () => {
|
|
122
|
+
it( 'Should return information about all menus when the ref is missing', () => {
|
|
109
123
|
resolveRecords( registry, navigationMenus );
|
|
110
124
|
resolveCreatePermission( registry, true );
|
|
125
|
+
resolveReadPermission( registry, true );
|
|
111
126
|
expect( useNavigationMenu() ).toEqual( {
|
|
112
127
|
navigationMenus,
|
|
113
128
|
navigationMenu: undefined,
|
|
@@ -171,6 +186,7 @@ describe( 'useNavigationMenus', () => {
|
|
|
171
186
|
it( 'Should return correct permissions (create, update)', () => {
|
|
172
187
|
resolveRecords( registry, navigationMenus );
|
|
173
188
|
resolveCreatePermission( registry, true );
|
|
189
|
+
resolveReadRecordPermission( registry, 1, true );
|
|
174
190
|
resolveUpdatePermission( registry, 1, true );
|
|
175
191
|
resolveDeletePermission( registry, 1, false );
|
|
176
192
|
expect( useNavigationMenu( 1 ) ).toEqual( {
|
|
@@ -194,6 +210,7 @@ describe( 'useNavigationMenus', () => {
|
|
|
194
210
|
it( 'Should return correct permissions (delete only)', () => {
|
|
195
211
|
resolveRecords( registry, navigationMenus );
|
|
196
212
|
resolveCreatePermission( registry, false );
|
|
213
|
+
resolveReadRecordPermission( registry, 1, false );
|
|
197
214
|
resolveUpdatePermission( registry, 1, false );
|
|
198
215
|
resolveDeletePermission( registry, 1, true );
|
|
199
216
|
expect( useNavigationMenu( 1 ) ).toEqual( {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
store as coreStore,
|
|
6
|
-
|
|
6
|
+
useResourcePermissions,
|
|
7
7
|
} from '@wordpress/core-data';
|
|
8
8
|
import { useSelect } from '@wordpress/data';
|
|
9
9
|
|
|
@@ -12,10 +12,13 @@ export default function useNavigationMenu( ref ) {
|
|
|
12
12
|
|
|
13
13
|
return useSelect(
|
|
14
14
|
( select ) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const {
|
|
16
|
+
canCreate,
|
|
17
|
+
canUpdate,
|
|
18
|
+
canDelete,
|
|
19
|
+
isResolving,
|
|
20
|
+
hasResolved,
|
|
21
|
+
} = permissions;
|
|
19
22
|
|
|
20
23
|
const {
|
|
21
24
|
navigationMenus,
|
|
@@ -44,16 +47,16 @@ export default function useNavigationMenu( ref ) {
|
|
|
44
47
|
|
|
45
48
|
canUserCreateNavigationMenu: canCreate,
|
|
46
49
|
isResolvingCanUserCreateNavigationMenu: isResolving,
|
|
47
|
-
hasResolvedCanUserCreateNavigationMenu:
|
|
50
|
+
hasResolvedCanUserCreateNavigationMenu: hasResolved,
|
|
48
51
|
|
|
49
52
|
canUserUpdateNavigationMenu: canUpdate,
|
|
50
53
|
hasResolvedCanUserUpdateNavigationMenu: ref
|
|
51
|
-
?
|
|
54
|
+
? hasResolved
|
|
52
55
|
: undefined,
|
|
53
56
|
|
|
54
57
|
canUserDeleteNavigationMenu: canDelete,
|
|
55
58
|
hasResolvedCanUserDeleteNavigationMenu: ref
|
|
56
|
-
?
|
|
59
|
+
? hasResolved
|
|
57
60
|
: undefined,
|
|
58
61
|
};
|
|
59
62
|
},
|
|
@@ -42,7 +42,10 @@ import {
|
|
|
42
42
|
} from '@wordpress/element';
|
|
43
43
|
import { placeCaretAtHorizontalEdge } from '@wordpress/dom';
|
|
44
44
|
import { link as linkIcon, addSubmenu } from '@wordpress/icons';
|
|
45
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
store as coreStore,
|
|
47
|
+
useResourcePermissions,
|
|
48
|
+
} from '@wordpress/core-data';
|
|
46
49
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
47
50
|
|
|
48
51
|
/**
|
|
@@ -463,14 +466,15 @@ export default function NavigationLinkEdit( {
|
|
|
463
466
|
const itemLabelPlaceholder = __( 'Add link…' );
|
|
464
467
|
const ref = useRef();
|
|
465
468
|
|
|
469
|
+
const pagesPermissions = useResourcePermissions( 'pages' );
|
|
470
|
+
const postsPermissions = useResourcePermissions( 'posts' );
|
|
471
|
+
|
|
466
472
|
const {
|
|
467
473
|
innerBlocks,
|
|
468
474
|
isAtMaxNesting,
|
|
469
475
|
isTopLevelLink,
|
|
470
476
|
isParentOfSelectedBlock,
|
|
471
477
|
hasChildren,
|
|
472
|
-
userCanCreatePages,
|
|
473
|
-
userCanCreatePosts,
|
|
474
478
|
} = useSelect(
|
|
475
479
|
( select ) => {
|
|
476
480
|
const {
|
|
@@ -497,14 +501,6 @@ export default function NavigationLinkEdit( {
|
|
|
497
501
|
true
|
|
498
502
|
),
|
|
499
503
|
hasChildren: !! getBlockCount( clientId ),
|
|
500
|
-
userCanCreatePages: select( coreStore ).canUser(
|
|
501
|
-
'create',
|
|
502
|
-
'pages'
|
|
503
|
-
),
|
|
504
|
-
userCanCreatePosts: select( coreStore ).canUser(
|
|
505
|
-
'create',
|
|
506
|
-
'posts'
|
|
507
|
-
),
|
|
508
504
|
};
|
|
509
505
|
},
|
|
510
506
|
[ clientId ]
|
|
@@ -606,9 +602,9 @@ export default function NavigationLinkEdit( {
|
|
|
606
602
|
|
|
607
603
|
let userCanCreate = false;
|
|
608
604
|
if ( ! type || type === 'page' ) {
|
|
609
|
-
userCanCreate =
|
|
605
|
+
userCanCreate = pagesPermissions.canCreate;
|
|
610
606
|
} else if ( type === 'post' ) {
|
|
611
|
-
userCanCreate =
|
|
607
|
+
userCanCreate = postsPermissions.canCreate;
|
|
612
608
|
}
|
|
613
609
|
|
|
614
610
|
async function handleCreate( pageTitle ) {
|
|
@@ -39,7 +39,10 @@ import {
|
|
|
39
39
|
} from '@wordpress/element';
|
|
40
40
|
import { placeCaretAtHorizontalEdge } from '@wordpress/dom';
|
|
41
41
|
import { link as linkIcon, removeSubmenu } from '@wordpress/icons';
|
|
42
|
-
import {
|
|
42
|
+
import {
|
|
43
|
+
useResourcePermissions,
|
|
44
|
+
store as coreStore,
|
|
45
|
+
} from '@wordpress/core-data';
|
|
43
46
|
import { speak } from '@wordpress/a11y';
|
|
44
47
|
import { createBlock } from '@wordpress/blocks';
|
|
45
48
|
|
|
@@ -294,6 +297,9 @@ export default function NavigationSubmenuEdit( {
|
|
|
294
297
|
const itemLabelPlaceholder = __( 'Add text…' );
|
|
295
298
|
const ref = useRef();
|
|
296
299
|
|
|
300
|
+
const pagesPermissions = useResourcePermissions( 'pages' );
|
|
301
|
+
const postsPermissions = useResourcePermissions( 'posts' );
|
|
302
|
+
|
|
297
303
|
const {
|
|
298
304
|
isAtMaxNesting,
|
|
299
305
|
isTopLevelItem,
|
|
@@ -301,8 +307,6 @@ export default function NavigationSubmenuEdit( {
|
|
|
301
307
|
isImmediateParentOfSelectedBlock,
|
|
302
308
|
hasChildren,
|
|
303
309
|
selectedBlockHasChildren,
|
|
304
|
-
userCanCreatePages,
|
|
305
|
-
userCanCreatePosts,
|
|
306
310
|
onlyDescendantIsEmptyLink,
|
|
307
311
|
} = useSelect(
|
|
308
312
|
( select ) => {
|
|
@@ -348,14 +352,6 @@ export default function NavigationSubmenuEdit( {
|
|
|
348
352
|
),
|
|
349
353
|
hasChildren: !! getBlockCount( clientId ),
|
|
350
354
|
selectedBlockHasChildren: !! selectedBlockChildren?.length,
|
|
351
|
-
userCanCreatePages: select( coreStore ).canUser(
|
|
352
|
-
'create',
|
|
353
|
-
'pages'
|
|
354
|
-
),
|
|
355
|
-
userCanCreatePosts: select( coreStore ).canUser(
|
|
356
|
-
'create',
|
|
357
|
-
'posts'
|
|
358
|
-
),
|
|
359
355
|
onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,
|
|
360
356
|
};
|
|
361
357
|
},
|
|
@@ -426,9 +422,9 @@ export default function NavigationSubmenuEdit( {
|
|
|
426
422
|
|
|
427
423
|
let userCanCreate = false;
|
|
428
424
|
if ( ! type || type === 'page' ) {
|
|
429
|
-
userCanCreate =
|
|
425
|
+
userCanCreate = pagesPermissions.canCreate;
|
|
430
426
|
} else if ( type === 'post' ) {
|
|
431
|
-
userCanCreate =
|
|
427
|
+
userCanCreate = postsPermissions.canCreate;
|
|
432
428
|
}
|
|
433
429
|
|
|
434
430
|
async function handleCreate( pageTitle ) {
|
package/src/page-list/edit.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { sortBy } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -133,7 +132,12 @@ function usePageData() {
|
|
|
133
132
|
// TODO: Once the REST API supports passing multiple values to
|
|
134
133
|
// 'orderby', this can be removed.
|
|
135
134
|
// https://core.trac.wordpress.org/ticket/39037
|
|
136
|
-
const sortedPages =
|
|
135
|
+
const sortedPages = [ ...( pages ?? [] ) ].sort( ( a, b ) => {
|
|
136
|
+
if ( a.menu_order === b.menu_order ) {
|
|
137
|
+
return a.title.rendered.localeCompare( b.title.rendered );
|
|
138
|
+
}
|
|
139
|
+
return a.menu_order - b.menu_order;
|
|
140
|
+
} );
|
|
137
141
|
const pagesByParentId = sortedPages.reduce( ( accumulator, page ) => {
|
|
138
142
|
const { parent } = page;
|
|
139
143
|
if ( accumulator.has( parent ) ) {
|
package/src/paragraph/block.json
CHANGED
|
@@ -34,15 +34,22 @@
|
|
|
34
34
|
"anchor": true,
|
|
35
35
|
"className": false,
|
|
36
36
|
"color": {
|
|
37
|
+
"gradients": true,
|
|
37
38
|
"link": true,
|
|
38
39
|
"__experimentalDefaultControls": {
|
|
39
40
|
"background": true,
|
|
40
41
|
"text": true
|
|
41
42
|
}
|
|
42
43
|
},
|
|
44
|
+
"spacing": {
|
|
45
|
+
"margin": true,
|
|
46
|
+
"padding": true
|
|
47
|
+
},
|
|
43
48
|
"typography": {
|
|
44
49
|
"fontSize": true,
|
|
45
50
|
"lineHeight": true,
|
|
51
|
+
"__experimentalFontFamily": true,
|
|
52
|
+
"__experimentalTextDecoration": true,
|
|
46
53
|
"__experimentalFontStyle": true,
|
|
47
54
|
"__experimentalFontWeight": true,
|
|
48
55
|
"__experimentalLetterSpacing": true,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { omit } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -74,21 +73,27 @@ const migrateCustomColorsAndFontSizes = ( attributes ) => {
|
|
|
74
73
|
if ( attributes.customFontSize ) {
|
|
75
74
|
style.typography = { fontSize: attributes.customFontSize };
|
|
76
75
|
}
|
|
76
|
+
|
|
77
|
+
const {
|
|
78
|
+
customTextColor,
|
|
79
|
+
customBackgroundColor,
|
|
80
|
+
customFontSize,
|
|
81
|
+
...restAttributes
|
|
82
|
+
} = attributes;
|
|
83
|
+
|
|
77
84
|
return {
|
|
78
|
-
...
|
|
79
|
-
'customTextColor',
|
|
80
|
-
'customBackgroundColor',
|
|
81
|
-
'customFontSize',
|
|
82
|
-
] ),
|
|
85
|
+
...restAttributes,
|
|
83
86
|
style,
|
|
84
87
|
};
|
|
85
88
|
};
|
|
86
89
|
|
|
90
|
+
const { style, ...restBlockAttributes } = blockAttributes;
|
|
91
|
+
|
|
87
92
|
const deprecated = [
|
|
88
93
|
{
|
|
89
94
|
supports,
|
|
90
95
|
attributes: {
|
|
91
|
-
...
|
|
96
|
+
...restBlockAttributes,
|
|
92
97
|
customTextColor: {
|
|
93
98
|
type: 'string',
|
|
94
99
|
},
|
|
@@ -153,7 +158,7 @@ const deprecated = [
|
|
|
153
158
|
{
|
|
154
159
|
supports,
|
|
155
160
|
attributes: {
|
|
156
|
-
...
|
|
161
|
+
...restBlockAttributes,
|
|
157
162
|
customTextColor: {
|
|
158
163
|
type: 'string',
|
|
159
164
|
},
|
|
@@ -218,7 +223,7 @@ const deprecated = [
|
|
|
218
223
|
{
|
|
219
224
|
supports,
|
|
220
225
|
attributes: {
|
|
221
|
-
...
|
|
226
|
+
...restBlockAttributes,
|
|
222
227
|
customTextColor: {
|
|
223
228
|
type: 'string',
|
|
224
229
|
},
|
|
@@ -284,15 +289,12 @@ const deprecated = [
|
|
|
284
289
|
},
|
|
285
290
|
{
|
|
286
291
|
supports,
|
|
287
|
-
attributes:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
type: 'number',
|
|
292
|
-
},
|
|
292
|
+
attributes: {
|
|
293
|
+
...restBlockAttributes,
|
|
294
|
+
fontSize: {
|
|
295
|
+
type: 'number',
|
|
293
296
|
},
|
|
294
|
-
|
|
295
|
-
),
|
|
297
|
+
},
|
|
296
298
|
save( { attributes } ) {
|
|
297
299
|
const {
|
|
298
300
|
width,
|
|
@@ -325,25 +327,21 @@ const deprecated = [
|
|
|
325
327
|
);
|
|
326
328
|
},
|
|
327
329
|
migrate( attributes ) {
|
|
328
|
-
return migrateCustomColorsAndFontSizes(
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
return migrateCustomColorsAndFontSizes( {
|
|
331
|
+
...attributes,
|
|
332
|
+
customFontSize: Number.isFinite( attributes.fontSize )
|
|
333
|
+
? attributes.fontSize
|
|
334
|
+
: undefined,
|
|
335
|
+
customTextColor:
|
|
336
|
+
attributes.textColor && '#' === attributes.textColor[ 0 ]
|
|
337
|
+
? attributes.textColor
|
|
333
338
|
: undefined,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
attributes.backgroundColor &&
|
|
341
|
-
'#' === attributes.backgroundColor[ 0 ]
|
|
342
|
-
? attributes.backgroundColor
|
|
343
|
-
: undefined,
|
|
344
|
-
} ),
|
|
345
|
-
[ 'fontSize', 'textColor', 'backgroundColor', 'style' ]
|
|
346
|
-
);
|
|
339
|
+
customBackgroundColor:
|
|
340
|
+
attributes.backgroundColor &&
|
|
341
|
+
'#' === attributes.backgroundColor[ 0 ]
|
|
342
|
+
? attributes.backgroundColor
|
|
343
|
+
: undefined,
|
|
344
|
+
} );
|
|
347
345
|
},
|
|
348
346
|
},
|
|
349
347
|
{
|
package/src/paragraph/edit.js
CHANGED
|
@@ -146,6 +146,7 @@ function ParagraphBlock( {
|
|
|
146
146
|
}
|
|
147
147
|
data-empty={ content ? false : true }
|
|
148
148
|
placeholder={ placeholder || __( 'Type / to choose a block' ) }
|
|
149
|
+
data-custom-placeholder={ placeholder ? true : undefined }
|
|
149
150
|
__unstableEmbedURLOnPaste
|
|
150
151
|
__unstableAllowPrefixTransformations
|
|
151
152
|
/>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
min-height: auto !important;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
// Hide multiple sequential paragraphs.
|
|
6
|
+
// Hide multiple sequential paragraphs, but don't hide placeholders if a custom placeholder is set.
|
|
7
7
|
.block-editor-block-list__block[data-empty="true"] {
|
|
8
8
|
[data-rich-text-placeholder] {
|
|
9
9
|
opacity: 1;
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.block-editor-block-list__block[data-empty="true"] + .block-editor-block-list__block[data-empty="true"] {
|
|
14
|
-
[data-
|
|
15
|
-
|
|
14
|
+
&:not([data-custom-placeholder="true"]) {
|
|
15
|
+
[data-rich-text-placeholder] {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
}
|