@wordpress/block-library 6.0.12 → 6.0.17-next.33ec3857e2.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 +4 -0
- package/build/archives/index.js +1 -0
- package/build/archives/index.js.map +1 -1
- package/build/audio/index.js +1 -0
- package/build/audio/index.js.map +1 -1
- package/build/block/index.js +1 -0
- package/build/block/index.js.map +1 -1
- package/build/button/edit.native.js +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +5 -1
- package/build/button/index.js.map +1 -1
- package/build/buttons/index.js +1 -0
- package/build/buttons/index.js.map +1 -1
- package/build/buttons/transforms.js +1 -0
- package/build/buttons/transforms.js.map +1 -1
- package/build/calendar/index.js +1 -0
- package/build/calendar/index.js.map +1 -1
- package/build/categories/index.js +1 -0
- package/build/categories/index.js.map +1 -1
- package/build/code/index.js +6 -1
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/index.js +1 -0
- package/build/columns/index.js.map +1 -1
- package/build/comment-author-avatar/edit.js +2 -1
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-avatar/index.js +7 -2
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/index.js +1 -0
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +1 -0
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +1 -0
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +2 -1
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +1 -0
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/edit.js +98 -23
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/index.js +4 -2
- package/build/comment-template/index.js.map +1 -1
- package/build/comment-template/util.js +66 -0
- package/build/comment-template/util.js.map +1 -0
- package/build/comments-pagination/comments-pagination-arrow-controls.js +39 -0
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -0
- package/build/comments-pagination/edit.js +80 -0
- package/build/comments-pagination/edit.js.map +1 -0
- package/build/comments-pagination/index.js +71 -0
- package/build/comments-pagination/index.js.map +1 -0
- package/build/comments-pagination/save.js +18 -0
- package/build/comments-pagination/save.js.map +1 -0
- package/build/comments-pagination-numbers/edit.js +47 -0
- package/build/comments-pagination-numbers/edit.js.map +1 -0
- package/build/comments-pagination-numbers/index.js +47 -0
- package/build/comments-pagination-numbers/index.js.map +1 -0
- package/build/comments-query-loop/edit.js +2 -2
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-query-loop/index.js +4 -7
- package/build/comments-query-loop/index.js.map +1 -1
- package/build/comments-query-loop/toolbar.js +3 -3
- package/build/comments-query-loop/toolbar.js.map +1 -1
- package/build/cover/edit.js +2 -1
- package/build/cover/edit.js.map +1 -1
- package/build/cover/index.js +1 -0
- package/build/cover/index.js.map +1 -1
- package/build/embed/deprecated.js +1 -0
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.native.js +23 -20
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-controls.native.js +69 -0
- package/build/embed/embed-controls.native.js.map +1 -0
- package/build/embed/embed-link-settings.native.js +101 -0
- package/build/embed/embed-link-settings.native.js.map +1 -0
- package/build/embed/embed-placeholder.native.js +9 -2
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/index.js +1 -0
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +1 -0
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +1 -0
- package/build/embed/util.js.map +1 -1
- package/build/file/index.js +1 -0
- package/build/file/index.js.map +1 -1
- package/build/freeform/index.js +1 -0
- package/build/freeform/index.js.map +1 -1
- package/build/gallery/edit.js +5 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +1 -0
- package/build/gallery/index.js.map +1 -1
- package/build/group/index.js +8 -1
- package/build/group/index.js.map +1 -1
- package/build/heading/index.js +1 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +1 -0
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/index.js +1 -0
- package/build/home-link/index.js.map +1 -1
- package/build/html/index.js +1 -0
- package/build/html/index.js.map +1 -1
- package/build/image/edit.js +56 -5
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +45 -10
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +5 -1
- package/build/image/index.js.map +1 -1
- package/build/index.js +5 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/index.js +1 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +1 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +1 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/index.js +1 -0
- package/build/list/index.js.map +1 -1
- package/build/loginout/index.js +1 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/index.js +1 -0
- package/build/media-text/index.js.map +1 -1
- package/build/missing/index.js +1 -0
- package/build/missing/index.js.map +1 -1
- package/build/more/index.js +1 -0
- package/build/more/index.js.map +1 -1
- package/build/navigation/edit/index.js +27 -8
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +7 -1
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/index.js +1 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +8 -2
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/view.js +2 -2
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-area/edit.js +2 -1
- package/build/navigation-area/edit.js.map +1 -1
- package/build/navigation-area/index.js +2 -1
- package/build/navigation-area/index.js.map +1 -1
- package/build/navigation-link/edit.js +7 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +1 -0
- 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/index.js +1 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/nextpage/index.js +1 -0
- package/build/nextpage/index.js.map +1 -1
- package/build/page-list/index.js +6 -1
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +12 -2
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +1 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +1 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/pattern/index.js +1 -0
- package/build/pattern/index.js.map +1 -1
- package/build/post-author/index.js +1 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-comment/index.js +1 -0
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/index.js +2 -1
- 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/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/index.js +1 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/index.js +1 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/index.js +1 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +50 -30
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +7 -3
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +1 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +54 -13
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -0
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/index.js +1 -0
- 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/preformatted/edit.native.js +2 -1
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/preformatted/index.js +1 -0
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/index.js +8 -1
- package/build/pullquote/index.js.map +1 -1
- package/build/query/index.js +1 -0
- package/build/query/index.js.map +1 -1
- package/build/query-pagination/index.js +1 -0
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination-next/index.js +1 -0
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +1 -0
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +1 -0
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/index.js +1 -0
- package/build/query-title/index.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/rss/index.js +1 -0
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +5 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +8 -1
- package/build/search/index.js.map +1 -1
- package/build/separator/index.js +1 -0
- package/build/separator/index.js.map +1 -1
- package/build/shortcode/index.js +1 -0
- package/build/shortcode/index.js.map +1 -1
- package/build/site-logo/index.js +1 -0
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/index.js +2 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/index.js +2 -1
- package/build/social-link/index.js.map +1 -1
- package/build/social-links/index.js +2 -1
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/index.js +1 -0
- package/build/spacer/index.js.map +1 -1
- package/build/table/index.js +7 -1
- package/build/table/index.js.map +1 -1
- package/build/table-of-contents/index.js +1 -0
- package/build/table-of-contents/index.js.map +1 -1
- package/build/tag-cloud/index.js +1 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/index.js +7 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/index.js +26 -9
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +1 -0
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/index.js +1 -0
- package/build/text-columns/index.js.map +1 -1
- package/build/verse/index.js +1 -0
- package/build/verse/index.js.map +1 -1
- package/build/video/index.js +1 -0
- package/build/video/index.js.map +1 -1
- package/build-module/archives/index.js +1 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/index.js +1 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/block/index.js +1 -0
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/edit.native.js +1 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +5 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/buttons/index.js +1 -0
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/buttons/transforms.js +1 -0
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/calendar/index.js +1 -0
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/categories/index.js +1 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/index.js +6 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/index.js +1 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +3 -2
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +7 -2
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +1 -0
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +1 -0
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +1 -0
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +2 -1
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +1 -0
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/edit.js +97 -23
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/index.js +4 -2
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comment-template/util.js +57 -0
- package/build-module/comment-template/util.js.map +1 -0
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +30 -0
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -0
- package/build-module/comments-pagination/edit.js +67 -0
- package/build-module/comments-pagination/edit.js.map +1 -0
- package/build-module/comments-pagination/index.js +57 -0
- package/build-module/comments-pagination/index.js.map +1 -0
- package/build-module/comments-pagination/save.js +10 -0
- package/build-module/comments-pagination/save.js.map +1 -0
- package/build-module/comments-pagination-numbers/edit.js +40 -0
- package/build-module/comments-pagination-numbers/edit.js.map +1 -0
- package/build-module/comments-pagination-numbers/index.js +34 -0
- package/build-module/comments-pagination-numbers/index.js.map +1 -0
- package/build-module/comments-query-loop/edit.js +2 -2
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-query-loop/index.js +4 -7
- package/build-module/comments-query-loop/index.js.map +1 -1
- package/build-module/comments-query-loop/toolbar.js +3 -3
- package/build-module/comments-query-loop/toolbar.js.map +1 -1
- package/build-module/cover/edit.js +2 -1
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/index.js +1 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/embed/deprecated.js +1 -0
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.native.js +24 -21
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.native.js +54 -0
- package/build-module/embed/embed-controls.native.js.map +1 -0
- package/build-module/embed/embed-link-settings.native.js +90 -0
- package/build-module/embed/embed-link-settings.native.js.map +1 -0
- package/build-module/embed/embed-placeholder.native.js +9 -2
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/index.js +1 -0
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +1 -0
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +1 -0
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/index.js +1 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/freeform/index.js +1 -0
- package/build-module/freeform/index.js.map +1 -1
- package/build-module/gallery/edit.js +5 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +1 -0
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/index.js +8 -1
- package/build-module/group/index.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 +1 -0
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/index.js +1 -0
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/html/index.js +1 -0
- package/build-module/html/index.js.map +1 -1
- package/build-module/image/edit.js +52 -4
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +47 -12
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +5 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +3 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/index.js +1 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +1 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +1 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/index.js +1 -0
- package/build-module/list/index.js.map +1 -1
- package/build-module/loginout/index.js +1 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/index.js +1 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/missing/index.js +1 -0
- package/build-module/missing/index.js.map +1 -1
- package/build-module/more/index.js +1 -0
- package/build-module/more/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +26 -8
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +6 -1
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/index.js +1 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +7 -2
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/view.js +2 -2
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-area/edit.js +2 -1
- package/build-module/navigation-area/edit.js.map +1 -1
- package/build-module/navigation-area/index.js +2 -1
- package/build-module/navigation-area/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +7 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +1 -0
- 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/index.js +1 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/nextpage/index.js +1 -0
- package/build-module/nextpage/index.js.map +1 -1
- package/build-module/page-list/index.js +6 -1
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +13 -3
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +1 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +1 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/pattern/index.js +1 -0
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/post-author/index.js +1 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-comment/index.js +1 -0
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comments/index.js +2 -1
- 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/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/index.js +1 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/index.js +1 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/index.js +1 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +52 -29
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +8 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +1 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +54 -15
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -0
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/index.js +1 -0
- 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/preformatted/edit.native.js +2 -1
- package/build-module/preformatted/edit.native.js.map +1 -1
- package/build-module/preformatted/index.js +1 -0
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/index.js +8 -1
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/query/index.js +1 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/query-pagination/index.js +1 -0
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination-next/index.js +1 -0
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -0
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +1 -0
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/index.js +1 -0
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/rss/index.js +1 -0
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +5 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +8 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/separator/index.js +1 -0
- package/build-module/separator/index.js.map +1 -1
- package/build-module/shortcode/index.js +1 -0
- package/build-module/shortcode/index.js.map +1 -1
- package/build-module/site-logo/index.js +1 -0
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/index.js +2 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/index.js +2 -1
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/social-links/index.js +2 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/index.js +1 -0
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/table/index.js +7 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table-of-contents/index.js +1 -0
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/tag-cloud/index.js +1 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/index.js +6 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/index.js +26 -9
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +1 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/index.js +1 -0
- package/build-module/text-columns/index.js.map +1 -1
- package/build-module/verse/index.js +1 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/index.js +1 -0
- package/build-module/video/index.js.map +1 -1
- package/build-style/columns/style-rtl.css +4 -3
- package/build-style/columns/style.css +4 -3
- package/build-style/comment-template/style-rtl.css +91 -0
- package/build-style/comment-template/style.css +91 -0
- package/build-style/{home-link/style.css → comments-pagination/editor-rtl.css} +18 -22
- package/build-style/comments-pagination/editor.css +102 -0
- package/build-style/{home-link → comments-pagination}/style-rtl.css +21 -21
- package/build-style/comments-pagination/style.css +106 -0
- package/build-style/comments-pagination-numbers/editor-rtl.css +85 -0
- package/build-style/comments-pagination-numbers/editor.css +86 -0
- package/build-style/common-rtl.css +29 -0
- package/build-style/common.css +29 -0
- package/build-style/cover/style-rtl.css +4 -0
- package/build-style/cover/style.css +4 -0
- package/build-style/editor-rtl.css +70 -23
- package/build-style/editor.css +73 -23
- package/build-style/gallery/editor-rtl.css +0 -12
- package/build-style/gallery/editor.css +0 -12
- package/build-style/gallery/style-rtl.css +3 -0
- package/build-style/gallery/style.css +3 -0
- package/build-style/group/theme-rtl.css +1 -1
- package/build-style/group/theme.css +1 -1
- package/build-style/image/editor-rtl.css +16 -0
- package/build-style/image/editor.css +16 -0
- package/build-style/navigation/editor-rtl.css +9 -0
- package/build-style/navigation/editor.css +9 -0
- package/build-style/navigation/style-rtl.css +13 -7
- package/build-style/navigation/style.css +13 -7
- package/build-style/post-comments/style-rtl.css +3 -1
- package/build-style/post-comments/style.css +3 -1
- package/build-style/post-comments-form/style-rtl.css +2 -2
- package/build-style/post-comments-form/style.css +2 -2
- package/build-style/post-featured-image/editor-rtl.css +0 -7
- package/build-style/post-featured-image/editor.css +0 -7
- package/build-style/post-featured-image/style-rtl.css +1 -1
- package/build-style/post-featured-image/style.css +1 -1
- package/build-style/post-title/style-rtl.css +3 -0
- package/build-style/post-title/style.css +3 -0
- package/build-style/pullquote/style-rtl.css +1 -0
- package/build-style/pullquote/style.css +1 -0
- package/build-style/query-pagination/editor-rtl.css +0 -4
- package/build-style/query-pagination/editor.css +0 -4
- package/build-style/query-pagination/style-rtl.css +6 -2
- package/build-style/query-pagination/style.css +6 -2
- package/build-style/style-rtl.css +131 -61
- package/build-style/style.css +133 -61
- package/build-style/table/style-rtl.css +1 -0
- package/build-style/table/style.css +1 -0
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/package.json +31 -31
- package/src/archives/block.json +1 -0
- package/src/audio/block.json +1 -0
- package/src/block/block.json +1 -0
- package/src/button/block.json +5 -1
- package/src/button/edit.native.js +1 -1
- package/src/buttons/block.json +2 -1
- package/src/calendar/block.json +1 -0
- package/src/calendar/index.php +35 -39
- package/src/categories/block.json +1 -0
- package/src/code/block.json +6 -1
- package/src/column/block.json +1 -0
- package/src/columns/block.json +1 -0
- package/src/columns/style.scss +8 -5
- package/src/comment-author-avatar/block.json +7 -2
- package/src/comment-author-avatar/edit.js +7 -2
- package/src/comment-author-avatar/index.php +25 -6
- package/src/comment-author-name/block.json +1 -0
- package/src/comment-content/block.json +1 -0
- package/src/comment-date/block.json +1 -0
- package/src/comment-edit-link/block.json +1 -0
- package/src/comment-edit-link/index.js +1 -1
- package/src/comment-reply-link/block.json +1 -0
- package/src/comment-template/block.json +4 -2
- package/src/comment-template/edit.js +111 -37
- package/src/comment-template/index.php +46 -19
- package/src/comment-template/style.scss +17 -0
- package/src/comment-template/test/index.js +45 -0
- package/src/comment-template/util.js +56 -0
- package/src/comments-pagination/block.json +37 -0
- package/src/comments-pagination/comments-pagination-arrow-controls.js +44 -0
- package/src/comments-pagination/edit.js +78 -0
- package/src/comments-pagination/editor.scss +34 -0
- package/src/comments-pagination/index.js +20 -0
- package/src/comments-pagination/index.php +39 -0
- package/src/comments-pagination/save.js +8 -0
- package/src/comments-pagination/style.scss +38 -0
- package/src/comments-pagination-numbers/block.json +16 -0
- package/src/comments-pagination-numbers/edit.js +22 -0
- package/src/comments-pagination-numbers/editor.scss +12 -0
- package/src/comments-pagination-numbers/index.js +18 -0
- package/src/comments-pagination-numbers/index.php +69 -0
- package/src/comments-query-loop/block.json +4 -7
- package/src/comments-query-loop/edit.js +2 -5
- package/src/comments-query-loop/toolbar.js +3 -3
- package/src/common.scss +31 -0
- package/src/cover/block.json +1 -0
- package/src/cover/edit.js +1 -0
- package/src/cover/style.scss +4 -0
- package/src/editor.scss +14 -0
- package/src/embed/block.json +1 -0
- package/src/embed/edit.native.js +23 -18
- package/src/embed/embed-controls.native.js +65 -0
- package/src/embed/embed-link-settings.native.js +100 -0
- package/src/embed/embed-placeholder.native.js +8 -0
- package/src/embed/test/__snapshots__/index.native.js.snap +10 -0
- package/src/embed/test/index.native.js +228 -88
- package/src/file/block.json +1 -0
- package/src/freeform/block.json +1 -0
- package/src/gallery/block.json +1 -0
- package/src/gallery/edit.js +13 -0
- package/src/gallery/editor.scss +0 -14
- package/src/gallery/index.php +7 -8
- package/src/gallery/style.scss +4 -0
- package/src/gallery/test/use-get-new-images.js +93 -0
- package/src/group/block.json +8 -1
- package/src/group/theme.scss +4 -5
- package/src/heading/block.json +1 -0
- package/src/home-link/block.json +1 -0
- package/src/home-link/index.php +4 -4
- package/src/html/block.json +1 -0
- package/src/image/block.json +5 -1
- package/src/image/edit.js +44 -0
- package/src/image/edit.native.js +1 -1
- package/src/image/editor.scss +18 -0
- package/src/image/image.js +46 -11
- package/src/image/index.php +1 -1
- package/src/index.js +4 -0
- package/src/latest-comments/block.json +1 -0
- package/src/latest-posts/block.json +1 -0
- package/src/list/block.json +1 -0
- package/src/loginout/block.json +1 -0
- package/src/media-text/block.json +1 -0
- package/src/missing/block.json +1 -0
- package/src/more/block.json +1 -0
- package/src/navigation/README.md +13 -0
- package/src/navigation/block.json +4 -16
- package/src/navigation/edit/index.js +51 -28
- package/src/navigation/edit/navigation-menu-selector.js +8 -0
- package/src/navigation/editor.scss +12 -0
- package/src/navigation/index.php +4 -4
- package/src/navigation/menu-items-to-blocks.js +9 -2
- package/src/navigation/style.scss +26 -14
- package/src/navigation/view.js +2 -2
- package/src/navigation-area/block.json +3 -7
- package/src/navigation-area/edit.js +2 -1
- package/src/navigation-link/block.json +2 -3
- package/src/navigation-link/edit.js +5 -0
- package/src/navigation-link/index.php +4 -4
- package/src/navigation-submenu/block.json +2 -3
- package/src/navigation-submenu/edit.js +1 -1
- package/src/navigation-submenu/index.php +12 -6
- package/src/nextpage/block.json +1 -0
- package/src/page-list/block.json +4 -0
- package/src/page-list/index.php +12 -7
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/edit.js +12 -4
- package/src/pattern/block.json +1 -0
- package/src/post-author/block.json +1 -0
- package/src/post-comment/block.json +1 -0
- package/src/post-comments/block.json +6 -1
- package/src/post-comments/index.php +17 -0
- package/src/post-comments/style.scss +7 -3
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/block.json +6 -1
- package/src/post-comments-form/index.php +6 -4
- package/src/post-comments-form/style.scss +7 -5
- package/src/post-comments-link/block.json +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-date/block.json +1 -0
- package/src/post-excerpt/block.json +1 -0
- package/src/post-featured-image/block.json +1 -0
- package/src/post-featured-image/dimension-controls.js +75 -50
- package/src/post-featured-image/edit.js +12 -5
- package/src/post-featured-image/editor.scss +0 -8
- package/src/post-featured-image/style.scss +1 -1
- package/src/post-navigation-link/block.json +1 -0
- package/src/post-template/block.json +1 -0
- package/src/post-template/edit.js +54 -17
- package/src/post-terms/block.json +1 -0
- package/src/post-title/block.json +1 -0
- package/src/post-title/style.scss +6 -2
- package/src/preformatted/block.json +1 -0
- package/src/preformatted/edit.native.js +3 -1
- package/src/pullquote/block.json +8 -1
- package/src/pullquote/style.scss +1 -0
- package/src/query/block.json +1 -0
- package/src/query-pagination/block.json +1 -0
- package/src/query-pagination/editor.scss +0 -4
- package/src/query-pagination/style.scss +12 -2
- package/src/query-pagination-next/block.json +1 -0
- package/src/query-pagination-next/index.php +42 -19
- package/src/query-pagination-numbers/block.json +1 -0
- package/src/query-pagination-previous/block.json +1 -0
- package/src/query-pagination-previous/index.php +45 -13
- package/src/query-title/block.json +1 -0
- package/src/quote/block.json +1 -0
- package/src/rss/block.json +1 -0
- package/src/search/block.json +8 -1
- package/src/search/edit.js +2 -1
- package/src/search/index.php +20 -10
- package/src/separator/block.json +1 -0
- package/src/shortcode/block.json +1 -0
- package/src/site-logo/block.json +1 -0
- package/src/site-tagline/block.json +2 -1
- package/src/site-title/block.json +1 -0
- package/src/social-link/block.json +2 -1
- package/src/social-links/block.json +3 -8
- package/src/spacer/block.json +1 -0
- package/src/style.scss +3 -2
- package/src/table/block.json +7 -1
- package/src/table/style.scss +1 -0
- package/src/table-of-contents/block.json +1 -0
- package/src/tag-cloud/block.json +1 -0
- package/src/template-part/block.json +1 -8
- package/src/template-part/edit/index.js +6 -1
- package/src/template-part/index.js +28 -0
- package/src/template-part/index.php +5 -2
- package/src/term-description/block.json +1 -0
- package/src/text-columns/block.json +1 -0
- package/src/verse/block.json +1 -0
- package/src/video/block.json +1 -0
- package/build/embed/embed-bottom-sheet.native.js +0 -85
- package/build/embed/embed-bottom-sheet.native.js.map +0 -1
- package/build-module/embed/embed-bottom-sheet.native.js +0 -74
- package/build-module/embed/embed-bottom-sheet.native.js.map +0 -1
- package/src/embed/embed-bottom-sheet.native.js +0 -78
- package/src/home-link/style.scss +0 -51
package/src/columns/style.scss
CHANGED
|
@@ -10,10 +10,6 @@
|
|
|
10
10
|
flex-wrap: nowrap;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
&:where(.has-background) {
|
|
14
|
-
padding: $block-bg-padding--v $block-bg-padding--h;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
13
|
/**
|
|
18
14
|
* All Columns Alignment
|
|
19
15
|
*/
|
|
@@ -85,8 +81,8 @@
|
|
|
85
81
|
> .wp-block-column {
|
|
86
82
|
// Available space should be divided equally amongst columns.
|
|
87
83
|
flex-basis: 0;
|
|
88
|
-
flex-grow: 1;
|
|
89
84
|
|
|
85
|
+
flex-grow: 1;
|
|
90
86
|
// Columns with an explicitly-assigned width should maintain their
|
|
91
87
|
// `flex-basis` width and not grow.
|
|
92
88
|
&[style*="flex-basis"] {
|
|
@@ -101,6 +97,13 @@
|
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
99
|
|
|
100
|
+
// Add low specificity default padding to columns blocks with backgrounds.
|
|
101
|
+
:where(.wp-block-columns.has-background) {
|
|
102
|
+
// Matches paragraph block padding.
|
|
103
|
+
padding: $block-bg-padding--v $block-bg-padding--h;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
104
107
|
.wp-block-column {
|
|
105
108
|
flex-grow: 1;
|
|
106
109
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
2
3
|
"apiVersion": 2,
|
|
3
4
|
"name": "core/comment-author-avatar",
|
|
4
5
|
"title": "Comment Author Avatar",
|
|
@@ -27,8 +28,12 @@
|
|
|
27
28
|
},
|
|
28
29
|
"color": {
|
|
29
30
|
"background": true,
|
|
30
|
-
"text": false
|
|
31
|
-
|
|
31
|
+
"text": false
|
|
32
|
+
},
|
|
33
|
+
"spacing": {
|
|
34
|
+
"__experimentalSkipSerialization": true,
|
|
35
|
+
"margin": true,
|
|
36
|
+
"padding": true
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
InspectorControls,
|
|
6
|
+
useBlockProps,
|
|
7
|
+
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
|
|
8
|
+
} from '@wordpress/block-editor';
|
|
5
9
|
import { PanelBody, ResizableBox, RangeControl } from '@wordpress/components';
|
|
6
10
|
import { useEntityProp } from '@wordpress/core-data';
|
|
7
11
|
import { __, _x, isRTL } from '@wordpress/i18n';
|
|
@@ -31,6 +35,7 @@ export default function Edit( {
|
|
|
31
35
|
const minSize = sizes ? sizes[ 0 ] : 24;
|
|
32
36
|
const maxSize = sizes ? sizes[ sizes.length - 1 ] : 96;
|
|
33
37
|
const blockProps = useBlockProps();
|
|
38
|
+
const spacingProps = useSpacingProps( attributes );
|
|
34
39
|
const maxSizeBuffer = Math.floor( maxSize * 2.5 );
|
|
35
40
|
|
|
36
41
|
const inspectorControls = (
|
|
@@ -90,7 +95,7 @@ export default function Edit( {
|
|
|
90
95
|
return (
|
|
91
96
|
<>
|
|
92
97
|
{ inspectorControls }
|
|
93
|
-
<div>{ displayAvatar }</div>
|
|
98
|
+
<div { ...spacingProps }>{ displayAvatar }</div>
|
|
94
99
|
</>
|
|
95
100
|
);
|
|
96
101
|
}
|
|
@@ -25,15 +25,31 @@ function render_block_core_comment_author_avatar( $attributes, $content, $block
|
|
|
25
25
|
|
|
26
26
|
// This is the only way to retreive style and classes on different instances.
|
|
27
27
|
$wrapper_attributes = WP_Block_Supports::get_instance()->apply_block_supports();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* We get the spacing attributes and transform the array provided into a string formatted for being applied as a style html tag.
|
|
31
|
+
* Good candidate to be moved to a separate function in core.
|
|
32
|
+
*/
|
|
33
|
+
$spacing_attributes = isset( $attributes['style']['spacing'] ) ? $attributes['style']['spacing'] : null;
|
|
34
|
+
if ( isset( $spacing_attributes ) && ! empty( $spacing_attributes ) ) {
|
|
35
|
+
$spacing_array = array();
|
|
36
|
+
foreach ( $spacing_attributes as $spacing_attribute_key => $spacing_attribute_value ) {
|
|
37
|
+
foreach ( $spacing_attribute_value as $position_key => $position_value ) {
|
|
38
|
+
$spacing_array[] = $spacing_attribute_key . '-' . $position_key . ': ' . $position_value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
$spacing_string = implode( ';', $spacing_array );
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
$width = isset( $attributes['width'] ) ? $attributes['width'] : 96;
|
|
45
|
+
$height = isset( $attributes['height'] ) ? $attributes['height'] : 96;
|
|
46
|
+
$styles = isset( $wrapper_attributes['style'] ) ? $wrapper_attributes['style'] : '';
|
|
47
|
+
$classes = isset( $wrapper_attributes['class'] ) ? $wrapper_attributes['class'] : '';
|
|
32
48
|
|
|
33
49
|
/* translators: %s is the Comment Author name */
|
|
34
50
|
$alt = sprintf( __( '%s Avatar' ), $comment->comment_author );
|
|
35
51
|
|
|
36
|
-
$
|
|
52
|
+
$avatar_block = get_avatar(
|
|
37
53
|
$comment,
|
|
38
54
|
null,
|
|
39
55
|
'',
|
|
@@ -45,7 +61,10 @@ function render_block_core_comment_author_avatar( $attributes, $content, $block
|
|
|
45
61
|
'class' => $classes,
|
|
46
62
|
)
|
|
47
63
|
);
|
|
48
|
-
|
|
64
|
+
if ( isset( $spacing_attributes ) ) {
|
|
65
|
+
return sprintf( '<div style="%1s">%2s</div>', esc_attr( $spacing_string ), $avatar_block );
|
|
66
|
+
}
|
|
67
|
+
return sprintf( '<div>%1s</div>', $avatar_block );
|
|
49
68
|
}
|
|
50
69
|
|
|
51
70
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
2
3
|
"apiVersion": 2,
|
|
3
4
|
"name": "core/comment-template",
|
|
4
5
|
"title": "Comment Template",
|
|
@@ -6,10 +7,11 @@
|
|
|
6
7
|
"parent": [ "core/comments-query-loop" ],
|
|
7
8
|
"description": "Contains the block elements used to render a comment, like the title, date, author, avatar and more.",
|
|
8
9
|
"textdomain": "default",
|
|
9
|
-
"usesContext": [ "
|
|
10
|
+
"usesContext": [ "comments/perPage", "postId" ],
|
|
10
11
|
"supports": {
|
|
11
12
|
"reusable": false,
|
|
12
13
|
"html": false,
|
|
13
14
|
"align": true
|
|
14
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"style": "wp-block-comment-template"
|
|
15
17
|
}
|
|
@@ -14,6 +14,11 @@ import {
|
|
|
14
14
|
import { Spinner } from '@wordpress/components';
|
|
15
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
import { convertToTree } from './util';
|
|
21
|
+
|
|
17
22
|
const TEMPLATE = [
|
|
18
23
|
[ 'core/comment-author-avatar' ],
|
|
19
24
|
[ 'core/comment-author-name' ],
|
|
@@ -23,43 +28,129 @@ const TEMPLATE = [
|
|
|
23
28
|
[ 'core/comment-edit-link' ],
|
|
24
29
|
];
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Component which renders the inner blocks of the Comment Template.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} props Component props.
|
|
35
|
+
* @param {Array} [props.comment] - A comment object.
|
|
36
|
+
* @param {Array} [props.activeComment] - The block that is currently active.
|
|
37
|
+
* @param {Array} [props.setActiveComment] - The setter for activeComment.
|
|
38
|
+
* @param {Array} [props.firstBlock] - First comment in the array.
|
|
39
|
+
* @param {Array} [props.blocks] - Array of blocks returned from
|
|
40
|
+
* getBlocks() in parent .
|
|
41
|
+
* @return {WPElement} Inner blocks of the Comment Template
|
|
42
|
+
*/
|
|
43
|
+
function CommentTemplateInnerBlocks( {
|
|
44
|
+
comment,
|
|
45
|
+
activeComment,
|
|
46
|
+
setActiveComment,
|
|
47
|
+
firstBlock,
|
|
48
|
+
blocks,
|
|
49
|
+
} ) {
|
|
50
|
+
const { children, ...innerBlocksProps } = useInnerBlocksProps(
|
|
51
|
+
{},
|
|
52
|
+
{ template: TEMPLATE }
|
|
53
|
+
);
|
|
54
|
+
return (
|
|
55
|
+
<li { ...innerBlocksProps }>
|
|
56
|
+
{ comment === ( activeComment || firstBlock ) ? (
|
|
57
|
+
children
|
|
58
|
+
) : (
|
|
59
|
+
<BlockPreview
|
|
60
|
+
blocks={ blocks }
|
|
61
|
+
__experimentalLive
|
|
62
|
+
__experimentalOnClick={ () => setActiveComment( comment ) }
|
|
63
|
+
/>
|
|
64
|
+
) }
|
|
65
|
+
{ comment?.children?.length > 0 ? (
|
|
66
|
+
<CommentsList
|
|
67
|
+
comments={ comment.children }
|
|
68
|
+
activeComment={ activeComment }
|
|
69
|
+
setActiveComment={ setActiveComment }
|
|
70
|
+
blocks={ blocks }
|
|
71
|
+
/>
|
|
72
|
+
) : null }
|
|
73
|
+
</li>
|
|
74
|
+
);
|
|
29
75
|
}
|
|
30
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Component that renders a list of (nested) comments. It is called recursively.
|
|
79
|
+
*
|
|
80
|
+
* @param {Object} props Component props.
|
|
81
|
+
* @param {Array} [props.comments] - Array of comment objects.
|
|
82
|
+
* @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.
|
|
83
|
+
* @param {Array} [props.activeComment] - The block that is currently active.
|
|
84
|
+
* @param {Array} [props.setActiveComment] - The setter for activeComment.
|
|
85
|
+
* @param {Array} [props.blocks] - Array of blocks returned from
|
|
86
|
+
* getBlocks() in parent .
|
|
87
|
+
* @return {WPElement} List of comments.
|
|
88
|
+
*/
|
|
89
|
+
const CommentsList = ( {
|
|
90
|
+
comments,
|
|
91
|
+
blockProps,
|
|
92
|
+
activeComment,
|
|
93
|
+
setActiveComment,
|
|
94
|
+
blocks,
|
|
95
|
+
} ) => (
|
|
96
|
+
<ol { ...blockProps }>
|
|
97
|
+
{ comments &&
|
|
98
|
+
comments.map( ( comment ) => (
|
|
99
|
+
<BlockContextProvider
|
|
100
|
+
key={ comment.commentId }
|
|
101
|
+
value={ comment }
|
|
102
|
+
>
|
|
103
|
+
<CommentTemplateInnerBlocks
|
|
104
|
+
comment={ comment }
|
|
105
|
+
activeComment={ activeComment }
|
|
106
|
+
setActiveComment={ setActiveComment }
|
|
107
|
+
blocks={ blocks }
|
|
108
|
+
firstBlock={ comments[ 0 ] }
|
|
109
|
+
/>
|
|
110
|
+
</BlockContextProvider>
|
|
111
|
+
) ) }
|
|
112
|
+
</ol>
|
|
113
|
+
);
|
|
114
|
+
|
|
31
115
|
export default function CommentTemplateEdit( {
|
|
32
116
|
clientId,
|
|
33
|
-
context: { postId,
|
|
117
|
+
context: { postId, 'comments/perPage': perPage },
|
|
34
118
|
} ) {
|
|
35
119
|
const blockProps = useBlockProps();
|
|
36
120
|
|
|
37
|
-
const [
|
|
121
|
+
const [ activeComment, setActiveComment ] = useState();
|
|
38
122
|
|
|
39
|
-
const {
|
|
123
|
+
const { rawComments, blocks } = useSelect(
|
|
40
124
|
( select ) => {
|
|
41
125
|
const { getEntityRecords } = select( coreStore );
|
|
42
126
|
const { getBlocks } = select( blockEditorStore );
|
|
43
127
|
|
|
44
128
|
return {
|
|
45
|
-
|
|
129
|
+
rawComments: getEntityRecords( 'root', 'comment', {
|
|
46
130
|
post: postId,
|
|
47
131
|
status: 'approve',
|
|
48
|
-
per_page: queryPerPage,
|
|
49
132
|
order: 'asc',
|
|
133
|
+
context: 'embed',
|
|
50
134
|
} ),
|
|
51
135
|
blocks: getBlocks( clientId ),
|
|
52
136
|
};
|
|
53
137
|
},
|
|
54
|
-
[
|
|
138
|
+
[ postId, clientId ]
|
|
55
139
|
);
|
|
56
140
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
141
|
+
// TODO: Replicate the logic used on the server.
|
|
142
|
+
perPage = perPage || 50;
|
|
143
|
+
|
|
144
|
+
// We convert the flat list of comments to tree.
|
|
145
|
+
// Then, we show only a maximum of `perPage` number of comments.
|
|
146
|
+
// This is because passing `per_page` to `getEntityRecords()` does not
|
|
147
|
+
// take into account nested comments.
|
|
148
|
+
const comments = useMemo(
|
|
149
|
+
() => convertToTree( rawComments ).slice( 0, perPage ),
|
|
150
|
+
[ rawComments, perPage ]
|
|
60
151
|
);
|
|
61
152
|
|
|
62
|
-
if ( !
|
|
153
|
+
if ( ! rawComments ) {
|
|
63
154
|
return (
|
|
64
155
|
<p { ...blockProps }>
|
|
65
156
|
<Spinner />
|
|
@@ -72,29 +163,12 @@ export default function CommentTemplateEdit( {
|
|
|
72
163
|
}
|
|
73
164
|
|
|
74
165
|
return (
|
|
75
|
-
<
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{ blockContext ===
|
|
83
|
-
( activeBlockContext || blockContexts[ 0 ] ) ? (
|
|
84
|
-
<CommentTemplateInnerBlocks />
|
|
85
|
-
) : (
|
|
86
|
-
<li>
|
|
87
|
-
<BlockPreview
|
|
88
|
-
blocks={ blocks }
|
|
89
|
-
__experimentalLive
|
|
90
|
-
__experimentalOnClick={ () =>
|
|
91
|
-
setActiveBlockContext( blockContext )
|
|
92
|
-
}
|
|
93
|
-
/>
|
|
94
|
-
</li>
|
|
95
|
-
) }
|
|
96
|
-
</BlockContextProvider>
|
|
97
|
-
) ) }
|
|
98
|
-
</ul>
|
|
166
|
+
<CommentsList
|
|
167
|
+
comments={ comments }
|
|
168
|
+
blockProps={ blockProps }
|
|
169
|
+
blocks={ blocks }
|
|
170
|
+
activeComment={ activeComment }
|
|
171
|
+
setActiveComment={ setActiveComment }
|
|
172
|
+
/>
|
|
99
173
|
);
|
|
100
174
|
}
|
|
@@ -5,6 +5,43 @@
|
|
|
5
5
|
* @package WordPress
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Function that recursively renders a list of nested comments.
|
|
10
|
+
*
|
|
11
|
+
* @param WP_Comment[] $comments The array of comments.
|
|
12
|
+
* @param WP_Block $block Block instance.
|
|
13
|
+
* @return string
|
|
14
|
+
*/
|
|
15
|
+
function block_core_comment_template_render_comments( $comments, $block ) {
|
|
16
|
+
$content = '';
|
|
17
|
+
foreach ( $comments as $comment ) {
|
|
18
|
+
|
|
19
|
+
$block_content = ( new WP_Block(
|
|
20
|
+
$block->parsed_block,
|
|
21
|
+
array(
|
|
22
|
+
'commentId' => $comment->comment_ID,
|
|
23
|
+
)
|
|
24
|
+
) )->render( array( 'dynamic' => false ) );
|
|
25
|
+
|
|
26
|
+
$children = $comment->get_children();
|
|
27
|
+
|
|
28
|
+
// If the comment has children, recurse to create the HTML for the nested
|
|
29
|
+
// comments.
|
|
30
|
+
if ( ! empty( $children ) ) {
|
|
31
|
+
$inner_content = block_core_comment_template_render_comments(
|
|
32
|
+
$children,
|
|
33
|
+
$block
|
|
34
|
+
);
|
|
35
|
+
$block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
$content .= '<li>' . $block_content . '</li>';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return $content;
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
8
45
|
/**
|
|
9
46
|
* Renders the `core/comment-template` block on the server.
|
|
10
47
|
*
|
|
@@ -16,37 +53,27 @@
|
|
|
16
53
|
* defined by the block's inner blocks.
|
|
17
54
|
*/
|
|
18
55
|
function render_block_core_comment_template( $attributes, $content, $block ) {
|
|
19
|
-
|
|
20
|
-
$post_id = $block->context['postId'];
|
|
21
|
-
|
|
22
56
|
// Bail out early if the post ID is not set for some reason.
|
|
23
|
-
if (
|
|
57
|
+
if ( empty( $block->context['postId'] ) ) {
|
|
24
58
|
return '';
|
|
25
59
|
}
|
|
26
60
|
|
|
27
|
-
$
|
|
61
|
+
$comment_query = new WP_Comment_Query(
|
|
62
|
+
build_comment_query_vars_from_block( $block )
|
|
63
|
+
);
|
|
28
64
|
|
|
29
65
|
// Get an array of comments for the current post.
|
|
30
|
-
$comments =
|
|
31
|
-
|
|
66
|
+
$comments = $comment_query->get_comments();
|
|
32
67
|
if ( count( $comments ) === 0 ) {
|
|
33
68
|
return '';
|
|
34
69
|
}
|
|
35
70
|
|
|
36
|
-
$
|
|
37
|
-
foreach ( $comments as $comment ) {
|
|
38
|
-
$block_content = ( new WP_Block(
|
|
39
|
-
$block->parsed_block,
|
|
40
|
-
array(
|
|
41
|
-
'commentId' => $comment->comment_ID,
|
|
42
|
-
)
|
|
43
|
-
) )->render( array( 'dynamic' => false ) );
|
|
44
|
-
$content .= '<li>' . $block_content . '</li>';
|
|
45
|
-
}
|
|
71
|
+
$wrapper_attributes = get_block_wrapper_attributes();
|
|
46
72
|
|
|
47
73
|
return sprintf(
|
|
48
|
-
'<
|
|
49
|
-
$
|
|
74
|
+
'<ol %1$s>%2$s</ol>',
|
|
75
|
+
$wrapper_attributes,
|
|
76
|
+
block_core_comment_template_render_comments( $comments, $block )
|
|
50
77
|
);
|
|
51
78
|
}
|
|
52
79
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { convertToTree } from '../util';
|
|
5
|
+
|
|
6
|
+
describe( 'Convert to tree', () => {
|
|
7
|
+
it( 'Empty comments', () => {
|
|
8
|
+
const comments = convertToTree( [] );
|
|
9
|
+
|
|
10
|
+
expect( comments ).toEqual( [] );
|
|
11
|
+
} );
|
|
12
|
+
|
|
13
|
+
it( 'Handle comments', () => {
|
|
14
|
+
const comments = convertToTree( [
|
|
15
|
+
{ id: 1, parent: 0 },
|
|
16
|
+
{ id: 2, parent: 0 },
|
|
17
|
+
{ id: 3, parent: 2 },
|
|
18
|
+
{ id: 4, parent: 2 },
|
|
19
|
+
{ id: 5, parent: 4 },
|
|
20
|
+
{ id: 6, parent: 1 },
|
|
21
|
+
] );
|
|
22
|
+
|
|
23
|
+
expect( comments ).toEqual( [
|
|
24
|
+
{
|
|
25
|
+
commentId: 1,
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
commentId: 6,
|
|
29
|
+
children: [],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
commentId: 2,
|
|
35
|
+
children: [
|
|
36
|
+
{ commentId: 3, children: [] },
|
|
37
|
+
{
|
|
38
|
+
commentId: 4,
|
|
39
|
+
children: [ { commentId: 5, children: [] } ],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
] );
|
|
44
|
+
} );
|
|
45
|
+
} );
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* This function converts a flat list of comment objects with a `parent` property
|
|
4
|
+
* to a nested list of comment objects with a `children` property. The `children`
|
|
5
|
+
* property is itself a list of comment objects.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* const comments = [
|
|
10
|
+
* { id: 1, parent: 0 },
|
|
11
|
+
* { id: 2, parent: 1 },
|
|
12
|
+
* { id: 3, parent: 2 },
|
|
13
|
+
* { id: 4, parent: 1 },
|
|
14
|
+
* ];
|
|
15
|
+
* expect( convertToTree( comments ) ).toEqual( [
|
|
16
|
+
* {
|
|
17
|
+
* commentId: 1,
|
|
18
|
+
* children: [
|
|
19
|
+
* { commentId: 2, children: [ { commentId: 3, children: [] } ] },
|
|
20
|
+
* { commentId: 4, children: [] },
|
|
21
|
+
* ],
|
|
22
|
+
* },
|
|
23
|
+
* ] );
|
|
24
|
+
* ```
|
|
25
|
+
* @typedef {{id: number, parent: number}} Comment
|
|
26
|
+
* @param {Comment[]} data - List of comment objects.
|
|
27
|
+
*
|
|
28
|
+
* @return {Object[]} Nested list of comment objects with a `children` property.
|
|
29
|
+
*/
|
|
30
|
+
export const convertToTree = ( data ) => {
|
|
31
|
+
const table = {};
|
|
32
|
+
if ( ! data ) return [];
|
|
33
|
+
|
|
34
|
+
// First create a hash table of { [id]: { ...comment, children: [] }}
|
|
35
|
+
data.forEach( ( item ) => {
|
|
36
|
+
table[ item.id ] = { commentId: item.id, children: [] };
|
|
37
|
+
} );
|
|
38
|
+
|
|
39
|
+
const tree = [];
|
|
40
|
+
|
|
41
|
+
// Iterate over the original comments again
|
|
42
|
+
data.forEach( ( item ) => {
|
|
43
|
+
if ( item.parent ) {
|
|
44
|
+
// If the comment has a "parent", then find that parent in the table that
|
|
45
|
+
// we have created above and push the current comment to the array of its
|
|
46
|
+
// children.
|
|
47
|
+
table[ item.parent ].children.push( table[ item.id ] );
|
|
48
|
+
} else {
|
|
49
|
+
// Otherwise, if the comment has no parent (also works if parent is 0)
|
|
50
|
+
// that means that it's a top-level comment so we can find it in the table
|
|
51
|
+
// and push it to the final tree.
|
|
52
|
+
tree.push( table[ item.id ] );
|
|
53
|
+
}
|
|
54
|
+
} );
|
|
55
|
+
return tree;
|
|
56
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
|
+
"apiVersion": 2,
|
|
4
|
+
"name": "core/comments-pagination",
|
|
5
|
+
"title": "Comments Pagination",
|
|
6
|
+
"category": "design",
|
|
7
|
+
"parent": [ "core/comments-query-loop" ],
|
|
8
|
+
"description": "Displays a paginated navigation to next/previous set of comments, when applicable.",
|
|
9
|
+
"textdomain": "default",
|
|
10
|
+
"attributes": {
|
|
11
|
+
"paginationArrow": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"default": "none"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"providesContext": {
|
|
17
|
+
"paginationArrow": "paginationArrow"
|
|
18
|
+
},
|
|
19
|
+
"supports": {
|
|
20
|
+
"align": true,
|
|
21
|
+
"reusable": false,
|
|
22
|
+
"html": false,
|
|
23
|
+
"color": {
|
|
24
|
+
"gradients": true,
|
|
25
|
+
"link": true
|
|
26
|
+
},
|
|
27
|
+
"__experimentalLayout": {
|
|
28
|
+
"allowSwitching": false,
|
|
29
|
+
"allowInheriting": false,
|
|
30
|
+
"default": {
|
|
31
|
+
"type": "flex"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"editorStyle": "wp-block-comments-pagination-editor",
|
|
36
|
+
"style": "wp-block-comments-pagination"
|
|
37
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, _x } from '@wordpress/i18n';
|
|
5
|
+
import {
|
|
6
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
7
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
|
|
10
|
+
export function CommentsPaginationArrowControls( { value, onChange } ) {
|
|
11
|
+
return (
|
|
12
|
+
<ToggleGroupControl
|
|
13
|
+
label={ __( 'Arrow' ) }
|
|
14
|
+
value={ value }
|
|
15
|
+
onChange={ onChange }
|
|
16
|
+
help={ __(
|
|
17
|
+
'A decorative arrow appended to the next and previous comments link.'
|
|
18
|
+
) }
|
|
19
|
+
isBlock
|
|
20
|
+
>
|
|
21
|
+
<ToggleGroupControlOption
|
|
22
|
+
value="none"
|
|
23
|
+
label={ _x(
|
|
24
|
+
'None',
|
|
25
|
+
'Arrow option for Comments Pagination Next/Previous blocks'
|
|
26
|
+
) }
|
|
27
|
+
/>
|
|
28
|
+
<ToggleGroupControlOption
|
|
29
|
+
value="arrow"
|
|
30
|
+
label={ _x(
|
|
31
|
+
'Arrow',
|
|
32
|
+
'Arrow option for Comments Pagination Next/Previous blocks'
|
|
33
|
+
) }
|
|
34
|
+
/>
|
|
35
|
+
<ToggleGroupControlOption
|
|
36
|
+
value="chevron"
|
|
37
|
+
label={ _x(
|
|
38
|
+
'Chevron',
|
|
39
|
+
'Arrow option for Comments Pagination Next/Previous blocks'
|
|
40
|
+
) }
|
|
41
|
+
/>
|
|
42
|
+
</ToggleGroupControl>
|
|
43
|
+
);
|
|
44
|
+
}
|