@wordpress/block-library 7.11.0 → 7.13.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 +9 -1
- package/build/archives/edit.js +7 -0
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +9 -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/block/edit.js +4 -2
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +4 -2
- package/build/block/edit.native.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/calendar/edit.js +12 -5
- package/build/calendar/edit.js.map +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 +8 -3
- 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/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/resizable-cover.js +6 -0
- package/build/cover/edit/resizable-cover.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/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/transforms.js +5 -0
- package/build/group/transforms.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/image/edit.js +13 -1
- 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/index.native.js +23 -7
- package/build/index.native.js.map +1 -1
- package/build/list/index.js +10 -0
- package/build/list/index.js.map +1 -1
- package/build/list/v2/edit.js +16 -5
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/tag-name.js +31 -0
- package/build/list/v2/tag-name.js.map +1 -0
- package/build/list/v2/tag-name.native.js +32 -0
- package/build/list/v2/tag-name.native.js.map +1 -0
- package/build/list/v2/transforms.js +1 -11
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +4 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +158 -0
- package/build/list-item/edit.native.js.map +1 -0
- 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 +42 -0
- package/build/list-item/hooks/use-copy.js.map +1 -0
- package/build/list-item/icons.native.js +53 -0
- package/build/list-item/icons.native.js.map +1 -0
- package/build/list-item/list-style-type.native.js +139 -0
- package/build/list-item/list-style-type.native.js.map +1 -0
- package/build/list-item/utils.js +4 -0
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +193 -67
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +2 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +17 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.js +1 -1
- package/build/media-text/media-container.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 +180 -154
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +11 -14
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +4 -2
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +13 -3
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +2 -1
- 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/edit/use-create-navigation-menu.js +5 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-inner-blocks.js +43 -0
- package/build/navigation/edit/use-inner-blocks.js.map +1 -0
- package/build/navigation/edit/utils.js +28 -0
- package/build/navigation/edit/utils.js.map +1 -0
- 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 +15 -10
- 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/edit.js +5 -2
- package/build/post-author/edit.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/edit.js +7 -1
- package/build/post-author-biography/edit.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-content/edit.js +4 -2
- package/build/post-content/edit.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-featured-image/edit.js +43 -14
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +21 -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/index.js +5 -3
- package/build/post-terms/index.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/index.js +42 -9
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +22 -14
- 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-title/edit.js +30 -8
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +11 -2
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +10 -0
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/deprecated.js +13 -6
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/transforms.js +24 -39
- 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/edit.js +1 -1
- package/build/separator/edit.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 +44 -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/edit/index.js +4 -2
- package/build/template-part/edit/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 +4 -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 +1 -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/edit.js +7 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +9 -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/block/edit.js +5 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +5 -3
- package/build-module/block/edit.native.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/calendar/edit.js +12 -4
- package/build-module/calendar/edit.js.map +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 +9 -4
- 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/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/resizable-cover.js +6 -0
- package/build-module/cover/edit/resizable-cover.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/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/transforms.js +5 -0
- package/build-module/group/transforms.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/image/edit.js +14 -2
- 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/index.native.js +22 -6
- package/build-module/index.native.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/edit.js +15 -5
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/tag-name.js +21 -0
- package/build-module/list/v2/tag-name.js.map +1 -0
- package/build-module/list/v2/tag-name.native.js +21 -0
- package/build-module/list/v2/tag-name.native.js.map +1 -0
- package/build-module/list/v2/transforms.js +1 -10
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +5 -5
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +141 -0
- package/build-module/list-item/edit.native.js.map +1 -0
- 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 +32 -0
- package/build-module/list-item/hooks/use-copy.js.map +1 -0
- package/build-module/list-item/icons.native.js +37 -0
- package/build-module/list-item/icons.native.js.map +1 -0
- package/build-module/list-item/list-style-type.native.js +126 -0
- package/build-module/list-item/list-style-type.native.js.map +1 -0
- package/build-module/list-item/utils.js +4 -0
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +195 -67
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +2 -1
- package/build-module/media-text/edit.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/media-text/media-container.js +1 -1
- package/build-module/media-text/media-container.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 +178 -154
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +4 -2
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +12 -3
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -1
- 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/edit/use-create-navigation-menu.js +5 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-inner-blocks.js +33 -0
- package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
- package/build-module/navigation/edit/utils.js +21 -0
- package/build-module/navigation/edit/utils.js.map +1 -0
- 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 +15 -10
- 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/edit.js +5 -2
- package/build-module/post-author/edit.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/edit.js +6 -1
- package/build-module/post-author-biography/edit.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-content/edit.js +5 -3
- package/build-module/post-content/edit.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-featured-image/edit.js +45 -16
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +21 -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/index.js +5 -3
- package/build-module/post-terms/index.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/index.js +42 -9
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +17 -12
- 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-title/edit.js +30 -9
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +11 -2
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +10 -0
- package/build-module/query-title/variations.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/transforms.js +25 -40
- 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/edit.js +1 -1
- package/build-module/separator/edit.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 +46 -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/edit/index.js +5 -3
- package/build-module/template-part/edit/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 +4 -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 +1 -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 +6 -6
- package/build-style/button/style.css +6 -6
- package/build-style/editor-rtl.css +115 -122
- package/build-style/editor.css +115 -122
- package/build-style/group/editor-rtl.css +27 -8
- package/build-style/group/editor.css +27 -8
- package/build-style/image/editor-rtl.css +21 -2
- package/build-style/image/editor.css +21 -2
- package/build-style/latest-posts/editor-rtl.css +3 -0
- package/build-style/latest-posts/editor.css +3 -0
- 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 +8 -4
- package/build-style/navigation/editor.css +8 -4
- package/build-style/navigation/style-rtl.css +17 -19
- package/build-style/navigation/style.css +17 -19
- 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/editor-rtl.css +7 -0
- package/build-style/query/editor.css +7 -0
- package/build-style/query-pagination/style-rtl.css +6 -0
- package/build-style/query-pagination/style.css +6 -0
- package/build-style/query-title/style-rtl.css +79 -0
- package/build-style/query-title/style.css +79 -0
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -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 +52 -35
- package/build-style/style.css +52 -35
- package/build-style/tag-cloud/style-rtl.css +1 -0
- package/build-style/tag-cloud/style.css +1 -0
- package/build-style/video/style-rtl.css +3 -0
- package/build-style/video/style.css +3 -0
- package/package.json +30 -30
- package/src/archives/block.json +9 -1
- package/src/archives/edit.js +12 -1
- package/src/archives/index.php +5 -3
- package/src/audio/block.json +4 -0
- package/src/audio/style.scss +2 -0
- package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
- package/src/block/edit.js +4 -4
- package/src/block/edit.native.js +4 -4
- package/src/button/block.json +1 -1
- package/src/button/deprecated.js +21 -22
- package/src/button/style.scss +6 -6
- package/src/calendar/edit.js +11 -4
- 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/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 +10 -4
- 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/resizable-cover.js +6 -0
- package/src/cover/index.php +2 -2
- package/src/cover/shared.js +2 -1
- package/src/embed/icons.js +1 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
- package/src/gallery/block.json +5 -0
- package/src/gallery/deprecated.js +4 -2
- package/src/gallery/edit.js +22 -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 +28 -3
- package/src/group/transforms.js +7 -0
- 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/edit.js +19 -20
- package/src/home-link/index.php +8 -17
- package/src/image/block.json +13 -7
- package/src/image/edit.js +19 -1
- package/src/image/editor.scss +39 -3
- package/src/image/index.php +1 -1
- package/src/image/test/edit.native.js +6 -10
- package/src/index.native.js +30 -12
- package/src/latest-posts/editor.scss +5 -0
- package/src/list/block.json +4 -0
- package/src/list/index.js +1 -1
- package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
- package/src/list/test/edit.native.js +511 -7
- package/src/list/v2/edit.js +12 -4
- package/src/list/v2/tag-name.js +13 -0
- package/src/list/v2/tag-name.native.js +12 -0
- package/src/list/v2/transforms.js +1 -9
- package/src/list-item/edit.js +3 -2
- package/src/list-item/edit.native.js +148 -0
- package/src/list-item/hooks/index.js +1 -0
- package/src/list-item/hooks/use-copy.js +36 -0
- package/src/list-item/icons.native.js +34 -0
- package/src/list-item/list-style-type.native.js +146 -0
- package/src/list-item/style.native.scss +49 -0
- package/src/media-text/block.json +17 -0
- package/src/media-text/deprecated.js +564 -417
- package/src/media-text/edit.js +1 -0
- package/src/media-text/media-container.js +3 -1
- package/src/media-text/style.scss +2 -0
- package/src/media-text/test/media-container.js +24 -0
- package/src/navigation/block.json +1 -0
- package/src/navigation/deprecated.js +4 -2
- package/src/navigation/edit/index.js +234 -237
- package/src/navigation/edit/navigation-menu-selector.js +12 -26
- package/src/navigation/edit/placeholder/index.js +4 -2
- package/src/navigation/edit/responsive-wrapper.js +24 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
- package/src/navigation/edit/use-create-navigation-menu.js +4 -0
- package/src/navigation/edit/use-inner-blocks.js +39 -0
- package/src/navigation/edit/utils.js +30 -0
- package/src/navigation/editor.scss +3 -2
- package/src/navigation/index.php +17 -16
- package/src/navigation/menu-items-to-blocks.js +3 -6
- package/src/navigation/style.scss +13 -22
- package/src/navigation/test/use-navigation-menu.js +18 -1
- package/src/navigation/use-navigation-menu.js +20 -13
- package/src/navigation-link/edit.js +9 -13
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/edit.js +9 -13
- package/src/navigation-submenu/index.php +1 -1
- package/src/page-list/edit.js +6 -2
- package/src/page-list/index.php +4 -4
- 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/edit.js +6 -3
- package/src/post-author-biography/block.json +1 -0
- package/src/post-author-biography/edit.js +4 -1
- 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-content/edit.js +4 -4
- 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-featured-image/block.json +21 -0
- package/src/post-featured-image/edit.js +66 -14
- package/src/post-featured-image/editor.scss +44 -53
- package/src/post-featured-image/index.php +64 -5
- 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-title/block.json +2 -1
- package/src/post-title/index.php +2 -1
- package/src/post-title/style.scss +2 -0
- package/src/preformatted/block.json +4 -2
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -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/index.js +129 -65
- package/src/query/edit/inspector-controls/taxonomy-controls.js +18 -11
- package/src/query/edit/query-placeholder.js +17 -2
- package/src/query/editor.scss +9 -0
- package/src/query/utils.js +29 -7
- package/src/query-no-results/edit.js +1 -1
- package/src/query-pagination/style.scss +14 -0
- package/src/query-title/block.json +11 -2
- package/src/query-title/edit.js +51 -7
- package/src/query-title/index.php +28 -2
- package/src/query-title/style.scss +4 -0
- package/src/query-title/variations.js +13 -0
- package/src/quote/deprecated.js +6 -5
- package/src/quote/transforms.js +6 -24
- package/src/search/index.php +1 -1
- package/src/search/style.scss +2 -0
- package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
- package/src/separator/block.json +1 -0
- package/src/separator/deprecated.js +2 -3
- package/src/separator/edit.js +1 -1
- package/src/separator/test/edit.js +5 -3
- package/src/site-logo/editor.scss +8 -66
- package/src/site-title/index.php +8 -9
- package/src/social-link/icons/reddit.js +1 -1
- package/src/social-link/index.php +2 -2
- 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 +48 -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/tag-cloud/style.scss +1 -0
- package/src/template-part/edit/index.js +4 -4
- package/src/template-part/index.js +3 -2
- package/src/term-description/block.json +4 -0
- package/src/text-columns/edit.js +2 -2
- package/src/text-columns/save.js +2 -2
- package/src/verse/block.json +1 -0
- package/src/video/block.json +4 -0
- package/src/video/style.scss +2 -0
package/src/query/utils.js
CHANGED
|
@@ -10,6 +10,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
import { useMemo } from '@wordpress/element';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
13
|
+
import { cloneBlock } from '@wordpress/blocks';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @typedef IHasNameAndId
|
|
@@ -127,21 +128,42 @@ export const useTaxonomies = ( postType ) => {
|
|
|
127
128
|
};
|
|
128
129
|
|
|
129
130
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
131
|
+
* Clones a pattern's blocks and then recurses over that list of blocks,
|
|
132
|
+
* transforming them to retain some `query` attribute properties.
|
|
133
|
+
* For now we retain the `postType` and `inherit` properties as they are
|
|
134
|
+
* fundamental for the expected functionality of the block and don't affect
|
|
135
|
+
* its design and presentation.
|
|
132
136
|
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
137
|
+
* Returns the cloned/transformed blocks and array of existing Query Loop
|
|
138
|
+
* client ids for further manipulation, in order to avoid multiple recursions.
|
|
139
|
+
*
|
|
140
|
+
* @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).
|
|
141
|
+
* @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.
|
|
142
|
+
* @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.
|
|
135
143
|
*/
|
|
136
|
-
export const
|
|
137
|
-
|
|
144
|
+
export const getTransformedBlocksFromPattern = (
|
|
145
|
+
blocks,
|
|
146
|
+
queryBlockAttributes
|
|
147
|
+
) => {
|
|
148
|
+
const {
|
|
149
|
+
query: { postType, inherit },
|
|
150
|
+
} = queryBlockAttributes;
|
|
151
|
+
const clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );
|
|
152
|
+
const queryClientIds = [];
|
|
153
|
+
const blocksQueue = [ ...clonedBlocks ];
|
|
138
154
|
while ( blocksQueue.length > 0 ) {
|
|
139
155
|
const block = blocksQueue.shift();
|
|
140
156
|
if ( block.name === 'core/query' ) {
|
|
141
|
-
|
|
157
|
+
block.attributes.query = {
|
|
158
|
+
...block.attributes.query,
|
|
159
|
+
postType,
|
|
160
|
+
inherit,
|
|
161
|
+
};
|
|
162
|
+
queryClientIds.push( block.clientId );
|
|
142
163
|
}
|
|
143
164
|
block.innerBlocks?.forEach( ( innerBlock ) => {
|
|
144
165
|
blocksQueue.push( innerBlock );
|
|
145
166
|
} );
|
|
146
167
|
}
|
|
168
|
+
return { newBlocks: clonedBlocks, queryClientIds };
|
|
147
169
|
};
|
|
@@ -13,6 +13,20 @@ $pagination-margin: 0.5em;
|
|
|
13
13
|
margin-right: 0;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
// This moves the next link to the right side of the container,
|
|
18
|
+
// which is important when it's the only block displayed
|
|
19
|
+
// and the block has a "space-between" justification.
|
|
20
|
+
&.is-content-justification-space-between {
|
|
21
|
+
> .wp-block-query-pagination-next:last-child {
|
|
22
|
+
margin-inline-start: auto;
|
|
23
|
+
}
|
|
24
|
+
> .wp-block-query-pagination-previous:first-child {
|
|
25
|
+
margin-inline-end: auto;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
16
30
|
.wp-block-query-pagination-previous-arrow {
|
|
17
31
|
margin-right: 1ch;
|
|
18
32
|
display: inline-block; // Needed so that the transform works.
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
"level": {
|
|
17
17
|
"type": "number",
|
|
18
18
|
"default": 1
|
|
19
|
+
},
|
|
20
|
+
"showPrefix": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": true
|
|
23
|
+
},
|
|
24
|
+
"showSearchTerm": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"default": true
|
|
19
27
|
}
|
|
20
28
|
},
|
|
21
29
|
"supports": {
|
|
@@ -29,7 +37,8 @@
|
|
|
29
37
|
}
|
|
30
38
|
},
|
|
31
39
|
"spacing": {
|
|
32
|
-
"margin": true
|
|
40
|
+
"margin": true,
|
|
41
|
+
"padding": true
|
|
33
42
|
},
|
|
34
43
|
"typography": {
|
|
35
44
|
"fontSize": true,
|
|
@@ -46,5 +55,5 @@
|
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
},
|
|
49
|
-
"
|
|
58
|
+
"style": "wp-block-query-title"
|
|
50
59
|
}
|
package/src/query-title/edit.js
CHANGED
|
@@ -9,9 +9,11 @@ import classnames from 'classnames';
|
|
|
9
9
|
import {
|
|
10
10
|
AlignmentControl,
|
|
11
11
|
BlockControls,
|
|
12
|
+
InspectorControls,
|
|
12
13
|
useBlockProps,
|
|
13
14
|
Warning,
|
|
14
15
|
} from '@wordpress/block-editor';
|
|
16
|
+
import { ToggleControl, PanelBody } from '@wordpress/components';
|
|
15
17
|
import { __ } from '@wordpress/i18n';
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -19,21 +21,19 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
21
|
*/
|
|
20
22
|
import HeadingLevelDropdown from '../heading/heading-level-dropdown';
|
|
21
23
|
|
|
22
|
-
const SUPPORTED_TYPES = [ 'archive' ];
|
|
24
|
+
const SUPPORTED_TYPES = [ 'archive', 'search' ];
|
|
23
25
|
|
|
24
26
|
export default function QueryTitleEdit( {
|
|
25
|
-
attributes: { type, level, textAlign },
|
|
27
|
+
attributes: { type, level, textAlign, showPrefix, showSearchTerm },
|
|
26
28
|
setAttributes,
|
|
27
29
|
} ) {
|
|
28
30
|
const TagName = `h${ level }`;
|
|
29
31
|
const blockProps = useBlockProps( {
|
|
30
|
-
className: classnames( {
|
|
32
|
+
className: classnames( 'wp-block-query-title__placeholder', {
|
|
31
33
|
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
32
|
-
'wp-block-query-title__placeholder': type === 'archive',
|
|
33
34
|
} ),
|
|
34
35
|
} );
|
|
35
|
-
|
|
36
|
-
// block variations like `Search Title`.
|
|
36
|
+
|
|
37
37
|
if ( ! SUPPORTED_TYPES.includes( type ) ) {
|
|
38
38
|
return (
|
|
39
39
|
<div { ...blockProps }>
|
|
@@ -45,9 +45,53 @@ export default function QueryTitleEdit( {
|
|
|
45
45
|
let titleElement;
|
|
46
46
|
if ( type === 'archive' ) {
|
|
47
47
|
titleElement = (
|
|
48
|
-
|
|
48
|
+
<>
|
|
49
|
+
<InspectorControls>
|
|
50
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
51
|
+
<ToggleControl
|
|
52
|
+
label={ __( 'Show archive type in title' ) }
|
|
53
|
+
onChange={ () =>
|
|
54
|
+
setAttributes( { showPrefix: ! showPrefix } )
|
|
55
|
+
}
|
|
56
|
+
checked={ showPrefix }
|
|
57
|
+
/>
|
|
58
|
+
</PanelBody>
|
|
59
|
+
</InspectorControls>
|
|
60
|
+
<TagName { ...blockProps }>
|
|
61
|
+
{ showPrefix
|
|
62
|
+
? __( 'Archive type: Name' )
|
|
63
|
+
: __( 'Archive title' ) }
|
|
64
|
+
</TagName>
|
|
65
|
+
</>
|
|
49
66
|
);
|
|
50
67
|
}
|
|
68
|
+
|
|
69
|
+
if ( type === 'search' ) {
|
|
70
|
+
titleElement = (
|
|
71
|
+
<>
|
|
72
|
+
<InspectorControls>
|
|
73
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
74
|
+
<ToggleControl
|
|
75
|
+
label={ __( 'Show search term in title' ) }
|
|
76
|
+
onChange={ () =>
|
|
77
|
+
setAttributes( {
|
|
78
|
+
showSearchTerm: ! showSearchTerm,
|
|
79
|
+
} )
|
|
80
|
+
}
|
|
81
|
+
checked={ showSearchTerm }
|
|
82
|
+
/>
|
|
83
|
+
</PanelBody>
|
|
84
|
+
</InspectorControls>
|
|
85
|
+
|
|
86
|
+
<TagName { ...blockProps }>
|
|
87
|
+
{ showSearchTerm
|
|
88
|
+
? __( 'Search results for: "search term"' )
|
|
89
|
+
: __( 'Search results' ) }
|
|
90
|
+
</TagName>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
51
95
|
return (
|
|
52
96
|
<>
|
|
53
97
|
<BlockControls group="block">
|
|
@@ -17,13 +17,39 @@
|
|
|
17
17
|
function render_block_core_query_title( $attributes ) {
|
|
18
18
|
$type = isset( $attributes['type'] ) ? $attributes['type'] : null;
|
|
19
19
|
$is_archive = is_archive();
|
|
20
|
-
|
|
20
|
+
$is_search = is_search();
|
|
21
|
+
if ( ! $type ||
|
|
22
|
+
( 'archive' === $type && ! $is_archive ) ||
|
|
23
|
+
( 'search' === $type && ! $is_search )
|
|
24
|
+
) {
|
|
21
25
|
return '';
|
|
22
26
|
}
|
|
23
27
|
$title = '';
|
|
24
28
|
if ( $is_archive ) {
|
|
25
|
-
$
|
|
29
|
+
$show_prefix = isset( $attributes['showPrefix'] ) ? $attributes['showPrefix'] : true;
|
|
30
|
+
if ( ! $show_prefix ) {
|
|
31
|
+
$filter_title = function( $title, $original_title ) {
|
|
32
|
+
return $original_title;
|
|
33
|
+
};
|
|
34
|
+
add_filter( 'get_the_archive_title', $filter_title, 10, 2 );
|
|
35
|
+
$title = get_the_archive_title();
|
|
36
|
+
remove_filter( 'get_the_archive_title', $filter_title, 10, 2 );
|
|
37
|
+
} else {
|
|
38
|
+
$title = get_the_archive_title();
|
|
39
|
+
}
|
|
26
40
|
}
|
|
41
|
+
if ( $is_search ) {
|
|
42
|
+
$title = __( 'Search results' );
|
|
43
|
+
|
|
44
|
+
if ( isset( $attributes['showSearchTerm'] ) && $attributes['showSearchTerm'] ) {
|
|
45
|
+
$title = sprintf(
|
|
46
|
+
/* translators: %s is the search term. */
|
|
47
|
+
__( 'Search results for: "%s"' ),
|
|
48
|
+
get_search_query()
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
27
53
|
$tag_name = isset( $attributes['level'] ) ? 'h' . (int) $attributes['level'] : 'h1';
|
|
28
54
|
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
|
|
29
55
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
|
@@ -17,6 +17,19 @@ const variations = [
|
|
|
17
17
|
},
|
|
18
18
|
scope: [ 'inserter' ],
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
isDefault: false,
|
|
22
|
+
name: 'search-title',
|
|
23
|
+
title: __( 'Search Results Title' ),
|
|
24
|
+
description: __(
|
|
25
|
+
'Display the search results title based on the queried object.'
|
|
26
|
+
),
|
|
27
|
+
icon: title,
|
|
28
|
+
attributes: {
|
|
29
|
+
type: 'search',
|
|
30
|
+
},
|
|
31
|
+
scope: [ 'inserter' ],
|
|
32
|
+
},
|
|
20
33
|
];
|
|
21
34
|
|
|
22
35
|
/**
|
package/src/quote/deprecated.js
CHANGED
|
@@ -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
|
|
@@ -11,11 +10,11 @@ import { createBlock, parseWithAttributeSchema } from '@wordpress/blocks';
|
|
|
11
10
|
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
12
11
|
|
|
13
12
|
export const migrateToQuoteV2 = ( attributes ) => {
|
|
14
|
-
const { value } = attributes;
|
|
13
|
+
const { value, ...restAttributes } = attributes;
|
|
15
14
|
|
|
16
15
|
return [
|
|
17
16
|
{
|
|
18
|
-
...
|
|
17
|
+
...restAttributes,
|
|
19
18
|
},
|
|
20
19
|
value
|
|
21
20
|
? parseWithAttributeSchema( value, {
|
|
@@ -151,8 +150,9 @@ const v1 = {
|
|
|
151
150
|
|
|
152
151
|
migrate( attributes ) {
|
|
153
152
|
if ( attributes.style === 2 ) {
|
|
153
|
+
const { style, ...restAttributes } = attributes;
|
|
154
154
|
return migrateToQuoteV2( {
|
|
155
|
-
...
|
|
155
|
+
...restAttributes,
|
|
156
156
|
className: attributes.className
|
|
157
157
|
? attributes.className + ' is-style-large'
|
|
158
158
|
: 'is-style-large',
|
|
@@ -205,8 +205,9 @@ const v0 = {
|
|
|
205
205
|
|
|
206
206
|
migrate( attributes ) {
|
|
207
207
|
if ( ! isNaN( parseInt( attributes.style ) ) ) {
|
|
208
|
+
const { style, ...restAttributes } = attributes;
|
|
208
209
|
return migrateToQuoteV2( {
|
|
209
|
-
...
|
|
210
|
+
...restAttributes,
|
|
210
211
|
} );
|
|
211
212
|
}
|
|
212
213
|
|
package/src/quote/transforms.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
createBlock,
|
|
6
|
-
parseWithAttributeSchema,
|
|
7
|
-
rawHandler,
|
|
8
|
-
} from '@wordpress/blocks';
|
|
4
|
+
import { createBlock } from '@wordpress/blocks';
|
|
9
5
|
|
|
10
6
|
const transforms = {
|
|
11
7
|
from: [
|
|
@@ -21,19 +17,7 @@ const transforms = {
|
|
|
21
17
|
fontSize,
|
|
22
18
|
style,
|
|
23
19
|
},
|
|
24
|
-
|
|
25
|
-
type: 'array',
|
|
26
|
-
source: 'query',
|
|
27
|
-
selector: 'p',
|
|
28
|
-
query: {
|
|
29
|
-
content: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
source: 'html',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
} ).map( ( { content } ) =>
|
|
35
|
-
createBlock( 'core/paragraph', { content } )
|
|
36
|
-
)
|
|
20
|
+
createBlock( 'core/paragraph', { content: value } )
|
|
37
21
|
);
|
|
38
22
|
},
|
|
39
23
|
},
|
|
@@ -59,7 +43,7 @@ const transforms = {
|
|
|
59
43
|
},
|
|
60
44
|
} ),
|
|
61
45
|
selector: 'blockquote',
|
|
62
|
-
transform: ( node ) => {
|
|
46
|
+
transform: ( node, handler ) => {
|
|
63
47
|
return createBlock(
|
|
64
48
|
'core/quote',
|
|
65
49
|
// Don't try to parse any `cite` out of this content.
|
|
@@ -68,7 +52,7 @@ const transforms = {
|
|
|
68
52
|
// * If the cite is nested in the quoted text, it's wrong to
|
|
69
53
|
// remove it.
|
|
70
54
|
{},
|
|
71
|
-
|
|
55
|
+
handler( {
|
|
72
56
|
HTML: node.innerHTML,
|
|
73
57
|
mode: 'BLOCKS',
|
|
74
58
|
} )
|
|
@@ -110,10 +94,8 @@ const transforms = {
|
|
|
110
94
|
innerBlocks
|
|
111
95
|
) => {
|
|
112
96
|
const value = innerBlocks
|
|
113
|
-
.map(
|
|
114
|
-
|
|
115
|
-
)
|
|
116
|
-
.join( '' );
|
|
97
|
+
.map( ( { attributes } ) => `${ attributes.content }` )
|
|
98
|
+
.join( '<br>' );
|
|
117
99
|
return createBlock( 'core/pullquote', {
|
|
118
100
|
value,
|
|
119
101
|
citation,
|
package/src/search/index.php
CHANGED
|
@@ -217,7 +217,7 @@ function apply_block_core_search_border_style( $attributes, $property, $side, &$
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
if ( 'color' === $property && $side ) {
|
|
220
|
-
$has_color_preset =
|
|
220
|
+
$has_color_preset = str_contains( $value, 'var:preset|color|' );
|
|
221
221
|
if ( $has_color_preset ) {
|
|
222
222
|
$named_color_value = substr( $value, strrpos( $value, '|' ) + 1 );
|
|
223
223
|
$value = sprintf( 'var(--wp--preset--color--%s)', $named_color_value );
|
package/src/search/style.scss
CHANGED
|
@@ -11,7 +11,14 @@ exports[`Search Block renders block with button inside option 1`] = `
|
|
|
11
11
|
accessibilityRole="none"
|
|
12
12
|
accessible={true}
|
|
13
13
|
>
|
|
14
|
-
<View
|
|
14
|
+
<View
|
|
15
|
+
style={
|
|
16
|
+
Array [
|
|
17
|
+
undefined,
|
|
18
|
+
undefined,
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
>
|
|
15
22
|
<RCTAztecView
|
|
16
23
|
accessible={true}
|
|
17
24
|
activeFormats={Array []}
|
|
@@ -119,7 +126,14 @@ exports[`Search Block renders block with button inside option 1`] = `
|
|
|
119
126
|
accessible={true}
|
|
120
127
|
onLayout={[Function]}
|
|
121
128
|
>
|
|
122
|
-
<View
|
|
129
|
+
<View
|
|
130
|
+
style={
|
|
131
|
+
Array [
|
|
132
|
+
undefined,
|
|
133
|
+
undefined,
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
>
|
|
123
137
|
<RCTAztecView
|
|
124
138
|
accessible={true}
|
|
125
139
|
activeFormats={Array []}
|
|
@@ -191,7 +205,14 @@ exports[`Search Block renders block with icon button option matches snapshot 1`]
|
|
|
191
205
|
accessibilityRole="none"
|
|
192
206
|
accessible={true}
|
|
193
207
|
>
|
|
194
|
-
<View
|
|
208
|
+
<View
|
|
209
|
+
style={
|
|
210
|
+
Array [
|
|
211
|
+
undefined,
|
|
212
|
+
undefined,
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
>
|
|
195
216
|
<RCTAztecView
|
|
196
217
|
accessible={true}
|
|
197
218
|
activeFormats={Array []}
|
|
@@ -359,7 +380,14 @@ exports[`Search Block renders block with label hidden matches snapshot 1`] = `
|
|
|
359
380
|
accessible={true}
|
|
360
381
|
onLayout={[Function]}
|
|
361
382
|
>
|
|
362
|
-
<View
|
|
383
|
+
<View
|
|
384
|
+
style={
|
|
385
|
+
Array [
|
|
386
|
+
undefined,
|
|
387
|
+
undefined,
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
>
|
|
363
391
|
<RCTAztecView
|
|
364
392
|
accessible={true}
|
|
365
393
|
activeFormats={Array []}
|
|
@@ -431,7 +459,14 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
|
|
|
431
459
|
accessibilityRole="none"
|
|
432
460
|
accessible={true}
|
|
433
461
|
>
|
|
434
|
-
<View
|
|
462
|
+
<View
|
|
463
|
+
style={
|
|
464
|
+
Array [
|
|
465
|
+
undefined,
|
|
466
|
+
undefined,
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
>
|
|
435
470
|
<RCTAztecView
|
|
436
471
|
accessible={true}
|
|
437
472
|
activeFormats={Array []}
|
|
@@ -539,7 +574,14 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
|
|
|
539
574
|
accessible={true}
|
|
540
575
|
onLayout={[Function]}
|
|
541
576
|
>
|
|
542
|
-
<View
|
|
577
|
+
<View
|
|
578
|
+
style={
|
|
579
|
+
Array [
|
|
580
|
+
undefined,
|
|
581
|
+
undefined,
|
|
582
|
+
]
|
|
583
|
+
}
|
|
584
|
+
>
|
|
543
585
|
<RCTAztecView
|
|
544
586
|
accessible={true}
|
|
545
587
|
activeFormats={Array []}
|
|
@@ -611,7 +653,14 @@ exports[`Search Block renders with no-button option matches snapshot 1`] = `
|
|
|
611
653
|
accessibilityRole="none"
|
|
612
654
|
accessible={true}
|
|
613
655
|
>
|
|
614
|
-
<View
|
|
656
|
+
<View
|
|
657
|
+
style={
|
|
658
|
+
Array [
|
|
659
|
+
undefined,
|
|
660
|
+
undefined,
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
>
|
|
615
664
|
<RCTAztecView
|
|
616
665
|
accessible={true}
|
|
617
666
|
activeFormats={Array []}
|
package/src/separator/block.json
CHANGED
|
@@ -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
|
|
@@ -42,9 +41,9 @@ const v1 = {
|
|
|
42
41
|
return <hr { ...useBlockProps.save( { className, style } ) } />;
|
|
43
42
|
},
|
|
44
43
|
migrate( attributes ) {
|
|
45
|
-
const { color, customColor } = attributes;
|
|
44
|
+
const { color, customColor, ...restAttributes } = attributes;
|
|
46
45
|
return {
|
|
47
|
-
...
|
|
46
|
+
...restAttributes,
|
|
48
47
|
backgroundColor: color ? color : undefined,
|
|
49
48
|
opacity: 'css',
|
|
50
49
|
style: customColor
|
package/src/separator/edit.js
CHANGED
|
@@ -66,7 +66,8 @@ describe( 'Separator block edit method', () => {
|
|
|
66
66
|
expect( useBlockProps ).toHaveBeenCalledWith( {
|
|
67
67
|
// For backwards compatibility the has-text-color class is also added even though it is only needed for
|
|
68
68
|
// is-style-dots as this class was always added to v1 blocks, so may be expected by themes and plugins.
|
|
69
|
-
className:
|
|
69
|
+
className:
|
|
70
|
+
'has-text-color has-alpha-channel-opacity has-background',
|
|
70
71
|
style: {
|
|
71
72
|
backgroundColor: '#ff0000',
|
|
72
73
|
color: '#ff0000',
|
|
@@ -85,7 +86,8 @@ describe( 'Separator block edit method', () => {
|
|
|
85
86
|
};
|
|
86
87
|
render( <SeparatorEdit { ...props } /> );
|
|
87
88
|
expect( useBlockProps ).toHaveBeenCalledWith( {
|
|
88
|
-
className:
|
|
89
|
+
className:
|
|
90
|
+
'has-text-color has-alpha-channel-opacity has-background',
|
|
89
91
|
style: {
|
|
90
92
|
backgroundColor: '#ff0000',
|
|
91
93
|
color: '#ff0000',
|
|
@@ -106,7 +108,7 @@ describe( 'Separator block edit method', () => {
|
|
|
106
108
|
// background color classes are added by useBlockProps which has to be mocked.
|
|
107
109
|
expect( useBlockProps ).toHaveBeenCalledWith( {
|
|
108
110
|
className:
|
|
109
|
-
'has-text-color has-banana-color has-alpha-channel-opacity',
|
|
111
|
+
'has-text-color has-banana-color has-alpha-channel-opacity has-banana-background-color has-background',
|
|
110
112
|
style: undefined,
|
|
111
113
|
} );
|
|
112
114
|
} );
|