@wordpress/block-library 7.3.10 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +3 -2
- package/babel-plugin.js +154 -0
- package/build/archives/edit.js +1 -1
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +5 -17
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/block/edit.js +10 -9
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.native.js +7 -3
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +1 -0
- package/build/button/index.js.map +1 -1
- package/build/categories/edit.js +9 -4
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +5 -1
- package/build/categories/index.js.map +1 -1
- package/build/column/index.js +10 -0
- package/build/column/index.js.map +1 -1
- package/build/comment-author-avatar/index.js +1 -0
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-template/edit.js +1 -3
- package/build/comment-template/edit.js.map +1 -1
- package/build/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/{build-module/comments-query-loop → build/comments}/edit/comments-inspector-controls.js.map +1 -1
- package/build/{comments-query-loop → comments}/edit.js +2 -2
- package/build/comments/edit.js.map +1 -0
- package/build/{comments-query-loop → comments}/index.js +1 -1
- package/build/comments/index.js.map +1 -0
- package/build/{comments-query-loop → comments}/save.js +2 -2
- package/build/comments/save.js.map +1 -0
- package/build/comments-title/index.js +1 -1
- package/build/comments-title/index.js.map +1 -1
- package/build/cover/controls.native.js +2 -3
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/edit/block-controls.js +115 -0
- package/build/cover/edit/block-controls.js.map +1 -0
- package/build/cover/edit/cover-placeholder.js +49 -0
- package/build/cover/edit/cover-placeholder.js.map +1 -0
- package/build/cover/edit/index.js +333 -0
- package/build/cover/edit/index.js.map +1 -0
- package/build/cover/edit/inspector-controls.js +224 -0
- package/build/cover/edit/inspector-controls.js.map +1 -0
- package/build/cover/edit/resizable-cover.js +67 -0
- package/build/cover/edit/resizable-cover.js.map +1 -0
- package/build/cover/edit/use-cover-is-dark.js +81 -0
- package/build/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build/cover/edit.native.js +36 -16
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/shared.js +9 -0
- package/build/cover/shared.js.map +1 -1
- package/build/cover/transforms.js +77 -6
- package/build/cover/transforms.js.map +1 -1
- package/build/cover/use-cover-is-dark.native.js +60 -0
- package/build/cover/use-cover-is-dark.native.js.map +1 -0
- package/build/embed/edit.js +12 -18
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +1 -7
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-preview.js +1 -1
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/util.js +29 -4
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.native.js +0 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/inspector.js +2 -4
- package/build/file/inspector.js.map +1 -1
- package/build/gallery/edit.js +3 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/shared.js +2 -2
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/use-get-media.js +2 -1
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-short-code-transform.js +19 -18
- package/build/gallery/use-short-code-transform.js.map +1 -1
- package/build/gallery/v1/edit.js +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/edit.js +6 -2
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +1 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +9 -4
- package/build/heading/transforms.js.map +1 -1
- package/build/html/edit.js +2 -2
- package/build/html/edit.js.map +1 -1
- package/build/image/edit.js +9 -8
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -2
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +2 -2
- package/build/image/image.js.map +1 -1
- package/build/index.js +48 -12
- package/build/index.js.map +1 -1
- package/build/index.native.js +14 -3
- package/build/index.native.js.map +1 -1
- package/build/is-block-metadata-experimental.js +18 -0
- package/build/is-block-metadata-experimental.js.map +1 -0
- package/build/latest-comments/edit.js +1 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +30 -4
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +49 -0
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/transforms.js +6 -0
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/edit.js +2 -1
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/migrate.js +1 -0
- package/build/list/v2/migrate.js.map +1 -1
- package/build/list/v2/transforms.js +46 -9
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +7 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +24 -0
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-backspace.js +59 -0
- package/build/list-item/hooks/use-backspace.js.map +1 -0
- package/build/list-item/hooks/use-enter.js +6 -9
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +33 -39
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +54 -0
- package/build/list-item/hooks/use-space.js.map +1 -0
- package/build/list-item/hooks/use-split.js +30 -0
- package/build/list-item/hooks/use-split.js.map +1 -0
- package/build/list-item/index.js +1 -0
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +1 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/loginout/edit.js +1 -1
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/edit.js +1 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +3 -2
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/transforms.js +137 -8
- package/build/media-text/transforms.js.map +1 -1
- package/build/navigation/edit/index.js +86 -81
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +1 -5
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +1 -1
- package/build/navigation/use-navigation-entities.js +3 -3
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/view-modal.js +62 -0
- package/build/navigation/view-modal.js.map +1 -0
- package/build/navigation/view.js +1 -34
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/fallback-variations.js +1 -1
- package/build/navigation-link/fallback-variations.js.map +1 -1
- package/build/navigation-link/hooks.js +1 -1
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +10 -0
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/edit.native.js +6 -2
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/paragraph/use-enter.js +94 -0
- package/build/paragraph/use-enter.js.map +1 -0
- package/build/post-author/edit.js +2 -2
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-name/index.js +1 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comment/index.js +2 -1
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/edit.js +14 -35
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments/index.js +1 -1
- package/build/post-comments-count/index.js +1 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/edit.js +37 -24
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +48 -0
- package/build/post-comments-form/form.js.map +1 -0
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +7 -2
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +35 -4
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/hooks.js +33 -0
- package/build/post-terms/hooks.js.map +1 -0
- package/build/post-terms/index.js +20 -5
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -1
- package/build/post-title/index.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 +1 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +26 -17
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +148 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build/query/edit/inspector-controls/sticky-control.js +41 -0
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build/query/index.js +2 -1
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +28 -2
- package/build/query/utils.js.map +1 -1
- package/build/query-title/index.js +1 -1
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +1 -1
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/edit.js +3 -2
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +7 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/edit.js +12 -4
- package/build/quote/v2/edit.js.map +1 -1
- package/build/rss/edit.js +1 -1
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +12 -9
- package/build/search/edit.js.map +1 -1
- package/build/separator/index.js +3 -0
- package/build/separator/index.js.map +1 -1
- package/build/site-logo/edit.js +1 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/spacer/constants.js +9 -0
- package/build/spacer/constants.js.map +1 -0
- package/build/spacer/controls.js +3 -3
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +2 -2
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.js +5 -6
- package/build/spacer/edit.js.map +1 -1
- package/build/table/edit.js +23 -4
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +138 -66
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +13 -3
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +16 -9
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +40 -0
- package/build/table-of-contents/save.js.map +1 -0
- package/build/table-of-contents/utils.js +11 -77
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/index.js +7 -3
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +3 -8
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/video/edit.js +5 -9
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +1 -1
- package/build/video/edit.native.js.map +1 -1
- package/build-module/archives/edit.js +1 -1
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +6 -18
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +1 -1
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/block/edit.js +11 -10
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.native.js +7 -3
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +1 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/categories/edit.js +9 -4
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +5 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/column/index.js +10 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +1 -0
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-template/edit.js +1 -3
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/edit.js +1 -1
- package/build-module/comments/edit.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/index.js +1 -1
- package/build-module/comments/index.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/save.js +1 -1
- package/build-module/comments/save.js.map +1 -0
- package/build-module/comments-title/index.js +1 -1
- package/build-module/comments-title/index.js.map +1 -1
- package/build-module/cover/controls.native.js +2 -3
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +104 -0
- package/build-module/cover/edit/block-controls.js.map +1 -0
- package/build-module/cover/edit/cover-placeholder.js +38 -0
- package/build-module/cover/edit/cover-placeholder.js.map +1 -0
- package/build-module/cover/edit/index.js +307 -0
- package/build-module/cover/edit/index.js.map +1 -0
- package/build-module/cover/edit/inspector-controls.js +215 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -0
- package/build-module/cover/edit/resizable-cover.js +55 -0
- package/build-module/cover/edit/resizable-cover.js.map +1 -0
- package/build-module/cover/edit/use-cover-is-dark.js +70 -0
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build-module/cover/edit.native.js +35 -17
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
- package/build-module/cover/shared.js +7 -0
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/cover/transforms.js +74 -6
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/cover/use-cover-is-dark.native.js +51 -0
- package/build-module/cover/use-cover-is-dark.native.js.map +1 -0
- package/build-module/embed/edit.js +13 -19
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +2 -8
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +2 -2
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/util.js +25 -3
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.native.js +0 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/inspector.js +2 -4
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/gallery/edit.js +3 -2
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/shared.js +2 -2
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/use-get-media.js +2 -1
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-short-code-transform.js +19 -18
- package/build-module/gallery/use-short-code-transform.js.map +1 -1
- package/build-module/gallery/v1/edit.js +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +2 -2
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/edit.js +6 -2
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +9 -4
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/html/edit.js +2 -2
- package/build-module/html/edit.js.map +1 -1
- package/build-module/image/edit.js +10 -9
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -2
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +3 -3
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +43 -11
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +14 -3
- package/build-module/index.native.js.map +1 -1
- package/build-module/is-block-metadata-experimental.js +16 -0
- package/build-module/is-block-metadata-experimental.js.map +1 -0
- package/build-module/latest-comments/edit.js +1 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +29 -5
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +51 -2
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/transforms.js +6 -0
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/edit.js +2 -1
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/migrate.js +1 -3
- package/build-module/list/v2/migrate.js.map +1 -1
- package/build-module/list/v2/transforms.js +46 -9
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +8 -9
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +3 -0
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-backspace.js +44 -0
- package/build-module/list-item/hooks/use-backspace.js.map +1 -0
- package/build-module/list-item/hooks/use-enter.js +6 -9
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +33 -38
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +40 -0
- package/build-module/list-item/hooks/use-space.js.map +1 -0
- package/build-module/list-item/hooks/use-split.js +19 -0
- package/build-module/list-item/hooks/use-split.js.map +1 -0
- package/build-module/list-item/index.js +1 -0
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +1 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/loginout/edit.js +1 -1
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/edit.js +1 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +3 -2
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/transforms.js +137 -8
- package/build-module/media-text/transforms.js.map +1 -1
- package/build-module/navigation/edit/index.js +87 -82
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -6
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +1 -1
- package/build-module/navigation/use-navigation-entities.js +1 -1
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/view-modal.js +56 -0
- package/build-module/navigation/view-modal.js.map +1 -0
- package/build-module/navigation/view.js +1 -30
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/fallback-variations.js +1 -1
- package/build-module/navigation-link/fallback-variations.js.map +1 -1
- package/build-module/navigation-link/hooks.js +2 -2
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +9 -0
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js +6 -2
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/paragraph/use-enter.js +81 -0
- package/build-module/paragraph/use-enter.js.map +1 -0
- package/build-module/post-author/edit.js +2 -2
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +1 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comment/index.js +2 -1
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comments/edit.js +13 -35
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments/index.js +1 -1
- package/build-module/post-comments-count/index.js +1 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/edit.js +38 -26
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +39 -0
- package/build-module/post-comments-form/form.js.map +1 -0
- package/build-module/post-comments-link/index.js +1 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +7 -2
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +35 -6
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/hooks.js +25 -0
- package/build-module/post-terms/hooks.js.map +1 -0
- package/build-module/post-terms/index.js +18 -8
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/pullquote/edit.js +2 -2
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +2 -2
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +24 -17
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +135 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js +31 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build-module/query/index.js +2 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +21 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-title/index.js +1 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +2 -2
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/quote/edit.js +4 -3
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +2 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/edit.js +12 -5
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/rss/edit.js +1 -1
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +12 -9
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/index.js +3 -0
- package/build-module/separator/index.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/spacer/constants.js +2 -0
- package/build-module/spacer/constants.js.map +1 -0
- package/build-module/spacer/controls.js +2 -2
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +1 -1
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.js +1 -1
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table/edit.js +26 -7
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +136 -68
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +12 -3
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +18 -10
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +28 -0
- package/build-module/table-of-contents/save.js.map +1 -0
- package/build-module/table-of-contents/utils.js +11 -73
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +8 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +4 -9
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/video/edit.js +6 -10
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +1 -1
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/{comments-query-loop → comments}/editor-rtl.css +0 -0
- package/build-style/{comments-query-loop → comments}/editor.css +0 -0
- package/build-style/common-rtl.css +32 -0
- package/build-style/common.css +32 -0
- package/build-style/cover/style-rtl.css +0 -4
- package/build-style/cover/style.css +0 -4
- package/build-style/editor-rtl.css +16 -10
- package/build-style/editor.css +16 -10
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/navigation/style-rtl.css +3 -0
- package/build-style/navigation/style.css +3 -0
- package/build-style/separator/editor-rtl.css +1 -0
- package/build-style/separator/editor.css +1 -0
- package/build-style/style-rtl.css +73 -4
- package/build-style/style.css +73 -4
- package/build-style/table/editor-rtl.css +8 -0
- package/build-style/table/editor.css +8 -0
- package/build-style/table/style-rtl.css +38 -0
- package/build-style/table/style.css +38 -0
- package/build-style/video/editor-rtl.css +2 -5
- package/build-style/video/editor.css +2 -5
- package/build-types/table-of-contents/list.d.ts +12 -0
- package/build-types/table-of-contents/list.d.ts.map +1 -0
- package/build-types/table-of-contents/utils.d.ts +24 -0
- package/build-types/table-of-contents/utils.d.ts.map +1 -0
- package/package.json +30 -29
- package/src/archives/edit.js +1 -1
- package/src/audio/edit.js +7 -10
- package/src/audio/edit.native.js +1 -1
- package/src/avatar/block.json +0 -1
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +39 -42
- package/src/block/test/edit.native.js +1 -1
- package/src/button/block.json +1 -0
- package/src/button/edit.native.js +6 -3
- package/src/categories/block.json +5 -1
- package/src/categories/edit.js +9 -3
- package/src/categories/index.php +1 -0
- package/src/column/block.json +10 -0
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comment-template/edit.js +1 -5
- package/src/{comments-query-loop → comments}/block.json +1 -1
- package/src/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/src/{comments-query-loop → comments}/edit.js +1 -1
- package/src/{comments-query-loop → comments}/editor.scss +0 -0
- package/src/{comments-query-loop → comments}/index.js +0 -0
- package/src/{comments-query-loop → comments}/save.js +1 -3
- package/src/comments-title/index.js +1 -1
- package/src/common.scss +24 -1
- package/src/cover/controls.native.js +1 -2
- package/src/cover/edit/block-controls.js +119 -0
- package/src/cover/edit/cover-placeholder.js +39 -0
- package/src/cover/edit/index.js +381 -0
- package/src/cover/edit/inspector-controls.js +286 -0
- package/src/cover/edit/resizable-cover.js +55 -0
- package/src/cover/edit/use-cover-is-dark.js +71 -0
- package/src/cover/edit.native.js +40 -14
- package/src/cover/editor.scss +1 -1
- package/src/cover/focal-point-settings-button.native.js +1 -1
- package/src/cover/shared.js +4 -0
- package/src/cover/style.native.scss +4 -0
- package/src/cover/style.scss +0 -4
- package/src/cover/test/__snapshots__/edit.native.js.snap +6 -6
- package/src/cover/test/block-controls.js +62 -0
- package/src/cover/test/transforms.js +301 -0
- package/src/cover/transforms.js +112 -7
- package/src/cover/use-cover-is-dark.native.js +51 -0
- package/src/editor.scss +1 -1
- package/src/embed/edit.js +19 -24
- package/src/embed/edit.native.js +9 -14
- package/src/embed/embed-preview.js +4 -2
- package/src/embed/util.js +34 -2
- package/src/file/edit.native.js +0 -1
- package/src/file/inspector.js +1 -3
- package/src/gallery/edit.js +3 -2
- package/src/gallery/gallery.js +2 -2
- package/src/gallery/shared.js +3 -2
- package/src/gallery/use-get-media.js +2 -1
- package/src/gallery/use-short-code-transform.js +19 -16
- package/src/gallery/v1/edit.js +1 -1
- package/src/gallery/v1/gallery.js +2 -2
- package/src/group/block.json +1 -0
- package/src/heading/block.json +1 -0
- package/src/heading/edit.js +5 -2
- package/src/heading/transforms.js +4 -3
- package/src/html/edit.js +2 -2
- package/src/image/edit.js +11 -5
- package/src/image/edit.native.js +1 -2
- package/src/image/editor.scss +1 -1
- package/src/image/image.js +9 -3
- package/src/image/test/edit.native.js +7 -7
- package/src/index.js +52 -30
- package/src/index.native.js +12 -2
- package/src/is-block-metadata-experimental.js +19 -0
- package/src/latest-comments/edit.js +1 -1
- package/src/latest-posts/edit.js +27 -2
- package/src/latest-posts/edit.native.js +56 -1
- package/src/list/transforms.js +7 -0
- package/src/list/v2/edit.js +1 -0
- package/src/list/v2/migrate.js +1 -1
- package/src/list/v2/transforms.js +35 -0
- package/src/list-item/block.json +2 -1
- package/src/list-item/edit.js +17 -10
- package/src/list-item/hooks/index.js +3 -0
- package/src/list-item/hooks/use-backspace.js +52 -0
- package/src/list-item/hooks/use-enter.js +9 -16
- package/src/list-item/hooks/use-indent-list-item.js +50 -63
- package/src/list-item/hooks/use-space.js +48 -0
- package/src/list-item/hooks/use-split.js +24 -0
- package/src/list-item/utils.js +1 -1
- package/src/loginout/edit.js +1 -1
- package/src/media-text/edit.js +1 -2
- package/src/media-text/edit.native.js +4 -2
- package/src/media-text/media-container.native.js +2 -4
- package/src/media-text/transforms.js +154 -0
- package/src/navigation/block.json +1 -1
- package/src/navigation/edit/index.js +175 -169
- package/src/navigation/edit/inner-blocks.js +1 -8
- package/src/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/src/navigation/index.php +5 -0
- package/src/navigation/style.scss +3 -0
- package/src/navigation/use-navigation-entities.js +1 -1
- package/src/navigation/view-modal.js +68 -0
- package/src/navigation/view.js +0 -35
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-link/fallback-variations.js +1 -1
- package/src/navigation-link/hooks.js +2 -2
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +4 -4
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +1 -4
- package/src/paragraph/edit.js +6 -0
- package/src/paragraph/edit.native.js +13 -1
- package/src/paragraph/use-enter.js +103 -0
- package/src/post-author/edit.js +25 -23
- package/src/post-author-name/block.json +1 -0
- package/src/post-comment/block.json +2 -1
- package/src/post-comments/block.json +1 -1
- package/src/post-comments/edit.js +13 -43
- package/src/post-comments/index.php +2 -0
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/edit.js +50 -58
- package/src/post-comments-form/form.js +40 -0
- package/src/post-comments-link/block.json +1 -0
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-template/edit.js +5 -0
- package/src/post-terms/block.json +8 -0
- package/src/post-terms/edit.js +47 -1
- package/src/post-terms/hooks.js +27 -0
- package/src/post-terms/index.js +14 -7
- package/src/post-terms/index.php +50 -2
- package/src/post-title/index.js +1 -1
- package/src/pullquote/edit.js +2 -2
- package/src/pullquote/edit.native.js +2 -2
- package/src/query/block.json +2 -1
- package/src/query/edit/inspector-controls/index.js +25 -11
- package/src/query/edit/inspector-controls/parent-control.js +133 -0
- package/src/query/edit/inspector-controls/sticky-control.js +25 -0
- package/src/query/utils.js +22 -0
- package/src/query-title/index.js +1 -1
- package/src/query-title/variations.js +2 -2
- package/src/quote/block.json +1 -0
- package/src/quote/edit.js +5 -2
- package/src/quote/index.js +1 -1
- package/src/quote/v2/edit.js +7 -2
- package/src/rss/edit.js +1 -1
- package/src/search/edit.js +14 -7
- package/src/search/index.php +85 -34
- package/src/separator/block.json +3 -0
- package/src/separator/editor.scss +1 -0
- package/src/site-logo/edit.js +1 -1
- package/src/spacer/constants.js +1 -0
- package/src/spacer/controls.js +2 -2
- package/src/spacer/controls.native.js +1 -1
- package/src/spacer/edit.js +1 -2
- package/src/table/edit.js +30 -6
- package/src/table/editor.scss +13 -0
- package/src/table/style.scss +52 -0
- package/src/table-of-contents/block.json +9 -2
- package/src/table-of-contents/edit.js +155 -75
- package/src/table-of-contents/index.js +2 -0
- package/src/table-of-contents/list.tsx +46 -0
- package/src/table-of-contents/save.js +25 -0
- package/src/table-of-contents/utils.ts +71 -0
- package/src/tag-cloud/block.json +1 -1
- package/src/tag-cloud/edit.js +1 -1
- package/src/template-part/edit/index.js +25 -15
- package/src/template-part/edit/inner-blocks.js +2 -10
- package/src/video/edit.js +8 -7
- package/src/video/edit.native.js +1 -1
- package/src/video/editor.scss +3 -6
- package/test/babel-plugin.js +67 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/build/comments-query-loop/edit/comments-inspector-controls.js.map +0 -1
- package/build/comments-query-loop/edit.js.map +0 -1
- package/build/comments-query-loop/index.js.map +0 -1
- package/build/comments-query-loop/save.js.map +0 -1
- package/build/cover/edit.js +0 -668
- package/build/cover/edit.js.map +0 -1
- package/build/post-terms/variations.js +0 -37
- package/build/post-terms/variations.js.map +0 -1
- package/build-module/comments-query-loop/edit.js.map +0 -1
- package/build-module/comments-query-loop/index.js.map +0 -1
- package/build-module/comments-query-loop/save.js.map +0 -1
- package/build-module/cover/edit.js +0 -645
- package/build-module/cover/edit.js.map +0 -1
- package/build-module/post-terms/variations.js +0 -27
- package/build-module/post-terms/variations.js.map +0 -1
- package/src/cover/edit.js +0 -827
- package/src/post-terms/variations.js +0 -28
- package/src/table-of-contents/index.php +0 -346
- package/src/table-of-contents/list.js +0 -28
- package/src/table-of-contents/utils.js +0 -126
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { postCategories, postTerms } from '@wordpress/icons';
|
|
5
|
+
|
|
6
|
+
const variationIconMap = {
|
|
7
|
+
category: postCategories,
|
|
8
|
+
post_tag: postTerms,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// We add `icons` to categories and tags. The remaining ones use
|
|
12
|
+
// the block's default icon.
|
|
13
|
+
export default function enhanceVariations( settings, name ) {
|
|
14
|
+
if ( name !== 'core/post-terms' ) {
|
|
15
|
+
return settings;
|
|
16
|
+
}
|
|
17
|
+
const variations = settings.variations.map( ( variation ) => ( {
|
|
18
|
+
...variation,
|
|
19
|
+
...( variationIconMap[ variation.name ] && {
|
|
20
|
+
icon: variationIconMap[ variation.name ],
|
|
21
|
+
} ),
|
|
22
|
+
} ) );
|
|
23
|
+
return {
|
|
24
|
+
...settings,
|
|
25
|
+
variations,
|
|
26
|
+
};
|
|
27
|
+
}
|
package/src/post-terms/index.js
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import variations from './variations';
|
|
4
|
+
import { postCategories as icon } from '@wordpress/icons';
|
|
5
|
+
import { addFilter } from '@wordpress/hooks';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* Internal dependencies
|
|
10
9
|
*/
|
|
11
|
-
import
|
|
10
|
+
import metadata from './block.json';
|
|
11
|
+
import edit from './edit';
|
|
12
|
+
import enhanceVariations from './hooks';
|
|
12
13
|
|
|
13
14
|
const { name } = metadata;
|
|
14
15
|
export { metadata, name };
|
|
15
16
|
|
|
16
17
|
export const settings = {
|
|
17
18
|
icon,
|
|
18
|
-
variations,
|
|
19
19
|
edit,
|
|
20
20
|
};
|
|
21
|
+
|
|
22
|
+
// Importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
|
|
23
|
+
addFilter(
|
|
24
|
+
'blocks.registerBlockType',
|
|
25
|
+
'core/template-part',
|
|
26
|
+
enhanceVariations
|
|
27
|
+
);
|
package/src/post-terms/index.php
CHANGED
|
@@ -36,12 +36,22 @@ function render_block_core_post_terms( $attributes, $content, $block ) {
|
|
|
36
36
|
|
|
37
37
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
38
38
|
|
|
39
|
+
$prefix = "<div $wrapper_attributes>";
|
|
40
|
+
if ( isset( $attributes['prefix'] ) && $attributes['prefix'] ) {
|
|
41
|
+
$prefix .= '<span class="wp-block-post-terms__prefix">' . $attributes['prefix'] . '</span>';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
$suffix = '</div>';
|
|
45
|
+
if ( isset( $attributes['suffix'] ) && $attributes['suffix'] ) {
|
|
46
|
+
$suffix = '<span class="wp-block-post-terms__suffix">' . $attributes['suffix'] . '</span>' . $suffix;
|
|
47
|
+
}
|
|
48
|
+
|
|
39
49
|
return get_the_term_list(
|
|
40
50
|
$block->context['postId'],
|
|
41
51
|
$attributes['term'],
|
|
42
|
-
|
|
52
|
+
wp_kses_post( $prefix ),
|
|
43
53
|
'<span class="wp-block-post-terms__separator">' . esc_html( $separator ) . '</span>',
|
|
44
|
-
|
|
54
|
+
wp_kses_post( $suffix )
|
|
45
55
|
);
|
|
46
56
|
}
|
|
47
57
|
|
|
@@ -49,10 +59,48 @@ function render_block_core_post_terms( $attributes, $content, $block ) {
|
|
|
49
59
|
* Registers the `core/post-terms` block on the server.
|
|
50
60
|
*/
|
|
51
61
|
function register_block_core_post_terms() {
|
|
62
|
+
$taxonomies = get_taxonomies(
|
|
63
|
+
array(
|
|
64
|
+
'public' => true,
|
|
65
|
+
'show_in_rest' => true,
|
|
66
|
+
),
|
|
67
|
+
'objects'
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// Split the available taxonomies to `built_in` and custom ones,
|
|
71
|
+
// in order to prioritize the `built_in` taxonomies at the
|
|
72
|
+
// search results.
|
|
73
|
+
$built_ins = array();
|
|
74
|
+
$custom_variations = array();
|
|
75
|
+
|
|
76
|
+
// Create and register the eligible taxonomies variations.
|
|
77
|
+
foreach ( $taxonomies as $taxonomy ) {
|
|
78
|
+
$variation = array(
|
|
79
|
+
'name' => $taxonomy->name,
|
|
80
|
+
'title' => $taxonomy->label,
|
|
81
|
+
/* translators: %s: taxonomy's label */
|
|
82
|
+
'description' => sprintf( __( 'Display the assigned taxonomy: %s' ), $taxonomy->label ),
|
|
83
|
+
'attributes' => array(
|
|
84
|
+
'term' => $taxonomy->name,
|
|
85
|
+
),
|
|
86
|
+
'isActive' => array( 'term' ),
|
|
87
|
+
);
|
|
88
|
+
// Set the category variation as the default one.
|
|
89
|
+
if ( 'category' === $taxonomy->name ) {
|
|
90
|
+
$variation['isDefault'] = true;
|
|
91
|
+
}
|
|
92
|
+
if ( $taxonomy->_builtin ) {
|
|
93
|
+
$built_ins[] = $variation;
|
|
94
|
+
} else {
|
|
95
|
+
$custom_variations[] = $variation;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
52
99
|
register_block_type_from_metadata(
|
|
53
100
|
__DIR__ . '/post-terms',
|
|
54
101
|
array(
|
|
55
102
|
'render_callback' => 'render_block_core_post_terms',
|
|
103
|
+
'variations' => array_merge( $built_ins, $custom_variations ),
|
|
56
104
|
)
|
|
57
105
|
);
|
|
58
106
|
}
|
package/src/post-title/index.js
CHANGED
package/src/pullquote/edit.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
RichText,
|
|
14
14
|
useBlockProps,
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
|
-
import { createBlock } from '@wordpress/blocks';
|
|
16
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
17
17
|
import { Platform } from '@wordpress/element';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -87,7 +87,7 @@ function PullQuoteEdit( {
|
|
|
87
87
|
textAlign="center"
|
|
88
88
|
__unstableOnSplitAtEnd={ () =>
|
|
89
89
|
insertBlocksAfter(
|
|
90
|
-
createBlock(
|
|
90
|
+
createBlock( getDefaultBlockName() )
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
/>
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getColorObjectByAttributeValues,
|
|
11
11
|
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
|
|
12
12
|
} from '@wordpress/block-editor';
|
|
13
|
-
import { createBlock } from '@wordpress/blocks';
|
|
13
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -115,7 +115,7 @@ function PullQuoteEdit( props ) {
|
|
|
115
115
|
textAlign={ textAlign ?? 'center' }
|
|
116
116
|
__unstableOnSplitAtEnd={ () =>
|
|
117
117
|
insertBlocksAfter(
|
|
118
|
-
createBlock(
|
|
118
|
+
createBlock( getDefaultBlockName() )
|
|
119
119
|
)
|
|
120
120
|
}
|
|
121
121
|
/>
|
package/src/query/block.json
CHANGED
|
@@ -17,20 +17,28 @@ import {
|
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
18
|
import { InspectorControls } from '@wordpress/block-editor';
|
|
19
19
|
import { useEffect, useState, useCallback } from '@wordpress/element';
|
|
20
|
+
import { useSelect } from '@wordpress/data';
|
|
21
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* Internal dependencies
|
|
23
25
|
*/
|
|
24
26
|
import OrderControl from './order-control';
|
|
25
27
|
import AuthorControl from './author-control';
|
|
28
|
+
import ParentControl from './parent-control';
|
|
26
29
|
import TaxonomyControls from './taxonomy-controls';
|
|
30
|
+
import StickyControl from './sticky-control';
|
|
27
31
|
import { usePostTypes } from '../../utils';
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
function useIsPostTypeHierarchical( postType ) {
|
|
34
|
+
return useSelect(
|
|
35
|
+
( select ) => {
|
|
36
|
+
const type = select( coreStore ).getPostType( postType );
|
|
37
|
+
return type?.viewable && type?.hierarchical;
|
|
38
|
+
},
|
|
39
|
+
[ postType ]
|
|
40
|
+
);
|
|
41
|
+
}
|
|
34
42
|
|
|
35
43
|
export default function QueryInspectorControls( {
|
|
36
44
|
attributes: { query, displayLayout },
|
|
@@ -45,9 +53,11 @@ export default function QueryInspectorControls( {
|
|
|
45
53
|
sticky,
|
|
46
54
|
inherit,
|
|
47
55
|
taxQuery,
|
|
56
|
+
parents,
|
|
48
57
|
} = query;
|
|
49
58
|
const [ showSticky, setShowSticky ] = useState( postType === 'post' );
|
|
50
59
|
const { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();
|
|
60
|
+
const isPostTypeHierarchical = useIsPostTypeHierarchical( postType );
|
|
51
61
|
useEffect( () => {
|
|
52
62
|
setShowSticky( postType === 'post' );
|
|
53
63
|
}, [ postType ] );
|
|
@@ -72,6 +82,8 @@ export default function QueryInspectorControls( {
|
|
|
72
82
|
if ( newValue !== 'post' ) {
|
|
73
83
|
updateQuery.sticky = '';
|
|
74
84
|
}
|
|
85
|
+
// We need to reset `parents` because they are tied to each post type.
|
|
86
|
+
updateQuery.parents = [];
|
|
75
87
|
setQuery( updateQuery );
|
|
76
88
|
};
|
|
77
89
|
const [ querySearch, setQuerySearch ] = useState( query.search );
|
|
@@ -136,14 +148,9 @@ export default function QueryInspectorControls( {
|
|
|
136
148
|
/>
|
|
137
149
|
) }
|
|
138
150
|
{ showSticky && (
|
|
139
|
-
<
|
|
140
|
-
label={ __( 'Sticky posts' ) }
|
|
141
|
-
options={ stickyOptions }
|
|
151
|
+
<StickyControl
|
|
142
152
|
value={ sticky }
|
|
143
153
|
onChange={ ( value ) => setQuery( { sticky: value } ) }
|
|
144
|
-
help={ __(
|
|
145
|
-
'Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'
|
|
146
|
-
) }
|
|
147
154
|
/>
|
|
148
155
|
) }
|
|
149
156
|
</PanelBody>
|
|
@@ -156,6 +163,13 @@ export default function QueryInspectorControls( {
|
|
|
156
163
|
value={ querySearch }
|
|
157
164
|
onChange={ setQuerySearch }
|
|
158
165
|
/>
|
|
166
|
+
{ isPostTypeHierarchical && (
|
|
167
|
+
<ParentControl
|
|
168
|
+
parents={ parents }
|
|
169
|
+
postType={ postType }
|
|
170
|
+
onChange={ setQuery }
|
|
171
|
+
/>
|
|
172
|
+
) }
|
|
159
173
|
</PanelBody>
|
|
160
174
|
) }
|
|
161
175
|
</InspectorControls>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { FormTokenField } from '@wordpress/components';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
import { useState, useEffect, useMemo } from '@wordpress/element';
|
|
9
|
+
import { useDebounce } from '@wordpress/compose';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { getEntitiesInfo, mapToIHasNameAndId } from '../../utils';
|
|
15
|
+
|
|
16
|
+
const EMPTY_ARRAY = [];
|
|
17
|
+
const BASE_QUERY = {
|
|
18
|
+
order: 'asc',
|
|
19
|
+
_fields: 'id,title',
|
|
20
|
+
context: 'view',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function ParentControl( { parents, postType, onChange } ) {
|
|
24
|
+
const [ search, setSearch ] = useState( '' );
|
|
25
|
+
const [ value, setValue ] = useState( EMPTY_ARRAY );
|
|
26
|
+
const [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY );
|
|
27
|
+
const debouncedSearch = useDebounce( setSearch, 250 );
|
|
28
|
+
const { searchResults, searchHasResolved } = useSelect(
|
|
29
|
+
( select ) => {
|
|
30
|
+
if ( ! search ) {
|
|
31
|
+
return { searchResults: EMPTY_ARRAY, searchHasResolved: true };
|
|
32
|
+
}
|
|
33
|
+
const { getEntityRecords, hasFinishedResolution } = select(
|
|
34
|
+
coreStore
|
|
35
|
+
);
|
|
36
|
+
const selectorArgs = [
|
|
37
|
+
'postType',
|
|
38
|
+
postType,
|
|
39
|
+
{
|
|
40
|
+
...BASE_QUERY,
|
|
41
|
+
search,
|
|
42
|
+
orderby: 'relevance',
|
|
43
|
+
exclude: parents,
|
|
44
|
+
per_page: 20,
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
return {
|
|
48
|
+
searchResults: getEntityRecords( ...selectorArgs ),
|
|
49
|
+
searchHasResolved: hasFinishedResolution(
|
|
50
|
+
'getEntityRecords',
|
|
51
|
+
selectorArgs
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
[ search, parents ]
|
|
56
|
+
);
|
|
57
|
+
const currentParents = useSelect(
|
|
58
|
+
( select ) => {
|
|
59
|
+
if ( ! parents?.length ) return EMPTY_ARRAY;
|
|
60
|
+
const { getEntityRecords } = select( coreStore );
|
|
61
|
+
return getEntityRecords( 'postType', postType, {
|
|
62
|
+
...BASE_QUERY,
|
|
63
|
+
include: parents,
|
|
64
|
+
per_page: parents.length,
|
|
65
|
+
} );
|
|
66
|
+
},
|
|
67
|
+
[ parents ]
|
|
68
|
+
);
|
|
69
|
+
// Update the `value` state only after the selectors are resolved
|
|
70
|
+
// to avoid emptying the input when we're changing parents.
|
|
71
|
+
useEffect( () => {
|
|
72
|
+
if ( ! parents?.length ) {
|
|
73
|
+
setValue( EMPTY_ARRAY );
|
|
74
|
+
}
|
|
75
|
+
if ( ! currentParents?.length ) return;
|
|
76
|
+
const currentParentsInfo = getEntitiesInfo(
|
|
77
|
+
mapToIHasNameAndId( currentParents, 'title.rendered' )
|
|
78
|
+
);
|
|
79
|
+
// Returns only the existing entity ids. This prevents the component
|
|
80
|
+
// from crashing in the editor, when non existing ids are provided.
|
|
81
|
+
const sanitizedValue = parents.reduce( ( accumulator, id ) => {
|
|
82
|
+
const entity = currentParentsInfo.mapById[ id ];
|
|
83
|
+
if ( entity ) {
|
|
84
|
+
accumulator.push( {
|
|
85
|
+
id,
|
|
86
|
+
value: entity.name,
|
|
87
|
+
} );
|
|
88
|
+
}
|
|
89
|
+
return accumulator;
|
|
90
|
+
}, [] );
|
|
91
|
+
setValue( sanitizedValue );
|
|
92
|
+
}, [ parents, currentParents ] );
|
|
93
|
+
|
|
94
|
+
const entitiesInfo = useMemo( () => {
|
|
95
|
+
if ( ! searchResults?.length ) return EMPTY_ARRAY;
|
|
96
|
+
return getEntitiesInfo(
|
|
97
|
+
mapToIHasNameAndId( searchResults, 'title.rendered' )
|
|
98
|
+
);
|
|
99
|
+
}, [ searchResults ] );
|
|
100
|
+
// Update suggestions only when the query has resolved.
|
|
101
|
+
useEffect( () => {
|
|
102
|
+
if ( ! searchHasResolved ) return;
|
|
103
|
+
setSuggestions( entitiesInfo.names );
|
|
104
|
+
}, [ entitiesInfo.names, searchHasResolved ] );
|
|
105
|
+
|
|
106
|
+
const getIdByValue = ( entitiesMappedByName, entity ) => {
|
|
107
|
+
const id = entity?.id || entitiesMappedByName?.[ entity ]?.id;
|
|
108
|
+
if ( id ) return id;
|
|
109
|
+
};
|
|
110
|
+
const onParentChange = ( newValue ) => {
|
|
111
|
+
const ids = Array.from(
|
|
112
|
+
newValue.reduce( ( accumulator, entity ) => {
|
|
113
|
+
// Verify that new values point to existing entities.
|
|
114
|
+
const id = getIdByValue( entitiesInfo.mapByName, entity );
|
|
115
|
+
if ( id ) accumulator.add( id );
|
|
116
|
+
return accumulator;
|
|
117
|
+
}, new Set() )
|
|
118
|
+
);
|
|
119
|
+
setSuggestions( EMPTY_ARRAY );
|
|
120
|
+
onChange( { parents: ids } );
|
|
121
|
+
};
|
|
122
|
+
return (
|
|
123
|
+
<FormTokenField
|
|
124
|
+
label={ __( 'Parents' ) }
|
|
125
|
+
value={ value }
|
|
126
|
+
onInputChange={ debouncedSearch }
|
|
127
|
+
suggestions={ suggestions }
|
|
128
|
+
onChange={ onParentChange }
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export default ParentControl;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { SelectControl } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
const stickyOptions = [
|
|
8
|
+
{ label: __( 'Include' ), value: '' },
|
|
9
|
+
{ label: __( 'Exclude' ), value: 'exclude' },
|
|
10
|
+
{ label: __( 'Only' ), value: 'only' },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export default function StickyControl( { value, onChange } ) {
|
|
14
|
+
return (
|
|
15
|
+
<SelectControl
|
|
16
|
+
label={ __( 'Sticky posts' ) }
|
|
17
|
+
options={ stickyOptions }
|
|
18
|
+
value={ value }
|
|
19
|
+
onChange={ onChange }
|
|
20
|
+
help={ __(
|
|
21
|
+
'Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'
|
|
22
|
+
) }
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
package/src/query/utils.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { get } from 'lodash';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { useSelect } from '@wordpress/data';
|
|
5
10
|
import { useMemo } from '@wordpress/element';
|
|
6
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
7
13
|
|
|
8
14
|
/**
|
|
9
15
|
* @typedef IHasNameAndId
|
|
@@ -47,6 +53,22 @@ export const getEntitiesInfo = ( entities ) => {
|
|
|
47
53
|
};
|
|
48
54
|
};
|
|
49
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Helper util to map records to add a `name` prop from a
|
|
58
|
+
* provided path, in order to handle all entities in the same
|
|
59
|
+
* fashion(implementing`IHasNameAndId` interface).
|
|
60
|
+
*
|
|
61
|
+
* @param {Object[]} entities The array of entities.
|
|
62
|
+
* @param {string} path The path to map a `name` property from the entity.
|
|
63
|
+
* @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.
|
|
64
|
+
*/
|
|
65
|
+
export const mapToIHasNameAndId = ( entities, path ) => {
|
|
66
|
+
return ( entities || [] ).map( ( entity ) => ( {
|
|
67
|
+
...entity,
|
|
68
|
+
name: decodeEntities( get( entity, path ) ),
|
|
69
|
+
} ) );
|
|
70
|
+
};
|
|
71
|
+
|
|
50
72
|
/**
|
|
51
73
|
* Returns a helper object that contains:
|
|
52
74
|
* 1. An `options` object from the available post types, to be passed to a `SelectControl`.
|
package/src/query-title/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { title } from '@wordpress/icons';
|
|
6
6
|
const variations = [
|
|
7
7
|
{
|
|
8
8
|
isDefault: true,
|
|
@@ -11,7 +11,7 @@ const variations = [
|
|
|
11
11
|
description: __(
|
|
12
12
|
'Display the archive title based on the queried object.'
|
|
13
13
|
),
|
|
14
|
-
icon:
|
|
14
|
+
icon: title,
|
|
15
15
|
attributes: {
|
|
16
16
|
type: 'archive',
|
|
17
17
|
},
|
package/src/quote/block.json
CHANGED
package/src/quote/edit.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useBlockProps,
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
16
|
import { BlockQuotation } from '@wordpress/components';
|
|
17
|
-
import { createBlock } from '@wordpress/blocks';
|
|
17
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
18
18
|
import { Platform } from '@wordpress/element';
|
|
19
19
|
|
|
20
20
|
const isWebPlatform = Platform.OS === 'web';
|
|
@@ -81,6 +81,7 @@ export default function QuoteEdit( {
|
|
|
81
81
|
createBlock( 'core/paragraph' )
|
|
82
82
|
}
|
|
83
83
|
textAlign={ align }
|
|
84
|
+
__unstableEmbedURLOnPaste
|
|
84
85
|
/>
|
|
85
86
|
{ ( ! RichText.isEmpty( citation ) || isSelected ) && (
|
|
86
87
|
<RichText
|
|
@@ -102,7 +103,9 @@ export default function QuoteEdit( {
|
|
|
102
103
|
className="wp-block-quote__citation"
|
|
103
104
|
textAlign={ align }
|
|
104
105
|
__unstableOnSplitAtEnd={ () =>
|
|
105
|
-
insertBlocksAfter(
|
|
106
|
+
insertBlocksAfter(
|
|
107
|
+
createBlock( getDefaultBlockName() )
|
|
108
|
+
)
|
|
106
109
|
}
|
|
107
110
|
/>
|
|
108
111
|
) }
|
package/src/quote/index.js
CHANGED
package/src/quote/v2/edit.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@wordpress/block-editor';
|
|
18
18
|
import { BlockQuotation } from '@wordpress/components';
|
|
19
19
|
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
20
|
-
import { createBlock } from '@wordpress/blocks';
|
|
20
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
21
21
|
import { Platform, useEffect } from '@wordpress/element';
|
|
22
22
|
import deprecated from '@wordpress/deprecated';
|
|
23
23
|
|
|
@@ -74,6 +74,7 @@ export default function QuoteEdit( {
|
|
|
74
74
|
insertBlocksAfter,
|
|
75
75
|
clientId,
|
|
76
76
|
className,
|
|
77
|
+
style,
|
|
77
78
|
} ) {
|
|
78
79
|
const { citation, align } = attributes;
|
|
79
80
|
|
|
@@ -88,6 +89,7 @@ export default function QuoteEdit( {
|
|
|
88
89
|
className: classNames( className, {
|
|
89
90
|
[ `has-text-align-${ align }` ]: align,
|
|
90
91
|
} ),
|
|
92
|
+
...( ! isWebPlatform && { style } ),
|
|
91
93
|
} );
|
|
92
94
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
93
95
|
template: TEMPLATE,
|
|
@@ -126,8 +128,11 @@ export default function QuoteEdit( {
|
|
|
126
128
|
}
|
|
127
129
|
className="wp-block-quote__citation"
|
|
128
130
|
__unstableOnSplitAtEnd={ () =>
|
|
129
|
-
insertBlocksAfter(
|
|
131
|
+
insertBlocksAfter(
|
|
132
|
+
createBlock( getDefaultBlockName() )
|
|
133
|
+
)
|
|
130
134
|
}
|
|
135
|
+
{ ...( ! isWebPlatform ? { textAlign: align } : {} ) }
|
|
131
136
|
/>
|
|
132
137
|
) }
|
|
133
138
|
</BlockQuotation>
|
package/src/rss/edit.js
CHANGED
|
@@ -109,7 +109,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
109
109
|
<ToolbarGroup controls={ toolbarControls } />
|
|
110
110
|
</BlockControls>
|
|
111
111
|
<InspectorControls>
|
|
112
|
-
<PanelBody title={ __( '
|
|
112
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
113
113
|
<RangeControl
|
|
114
114
|
label={ __( 'Number of items' ) }
|
|
115
115
|
value={ itemsToShow }
|
package/src/search/edit.js
CHANGED
|
@@ -103,8 +103,6 @@ export default function SearchEdit( {
|
|
|
103
103
|
} );
|
|
104
104
|
}, [ insertedInNavigationBlock ] );
|
|
105
105
|
const borderRadius = style?.border?.radius;
|
|
106
|
-
const borderColor = style?.border?.color;
|
|
107
|
-
const borderWidth = style?.border?.width;
|
|
108
106
|
const borderProps = useBorderProps( attributes );
|
|
109
107
|
|
|
110
108
|
// Check for old deprecated numerical border radius. Done as a separate
|
|
@@ -219,6 +217,7 @@ export default function SearchEdit( {
|
|
|
219
217
|
|
|
220
218
|
return (
|
|
221
219
|
<input
|
|
220
|
+
type="search"
|
|
222
221
|
className={ textFieldClasses }
|
|
223
222
|
style={ textFieldStyles }
|
|
224
223
|
aria-label={ __( 'Optional placeholder text' ) }
|
|
@@ -392,10 +391,18 @@ export default function SearchEdit( {
|
|
|
392
391
|
radius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;
|
|
393
392
|
|
|
394
393
|
const getWrapperStyles = () => {
|
|
395
|
-
const styles =
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
394
|
+
const styles = isButtonPositionInside
|
|
395
|
+
? borderProps.style
|
|
396
|
+
: {
|
|
397
|
+
borderRadius: borderProps.style?.borderRadius,
|
|
398
|
+
borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
|
|
399
|
+
borderTopRightRadius:
|
|
400
|
+
borderProps.style?.borderTopRightRadius,
|
|
401
|
+
borderBottomLeftRadius:
|
|
402
|
+
borderProps.style?.borderBottomLeftRadius,
|
|
403
|
+
borderBottomRightRadius:
|
|
404
|
+
borderProps.style?.borderBottomRightRadius,
|
|
405
|
+
};
|
|
399
406
|
|
|
400
407
|
const isNonZeroBorderRadius =
|
|
401
408
|
borderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;
|
|
@@ -417,11 +424,11 @@ export default function SearchEdit( {
|
|
|
417
424
|
} = borderRadius;
|
|
418
425
|
|
|
419
426
|
return {
|
|
427
|
+
...styles,
|
|
420
428
|
borderTopLeftRadius: padBorderRadius( topLeft ),
|
|
421
429
|
borderTopRightRadius: padBorderRadius( topRight ),
|
|
422
430
|
borderBottomLeftRadius: padBorderRadius( bottomLeft ),
|
|
423
431
|
borderBottomRightRadius: padBorderRadius( bottomRight ),
|
|
424
|
-
...styles,
|
|
425
432
|
};
|
|
426
433
|
}
|
|
427
434
|
|