@wordpress/block-library 7.8.0 → 7.11.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 +6 -0
- package/build/audio/edit.js +1 -0
- package/build/audio/edit.js.map +1 -1
- package/build/audio/save.js +2 -1
- package/build/audio/save.js.map +1 -1
- package/build/avatar/hooks.js +2 -2
- package/build/avatar/hooks.js.map +1 -1
- package/build/button/edit.js +3 -2
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +1 -24
- 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/buttons/edit.js +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/variations.js +2 -2
- package/build/columns/variations.js.map +1 -1
- package/build/comment-author-name/edit.js +3 -5
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-author-name/index.js +0 -4
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-date/edit.js +4 -4
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +0 -4
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +0 -4
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +0 -4
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +1 -1
- package/build/comments/deprecated.js +65 -0
- package/build/comments/deprecated.js.map +1 -0
- package/build/comments/edit/comments-legacy.js +73 -0
- package/build/comments/edit/comments-legacy.js.map +1 -0
- package/build/comments/{edit.js → edit/index.js} +17 -30
- package/build/comments/edit/index.js.map +1 -0
- package/build/comments/edit/placeholder.js +117 -0
- package/build/comments/edit/placeholder.js.map +1 -0
- package/build/comments/edit/template.js +39 -0
- package/build/comments/edit/template.js.map +1 -0
- package/build/comments/index.js +11 -3
- package/build/comments/index.js.map +1 -1
- package/build/comments/save.js +12 -4
- package/build/comments/save.js.map +1 -1
- package/build/comments-pagination/index.js +1 -1
- package/build/comments-title/deprecated.js +1 -4
- package/build/comments-title/deprecated.js.map +1 -1
- package/build/comments-title/index.js +1 -1
- package/build/cover/edit/block-controls.js +2 -12
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +3 -1
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +19 -4
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +1 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/transforms.js +3 -2
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +1 -3
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/embed-preview.js +1 -0
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/icons.js +21 -1
- package/build/embed/icons.js.map +1 -1
- package/build/embed/save.js +1 -0
- package/build/embed/save.js.map +1 -1
- package/build/embed/variations.js +11 -0
- package/build/embed/variations.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/save.js +1 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/edit.js +11 -19
- 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/save.js +1 -1
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/transforms.js +32 -22
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.js +7 -18
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-get-media.native.js +59 -0
- package/build/gallery/use-get-media.native.js.map +1 -0
- package/build/gallery/v1/edit.js +3 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.js +1 -0
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/save.js +10 -2
- package/build/gallery/v1/save.js.map +1 -1
- package/build/group/edit.js +1 -3
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +2 -0
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +1 -1
- package/build/group/variations.js.map +1 -1
- package/build/heading/heading-level-dropdown.js +2 -1
- package/build/heading/heading-level-dropdown.js.map +1 -1
- package/build/heading/index.js +9 -4
- package/build/heading/index.js.map +1 -1
- package/build/html/edit.js +11 -20
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +48 -0
- package/build/html/preview.js.map +1 -0
- package/build/image/deprecated.js +77 -9
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +3 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +20 -9
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +28 -20
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -1
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +9 -2
- package/build/image/save.js.map +1 -1
- package/build/index.js +1 -3
- package/build/index.js.map +1 -1
- package/build/index.native.js +3 -13
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/transforms.js +4 -63
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/transforms.js +31 -42
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +14 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +8 -8
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-enter.js +7 -4
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +174 -0
- package/build/list-item/hooks/use-merge.js.map +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js +93 -36
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/utils.js +125 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +134 -7
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +2 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/save.js +13 -0
- package/build/media-text/save.js.map +1 -1
- package/build/more/edit.js +2 -4
- package/build/more/edit.js.map +1 -1
- package/build/more/save.js +1 -7
- package/build/more/save.js.map +1 -1
- package/build/navigation/edit/index.js +1 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +9 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +16 -74
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view.js +6 -1
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +5 -4
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/hooks.js +0 -16
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/view.js +6 -1
- package/build/navigation-submenu/view.js.map +1 -1
- package/build/nextpage/edit.js +1 -3
- package/build/nextpage/edit.js.map +1 -1
- package/build/page-list/edit.js +10 -3
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +7 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +4 -37
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +47 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-terms/edit.js +3 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +1 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/index.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-pagination-next/edit.js +2 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js +2 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +168 -36
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +76 -39
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +9 -45
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +1 -5
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js +110 -158
- package/build/quote/transforms.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +5 -13
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/edit/level-toolbar.js +2 -1
- package/build/site-title/edit/level-toolbar.js.map +1 -1
- package/build/social-link/icons/index.js +13 -0
- package/build/social-link/icons/index.js.map +1 -1
- package/build/social-link/icons/whatsapp.js +25 -0
- package/build/social-link/icons/whatsapp.js.map +1 -0
- package/build/social-link/variations.js +7 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/table/edit.js +1 -0
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js +2 -1
- package/build/table/save.js.map +1 -1
- package/build/template-part/edit/index.js +17 -8
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +33 -13
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/search.js +94 -0
- package/build/template-part/edit/utils/search.js.map +1 -0
- package/build/template-part/index.js +1 -1
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +0 -16
- package/build/template-part/variations.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -3
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build/video/edit.js +1 -0
- package/build/video/edit.js.map +1 -1
- package/build/video/save.js +1 -0
- package/build/video/save.js.map +1 -1
- package/build/video/tracks-editor.js +9 -11
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/audio/edit.js +2 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/save.js +3 -2
- package/build-module/audio/save.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -2
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/button/edit.js +4 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +1 -24
- 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/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/variations.js +2 -2
- package/build-module/columns/variations.js.map +1 -1
- package/build-module/comment-author-name/edit.js +3 -5
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +0 -4
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-date/edit.js +4 -4
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +0 -4
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +0 -4
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +0 -4
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +1 -1
- package/build-module/comments/deprecated.js +54 -0
- package/build-module/comments/deprecated.js.map +1 -0
- package/build-module/comments/edit/comments-legacy.js +59 -0
- package/build-module/comments/edit/comments-legacy.js.map +1 -0
- package/build-module/comments/edit/index.js +37 -0
- package/build-module/comments/edit/index.js.map +1 -0
- package/build-module/comments/edit/placeholder.js +102 -0
- package/build-module/comments/edit/placeholder.js.map +1 -0
- package/build-module/comments/edit/template.js +32 -0
- package/build-module/comments/edit/template.js.map +1 -0
- package/build-module/comments/index.js +10 -3
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments/save.js +9 -4
- package/build-module/comments/save.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -1
- package/build-module/comments-title/deprecated.js +1 -4
- package/build-module/comments-title/deprecated.js.map +1 -1
- package/build-module/comments-title/index.js +1 -1
- package/build-module/cover/edit/block-controls.js +3 -13
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +3 -1
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +19 -4
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +1 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/transforms.js +3 -2
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -2
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +2 -1
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/icons.js +19 -0
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/embed/save.js +2 -1
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/variations.js +12 -1
- package/build-module/embed/variations.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/save.js +2 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/edit.js +11 -18
- 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/save.js +2 -2
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/transforms.js +33 -23
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.js +6 -16
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +50 -0
- package/build-module/gallery/use-get-media.native.js.map +1 -0
- package/build-module/gallery/v1/edit.js +4 -4
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.js +2 -1
- package/build-module/gallery/v1/gallery-image.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/gallery/v1/save.js +8 -3
- package/build-module/gallery/v1/save.js.map +1 -1
- package/build-module/group/edit.js +1 -3
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +2 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +2 -2
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.js +2 -1
- package/build-module/heading/heading-level-dropdown.js.map +1 -1
- package/build-module/heading/index.js +9 -4
- package/build-module/heading/index.js.map +1 -1
- package/build-module/html/edit.js +12 -23
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +38 -0
- package/build-module/html/preview.js.map +1 -0
- package/build-module/image/deprecated.js +77 -9
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +5 -3
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +20 -9
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +30 -22
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +10 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/index.js +1 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +3 -13
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/transforms.js +4 -63
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/transforms.js +32 -44
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +14 -10
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +1 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-enter.js +7 -4
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +160 -0
- package/build-module/list-item/hooks/use-merge.js.map +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js +88 -33
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/utils.js +123 -2
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +134 -8
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +2 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/save.js +13 -0
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/more/edit.js +2 -4
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/save.js +1 -6
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +9 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +17 -75
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view.js +6 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/hooks.js +0 -13
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/view.js +6 -1
- package/build-module/navigation-submenu/view.js.map +1 -1
- package/build-module/nextpage/edit.js +1 -3
- package/build-module/nextpage/edit.js.map +1 -1
- package/build-module/page-list/edit.js +10 -3
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +8 -12
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +5 -35
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +46 -5
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-terms/edit.js +3 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +1 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query-no-results/edit.js +2 -2
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +2 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +2 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +162 -36
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +77 -43
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +9 -39
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +4 -8
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js +111 -158
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/search/edit.js +2 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +5 -13
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/edit/level-toolbar.js +2 -1
- package/build-module/site-title/edit/level-toolbar.js.map +1 -1
- package/build-module/social-link/icons/index.js +1 -0
- package/build-module/social-link/icons/index.js.map +1 -1
- package/build-module/social-link/icons/whatsapp.js +15 -0
- package/build-module/social-link/icons/whatsapp.js.map +1 -0
- package/build-module/social-link/variations.js +8 -1
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/table/edit.js +2 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/save.js +3 -2
- package/build-module/table/save.js.map +1 -1
- package/build-module/template-part/edit/index.js +20 -11
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +33 -15
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/search.js +84 -0
- package/build-module/template-part/edit/utils/search.js.map +1 -0
- package/build-module/template-part/index.js +1 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +0 -13
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +5 -2
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-module/video/edit.js +2 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/save.js +2 -1
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks-editor.js +9 -11
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/button/style-rtl.css +6 -1
- package/build-style/button/style.css +6 -1
- package/build-style/comment-template/style-rtl.css +12 -0
- package/build-style/comment-template/style.css +12 -0
- package/build-style/comments/editor-rtl.css +122 -0
- package/build-style/comments/editor.css +122 -0
- package/build-style/{post-comments → comments}/style-rtl.css +3 -1
- package/build-style/{post-comments → comments}/style.css +3 -1
- package/build-style/common-rtl.css +7 -0
- package/build-style/common.css +7 -0
- package/build-style/cover/style-rtl.css +2 -2
- package/build-style/cover/style.css +2 -2
- package/build-style/editor-elements-rtl.css +85 -0
- package/build-style/editor-elements.css +85 -0
- package/build-style/editor-rtl.css +154 -10
- package/build-style/editor.css +154 -10
- package/build-style/{post-comments/editor-rtl.css → elements-rtl.css} +5 -2
- package/build-style/{post-comments/editor.css → elements.css} +5 -2
- package/build-style/file/style-rtl.css +5 -8
- package/build-style/file/style.css +5 -8
- package/build-style/gallery/style-rtl.css +7 -2
- package/build-style/gallery/style.css +7 -2
- package/build-style/image/editor-rtl.css +4 -3
- package/build-style/image/editor.css +4 -3
- package/build-style/image/style-rtl.css +33 -3
- package/build-style/image/style.css +33 -3
- package/build-style/navigation/style-rtl.css +9 -1
- package/build-style/navigation/style.css +9 -1
- package/build-style/post-comments-form/editor-rtl.css +3 -0
- package/build-style/post-comments-form/editor.css +3 -0
- package/build-style/post-comments-form/style-rtl.css +0 -1
- package/build-style/post-comments-form/style.css +0 -1
- package/build-style/post-template/style-rtl.css +9 -18
- package/build-style/post-template/style.css +9 -18
- package/build-style/query/editor-rtl.css +1 -1
- package/build-style/query/editor.css +1 -1
- package/build-style/search/style-rtl.css +6 -8
- package/build-style/search/style.css +6 -8
- package/build-style/search/theme-rtl.css +5 -0
- package/build-style/search/theme.css +5 -0
- package/build-style/social-link/editor-rtl.css +1 -0
- package/build-style/social-link/editor.css +1 -0
- package/build-style/social-links/style-rtl.css +8 -0
- package/build-style/social-links/style.css +8 -0
- package/build-style/style-rtl.css +216 -154
- package/build-style/style.css +216 -154
- package/build-style/template-part/editor-rtl.css +14 -3
- package/build-style/template-part/editor.css +14 -3
- package/build-style/theme-rtl.css +5 -0
- package/build-style/theme.css +5 -0
- package/package.json +28 -28
- package/src/audio/edit.js +4 -0
- package/src/audio/save.js +12 -2
- package/src/avatar/hooks.js +6 -9
- package/src/button/block.json +1 -24
- package/src/button/edit.js +3 -2
- package/src/button/save.js +2 -2
- package/src/button/style.scss +13 -1
- package/src/buttons/edit.js +1 -5
- package/src/columns/edit.native.js +2 -2
- package/src/columns/variations.js +2 -2
- package/src/comment-author-name/block.json +0 -4
- package/src/comment-author-name/edit.js +3 -12
- package/src/comment-date/block.json +0 -4
- package/src/comment-date/edit.js +10 -14
- package/src/comment-date/index.php +0 -3
- package/src/comment-edit-link/block.json +0 -4
- package/src/comment-reply-link/block.json +0 -4
- package/src/comment-template/block.json +1 -1
- package/src/comment-template/style.scss +14 -0
- package/src/comments/block.json +7 -2
- package/src/comments/deprecated.js +53 -0
- package/src/comments/edit/comments-legacy.js +71 -0
- package/src/comments/edit/index.js +35 -0
- package/src/comments/edit/placeholder.js +124 -0
- package/src/comments/{edit.js → edit/template.js} +25 -32
- package/src/comments/editor.scss +9 -0
- package/src/comments/index.js +2 -0
- package/src/comments/index.php +219 -0
- package/src/comments/save.js +8 -7
- package/src/{post-comments → comments}/style.scss +14 -3
- package/src/comments-pagination/block.json +1 -1
- package/src/comments-title/block.json +1 -1
- package/src/comments-title/deprecated.js +0 -2
- package/src/common.scss +2 -0
- package/src/cover/block.json +1 -0
- package/src/cover/edit/block-controls.js +4 -20
- package/src/cover/edit/cover-placeholder.js +2 -0
- package/src/cover/edit/index.js +16 -0
- package/src/cover/index.php +21 -8
- package/src/cover/style.scss +2 -2
- package/src/cover/transforms.js +2 -2
- package/src/editor-elements.scss +10 -0
- package/src/editor.scss +2 -1
- package/src/elements.scss +6 -0
- package/src/embed/embed-placeholder.native.js +2 -3
- package/src/embed/embed-preview.js +8 -1
- package/src/embed/icons.js +25 -0
- package/src/embed/save.js +10 -2
- package/src/embed/test/__snapshots__/index.native.js.snap +1 -1
- package/src/embed/variations.js +10 -0
- package/src/file/edit.js +4 -2
- package/src/file/save.js +2 -2
- package/src/file/style.scss +5 -5
- package/src/freeform/editor.scss +0 -2
- package/src/gallery/edit.js +12 -23
- package/src/gallery/gallery.js +9 -2
- package/src/gallery/index.php +5 -1
- package/src/gallery/save.js +5 -1
- package/src/gallery/style.scss +10 -1
- package/src/gallery/test/__snapshots__/index.native.js.snap +2 -2
- package/src/gallery/test/helpers.native.js +11 -198
- package/src/gallery/test/index.native.js +19 -29
- package/src/gallery/transforms.js +28 -13
- package/src/gallery/use-get-media.js +11 -28
- package/src/gallery/use-get-media.native.js +44 -0
- package/src/gallery/v1/edit.js +3 -4
- package/src/gallery/v1/gallery-image.js +4 -0
- package/src/gallery/v1/gallery.js +8 -2
- package/src/gallery/v1/save.js +20 -3
- package/src/group/block.json +2 -0
- package/src/group/edit.js +1 -3
- package/src/group/variations.js +2 -2
- package/src/heading/heading-level-dropdown.js +1 -0
- package/src/heading/index.js +8 -2
- package/src/html/edit.js +10 -40
- package/src/html/preview.js +46 -0
- package/src/image/block.json +7 -1
- package/src/image/deprecated.js +86 -0
- package/src/image/edit.js +6 -1
- package/src/image/edit.native.js +19 -7
- package/src/image/editor.scss +9 -4
- package/src/image/image.js +28 -16
- package/src/image/save.js +20 -3
- package/src/image/style.scss +39 -3
- package/src/image/test/edit.native.js +51 -19
- package/src/index.js +0 -2
- package/src/index.native.js +2 -11
- package/src/latest-posts/edit.js +2 -6
- package/src/list/transforms.js +0 -47
- package/src/list/v2/transforms.js +23 -46
- package/src/list-item/edit.js +10 -12
- package/src/list-item/hooks/index.js +1 -1
- package/src/list-item/hooks/use-enter.js +9 -6
- package/src/list-item/hooks/use-merge.js +141 -0
- package/src/list-item/hooks/use-outdent-list-item.js +79 -54
- package/src/list-item/utils.js +27 -3
- package/src/media-text/deprecated.js +148 -1
- package/src/media-text/edit.js +2 -1
- package/src/media-text/save.js +18 -0
- package/src/more/edit.js +9 -11
- package/src/more/save.js +3 -6
- package/src/navigation/block.json +9 -0
- package/src/navigation/edit/index.js +1 -0
- package/src/navigation/style.scss +11 -2
- package/src/navigation/test/use-navigation-menu.js +16 -11
- package/src/navigation/use-navigation-menu.js +26 -83
- package/src/navigation/view.js +6 -1
- package/src/navigation-link/edit.js +4 -3
- package/src/navigation-link/hooks.js +0 -14
- package/src/navigation-link/index.js +1 -1
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +0 -93
- package/src/navigation-link/test/hooks.js +0 -12
- package/src/navigation-submenu/edit.js +1 -0
- package/src/navigation-submenu/view.js +6 -1
- package/src/nextpage/edit.js +1 -3
- package/src/page-list/edit.js +12 -5
- package/src/paragraph/edit.js +8 -14
- package/src/post-comments-form/edit.js +3 -58
- package/src/post-comments-form/editor.scss +4 -0
- package/src/post-comments-form/form.js +81 -6
- package/src/post-comments-form/index.php +1 -1
- package/src/post-comments-form/style.scss +0 -1
- package/src/post-featured-image/index.php +4 -2
- package/src/post-template/index.php +23 -17
- package/src/post-template/style.scss +1 -7
- package/src/post-terms/edit.js +3 -2
- package/src/post-terms/index.js +1 -1
- package/src/post-title/block.json +1 -0
- package/src/query/edit/inspector-controls/index.js +1 -1
- package/src/query/editor.scss +1 -1
- package/src/query/index.js +1 -1
- package/src/query-no-results/edit.js +2 -5
- package/src/query-no-results/index.php +10 -8
- package/src/query-pagination-next/edit.js +1 -0
- package/src/query-pagination-previous/edit.js +1 -0
- package/src/quote/deprecated.js +213 -99
- package/src/quote/edit.js +77 -52
- package/src/quote/index.js +10 -33
- package/src/quote/save.js +5 -5
- package/src/quote/{v2/test → test}/migrate.js +2 -7
- package/src/quote/transforms.js +117 -147
- package/src/search/edit.js +2 -2
- package/src/search/index.php +12 -10
- package/src/search/style.scss +9 -8
- package/src/search/theme.scss +5 -0
- package/src/site-logo/edit.js +2 -11
- package/src/site-title/edit/level-toolbar.js +1 -0
- package/src/social-link/editor.scss +3 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/whatsapp.js +10 -0
- package/src/social-link/index.php +20 -0
- package/src/social-link/socials-with-bg.scss +5 -0
- package/src/social-link/socials-without-bg.scss +5 -0
- package/src/social-link/variations.js +7 -0
- package/src/style.scss +1 -1
- package/src/table/edit.js +2 -0
- package/src/table/save.js +6 -1
- package/src/template-part/edit/index.js +37 -24
- package/src/template-part/edit/selection-modal.js +68 -40
- package/src/template-part/edit/utils/search.js +76 -0
- package/src/template-part/editor.scss +21 -9
- package/src/template-part/index.js +1 -1
- package/src/template-part/index.php +56 -2
- package/src/template-part/variations.js +0 -11
- package/src/utils/clean-empty-object.js +8 -2
- package/src/video/edit.js +4 -0
- package/src/video/save.js +10 -2
- package/src/video/tracks-editor.js +1 -1
- package/build/comments/edit.js.map +0 -1
- package/build/gallery/use-short-code-transform.js +0 -64
- package/build/gallery/use-short-code-transform.js.map +0 -1
- package/build/list-item/hooks/use-backspace.js +0 -59
- package/build/list-item/hooks/use-backspace.js.map +0 -1
- package/build/navigation-link/fallback-variations.js +0 -75
- package/build/navigation-link/fallback-variations.js.map +0 -1
- package/build/post-comments/edit.js +0 -184
- package/build/post-comments/edit.js.map +0 -1
- package/build/post-comments/index.js +0 -72
- package/build/post-comments/index.js.map +0 -1
- package/build/quote/v2/deprecated.js +0 -133
- package/build/quote/v2/deprecated.js.map +0 -1
- package/build/quote/v2/edit.js +0 -139
- package/build/quote/v2/edit.js.map +0 -1
- package/build/quote/v2/index.js +0 -49
- package/build/quote/v2/index.js.map +0 -1
- package/build/quote/v2/save.js +0 -43
- package/build/quote/v2/save.js.map +0 -1
- package/build/quote/v2/transforms.js +0 -156
- package/build/quote/v2/transforms.js.map +0 -1
- package/build/template-part/fallback-variations.js +0 -59
- package/build/template-part/fallback-variations.js.map +0 -1
- package/build-module/comments/edit.js +0 -51
- package/build-module/comments/edit.js.map +0 -1
- package/build-module/gallery/use-short-code-transform.js +0 -54
- package/build-module/gallery/use-short-code-transform.js.map +0 -1
- package/build-module/list-item/hooks/use-backspace.js +0 -44
- package/build-module/list-item/hooks/use-backspace.js.map +0 -1
- package/build-module/navigation-link/fallback-variations.js +0 -65
- package/build-module/navigation-link/fallback-variations.js.map +0 -1
- package/build-module/post-comments/edit.js +0 -171
- package/build-module/post-comments/edit.js.map +0 -1
- package/build-module/post-comments/index.js +0 -59
- package/build-module/post-comments/index.js.map +0 -1
- package/build-module/quote/v2/deprecated.js +0 -116
- package/build-module/quote/v2/deprecated.js.map +0 -1
- package/build-module/quote/v2/edit.js +0 -122
- package/build-module/quote/v2/edit.js.map +0 -1
- package/build-module/quote/v2/index.js +0 -33
- package/build-module/quote/v2/index.js.map +0 -1
- package/build-module/quote/v2/save.js +0 -30
- package/build-module/quote/v2/save.js.map +0 -1
- package/build-module/quote/v2/transforms.js +0 -147
- package/build-module/quote/v2/transforms.js.map +0 -1
- package/build-module/template-part/fallback-variations.js +0 -47
- package/build-module/template-part/fallback-variations.js.map +0 -1
- package/src/gallery/use-short-code-transform.js +0 -55
- package/src/list-item/hooks/use-backspace.js +0 -51
- package/src/navigation-link/fallback-variations.js +0 -65
- package/src/post-comments/block.json +0 -45
- package/src/post-comments/edit.js +0 -247
- package/src/post-comments/editor.scss +0 -3
- package/src/post-comments/index.js +0 -18
- package/src/post-comments/index.php +0 -87
- package/src/quote/v2/deprecated.js +0 -107
- package/src/quote/v2/edit.js +0 -139
- package/src/quote/v2/index.js +0 -36
- package/src/quote/v2/save.js +0 -26
- package/src/quote/v2/transforms.js +0 -155
- package/src/template-part/fallback-variations.js +0 -51
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
|
+
import { useEntityProp } from '@wordpress/core-data';
|
|
8
|
+
import { useDisabled } from '@wordpress/compose';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import CommentsForm from '../../post-comments-form/form';
|
|
14
|
+
|
|
15
|
+
export default function PostCommentsPlaceholder( { postType, postId } ) {
|
|
16
|
+
let [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );
|
|
17
|
+
postTitle = postTitle || __( 'Post Title' );
|
|
18
|
+
|
|
19
|
+
const { avatarURL } = useSelect(
|
|
20
|
+
( select ) =>
|
|
21
|
+
select( blockEditorStore ).getSettings()
|
|
22
|
+
.__experimentalDiscussionSettings
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const disabledRef = useDisabled();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
className="wp-block-comments__legacy-placeholder"
|
|
30
|
+
ref={ disabledRef }
|
|
31
|
+
>
|
|
32
|
+
<h3>
|
|
33
|
+
{
|
|
34
|
+
/* translators: %s: Post title. */
|
|
35
|
+
sprintf( __( 'One response to %s' ), postTitle )
|
|
36
|
+
}
|
|
37
|
+
</h3>
|
|
38
|
+
|
|
39
|
+
<div className="navigation">
|
|
40
|
+
<div className="alignleft">
|
|
41
|
+
<a href="#top">« { __( 'Older Comments' ) }</a>
|
|
42
|
+
</div>
|
|
43
|
+
<div className="alignright">
|
|
44
|
+
<a href="#top">{ __( 'Newer Comments' ) } »</a>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ol className="commentlist">
|
|
49
|
+
<li className="comment even thread-even depth-1">
|
|
50
|
+
<article className="comment-body">
|
|
51
|
+
<footer className="comment-meta">
|
|
52
|
+
<div className="comment-author vcard">
|
|
53
|
+
<img
|
|
54
|
+
alt="Commenter Avatar"
|
|
55
|
+
src={ avatarURL }
|
|
56
|
+
className="avatar avatar-32 photo"
|
|
57
|
+
height="32"
|
|
58
|
+
width="32"
|
|
59
|
+
loading="lazy"
|
|
60
|
+
/>
|
|
61
|
+
<b className="fn">
|
|
62
|
+
<a href="#top" className="url">
|
|
63
|
+
{ __( 'A WordPress Commenter' ) }
|
|
64
|
+
</a>
|
|
65
|
+
</b>{ ' ' }
|
|
66
|
+
<span className="says">{ __( 'says' ) }:</span>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div className="comment-metadata">
|
|
70
|
+
<a href="#top">
|
|
71
|
+
<time dateTime="2000-01-01T00:00:00+00:00">
|
|
72
|
+
{ __( 'January 1, 2000 at 00:00 am' ) }
|
|
73
|
+
</time>
|
|
74
|
+
</a>{ ' ' }
|
|
75
|
+
<span className="edit-link">
|
|
76
|
+
<a
|
|
77
|
+
className="comment-edit-link"
|
|
78
|
+
href="#top"
|
|
79
|
+
>
|
|
80
|
+
{ __( 'Edit' ) }
|
|
81
|
+
</a>
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
</footer>
|
|
85
|
+
|
|
86
|
+
<div className="comment-content">
|
|
87
|
+
<p>
|
|
88
|
+
{ __( 'Hi, this is a comment.' ) }
|
|
89
|
+
<br />
|
|
90
|
+
{ __(
|
|
91
|
+
'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'
|
|
92
|
+
) }
|
|
93
|
+
<br />
|
|
94
|
+
{ __( 'Commenter avatars come from' ) }{ ' ' }
|
|
95
|
+
<a href="https://gravatar.com/">Gravatar</a>.
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div className="reply">
|
|
100
|
+
<a
|
|
101
|
+
className="comment-reply-link"
|
|
102
|
+
href="#top"
|
|
103
|
+
aria-label="Reply to A WordPress Commenter"
|
|
104
|
+
>
|
|
105
|
+
{ __( 'Reply' ) }
|
|
106
|
+
</a>
|
|
107
|
+
</div>
|
|
108
|
+
</article>
|
|
109
|
+
</li>
|
|
110
|
+
</ol>
|
|
111
|
+
|
|
112
|
+
<div className="navigation">
|
|
113
|
+
<div className="alignleft">
|
|
114
|
+
<a href="#top">« { __( 'Older Comments' ) }</a>
|
|
115
|
+
</div>
|
|
116
|
+
<div className="alignright">
|
|
117
|
+
<a href="#top">{ __( 'Newer Comments' ) } »</a>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<CommentsForm postId={ postId } postType={ postType } />
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import CommentsInspectorControls from './edit/comments-inspector-controls';
|
|
10
|
-
|
|
11
1
|
const TEMPLATE = [
|
|
12
2
|
[ 'core/comments-title' ],
|
|
13
3
|
[
|
|
@@ -37,7 +27,12 @@ const TEMPLATE = [
|
|
|
37
27
|
'core/column',
|
|
38
28
|
{},
|
|
39
29
|
[
|
|
40
|
-
[
|
|
30
|
+
[
|
|
31
|
+
'core/comment-author-name',
|
|
32
|
+
{
|
|
33
|
+
fontSize: 'small',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
41
36
|
[
|
|
42
37
|
'core/group',
|
|
43
38
|
{
|
|
@@ -52,12 +47,27 @@ const TEMPLATE = [
|
|
|
52
47
|
},
|
|
53
48
|
},
|
|
54
49
|
[
|
|
55
|
-
[
|
|
56
|
-
|
|
50
|
+
[
|
|
51
|
+
'core/comment-date',
|
|
52
|
+
{
|
|
53
|
+
fontSize: 'small',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
'core/comment-edit-link',
|
|
58
|
+
{
|
|
59
|
+
fontSize: 'small',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
57
62
|
],
|
|
58
63
|
],
|
|
59
64
|
[ 'core/comment-content' ],
|
|
60
|
-
[
|
|
65
|
+
[
|
|
66
|
+
'core/comment-reply-link',
|
|
67
|
+
{
|
|
68
|
+
fontSize: 'small',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
61
71
|
],
|
|
62
72
|
],
|
|
63
73
|
],
|
|
@@ -68,21 +78,4 @@ const TEMPLATE = [
|
|
|
68
78
|
[ 'core/post-comments-form' ],
|
|
69
79
|
];
|
|
70
80
|
|
|
71
|
-
export default
|
|
72
|
-
const { tagName: TagName } = attributes;
|
|
73
|
-
|
|
74
|
-
const blockProps = useBlockProps();
|
|
75
|
-
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
76
|
-
template: TEMPLATE,
|
|
77
|
-
} );
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<>
|
|
81
|
-
<CommentsInspectorControls
|
|
82
|
-
attributes={ attributes }
|
|
83
|
-
setAttributes={ setAttributes }
|
|
84
|
-
/>
|
|
85
|
-
<TagName { ...innerBlocksProps } />
|
|
86
|
-
</>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
81
|
+
export default TEMPLATE;
|
package/src/comments/editor.scss
CHANGED
package/src/comments/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { postComments as icon } from '@wordpress/icons';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import metadata from './block.json';
|
|
10
|
+
import deprecated from './deprecated';
|
|
10
11
|
import edit from './edit';
|
|
11
12
|
import save from './save';
|
|
12
13
|
|
|
@@ -17,4 +18,5 @@ export const settings = {
|
|
|
17
18
|
icon,
|
|
18
19
|
edit,
|
|
19
20
|
save,
|
|
21
|
+
deprecated,
|
|
20
22
|
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Server-side rendering of the `core/comments` block.
|
|
4
|
+
*
|
|
5
|
+
* @package WordPress
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Renders the `core/comments` block on the server.
|
|
10
|
+
*
|
|
11
|
+
* This render callback is mainly for rendering a dynamic, legacy version of
|
|
12
|
+
* this block (the old `core/post-comments`). It uses the `comments_template()`
|
|
13
|
+
* function to generate the output, in the same way as classic PHP themes.
|
|
14
|
+
*
|
|
15
|
+
* As this callback will always run during SSR, first we need to check whether
|
|
16
|
+
* the block is in legacy mode. If not, the HTML generated in the editor is
|
|
17
|
+
* returned instead.
|
|
18
|
+
*
|
|
19
|
+
* @param array $attributes Block attributes.
|
|
20
|
+
* @param string $content Block default content.
|
|
21
|
+
* @param WP_Block $block Block instance.
|
|
22
|
+
* @return string Returns the filtered post comments for the current post wrapped inside "p" tags.
|
|
23
|
+
*/
|
|
24
|
+
function render_block_core_comments( $attributes, $content, $block ) {
|
|
25
|
+
global $post;
|
|
26
|
+
|
|
27
|
+
$is_legacy = 'core/post-comments' === $block->name || ! empty( $attributes['legacy'] );
|
|
28
|
+
if ( ! $is_legacy ) {
|
|
29
|
+
return $block->render( array( 'dynamic' => false ) );
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
$post_id = $block->context['postId'];
|
|
33
|
+
if ( ! isset( $post_id ) ) {
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
$comment_args = array(
|
|
38
|
+
'post_id' => $post_id,
|
|
39
|
+
'count' => true,
|
|
40
|
+
'status' => 'approve',
|
|
41
|
+
);
|
|
42
|
+
// Return early if there are no comments and comments are closed.
|
|
43
|
+
if ( ! comments_open( $post_id ) && get_comments( $comment_args ) === 0 ) {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$post_before = $post;
|
|
48
|
+
$post = get_post( $post_id );
|
|
49
|
+
setup_postdata( $post );
|
|
50
|
+
|
|
51
|
+
ob_start();
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* There's a deprecation warning generated by WP Core.
|
|
55
|
+
* Ideally this deprecation is removed from Core.
|
|
56
|
+
* In the meantime, this removes it from the output.
|
|
57
|
+
*/
|
|
58
|
+
add_filter( 'deprecated_file_trigger_error', '__return_false' );
|
|
59
|
+
comments_template();
|
|
60
|
+
remove_filter( 'deprecated_file_trigger_error', '__return_false' );
|
|
61
|
+
|
|
62
|
+
$output = ob_get_clean();
|
|
63
|
+
$post = $post_before;
|
|
64
|
+
|
|
65
|
+
$classnames = array();
|
|
66
|
+
// Adds the old class name for styles' backwards compatibility.
|
|
67
|
+
if ( isset( $attributes['legacy'] ) ) {
|
|
68
|
+
$classnames[] = 'wp-block-post-comments';
|
|
69
|
+
}
|
|
70
|
+
if ( isset( $attributes['textAlign'] ) ) {
|
|
71
|
+
$classnames[] = 'has-text-align-' . $attributes['textAlign'];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
$wrapper_attributes = get_block_wrapper_attributes(
|
|
75
|
+
array( 'class' => implode( ' ', $classnames ) )
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Enqueues scripts and styles required only for the legacy version. That is
|
|
80
|
+
* why they are not defined in `block.json`.
|
|
81
|
+
*/
|
|
82
|
+
wp_enqueue_script( 'comment-reply' );
|
|
83
|
+
enqueue_legacy_post_comments_block_styles( $block->name );
|
|
84
|
+
|
|
85
|
+
return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $output );
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Registers the `core/comments` block on the server.
|
|
90
|
+
*/
|
|
91
|
+
function register_block_core_comments() {
|
|
92
|
+
register_block_type_from_metadata(
|
|
93
|
+
__DIR__ . '/comments',
|
|
94
|
+
array(
|
|
95
|
+
'render_callback' => 'render_block_core_comments',
|
|
96
|
+
'skip_inner_blocks' => true,
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
add_action( 'init', 'register_block_core_comments' );
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Use the button block classes for the form-submit button.
|
|
104
|
+
*
|
|
105
|
+
* @param array $fields The default comment form arguments.
|
|
106
|
+
*
|
|
107
|
+
* @return array Returns the modified fields.
|
|
108
|
+
*/
|
|
109
|
+
function comments_block_form_defaults( $fields ) {
|
|
110
|
+
if ( wp_is_block_theme() ) {
|
|
111
|
+
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link ' . WP_Theme_JSON_Gutenberg::get_element_class_name( 'button' ) . '" value="%4$s" />';
|
|
112
|
+
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return $fields;
|
|
116
|
+
}
|
|
117
|
+
add_filter( 'comment_form_defaults', 'comments_block_form_defaults' );
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Enqueues styles from the legacy `core/post-comments` block. These styles are
|
|
121
|
+
* required only by the block's fallback.
|
|
122
|
+
*
|
|
123
|
+
* @param string $block_name Name of the new block type.
|
|
124
|
+
*/
|
|
125
|
+
function enqueue_legacy_post_comments_block_styles( $block_name ) {
|
|
126
|
+
static $are_styles_enqueued = false;
|
|
127
|
+
|
|
128
|
+
if ( ! $are_styles_enqueued ) {
|
|
129
|
+
$handles = array(
|
|
130
|
+
'wp-block-post-comments',
|
|
131
|
+
'wp-block-buttons',
|
|
132
|
+
'wp-block-button',
|
|
133
|
+
);
|
|
134
|
+
foreach ( $handles as $handle ) {
|
|
135
|
+
wp_enqueue_block_style( $block_name, array( 'handle' => $handle ) );
|
|
136
|
+
}
|
|
137
|
+
$are_styles_enqueued = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Ensures backwards compatibility for any users running the Gutenberg plugin
|
|
143
|
+
* who have used Post Comments before it was merged into Comments Query Loop.
|
|
144
|
+
*
|
|
145
|
+
* The same approach was followed when core/query-loop was renamed to
|
|
146
|
+
* core/post-template.
|
|
147
|
+
*
|
|
148
|
+
* @see https://github.com/WordPress/gutenberg/pull/41807
|
|
149
|
+
* @see https://github.com/WordPress/gutenberg/pull/32514
|
|
150
|
+
*/
|
|
151
|
+
function register_legacy_post_comments_block() {
|
|
152
|
+
$registry = WP_Block_Type_Registry::get_instance();
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
* Remove the old `post-comments` block if it was already registered, as it
|
|
156
|
+
* is about to be replaced by the type defined below.
|
|
157
|
+
*/
|
|
158
|
+
if ( $registry->is_registered( 'core/post-comments' ) ) {
|
|
159
|
+
unregister_block_type( 'core/post-comments' );
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Recreate the legacy block metadata.
|
|
163
|
+
$metadata = array(
|
|
164
|
+
'name' => 'core/post-comments',
|
|
165
|
+
'category' => 'theme',
|
|
166
|
+
'attributes' => array(
|
|
167
|
+
'textAlign' => array(
|
|
168
|
+
'type' => 'string',
|
|
169
|
+
),
|
|
170
|
+
),
|
|
171
|
+
'uses_context' => array(
|
|
172
|
+
'postId',
|
|
173
|
+
'postType',
|
|
174
|
+
),
|
|
175
|
+
'supports' => array(
|
|
176
|
+
'html' => false,
|
|
177
|
+
'align' => array( 'wide', 'full' ),
|
|
178
|
+
'typography' => array(
|
|
179
|
+
'fontSize' => true,
|
|
180
|
+
'lineHeight' => true,
|
|
181
|
+
'__experimentalFontStyle' => true,
|
|
182
|
+
'__experimentalFontWeight' => true,
|
|
183
|
+
'__experimentalLetterSpacing' => true,
|
|
184
|
+
'__experimentalTextTransform' => true,
|
|
185
|
+
'__experimentalDefaultControls' => array(
|
|
186
|
+
'fontSize' => true,
|
|
187
|
+
),
|
|
188
|
+
),
|
|
189
|
+
'color' => array(
|
|
190
|
+
'gradients' => true,
|
|
191
|
+
'link' => true,
|
|
192
|
+
'__experimentalDefaultControls' => array(
|
|
193
|
+
'background' => true,
|
|
194
|
+
'text' => true,
|
|
195
|
+
),
|
|
196
|
+
),
|
|
197
|
+
'inserter' => false,
|
|
198
|
+
),
|
|
199
|
+
'style' => array(
|
|
200
|
+
'wp-block-post-comments',
|
|
201
|
+
'wp-block-buttons',
|
|
202
|
+
'wp-block-button',
|
|
203
|
+
),
|
|
204
|
+
'editorStyle' => 'wp-block-post-comments-editor',
|
|
205
|
+
'render_callback' => 'render_block_core_comments',
|
|
206
|
+
'skip_inner_blocks' => true,
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
/*
|
|
210
|
+
* Filters the metadata object, the same way it's done inside
|
|
211
|
+
* `register_block_type_from_metadata()`. This applies some default filters,
|
|
212
|
+
* like `_wp_multiple_block_styles`, which is required in this case because
|
|
213
|
+
* the block has multiple styles.
|
|
214
|
+
*/
|
|
215
|
+
$metadata = apply_filters( 'block_type_metadata', $metadata );
|
|
216
|
+
|
|
217
|
+
register_block_type( 'core/post-comments', $metadata );
|
|
218
|
+
}
|
|
219
|
+
add_action( 'init', 'register_legacy_post_comments_block', 21 );
|
package/src/comments/save.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';
|
|
5
5
|
|
|
6
|
-
export default function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export default function save( { attributes: { tagName: Tag, legacy } } ) {
|
|
7
|
+
const blockProps = useBlockProps.save();
|
|
8
|
+
const innerBlocksProps = useInnerBlocksProps.save( blockProps );
|
|
9
|
+
|
|
10
|
+
// The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner
|
|
11
|
+
// blocks, so nothing is saved in that case.
|
|
12
|
+
return legacy ? null : <Tag { ...innerBlocksProps } />;
|
|
12
13
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/* Styles for backwards compatibility with the legacy `post-comments` block */
|
|
1
2
|
.wp-block-post-comments {
|
|
3
|
+
|
|
2
4
|
/* utility classes */
|
|
3
5
|
.alignleft {
|
|
4
6
|
float: left;
|
|
@@ -7,6 +9,7 @@
|
|
|
7
9
|
.alignright {
|
|
8
10
|
float: right;
|
|
9
11
|
}
|
|
12
|
+
|
|
10
13
|
/* end utility classes */
|
|
11
14
|
|
|
12
15
|
.navigation {
|
|
@@ -62,9 +65,11 @@
|
|
|
62
65
|
.comment-meta {
|
|
63
66
|
font-size: 0.875em;
|
|
64
67
|
line-height: 1.5;
|
|
68
|
+
|
|
65
69
|
b {
|
|
66
70
|
font-weight: normal;
|
|
67
71
|
}
|
|
72
|
+
|
|
68
73
|
.comment-awaiting-moderation {
|
|
69
74
|
margin-top: 1em;
|
|
70
75
|
margin-bottom: 1em;
|
|
@@ -87,6 +92,7 @@
|
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
.comment-form {
|
|
95
|
+
|
|
90
96
|
textarea,
|
|
91
97
|
input:not([type="submit"]):not([type="checkbox"]) {
|
|
92
98
|
display: block;
|
|
@@ -106,6 +112,7 @@
|
|
|
106
112
|
|
|
107
113
|
.comment-reply-title {
|
|
108
114
|
margin-bottom: 0;
|
|
115
|
+
|
|
109
116
|
:where(small) {
|
|
110
117
|
font-size: var(--wp--preset--font-size--medium, smaller);
|
|
111
118
|
margin-left: 0.5em;
|
|
@@ -128,8 +135,12 @@
|
|
|
128
135
|
input:not([type="submit"]):not([type="checkbox"]) {
|
|
129
136
|
padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
|
|
130
137
|
}
|
|
138
|
+
}
|
|
131
139
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
|
|
141
|
+
// Using :where to give this a low specificity so that element styles take precedence.
|
|
142
|
+
// Needed for backwards compatibility.
|
|
143
|
+
// Styles copied from button block styles.
|
|
144
|
+
:where(.wp-block-post-comments input[type="submit"]) {
|
|
145
|
+
border: none;
|
|
135
146
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/comments-pagination",
|
|
5
5
|
"title": "Comments Pagination",
|
|
6
6
|
"category": "theme",
|
|
7
|
-
"parent": [ "core/comments
|
|
7
|
+
"parent": [ "core/comments" ],
|
|
8
8
|
"description": "Displays a paginated navigation to next/previous set of comments, when applicable.",
|
|
9
9
|
"textdomain": "default",
|
|
10
10
|
"attributes": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/comments-title",
|
|
5
5
|
"title": "Comments Title",
|
|
6
6
|
"category": "theme",
|
|
7
|
-
"ancestor": [ "core/comments
|
|
7
|
+
"ancestor": [ "core/comments" ],
|
|
8
8
|
"description": "Displays a title with the number of comments",
|
|
9
9
|
"textdomain": "default",
|
|
10
10
|
"usesContext": [ "postId", "postType" ],
|
|
@@ -18,13 +18,11 @@ export default [
|
|
|
18
18
|
},
|
|
19
19
|
supports,
|
|
20
20
|
migrate: ( oldAttributes ) => {
|
|
21
|
-
/* eslint-disable no-unused-vars */
|
|
22
21
|
const {
|
|
23
22
|
singleCommentLabel,
|
|
24
23
|
multipleCommentsLabel,
|
|
25
24
|
...newAttributes
|
|
26
25
|
} = oldAttributes;
|
|
27
|
-
/* eslint-enable no-unused-vars */
|
|
28
26
|
return newAttributes;
|
|
29
27
|
},
|
|
30
28
|
isEligible: ( { multipleCommentsLabel, singleCommentLabel } ) =>
|
package/src/common.scss
CHANGED
package/src/cover/block.json
CHANGED
|
@@ -14,22 +14,17 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
|
-
import { ALLOWED_MEDIA_TYPES
|
|
17
|
+
import { ALLOWED_MEDIA_TYPES } from '../shared';
|
|
18
18
|
|
|
19
19
|
export default function CoverBlockControls( {
|
|
20
20
|
attributes,
|
|
21
21
|
setAttributes,
|
|
22
22
|
onSelectMedia,
|
|
23
23
|
currentSettings,
|
|
24
|
+
toggleUseFeaturedImage,
|
|
24
25
|
} ) {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
id,
|
|
28
|
-
useFeaturedImage,
|
|
29
|
-
dimRatio,
|
|
30
|
-
minHeight,
|
|
31
|
-
minHeightUnit,
|
|
32
|
-
} = attributes;
|
|
26
|
+
const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } =
|
|
27
|
+
attributes;
|
|
33
28
|
const { hasInnerBlocks, url } = currentSettings;
|
|
34
29
|
|
|
35
30
|
const [ prevMinHeightValue, setPrevMinHeightValue ] = useState( minHeight );
|
|
@@ -63,17 +58,6 @@ export default function CoverBlockControls( {
|
|
|
63
58
|
} );
|
|
64
59
|
};
|
|
65
60
|
|
|
66
|
-
const toggleUseFeaturedImage = () => {
|
|
67
|
-
setAttributes( {
|
|
68
|
-
id: undefined,
|
|
69
|
-
url: undefined,
|
|
70
|
-
useFeaturedImage: ! useFeaturedImage,
|
|
71
|
-
dimRatio: dimRatio === 100 ? 50 : dimRatio,
|
|
72
|
-
backgroundType: useFeaturedImage
|
|
73
|
-
? IMAGE_BACKGROUND_TYPE
|
|
74
|
-
: undefined,
|
|
75
|
-
} );
|
|
76
|
-
};
|
|
77
61
|
return (
|
|
78
62
|
<>
|
|
79
63
|
<BlockControls group="block">
|
|
@@ -16,6 +16,7 @@ export default function CoverPlaceholder( {
|
|
|
16
16
|
onSelectMedia,
|
|
17
17
|
onError,
|
|
18
18
|
style,
|
|
19
|
+
toggleUseFeaturedImage,
|
|
19
20
|
} ) {
|
|
20
21
|
return (
|
|
21
22
|
<MediaPlaceholder
|
|
@@ -30,6 +31,7 @@ export default function CoverPlaceholder( {
|
|
|
30
31
|
accept="image/*,video/*"
|
|
31
32
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
32
33
|
disableMediaButtons={ disableMediaButtons }
|
|
34
|
+
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
33
35
|
onError={ onError }
|
|
34
36
|
style={ style }
|
|
35
37
|
>
|
package/src/cover/edit/index.js
CHANGED
|
@@ -211,12 +211,25 @@ function CoverEdit( {
|
|
|
211
211
|
overlayColor,
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
+
const toggleUseFeaturedImage = () => {
|
|
215
|
+
setAttributes( {
|
|
216
|
+
id: undefined,
|
|
217
|
+
url: undefined,
|
|
218
|
+
useFeaturedImage: ! useFeaturedImage,
|
|
219
|
+
dimRatio: dimRatio === 100 ? 50 : dimRatio,
|
|
220
|
+
backgroundType: useFeaturedImage
|
|
221
|
+
? IMAGE_BACKGROUND_TYPE
|
|
222
|
+
: undefined,
|
|
223
|
+
} );
|
|
224
|
+
};
|
|
225
|
+
|
|
214
226
|
const blockControls = (
|
|
215
227
|
<CoverBlockControls
|
|
216
228
|
attributes={ attributes }
|
|
217
229
|
setAttributes={ setAttributes }
|
|
218
230
|
onSelectMedia={ onSelectMedia }
|
|
219
231
|
currentSettings={ currentSettings }
|
|
232
|
+
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
220
233
|
/>
|
|
221
234
|
);
|
|
222
235
|
|
|
@@ -228,6 +241,7 @@ function CoverEdit( {
|
|
|
228
241
|
setOverlayColor={ setOverlayColor }
|
|
229
242
|
coverRef={ ref }
|
|
230
243
|
currentSettings={ currentSettings }
|
|
244
|
+
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
231
245
|
/>
|
|
232
246
|
);
|
|
233
247
|
|
|
@@ -249,6 +263,7 @@ function CoverEdit( {
|
|
|
249
263
|
style={ {
|
|
250
264
|
minHeight: minHeightWithUnit || undefined,
|
|
251
265
|
} }
|
|
266
|
+
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
252
267
|
>
|
|
253
268
|
<div className="wp-block-cover__placeholder-background-options">
|
|
254
269
|
<ColorPalette
|
|
@@ -384,6 +399,7 @@ function CoverEdit( {
|
|
|
384
399
|
disableMediaButtons
|
|
385
400
|
onSelectMedia={ onSelectMedia }
|
|
386
401
|
onError={ onUploadError }
|
|
402
|
+
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
387
403
|
/>
|
|
388
404
|
<div { ...innerBlocksProps } />
|
|
389
405
|
</div>
|