@wordpress/block-library 9.9.0 → 9.10.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 +2 -0
- package/build/audio/edit.native.js +1 -1
- package/build/audio/edit.native.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.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-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/controls.native.js.map +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +74 -30
- package/build/cover/edit/inspector-controls.js.map +1 -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.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/deprecated.js.map +1 -1
- package/build/gallery/edit.js +2 -2
- 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/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/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 +2 -2
- 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.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 +1 -1
- package/build/navigation/edit/menu-inspector-controls.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.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-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 +1 -1
- 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.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 +3 -3
- 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.map +1 -1
- package/build/search/edit.native.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.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/table/deprecated.js.map +1 -1
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- 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 +1 -1
- 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/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/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.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-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/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 +1 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +76 -34
- 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/save.js +1 -2
- 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 +1 -3
- 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/deprecated.js +1 -2
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +3 -5
- 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/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 +1 -3
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +1 -3
- 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 +3 -5
- 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 +1 -3
- 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 +2 -3
- 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 +1 -3
- 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 +1 -3
- 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 +1 -3
- 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 +2 -4
- 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.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 +4 -6
- 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 +1 -3
- 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/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 -3
- 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/table/deprecated.js +1 -2
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +1 -3
- 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 +2 -4
- 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 +2 -4
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/code/style-rtl.css +2 -0
- package/build-style/code/style.css +4 -0
- package/build-style/common-rtl.css +0 -2
- package/build-style/common.css +0 -2
- 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 +4 -6
- package/build-style/style.css +6 -6
- package/package.json +36 -36
- package/src/code/style.scss +5 -0
- package/src/common.scss +0 -3
- package/src/cover/edit/inspector-controls.js +103 -44
- package/src/cover/index.php +38 -19
- package/src/cover/test/edit.js +2 -2
- package/src/embed/edit.js +19 -2
- package/src/embed/embed-preview.js +2 -18
- package/src/image/index.php +1 -1
- package/src/post-content/edit.js +30 -1
- package/src/post-content/style.scss +2 -4
- package/src/post-terms/index.php +7 -6
- package/src/query/edit/inspector-controls/index.js +10 -16
- package/src/query/edit/pattern-selection-modal.js +1 -1
- package/src/template-part/edit/selection-modal.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_blockEditor","_icons","_useEnter","_jsxRuntime","ParagraphRTLControl","direction","setDirection","isRTL","jsx","ToolbarButton","icon","formatLtr","title","_x","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","useSettings","dropCap","helpText","__","__experimentalToolsPanelItem","hasValue","label","onDeselect","resetAllFilter","panelId","children","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","content","placeholder","blockProps","useBlockProps","ref","useOnEnter","className","clsx","style","blockEditingMode","useBlockEditingMode","jsxs","Fragment","BlockControls","group","AlignmentControl","value","newAlign","newDirection","InspectorControls","RichText","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations","_default","exports","default"],"sources":["@wordpress/block-library/src/paragraph/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSettings,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { formatLtr } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ formatLtr }\n\t\t\t\ttitle={ _x( 'Left to right', 'editor button' ) }\n\t\t\t\tisActive={ direction === 'ltr' }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetDirection( direction === 'ltr' ? undefined : 'ltr' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction hasDropCapDisabled( align ) {\n\treturn align === ( isRTL() ? 'left' : 'right' ) || align === 'center';\n}\n\nfunction DropCapControl( { clientId, attributes, setAttributes } ) {\n\t// Please do not add a useSelect call to the paragraph block unconditionally.\n\t// Every useSelect added to a (frequently used) block will degrade load\n\t// and type performance. By moving it within InspectorControls, the subscription is\n\t// now only added for the selected block(s).\n\tconst [ isDropCapFeatureEnabled ] = useSettings( 'typography.dropCap' );\n\n\tif ( ! isDropCapFeatureEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst { align, dropCap } = attributes;\n\n\tlet helpText;\n\tif ( hasDropCapDisabled( align ) ) {\n\t\thelpText = __( 'Not available for aligned text.' );\n\t} else if ( dropCap ) {\n\t\thelpText = __( 'Showing large initial letter.' );\n\t} else {\n\t\thelpText = __( 'Toggle to show a large initial letter.' );\n\t}\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => !! dropCap }\n\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\tonDeselect={ () => setAttributes( { dropCap: undefined } ) }\n\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\tpanelId={ clientId }\n\t\t>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\tchecked={ !! dropCap }\n\t\t\t\tonChange={ () => setAttributes( { dropCap: ! dropCap } ) }\n\t\t\t\thelp={ helpText }\n\t\t\t\tdisabled={ hasDropCapDisabled( align ) ? true : false }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: clsx( {\n\t\t\t'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ align }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t\t\t\tdropCap: hasDropCapDisabled( newAlign )\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: dropCap,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ParagraphRTLControl\n\t\t\t\t\t\tdirection={ direction }\n\t\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t<DropCapControl\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tRichText.isEmpty( content )\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Block: Paragraph' )\n\t\t\t\t}\n\t\t\t\tdata-empty={ RichText.isEmpty( content ) }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\tdata-custom-placeholder={ placeholder ? true : undefined }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AA5BzC;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAGA,SAASO,mBAAmBA,CAAE;EAAEC,SAAS;EAAEC;AAAa,CAAC,EAAG;EAC3D,OACC,IAAAC,WAAK,EAAC,CAAC,iBACN,IAAAJ,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAU,aAAa;IACbC,IAAI,EAAGC,gBAAW;IAClBC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAe,EAAE,eAAgB,C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AAI;IACnDiB,OAAO,EAAGb,QAAU;IAAAc,QAAA,eAEpB,IAAA/B,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAoC,aAAa;MACbC,uBAAuB;MACvBN,KAAK,EAAG,IAAAH,QAAE,EAAE,UAAW,CAAG;MAC1BU,OAAO,EAAG,CAAC,CAAEZ,OAAS;MACtBa,QAAQ,EAAGA,CAAA,KAAMhB,aAAa,CAAE;QAAEG,OAAO,EAAE,CAAEA;MAAQ,CAAE,CAAG;MAC1Dc,IAAI,EAAGb,QAAU;MACjBc,QAAQ,EAAGvB,kBAAkB,CAAEC,KAAM,CAAC,GAAG,IAAI,GAAG;IAAO,CACvD;EAAC,CACa,CAAC;AAEnB;AAEA,SAASuB,cAAcA,CAAE;EACxBpB,UAAU;EACVqB,WAAW;EACXC,SAAS;EACTC,QAAQ;EACRtB,aAAa;EACbF;AACD,CAAC,EAAG;EACH,MAAM;IAAEF,KAAK;IAAE2B,OAAO;IAAExC,SAAS;IAAEoB,OAAO;IAAEqB;EAAY,CAAC,GAAGzB,UAAU;EACtE,MAAM0B,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,GAAG,EAAE,IAAAC,oBAAU,EAAE;MAAE9B,QAAQ;MAAEyB;IAAQ,CAAE,CAAC;IACxCM,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,cAAc,EAAEnC,kBAAkB,CAAEC,KAAM,CAAC,GAAG,KAAK,GAAGO,OAAO;MAC7D,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_blockEditor","_icons","_useEnter","_jsxRuntime","ParagraphRTLControl","direction","setDirection","isRTL","jsx","ToolbarButton","icon","formatLtr","title","_x","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","useSettings","dropCap","helpText","__","__experimentalToolsPanelItem","hasValue","label","onDeselect","resetAllFilter","panelId","children","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","content","placeholder","blockProps","useBlockProps","ref","useOnEnter","className","clsx","style","blockEditingMode","useBlockEditingMode","jsxs","Fragment","BlockControls","group","AlignmentControl","value","newAlign","newDirection","InspectorControls","RichText","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations","_default","exports","default"],"sources":["@wordpress/block-library/src/paragraph/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSettings,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { formatLtr } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ formatLtr }\n\t\t\t\ttitle={ _x( 'Left to right', 'editor button' ) }\n\t\t\t\tisActive={ direction === 'ltr' }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetDirection( direction === 'ltr' ? undefined : 'ltr' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction hasDropCapDisabled( align ) {\n\treturn align === ( isRTL() ? 'left' : 'right' ) || align === 'center';\n}\n\nfunction DropCapControl( { clientId, attributes, setAttributes } ) {\n\t// Please do not add a useSelect call to the paragraph block unconditionally.\n\t// Every useSelect added to a (frequently used) block will degrade load\n\t// and type performance. By moving it within InspectorControls, the subscription is\n\t// now only added for the selected block(s).\n\tconst [ isDropCapFeatureEnabled ] = useSettings( 'typography.dropCap' );\n\n\tif ( ! isDropCapFeatureEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst { align, dropCap } = attributes;\n\n\tlet helpText;\n\tif ( hasDropCapDisabled( align ) ) {\n\t\thelpText = __( 'Not available for aligned text.' );\n\t} else if ( dropCap ) {\n\t\thelpText = __( 'Showing large initial letter.' );\n\t} else {\n\t\thelpText = __( 'Toggle to show a large initial letter.' );\n\t}\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => !! dropCap }\n\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\tonDeselect={ () => setAttributes( { dropCap: undefined } ) }\n\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\tpanelId={ clientId }\n\t\t>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\tchecked={ !! dropCap }\n\t\t\t\tonChange={ () => setAttributes( { dropCap: ! dropCap } ) }\n\t\t\t\thelp={ helpText }\n\t\t\t\tdisabled={ hasDropCapDisabled( align ) ? true : false }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: clsx( {\n\t\t\t'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ align }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t\t\t\tdropCap: hasDropCapDisabled( newAlign )\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: dropCap,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ParagraphRTLControl\n\t\t\t\t\t\tdirection={ direction }\n\t\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t<DropCapControl\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tRichText.isEmpty( content )\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Block: Paragraph' )\n\t\t\t\t}\n\t\t\t\tdata-empty={ RichText.isEmpty( content ) }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\tdata-custom-placeholder={ placeholder ? true : undefined }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"],"mappings":";;;;;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,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACgB,CAAC,eACpB,IAAAnB,WAAA,CAAAK,GAAA,EAACR,YAAA,CAAAiE,QAAQ;MACRC,UAAU,EAAC,SAAS;MACpBC,OAAO,EAAC,GAAG;MAAA,GACNpB,UAAU;MACfc,KAAK,EAAGhB,OAAS;MACjBP,QAAQ,EAAK8B,UAAU,IACtB9C,aAAa,CAAE;QAAEuB,OAAO,EAAEuB;MAAW,CAAE,CACvC;MACDC,OAAO,EAAG3B,WAAa;MACvBC,SAAS,EAAGA,SAAW;MACvBC,QAAQ,EAAGA,QAAU;MACrB,cACCqB,qBAAQ,CAACK,OAAO,CAAEzB,OAAQ,CAAC,GACxB,IAAAlB,QAAE,EACF,oEACA,CAAC,GACD,IAAAA,QAAE,EAAE,kBAAmB,CAC1B;MACD,cAAasC,qBAAQ,CAACK,OAAO,CAAEzB,OAAQ,CAAG;MAC1CC,WAAW,EAAGA,WAAW,IAAI,IAAAnB,QAAE,EAAE,0BAA2B,CAAG;MAC/D,2BAA0BmB,WAAW,GAAG,IAAI,GAAG9B,SAAW;MAC1DuD,yBAAyB;MACzBC,oCAAoC;IAAA,CACpC,CAAC;EAAA,CACD,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclC,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_i18n","_jsxRuntime","save","attributes","align","content","dropCap","direction","className","clsx","isRTL","jsx","useBlockProps","dir","children","RichText","Content","value"],"sources":["@wordpress/block-library/src/paragraph/save.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\nimport { isRTL } from '@wordpress/i18n';\n\nexport default function save( { attributes } ) {\n\tconst { align, content, dropCap, direction } = attributes;\n\tconst className = clsx( {\n\t\t'has-drop-cap':\n\t\t\talign === ( isRTL() ? 'left' : 'right' ) || align === 'center'\n\t\t\t\t? false\n\t\t\t\t: dropCap,\n\t\t[ `has-text-align-${ align }` ]: align,\n\t} );\n\n\treturn (\n\t\t<p { ...useBlockProps.save( { className, dir: direction } ) }>\n\t\t\t<RichText.Content value={ content } />\n\t\t</p>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAAwC,IAAAG,WAAA,GAAAH,OAAA;AATxC;AACA;AACA;;AAGA;AACA;AACA;;AAIe,SAASI,IAAIA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC9C,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,OAAO;IAAEC;EAAU,CAAC,GAAGJ,UAAU;EACzD,MAAMK,SAAS,GAAG,IAAAC,aAAI,EAAE;IACvB,cAAc,EACbL,KAAK,MAAO,IAAAM,WAAK,EAAC,CAAC,GAAG,MAAM,GAAG,OAAO,CAAE,IAAIN,KAAK,KAAK,QAAQ,GAC3D,KAAK,GACLE,OAAO;IACX,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_i18n","_jsxRuntime","save","attributes","align","content","dropCap","direction","className","clsx","isRTL","jsx","useBlockProps","dir","children","RichText","Content","value"],"sources":["@wordpress/block-library/src/paragraph/save.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\nimport { isRTL } from '@wordpress/i18n';\n\nexport default function save( { attributes } ) {\n\tconst { align, content, dropCap, direction } = attributes;\n\tconst className = clsx( {\n\t\t'has-drop-cap':\n\t\t\talign === ( isRTL() ? 'left' : 'right' ) || align === 'center'\n\t\t\t\t? false\n\t\t\t\t: dropCap,\n\t\t[ `has-text-align-${ align }` ]: align,\n\t} );\n\n\treturn (\n\t\t<p { ...useBlockProps.save( { className, dir: direction } ) }>\n\t\t\t<RichText.Content value={ content } />\n\t\t</p>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAAwC,IAAAG,WAAA,GAAAH,OAAA;AATxC;AACA;AACA;;AAGA;AACA;AACA;;AAIe,SAASI,IAAIA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC9C,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,OAAO;IAAEC;EAAU,CAAC,GAAGJ,UAAU;EACzD,MAAMK,SAAS,GAAG,IAAAC,aAAI,EAAE;IACvB,cAAc,EACbL,KAAK,MAAO,IAAAM,WAAK,EAAC,CAAC,GAAG,MAAM,GAAG,OAAO,CAAE,IAAIN,KAAK,KAAK,QAAQ,GAC3D,KAAK,GACLE,OAAO;IACX,CAAE,kBAAmBF,KAAK,EAAG,GAAIA;EAClC,CAAE,CAAC;EAEH,oBACC,IAAAH,WAAA,CAAAU,GAAA;IAAA,GAAQC,0BAAa,CAACV,IAAI,CAAE;MAAEM,SAAS;MAAEK,GAAG,EAAEN;IAAU,CAAE,CAAC;IAAAO,QAAA,eAC1D,IAAAb,WAAA,CAAAU,GAAA,EAACZ,YAAA,CAAAgB,QAAQ,CAACC,OAAO;MAACC,KAAK,EAAGZ;IAAS,CAAE;EAAC,CACpC,CAAC;AAEN","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","cachedParsers","WeakMap","useParsePatternDependencies","registry","useRegistry","has","deps","Map","set","parsePatternDependencies","bind","get","name","blocks","queue","length","block","shift","innerBlock","_block$innerBlocks","innerBlocks","unshift","registerDependency","attributes","slug","a","b","Set","add","hasCycle","TypeError","visitedNodes","currentPath","_deps$get","dependencies","dependency","delete"],"sources":["@wordpress/block-library/src/pattern/recursion-detector.js"],"sourcesContent":["/**\n * THIS MODULE IS INTENTIONALLY KEPT WITHIN THE PATTERN BLOCK'S SOURCE.\n *\n * This is because this approach for preventing infinite loops due to\n * recursively rendering blocks is specific to the way that the `core/pattern`\n * block behaves in the editor. Any other block types that deal with recursion\n * SHOULD USE THE STANDARD METHOD for avoiding loops:\n *\n * @see https://github.com/WordPress/gutenberg/pull/31455\n * @see packages/block-editor/src/components/recursion-provider/README.md\n */\n\n/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\n\n/**\n * Naming is hard.\n *\n * @see useParsePatternDependencies\n *\n * @type {WeakMap<Object, Function>}\n */\nconst cachedParsers = new WeakMap();\n\n/**\n * Hook used by PatternEdit to parse block patterns. It returns a function that\n * takes a pattern and returns nothing but throws an error if the pattern is\n * recursive.\n *\n * @example\n * ```js\n * const parsePatternDependencies = useParsePatternDependencies();\n * parsePatternDependencies( selectedPattern );\n * ```\n *\n * @see parsePatternDependencies\n *\n * @return {Function} A function to parse block patterns.\n */\nexport function useParsePatternDependencies() {\n\tconst registry = useRegistry();\n\n\t// Instead of caching maps, go straight to the point and cache bound\n\t// functions. Each of those functions is bound to a different Map that will\n\t// keep track of patterns in the context of the given registry.\n\tif ( ! cachedParsers.has( registry ) ) {\n\t\tconst deps = new Map();\n\t\tcachedParsers.set(\n\t\t\tregistry,\n\t\t\tparsePatternDependencies.bind( null, deps )\n\t\t);\n\t}\n\treturn cachedParsers.get( registry );\n}\n\n/**\n * Parse a given pattern and traverse its contents to detect any subsequent\n * patterns on which it may depend. Such occurrences will be added to an\n * internal dependency graph. If a circular dependency is detected, an\n * error will be thrown.\n *\n * EXPORTED FOR TESTING PURPOSES ONLY.\n *\n * @param {Map<string, Set<string>>} deps Map of pattern dependencies.\n * @param {Object} pattern Pattern.\n * @param {string} pattern.name Pattern name.\n * @param {Array} pattern.blocks Pattern's block list.\n *\n * @throws {Error} If a circular dependency is detected.\n */\nexport function parsePatternDependencies( deps, { name, blocks } ) {\n\tconst queue = [ ...blocks ];\n\twhile ( queue.length ) {\n\t\tconst block = queue.shift();\n\t\tfor ( const innerBlock of block.innerBlocks ?? [] ) {\n\t\t\tqueue.unshift( innerBlock );\n\t\t}\n\t\tif ( block.name === 'core/pattern' ) {\n\t\t\tregisterDependency( deps, name, block.attributes.slug );\n\t\t}\n\t}\n}\n\n/**\n * Declare that pattern `a` depends on pattern `b`. If a circular\n * dependency is detected, an error will be thrown.\n *\n * EXPORTED FOR TESTING PURPOSES ONLY.\n *\n * @param {Map<string, Set<string>>} deps Map of pattern dependencies.\n * @param {string} a Slug for pattern A.\n * @param {string} b Slug for pattern B.\n *\n * @throws {Error} If a circular dependency is detected.\n */\nexport function registerDependency( deps, a, b ) {\n\tif ( ! deps.has( a ) ) {\n\t\tdeps.set( a, new Set() );\n\t}\n\tdeps.get( a ).add( b );\n\tif ( hasCycle( deps, a ) ) {\n\t\tthrow new TypeError(\n\t\t\t`Pattern ${ a } has a circular dependency and cannot be rendered.`\n\t\t);\n\t}\n}\n\n/**\n * Determine if a given pattern has circular dependencies on other patterns.\n * This will be determined by running a depth-first search on the current state\n * of the graph represented by `patternDependencies`.\n *\n * @param {Map<string, Set<string>>} deps Map of pattern dependencies.\n * @param {string} slug Pattern slug.\n * @param {Set<string>} [visitedNodes] Set to track visited nodes in the graph.\n * @param {Set<string>} [currentPath] Set to track and backtrack graph paths.\n * @return {boolean} Whether any cycle was found.\n */\nfunction hasCycle(\n\tdeps,\n\tslug,\n\tvisitedNodes = new Set(),\n\tcurrentPath = new Set()\n) {\n\tvisitedNodes.add( slug );\n\tcurrentPath.add( slug );\n\n\tconst dependencies = deps.get( slug ) ?? new Set();\n\n\tfor ( const dependency of dependencies ) {\n\t\tif ( ! visitedNodes.has( dependency ) ) {\n\t\t\tif ( hasCycle( deps, dependency, visitedNodes, currentPath ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if ( currentPath.has( dependency ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// Remove the current node from the current path when backtracking\n\tcurrentPath.delete( slug );\n\treturn false;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_data","require","cachedParsers","WeakMap","useParsePatternDependencies","registry","useRegistry","has","deps","Map","set","parsePatternDependencies","bind","get","name","blocks","queue","length","block","shift","innerBlock","_block$innerBlocks","innerBlocks","unshift","registerDependency","attributes","slug","a","b","Set","add","hasCycle","TypeError","visitedNodes","currentPath","_deps$get","dependencies","dependency","delete"],"sources":["@wordpress/block-library/src/pattern/recursion-detector.js"],"sourcesContent":["/**\n * THIS MODULE IS INTENTIONALLY KEPT WITHIN THE PATTERN BLOCK'S SOURCE.\n *\n * This is because this approach for preventing infinite loops due to\n * recursively rendering blocks is specific to the way that the `core/pattern`\n * block behaves in the editor. Any other block types that deal with recursion\n * SHOULD USE THE STANDARD METHOD for avoiding loops:\n *\n * @see https://github.com/WordPress/gutenberg/pull/31455\n * @see packages/block-editor/src/components/recursion-provider/README.md\n */\n\n/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\n\n/**\n * Naming is hard.\n *\n * @see useParsePatternDependencies\n *\n * @type {WeakMap<Object, Function>}\n */\nconst cachedParsers = new WeakMap();\n\n/**\n * Hook used by PatternEdit to parse block patterns. It returns a function that\n * takes a pattern and returns nothing but throws an error if the pattern is\n * recursive.\n *\n * @example\n * ```js\n * const parsePatternDependencies = useParsePatternDependencies();\n * parsePatternDependencies( selectedPattern );\n * ```\n *\n * @see parsePatternDependencies\n *\n * @return {Function} A function to parse block patterns.\n */\nexport function useParsePatternDependencies() {\n\tconst registry = useRegistry();\n\n\t// Instead of caching maps, go straight to the point and cache bound\n\t// functions. Each of those functions is bound to a different Map that will\n\t// keep track of patterns in the context of the given registry.\n\tif ( ! cachedParsers.has( registry ) ) {\n\t\tconst deps = new Map();\n\t\tcachedParsers.set(\n\t\t\tregistry,\n\t\t\tparsePatternDependencies.bind( null, deps )\n\t\t);\n\t}\n\treturn cachedParsers.get( registry );\n}\n\n/**\n * Parse a given pattern and traverse its contents to detect any subsequent\n * patterns on which it may depend. Such occurrences will be added to an\n * internal dependency graph. If a circular dependency is detected, an\n * error will be thrown.\n *\n * EXPORTED FOR TESTING PURPOSES ONLY.\n *\n * @param {Map<string, Set<string>>} deps Map of pattern dependencies.\n * @param {Object} pattern Pattern.\n * @param {string} pattern.name Pattern name.\n * @param {Array} pattern.blocks Pattern's block list.\n *\n * @throws {Error} If a circular dependency is detected.\n */\nexport function parsePatternDependencies( deps, { name, blocks } ) {\n\tconst queue = [ ...blocks ];\n\twhile ( queue.length ) {\n\t\tconst block = queue.shift();\n\t\tfor ( const innerBlock of block.innerBlocks ?? [] ) {\n\t\t\tqueue.unshift( innerBlock );\n\t\t}\n\t\tif ( block.name === 'core/pattern' ) {\n\t\t\tregisterDependency( deps, name, block.attributes.slug );\n\t\t}\n\t}\n}\n\n/**\n * Declare that pattern `a` depends on pattern `b`. If a circular\n * dependency is detected, an error will be thrown.\n *\n * EXPORTED FOR TESTING PURPOSES ONLY.\n *\n * @param {Map<string, Set<string>>} deps Map of pattern dependencies.\n * @param {string} a Slug for pattern A.\n * @param {string} b Slug for pattern B.\n *\n * @throws {Error} If a circular dependency is detected.\n */\nexport function registerDependency( deps, a, b ) {\n\tif ( ! deps.has( a ) ) {\n\t\tdeps.set( a, new Set() );\n\t}\n\tdeps.get( a ).add( b );\n\tif ( hasCycle( deps, a ) ) {\n\t\tthrow new TypeError(\n\t\t\t`Pattern ${ a } has a circular dependency and cannot be rendered.`\n\t\t);\n\t}\n}\n\n/**\n * Determine if a given pattern has circular dependencies on other patterns.\n * This will be determined by running a depth-first search on the current state\n * of the graph represented by `patternDependencies`.\n *\n * @param {Map<string, Set<string>>} deps Map of pattern dependencies.\n * @param {string} slug Pattern slug.\n * @param {Set<string>} [visitedNodes] Set to track visited nodes in the graph.\n * @param {Set<string>} [currentPath] Set to track and backtrack graph paths.\n * @return {boolean} Whether any cycle was found.\n */\nfunction hasCycle(\n\tdeps,\n\tslug,\n\tvisitedNodes = new Set(),\n\tcurrentPath = new Set()\n) {\n\tvisitedNodes.add( slug );\n\tcurrentPath.add( slug );\n\n\tconst dependencies = deps.get( slug ) ?? new Set();\n\n\tfor ( const dependency of dependencies ) {\n\t\tif ( ! visitedNodes.has( dependency ) ) {\n\t\t\tif ( hasCycle( deps, dependency, visitedNodes, currentPath ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if ( currentPath.has( dependency ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// Remove the current node from the current path when backtracking\n\tcurrentPath.delete( slug );\n\treturn false;\n}\n"],"mappings":";;;;;;;;;AAeA,IAAAA,KAAA,GAAAC,OAAA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,2BAA2BA,CAAA,EAAG;EAC7C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;;EAE9B;EACA;EACA;EACA,IAAK,CAAEJ,aAAa,CAACK,GAAG,CAAEF,QAAS,CAAC,EAAG;IACtC,MAAMG,IAAI,GAAG,IAAIC,GAAG,CAAC,CAAC;IACtBP,aAAa,CAACQ,GAAG,CAChBL,QAAQ,EACRM,wBAAwB,CAACC,IAAI,CAAE,IAAI,EAAEJ,IAAK,CAC3C,CAAC;EACF;EACA,OAAON,aAAa,CAACW,GAAG,CAAER,QAAS,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,wBAAwBA,CAAEH,IAAI,EAAE;EAAEM,IAAI;EAAEC;AAAO,CAAC,EAAG;EAClE,MAAM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,GAAG,CAAEJ,IAAK,CAAC;EAEvB,MAAMU,YAAY,IAAAD,SAAA,GAAG3B,IAAI,CAACK,GAAG,CAAEa,IAAK,CAAC,cAAAS,SAAA,cAAAA,SAAA,GAAI,IAAIN,GAAG,CAAC,CAAC;EAElD,KAAM,MAAMQ,UAAU,IAAID,YAAY,EAAG;IACxC,IAAK,CAAEH,YAAY,CAAC1B,GAAG,CAAE8B,UAAW,CAAC,EAAG;MACvC,IAAKN,QAAQ,CAAEvB,IAAI,EAAE6B,UAAU,EAAEJ,YAAY,EAAEC,WAAY,CAAC,EAAG;QAC9D,OAAO,IAAI;MACZ;IACD,CAAC,MAAM,IAAKA,WAAW,CAAC3B,GAAG,CAAE8B,UAAW,CAAC,EAAG;MAC3C,OAAO,IAAI;IACZ;EACD;;EAEA;EACAH,WAAW,CAACI,MAAM,CAAEZ,IAAK,CAAC;EAC1B,OAAO,KAAK;AACb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_data","_i18n","_coreData","_jsxRuntime","minimumUsersForCombobox","AUTHORS_QUERY","who","per_page","PostAuthorEdit","isSelected","context","postType","postId","queryId","attributes","setAttributes","isDescendentOfQueryLoop","Number","isFinite","authorId","authorDetails","authors","useSelect","select","getEditedEntityRecord","getUser","getUsers","coreStore","_authorId","author","editEntityRecord","useDispatch","textAlign","showAvatar","showBio","byline","isLink","linkTarget","avatarSizes","authorName","name","__","avatar_urls","Object","keys","forEach","size","push","value","label","blockProps","useBlockProps","className","clsx","authorOptions","length","map","id","handleSelect","nextAuthorId","showCombobox","showAuthorControl","jsxs","Fragment","children","jsx","InspectorControls","PanelBody","title","__experimentalVStack","spacing","ComboboxControl","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","allowReset","SelectControl","ToggleControl","checked","avatarSize","BlockControls","group","AlignmentControl","nextAlign","width","src","alt","RichText","isEmpty","identifier","placeholder","href","onClick","event","preventDefault","dangerouslySetInnerHTML","__html","description","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tComboboxControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst minimumUsersForCombobox = 25;\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n};\n\nfunction PostAuthorEdit( {\n\tisSelected,\n\tcontext: { postType, postId, queryId },\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { authorId, authorDetails, authors } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getUsers } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tauthors: getUsers( AUTHORS_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst { textAlign, showAvatar, showBio, byline, isLink, linkTarget } =\n\t\tattributes;\n\tconst avatarSizes = [];\n\tconst authorName = authorDetails?.name || __( 'Post Author' );\n\tif ( authorDetails?.avatar_urls ) {\n\t\tObject.keys( authorDetails.avatar_urls ).forEach( ( size ) => {\n\t\t\tavatarSizes.push( {\n\t\t\t\tvalue: size,\n\t\t\t\tlabel: `${ size } x ${ size }`,\n\t\t\t} );\n\t\t} );\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\tconst authorOptions = authors?.length\n\t\t? authors.map( ( { id, name } ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: id,\n\t\t\t\t\tlabel: name,\n\t\t\t\t};\n\t\t } )\n\t\t: [];\n\n\tconst handleSelect = ( nextAuthorId ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tauthor: nextAuthorId,\n\t\t} );\n\t};\n\n\tconst showCombobox = authorOptions.length >= minimumUsersForCombobox;\n\tconst showAuthorControl =\n\t\t!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\tclassName=\"wp-block-post-author__inspector-settings\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showAuthorControl &&\n\t\t\t\t\t\t\t( ( showCombobox && (\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t\tallowReset={ false }\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<SelectControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show avatar' ) }\n\t\t\t\t\t\t\tchecked={ showAvatar }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showAvatar: ! showAvatar } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ showAvatar && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Avatar size' ) }\n\t\t\t\t\t\t\t\tvalue={ attributes.avatarSize }\n\t\t\t\t\t\t\t\toptions={ avatarSizes }\n\t\t\t\t\t\t\t\tonChange={ ( size ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tavatarSize: Number( size ),\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/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show bio' ) }\n\t\t\t\t\t\t\tchecked={ showBio }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showBio: ! showBio } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link author name to author page' ) }\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\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{ showAvatar && authorDetails?.avatar_urls && (\n\t\t\t\t\t<div className=\"wp-block-post-author__avatar\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\twidth={ attributes.avatarSize }\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tauthorDetails.avatar_urls[\n\t\t\t\t\t\t\t\t\tattributes.avatarSize\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={ authorDetails.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-post-author__content\">\n\t\t\t\t\t{ ( ! RichText.isEmpty( byline ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"byline\"\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__byline\"\n\t\t\t\t\t\t\taria-label={ __( 'Post author byline text' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Write byline…' ) }\n\t\t\t\t\t\t\tvalue={ byline }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { byline: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<p className=\"wp-block-post-author__name\">\n\t\t\t\t\t\t{ isLink ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"#post-author-pseudo-link\"\n\t\t\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ authorName }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tauthorName\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t{ showBio && (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__bio\"\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: authorDetails?.description,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAxB1D;AACA;AACA;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EAAC,2BAA2B;UACrC4C,uBAAuB,EAAG;YACzBC,MAAM,EAAE7E,aAAa,EAAE8E;UACxB;QAAG,CACH,CACD;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7F,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_data","_i18n","_coreData","_jsxRuntime","minimumUsersForCombobox","AUTHORS_QUERY","who","per_page","PostAuthorEdit","isSelected","context","postType","postId","queryId","attributes","setAttributes","isDescendentOfQueryLoop","Number","isFinite","authorId","authorDetails","authors","useSelect","select","getEditedEntityRecord","getUser","getUsers","coreStore","_authorId","author","editEntityRecord","useDispatch","textAlign","showAvatar","showBio","byline","isLink","linkTarget","avatarSizes","authorName","name","__","avatar_urls","Object","keys","forEach","size","push","value","label","blockProps","useBlockProps","className","clsx","authorOptions","length","map","id","handleSelect","nextAuthorId","showCombobox","showAuthorControl","jsxs","Fragment","children","jsx","InspectorControls","PanelBody","title","__experimentalVStack","spacing","ComboboxControl","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","allowReset","SelectControl","ToggleControl","checked","avatarSize","BlockControls","group","AlignmentControl","nextAlign","width","src","alt","RichText","isEmpty","identifier","placeholder","href","onClick","event","preventDefault","dangerouslySetInnerHTML","__html","description","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tComboboxControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst minimumUsersForCombobox = 25;\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n};\n\nfunction PostAuthorEdit( {\n\tisSelected,\n\tcontext: { postType, postId, queryId },\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { authorId, authorDetails, authors } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getUsers } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tauthors: getUsers( AUTHORS_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst { textAlign, showAvatar, showBio, byline, isLink, linkTarget } =\n\t\tattributes;\n\tconst avatarSizes = [];\n\tconst authorName = authorDetails?.name || __( 'Post Author' );\n\tif ( authorDetails?.avatar_urls ) {\n\t\tObject.keys( authorDetails.avatar_urls ).forEach( ( size ) => {\n\t\t\tavatarSizes.push( {\n\t\t\t\tvalue: size,\n\t\t\t\tlabel: `${ size } x ${ size }`,\n\t\t\t} );\n\t\t} );\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\tconst authorOptions = authors?.length\n\t\t? authors.map( ( { id, name } ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: id,\n\t\t\t\t\tlabel: name,\n\t\t\t\t};\n\t\t } )\n\t\t: [];\n\n\tconst handleSelect = ( nextAuthorId ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tauthor: nextAuthorId,\n\t\t} );\n\t};\n\n\tconst showCombobox = authorOptions.length >= minimumUsersForCombobox;\n\tconst showAuthorControl =\n\t\t!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\tclassName=\"wp-block-post-author__inspector-settings\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showAuthorControl &&\n\t\t\t\t\t\t\t( ( showCombobox && (\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t\tallowReset={ false }\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<SelectControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show avatar' ) }\n\t\t\t\t\t\t\tchecked={ showAvatar }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showAvatar: ! showAvatar } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ showAvatar && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Avatar size' ) }\n\t\t\t\t\t\t\t\tvalue={ attributes.avatarSize }\n\t\t\t\t\t\t\t\toptions={ avatarSizes }\n\t\t\t\t\t\t\t\tonChange={ ( size ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tavatarSize: Number( size ),\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/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show bio' ) }\n\t\t\t\t\t\t\tchecked={ showBio }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showBio: ! showBio } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link author name to author page' ) }\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\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{ showAvatar && authorDetails?.avatar_urls && (\n\t\t\t\t\t<div className=\"wp-block-post-author__avatar\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\twidth={ attributes.avatarSize }\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tauthorDetails.avatar_urls[\n\t\t\t\t\t\t\t\t\tattributes.avatarSize\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={ authorDetails.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-post-author__content\">\n\t\t\t\t\t{ ( ! RichText.isEmpty( byline ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"byline\"\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__byline\"\n\t\t\t\t\t\t\taria-label={ __( 'Post author byline text' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Write byline…' ) }\n\t\t\t\t\t\t\tvalue={ byline }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { byline: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<p className=\"wp-block-post-author__name\">\n\t\t\t\t\t\t{ isLink ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"#post-author-pseudo-link\"\n\t\t\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ authorName }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tauthorName\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t{ showBio && (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__bio\"\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: authorDetails?.description,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAxB1D;AACA;AACA;;AAGA;AACA;AACA;;AAmBA,MAAMO,uBAAuB,GAAG,EAAE;AAElC,MAAMC,aAAa,GAAG;EACrBC,GAAG,EAAE,SAAS;EACdC,QAAQ,EAAE;AACX,CAAC;AAED,SAASC,cAAcA,CAAE;EACxBC,UAAU;EACVC,OAAO,EAAE;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAQ,CAAC;EACtCC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAMC,uBAAuB,GAAGC,MAAM,CAACC,QAAQ,CAAEL,OAAQ,CAAC;EAC1D,MAAM;IAAEM,QAAQ;IAAEC,aA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;MAAC,CACE,CACL,eACD,IAAArC,WAAA,CAAA2D,IAAA;QAAKV,SAAS,EAAC,+BAA+B;QAAAY,QAAA,GAC3C,CAAE,CAAEwB,qBAAQ,CAACC,OAAO,CAAEtD,MAAO,CAAC,IAAI1B,UAAU,kBAC7C,IAAAN,WAAA,CAAA8D,GAAA,EAACnE,YAAA,CAAA0F,QAAQ;UACRE,UAAU,EAAC,QAAQ;UACnBtC,SAAS,EAAC,8BAA8B;UACxC,cAAa,IAAAX,QAAE,EAAE,yBAA0B,CAAG;UAC9CkD,WAAW,EAAG,IAAAlD,QAAE,EAAE,eAAgB,CAAG;UACrCO,KAAK,EAAGb,MAAQ;UAChBwC,QAAQ,EAAK3B,KAAK,IACjBjC,aAAa,CAAE;YAAEoB,MAAM,EAAEa;UAAM,CAAE;QACjC,CACD,CACD,eACD,IAAA7C,WAAA,CAAA8D,GAAA;UAAGb,SAAS,EAAC,4BAA4B;UAAAY,QAAA,EACtC5B,MAAM,gBACP,IAAAjC,WAAA,CAAA8D,GAAA;YACC2B,IAAI,EAAC,0BAA0B;YAC/BC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;YAAA/B,QAAA,EAE7CzB;UAAU,CACV,CAAC,GAEJA;QACA,CACC,CAAC,EACFL,OAAO,iBACR,IAAA/B,WAAA,CAAA8D,GAAA;UACCb,SAAS,EAAC,2BAA2B;UACrC4C,uBAAuB,EAAG;YACzBC,MAAM,EAAE7E,aAAa,EAAE8E;UACxB;QAAG,CACH,CACD;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7F,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_i18n","_coreData","_jsxRuntime","PostAuthorBiographyEdit","context","postType","postId","attributes","textAlign","setAttributes","authorDetails","useSelect","select","getEditedEntityRecord","getUser","coreStore","_authorId","author","blockProps","useBlockProps","className","clsx","displayAuthorBiography","description","__","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","dangerouslySetInnerHTML","__html","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author-biography/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} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostAuthorBiographyEdit( {\n\tcontext: { postType, postId },\n\tattributes: { textAlign },\n\tsetAttributes,\n} ) {\n\tconst { authorDetails } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\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\tconst displayAuthorBiography =\n\t\tauthorDetails?.description || __( 'Author Biography' );\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\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tdangerouslySetInnerHTML={ { __html: displayAuthorBiography } }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorBiographyEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAA0D,IAAAK,WAAA,GAAAL,OAAA;AAf1D;AACA;AACA;;AAGA;AACA;AACA;;AAUA,SAASM,uBAAuBA,CAAE;EACjCC,OAAO,EAAE;IAAEC,QAAQ;IAAEC;EAAO,CAAC;EAC7BC,UAAU,EAAE;IAAEC;EAAU,CAAC;EACzBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EAChCC,MAAM,IAAM;IACb,MAAM;MAAEC,qBAAqB;MAAEC;IAAQ,CAAC,GAAGF,MAAM,CAAEG,eAAU,CAAC;IAC9D,MAAMC,SAAS,GAAGH,qBAAqB,CACtC,UAAU,EACVR,QAAQ,EACRC,MACD,CAAC,EAAEW,MAAM;IAET,OAAO;MACNP,aAAa,EAAEM,SAAS,GAAGF,OAAO,CAAEE,SAAU,CAAC,GAAG;IACnD,CAAC;EACF,CAAC,EACD,CAAEX,QAAQ,EAAEC,MAAM,CACnB,CAAC;EAED,MAAMY,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_i18n","_coreData","_jsxRuntime","PostAuthorBiographyEdit","context","postType","postId","attributes","textAlign","setAttributes","authorDetails","useSelect","select","getEditedEntityRecord","getUser","coreStore","_authorId","author","blockProps","useBlockProps","className","clsx","displayAuthorBiography","description","__","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","dangerouslySetInnerHTML","__html","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author-biography/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} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostAuthorBiographyEdit( {\n\tcontext: { postType, postId },\n\tattributes: { textAlign },\n\tsetAttributes,\n} ) {\n\tconst { authorDetails } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\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\tconst displayAuthorBiography =\n\t\tauthorDetails?.description || __( 'Author Biography' );\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\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tdangerouslySetInnerHTML={ { __html: displayAuthorBiography } }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorBiographyEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF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aAAa,CAAE;YAAED,SAAS,EAAE0B;UAAU,CAAE,CAAC;QAC1C;MAAG,CACH;IAAC,CACY,CAAC,eAChB,IAAAhC,WAAA,CAAA0B,GAAA;MAAA,GACMV,UAAU;MACfiB,uBAAuB,EAAG;QAAEC,MAAM,EAAEd;MAAuB;IAAG,CAC9D,CAAC;EAAA,CACD,CAAC;AAEL;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcpC,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_i18n","_coreData","_components","_jsxRuntime","PostAuthorNameEdit","context","postType","postId","attributes","textAlign","isLink","linkTarget","setAttributes","authorName","useSelect","select","getEditedEntityRecord","getUser","coreStore","_authorId","author","blockProps","useBlockProps","className","clsx","displayName","name","__","displayAuthor","jsx","href","onClick","event","preventDefault","children","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author-name/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\n\nfunction PostAuthorNameEdit( {\n\tcontext: { postType, postId },\n\tattributes: { textAlign, isLink, linkTarget },\n\tsetAttributes,\n} ) {\n\tconst { authorName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorName: _authorId ? getUser( _authorId ) : null,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\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\tconst displayName = authorName?.name || __( 'Author Name' );\n\n\tconst displayAuthor = isLink ? (\n\t\t<a\n\t\t\thref=\"#author-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\tclassName=\"wp-block-post-author-name__link\"\n\t\t>\n\t\t\t{ displayName }\n\t\t</a>\n\t) : (\n\t\tdisplayName\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\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link to author archive' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }> { displayAuthor } </div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorNameEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAAiE,IAAAM,WAAA,GAAAN,OAAA;AAjBjE;AACA;AACA;;AAGA;AACA;AACA;;AAYA,SAASO,kBAAkBA,CAAE;EAC5BC,OAAO,EAAE;IAAEC,QAAQ;IAAEC;EAAO,CAAC;EAC7BC,UAAU,EAAE;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAW,CAAC;EAC7CC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IAAM;IACb,MAAM;MAAEC,qBAAqB;MAAEC;IAAQ,CAAC,GAAGF,MAAM,CAAEG,eAAU,CAAC;IAC9D,MAAMC,SAAS,GAAGH,qBAAqB,CACtC,UAAU,EACVV,QAAQ,EACRC,MACD,CAAC,EAAEa,MAAM;IAET,OAAO;MACNP,UAAU,EAAEM,SAAS,GAAGF,OAAO,CAAEE,SAAU,CAAC,GAAG;IAChD,CAAC;EACF,CAAC,EACD,CAAEb,QAAQ,EAAEC,MAAM,CACnB,CAAC;EAED,MAAMc,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_i18n","_coreData","_components","_jsxRuntime","PostAuthorNameEdit","context","postType","postId","attributes","textAlign","isLink","linkTarget","setAttributes","authorName","useSelect","select","getEditedEntityRecord","getUser","coreStore","_authorId","author","blockProps","useBlockProps","className","clsx","displayName","name","__","displayAuthor","jsx","href","onClick","event","preventDefault","children","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author-name/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\n\nfunction PostAuthorNameEdit( {\n\tcontext: { postType, postId },\n\tattributes: { textAlign, isLink, linkTarget },\n\tsetAttributes,\n} ) {\n\tconst { authorName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser } = select( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorName: _authorId ? getUser( _authorId ) : null,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\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\tconst displayName = authorName?.name || __( 'Author Name' );\n\n\tconst displayAuthor = isLink ? (\n\t\t<a\n\t\t\thref=\"#author-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\tclassName=\"wp-block-post-author-name__link\"\n\t\t>\n\t\t\t{ displayName }\n\t\t</a>\n\t) : (\n\t\tdisplayName\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\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link to author archive' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }> { displayAuthor } </div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorNameEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAAiE,IAAAM,WAAA,GAAAN,OAAA;AAjBjE;AACA;AACA;;AAGA;AACA;AACA;;AAYA,SAASO,kBAAkBA,CAAE;EAC5BC,OAAO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"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_apiFetch","_url","_i18n","_jsxRuntime","PostCommentsCountEdit","attributes","context","setAttributes","textAlign","postId","commentsCount","setCommentsCount","useState","blockProps","useBlockProps","className","clsx","useEffect","currentPostId","apiFetch","path","addQueryArgs","post","parse","then","res","headers","get","hasPostAndComments","undefined","blockStyles","style","textDecoration","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","Warning","__"],"sources":["@wordpress/block-library/src/post-comments-count/edit.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 { useState, useEffect } from '@wordpress/element';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PostCommentsCountEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! postId ) {\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} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst hasPostAndComments = postId && commentsCount !== undefined;\n\tconst blockStyles = {\n\t\t...blockProps.style,\n\t\ttextDecoration: hasPostAndComments\n\t\t\t? blockProps.style?.textDecoration\n\t\t\t: undefined,\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\t\t\t<div { ...blockProps } style={ blockStyles }>\n\t\t\t\t{ hasPostAndComments ? (\n\t\t\t\t\tcommentsCount\n\t\t\t\t) : (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __( 'Post Comments Count block: post not found.' ) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAqC,IAAAM,WAAA,GAAAN,OAAA;AAjBrC;AACA;AACA;;AAGA;AACA;AACA;;AAYe,SAASO,qBAAqBA,CAAE;EAC9CC,UAAU;EACVC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAU,CAAC,GAAGH,UAAU;EAChC,MAAM;IAAEI;EAAO,CAAC,GAAGH,OAAO;EAC1B,MAAM,CAAEI,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAC,CAAC;EACtD,MAAMC,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_apiFetch","_url","_i18n","_jsxRuntime","PostCommentsCountEdit","attributes","context","setAttributes","textAlign","postId","commentsCount","setCommentsCount","useState","blockProps","useBlockProps","className","clsx","useEffect","currentPostId","apiFetch","path","addQueryArgs","post","parse","then","res","headers","get","hasPostAndComments","undefined","blockStyles","style","textDecoration","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","Warning","__"],"sources":["@wordpress/block-library/src/post-comments-count/edit.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 { useState, useEffect } from '@wordpress/element';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PostCommentsCountEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! postId ) {\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} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst hasPostAndComments = postId && commentsCount !== undefined;\n\tconst blockStyles = {\n\t\t...blockProps.style,\n\t\ttextDecoration: hasPostAndComments\n\t\t\t? blockProps.style?.textDecoration\n\t\t\t: undefined,\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\t\t\t<div { ...blockProps } style={ blockStyles }>\n\t\t\t\t{ hasPostAndComments ? (\n\t\t\t\t\tcommentsCount\n\t\t\t\t) : (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __( 'Post Comments Count block: post not found.' ) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAqC,IAAAM,WAAA,GAAAN,OAAA;AAjBrC;AACA;AACA;;AAGA;AACA;AACA;;AAYe,SAASO,qBAAqBA,CAAE;EAC9CC,UAAU;EACVC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAU,CAAC,GAAGH,UAAU;EAChC,MAAM;IAAEI;EAAO,CAAC,GAAGH,OAAO;EAC1B,MAAM,CAAEI,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAC,CAAC;EACtD,MAAMC,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,CAAE,kBAAmBR,SAAS,EAAG,GAAIA;IACtC,CAAE;EACH,CAAE,CAAC;EAEH,IAAAS,kBAAS,EAAE,MAAM;IAChB,IAAK,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A6C,OAAO;QAAAR,QAAA,EACL,IAAAS,QAAE,EAAE,4CAA6C;MAAC,CAC5C;IACT,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_compose","_i18n","_form","_jsxRuntime","PostCommentsFormEdit","attributes","context","setAttributes","textAlign","postId","postType","instanceId","useInstanceId","instanceIdDesc","sprintf","blockProps","useBlockProps","className","clsx","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","default","VisuallyHidden","id","__"],"sources":["@wordpress/block-library/src/post-comments-form/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} from '@wordpress/block-editor';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CommentsForm from './form';\n\nexport default function PostCommentsFormEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId, postType } = context;\n\n\tconst instanceId = useInstanceId( PostCommentsFormEdit );\n\tconst instanceIdDesc = sprintf( 'comments-form-edit-%d-desc', instanceId );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t'aria-describedby': instanceIdDesc,\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\t\t\t<div { ...blockProps }>\n\t\t\t\t<CommentsForm postId={ postId } postType={ postType } />\n\t\t\t\t<VisuallyHidden id={ instanceIdDesc }>\n\t\t\t\t\t{ __( 'Comments form disabled in editor.' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAkC,IAAAM,WAAA,GAAAN,OAAA;AApBlC;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAGe,SAASO,oBAAoBA,CAAE;EAC7CC,UAAU;EACVC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAU,CAAC,GAAGH,UAAU;EAChC,MAAM;IAAEI,MAAM;IAAEC;EAAS,CAAC,GAAGJ,OAAO;EAEpC,MAAMK,UAAU,GAAG,IAAAC,sBAAa,EAAER,oBAAqB,CAAC;EACxD,MAAMS,cAAc,GAAG,IAAAC,aAAO,EAAE,4BAA4B,EAAEH,UAAW,CAAC;EAE1E,MAAMI,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_compose","_i18n","_form","_jsxRuntime","PostCommentsFormEdit","attributes","context","setAttributes","textAlign","postId","postType","instanceId","useInstanceId","instanceIdDesc","sprintf","blockProps","useBlockProps","className","clsx","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","default","VisuallyHidden","id","__"],"sources":["@wordpress/block-library/src/post-comments-form/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} from '@wordpress/block-editor';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CommentsForm from './form';\n\nexport default function PostCommentsFormEdit( {\n\tattributes,\n\tcontext,\n\tsetAttributes,\n} ) {\n\tconst { textAlign } = attributes;\n\tconst { postId, postType } = context;\n\n\tconst instanceId = useInstanceId( PostCommentsFormEdit );\n\tconst instanceIdDesc = sprintf( 'comments-form-edit-%d-desc', instanceId );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t'aria-describedby': instanceIdDesc,\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\t\t\t<div { ...blockProps }>\n\t\t\t\t<CommentsForm postId={ postId } postType={ postType } />\n\t\t\t\t<VisuallyHidden id={ instanceIdDesc }>\n\t\t\t\t\t{ __( 'Comments form disabled in editor.' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAkC,IAAAM,WAAA,G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EAAE,EAAGlB,cAAgB;QAAAQ,QAAA,EAClC,IAAAW,QAAE,EAAE,mCAAoC;MAAC,CAC5B,CAAC;IAAA,CACb,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
@@ -81,7 +81,7 @@ const CommentsForm = ({
|
|
|
81
81
|
});
|
|
82
82
|
} else if (!postTypeSupportsComments) {
|
|
83
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.Warning, {
|
|
84
|
-
children: (0, _i18n.sprintf)(
|
|
84
|
+
children: (0, _i18n.sprintf)(/* translators: 1: Post type (i.e. "post", "page") */
|
|
85
85
|
(0, _i18n.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType)
|
|
86
86
|
});
|
|
87
87
|
} else if ('open' !== defaultCommentStatus) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_blockEditor","_components","_compose","_coreData","_data","_jsxRuntime","CommentsFormPlaceholder","instanceId","useInstanceId","jsxs","className","children","jsx","__","noValidate","onSubmit","event","preventDefault","htmlFor","id","name","cols","rows","readOnly","type","clsx","__experimentalGetElementClassName","label","value","CommentsForm","postId","postType","commentStatus","setCommentStatus","useEntityProp","isSiteEditor","undefined","defaultCommentStatus","useSelect","select","blockEditorStore","getSettings","__experimentalDiscussionSettings","postTypeSupportsComments","coreStore","getPostType","supports","comments","actions","Button","__next40pxDefaultSize","onClick","variant","_x","Warning","sprintf","_default","exports","default"],"sources":["@wordpress/block-library/src/post-comments-form/form.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tWarning,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nconst CommentsFormPlaceholder = () => {\n\tconst instanceId = useInstanceId( CommentsFormPlaceholder );\n\n\treturn (\n\t\t<div className=\"comment-respond\">\n\t\t\t<h3 className=\"comment-reply-title\">{ __( 'Leave a Reply' ) }</h3>\n\t\t\t<form\n\t\t\t\tnoValidate\n\t\t\t\tclassName=\"comment-form\"\n\t\t\t\tonSubmit={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t<p>\n\t\t\t\t\t<label htmlFor={ `comment-${ instanceId }` }>\n\t\t\t\t\t\t{ __( 'Comment' ) }\n\t\t\t\t\t</label>\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tid={ `comment-${ instanceId }` }\n\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\treadOnly\n\t\t\t\t\t/>\n\t\t\t\t</p>\n\t\t\t\t<p className=\"form-submit wp-block-button\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Post Comment' ) }\n\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\taria-disabled=\"true\"\n\t\t\t\t\t/>\n\t\t\t\t</p>\n\t\t\t</form>\n\t\t</div>\n\t);\n};\n\nconst CommentsForm = ( { postId, postType } ) => {\n\tconst [ commentStatus, setCommentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst { defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\tconst actions = [\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tkey=\"enableComments\"\n\t\t\t\t\tonClick={ () => setCommentStatus( 'open' ) }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t>\n\t\t\t\t\t{ _x(\n\t\t\t\t\t\t'Enable comments',\n\t\t\t\t\t\t'action that affects the current post'\n\t\t\t\t\t) }\n\t\t\t\t</Button>,\n\t\t\t];\n\t\t\treturn (\n\t\t\t\t<Warning actions={ actions }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Post Comments Form block: Comments are not enabled for this item.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t);\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\treturn (\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Post Comments Form block: Comments are not enabled for this post type (%s).'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t);\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\treturn (\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Post Comments Form block: Comments are not enabled.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn <CommentsFormPlaceholder />;\n};\n\nexport default CommentsForm;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AAjB5C;AACA;AACA;;AAGA;AACA;AACA;;AAYA,MAAMQ,uBAAuB,GAAGA,CAAA,KAAM;EACrC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEF,uBAAwB,CAAC;EAE3D,oBACC,IAAAD,WAAA,CAAAI,IAAA;IAAKC,SAAS,EAAC,iBAAiB;IAAAC,QAAA,gBAC/B,IAAAN,WAAA,CAAAO,GAAA;MAAIF,SAAS,EAAC,qBAAqB;MAAAC,QAAA,EAAG,IAAAE,QAAE,EAAE,eAAgB;IAAC,CAAM,CAAC,eAClE,IAAAR,WAAA,CAAAI,IAAA;MACCK,UAAU;MACVJ,SAAS,EAAC,cAAc;MACxBK,QAAQ,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;MAAAN,QAAA,gBAEhD,IAAAN,WAAA,CAAAI,IAAA;QAAAE,QAAA,gBACC,IAAAN,WAAA,CAAAO,GAAA;UAAOM,OAAO,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_blockEditor","_components","_compose","_coreData","_data","_jsxRuntime","CommentsFormPlaceholder","instanceId","useInstanceId","jsxs","className","children","jsx","__","noValidate","onSubmit","event","preventDefault","htmlFor","id","name","cols","rows","readOnly","type","clsx","__experimentalGetElementClassName","label","value","CommentsForm","postId","postType","commentStatus","setCommentStatus","useEntityProp","isSiteEditor","undefined","defaultCommentStatus","useSelect","select","blockEditorStore","getSettings","__experimentalDiscussionSettings","postTypeSupportsComments","coreStore","getPostType","supports","comments","actions","Button","__next40pxDefaultSize","onClick","variant","_x","Warning","sprintf","_default","exports","default"],"sources":["@wordpress/block-library/src/post-comments-form/form.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tWarning,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nconst CommentsFormPlaceholder = () => {\n\tconst instanceId = useInstanceId( CommentsFormPlaceholder );\n\n\treturn (\n\t\t<div className=\"comment-respond\">\n\t\t\t<h3 className=\"comment-reply-title\">{ __( 'Leave a Reply' ) }</h3>\n\t\t\t<form\n\t\t\t\tnoValidate\n\t\t\t\tclassName=\"comment-form\"\n\t\t\t\tonSubmit={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t<p>\n\t\t\t\t\t<label htmlFor={ `comment-${ instanceId }` }>\n\t\t\t\t\t\t{ __( 'Comment' ) }\n\t\t\t\t\t</label>\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tid={ `comment-${ instanceId }` }\n\t\t\t\t\t\tname=\"comment\"\n\t\t\t\t\t\tcols=\"45\"\n\t\t\t\t\t\trows=\"8\"\n\t\t\t\t\t\treadOnly\n\t\t\t\t\t/>\n\t\t\t\t</p>\n\t\t\t\t<p className=\"form-submit wp-block-button\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"submit\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Post Comment' ) }\n\t\t\t\t\t\tvalue={ __( 'Post Comment' ) }\n\t\t\t\t\t\taria-disabled=\"true\"\n\t\t\t\t\t/>\n\t\t\t\t</p>\n\t\t\t</form>\n\t\t</div>\n\t);\n};\n\nconst CommentsForm = ( { postId, postType } ) => {\n\tconst [ commentStatus, setCommentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst { defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\tconst actions = [\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tkey=\"enableComments\"\n\t\t\t\t\tonClick={ () => setCommentStatus( 'open' ) }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t>\n\t\t\t\t\t{ _x(\n\t\t\t\t\t\t'Enable comments',\n\t\t\t\t\t\t'action that affects the current post'\n\t\t\t\t\t) }\n\t\t\t\t</Button>,\n\t\t\t];\n\t\t\treturn (\n\t\t\t\t<Warning actions={ actions }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Post Comments Form block: Comments are not enabled for this item.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t);\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\treturn (\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Post Comments Form block: Comments are not enabled for this post type (%s).'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t);\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\treturn (\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Post Comments Form block: Comments are not enabled.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn <CommentsFormPlaceholder />;\n};\n\nexport default CommentsForm;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AAjB5C;AACA;AACA;;AAGA;AACA;AACA;;AAYA,MAAMQ,uBAAuB,GAAGA,CAAA,KAAM;EACrC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEF,uBAAwB,CAAC;EAE3D,oBACC,IAAAD,WAAA,CAAAI,IAAA;IAAKC,SAAS,EAAC,iBAAiB;IAAAC,QAAA,gBAC/B,IAAAN,WAAA,CAAAO,GAAA;MAAIF,SAAS,EAAC,qBAAqB;MAAAC,QAAA,EAAG,IAAAE,QAAE,EAAE,eAAgB;IAAC,CAAM,CAAC,eAClE,IAAAR,WAAA,CAAAI,IAAA;MACCK,UAAU;MACVJ,SAAS,EAAC,cAAc;MACxBK,QAAQ,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;MAAAN,QAAA,gBAEhD,IAAAN,WAAA,CAAAI,IAAA;QAAAE,QAAA,gBACC,IAAAN,WAAA,CAAAO,GAAA;UAAOM,OAAO,EAAG,WAAYX,UAAU,EAAK;UAAAI,QAAA,EACzC,IAAAE,QAAE,EAAE,SAAU;QAAC,CACX,CAAC,eACR,IAAAR,WAAA,CAAAO,GAAA;UACCO,EAAE,EAAG,WAAYZ,UAAU,EAAK;UAChCa,IAAI,EAAC,SA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G;MACjC,MAAMgB,OAAO,GAAG,cACf,IAAA3C,WAAA,CAAAO,GAAA,EAACX,WAAA,CAAAgD,MAAM;QACNC,qBAAqB;QAErBC,OAAO,EAAGA,CAAA,KAAMlB,gBAAgB,CAAE,MAAO,CAAG;QAC5CmB,OAAO,EAAC,SAAS;QAAAzC,QAAA,EAEf,IAAA0C,QAAE,EACH,iBAAiB,EACjB,sCACD;MAAC,GAPG,gBAQG,CAAC,CACT;MACD,oBACC,IAAAhD,WAAA,CAAAO,GAAA,EAACZ,YAAA,CAAAsD,OAAO;QAACN,OAAO,EAAGA,OAAS;QAAArC,QAAA,EACzB,IAAAE,QAAE,EACH,mEACD;MAAC,CACO,CAAC;IAEZ,CAAC,MAAM,IAAK,CAAE8B,wBAAwB,EAAG;MACxC,oBACC,IAAAtC,WAAA,CAAAO,GAAA,EAACZ,YAAA,CAAAsD,OAAO;QAAA3C,QAAA,EACL,IAAA4C,aAAO,EACR;QACA,IAAA1C,QAAE,EACD,6EACD,CAAC,EACDkB,QACD;MAAC,CACO,CAAC;IAEZ,CAAC,MAAM,IAAK,MAAM,KAAKM,oBAAoB,EAAG;MAC7C,oBACC,IAAAhC,WAAA,CAAAO,GAAA,EAACZ,YAAA,CAAAsD,OAAO;QAAA3C,QAAA,EACL,IAAAE,QAAE,EACH,qDACD;MAAC,CACO,CAAC;IAEZ;EACD;EAEA,oBAAO,IAAAR,WAAA,CAAAO,GAAA,EAACN,uBAAuB,IAAE,CAAC;AACnC,CAAC;AAAC,IAAAkD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa7B,YAAY","ignoreList":[]}
|
|
@@ -70,7 +70,7 @@ function PostCommentsLinkEdit({
|
|
|
70
70
|
if (commentsNumber === 0) {
|
|
71
71
|
commentsText = (0, _i18n.__)('No comments');
|
|
72
72
|
} else {
|
|
73
|
-
commentsText = (0, _i18n.sprintf)(
|
|
73
|
+
commentsText = (0, _i18n.sprintf)(/* translators: %s: Number of comments */
|
|
74
74
|
(0, _i18n._n)('%s comment', '%s comments', commentsNumber), commentsNumber.toLocaleString());
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_data","_apiFetch","_url","_i18n","_coreData","_jsxRuntime","PostCommentsLinkEdit","context","attributes","setAttributes","textAlign","postType","postId","commentsCount","setCommentsCount","useState","blockProps","useBlockProps","className","clsx","useEffect","currentPostId","apiFetch","path","addQueryArgs","post","parse","then","res","headers","get","useSelect","select","coreStore","getEditedEntityRecord","link","commentsText","undefined","commentsNumber","parseInt","__","sprintf","_n","toLocaleString","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","href","onClick","event","preventDefault","Warning","_default","exports","default"],"sources":["@wordpress/block-library/src/post-comments-link/edit.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 { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostCommentsLinkEdit( { context, attributes, setAttributes } ) {\n\tconst { textAlign } = attributes;\n\tconst { postType, postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\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\tuseEffect( () => {\n\t\tif ( ! postId ) {\n\t\t\treturn;\n\t\t}\n\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} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst post = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t),\n\t\t[ postType, postId ]\n\t);\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\tconst { link } = post;\n\n\tlet commentsText;\n\tif ( commentsCount !== undefined ) {\n\t\tconst commentsNumber = parseInt( commentsCount );\n\n\t\tif ( commentsNumber === 0 ) {\n\t\t\tcommentsText = __( 'No comments' );\n\t\t} else {\n\t\t\tcommentsText = sprintf(\n\t\t\t\t/* translators: %s: Number of comments */\n\t\t\t\t_n( '%s comment', '%s comments', commentsNumber ),\n\t\t\t\tcommentsNumber.toLocaleString()\n\t\t\t);\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{ link && commentsText !== undefined ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ link + '#comments' }\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ commentsText }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __( 'Post Comments Link block: post not found.' ) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostCommentsLinkEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAA0D,IAAAQ,WAAA,GAAAR,OAAA;AAnB1D;AACA;AACA;;AAGA;AACA;AACA;;AAcA,SAASS,oBAAoBA,CAAE;EAAEC,OAAO;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EACvE,MAAM;IAAEC;EAAU,CAAC,GAAGF,UAAU;EAChC,MAAM;IAAEG,QAAQ;IAAEC;EAAO,CAAC,GAAGL,OAAO;EACpC,MAAM,CAAEM,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAC,CAAC;EAEtD,MAAMC,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_data","_apiFetch","_url","_i18n","_coreData","_jsxRuntime","PostCommentsLinkEdit","context","attributes","setAttributes","textAlign","postType","postId","commentsCount","setCommentsCount","useState","blockProps","useBlockProps","className","clsx","useEffect","currentPostId","apiFetch","path","addQueryArgs","post","parse","then","res","headers","get","useSelect","select","coreStore","getEditedEntityRecord","link","commentsText","undefined","commentsNumber","parseInt","__","sprintf","_n","toLocaleString","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","value","onChange","nextAlign","href","onClick","event","preventDefault","Warning","_default","exports","default"],"sources":["@wordpress/block-library/src/post-comments-link/edit.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 { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostCommentsLinkEdit( { context, attributes, setAttributes } ) {\n\tconst { textAlign } = attributes;\n\tconst { postType, postId } = context;\n\tconst [ commentsCount, setCommentsCount ] = useState();\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\tuseEffect( () => {\n\t\tif ( ! postId ) {\n\t\t\treturn;\n\t\t}\n\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} ),\n\t\t\tparse: false,\n\t\t} ).then( ( res ) => {\n\t\t\t// Stale requests will have the `currentPostId` of an older closure.\n\t\t\tif ( currentPostId === postId ) {\n\t\t\t\tsetCommentsCount( res.headers.get( 'X-WP-Total' ) );\n\t\t\t}\n\t\t} );\n\t}, [ postId ] );\n\n\tconst post = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t),\n\t\t[ postType, postId ]\n\t);\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\tconst { link } = post;\n\n\tlet commentsText;\n\tif ( commentsCount !== undefined ) {\n\t\tconst commentsNumber = parseInt( commentsCount );\n\n\t\tif ( commentsNumber === 0 ) {\n\t\t\tcommentsText = __( 'No comments' );\n\t\t} else {\n\t\t\tcommentsText = sprintf(\n\t\t\t\t/* translators: %s: Number of comments */\n\t\t\t\t_n( '%s comment', '%s comments', commentsNumber ),\n\t\t\t\tcommentsNumber.toLocaleString()\n\t\t\t);\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{ link && commentsText !== undefined ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ link + '#comments' }\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ commentsText }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ __( 'Post Comments Link block: post not found.' ) }\n\t\t\t\t\t</Warning>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostCommentsLinkEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAA0D,IAAAQ,WAAA,GAAAR,OAAA;AAnB1D;AACA;AACA;;AAGA;AACA;AACA;;AAcA,SAASS,oBAAoBA,CAAE;EAAEC,OAAO;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EACvE,MAAM;IAAEC;EAAU,CAAC,GAAGF,UAAU;EAChC,MAAM;IAAEG,QAAQ;IAAEC;EAAO,CAAC,GAAGL,OAAO;EACp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G,IAAAK,aAAO,EACrB;MACA,IAAAC,QAAE,EAAE,YAAY,EAAE,aAAa,EAAEJ,cAAe,CAAC,EACjDA,cAAc,CAACK,cAAc,CAAC,CAC/B,CAAC;IACF;EACD;EAEA,oBACC,IAAAtC,WAAA,CAAAuC,IAAA,EAAAvC,WAAA,CAAAwC,QAAA;IAAAC,QAAA,gBACC,IAAAzC,WAAA,CAAA0C,GAAA,EAACjD,YAAA,CAAAkD,aAAa;MAACC,KAAK,EAAC,OAAO;MAAAH,QAAA,eAC3B,IAAAzC,WAAA,CAAA0C,GAAA,EAACjD,YAAA,CAAAoD,gBAAgB;QAChBC,KAAK,EAAGzC,SAAW;QACnB0C,QAAQ,EAAKC,SAAS,IAAM;UAC3B5C,aAAa,CAAE;YAAEC,SAAS,EAAE2C;UAAU,CAAE,CAAC;QAC1C;MAAG,CACH;IAAC,CACY,CAAC,eAEhB,IAAAhD,WAAA,CAAA0C,GAAA;MAAA,GAAU/B,UAAU;MAAA8B,QAAA,EACjBX,IAAI,IAAIC,YAAY,KAAKC,SAAS,gBACnC,IAAAhC,WAAA,CAAA0C,GAAA;QACCO,IAAI,EAAGnB,IAAI,GAAG,WAAa;QAC3BoB,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAAX,QAAA,EAE7CV;MAAY,CACZ,CAAC,gBAEJ,IAAA/B,WAAA,CAAA0C,GAAA,EAACjD,YAAA,CAAA4D,OAAO;QAAAZ,QAAA,EACL,IAAAN,QAAE,EAAE,2CAA4C;MAAC,CAC3C;IACT,CACG,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvD,oBAAoB","ignoreList":[]}
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = PostContentEdit;
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
8
|
var _blockEditor = require("@wordpress/block-editor");
|
|
9
|
+
var _blocks = require("@wordpress/blocks");
|
|
9
10
|
var _coreData = require("@wordpress/core-data");
|
|
10
11
|
var _data = require("@wordpress/data");
|
|
12
|
+
var _element = require("@wordpress/element");
|
|
11
13
|
var _hooks = require("../utils/hooks");
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
15
|
/**
|
|
@@ -19,6 +21,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
21
|
*/
|
|
20
22
|
|
|
21
23
|
function ReadOnlyContent({
|
|
24
|
+
parentLayout,
|
|
22
25
|
layoutClassNames,
|
|
23
26
|
userCanEdit,
|
|
24
27
|
postType,
|
|
@@ -28,7 +31,28 @@ function ReadOnlyContent({
|
|
|
28
31
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
29
32
|
className: layoutClassNames
|
|
30
33
|
});
|
|
31
|
-
|
|
34
|
+
const blocks = (0, _element.useMemo)(() => {
|
|
35
|
+
return content?.raw ? (0, _blocks.parse)(content.raw) : [];
|
|
36
|
+
}, [content?.raw]);
|
|
37
|
+
const blockPreviewProps = (0, _blockEditor.__experimentalUseBlockPreview)({
|
|
38
|
+
blocks,
|
|
39
|
+
props: blockProps,
|
|
40
|
+
layout: parentLayout
|
|
41
|
+
});
|
|
42
|
+
if (userCanEdit) {
|
|
43
|
+
/*
|
|
44
|
+
* Rendering the block preview using the raw content blocks allows for
|
|
45
|
+
* block support styles to be generated and applied by the editor.
|
|
46
|
+
*
|
|
47
|
+
* The preview using the raw blocks can only be presented to users with
|
|
48
|
+
* edit permissions for the post to prevent potential exposure of private
|
|
49
|
+
* block content.
|
|
50
|
+
*/
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
52
|
+
...blockPreviewProps
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return content?.protected ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
32
56
|
...blockProps,
|
|
33
57
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.Warning, {
|
|
34
58
|
children: (0, _i18n.__)('This content is password protected.')
|
|
@@ -85,6 +109,7 @@ function Content(props) {
|
|
|
85
109
|
return isEditable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(EditableContent, {
|
|
86
110
|
...props
|
|
87
111
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ReadOnlyContent, {
|
|
112
|
+
parentLayout: props.parentLayout,
|
|
88
113
|
layoutClassNames: layoutClassNames,
|
|
89
114
|
userCanEdit: userCanEdit,
|
|
90
115
|
postType: postType,
|
|
@@ -119,7 +144,8 @@ function RecursionError() {
|
|
|
119
144
|
}
|
|
120
145
|
function PostContentEdit({
|
|
121
146
|
context,
|
|
122
|
-
__unstableLayoutClassNames: layoutClassNames
|
|
147
|
+
__unstableLayoutClassNames: layoutClassNames,
|
|
148
|
+
__unstableParentLayout: parentLayout
|
|
123
149
|
}) {
|
|
124
150
|
const {
|
|
125
151
|
postId: contextPostId,
|
|
@@ -133,6 +159,7 @@ function PostContentEdit({
|
|
|
133
159
|
uniqueId: contextPostId,
|
|
134
160
|
children: contextPostId && contextPostType ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, {
|
|
135
161
|
context: context,
|
|
162
|
+
parentLayout: parentLayout,
|
|
136
163
|
layoutClassNames: layoutClassNames
|
|
137
164
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Placeholder, {
|
|
138
165
|
layoutClassNames: layoutClassNames
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","_coreData","_data","_hooks","_jsxRuntime","ReadOnlyContent","layoutClassNames","userCanEdit","postType","postId","content","useEntityProp","blockProps","useBlockProps","className","protected","jsx","children","Warning","__","dangerouslySetInnerHTML","__html","rendered","EditableContent","context","blocks","onInput","onChange","useEntityBlockEditor","id","entityRecord","useSelect","select","coreStore","getEntityRecord","hasInnerBlocks","raw","length","initialInnerBlocks","props","useInnerBlocksProps","value","template","undefined","Content","queryId","useCanEditEntity","isDescendentOfQueryLoop","Number","isFinite","isEditable","Placeholder","jsxs","RecursionError","PostContentEdit","__unstableLayoutClassNames","contextPostId","contextPostType","hasAlreadyRendered","useHasRecursion","RecursionProvider","uniqueId"],"sources":["@wordpress/block-library/src/post-content/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tWarning,\n} from '@wordpress/block-editor';\nimport {\n\tuseEntityProp,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nfunction ReadOnlyContent( {\n\tlayoutClassNames,\n\tuserCanEdit,\n\tpostType,\n\tpostId,\n} ) {\n\tconst [ , , content ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\treturn content?.protected && ! userCanEdit ? (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>{ __( 'This content is password protected.' ) }</Warning>\n\t\t</div>\n\t) : (\n\t\t<div\n\t\t\t{ ...blockProps }\n\t\t\tdangerouslySetInnerHTML={ { __html: content?.rendered } }\n\t\t></div>\n\t);\n}\n\nfunction EditableContent( { context = {} } ) {\n\tconst { postType, postId } = context;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpostType,\n\t\t{ id: postId }\n\t);\n\n\tconst entityRecord = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst hasInnerBlocks = !! entityRecord?.content?.raw || blocks?.length;\n\n\tconst initialInnerBlocks = [ [ 'core/paragraph' ] ];\n\n\tconst props = useInnerBlocksProps(\n\t\tuseBlockProps( { className: 'entry-content' } ),\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplate: ! hasInnerBlocks ? initialInnerBlocks : undefined,\n\t\t}\n\t);\n\treturn <div { ...props } />;\n}\n\nfunction Content( props ) {\n\tconst { context: { queryId, postType, postId } = {}, layoutClassNames } =\n\t\tprops;\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tif ( userCanEdit === undefined ) {\n\t\treturn null;\n\t}\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\n\treturn isEditable ? (\n\t\t<EditableContent { ...props } />\n\t) : (\n\t\t<ReadOnlyContent\n\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\tuserCanEdit={ userCanEdit }\n\t\t\tpostType={ postType }\n\t\t\tpostId={ postId }\n\t\t/>\n\t);\n}\n\nfunction Placeholder( { layoutClassNames } ) {\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'This is the Content block, it will display all the blocks in any single post or page.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n\nfunction RecursionError() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nexport default function PostContentEdit( {\n\tcontext,\n\t__unstableLayoutClassNames: layoutClassNames,\n} ) {\n\tconst { postId: contextPostId, postType: contextPostType } = context;\n\tconst hasAlreadyRendered = useHasRecursion( contextPostId );\n\n\tif ( contextPostId && contextPostType && hasAlreadyRendered ) {\n\t\treturn <RecursionError />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ contextPostId }>\n\t\t\t{ contextPostId && contextPostType ? (\n\t\t\t\t<Content\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Placeholder layoutClassNames={ layoutClassNames } />\n\t\t\t) }\n\t\t</RecursionProvider>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AApBlD;AACA;AACA;;AAeA;AACA;AACA;;AAGA,SAASM,eAAeA,CAAE;EACzBC,gBAAgB;EAChBC,WAAW;EACXC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM,IAAMC,OAAO,CAAE,GAAG,IAAAC,uBAAa,EACpC,UAAU,EACVH,QAAQ,EACR,SAAS,EACTC,MACD,CAAC;EACD,MAAMG,UAAU,GAAG,IAAAC,0BAAa,EAAE;IAAEC,SAAS,EAAER;EAAiB,CAAE,CAAC;EACnE,OAAOI,OAAO,EAAEK,SAAS,IAAI,CAAER,WAAW,gBACzC,IAAAH,WAAA,CAAAY,GAAA;IAAA,GAAUJ,UAAU;IAAAK,QAAA,eACnB,IAAAb,WAAA,CAAAY,GAAA,EAAChB,YAAA,CAAAkB,OAAO;MAAAD,QAAA,EA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G,IAAAC,0BAAa,EAAC,CAAC;EAClC,oBACC,IAAAT,WAAA,CAAAY,GAAA;IAAA,GAAUJ,UAAU;IAAAK,QAAA,eACnB,IAAAb,WAAA,CAAAY,GAAA,EAAChB,YAAA,CAAAkB,OAAO;MAAAD,QAAA,EACL,IAAAE,QAAE,EAAE,yCAA0C;IAAC,CACzC;EAAC,CACN,CAAC;AAER;AAEe,SAASmC,eAAeA,CAAE;EACxC9B,OAAO;EACP+B,0BAA0B,EAAEjD;AAC7B,CAAC,EAAG;EACH,MAAM;IAAEG,MAAM,EAAE+C,aAAa;IAAEhD,QAAQ,EAAEiD;EAAgB,CAAC,GAAGjC,OAAO;EACpE,MAAMkC,kBAAkB,GAAG,IAAAC,4BAAe,EAAEH,aAAc,CAAC;EAE3D,IAAKA,aAAa,IAAIC,eAAe,IAAIC,kBAAkB,EAAG;IAC7D,oBAAO,IAAAtD,WAAA,CAAAY,GAAA,EAACqC,cAAc,IAAE,CAAC;EAC1B;EAEA,oBACC,IAAAjD,WAAA,CAAAY,GAAA,EAAChB,YAAA,CAAA4D,iBAAiB;IAACC,QAAQ,EAAGL,aAAe;IAAAvC,QAAA,EAC1CuC,aAAa,IAAIC,eAAe,gBACjC,IAAArD,WAAA,CAAAY,GAAA,EAAC4B,OAAO;MACPpB,OAAO,EAAGA,OAAS;MACnBlB,gBAAgB,EAAGA;IAAkB,CACrC,CAAC,gBAEF,IAAAF,WAAA,CAAAY,GAAA,EAACmC,WAAW;MAAC7C,gBAAgB,EAAGA;IAAkB,CAAE;EACpD,CACiB,CAAC;AAEtB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","_blocks","_coreData","_data","_element","_hooks","_jsxRuntime","ReadOnlyContent","parentLayout","layoutClassNames","userCanEdit","postType","postId","content","useEntityProp","blockProps","useBlockProps","className","blocks","useMemo","raw","parse","blockPreviewProps","useBlockPreview","props","layout","jsx","protected","children","Warning","__","dangerouslySetInnerHTML","__html","rendered","EditableContent","context","onInput","onChange","useEntityBlockEditor","id","entityRecord","useSelect","select","coreStore","getEntityRecord","hasInnerBlocks","length","initialInnerBlocks","useInnerBlocksProps","value","template","undefined","Content","queryId","useCanEditEntity","isDescendentOfQueryLoop","Number","isFinite","isEditable","Placeholder","jsxs","RecursionError","PostContentEdit","__unstableLayoutClassNames","__unstableParentLayout","contextPostId","contextPostType","hasAlreadyRendered","useHasRecursion","RecursionProvider","uniqueId"],"sources":["@wordpress/block-library/src/post-content/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tWarning,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tuseEntityProp,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nfunction ReadOnlyContent( {\n\tparentLayout,\n\tlayoutClassNames,\n\tuserCanEdit,\n\tpostType,\n\tpostId,\n} ) {\n\tconst [ , , content ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\tconst blocks = useMemo( () => {\n\t\treturn content?.raw ? parse( content.raw ) : [];\n\t}, [ content?.raw ] );\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: blockProps,\n\t\tlayout: parentLayout,\n\t} );\n\n\tif ( userCanEdit ) {\n\t\t/*\n\t\t * Rendering the block preview using the raw content blocks allows for\n\t\t * block support styles to be generated and applied by the editor.\n\t\t *\n\t\t * The preview using the raw blocks can only be presented to users with\n\t\t * edit permissions for the post to prevent potential exposure of private\n\t\t * block content.\n\t\t */\n\t\treturn <div { ...blockPreviewProps }></div>;\n\t}\n\n\treturn content?.protected ? (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>{ __( 'This content is password protected.' ) }</Warning>\n\t\t</div>\n\t) : (\n\t\t<div\n\t\t\t{ ...blockProps }\n\t\t\tdangerouslySetInnerHTML={ { __html: content?.rendered } }\n\t\t></div>\n\t);\n}\n\nfunction EditableContent( { context = {} } ) {\n\tconst { postType, postId } = context;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpostType,\n\t\t{ id: postId }\n\t);\n\n\tconst entityRecord = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst hasInnerBlocks = !! entityRecord?.content?.raw || blocks?.length;\n\n\tconst initialInnerBlocks = [ [ 'core/paragraph' ] ];\n\n\tconst props = useInnerBlocksProps(\n\t\tuseBlockProps( { className: 'entry-content' } ),\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplate: ! hasInnerBlocks ? initialInnerBlocks : undefined,\n\t\t}\n\t);\n\treturn <div { ...props } />;\n}\n\nfunction Content( props ) {\n\tconst { context: { queryId, postType, postId } = {}, layoutClassNames } =\n\t\tprops;\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tif ( userCanEdit === undefined ) {\n\t\treturn null;\n\t}\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\n\treturn isEditable ? (\n\t\t<EditableContent { ...props } />\n\t) : (\n\t\t<ReadOnlyContent\n\t\t\tparentLayout={ props.parentLayout }\n\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\tuserCanEdit={ userCanEdit }\n\t\t\tpostType={ postType }\n\t\t\tpostId={ postId }\n\t\t/>\n\t);\n}\n\nfunction Placeholder( { layoutClassNames } ) {\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'This is the Content block, it will display all the blocks in any single post or page.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n\nfunction RecursionError() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nexport default function PostContentEdit( {\n\tcontext,\n\t__unstableLayoutClassNames: layoutClassNames,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst { postId: contextPostId, postType: contextPostType } = context;\n\tconst hasAlreadyRendered = useHasRecursion( contextPostId );\n\n\tif ( contextPostId && contextPostType && hasAlreadyRendered ) {\n\t\treturn <RecursionError />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ contextPostId }>\n\t\t\t{ contextPostId && contextPostType ? (\n\t\t\t\t<Content\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Placeholder layoutClassNames={ layoutClassNames } />\n\t\t\t) }\n\t\t</RecursionProvider>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC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