@wordpress/block-library 7.4.0 → 7.7.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/audio/edit.js +4 -16
- package/build/audio/edit.js.map +1 -1
- package/build/block/edit.js +10 -9
- package/build/block/edit.js.map +1 -1
- package/build/button/deprecated.js +175 -35
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/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/button/save.js +1 -1
- package/build/button/save.js.map +1 -1
- package/build/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -1
- package/build/columns/index.js +3 -1
- package/build/columns/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 +3 -3
- 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/deprecated.js +110 -0
- package/build/comments-title/deprecated.js.map +1 -0
- package/build/comments-title/edit.js +35 -35
- package/build/comments-title/edit.js.map +1 -1
- package/build/comments-title/index.js +5 -8
- 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/deprecated.js +212 -207
- package/build/cover/deprecated.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 +343 -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/save.js +18 -5
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +15 -9
- 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/embed-preview.js +1 -1
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +0 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/save.js +9 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/edit.js +2 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/gap-styles.js +14 -4
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +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/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/image/edit.js +5 -56
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +56 -4
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +4 -14
- package/build/image/image.js.map +1 -1
- package/build/index.js +48 -14
- package/build/index.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-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 +44 -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/media-text/edit.native.js +2 -1
- 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 +91 -109
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +6 -12
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +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 +25 -0
- package/build/navigation/view-modal.js.map +1 -1
- package/build/navigation-link/edit.js +60 -35
- 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/navigation-submenu/edit.js +14 -14
- package/build/navigation-submenu/edit.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/use-enter.js +94 -0
- package/build/paragraph/use-enter.js.map +1 -0
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-name/index.js +4 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-author-name/transforms.js +41 -0
- package/build/post-author-name/transforms.js.map +1 -0
- package/build/post-comment/index.js +2 -1
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/edit.js +138 -35
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments/index.js +3 -2
- package/build/post-comments/index.js.map +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 +38 -4
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +58 -0
- package/build/post-comments-form/form.js.map +1 -0
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js +13 -7
- package/build/post-date/edit.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-no-results/edit.js +1 -1
- package/build/query-no-results/edit.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 +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/edit.js +1 -1
- package/build/quote/v2/edit.js.map +1 -1
- package/build/search/edit.js +2 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +4 -0
- package/build/search/index.js.map +1 -1
- package/build/separator/index.js +3 -0
- package/build/separator/index.js.map +1 -1
- package/build/shortcode/edit.native.js +16 -13
- package/build/shortcode/edit.native.js.map +1 -1
- package/build/site-logo/edit.js +1 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/edit.js +2 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/table/edit.js +15 -2
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +145 -65
- 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/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 +4 -8
- package/build/video/edit.js.map +1 -1
- package/build-module/audio/edit.js +5 -17
- package/build-module/audio/edit.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/deprecated.js +175 -35
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +2 -2
- package/build-module/button/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/button/save.js +2 -2
- package/build-module/button/save.js.map +1 -1
- package/build-module/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -1
- package/build-module/columns/index.js +3 -1
- package/build-module/columns/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 +2 -2
- 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/deprecated.js +102 -0
- package/build-module/comments-title/deprecated.js.map +1 -0
- package/build-module/comments-title/edit.js +38 -38
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/comments-title/index.js +4 -8
- 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/deprecated.js +206 -198
- package/build-module/cover/deprecated.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 +317 -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/save.js +19 -6
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +11 -5
- 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/embed-preview.js +2 -2
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/edit.js +2 -2
- package/build-module/file/edit.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/save.js +7 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/edit.js +2 -1
- 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/gap-styles.js +14 -4
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +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/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/image/edit.js +4 -52
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +57 -6
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +6 -16
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +43 -12
- package/build-module/index.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-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 +33 -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/media-text/edit.native.js +2 -1
- 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 +93 -110
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +7 -13
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +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 +24 -0
- package/build-module/navigation/view-modal.js.map +1 -1
- package/build-module/navigation-link/edit.js +60 -36
- 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/navigation-submenu/edit.js +14 -14
- package/build-module/navigation-submenu/edit.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/use-enter.js +81 -0
- package/build-module/paragraph/use-enter.js.map +1 -0
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +3 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-author-name/transforms.js +32 -0
- package/build-module/post-author-name/transforms.js.map +1 -0
- 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 +139 -37
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments/index.js +3 -2
- package/build-module/post-comments/index.js.map +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 -6
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +45 -0
- package/build-module/post-comments-form/form.js.map +1 -0
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- 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-content/edit.js +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/edit.js +15 -9
- package/build-module/post-date/edit.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-no-results/edit.js +1 -1
- package/build-module/query-no-results/edit.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 +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/edit.js +2 -2
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/search/edit.js +3 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +4 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/separator/index.js +3 -0
- package/build-module/separator/index.js.map +1 -1
- package/build-module/shortcode/edit.native.js +17 -13
- package/build-module/shortcode/edit.native.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/social-links/edit.js +2 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/edit.js +17 -4
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +144 -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/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 +5 -9
- package/build-module/video/edit.js.map +1 -1
- package/build-style/comment-content/style-rtl.css +81 -0
- package/build-style/comment-content/style.css +81 -0
- 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/cover/style-rtl.css +32 -27
- package/build-style/cover/style.css +32 -27
- 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/latest-posts/style-rtl.css +2 -0
- package/build-style/latest-posts/style.css +4 -0
- package/build-style/navigation/style-rtl.css +3 -0
- package/build-style/navigation/style.css +3 -0
- package/build-style/post-comments/editor-rtl.css +79 -0
- package/build-style/post-comments/editor.css +79 -0
- package/build-style/post-comments/style-rtl.css +27 -3
- package/build-style/post-comments/style.css +27 -3
- package/build-style/post-comments-form/editor-rtl.css +79 -0
- package/build-style/post-comments-form/editor.css +79 -0
- package/build-style/post-comments-form/style-rtl.css +1 -3
- package/build-style/post-comments-form/style.css +1 -3
- package/build-style/separator/editor-rtl.css +1 -0
- package/build-style/separator/editor.css +1 -0
- package/build-style/site-logo/style-rtl.css +4 -0
- package/build-style/site-logo/style.css +4 -0
- package/build-style/style-rtl.css +69 -33
- package/build-style/style.css +71 -33
- 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/audio/edit.js +6 -9
- 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/deprecated.js +145 -0
- package/src/button/edit.js +3 -1
- package/src/button/edit.native.js +6 -3
- package/src/button/save.js +3 -1
- package/src/buttons/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/buttons/test/edit.native.js +1 -1
- package/src/categories/block.json +1 -1
- package/src/categories/edit.js +1 -1
- package/src/columns/block.json +3 -1
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comment-author-name/index.php +7 -5
- package/src/comment-content/index.php +25 -3
- package/src/comment-content/style.scss +5 -0
- package/src/comment-edit-link/index.php +1 -4
- package/src/comment-reply-link/index.php +1 -4
- package/src/comment-template/edit.js +1 -5
- package/src/comment-template/index.php +4 -0
- 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 +2 -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-pagination/index.php +4 -0
- package/src/comments-title/block.json +0 -6
- package/src/comments-title/deprecated.js +34 -0
- package/src/comments-title/edit.js +44 -84
- package/src/comments-title/index.js +3 -1
- package/src/comments-title/index.php +51 -22
- package/src/cover/controls.native.js +1 -2
- package/src/cover/deprecated.js +230 -183
- package/src/cover/edit/block-controls.js +119 -0
- package/src/cover/edit/cover-placeholder.js +39 -0
- package/src/cover/edit/index.js +393 -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/index.php +20 -37
- package/src/cover/save.js +26 -13
- package/src/cover/shared.js +5 -3
- package/src/cover/style.native.scss +4 -0
- package/src/cover/style.scss +27 -26
- 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 +3 -1
- package/src/embed/embed-preview.js +4 -2
- package/src/file/edit.js +5 -1
- package/src/file/edit.native.js +0 -1
- package/src/file/save.js +14 -2
- package/src/gallery/block.json +1 -1
- package/src/gallery/edit.js +2 -1
- package/src/gallery/gallery.js +2 -2
- package/src/gallery/gap-styles.js +21 -6
- package/src/gallery/index.php +23 -12
- 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/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/image/edit.js +0 -44
- package/src/image/edit.native.js +65 -4
- package/src/image/editor.scss +1 -1
- package/src/image/image.js +10 -13
- package/src/image/styles.native.scss +11 -0
- package/src/image/test/edit.native.js +7 -7
- package/src/index.js +53 -33
- package/src/is-block-metadata-experimental.js +19 -0
- package/src/latest-posts/edit.js +27 -2
- package/src/latest-posts/edit.native.js +56 -1
- package/src/latest-posts/index.php +12 -6
- package/src/latest-posts/style.scss +4 -0
- 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 +33 -0
- package/src/list-item/utils.js +1 -1
- package/src/media-text/edit.native.js +3 -1
- package/src/media-text/media-container.native.js +2 -4
- package/src/media-text/transforms.js +154 -0
- package/src/navigation/block.json +0 -1
- package/src/navigation/edit/index.js +181 -205
- package/src/navigation/edit/inner-blocks.js +6 -15
- package/src/navigation/index.php +40 -0
- package/src/navigation/style.scss +3 -0
- package/src/navigation/use-navigation-entities.js +1 -1
- package/src/navigation/view-modal.js +32 -0
- package/src/navigation-link/edit.js +75 -48
- 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/navigation-link/test/edit.js +0 -20
- package/src/navigation-submenu/edit.js +13 -17
- 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/use-enter.js +103 -0
- package/src/post-author/edit.js +24 -22
- package/src/post-author/index.php +4 -3
- package/src/post-author-name/block.json +1 -0
- package/src/post-author-name/index.js +2 -0
- package/src/post-author-name/index.php +1 -1
- package/src/post-author-name/transforms.js +25 -0
- package/src/post-comment/block.json +2 -1
- package/src/post-comments/block.json +3 -2
- package/src/post-comments/edit.js +206 -44
- package/src/post-comments/editor.scss +3 -0
- package/src/post-comments/index.php +3 -1
- package/src/post-comments/style.scss +30 -5
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/block.json +1 -0
- package/src/post-comments-form/edit.js +52 -23
- package/src/post-comments-form/editor.scss +3 -0
- package/src/post-comments-form/form.js +50 -0
- package/src/post-comments-form/index.php +10 -3
- package/src/post-comments-form/style.scss +1 -4
- package/src/post-comments-link/block.json +1 -0
- package/src/post-content/edit.js +15 -1
- package/src/post-date/edit.js +4 -3
- package/src/post-excerpt/edit.js +14 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-template/edit.js +5 -0
- package/src/post-template/index.php +30 -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-no-results/edit.js +1 -1
- package/src/query-pagination/index.php +0 -1
- 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/v2/edit.js +4 -2
- package/src/search/block.json +4 -0
- package/src/search/edit.js +4 -1
- package/src/search/index.php +29 -16
- package/src/separator/block.json +3 -0
- package/src/separator/editor.scss +1 -0
- package/src/shortcode/edit.native.js +29 -15
- package/src/shortcode/style.native.scss +11 -4
- package/src/shortcode/test/__snapshots__/edit.native.js.snap +9 -0
- package/src/shortcode/test/edit.native.js +58 -40
- package/src/site-logo/edit.js +1 -1
- package/src/site-logo/style.scss +6 -0
- package/src/social-links/edit.js +11 -10
- package/src/table/edit.js +19 -4
- package/src/table-of-contents/block.json +9 -2
- package/src/table-of-contents/edit.js +170 -77
- 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/template-part/edit/index.js +25 -15
- package/src/template-part/edit/inner-blocks.js +2 -10
- package/src/video/edit.js +7 -6
- 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 -665
- package/build/cover/edit.js.map +0 -1
- package/build/navigation-area/edit.js +0 -110
- package/build/navigation-area/edit.js.map +0 -1
- package/build/navigation-area/index.js +0 -62
- package/build/navigation-area/index.js.map +0 -1
- package/build/navigation-area/inner-blocks.js +0 -34
- package/build/navigation-area/inner-blocks.js.map +0 -1
- package/build/navigation-area/save.js +0 -18
- package/build/navigation-area/save.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 -642
- package/build-module/cover/edit.js.map +0 -1
- package/build-module/navigation-area/edit.js +0 -94
- package/build-module/navigation-area/edit.js.map +0 -1
- package/build-module/navigation-area/index.js +0 -48
- package/build-module/navigation-area/index.js.map +0 -1
- package/build-module/navigation-area/inner-blocks.js +0 -26
- package/build-module/navigation-area/inner-blocks.js.map +0 -1
- package/build-module/navigation-area/save.js +0 -10
- package/build-module/navigation-area/save.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 -822
- package/src/navigation-area/block.json +0 -23
- package/src/navigation-area/edit.js +0 -111
- package/src/navigation-area/index.js +0 -26
- package/src/navigation-area/index.php +0 -22
- package/src/navigation-area/inner-blocks.js +0 -24
- package/src/navigation-area/save.js +0 -8
- 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
package/src/audio/edit.js
CHANGED
|
@@ -29,7 +29,7 @@ import { useEffect } from '@wordpress/element';
|
|
|
29
29
|
import { __, _x } from '@wordpress/i18n';
|
|
30
30
|
import { useSelect } from '@wordpress/data';
|
|
31
31
|
import { audio as icon } from '@wordpress/icons';
|
|
32
|
-
import { createBlock } from '@wordpress/blocks';
|
|
32
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Internal dependencies
|
|
@@ -62,13 +62,8 @@ function AudioEdit( {
|
|
|
62
62
|
if ( file ) {
|
|
63
63
|
mediaUpload( {
|
|
64
64
|
filesList: [ file ],
|
|
65
|
-
onFileChange: ( [
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
onError: ( e ) => {
|
|
69
|
-
setAttributes( { src: undefined, id: undefined } );
|
|
70
|
-
noticeOperations.createErrorNotice( e );
|
|
71
|
-
},
|
|
65
|
+
onFileChange: ( [ media ] ) => onSelectAudio( media ),
|
|
66
|
+
onError: ( e ) => onUploadError( e ),
|
|
72
67
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
73
68
|
} );
|
|
74
69
|
}
|
|
@@ -213,7 +208,9 @@ function AudioEdit( {
|
|
|
213
208
|
}
|
|
214
209
|
inlineToolbar
|
|
215
210
|
__unstableOnSplitAtEnd={ () =>
|
|
216
|
-
insertBlocksAfter(
|
|
211
|
+
insertBlocksAfter(
|
|
212
|
+
createBlock( getDefaultBlockName() )
|
|
213
|
+
)
|
|
217
214
|
}
|
|
218
215
|
/>
|
|
219
216
|
) }
|
package/src/avatar/block.json
CHANGED
package/src/avatar/index.php
CHANGED
|
@@ -105,11 +105,11 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
105
105
|
return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
|
|
106
106
|
}
|
|
107
107
|
$comment = get_comment( $block->context['commentId'] );
|
|
108
|
-
/* translators: %s is the Comment Author name */
|
|
109
|
-
$alt = sprintf( __( '%s Avatar' ), $comment->comment_author );
|
|
110
108
|
if ( ! $comment ) {
|
|
111
109
|
return '';
|
|
112
110
|
}
|
|
111
|
+
/* translators: %s is the Comment Author name */
|
|
112
|
+
$alt = sprintf( __( '%s Avatar' ), $comment->comment_author );
|
|
113
113
|
$avatar_block = get_avatar(
|
|
114
114
|
$comment,
|
|
115
115
|
$size,
|
package/src/block/edit.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
5
5
|
import {
|
|
6
6
|
useEntityBlockEditor,
|
|
7
7
|
useEntityProp,
|
|
8
|
-
|
|
8
|
+
useEntityRecord,
|
|
9
9
|
} from '@wordpress/core-data';
|
|
10
10
|
import {
|
|
11
11
|
Placeholder,
|
|
@@ -19,7 +19,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
19
|
import {
|
|
20
20
|
useInnerBlocksProps,
|
|
21
21
|
__experimentalUseNoRecursiveRenders as useNoRecursiveRenders,
|
|
22
|
-
|
|
22
|
+
__experimentalUseBlockOverlayActive as useBlockOverlayActive,
|
|
23
23
|
InnerBlocks,
|
|
24
24
|
BlockControls,
|
|
25
25
|
InspectorControls,
|
|
@@ -62,20 +62,25 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
|
|
|
62
62
|
ref
|
|
63
63
|
);
|
|
64
64
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const innerBlocksProps = useInnerBlocksProps(
|
|
68
|
-
{},
|
|
65
|
+
const hasBlockOverlay = useBlockOverlayActive( clientId );
|
|
66
|
+
const blockProps = useBlockProps(
|
|
69
67
|
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
: InnerBlocks.ButtonBlockAppender,
|
|
76
|
-
}
|
|
68
|
+
className: hasBlockOverlay
|
|
69
|
+
? 'block-library-block__reusable-block-container block-editor-block-content-overlay'
|
|
70
|
+
: 'block-library-block__reusable-block-container',
|
|
71
|
+
},
|
|
72
|
+
{ __unstableIsDisabled: hasBlockOverlay }
|
|
77
73
|
);
|
|
78
74
|
|
|
75
|
+
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
76
|
+
value: blocks,
|
|
77
|
+
onInput,
|
|
78
|
+
onChange,
|
|
79
|
+
renderAppender: blocks?.length
|
|
80
|
+
? undefined
|
|
81
|
+
: InnerBlocks.ButtonBlockAppender,
|
|
82
|
+
} );
|
|
83
|
+
|
|
79
84
|
if ( hasAlreadyRendered ) {
|
|
80
85
|
return (
|
|
81
86
|
<div { ...blockProps }>
|
|
@@ -108,36 +113,28 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
|
|
|
108
113
|
|
|
109
114
|
return (
|
|
110
115
|
<RecursionProvider>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
label={ __( 'Convert to regular blocks' ) }
|
|
120
|
-
icon={ ungroup }
|
|
121
|
-
showTooltip
|
|
122
|
-
/>
|
|
123
|
-
</ToolbarGroup>
|
|
124
|
-
</BlockControls>
|
|
125
|
-
) }
|
|
126
|
-
<InspectorControls>
|
|
127
|
-
<PanelBody>
|
|
128
|
-
<TextControl
|
|
129
|
-
label={ __( 'Name' ) }
|
|
130
|
-
value={ title }
|
|
131
|
-
onChange={ setTitle }
|
|
116
|
+
{ canRemove && (
|
|
117
|
+
<BlockControls>
|
|
118
|
+
<ToolbarGroup>
|
|
119
|
+
<ToolbarButton
|
|
120
|
+
onClick={ () => convertBlockToStatic( clientId ) }
|
|
121
|
+
label={ __( 'Convert to regular blocks' ) }
|
|
122
|
+
icon={ ungroup }
|
|
123
|
+
showTooltip
|
|
132
124
|
/>
|
|
133
|
-
</
|
|
134
|
-
</
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
</ToolbarGroup>
|
|
126
|
+
</BlockControls>
|
|
127
|
+
) }
|
|
128
|
+
<InspectorControls>
|
|
129
|
+
<PanelBody>
|
|
130
|
+
<TextControl
|
|
131
|
+
label={ __( 'Name' ) }
|
|
132
|
+
value={ title }
|
|
133
|
+
onChange={ setTitle }
|
|
134
|
+
/>
|
|
135
|
+
</PanelBody>
|
|
136
|
+
</InspectorControls>
|
|
137
|
+
<div { ...innerBlocksProps } />
|
|
141
138
|
</RecursionProvider>
|
|
142
139
|
);
|
|
143
140
|
}
|
|
@@ -146,7 +146,7 @@ describe( 'Reusable block', () => {
|
|
|
146
146
|
} );
|
|
147
147
|
|
|
148
148
|
// Skipped until `pointerEvents: 'none'` no longer erroneously prevents
|
|
149
|
-
// triggering `onLayout*` on the element: https://
|
|
149
|
+
// triggering `onLayout*` on the element: https://github.com/callstack/react-native-testing-library/issues/897.
|
|
150
150
|
it.skip( 'renders block content', async () => {
|
|
151
151
|
// We have to use different ids because entities are cached in memory.
|
|
152
152
|
const id = 4;
|
package/src/button/block.json
CHANGED
package/src/button/deprecated.js
CHANGED
|
@@ -119,6 +119,150 @@ const blockAttributes = {
|
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
+
const v11 = {
|
|
123
|
+
attributes: {
|
|
124
|
+
url: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
source: 'attribute',
|
|
127
|
+
selector: 'a',
|
|
128
|
+
attribute: 'href',
|
|
129
|
+
},
|
|
130
|
+
title: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
source: 'attribute',
|
|
133
|
+
selector: 'a',
|
|
134
|
+
attribute: 'title',
|
|
135
|
+
},
|
|
136
|
+
text: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
source: 'html',
|
|
139
|
+
selector: 'a',
|
|
140
|
+
},
|
|
141
|
+
linkTarget: {
|
|
142
|
+
type: 'string',
|
|
143
|
+
source: 'attribute',
|
|
144
|
+
selector: 'a',
|
|
145
|
+
attribute: 'target',
|
|
146
|
+
},
|
|
147
|
+
rel: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
source: 'attribute',
|
|
150
|
+
selector: 'a',
|
|
151
|
+
attribute: 'rel',
|
|
152
|
+
},
|
|
153
|
+
placeholder: {
|
|
154
|
+
type: 'string',
|
|
155
|
+
},
|
|
156
|
+
backgroundColor: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
},
|
|
159
|
+
textColor: {
|
|
160
|
+
type: 'string',
|
|
161
|
+
},
|
|
162
|
+
gradient: {
|
|
163
|
+
type: 'string',
|
|
164
|
+
},
|
|
165
|
+
width: {
|
|
166
|
+
type: 'number',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
supports: {
|
|
170
|
+
anchor: true,
|
|
171
|
+
align: true,
|
|
172
|
+
alignWide: false,
|
|
173
|
+
color: {
|
|
174
|
+
__experimentalSkipSerialization: true,
|
|
175
|
+
gradients: true,
|
|
176
|
+
__experimentalDefaultControls: {
|
|
177
|
+
background: true,
|
|
178
|
+
text: true,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
typography: {
|
|
182
|
+
fontSize: true,
|
|
183
|
+
__experimentalFontFamily: true,
|
|
184
|
+
__experimentalDefaultControls: {
|
|
185
|
+
fontSize: true,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
reusable: false,
|
|
189
|
+
spacing: {
|
|
190
|
+
__experimentalSkipSerialization: true,
|
|
191
|
+
padding: [ 'horizontal', 'vertical' ],
|
|
192
|
+
__experimentalDefaultControls: {
|
|
193
|
+
padding: true,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
__experimentalBorder: {
|
|
197
|
+
radius: true,
|
|
198
|
+
__experimentalSkipSerialization: true,
|
|
199
|
+
__experimentalDefaultControls: {
|
|
200
|
+
radius: true,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
__experimentalSelector: '.wp-block-button__link',
|
|
204
|
+
},
|
|
205
|
+
save( { attributes, className } ) {
|
|
206
|
+
const {
|
|
207
|
+
fontSize,
|
|
208
|
+
linkTarget,
|
|
209
|
+
rel,
|
|
210
|
+
style,
|
|
211
|
+
text,
|
|
212
|
+
title,
|
|
213
|
+
url,
|
|
214
|
+
width,
|
|
215
|
+
} = attributes;
|
|
216
|
+
|
|
217
|
+
if ( ! text ) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const borderProps = getBorderClassesAndStyles( attributes );
|
|
222
|
+
const colorProps = getColorClassesAndStyles( attributes );
|
|
223
|
+
const spacingProps = getSpacingClassesAndStyles( attributes );
|
|
224
|
+
const buttonClasses = classnames(
|
|
225
|
+
'wp-block-button__link',
|
|
226
|
+
colorProps.className,
|
|
227
|
+
borderProps.className,
|
|
228
|
+
{
|
|
229
|
+
// For backwards compatibility add style that isn't provided via
|
|
230
|
+
// block support.
|
|
231
|
+
'no-border-radius': style?.border?.radius === 0,
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
const buttonStyle = {
|
|
235
|
+
...borderProps.style,
|
|
236
|
+
...colorProps.style,
|
|
237
|
+
...spacingProps.style,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// The use of a `title` attribute here is soft-deprecated, but still applied
|
|
241
|
+
// if it had already been assigned, for the sake of backward-compatibility.
|
|
242
|
+
// A title will no longer be assigned for new or updated button block links.
|
|
243
|
+
|
|
244
|
+
const wrapperClasses = classnames( className, {
|
|
245
|
+
[ `has-custom-width wp-block-button__width-${ width }` ]: width,
|
|
246
|
+
[ `has-custom-font-size` ]: fontSize || style?.typography?.fontSize,
|
|
247
|
+
} );
|
|
248
|
+
|
|
249
|
+
return (
|
|
250
|
+
<div { ...useBlockProps.save( { className: wrapperClasses } ) }>
|
|
251
|
+
<RichText.Content
|
|
252
|
+
tagName="a"
|
|
253
|
+
className={ buttonClasses }
|
|
254
|
+
href={ url }
|
|
255
|
+
title={ title }
|
|
256
|
+
style={ buttonStyle }
|
|
257
|
+
value={ text }
|
|
258
|
+
target={ linkTarget }
|
|
259
|
+
rel={ rel }
|
|
260
|
+
/>
|
|
261
|
+
</div>
|
|
262
|
+
);
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
|
|
122
266
|
const v10 = {
|
|
123
267
|
attributes: {
|
|
124
268
|
url: {
|
|
@@ -258,6 +402,7 @@ const v10 = {
|
|
|
258
402
|
};
|
|
259
403
|
|
|
260
404
|
const deprecated = [
|
|
405
|
+
v11,
|
|
261
406
|
v10,
|
|
262
407
|
{
|
|
263
408
|
supports: {
|
package/src/button/edit.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
__experimentalUseColorProps as useColorProps,
|
|
26
26
|
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
|
|
27
27
|
__experimentalLinkControl as LinkControl,
|
|
28
|
+
__experimentalElementButtonClassName,
|
|
28
29
|
} from '@wordpress/block-editor';
|
|
29
30
|
import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
|
|
30
31
|
import { link, linkOff } from '@wordpress/icons';
|
|
@@ -176,7 +177,8 @@ function ButtonEdit( props ) {
|
|
|
176
177
|
// For backwards compatibility add style that isn't
|
|
177
178
|
// provided via block support.
|
|
178
179
|
'no-border-radius': style?.border?.radius === 0,
|
|
179
|
-
}
|
|
180
|
+
},
|
|
181
|
+
__experimentalElementButtonClassName
|
|
180
182
|
) }
|
|
181
183
|
style={ {
|
|
182
184
|
...borderProps.style,
|
|
@@ -134,10 +134,13 @@ function ButtonEdit( props ) {
|
|
|
134
134
|
useEffect( () => {
|
|
135
135
|
// Blur `RichText` on Android when link settings sheet or button settings sheet is opened,
|
|
136
136
|
// to avoid flashing caret after closing one of them
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
const richText = richTextRef?.current;
|
|
138
|
+
if ( Platform.OS === 'android' && richText ) {
|
|
139
|
+
if ( editorSidebarOpened || isLinkSheetVisible ) {
|
|
140
|
+
richText.blur();
|
|
140
141
|
onToggleButtonFocus( false );
|
|
142
|
+
} else {
|
|
143
|
+
onToggleButtonFocus( true );
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
}, [ editorSidebarOpened, isLinkSheetVisible ] );
|
package/src/button/save.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
|
|
13
13
|
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
|
|
14
14
|
__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
|
|
15
|
+
__experimentalElementButtonClassName,
|
|
15
16
|
} from '@wordpress/block-editor';
|
|
16
17
|
|
|
17
18
|
export default function save( { attributes, className } ) {
|
|
@@ -41,7 +42,8 @@ export default function save( { attributes, className } ) {
|
|
|
41
42
|
// For backwards compatibility add style that isn't provided via
|
|
42
43
|
// block support.
|
|
43
44
|
'no-border-radius': style?.border?.radius === 0,
|
|
44
|
-
}
|
|
45
|
+
},
|
|
46
|
+
__experimentalElementButtonClassName
|
|
45
47
|
);
|
|
46
48
|
const buttonStyle = {
|
|
47
49
|
...borderProps.style,
|
|
@@ -21,7 +21,7 @@ exports[`Buttons block justify content sets Justify items right option 1`] = `
|
|
|
21
21
|
exports[`Buttons block when a button is shown adjusts the border radius 1`] = `
|
|
22
22
|
"<!-- wp:buttons -->
|
|
23
23
|
<div class=\\"wp-block-buttons\\"><!-- wp:button {\\"style\\":{\\"border\\":{\\"radius\\":\\"6px\\"}}} -->
|
|
24
|
-
<div class=\\"wp-block-button\\"><a class=\\"wp-block-button__link\\" href=\\"\\" style=\\"border-radius:6px\\">Hello</a></div>
|
|
24
|
+
<div class=\\"wp-block-button\\"><a class=\\"wp-block-button__link wp-element-button\\" href=\\"\\" style=\\"border-radius:6px\\">Hello</a></div>
|
|
25
25
|
<!-- /wp:button --></div>
|
|
26
26
|
<!-- /wp:buttons -->"
|
|
27
27
|
`;
|
|
@@ -32,7 +32,7 @@ describe( 'Buttons block', () => {
|
|
|
32
32
|
it( 'adjusts the border radius', async () => {
|
|
33
33
|
const initialHtml = `<!-- wp:buttons -->
|
|
34
34
|
<div class="wp-block-buttons"><!-- wp:button {"style":{"border":{"radius":"5px"}}} -->
|
|
35
|
-
<div class="wp-block-button"><a class="wp-block-button__link" style="border-radius:5px" >Hello</a></div>
|
|
35
|
+
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" style="border-radius:5px" >Hello</a></div>
|
|
36
36
|
<!-- /wp:button --></div>
|
|
37
37
|
<!-- /wp:buttons -->`;
|
|
38
38
|
const { getByA11yLabel } = await initializeEditor( {
|
package/src/categories/edit.js
CHANGED
|
@@ -17,7 +17,7 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
17
17
|
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
18
18
|
import { __ } from '@wordpress/i18n';
|
|
19
19
|
import { pin } from '@wordpress/icons';
|
|
20
|
-
import {
|
|
20
|
+
import { useEntityRecords } from '@wordpress/core-data';
|
|
21
21
|
|
|
22
22
|
export default function CategoriesEdit( {
|
|
23
23
|
attributes: {
|
package/src/columns/block.json
CHANGED
|
@@ -18,17 +18,16 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
|
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
$comment
|
|
21
|
+
$comment = get_comment( $block->context['commentId'] );
|
|
22
|
+
$commenter = wp_get_current_commenter();
|
|
23
|
+
$show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];
|
|
22
24
|
if ( empty( $comment ) ) {
|
|
23
25
|
return '';
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
$classes = '';
|
|
27
29
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
28
|
-
$classes .= 'has-text-align-' .
|
|
29
|
-
}
|
|
30
|
-
if ( isset( $attributes['fontSize'] ) ) {
|
|
31
|
-
$classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
|
|
30
|
+
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
@@ -38,6 +37,9 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
|
|
|
38
37
|
if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
|
|
39
38
|
$comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
|
|
40
39
|
}
|
|
40
|
+
if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
|
|
41
|
+
$comment_author = wp_kses( $comment_author, array() );
|
|
42
|
+
}
|
|
41
43
|
|
|
42
44
|
return sprintf(
|
|
43
45
|
'<div %1$s>%2$s</div>',
|
|
@@ -18,16 +18,37 @@ function render_block_core_comment_content( $attributes, $content, $block ) {
|
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
$comment
|
|
21
|
+
$comment = get_comment( $block->context['commentId'] );
|
|
22
|
+
$commenter = wp_get_current_commenter();
|
|
23
|
+
$show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];
|
|
22
24
|
if ( empty( $comment ) ) {
|
|
23
25
|
return '';
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
$
|
|
28
|
+
$args = array();
|
|
29
|
+
$comment_text = get_comment_text( $comment, $args );
|
|
27
30
|
if ( ! $comment_text ) {
|
|
28
31
|
return '';
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
/** This filter is documented in wp-includes/comment-template.php */
|
|
35
|
+
$comment_text = apply_filters( 'comment_text', $comment_text, $comment, $args );
|
|
36
|
+
|
|
37
|
+
$moderation_note = '';
|
|
38
|
+
if ( '0' === $comment->comment_approved ) {
|
|
39
|
+
$commenter = wp_get_current_commenter();
|
|
40
|
+
|
|
41
|
+
if ( $commenter['comment_author_email'] ) {
|
|
42
|
+
$moderation_note = __( 'Your comment is awaiting moderation.' );
|
|
43
|
+
} else {
|
|
44
|
+
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.' );
|
|
45
|
+
}
|
|
46
|
+
$moderation_note = '<p><em class="comment-awaiting-moderation">' . $moderation_note . '</em></p>';
|
|
47
|
+
if ( ! $show_pending_links ) {
|
|
48
|
+
$comment_text = wp_kses( $comment_text, array() );
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
31
52
|
$classes = '';
|
|
32
53
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
33
54
|
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
|
@@ -36,8 +57,9 @@ function render_block_core_comment_content( $attributes, $content, $block ) {
|
|
|
36
57
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
37
58
|
|
|
38
59
|
return sprintf(
|
|
39
|
-
'<div %1$s>%2$s</div>',
|
|
60
|
+
'<div %1$s>%2$s%3$s</div>',
|
|
40
61
|
$wrapper_attributes,
|
|
62
|
+
$moderation_note,
|
|
41
63
|
$comment_text
|
|
42
64
|
);
|
|
43
65
|
}
|
|
@@ -29,10 +29,7 @@ function render_block_core_comment_edit_link( $attributes, $content, $block ) {
|
|
|
29
29
|
|
|
30
30
|
$classes = '';
|
|
31
31
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
32
|
-
$classes .= 'has-text-align-' .
|
|
33
|
-
}
|
|
34
|
-
if ( isset( $attributes['fontSize'] ) ) {
|
|
35
|
-
$classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
|
|
32
|
+
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
@@ -53,10 +53,7 @@ function render_block_core_comment_reply_link( $attributes, $content, $block ) {
|
|
|
53
53
|
|
|
54
54
|
$classes = '';
|
|
55
55
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
56
|
-
$classes .= 'has-text-align-' .
|
|
57
|
-
}
|
|
58
|
-
if ( isset( $attributes['fontSize'] ) ) {
|
|
59
|
-
$classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
|
|
56
|
+
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
|
60
57
|
}
|
|
61
58
|
|
|
62
59
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
|
@@ -288,11 +288,7 @@ export default function CommentTemplateEdit( {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
if ( ! commentTree.length ) {
|
|
291
|
-
return (
|
|
292
|
-
<p { ...blockProps } data-testid="noresults">
|
|
293
|
-
{ __( 'No results found.' ) }
|
|
294
|
-
</p>
|
|
295
|
-
);
|
|
291
|
+
return <p { ...blockProps }>{ __( 'No results found.' ) }</p>;
|
|
296
292
|
}
|
|
297
293
|
|
|
298
294
|
return (
|
|
@@ -79,6 +79,10 @@ function render_block_core_comment_template( $attributes, $content, $block ) {
|
|
|
79
79
|
return '';
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
if ( post_password_required( $block->context['postId'] ) ) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
82
86
|
$comment_query = new WP_Comment_Query(
|
|
83
87
|
build_comment_query_vars_from_block( $block )
|
|
84
88
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
3
|
"apiVersion": 2,
|
|
4
4
|
"name": "core/comments-query-loop",
|
|
5
|
-
"title": "Comments
|
|
5
|
+
"title": "Comments",
|
|
6
6
|
"category": "theme",
|
|
7
7
|
"description": "An advanced block that allows displaying post comments using different visual configurations.",
|
|
8
8
|
"textdomain": "default",
|
|
File without changes
|
|
@@ -65,9 +65,10 @@ const TEMPLATE = [
|
|
|
65
65
|
],
|
|
66
66
|
],
|
|
67
67
|
[ 'core/comments-pagination' ],
|
|
68
|
+
[ 'core/post-comments-form' ],
|
|
68
69
|
];
|
|
69
70
|
|
|
70
|
-
export default function
|
|
71
|
+
export default function CommentsEdit( { attributes, setAttributes } ) {
|
|
71
72
|
const { tagName: TagName } = attributes;
|
|
72
73
|
|
|
73
74
|
const blockProps = useBlockProps();
|
|
File without changes
|
|
File without changes
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
|
|
5
5
|
|
|
6
|
-
export default function
|
|
7
|
-
attributes: { tagName: Tag },
|
|
8
|
-
} ) {
|
|
6
|
+
export default function CommentsSave( { attributes: { tagName: Tag } } ) {
|
|
9
7
|
return (
|
|
10
8
|
<Tag { ...useBlockProps.save() }>
|
|
11
9
|
<InnerBlocks.Content />
|