@wordpress/block-library 9.9.0 → 9.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 +4 -0
- package/README.md +10 -5
- package/build/archives/index.js +6 -0
- package/build/archives/index.js.map +1 -1
- package/build/audio/edit.native.js +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/avatar/hooks.js +2 -3
- package/build/avatar/hooks.js.map +1 -1
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +2 -2
- package/build/block/edit.native.js.map +1 -1
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/get-updated-link-attributes.js +1 -1
- package/build/button/get-updated-link-attributes.js.map +1 -1
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js.map +1 -1
- package/build/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/column/deprecated.js.map +1 -1
- package/build/column/edit.js +1 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/column/save.js.map +1 -1
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/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/save.js.map +1 -1
- package/build/columns/transforms.js.map +1 -1
- package/build/columns/utils.js.map +1 -1
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-content/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comment-reply-link/edit.js.map +1 -1
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comments/edit/comments-legacy.js.map +1 -1
- package/build/comments/index.js +12 -0
- package/build/comments/index.js.map +1 -1
- package/build/comments-pagination-next/edit.js.map +1 -1
- package/build/comments-pagination-numbers/edit.js.map +1 -1
- package/build/comments-pagination-previous/edit.js.map +1 -1
- package/build/comments-title/edit.js +2 -2
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/constants.js +8 -0
- package/build/cover/constants.js.map +1 -0
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js +24 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +113 -31
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +3 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +3 -1
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js.map +1 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.js +16 -3
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-preview.js +5 -19
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/embed-preview.native.js +1 -1
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/embed/save.js.map +1 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/variations.js +1 -1
- package/build/embed/variations.js.map +1 -1
- package/build/embed/wp-embed-preview.native.js.map +1 -1
- package/build/file/deprecated.js +3 -3
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +1 -2
- package/build/file/edit.js.map +1 -1
- package/build/file/save.js.map +1 -1
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js.map +1 -1
- package/build/form/edit.js.map +1 -1
- package/build/form-submission-notification/edit.js.map +1 -1
- package/build/form-submission-notification/save.js.map +1 -1
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/constants.js +2 -1
- package/build/gallery/constants.js.map +1 -1
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +13 -4
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/gallery.native.js +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/utils.js +26 -5
- package/build/gallery/utils.js.map +1 -1
- package/build/group/placeholder.js.map +1 -1
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js.map +1 -1
- package/build/heading/edit.native.js.map +1 -1
- package/build/heading/index.js +2 -2
- package/build/heading/index.js.map +1 -1
- package/build/heading/save.js.map +1 -1
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/edit.js.map +1 -1
- package/build/html/edit.js +5 -1
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +2 -2
- package/build/html/preview.js.map +1 -1
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +1 -1
- 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 +3 -3
- package/build/image/image.js.map +1 -1
- package/build/image/save.js.map +1 -1
- package/build/image/view.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/edit.js +4 -9
- package/build/latest-posts/edit.js.map +1 -1
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/image-fill.js.map +1 -1
- package/build/media-text/save.js.map +1 -1
- package/build/missing/edit.js +2 -2
- package/build/missing/edit.js.map +1 -1
- package/build/more/edit.js.map +1 -1
- package/build/more/save.js.map +1 -1
- package/build/navigation/edit/accessible-menu-description.js.map +1 -1
- package/build/navigation/edit/index.js +23 -2
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +1 -1
- package/build/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +2 -2
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +2 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation/edit/utils.js.map +1 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/nextpage/edit.native.js +1 -1
- package/build/nextpage/edit.native.js.map +1 -1
- package/build/page-list-item/edit.js +1 -1
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/save.js.map +1 -1
- package/build/pattern/recursion-detector.js +1 -0
- package/build/pattern/recursion-detector.js.map +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-biography/edit.js.map +1 -1
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +1 -1
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-link/edit.js +1 -1
- package/build/post-comments-link/edit.js.map +1 -1
- package/build/post-content/edit.js +29 -2
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +2 -2
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-title/edit.js.map +1 -1
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/save.js.map +1 -1
- package/build/pullquote/shared.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +1 -0
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +8 -11
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +2 -2
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +1 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +1 -1
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js.map +1 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/query-title/edit.js +4 -4
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js.map +1 -1
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js.map +1 -1
- package/build/search/edit.js +19 -14
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js.map +1 -1
- package/build/separator/transforms.js +12 -0
- package/build/separator/transforms.js.map +1 -1
- package/build/shortcode/edit.js.map +1 -1
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-title/edit.js.map +1 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.js +0 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/deprecated.js.map +1 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/index.js +2 -0
- package/build/spacer/index.js.map +1 -1
- package/build/spacer/transforms.js +27 -0
- package/build/spacer/transforms.js.map +1 -0
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +0 -1
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js.map +1 -1
- package/build/table-of-contents/edit.js +3 -8
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js.map +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +1 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/import-controls.js +2 -1
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/index.js +2 -2
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +2 -2
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js.map +1 -1
- package/build/term-description/edit.js.map +1 -1
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js.map +1 -1
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/edit.js.map +1 -1
- package/build/verse/save.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +1 -1
- package/build/video/edit.native.js.map +1 -1
- package/build/video/tracks-editor.js +2 -2
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +1 -3
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +6 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/deprecated.js +1 -2
- package/build-module/audio/deprecated.js.map +1 -1
- package/build-module/audio/edit.js +1 -3
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +2 -4
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/save.js +1 -2
- package/build-module/audio/save.js.map +1 -1
- package/build-module/avatar/edit.js +1 -3
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -3
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/block/edit-title.native.js +1 -2
- package/build-module/block/edit-title.native.js.map +1 -1
- package/build-module/block/edit.js +1 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +3 -4
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/button/color-background.native.js +1 -2
- package/build-module/button/color-background.native.js.map +1 -1
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +1 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +1 -3
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/get-updated-link-attributes.js +1 -1
- package/build-module/button/get-updated-link-attributes.js.map +1 -1
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.native.js +1 -3
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/categories/edit.js +2 -4
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/column/deprecated.js.map +1 -1
- package/build-module/column/edit.js +2 -4
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js +1 -3
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/column/save.js.map +1 -1
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +1 -3
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -4
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/save.js.map +1 -1
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -3
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comment-author-name/edit.js +1 -3
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-content/edit.js +1 -3
- package/build-module/comment-content/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +1 -3
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +1 -3
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comment-reply-link/edit.js +1 -3
- package/build-module/comment-reply-link/edit.js.map +1 -1
- package/build-module/comment-template/edit.js +1 -2
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comments/edit/comments-legacy.js +1 -3
- package/build-module/comments/edit/comments-legacy.js.map +1 -1
- package/build-module/comments/edit/index.js +1 -3
- package/build-module/comments/edit/index.js.map +1 -1
- package/build-module/comments/edit/placeholder.js +1 -2
- package/build-module/comments/edit/placeholder.js.map +1 -1
- package/build-module/comments/index.js +12 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -2
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +1 -3
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-pagination-next/edit.js +1 -2
- package/build-module/comments-pagination-next/edit.js.map +1 -1
- package/build-module/comments-pagination-numbers/edit.js +1 -2
- package/build-module/comments-pagination-numbers/edit.js.map +1 -1
- package/build-module/comments-pagination-previous/edit.js +1 -2
- package/build-module/comments-pagination-previous/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +3 -5
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/cover/constants.js +2 -0
- package/build-module/cover/constants.js.map +1 -0
- package/build-module/cover/controls.native.js +1 -3
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +1 -2
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -3
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/index.js +25 -6
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +116 -36
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit.native.js +1 -3
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/index.js +3 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +4 -3
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/edit.js +1 -3
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/save.js +1 -2
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/deprecated.js +1 -2
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.js +17 -6
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +1 -3
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.js +1 -3
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/embed/embed-controls.native.js +1 -3
- package/build-module/embed/embed-controls.native.js.map +1 -1
- package/build-module/embed/embed-no-preview.native.js +1 -3
- package/build-module/embed/embed-no-preview.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +1 -2
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -3
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +6 -21
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/embed-preview.native.js +2 -4
- package/build-module/embed/embed-preview.native.js.map +1 -1
- package/build-module/embed/icons.js +1 -2
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/embed/save.js +1 -2
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/variations.js +1 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/embed/wp-embed-preview.native.js.map +1 -1
- package/build-module/file/deprecated.js +4 -6
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +2 -5
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js +1 -2
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/inspector.js +1 -3
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/save.js +1 -3
- package/build-module/file/save.js.map +1 -1
- package/build-module/footnotes/edit.js +1 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/footnotes/format.js.map +1 -1
- package/build-module/form/edit.js +1 -3
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form-input/deprecated.js +1 -2
- package/build-module/form-input/deprecated.js.map +1 -1
- package/build-module/form-input/edit.js +1 -3
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/form-input/save.js +1 -2
- package/build-module/form-input/save.js.map +1 -1
- package/build-module/form-submission-notification/edit.js.map +1 -1
- package/build-module/form-submission-notification/save.js.map +1 -1
- package/build-module/freeform/edit.js +1 -3
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/modal.js +1 -3
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/constants.js +1 -0
- package/build-module/gallery/constants.js.map +1 -1
- package/build-module/gallery/deprecated.js +1 -2
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +17 -10
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +1 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/gallery.native.js +2 -3
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/save.js +1 -2
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/utils.js +27 -6
- package/build-module/gallery/utils.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/edit.native.js +1 -2
- package/build-module/group/edit.native.js.map +1 -1
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/edit.js +1 -3
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/edit.native.js +1 -3
- package/build-module/heading/edit.native.js.map +1 -1
- package/build-module/heading/index.js +2 -2
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/save.js.map +1 -1
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/edit.js +1 -2
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/html/edit.js +7 -5
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +3 -5
- package/build-module/html/preview.js.map +1 -1
- package/build-module/image/deprecated.js +1 -3
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +2 -4
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +2 -4
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +4 -6
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/save.js +1 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/image/view.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -2
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +5 -12
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +1 -3
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/edit.js +1 -3
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +1 -2
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list-item/edit.js +1 -3
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +1 -2
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/list-style-type.native.js +1 -2
- package/build-module/list-item/list-style-type.native.js.map +1 -1
- package/build-module/list-item/save.js +1 -2
- package/build-module/list-item/save.js.map +1 -1
- package/build-module/loginout/edit.js +1 -3
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/deprecated.js +1 -2
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +1 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +1 -3
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/icon-retry.native.js +1 -2
- package/build-module/media-text/icon-retry.native.js.map +1 -1
- package/build-module/media-text/image-fill.js.map +1 -1
- package/build-module/media-text/media-container.js +1 -2
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -3
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +1 -2
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/missing/edit.js +3 -4
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +1 -2
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/more/edit.js +1 -3
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/edit/accessible-menu-description.js.map +1 -1
- package/build-module/navigation/edit/index.js +24 -5
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +2 -4
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +3 -6
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -3
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +3 -5
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-icon.js +1 -2
- package/build-module/navigation/edit/overlay-menu-icon.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -3
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +1 -3
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/placeholder/placeholder-preview.js +1 -2
- package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +1 -3
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation/edit/utils.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +1 -3
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +1 -2
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -3
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/nextpage/edit.native.js +1 -1
- package/build-module/nextpage/edit.native.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -2
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +1 -3
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list-item/edit.js +2 -4
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +2 -4
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js +1 -3
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/paragraph/save.js.map +1 -1
- package/build-module/pattern/recursion-detector.js +1 -0
- package/build-module/pattern/recursion-detector.js.map +1 -1
- package/build-module/post-author/edit.js +1 -3
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-biography/edit.js +1 -3
- package/build-module/post-author-biography/edit.js.map +1 -1
- package/build-module/post-author-name/edit.js +1 -3
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-comment/edit.js +1 -2
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comments-count/edit.js +1 -3
- package/build-module/post-comments-count/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +1 -3
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +2 -3
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-comments-link/edit.js +2 -4
- package/build-module/post-comments-link/edit.js.map +1 -1
- package/build-module/post-content/edit.js +32 -5
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/edit.js +1 -3
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -3
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +1 -3
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +2 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/overlay-controls.js +1 -3
- package/build-module/post-featured-image/overlay-controls.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +1 -3
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-template/edit.js +1 -3
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +1 -3
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +3 -5
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-title/edit.js +1 -3
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/pullquote/deprecated.js +1 -2
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +1 -3
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +1 -3
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/pullquote/save.js +1 -2
- package/build-module/pullquote/save.js.map +1 -1
- package/build-module/pullquote/shared.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +1 -2
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/index.js +1 -3
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +1 -0
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -2
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +9 -14
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +2 -2
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +1 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +2 -3
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -3
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +1 -2
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +1 -2
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -3
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -2
- package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +1 -2
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -3
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +1 -2
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/query-title/edit.js +6 -8
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +1 -2
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +1 -3
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/save.js +1 -2
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/read-more/edit.js +1 -3
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/rss/edit.js +1 -3
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +21 -18
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +1 -2
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/search/icons.js +1 -2
- package/build-module/search/icons.js.map +1 -1
- package/build-module/separator/edit.js +1 -2
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/separator/transforms.js +12 -0
- package/build-module/separator/transforms.js.map +1 -1
- package/build-module/shortcode/edit.js.map +1 -1
- package/build-module/shortcode/edit.native.js +1 -2
- package/build-module/shortcode/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -3
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +1 -3
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-title/edit.js +1 -3
- package/build-module/site-title/edit.js.map +1 -1
- package/build-module/social-link/edit.js +1 -3
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +1 -3
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/social-links/deprecated.js.map +1 -1
- package/build-module/social-links/edit.js +1 -4
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/controls.js +1 -3
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +1 -2
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/deprecated.js.map +1 -1
- package/build-module/spacer/edit.js +1 -3
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/index.js +2 -0
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/spacer/transforms.js +20 -0
- package/build-module/spacer/transforms.js.map +1 -0
- package/build-module/table/deprecated.js +1 -2
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +1 -4
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/save.js +1 -2
- package/build-module/table/save.js.map +1 -1
- package/build-module/table-of-contents/edit.js +4 -11
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js.map +1 -1
- package/build-module/table-of-contents/list.js +1 -3
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -3
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +2 -4
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +3 -3
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +3 -5
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/placeholder.js +1 -2
- package/build-module/template-part/edit/placeholder.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +3 -4
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/title-modal.js +1 -2
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/term-description/edit.js +1 -3
- package/build-module/term-description/edit.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -3
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/utils/caption.js +1 -3
- package/build-module/utils/caption.js.map +1 -1
- package/build-module/verse/deprecated.js.map +1 -1
- package/build-module/verse/edit.js +1 -3
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/save.js.map +1 -1
- package/build-module/video/deprecated.js +1 -2
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit-common-settings.js +1 -3
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +2 -4
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +2 -3
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/icon-retry.native.js +1 -2
- package/build-module/video/icon-retry.native.js.map +1 -1
- package/build-module/video/save.js +1 -2
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks-editor.js +4 -6
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/archives/editor-rtl.css +5 -0
- package/build-style/archives/editor.css +5 -0
- package/build-style/button/style-rtl.css +3 -0
- package/build-style/button/style.css +3 -0
- package/build-style/code/style-rtl.css +2 -0
- package/build-style/code/style.css +4 -0
- package/build-style/comments/editor-rtl.css +4 -0
- package/build-style/comments/editor.css +4 -0
- package/build-style/comments/style-rtl.css +4 -0
- package/build-style/comments/style.css +4 -0
- package/build-style/common-rtl.css +0 -2
- package/build-style/common.css +0 -2
- package/build-style/cover/style-rtl.css +5 -0
- package/build-style/cover/style.css +5 -0
- package/build-style/editor-rtl.css +20 -0
- package/build-style/editor.css +20 -0
- package/build-style/group/editor-rtl.css +10 -0
- package/build-style/group/editor.css +10 -0
- package/build-style/image/style-rtl.css +2 -0
- package/build-style/image/style.css +2 -0
- package/build-style/navigation/editor-rtl.css +1 -0
- package/build-style/navigation/editor.css +1 -0
- package/build-style/post-content/style-rtl.css +2 -4
- package/build-style/post-content/style.css +2 -4
- package/build-style/style-rtl.css +18 -6
- package/build-style/style.css +20 -6
- package/package.json +37 -36
- package/src/archives/block.json +6 -0
- package/src/archives/editor.scss +8 -0
- package/src/avatar/hooks.js +2 -3
- package/src/avatar/index.php +4 -5
- package/src/button/get-updated-link-attributes.js +1 -1
- package/src/button/style.scss +3 -0
- package/src/button/test/get-updated-link-attributes.js +15 -0
- package/src/code/style.scss +5 -0
- package/src/comment-author-avatar/index.php +1 -1
- package/src/comments/block.json +21 -3
- package/src/comments/style.scss +4 -1
- package/src/common.scss +0 -3
- package/src/cover/block.json +3 -0
- package/src/cover/constants.js +1 -0
- package/src/cover/edit/index.js +20 -2
- package/src/cover/edit/inspector-controls.js +148 -44
- package/src/cover/index.php +38 -19
- package/src/cover/save.js +2 -0
- package/src/cover/style.scss +6 -0
- package/src/cover/test/edit.js +3 -5
- package/src/embed/edit.js +19 -2
- package/src/embed/embed-preview.js +2 -18
- package/src/file/edit.js +1 -2
- package/src/gallery/constants.js +1 -0
- package/src/gallery/edit.js +25 -2
- package/src/gallery/utils.js +23 -2
- package/src/group/editor.scss +12 -0
- package/src/html/edit.js +7 -1
- package/src/html/preview.js +3 -2
- package/src/image/index.php +1 -1
- package/src/image/style.scss +1 -0
- package/src/latest-posts/edit.js +3 -7
- package/src/latest-posts/index.php +1 -1
- package/src/navigation/edit/index.js +30 -3
- package/src/navigation/edit/menu-inspector-controls.js +2 -2
- package/src/navigation/edit/navigation-menu-selector.js +2 -2
- package/src/navigation/editor.scss +1 -0
- package/src/paragraph/edit.js +1 -1
- package/src/post-content/edit.js +30 -1
- package/src/post-content/style.scss +2 -4
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-terms/index.php +7 -6
- package/src/post-time-to-read/edit.js +2 -2
- package/src/post-time-to-read/index.php +1 -1
- package/src/query/edit/inspector-controls/index.js +10 -16
- package/src/query/edit/inspector-controls/order-control.js +2 -2
- package/src/query/edit/pattern-selection-modal.js +1 -1
- package/src/query-title/edit.js +2 -2
- package/src/rss/index.php +1 -1
- package/src/search/edit.js +28 -25
- package/src/separator/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/separator/test/transforms.native.js +1 -1
- package/src/separator/transforms.js +11 -0
- package/src/social-links/edit.js +0 -1
- package/src/spacer/index.js +2 -0
- package/src/spacer/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/spacer/test/transforms.native.js +1 -1
- package/src/spacer/transforms.js +20 -0
- package/src/table/edit.js +0 -1
- package/src/table-of-contents/edit.js +2 -6
- package/src/template-part/edit/index.js +1 -1
- package/src/template-part/edit/selection-modal.js +1 -1
- package/src/video/tracks-editor.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__","AlignmentControl","BlockControls","useBlockProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","setAttributes","attributes","textAlign","blockProps","className","blockControls","group","children","value","onChange","newAlign","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/comment-reply-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\n\n/**\n * Renders the `core/comment-reply-link` block on the editor.\n *\n * @param {Object} props React props.\n * @param {Object} props.setAttributes Callback for updating block attributes.\n * @param {Object} props.attributes Block attributes.\n * @param {string} props.attributes.textAlign The `textAlign` attribute.\n *\n * @return {JSX.Element} React element.\n */\nfunction Edit( { setAttributes, attributes: { textAlign } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref=\"#comment-reply-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Edit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,gBAAgB,EAChBC,aAAa,EACbC,aAAa,QACP,yBAAyB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","__","AlignmentControl","BlockControls","useBlockProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","setAttributes","attributes","textAlign","blockProps","className","blockControls","group","children","value","onChange","newAlign","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/comment-reply-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\n\n/**\n * Renders the `core/comment-reply-link` block on the editor.\n *\n * @param {Object} props React props.\n * @param {Object} props.setAttributes Callback for updating block attributes.\n * @param {Object} props.attributes Block attributes.\n * @param {string} props.attributes.textAlign The `textAlign` attribute.\n *\n * @return {JSX.Element} React element.\n */\nfunction Edit( { setAttributes, attributes: { textAlign } } ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref=\"#comment-reply-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Edit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,gBAAgB,EAChBC,aAAa,EACbC,aAAa,QACP,yBAAyB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAUA,SAASC,IAAIA,CAAE;EAAEC,aAAa;EAAEC,UAAU,EAAE;IAAEC;EAAU;AAAE,CAAC,EAAG;EAC7D,MAAMC,UAAU,GAAGX,aAAa,CAAE;IACjCY,SAAS,EAAEhB,IAAI,CAAE;MAChB,CAAE,kBAAmBc,SAAS,EAAG,GAAIA;IACtC,CAAE;EACH,CAAE,CAAC;EAEH,MAAMG,aAAa,gBAClBX,IAAA,CAACH,aAAa;IAACe,KAAK,EAAC,OAAO;IAAAC,QAAA,eAC3Bb,IAAA,CAACJ,gBAAgB;MAChBkB,KAAK,EAAGN,SAAW;MACnBO,QAAQ,EAAKC,QAAQ,IACpBV,aAAa,CAAE;QAAEE,SAAS,EAAEQ;MAAS,CAAE;IACvC,CACD;EAAC,CACY,CACf;EAED,oBACCZ,KAAA,CAAAF,SAAA;IAAAW,QAAA,GACGF,aAAa,eACfX,IAAA;MAAA,GAAUS,UAAU;MAAAI,QAAA,eACnBb,IAAA;QACCiB,IAAI,EAAC,4BAA4B;QACjCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAAP,QAAA,EAE7ClB,EAAE,CAAE,OAAQ;MAAC,CACb;IAAC,CACA,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeU,IAAI","ignoreList":[]}
|
|
@@ -12,8 +12,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import { useCommentQueryArgs, useCommentTree } from './hooks';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
const TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
|
|
18
17
|
|
|
19
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","memo","useSelect","__","BlockContextProvider","useBlockProps","useInnerBlocksProps","store","blockEditorStore","__experimentalUseBlockPreview","useBlockPreview","Spinner","coreStore","useCommentQueryArgs","useCommentTree","jsx","_jsx","jsxs","_jsxs","TEMPLATE","getCommentsPlaceholder","perPage","pageComments","threadComments","threadCommentsDepth","commentsDepth","Math","min","buildChildrenComment","commentsLevel","nextLevel","commentId","children","placeholderComments","push","CommentTemplateInnerBlocks","comment","activeCommentId","setActiveCommentId","firstCommentId","blocks","innerBlocksProps","template","MemoizedCommentTemplatePreview","isHidden","length","CommentsList","comments","CommentTemplatePreview","blockPreviewProps","handleOnClick","style","display","undefined","tabIndex","role","onClick","onKeyPress","blockProps","map","index","value","CommentTemplateEdit","clientId","context","postId","commentOrder","commentsPerPage","select","getSettings","__experimentalDiscussionSettings","commentQuery","topLevelComments","getEntityRecords","getBlocks","commentTree","reverse"],"sources":["@wordpress/block-library/src/comment-template/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, memo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockContextProvider,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { Spinner } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useCommentQueryArgs, useCommentTree } from './hooks';\n\nconst TEMPLATE = [\n\t[ 'core/avatar' ],\n\t[ 'core/comment-author-name' ],\n\t[ 'core/comment-date' ],\n\t[ 'core/comment-content' ],\n\t[ 'core/comment-reply-link' ],\n\t[ 'core/comment-edit-link' ],\n];\n\n/**\n * Function that returns a comment structure that will be rendered with default placehoders.\n *\n * Each comment has a `commentId` property that is always a negative number in\n * case of the placeholders. This is to ensure that the comment does not\n * conflict with the actual (real) comments.\n *\n * @param {Object} settings Discussion Settings.\n * @param {number} [settings.perPage] - Comments per page setting or block attribute.\n * @param {boolean} [settings.pageComments] - Enable break comments into pages setting.\n * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.\n * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.\n *\n * @typedef {{id: null, children: EmptyComment[]}} EmptyComment\n * @return {EmptyComment[]} \t\tInner blocks of the Comment Template\n */\nconst getCommentsPlaceholder = ( {\n\tperPage,\n\tpageComments,\n\tthreadComments,\n\tthreadCommentsDepth,\n} ) => {\n\t// Limit commentsDepth to 3\n\tconst commentsDepth = ! threadComments\n\t\t? 1\n\t\t: Math.min( threadCommentsDepth, 3 );\n\n\tconst buildChildrenComment = ( commentsLevel ) => {\n\t\t// Render children comments until commentsDepth is reached\n\t\tif ( commentsLevel < commentsDepth ) {\n\t\t\tconst nextLevel = commentsLevel + 1;\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tcommentId: -( commentsLevel + 3 ),\n\t\t\t\t\tchildren: buildChildrenComment( nextLevel ),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\treturn [];\n\t};\n\n\t// Add the first comment and its children\n\tconst placeholderComments = [\n\t\t{ commentId: -1, children: buildChildrenComment( 1 ) },\n\t];\n\n\t// Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max\n\tif ( ( ! pageComments || perPage >= 2 ) && commentsDepth < 3 ) {\n\t\tplaceholderComments.push( {\n\t\t\tcommentId: -2,\n\t\t\tchildren: [],\n\t\t} );\n\t}\n\n\t// Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments\n\tif ( ( ! pageComments || perPage >= 3 ) && commentsDepth < 2 ) {\n\t\tplaceholderComments.push( {\n\t\t\tcommentId: -3,\n\t\t\tchildren: [],\n\t\t} );\n\t}\n\n\t// In case that the value is set but larger than 3 we truncate it to 3.\n\treturn placeholderComments;\n};\n\n/**\n * Component which renders the inner blocks of the Comment Template.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.comment] - A comment object.\n * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.\n * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.\n * @param {Array} [props.firstCommentId] - ID of the first comment in the array.\n * @param {Array} [props.blocks] - Array of blocks returned from\n * getBlocks() in parent .\n * @return {Element} \t\tInner blocks of the Comment Template\n */\nfunction CommentTemplateInnerBlocks( {\n\tcomment,\n\tactiveCommentId,\n\tsetActiveCommentId,\n\tfirstCommentId,\n\tblocks,\n} ) {\n\tconst { children, ...innerBlocksProps } = useInnerBlocksProps(\n\t\t{},\n\t\t{ template: TEMPLATE }\n\t);\n\n\treturn (\n\t\t<li { ...innerBlocksProps }>\n\t\t\t{ comment.commentId === ( activeCommentId || firstCommentId )\n\t\t\t\t? children\n\t\t\t\t: null }\n\n\t\t\t{ /* To avoid flicker when switching active block contexts, a preview\n\t\t\t is ALWAYS rendered and the preview for the active block is hidden.\n\t\t\t This ensures that when switching the active block, the component is not\n\t\t\t mounted again but rather it only toggles the `isHidden` prop.\n\t\t\t The same strategy is used for preventing the flicker in the Post Template\n\t\t\t block. */ }\n\t\t\t<MemoizedCommentTemplatePreview\n\t\t\t\tblocks={ blocks }\n\t\t\t\tcommentId={ comment.commentId }\n\t\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\t\tisHidden={\n\t\t\t\t\tcomment.commentId === ( activeCommentId || firstCommentId )\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ comment?.children?.length > 0 ? (\n\t\t\t\t<CommentsList\n\t\t\t\t\tcomments={ comment.children }\n\t\t\t\t\tactiveCommentId={ activeCommentId }\n\t\t\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tfirstCommentId={ firstCommentId }\n\t\t\t\t/>\n\t\t\t) : null }\n\t\t</li>\n\t);\n}\n\nconst CommentTemplatePreview = ( {\n\tblocks,\n\tcommentId,\n\tsetActiveCommentId,\n\tisHidden,\n} ) => {\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t} );\n\n\tconst handleOnClick = () => {\n\t\tsetActiveCommentId( commentId );\n\t};\n\n\t// We have to hide the preview block if the `comment` props points to\n\t// the curently active block!\n\n\t// Or, to put it differently, every preview block is visible unless it is the\n\t// currently active block - in this case we render its inner blocks.\n\tconst style = {\n\t\tdisplay: isHidden ? 'none' : undefined,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\t{ ...blockPreviewProps }\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\tstyle={ style }\n\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n\t\t\tonClick={ handleOnClick }\n\t\t\tonKeyPress={ handleOnClick }\n\t\t/>\n\t);\n};\n\nconst MemoizedCommentTemplatePreview = memo( CommentTemplatePreview );\n\n/**\n * Component that renders a list of (nested) comments. It is called recursively.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.comments] - Array of comment objects.\n * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.\n * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.\n * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.\n * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.\n * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of\n * comment objects.\n * @return {Element} \t\tList of comments.\n */\nconst CommentsList = ( {\n\tcomments,\n\tblockProps,\n\tactiveCommentId,\n\tsetActiveCommentId,\n\tblocks,\n\tfirstCommentId,\n} ) => (\n\t<ol { ...blockProps }>\n\t\t{ comments &&\n\t\t\tcomments.map( ( { commentId, ...comment }, index ) => (\n\t\t\t\t<BlockContextProvider\n\t\t\t\t\tkey={ comment.commentId || index }\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t// If the commentId is negative it means that this comment is a\n\t\t\t\t\t\t// \"placeholder\" and that the block is most likely being used in the\n\t\t\t\t\t\t// site editor. In this case, we have to set the commentId to `null`\n\t\t\t\t\t\t// because otherwise the (non-existent) comment with a negative ID\n\t\t\t\t\t\t// would be reqested from the REST API.\n\t\t\t\t\t\tcommentId: commentId < 0 ? null : commentId,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<CommentTemplateInnerBlocks\n\t\t\t\t\t\tcomment={ { commentId, ...comment } }\n\t\t\t\t\t\tactiveCommentId={ activeCommentId }\n\t\t\t\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tfirstCommentId={ firstCommentId }\n\t\t\t\t\t/>\n\t\t\t\t</BlockContextProvider>\n\t\t\t) ) }\n\t</ol>\n);\n\nexport default function CommentTemplateEdit( {\n\tclientId,\n\tcontext: { postId },\n} ) {\n\tconst blockProps = useBlockProps();\n\n\tconst [ activeCommentId, setActiveCommentId ] = useState();\n\tconst {\n\t\tcommentOrder,\n\t\tthreadCommentsDepth,\n\t\tthreadComments,\n\t\tcommentsPerPage,\n\t\tpageComments,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalDiscussionSettings;\n\t} );\n\n\tconst commentQuery = useCommentQueryArgs( {\n\t\tpostId,\n\t} );\n\n\tconst { topLevelComments, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\t// Request only top-level comments. Replies are embedded.\n\t\t\t\ttopLevelComments: commentQuery\n\t\t\t\t\t? getEntityRecords( 'root', 'comment', commentQuery )\n\t\t\t\t\t: null,\n\t\t\t\tblocks: getBlocks( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, commentQuery ]\n\t);\n\n\t// Generate a tree structure of comment IDs.\n\tlet commentTree = useCommentTree(\n\t\t// Reverse the order of top comments if needed.\n\t\tcommentOrder === 'desc' && topLevelComments\n\t\t\t? [ ...topLevelComments ].reverse()\n\t\t\t: topLevelComments\n\t);\n\n\tif ( ! topLevelComments ) {\n\t\treturn (\n\t\t\t<p { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</p>\n\t\t);\n\t}\n\n\tif ( ! postId ) {\n\t\tcommentTree = getCommentsPlaceholder( {\n\t\t\tperPage: commentsPerPage,\n\t\t\tpageComments,\n\t\t\tthreadComments,\n\t\t\tthreadCommentsDepth,\n\t\t} );\n\t}\n\n\tif ( ! commentTree.length ) {\n\t\treturn <p { ...blockProps }>{ __( 'No results found.' ) }</p>;\n\t}\n\n\treturn (\n\t\t<CommentsList\n\t\t\tcomments={ commentTree }\n\t\t\tblockProps={ blockProps }\n\t\t\tblocks={ blocks }\n\t\t\tactiveCommentId={ activeCommentId }\n\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\tfirstCommentId={ commentTree[ 0 ]?.commentId }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,IAAI,QAAQ,oBAAoB;AACnD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,oBAAoB,EACpBC,aAAa,EACbC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,EACzBC,6BAA6B,IAAIC,eAAe,QAC1C,yBAAyB;AAChC,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASJ,KAAK,IAAIK,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,mBAAmB,EAAEC,cAAc,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE9D,MAAMC,QAAQ,GAAG,CAChB,CAAE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EN;EAEA,IAAK,CAAEsD,MAAM,EAAG;IACfU,WAAW,GAAGvD,sBAAsB,CAAE;MACrCC,OAAO,EAAE8C,eAAe;MACxB7C,YAAY;MACZC,cAAc;MACdC;IACD,CAAE,CAAC;EACJ;EAEA,IAAK,CAAEmD,WAAW,CAAC9B,MAAM,EAAG;IAC3B,oBAAO7B,IAAA;MAAA,GAAQ0C,UAAU;MAAA1B,QAAA,EAAK7B,EAAE,CAAE,mBAAoB;IAAC,CAAK,CAAC;EAC9D;EAEA,oBACCa,IAAA,CAAC8B,YAAY;IACZC,QAAQ,EAAG4B,WAAa;IACxBjB,UAAU,EAAGA,UAAY;IACzBlB,MAAM,EAAGA,MAAQ;IACjBH,eAAe,EAAGA,eAAiB;IACnCC,kBAAkB,EAAGA,kBAAoB;IACzCC,cAAc,EAAGoC,WAAW,CAAE,CAAC,CAAE,EAAE5C;EAAW,CAC9C,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useState","memo","useSelect","__","BlockContextProvider","useBlockProps","useInnerBlocksProps","store","blockEditorStore","__experimentalUseBlockPreview","useBlockPreview","Spinner","coreStore","useCommentQueryArgs","useCommentTree","jsx","_jsx","jsxs","_jsxs","TEMPLATE","getCommentsPlaceholder","perPage","pageComments","threadComments","threadCommentsDepth","commentsDepth","Math","min","buildChildrenComment","commentsLevel","nextLevel","commentId","children","placeholderComments","push","CommentTemplateInnerBlocks","comment","activeCommentId","setActiveCommentId","firstCommentId","blocks","innerBlocksProps","template","MemoizedCommentTemplatePreview","isHidden","length","CommentsList","comments","CommentTemplatePreview","blockPreviewProps","handleOnClick","style","display","undefined","tabIndex","role","onClick","onKeyPress","blockProps","map","index","value","CommentTemplateEdit","clientId","context","postId","commentOrder","commentsPerPage","select","getSettings","__experimentalDiscussionSettings","commentQuery","topLevelComments","getEntityRecords","getBlocks","commentTree","reverse"],"sources":["@wordpress/block-library/src/comment-template/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, memo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockContextProvider,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { Spinner } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useCommentQueryArgs, useCommentTree } from './hooks';\n\nconst TEMPLATE = [\n\t[ 'core/avatar' ],\n\t[ 'core/comment-author-name' ],\n\t[ 'core/comment-date' ],\n\t[ 'core/comment-content' ],\n\t[ 'core/comment-reply-link' ],\n\t[ 'core/comment-edit-link' ],\n];\n\n/**\n * Function that returns a comment structure that will be rendered with default placehoders.\n *\n * Each comment has a `commentId` property that is always a negative number in\n * case of the placeholders. This is to ensure that the comment does not\n * conflict with the actual (real) comments.\n *\n * @param {Object} settings Discussion Settings.\n * @param {number} [settings.perPage] - Comments per page setting or block attribute.\n * @param {boolean} [settings.pageComments] - Enable break comments into pages setting.\n * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.\n * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.\n *\n * @typedef {{id: null, children: EmptyComment[]}} EmptyComment\n * @return {EmptyComment[]} \t\tInner blocks of the Comment Template\n */\nconst getCommentsPlaceholder = ( {\n\tperPage,\n\tpageComments,\n\tthreadComments,\n\tthreadCommentsDepth,\n} ) => {\n\t// Limit commentsDepth to 3\n\tconst commentsDepth = ! threadComments\n\t\t? 1\n\t\t: Math.min( threadCommentsDepth, 3 );\n\n\tconst buildChildrenComment = ( commentsLevel ) => {\n\t\t// Render children comments until commentsDepth is reached\n\t\tif ( commentsLevel < commentsDepth ) {\n\t\t\tconst nextLevel = commentsLevel + 1;\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tcommentId: -( commentsLevel + 3 ),\n\t\t\t\t\tchildren: buildChildrenComment( nextLevel ),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\treturn [];\n\t};\n\n\t// Add the first comment and its children\n\tconst placeholderComments = [\n\t\t{ commentId: -1, children: buildChildrenComment( 1 ) },\n\t];\n\n\t// Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max\n\tif ( ( ! pageComments || perPage >= 2 ) && commentsDepth < 3 ) {\n\t\tplaceholderComments.push( {\n\t\t\tcommentId: -2,\n\t\t\tchildren: [],\n\t\t} );\n\t}\n\n\t// Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments\n\tif ( ( ! pageComments || perPage >= 3 ) && commentsDepth < 2 ) {\n\t\tplaceholderComments.push( {\n\t\t\tcommentId: -3,\n\t\t\tchildren: [],\n\t\t} );\n\t}\n\n\t// In case that the value is set but larger than 3 we truncate it to 3.\n\treturn placeholderComments;\n};\n\n/**\n * Component which renders the inner blocks of the Comment Template.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.comment] - A comment object.\n * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.\n * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.\n * @param {Array} [props.firstCommentId] - ID of the first comment in the array.\n * @param {Array} [props.blocks] - Array of blocks returned from\n * getBlocks() in parent .\n * @return {Element} \t\tInner blocks of the Comment Template\n */\nfunction CommentTemplateInnerBlocks( {\n\tcomment,\n\tactiveCommentId,\n\tsetActiveCommentId,\n\tfirstCommentId,\n\tblocks,\n} ) {\n\tconst { children, ...innerBlocksProps } = useInnerBlocksProps(\n\t\t{},\n\t\t{ template: TEMPLATE }\n\t);\n\n\treturn (\n\t\t<li { ...innerBlocksProps }>\n\t\t\t{ comment.commentId === ( activeCommentId || firstCommentId )\n\t\t\t\t? children\n\t\t\t\t: null }\n\n\t\t\t{ /* To avoid flicker when switching active block contexts, a preview\n\t\t\t is ALWAYS rendered and the preview for the active block is hidden.\n\t\t\t This ensures that when switching the active block, the component is not\n\t\t\t mounted again but rather it only toggles the `isHidden` prop.\n\t\t\t The same strategy is used for preventing the flicker in the Post Template\n\t\t\t block. */ }\n\t\t\t<MemoizedCommentTemplatePreview\n\t\t\t\tblocks={ blocks }\n\t\t\t\tcommentId={ comment.commentId }\n\t\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\t\tisHidden={\n\t\t\t\t\tcomment.commentId === ( activeCommentId || firstCommentId )\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ comment?.children?.length > 0 ? (\n\t\t\t\t<CommentsList\n\t\t\t\t\tcomments={ comment.children }\n\t\t\t\t\tactiveCommentId={ activeCommentId }\n\t\t\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tfirstCommentId={ firstCommentId }\n\t\t\t\t/>\n\t\t\t) : null }\n\t\t</li>\n\t);\n}\n\nconst CommentTemplatePreview = ( {\n\tblocks,\n\tcommentId,\n\tsetActiveCommentId,\n\tisHidden,\n} ) => {\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t} );\n\n\tconst handleOnClick = () => {\n\t\tsetActiveCommentId( commentId );\n\t};\n\n\t// We have to hide the preview block if the `comment` props points to\n\t// the curently active block!\n\n\t// Or, to put it differently, every preview block is visible unless it is the\n\t// currently active block - in this case we render its inner blocks.\n\tconst style = {\n\t\tdisplay: isHidden ? 'none' : undefined,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\t{ ...blockPreviewProps }\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\tstyle={ style }\n\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n\t\t\tonClick={ handleOnClick }\n\t\t\tonKeyPress={ handleOnClick }\n\t\t/>\n\t);\n};\n\nconst MemoizedCommentTemplatePreview = memo( CommentTemplatePreview );\n\n/**\n * Component that renders a list of (nested) comments. It is called recursively.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.comments] - Array of comment objects.\n * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.\n * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.\n * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.\n * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.\n * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of\n * comment objects.\n * @return {Element} \t\tList of comments.\n */\nconst CommentsList = ( {\n\tcomments,\n\tblockProps,\n\tactiveCommentId,\n\tsetActiveCommentId,\n\tblocks,\n\tfirstCommentId,\n} ) => (\n\t<ol { ...blockProps }>\n\t\t{ comments &&\n\t\t\tcomments.map( ( { commentId, ...comment }, index ) => (\n\t\t\t\t<BlockContextProvider\n\t\t\t\t\tkey={ comment.commentId || index }\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t// If the commentId is negative it means that this comment is a\n\t\t\t\t\t\t// \"placeholder\" and that the block is most likely being used in the\n\t\t\t\t\t\t// site editor. In this case, we have to set the commentId to `null`\n\t\t\t\t\t\t// because otherwise the (non-existent) comment with a negative ID\n\t\t\t\t\t\t// would be reqested from the REST API.\n\t\t\t\t\t\tcommentId: commentId < 0 ? null : commentId,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<CommentTemplateInnerBlocks\n\t\t\t\t\t\tcomment={ { commentId, ...comment } }\n\t\t\t\t\t\tactiveCommentId={ activeCommentId }\n\t\t\t\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tfirstCommentId={ firstCommentId }\n\t\t\t\t\t/>\n\t\t\t\t</BlockContextProvider>\n\t\t\t) ) }\n\t</ol>\n);\n\nexport default function CommentTemplateEdit( {\n\tclientId,\n\tcontext: { postId },\n} ) {\n\tconst blockProps = useBlockProps();\n\n\tconst [ activeCommentId, setActiveCommentId ] = useState();\n\tconst {\n\t\tcommentOrder,\n\t\tthreadCommentsDepth,\n\t\tthreadComments,\n\t\tcommentsPerPage,\n\t\tpageComments,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalDiscussionSettings;\n\t} );\n\n\tconst commentQuery = useCommentQueryArgs( {\n\t\tpostId,\n\t} );\n\n\tconst { topLevelComments, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\t// Request only top-level comments. Replies are embedded.\n\t\t\t\ttopLevelComments: commentQuery\n\t\t\t\t\t? getEntityRecords( 'root', 'comment', commentQuery )\n\t\t\t\t\t: null,\n\t\t\t\tblocks: getBlocks( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, commentQuery ]\n\t);\n\n\t// Generate a tree structure of comment IDs.\n\tlet commentTree = useCommentTree(\n\t\t// Reverse the order of top comments if needed.\n\t\tcommentOrder === 'desc' && topLevelComments\n\t\t\t? [ ...topLevelComments ].reverse()\n\t\t\t: topLevelComments\n\t);\n\n\tif ( ! topLevelComments ) {\n\t\treturn (\n\t\t\t<p { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</p>\n\t\t);\n\t}\n\n\tif ( ! postId ) {\n\t\tcommentTree = getCommentsPlaceholder( {\n\t\t\tperPage: commentsPerPage,\n\t\t\tpageComments,\n\t\t\tthreadComments,\n\t\t\tthreadCommentsDepth,\n\t\t} );\n\t}\n\n\tif ( ! commentTree.length ) {\n\t\treturn <p { ...blockProps }>{ __( 'No results found.' ) }</p>;\n\t}\n\n\treturn (\n\t\t<CommentsList\n\t\t\tcomments={ commentTree }\n\t\t\tblockProps={ blockProps }\n\t\t\tblocks={ blocks }\n\t\t\tactiveCommentId={ activeCommentId }\n\t\t\tsetActiveCommentId={ setActiveCommentId }\n\t\t\tfirstCommentId={ commentTree[ 0 ]?.commentId }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,IAAI,QAAQ,oBAAoB;AACnD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C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SAAS,CAAEX,QAAS;IAC7B,CAAC;EACF,CAAC,EACD,CAAEA,QAAQ,EAAEQ,YAAY,CACzB,CAAC;;EAED;EACA,IAAII,WAAW,GAAG7D,cAAc;EAC/B;EACAoD,YAAY,KAAK,MAAM,IAAIM,gBAAgB,GACxC,CAAE,GAAGA,gBAAgB,CAAE,CAACI,OAAO,CAAC,CAAC,GACjCJ,gBACJ,CAAC;EAED,IAAK,CAAEA,gBAAgB,EAAG;IACzB,oBACCxD,IAAA;MAAA,GAAQ0C,UAAU;MAAA1B,QAAA,eACjBhB,IAAA,CAACL,OAAO,IAAE;IAAC,CACT,CAAC;EAEN;EAEA,IAAK,CAAEsD,MAAM,EAAG;IACfU,WAAW,GAAGvD,sBAAsB,CAAE;MACrCC,OAAO,EAAE8C,eAAe;MACxB7C,YAAY;MACZC,cAAc;MACdC;IACD,CAAE,CAAC;EACJ;EAEA,IAAK,CAAEmD,WAAW,CAAC9B,MAAM,EAAG;IAC3B,oBAAO7B,IAAA;MAAA,GAAQ0C,UAAU;MAAA1B,QAAA,EAAK7B,EAAE,CAAE,mBAAoB;IAAC,CAAK,CAAC;EAC9D;EAEA,oBACCa,IAAA,CAAC8B,YAAY;IACZC,QAAQ,EAAG4B,WAAa;IACxBjB,UAAU,EAAGA,UAAY;IACzBlB,MAAM,EAAGA,MAAQ;IACjBH,eAAe,EAAGA,eAAiB;IACnCC,kBAAkB,EAAGA,kBAAoB;IACzCC,cAAc,EAAGoC,WAAW,CAAE,CAAC,CAAE,EAAE5C;EAAW,CAC9C,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useEffect","useMemo","useSelect","store","blockEditorStore","addQueryArgs","apiFetch","MAX_COMMENTS_PER_PAGE","useCommentQueryArgs","postId","queryArgs","status","order","context","parent","_embed","pageComments","commentsPerPage","defaultCommentsPage","defaultPage","select","getSettings","__experimentalDiscussionSettings","perPage","Math","min","page","useDefaultPageIndex","post","per_page","defaultPages","setDefaultPages","key","path","_fields","method","parse","then","res","pages","parseInt","headers","get","useCommentTree","topLevelComments","commentTree","map","id","_embedded","children","commentId","child"],"sources":["@wordpress/block-library/src/comment-template/hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\n\n// This is limited by WP REST API\nconst MAX_COMMENTS_PER_PAGE = 100;\n\n/**\n * Return an object with the query args needed to fetch the default page of\n * comments.\n *\n * @param {Object} props Hook props.\n * @param {number} props.postId ID of the post that contains the comments.\n * discussion settings.\n *\n * @return {Object} Query args to retrieve the comments.\n */\nexport const useCommentQueryArgs = ( { postId } ) => {\n\t// Initialize the query args that are not going to change.\n\tconst queryArgs = {\n\t\tstatus: 'approve',\n\t\torder: 'asc',\n\t\tcontext: 'embed',\n\t\tparent: 0,\n\t\t_embed: 'children',\n\t};\n\n\t// Get the Discussion settings that may be needed to query the comments.\n\tconst {\n\t\tpageComments,\n\t\tcommentsPerPage,\n\t\tdefaultCommentsPage: defaultPage,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings;\n\t} );\n\n\t// WP REST API doesn't allow fetching more than max items limit set per single page of data.\n\t// As for the editor performance is more important than completeness of data and fetching only the\n\t// max allowed for single page should be enough for the purpose of design and laying out the page.\n\t// Fetching over the limit would return an error here but would work with backend query.\n\tconst perPage = pageComments\n\t\t? Math.min( commentsPerPage, MAX_COMMENTS_PER_PAGE )\n\t\t: MAX_COMMENTS_PER_PAGE;\n\n\t// Get the number of the default page.\n\tconst page = useDefaultPageIndex( {\n\t\tdefaultPage,\n\t\tpostId,\n\t\tperPage,\n\t\tqueryArgs,\n\t} );\n\n\t// Merge, memoize and return all query arguments, unless the default page's\n\t// number is not known yet.\n\treturn useMemo( () => {\n\t\treturn page\n\t\t\t? {\n\t\t\t\t\t...queryArgs,\n\t\t\t\t\tpost: postId,\n\t\t\t\t\tper_page: perPage,\n\t\t\t\t\tpage,\n\t\t\t }\n\t\t\t: null;\n\t}, [ postId, perPage, page ] );\n};\n\n/**\n * Return the index of the default page, depending on whether `defaultPage` is\n * `newest` or `oldest`. In the first case, the only way to know the page's\n * index is by using the `X-WP-TotalPages` header, which forces to make an\n * additional request.\n *\n * @param {Object} props Hook props.\n * @param {string} props.defaultPage Page shown by default (newest/oldest).\n * @param {number} props.postId ID of the post that contains the comments.\n * @param {number} props.perPage The number of comments included per page.\n * @param {Object} props.queryArgs Other query args.\n *\n * @return {number} Index of the default comments page.\n */\nconst useDefaultPageIndex = ( { defaultPage, postId, perPage, queryArgs } ) => {\n\t// Store the default page indices.\n\tconst [ defaultPages, setDefaultPages ] = useState( {} );\n\tconst key = `${ postId }_${ perPage }`;\n\tconst page = defaultPages[ key ] || 0;\n\n\tuseEffect( () => {\n\t\t// Do nothing if the page is already known or not the newest page.\n\t\tif ( page || defaultPage !== 'newest' ) {\n\t\t\treturn;\n\t\t}\n\t\t// We need to fetch comments to know the index. Use HEAD and limit\n\t\t// fields just to ID, to make this call as light as possible.\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\t...queryArgs,\n\t\t\t\tpost: postId,\n\t\t\t\tper_page: perPage,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\tconst pages = parseInt( res.headers.get( 'X-WP-TotalPages' ) );\n\t\t\tsetDefaultPages( {\n\t\t\t\t...defaultPages,\n\t\t\t\t[ key ]: pages <= 1 ? 1 : pages, // If there are 0 pages, it means that there are no comments, but there is no 0th page.\n\t\t\t} );\n\t\t} );\n\t}, [ defaultPage, postId, perPage, setDefaultPages ] );\n\n\t// The oldest one is always the first one.\n\treturn defaultPage === 'newest' ? page : 1;\n};\n\n/**\n * Generate a tree structure of comment IDs from a list of comment entities. The\n * children of each comment are obtained from `_embedded`.\n *\n * @typedef {{ commentId: number, children: CommentNode }} CommentNode\n *\n * @param {Object[]} topLevelComments List of comment entities.\n * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.\n */\nexport const useCommentTree = ( topLevelComments ) => {\n\tconst commentTree = useMemo(\n\t\t() =>\n\t\t\ttopLevelComments?.map( ( { id, _embedded } ) => {\n\t\t\t\tconst [ children ] = _embedded?.children || [ [] ];\n\t\t\t\treturn {\n\t\t\t\t\tcommentId: id,\n\t\t\t\t\tchildren: children.map( ( child ) => ( {\n\t\t\t\t\t\tcommentId: child.id,\n\t\t\t\t\t} ) ),\n\t\t\t\t};\n\t\t\t} ),\n\t\t[ topLevelComments ]\n\t);\n\n\treturn commentTree;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACjE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,OAAOC,QAAQ,MAAM,sBAAsB;;AAE3C;AACA,MAAMC,qBAAqB,GAAG,GAAG;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGA,CAAE;EAAEC;AAAO,CAAC,KAAM;EACpD;EACA,MAAMC,SAAS,GAAG;IACjBC,MAAM,EAAE,SAAS;IACjBC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,OAAO;IAChBC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE;EACT,CAAC;;EAED;EACA,MAAM;IACLC,YAAY;IACZC,eAAe;IACfC,mBAAmB,EAAEC;EACtB,CAAC,GAAGjB,SAAS,CAAIkB,MAAM,IAAM;IAC5B,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEhB,gBAAiB,CAAC;IAClD,MAAM;MAAEkB;IAAiC,CAAC,GAAGD,WAAW,CAAC,CAAC;IAC1D,OAAOC,gCAAgC;EACxC,CAAE,CAAC;;EAEH;EACA;EACA;EACA;EACA,MAAMC,OAAO,GAAGP,YAAY,GACzBQ,IAAI,CAACC,GAAG,CAAER,eAAe,EAAEV,qBAAsB,CAAC,GAClDA,qBAAqB;;EAExB;EACA,MAAMmB,IAAI,GAAGC,mBAAmB,CAAE;IACjCR,WAAW;IACXV,MAAM;IACNc,OAAO;IACPb;EACD,CAAE,CAAC;;EAEH;EACA;EACA,OAAOT,OAAO,CAAE,MAAM;IACrB,OAAOyB,IAAI,GACR;MACA,GAAGhB,SAAS;MACZkB,IAAI,EAAEnB,MAAM;MACZoB,QAAQ,EAAEN,OAAO;MACjBG;IACA,CAAC,GACD,IAAI;EACR,CAAC,EAAE,CAAEjB,MAAM,EAAEc,OAAO,EAAEG,IAAI,CAAG,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAAE;EAAER,WAAW;EAAEV,MAAM;EAAEc,OAAO;EAAEb;AAAU,CAAC,KAAM;EAC9E;EACA,MAAM,CAAEoB,YAAY,EAAEC,eAAe,CAAE,GAAGhC,QAAQ,CAAE,CAAC,CAAE,CAAC;EACxD,MAAMiC,GAAG,
|
|
1
|
+
{"version":3,"names":["useState","useEffect","useMemo","useSelect","store","blockEditorStore","addQueryArgs","apiFetch","MAX_COMMENTS_PER_PAGE","useCommentQueryArgs","postId","queryArgs","status","order","context","parent","_embed","pageComments","commentsPerPage","defaultCommentsPage","defaultPage","select","getSettings","__experimentalDiscussionSettings","perPage","Math","min","page","useDefaultPageIndex","post","per_page","defaultPages","setDefaultPages","key","path","_fields","method","parse","then","res","pages","parseInt","headers","get","useCommentTree","topLevelComments","commentTree","map","id","_embedded","children","commentId","child"],"sources":["@wordpress/block-library/src/comment-template/hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\n\n// This is limited by WP REST API\nconst MAX_COMMENTS_PER_PAGE = 100;\n\n/**\n * Return an object with the query args needed to fetch the default page of\n * comments.\n *\n * @param {Object} props Hook props.\n * @param {number} props.postId ID of the post that contains the comments.\n * discussion settings.\n *\n * @return {Object} Query args to retrieve the comments.\n */\nexport const useCommentQueryArgs = ( { postId } ) => {\n\t// Initialize the query args that are not going to change.\n\tconst queryArgs = {\n\t\tstatus: 'approve',\n\t\torder: 'asc',\n\t\tcontext: 'embed',\n\t\tparent: 0,\n\t\t_embed: 'children',\n\t};\n\n\t// Get the Discussion settings that may be needed to query the comments.\n\tconst {\n\t\tpageComments,\n\t\tcommentsPerPage,\n\t\tdefaultCommentsPage: defaultPage,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings;\n\t} );\n\n\t// WP REST API doesn't allow fetching more than max items limit set per single page of data.\n\t// As for the editor performance is more important than completeness of data and fetching only the\n\t// max allowed for single page should be enough for the purpose of design and laying out the page.\n\t// Fetching over the limit would return an error here but would work with backend query.\n\tconst perPage = pageComments\n\t\t? Math.min( commentsPerPage, MAX_COMMENTS_PER_PAGE )\n\t\t: MAX_COMMENTS_PER_PAGE;\n\n\t// Get the number of the default page.\n\tconst page = useDefaultPageIndex( {\n\t\tdefaultPage,\n\t\tpostId,\n\t\tperPage,\n\t\tqueryArgs,\n\t} );\n\n\t// Merge, memoize and return all query arguments, unless the default page's\n\t// number is not known yet.\n\treturn useMemo( () => {\n\t\treturn page\n\t\t\t? {\n\t\t\t\t\t...queryArgs,\n\t\t\t\t\tpost: postId,\n\t\t\t\t\tper_page: perPage,\n\t\t\t\t\tpage,\n\t\t\t }\n\t\t\t: null;\n\t}, [ postId, perPage, page ] );\n};\n\n/**\n * Return the index of the default page, depending on whether `defaultPage` is\n * `newest` or `oldest`. In the first case, the only way to know the page's\n * index is by using the `X-WP-TotalPages` header, which forces to make an\n * additional request.\n *\n * @param {Object} props Hook props.\n * @param {string} props.defaultPage Page shown by default (newest/oldest).\n * @param {number} props.postId ID of the post that contains the comments.\n * @param {number} props.perPage The number of comments included per page.\n * @param {Object} props.queryArgs Other query args.\n *\n * @return {number} Index of the default comments page.\n */\nconst useDefaultPageIndex = ( { defaultPage, postId, perPage, queryArgs } ) => {\n\t// Store the default page indices.\n\tconst [ defaultPages, setDefaultPages ] = useState( {} );\n\tconst key = `${ postId }_${ perPage }`;\n\tconst page = defaultPages[ key ] || 0;\n\n\tuseEffect( () => {\n\t\t// Do nothing if the page is already known or not the newest page.\n\t\tif ( page || defaultPage !== 'newest' ) {\n\t\t\treturn;\n\t\t}\n\t\t// We need to fetch comments to know the index. Use HEAD and limit\n\t\t// fields just to ID, to make this call as light as possible.\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\t...queryArgs,\n\t\t\t\tpost: postId,\n\t\t\t\tper_page: perPage,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\tconst pages = parseInt( res.headers.get( 'X-WP-TotalPages' ) );\n\t\t\tsetDefaultPages( {\n\t\t\t\t...defaultPages,\n\t\t\t\t[ key ]: pages <= 1 ? 1 : pages, // If there are 0 pages, it means that there are no comments, but there is no 0th page.\n\t\t\t} );\n\t\t} );\n\t}, [ defaultPage, postId, perPage, setDefaultPages ] );\n\n\t// The oldest one is always the first one.\n\treturn defaultPage === 'newest' ? page : 1;\n};\n\n/**\n * Generate a tree structure of comment IDs from a list of comment entities. The\n * children of each comment are obtained from `_embedded`.\n *\n * @typedef {{ commentId: number, children: CommentNode }} CommentNode\n *\n * @param {Object[]} topLevelComments List of comment entities.\n * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.\n */\nexport const useCommentTree = ( topLevelComments ) => {\n\tconst commentTree = useMemo(\n\t\t() =>\n\t\t\ttopLevelComments?.map( ( { id, _embedded } ) => {\n\t\t\t\tconst [ children ] = _embedded?.children || [ [] ];\n\t\t\t\treturn {\n\t\t\t\t\tcommentId: id,\n\t\t\t\t\tchildren: children.map( ( child ) => ( {\n\t\t\t\t\t\tcommentId: child.id,\n\t\t\t\t\t} ) ),\n\t\t\t\t};\n\t\t\t} ),\n\t\t[ topLevelComments ]\n\t);\n\n\treturn commentTree;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACjE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,OAAOC,QAAQ,MAAM,sBAAsB;;AAE3C;AACA,MAAMC,qBAAqB,GAAG,GAAG;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGA,CAAE;EAAEC;AAAO,CAAC,KAAM;EACpD;EACA,MAAMC,SAAS,GAAG;IACjBC,MAAM,EAAE,SAAS;IACjBC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,OAAO;IAChBC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE;EACT,CAAC;;EAED;EACA,MAAM;IACLC,YAAY;IACZC,eAAe;IACfC,mBAAmB,EAAEC;EACtB,CAAC,GAAGjB,SAAS,CAAIkB,MAAM,IAAM;IAC5B,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEhB,gBAAiB,C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AO,EAAE;MACV,CAAE,CAAC;MACHC,MAAM,EAAE,MAAM;MACdC,KAAK,EAAE;IACR,CAAE,CAAC,CAACC,IAAI,CAAIC,GAAG,IAAM;MACpB,MAAMC,KAAK,GAAGC,QAAQ,CAAEF,GAAG,CAACG,OAAO,CAACC,GAAG,CAAE,iBAAkB,CAAE,CAAC;MAC9DX,eAAe,CAAE;QAChB,GAAGD,YAAY;QACf,CAAEE,GAAG,GAAIO,KAAK,IAAI,CAAC,GAAG,CAAC,GAAGA,KAAK,CAAE;MAClC,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEpB,WAAW,EAAEV,MAAM,EAAEc,OAAO,EAAEQ,eAAe,CAAG,CAAC;;EAEtD;EACA,OAAOZ,WAAW,KAAK,QAAQ,GAAGO,IAAI,GAAG,CAAC;AAC3C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiB,cAAc,GAAKC,gBAAgB,IAAM;EACrD,MAAMC,WAAW,GAAG5C,OAAO,CAC1B,MACC2C,gBAAgB,EAAEE,GAAG,CAAE,CAAE;IAAEC,EAAE;IAAEC;EAAU,CAAC,KAAM;IAC/C,MAAM,CAAEC,QAAQ,CAAE,GAAGD,SAAS,EAAEC,QAAQ,IAAI,CAAE,EAAE,CAAE;IAClD,OAAO;MACNC,SAAS,EAAEH,EAAE;MACbE,QAAQ,EAAEA,QAAQ,CAACH,GAAG,CAAIK,KAAK,KAAQ;QACtCD,SAAS,EAAEC,KAAK,CAACJ;MAClB,CAAC,CAAG;IACL,CAAC;EACF,CAAE,CAAC,EACJ,CAAEH,gBAAgB,CACnB,CAAC;EAED,OAAOC,WAAW;AACnB,CAAC","ignoreList":[]}
|
|
@@ -14,9 +14,7 @@ import { Button } from '@wordpress/components';
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import Placeholder from './placeholder';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
18
|
export default function CommentsLegacy({
|
|
21
19
|
attributes,
|
|
22
20
|
setAttributes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","AlignmentControl","BlockControls","Warning","useBlockProps","__","Button","Placeholder","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CommentsLegacy","attributes","setAttributes","context","postType","postId","textAlign","actions","__next40pxDefaultSize","onClick","legacy","variant","children","blockProps","className","group","value","onChange","nextAlign"],"sources":["@wordpress/block-library/src/comments/edit/comments-legacy.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport Placeholder from './placeholder';\n\nexport default function CommentsLegacy( {\n\tattributes,\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst { textAlign } = attributes;\n\n\tconst actions = [\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tkey=\"convert\"\n\t\t\tonClick={ () => void setAttributes( { legacy: false } ) }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ __( 'Switch to editable mode' ) }\n\t\t</Button>,\n\t];\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning actions={ actions }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Comments block: You’re currently using the legacy version of the block. ' +\n\t\t\t\t\t\t\t'The following is just a placeholder - the final styling will likely look different. ' +\n\t\t\t\t\t\t\t'For a better representation and more customization options, ' +\n\t\t\t\t\t\t\t'switch the block to its editable mode.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t\t<Placeholder postId={ postId } postType={ postType } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,aAAa,EACbC,OAAO,EACPC,aAAa,QACP,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","AlignmentControl","BlockControls","Warning","useBlockProps","__","Button","Placeholder","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CommentsLegacy","attributes","setAttributes","context","postType","postId","textAlign","actions","__next40pxDefaultSize","onClick","legacy","variant","children","blockProps","className","group","value","onChange","nextAlign"],"sources":["@wordpress/block-library/src/comments/edit/comments-legacy.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport Placeholder from './placeholder';\n\nexport default function CommentsLegacy( {\n\tattributes,\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst { textAlign } = attributes;\n\n\tconst actions = [\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tkey=\"convert\"\n\t\t\tonClick={ () => void setAttributes( { legacy: false } ) }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ __( 'Switch to editable mode' ) }\n\t\t</Button>,\n\t];\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning actions={ actions }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Comments block: You’re currently using the legacy version of the block. ' +\n\t\t\t\t\t\t\t'The following is just a placeholder - the final styling will likely look different. ' +\n\t\t\t\t\t\t\t'For a better representation and more customization options, ' +\n\t\t\t\t\t\t\t'switch the block to its editable mode.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t\t<Placeholder postId={ postId } postType={ postType } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,aAAa,EACbC,OAAO,EACPC,aAAa,QACP,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAA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|
|
@@ -9,9 +9,7 @@ import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
|
|
|
9
9
|
import CommentsInspectorControls from './comments-inspector-controls';
|
|
10
10
|
import CommentsLegacy from './comments-legacy';
|
|
11
11
|
import TEMPLATE from './template';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
13
|
export default function CommentsEdit(props) {
|
|
16
14
|
const {
|
|
17
15
|
attributes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useBlockProps","useInnerBlocksProps","CommentsInspectorControls","CommentsLegacy","TEMPLATE","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","CommentsEdit","props","attributes","setAttributes","tagName","TagName","legacy","blockProps","innerBlocksProps","template","children"],"sources":["@wordpress/block-library/src/comments/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentsInspectorControls from './comments-inspector-controls';\nimport CommentsLegacy from './comments-legacy';\nimport TEMPLATE from './template';\n\nexport default function CommentsEdit( props ) {\n\tconst { attributes, setAttributes } = props;\n\tconst { tagName: TagName, legacy } = attributes;\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tif ( legacy ) {\n\t\treturn <CommentsLegacy { ...props } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommentsInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t/>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,yBAAyB;;AAE5E;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,+BAA+B;AACrE,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,QAAQ,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useBlockProps","useInnerBlocksProps","CommentsInspectorControls","CommentsLegacy","TEMPLATE","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","CommentsEdit","props","attributes","setAttributes","tagName","TagName","legacy","blockProps","innerBlocksProps","template","children"],"sources":["@wordpress/block-library/src/comments/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentsInspectorControls from './comments-inspector-controls';\nimport CommentsLegacy from './comments-legacy';\nimport TEMPLATE from './template';\n\nexport default function CommentsEdit( props ) {\n\tconst { attributes, setAttributes } = props;\n\tconst { tagName: TagName, legacy } = attributes;\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tif ( legacy ) {\n\t\treturn <CommentsLegacy { ...props } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommentsInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t/>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,yBAAyB;;AAE5E;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,+BAA+B;AACrE,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,QAAQ,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAElC,eAAe,SAASC,YAAYA,CAAEC,KAAK,EAAG;EAC7C,MAAM;IAAEC,UAAU;IAAEC;EAAc,CAAC,GAAGF,KAAK;EAC3C,MAAM;IAAEG,OAAO,EAAEC,OAAO;IAAEC;EAAO,CAAC,GAAGJ,UAAU;EAE/C,MAAMK,UAAU,GAAGlB,aAAa,CAAC,CAAC;EAClC,MAAMmB,gBAAgB,GAAGlB,mBAAmB,CAAEiB,UAAU,EAAE;IACzDE,QAAQ,EAAEhB;EACX,CAAE,CAAC;EAEH,IAAKa,MAAM,EAAG;IACb,oBAAOX,IAAA,CAACH,cAAc;MAAA,GAAMS;IAAK,CAAI,CAAC;EACvC;EAEA,oBACCF,KAAA,CAAAF,SAAA;IAAAa,QAAA,gBACCf,IAAA,CAACJ,yBAAyB;MACzBW,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA;IAAe,CAC/B,CAAC,eACFR,IAAA,CAACU,OAAO;MAAA,GAAMG;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -11,8 +11,7 @@ import { createInterpolateElement } from '@wordpress/element';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import CommentsForm from '../../post-comments-form/form';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
15
|
export default function PostCommentsPlaceholder({
|
|
17
16
|
postType,
|
|
18
17
|
postId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blockEditorStore","__","sprintf","useSelect","useEntityProp","createInterpolateElement","CommentsForm","jsx","_jsx","jsxs","_jsxs","PostCommentsPlaceholder","postType","postId","postTitle","avatarURL","select","getSettings","__experimentalDiscussionSettings","className","inert","children","href","alt","src","height","width","loading","dateTime","a"],"sources":["@wordpress/block-library/src/comments/edit/placeholder.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport CommentsForm from '../../post-comments-form/form';\n\nexport default function PostCommentsPlaceholder( { postType, postId } ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst { avatarURL } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\treturn (\n\t\t<div className=\"wp-block-comments__legacy-placeholder\" inert=\"true\">\n\t\t\t<h3>\n\t\t\t\t{\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tsprintf( __( 'One response to %s' ), postTitle )\n\t\t\t\t}\n\t\t\t</h3>\n\n\t\t\t<div className=\"navigation\">\n\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<ol className=\"commentlist\">\n\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ __( 'Commenter Avatar' ) }\n\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<b className=\"fn\">\n\t\t\t\t\t\t\t\t\t<a href=\"#top\" className=\"url\">\n\t\t\t\t\t\t\t\t\t\t{ __( 'A WordPress Commenter' ) }\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</b>{ ' ' }\n\t\t\t\t\t\t\t\t<span className=\"says\">{ __( 'says' ) }:</span>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T00:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t{ __( 'January 1, 2000 at 00:00 am' ) }\n\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from <a>Gravatar</a>.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\" />\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t'Reply to A WordPress Commenter'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</article>\n\t\t\t\t</li>\n\t\t\t</ol>\n\n\t\t\t<div className=\"navigation\">\n\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<CommentsForm postId={ postId } postType={ postType } />\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,YAAY,MAAM,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["store","blockEditorStore","__","sprintf","useSelect","useEntityProp","createInterpolateElement","CommentsForm","jsx","_jsx","jsxs","_jsxs","PostCommentsPlaceholder","postType","postId","postTitle","avatarURL","select","getSettings","__experimentalDiscussionSettings","className","inert","children","href","alt","src","height","width","loading","dateTime","a"],"sources":["@wordpress/block-library/src/comments/edit/placeholder.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport CommentsForm from '../../post-comments-form/form';\n\nexport default function PostCommentsPlaceholder( { postType, postId } ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst { avatarURL } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\treturn (\n\t\t<div className=\"wp-block-comments__legacy-placeholder\" inert=\"true\">\n\t\t\t<h3>\n\t\t\t\t{\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tsprintf( __( 'One response to %s' ), postTitle )\n\t\t\t\t}\n\t\t\t</h3>\n\n\t\t\t<div className=\"navigation\">\n\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<ol className=\"commentlist\">\n\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ __( 'Commenter Avatar' ) }\n\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<b className=\"fn\">\n\t\t\t\t\t\t\t\t\t<a href=\"#top\" className=\"url\">\n\t\t\t\t\t\t\t\t\t\t{ __( 'A WordPress Commenter' ) }\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</b>{ ' ' }\n\t\t\t\t\t\t\t\t<span className=\"says\">{ __( 'says' ) }:</span>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T00:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t{ __( 'January 1, 2000 at 00:00 am' ) }\n\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from <a>Gravatar</a>.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\" />\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t'Reply to A WordPress Commenter'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</article>\n\t\t\t\t</li>\n\t\t\t</ol>\n\n\t\t\t<div className=\"navigation\">\n\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>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,CAAE,gBAAiB,CAAC,EAAE,OAAE;QAAA,CAAG;MAAC,CAC3C,CAAC;IAAA,CACF,CAAC,eAENO,IAAA,CAACF,YAAY;MAACO,MAAM,EAAGA,MAAQ;MAACD,QAAQ,EAAGA;IAAU,CAAE,CAAC;EAAA,CACpD,CAAC;AAER","ignoreList":[]}
|
|
@@ -54,6 +54,18 @@ const metadata = {
|
|
|
54
54
|
__experimentalDefaultControls: {
|
|
55
55
|
fontSize: true
|
|
56
56
|
}
|
|
57
|
+
},
|
|
58
|
+
__experimentalBorder: {
|
|
59
|
+
radius: true,
|
|
60
|
+
color: true,
|
|
61
|
+
width: true,
|
|
62
|
+
style: true,
|
|
63
|
+
__experimentalDefaultControls: {
|
|
64
|
+
radius: true,
|
|
65
|
+
color: true,
|
|
66
|
+
width: true,
|
|
67
|
+
style: true
|
|
68
|
+
}
|
|
57
69
|
}
|
|
58
70
|
},
|
|
59
71
|
editorStyle: "wp-block-comments-editor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["postComments","icon","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","tagName","type","legacy","supports","align","html","color","gradients","heading","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","editorStyle","usesContext","deprecated","edit","save","settings","init"],"sources":["@wordpress/block-library/src/comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postComments as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,IAAIC,IAAI,QAAQ,kBAAkB;;AAEvD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,MAAA;MAAAD,IAAA;MAAA;IAAA;EAAA;EAAAE,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,OAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["postComments","icon","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","tagName","type","legacy","supports","align","html","color","gradients","heading","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","editorStyle","usesContext","deprecated","edit","save","settings","init"],"sources":["@wordpress/block-library/src/comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postComments as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\t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GAAGA,CAAA,KAAM7C,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAE2C;AAAS,CAAE,CAAC","ignoreList":[]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import { __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption } from '@wordpress/components';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
7
|
export function CommentsPaginationArrowControls({
|
|
9
8
|
value,
|
|
10
9
|
onChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","jsx","_jsx","jsxs","_jsxs","CommentsPaginationArrowControls","value","onChange","__next40pxDefaultSize","__nextHasNoMarginBottom","label","help","isBlock","children"],"sources":["@wordpress/block-library/src/comments-pagination/comments-pagination-arrow-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\n\nexport function CommentsPaginationArrowControls( { value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'A decorative arrow appended to the next and previous comments link.'\n\t\t\t) }\n\t\t\tisBlock\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"none\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'None',\n\t\t\t\t\t'Arrow option for Comments Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"arrow\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Arrow',\n\t\t\t\t\t'Arrow option for Comments Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"chevron\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Chevron',\n\t\t\t\t\t'Arrow option for Comments Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,QAC5D,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","_x","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","jsx","_jsx","jsxs","_jsxs","CommentsPaginationArrowControls","value","onChange","__next40pxDefaultSize","__nextHasNoMarginBottom","label","help","isBlock","children"],"sources":["@wordpress/block-library/src/comments-pagination/comments-pagination-arrow-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\n\nexport function CommentsPaginationArrowControls( { value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'A decorative arrow appended to the next and previous comments link.'\n\t\t\t) }\n\t\t\tisBlock\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"none\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'None',\n\t\t\t\t\t'Arrow option for Comments Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"arrow\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Arrow',\n\t\t\t\t\t'Arrow option for Comments Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"chevron\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Chevron',\n\t\t\t\t\t'Arrow option for Comments Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,QAC5D,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/B,OAAO,SAASC,+BAA+BA,CAAE;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EACtE,oBACCH,KAAA,CAACN,kBAAkB;IAClBU,qBAAqB;IACrBC,uBAAuB;IACvBC,KAAK,EAAGf,EAAE,CAAE,OAAQ,CAAG;IACvBW,KAAK,EAAGA,KAAO;IACfC,QAAQ,EAAGA,QAAU;IACrBI,IAAI,EAAGhB,EAAE,CACR,qEACD,CAAG;IACHiB,OAAO;IAAAC,QAAA,gBAEPX,IAAA,CAACF,wBAAwB;MACxBM,KAAK,EAAC,MAAM;MACZI,KAAK,EAAGd,EAAE,CACT,MAAM,EACN,2DACD;IAAG,CACH,CAAC,eACFM,IAAA,CAACF,wBAAwB;MACxBM,KAAK,EAAC,OAAO;MACbI,KAAK,EAAGd,EAAE,CACT,OAAO,EACP,2DACD;IAAG,CACH,CAAC,eACFM,IAAA,CAACF,wBAAwB;MACxBM,KAAK,EAAC,SAAS;MACfI,KAAK,EAAGd,EAAE,CACT,SAAS,EACT,2DACD;IAAG,CACH,CAAC;EAAA,CACiB,CAAC;AAEvB","ignoreList":[]}
|
|
@@ -10,9 +10,7 @@ import { PanelBody } from '@wordpress/components';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { CommentsPaginationArrowControls } from './comments-pagination-arrow-controls';
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
14
|
const TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
|
|
17
15
|
export default function QueryPaginationEdit({
|
|
18
16
|
attributes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","InspectorControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","Warning","useSelect","PanelBody","CommentsPaginationArrowControls","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TEMPLATE","QueryPaginationEdit","attributes","paginationArrow","setAttributes","clientId","hasNextPreviousBlocks","select","getBlocks","innerBlocks","find","innerBlock","includes","name","blockProps","innerBlocksProps","template","pageComments","getSettings","__experimentalDiscussionSettings","children","title","value","onChange"],"sources":["@wordpress/block-library/src/comments-pagination/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { CommentsPaginationArrowControls } from './comments-pagination-arrow-controls';\n\nconst TEMPLATE = [\n\t[ 'core/comments-pagination-previous' ],\n\t[ 'core/comments-pagination-numbers' ],\n\t[ 'core/comments-pagination-next' ],\n];\n\nexport default function QueryPaginationEdit( {\n\tattributes: { paginationArrow },\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasNextPreviousBlocks = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst innerBlocks = getBlocks( clientId );\n\t\t/**\n\t\t * Show the `paginationArrow` control only if a\n\t\t * Comments Pagination Next or Comments Pagination Previous\n\t\t * block exists.\n\t\t */\n\t\treturn innerBlocks?.find( ( innerBlock ) => {\n\t\t\treturn [\n\t\t\t\t'core/comments-pagination-previous',\n\t\t\t\t'core/comments-pagination-next',\n\t\t\t].includes( innerBlock.name );\n\t\t} );\n\t}, [] );\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\t// Get the Discussion settings\n\tconst pageComments = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings?.pageComments;\n\t}, [] );\n\n\t// If paging comments is not enabled in the Discussion Settings then hide the pagination\n\t// controls. We don't want to remove them from the template so that when the user enables\n\t// paging comments, the controls will be visible.\n\tif ( ! pageComments ) {\n\t\treturn (\n\t\t\t<Warning>\n\t\t\t\t{ __(\n\t\t\t\t\t'Comments Pagination block: paging comments is disabled in the Discussion Settings'\n\t\t\t\t) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ hasNextPreviousBlocks && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<CommentsPaginationArrowControls\n\t\t\t\t\t\t\tvalue={ paginationArrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,aAAa,EACbC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,EACzBC,OAAO,QACD,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,QAAQ,uBAAuB;;AAEjD;AACA;AACA;AACA,SAASC,+BAA+B,QAAQ,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","InspectorControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","Warning","useSelect","PanelBody","CommentsPaginationArrowControls","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TEMPLATE","QueryPaginationEdit","attributes","paginationArrow","setAttributes","clientId","hasNextPreviousBlocks","select","getBlocks","innerBlocks","find","innerBlock","includes","name","blockProps","innerBlocksProps","template","pageComments","getSettings","__experimentalDiscussionSettings","children","title","value","onChange"],"sources":["@wordpress/block-library/src/comments-pagination/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { CommentsPaginationArrowControls } from './comments-pagination-arrow-controls';\n\nconst TEMPLATE = [\n\t[ 'core/comments-pagination-previous' ],\n\t[ 'core/comments-pagination-numbers' ],\n\t[ 'core/comments-pagination-next' ],\n];\n\nexport default function QueryPaginationEdit( {\n\tattributes: { paginationArrow },\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasNextPreviousBlocks = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst innerBlocks = getBlocks( clientId );\n\t\t/**\n\t\t * Show the `paginationArrow` control only if a\n\t\t * Comments Pagination Next or Comments Pagination Previous\n\t\t * block exists.\n\t\t */\n\t\treturn innerBlocks?.find( ( innerBlock ) => {\n\t\t\treturn [\n\t\t\t\t'core/comments-pagination-previous',\n\t\t\t\t'core/comments-pagination-next',\n\t\t\t].includes( innerBlock.name );\n\t\t} );\n\t}, [] );\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\t// Get the Discussion settings\n\tconst pageComments = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings?.pageComments;\n\t}, [] );\n\n\t// If paging comments is not enabled in the Discussion Settings then hide the pagination\n\t// controls. We don't want to remove them from the template so that when the user enables\n\t// paging comments, the controls will be visible.\n\tif ( ! pageComments ) {\n\t\treturn (\n\t\t\t<Warning>\n\t\t\t\t{ __(\n\t\t\t\t\t'Comments Pagination block: paging comments is disabled in the Discussion Settings'\n\t\t\t\t) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ hasNextPreviousBlocks && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<CommentsPaginationArrowControls\n\t\t\t\t\t\t\tvalue={ paginationArrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: value } );\n\t\t\t\t\t\t\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AAEhB;EACX,CAAE,CAAC;;EAEH;EACA,MAAMiB,YAAY,GAAG1B,SAAS,CAAIgB,MAAM,IAAM;IAC7C,MAAM;MAAEW;IAAY,CAAC,GAAGX,MAAM,CAAElB,gBAAiB,CAAC;IAClD,MAAM;MAAE8B;IAAiC,CAAC,GAAGD,WAAW,CAAC,CAAC;IAC1D,OAAOC,gCAAgC,EAAEF,YAAY;EACtD,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA;EACA;EACA,IAAK,CAAEA,YAAY,EAAG;IACrB,oBACCtB,IAAA,CAACL,OAAO;MAAA8B,QAAA,EACLpC,EAAE,CACH,mFACD;IAAC,CACO,CAAC;EAEZ;EAEA,oBACCe,KAAA,CAAAF,SAAA;IAAAuB,QAAA,GACGd,qBAAqB,iBACtBX,IAAA,CAACV,iBAAiB;MAAAmC,QAAA,eACjBzB,IAAA,CAACH,SAAS;QAAC6B,KAAK,EAAGrC,EAAE,CAAE,UAAW,CAAG;QAAAoC,QAAA,eACpCzB,IAAA,CAACF,+BAA+B;UAC/B6B,KAAK,EAAGnB,eAAiB;UACzBoB,QAAQ,EAAKD,KAAK,IAAM;YACvBlB,aAAa,CAAE;cAAED,eAAe,EAAEmB;YAAM,CAAE,CAAC;UAC5C;QAAG,CACH;MAAC,CACQ;IAAC,CACM,CACnB,eACD3B,IAAA;MAAA,GAAUoB;IAAgB,CAAI,CAAC;EAAA,CAC9B,CAAC;AAEL","ignoreList":[]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useBlockProps, PlainText } from '@wordpress/block-editor';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
7
|
const arrowMap = {
|
|
9
8
|
none: '',
|
|
10
9
|
arrow: '→',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useBlockProps","PlainText","jsx","_jsx","jsxs","_jsxs","arrowMap","none","arrow","chevron","CommentsPaginationNextEdit","attributes","label","setAttributes","context","paginationArrow","displayArrow","href","onClick","event","preventDefault","children","__experimentalVersion","tagName","placeholder","value","onChange","newLabel","className"],"sources":["@wordpress/block-library/src/comments-pagination-next/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '→',\n\tchevron: '»',\n};\n\nexport default function CommentsPaginationNextEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { 'comments/paginationArrow': paginationArrow },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#comments-pagination-next-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t<PlainText\n\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\ttagName=\"span\"\n\t\t\t\taria-label={ __( 'Newer comments page link' ) }\n\t\t\t\tplaceholder={ __( 'Newer Comments' ) }\n\t\t\t\tvalue={ label }\n\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-comments-pagination-next-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","useBlockProps","PlainText","jsx","_jsx","jsxs","_jsxs","arrowMap","none","arrow","chevron","CommentsPaginationNextEdit","attributes","label","setAttributes","context","paginationArrow","displayArrow","href","onClick","event","preventDefault","children","__experimentalVersion","tagName","placeholder","value","onChange","newLabel","className"],"sources":["@wordpress/block-library/src/comments-pagination-next/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '→',\n\tchevron: '»',\n};\n\nexport default function CommentsPaginationNextEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { 'comments/paginationArrow': paginationArrow },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#comments-pagination-next-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t<PlainText\n\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\ttagName=\"span\"\n\t\t\t\taria-label={ __( 'Newer comments page link' ) }\n\t\t\t\tplaceholder={ __( 'Newer Comments' ) }\n\t\t\t\tvalue={ label }\n\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-comments-pagination-next-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnE,MAAMC,QAAQ,GAAG;EAChBC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,GAAG;EACVC,OAAO,EAAE;AACV,CAAC;AAED,eAAe,SAASC,0BAA0BA,CAAE;EACnDC,UAAU,EAAE;IAAEC;EAAM,CAAC;EACrBC,aAAa;EACbC,OAAO,EAAE;IAAE,0BAA0B,EAAEC;EAAgB;AACxD,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGV,QAAQ,CAAES,eAAe,CAAE;EAChD,oBACCV,KAAA;IACCY,IAAI,EAAC,uCAAuC;IAC5CC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;IAAA,GAC1CpB,aAAa,CAAC,CAAC;IAAAqB,QAAA,gBAEpBlB,IAAA,CAACF,SAAS;MACTqB,qBAAqB,EAAG,CAAG;MAC3BC,OAAO,EAAC,MAAM;MACd,cAAaxB,EAAE,CAAE,0BAA2B,CAAG;MAC/CyB,WAAW,EAAGzB,EAAE,CAAE,gBAAiB,CAAG;MACtC0B,KAAK,EAAGb,KAAO;MACfc,QAAQ,EAAKC,QAAQ,IACpBd,aAAa,CAAE;QAAED,KAAK,EAAEe;MAAS,CAAE;IACnC,CACD,CAAC,EACAX,YAAY,iBACbb,IAAA;MACCyB,SAAS,EAAG,oDAAqDb,eAAe,EAAK;MAAAM,QAAA,EAEnFL;IAAY,CACT,CACN;EAAA,CACC,CAAC;AAEN","ignoreList":[]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useBlockProps } from '@wordpress/block-editor';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
const PaginationItem = ({
|
|
8
7
|
content,
|
|
9
8
|
tag: Tag = 'a',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useBlockProps","jsx","_jsx","jsxs","_jsxs","PaginationItem","content","tag","Tag","extraClass","className","href","onClick","event","preventDefault","children","CommentsPaginationNumbersEdit"],"sources":["@wordpress/block-library/src/comments-pagination-numbers/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nconst PaginationItem = ( { content, tag: Tag = 'a', extraClass = '' } ) =>\n\tTag === 'a' ? (\n\t\t<Tag\n\t\t\tclassName={ `page-numbers ${ extraClass }` }\n\t\t\thref=\"#comments-pagination-numbers-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t>\n\t\t\t{ content }\n\t\t</Tag>\n\t) : (\n\t\t<Tag className={ `page-numbers ${ extraClass }` }>{ content }</Tag>\n\t);\n\nexport default function CommentsPaginationNumbersEdit() {\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<PaginationItem content=\"1\" />\n\t\t\t<PaginationItem content=\"2\" />\n\t\t\t<PaginationItem content=\"3\" tag=\"span\" extraClass=\"current\" />\n\t\t\t<PaginationItem content=\"4\" />\n\t\t\t<PaginationItem content=\"5\" />\n\t\t\t<PaginationItem content=\"...\" tag=\"span\" extraClass=\"dots\" />\n\t\t\t<PaginationItem content=\"8\" />\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useBlockProps","jsx","_jsx","jsxs","_jsxs","PaginationItem","content","tag","Tag","extraClass","className","href","onClick","event","preventDefault","children","CommentsPaginationNumbersEdit"],"sources":["@wordpress/block-library/src/comments-pagination-numbers/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nconst PaginationItem = ( { content, tag: Tag = 'a', extraClass = '' } ) =>\n\tTag === 'a' ? (\n\t\t<Tag\n\t\t\tclassName={ `page-numbers ${ extraClass }` }\n\t\t\thref=\"#comments-pagination-numbers-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t>\n\t\t\t{ content }\n\t\t</Tag>\n\t) : (\n\t\t<Tag className={ `page-numbers ${ extraClass }` }>{ content }</Tag>\n\t);\n\nexport default function CommentsPaginationNumbersEdit() {\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<PaginationItem content=\"1\" />\n\t\t\t<PaginationItem content=\"2\" />\n\t\t\t<PaginationItem content=\"3\" tag=\"span\" extraClass=\"current\" />\n\t\t\t<PaginationItem content=\"4\" />\n\t\t\t<PaginationItem content=\"5\" />\n\t\t\t<PaginationItem content=\"...\" tag=\"span\" extraClass=\"dots\" />\n\t\t\t<PaginationItem content=\"8\" />\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,MAAMC,cAAc,GAAGA,CAAE;EAAEC,OAAO;EAAEC,GAAG,EAAEC,GAAG,GAAG,GAAG;EAAEC,UAAU,GAAG;AAAG,CAAC,KACpED,GAAG,KAAK,GAAG,gBACVN,IAAA,CAACM,GAAG;EACHE,SAAS,EAAG,gBAAiBD,UAAU,EAAK;EAC5CE,IAAI,EAAC,0CAA0C;EAC/CC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;EAAAC,QAAA,EAE7CT;AAAO,CACL,CAAC,gBAENJ,IAAA,CAACM,GAAG;EAACE,SAAS,EAAG,gBAAiBD,UAAU,EAAK;EAAAM,QAAA,EAAGT;AAAO,CAAO,CAClE;AAEF,eAAe,SAASU,6BAA6BA,CAAA,EAAG;EACvD,oBACCZ,KAAA;IAAA,GAAUJ,aAAa,CAAC,CAAC;IAAAe,QAAA,gBACxBb,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC;IAAG,CAAE,CAAC,eAC9BJ,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC;IAAG,CAAE,CAAC,eAC9BJ,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC,GAAG;MAACC,GAAG,EAAC,MAAM;MAACE,UAAU,EAAC;IAAS,CAAE,CAAC,eAC9DP,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC;IAAG,CAAE,CAAC,eAC9BJ,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC;IAAG,CAAE,CAAC,eAC9BJ,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC,KAAK;MAACC,GAAG,EAAC,MAAM;MAACE,UAAU,EAAC;IAAM,CAAE,CAAC,eAC7DP,IAAA,CAACG,cAAc;MAACC,OAAO,EAAC;IAAG,CAAE,CAAC;EAAA,CAC1B,CAAC;AAER","ignoreList":[]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useBlockProps, PlainText } from '@wordpress/block-editor';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
7
|
const arrowMap = {
|
|
9
8
|
none: '',
|
|
10
9
|
arrow: '←',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useBlockProps","PlainText","jsx","_jsx","jsxs","_jsxs","arrowMap","none","arrow","chevron","CommentsPaginationPreviousEdit","attributes","label","setAttributes","context","paginationArrow","displayArrow","href","onClick","event","preventDefault","children","className","__experimentalVersion","tagName","placeholder","value","onChange","newLabel"],"sources":["@wordpress/block-library/src/comments-pagination-previous/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '←',\n\tchevron: '«',\n};\n\nexport default function CommentsPaginationPreviousEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { 'comments/paginationArrow': paginationArrow },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#comments-pagination-previous-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-comments-pagination-previous-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t<PlainText\n\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\ttagName=\"span\"\n\t\t\t\taria-label={ __( 'Older comments page link' ) }\n\t\t\t\tplaceholder={ __( 'Older Comments' ) }\n\t\t\t\tvalue={ label }\n\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</a>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","useBlockProps","PlainText","jsx","_jsx","jsxs","_jsxs","arrowMap","none","arrow","chevron","CommentsPaginationPreviousEdit","attributes","label","setAttributes","context","paginationArrow","displayArrow","href","onClick","event","preventDefault","children","className","__experimentalVersion","tagName","placeholder","value","onChange","newLabel"],"sources":["@wordpress/block-library/src/comments-pagination-previous/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '←',\n\tchevron: '«',\n};\n\nexport default function CommentsPaginationPreviousEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { 'comments/paginationArrow': paginationArrow },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#comments-pagination-previous-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-comments-pagination-previous-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t<PlainText\n\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\ttagName=\"span\"\n\t\t\t\taria-label={ __( 'Older comments page link' ) }\n\t\t\t\tplaceholder={ __( 'Older Comments' ) }\n\t\t\t\tvalue={ label }\n\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</a>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnE,MAAMC,QAAQ,GAAG;EAChBC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,GAAG;EACVC,OAAO,EAAE;AACV,CAAC;AAED,eAAe,SAASC,8BAA8BA,CAAE;EACvDC,UAAU,EAAE;IAAEC;EAAM,CAAC;EACrBC,aAAa;EACbC,OAAO,EAAE;IAAE,0BAA0B,EAAEC;EAAgB;AACxD,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGV,QAAQ,CAAES,eAAe,CAAE;EAChD,oBACCV,KAAA;IACCY,IAAI,EAAC,2CAA2C;IAChDC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;IAAA,GAC1CpB,aAAa,CAAC,CAAC;IAAAqB,QAAA,GAElBL,YAAY,iBACbb,IAAA;MACCmB,SAAS,EAAG,wDAAyDP,eAAe,EAAK;MAAAM,QAAA,EAEvFL;IAAY,CACT,CACN,eACDb,IAAA,CAACF,SAAS;MACTsB,qBAAqB,EAAG,CAAG;MAC3BC,OAAO,EAAC,MAAM;MACd,cAAazB,EAAE,CAAE,0BAA2B,CAAG;MAC/C0B,WAAW,EAAG1B,EAAE,CAAE,gBAAiB,CAAG;MACtC2B,KAAK,EAAGd,KAAO;MACfe,QAAQ,EAAKC,QAAQ,IACpBf,aAAa,CAAE;QAAED,KAAK,EAAEgB;MAAS,CAAE;IACnC,CACD,CAAC;EAAA,CACA,CAAC;AAEN","ignoreList":[]}
|
|
@@ -14,9 +14,7 @@ import { useState, useEffect } from '@wordpress/element';
|
|
|
14
14
|
import { useSelect } from '@wordpress/data';
|
|
15
15
|
import apiFetch from '@wordpress/api-fetch';
|
|
16
16
|
import { addQueryArgs } from '@wordpress/url';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
18
|
export default function Edit({
|
|
21
19
|
attributes: {
|
|
22
20
|
textAlign,
|
|
@@ -121,13 +119,13 @@ export default function Edit({
|
|
|
121
119
|
/* translators: %s: Post title. */
|
|
122
120
|
placeholder = sprintf(__('One response to %s'), postTitle);
|
|
123
121
|
} else {
|
|
124
|
-
placeholder = sprintf(
|
|
122
|
+
placeholder = sprintf(/* translators: 1: Number of comments, 2: Post title. */
|
|
125
123
|
_n('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
|
|
126
124
|
}
|
|
127
125
|
} else if (commentsCount === 1) {
|
|
128
126
|
placeholder = __('One response');
|
|
129
127
|
} else {
|
|
130
|
-
placeholder = sprintf(
|
|
128
|
+
placeholder = sprintf(/* translators: %s: Number of comments. */
|
|
131
129
|
_n('%s response', '%s responses', commentsCount), commentsCount);
|
|
132
130
|
}
|
|
133
131
|
} else if (showPostTitle) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","AlignmentControl","BlockControls","useBlockProps","InspectorControls","store","blockEditorStore","HeadingLevelDropdown","__","_n","sprintf","useEntityProp","PanelBody","ToggleControl","useState","useEffect","useSelect","apiFetch","addQueryArgs","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","textAlign","showPostTitle","showCommentsCount","level","levelOptions","setAttributes","context","postType","postId","TagName","commentsCount","setCommentsCount","rawTitle","isSiteEditor","blockProps","className","threadCommentsDepth","threadComments","commentsPerPage","pageComments","select","getSettings","__experimentalDiscussionSettings","nestedCommentsNumber","Math","min","topLevelCommentsNumber","commentsNumber","parseInt","currentPostId","path","post","_fields","method","parse","then","res","headers","get","catch","blockControls","group","children","value","onChange","newAlign","options","newLevel","inspectorControls","title","__nextHasNoMarginBottom","label","checked","postTitle","placeholder","undefined"],"sources":["@wordpress/block-library/src/comments-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function Edit( {\n\tattributes: {\n\t\ttextAlign,\n\t\tshowPostTitle,\n\t\tshowCommentsCount,\n\t\tlevel,\n\t\tlevelOptions,\n\t},\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst TagName = 'h' + level;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst [ rawTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tconst isSiteEditor = typeof postId === 'undefined';\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst {\n\t\tthreadCommentsDepth,\n\t\tthreadComments,\n\t\tcommentsPerPage,\n\t\tpageComments,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalDiscussionSettings;\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( isSiteEditor ) {\n\t\t\t// Match the number of comments that will be shown in the comment-template/edit.js placeholder\n\n\t\t\tconst nestedCommentsNumber = threadComments\n\t\t\t\t? Math.min( threadCommentsDepth, 3 ) - 1\n\t\t\t\t: 0;\n\t\t\tconst topLevelCommentsNumber = pageComments ? commentsPerPage : 3;\n\n\t\t\tconst commentsNumber =\n\t\t\t\tparseInt( nestedCommentsNumber ) +\n\t\t\t\tparseInt( topLevelCommentsNumber );\n\n\t\t\tsetCommentsCount( Math.min( commentsNumber, 3 ) );\n\t\t\treturn;\n\t\t}\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} )\n\t\t\t.then( ( res ) => {\n\t\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\t\tif ( currentPostId === postId ) {\n\t\t\t\t\tsetCommentsCount(\n\t\t\t\t\t\tparseInt( res.headers.get( 'X-WP-Total' ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tsetCommentsCount( 0 );\n\t\t\t} );\n\t}, [ postId ] );\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<HeadingLevelDropdown\n\t\t\t\tvalue={ level }\n\t\t\t\toptions={ levelOptions }\n\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post title' ) }\n\t\t\t\t\tchecked={ showPostTitle }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showPostTitle: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show comments count' ) }\n\t\t\t\t\tchecked={ showCommentsCount }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showCommentsCount: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst postTitle = isSiteEditor ? __( '“Post Title”' ) : `\"${ rawTitle }\"`;\n\n\tlet placeholder;\n\tif ( showCommentsCount && commentsCount !== undefined ) {\n\t\tif ( showPostTitle ) {\n\t\t\tif ( commentsCount === 1 ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tplaceholder = sprintf( __( 'One response to %s' ), postTitle );\n\t\t\t} else {\n\t\t\t\tplaceholder = sprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%1$s response to %2$s',\n\t\t\t\t\t\t'%1$s responses to %2$s',\n\t\t\t\t\t\tcommentsCount\n\t\t\t\t\t),\n\t\t\t\t\tcommentsCount,\n\t\t\t\t\tpostTitle\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( commentsCount === 1 ) {\n\t\t\tplaceholder = __( 'One response' );\n\t\t} else {\n\t\t\tplaceholder = sprintf(\n\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t_n( '%s response', '%s responses', commentsCount ),\n\t\t\t\tcommentsCount\n\t\t\t);\n\t\t}\n\t} else if ( showPostTitle ) {\n\t\tif ( commentsCount === 1 ) {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Response to %s' ), postTitle );\n\t\t} else {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Responses to %s' ), postTitle );\n\t\t}\n\t} else if ( commentsCount === 1 ) {\n\t\tplaceholder = __( 'Response' );\n\t} else {\n\t\tplaceholder = __( 'Responses' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName { ...blockProps }>{ placeholder }</TagName>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,aAAa,EACbC,aAAa,EACbC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,EACzBC,oBAAoB,QACd,yBAAyB;AAChC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,SAAS,EAAEC,aAAa,QAAQ,uBAAuB;AAChE,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,O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aAAa,EAAE,cAAc,EAAE4B,aAAc,CAAC,EAClDA,aACD,CAAC;IACF;EACD,CAAC,MAAM,IAAKT,aAAa,EAAG;IAC3B,IAAKS,aAAa,KAAK,CAAC,EAAG;MAC1B;MACA4C,WAAW,GAAGvE,OAAO,CAAEF,EAAE,CAAE,gBAAiB,CAAC,EAAEwE,SAAU,CAAC;IAC3D,CAAC,MAAM;MACN;MACAC,WAAW,GAAGvE,OAAO,CAAEF,EAAE,CAAE,iBAAkB,CAAC,EAAEwE,SAAU,CAAC;IAC5D;EACD,CAAC,MAAM,IAAK3C,aAAa,KAAK,CAAC,EAAG;IACjC4C,WAAW,GAAGzE,EAAE,CAAE,UAAW,CAAC;EAC/B,CAAC,MAAM;IACNyE,WAAW,GAAGzE,EAAE,CAAE,WAAY,CAAC;EAChC;EAEA,oBACCc,KAAA,CAAAE,SAAA;IAAA6C,QAAA,GACGF,aAAa,EACbQ,iBAAiB,eACnBvD,IAAA,CAACgB,OAAO;MAAA,GAAMK,UAAU;MAAA4B,QAAA,EAAKY;IAAW,CAAW,CAAC;EAAA,CACnD,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","AlignmentControl","BlockControls","useBlockProps","InspectorControls","store","blockEditorStore","HeadingLevelDropdown","__","_n","sprintf","useEntityProp","PanelBody","ToggleControl","useState","useEffect","useSelect","apiFetch","addQueryArgs","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","textAlign","showPostTitle","showCommentsCount","level","levelOptions","setAttributes","context","postType","postId","TagName","commentsCount","setCommentsCount","rawTitle","isSiteEditor","blockProps","className","threadCommentsDepth","threadComments","commentsPerPage","pageComments","select","getSettings","__experimentalDiscussionSettings","nestedCommentsNumber","Math","min","topLevelCommentsNumber","commentsNumber","parseInt","currentPostId","path","post","_fields","method","parse","then","res","headers","get","catch","blockControls","group","children","value","onChange","newAlign","options","newLevel","inspectorControls","title","__nextHasNoMarginBottom","label","checked","postTitle","placeholder","undefined"],"sources":["@wordpress/block-library/src/comments-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function Edit( {\n\tattributes: {\n\t\ttextAlign,\n\t\tshowPostTitle,\n\t\tshowCommentsCount,\n\t\tlevel,\n\t\tlevelOptions,\n\t},\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst TagName = 'h' + level;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst [ rawTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tconst isSiteEditor = typeof postId === 'undefined';\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst {\n\t\tthreadCommentsDepth,\n\t\tthreadComments,\n\t\tcommentsPerPage,\n\t\tpageComments,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalDiscussionSettings;\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( isSiteEditor ) {\n\t\t\t// Match the number of comments that will be shown in the comment-template/edit.js placeholder\n\n\t\t\tconst nestedCommentsNumber = threadComments\n\t\t\t\t? Math.min( threadCommentsDepth, 3 ) - 1\n\t\t\t\t: 0;\n\t\t\tconst topLevelCommentsNumber = pageComments ? commentsPerPage : 3;\n\n\t\t\tconst commentsNumber =\n\t\t\t\tparseInt( nestedCommentsNumber ) +\n\t\t\t\tparseInt( topLevelCommentsNumber );\n\n\t\t\tsetCommentsCount( Math.min( commentsNumber, 3 ) );\n\t\t\treturn;\n\t\t}\n\t\tconst currentPostId = postId;\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/comments', {\n\t\t\t\tpost: postId,\n\t\t\t\t_fields: 'id',\n\t\t\t} ),\n\t\t\tmethod: 'HEAD',\n\t\t\tparse: false,\n\t\t} )\n\t\t\t.then( ( res ) => {\n\t\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\t\tif ( currentPostId === postId ) {\n\t\t\t\t\tsetCommentsCount(\n\t\t\t\t\t\tparseInt( res.headers.get( 'X-WP-Total' ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tsetCommentsCount( 0 );\n\t\t\t} );\n\t}, [ postId ] );\n\n\tconst blockControls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ textAlign }\n\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<HeadingLevelDropdown\n\t\t\t\tvalue={ level }\n\t\t\t\toptions={ levelOptions }\n\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post title' ) }\n\t\t\t\t\tchecked={ showPostTitle }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showPostTitle: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show comments count' ) }\n\t\t\t\t\tchecked={ showCommentsCount }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showCommentsCount: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst postTitle = isSiteEditor ? __( '“Post Title”' ) : `\"${ rawTitle }\"`;\n\n\tlet placeholder;\n\tif ( showCommentsCount && commentsCount !== undefined ) {\n\t\tif ( showPostTitle ) {\n\t\t\tif ( commentsCount === 1 ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tplaceholder = sprintf( __( 'One response to %s' ), postTitle );\n\t\t\t} else {\n\t\t\t\tplaceholder = sprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'%1$s response to %2$s',\n\t\t\t\t\t\t'%1$s responses to %2$s',\n\t\t\t\t\t\tcommentsCount\n\t\t\t\t\t),\n\t\t\t\t\tcommentsCount,\n\t\t\t\t\tpostTitle\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( commentsCount === 1 ) {\n\t\t\tplaceholder = __( 'One response' );\n\t\t} else {\n\t\t\tplaceholder = sprintf(\n\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t_n( '%s response', '%s responses', commentsCount ),\n\t\t\t\tcommentsCount\n\t\t\t);\n\t\t}\n\t} else if ( showPostTitle ) {\n\t\tif ( commentsCount === 1 ) {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Response to %s' ), postTitle );\n\t\t} else {\n\t\t\t/* translators: %s: Post title. */\n\t\t\tplaceholder = sprintf( __( 'Responses to %s' ), postTitle );\n\t\t}\n\t} else if ( commentsCount === 1 ) {\n\t\tplaceholder = __( 'Response' );\n\t} else {\n\t\tplaceholder = __( 'Responses' );\n\t}\n\n\treturn (\n\t\t<>\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|
|
|
1
|
+
{"version":3,"names":["DEFAULT_MEDIA_SIZE_SLUG"],"sources":["@wordpress/block-library/src/cover/constants.js"],"sourcesContent":["export const DEFAULT_MEDIA_SIZE_SLUG = 'full';\n"],"mappings":"AAAA,OAAO,MAAMA,uBAAuB,GAAG,MAAM","ignoreList":[]}
|
|
@@ -21,9 +21,7 @@ import styles from './style.scss';
|
|
|
21
21
|
import OverlayColorSettings from './overlay-color-settings';
|
|
22
22
|
import FocalPointSettingsButton from './focal-point-settings-button';
|
|
23
23
|
import { ALLOWED_MEDIA_TYPES, COVER_MIN_HEIGHT, COVER_MAX_HEIGHT, COVER_DEFAULT_HEIGHT, IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared';
|
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
25
|
function Controls({
|
|
28
26
|
attributes,
|
|
29
27
|
didUploadFail,
|