@wordpress/editor 14.12.0 → 14.13.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/README.md +120 -99
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +17 -65
- package/build/components/collab-sidebar/add-comment.js.map +1 -1
- package/build/components/collab-sidebar/comment-author-info.js +76 -0
- package/build/components/collab-sidebar/comment-author-info.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +2 -2
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
- package/build/components/collab-sidebar/comment-button.js +2 -2
- package/build/components/collab-sidebar/comment-button.js.map +1 -1
- package/build/components/collab-sidebar/comment-form.js +64 -0
- package/build/components/collab-sidebar/comment-form.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +33 -91
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +1 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +10 -3
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +4 -4
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +8 -8
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-tools/index.js +1 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-history/redo.js +1 -1
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +1 -1
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/content-slot-fill.js +1 -10
- package/build/components/editor-interface/content-slot-fill.js.map +1 -1
- package/build/components/editor-interface/index.js +3 -9
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +1 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +9 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/index.js +2 -2
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/page-attributes/check.js +3 -3
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +1 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +1 -1
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js +2 -2
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +2 -1
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +2 -2
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-post-status-info/index.js +4 -4
- package/build/components/plugin-post-status-info/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +2 -2
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +2 -1
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +1 -0
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js +2 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/post-actions/actions.js +3 -3
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-author/check.js +3 -3
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/index.js +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +1 -1
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +9 -4
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +1 -1
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +1 -1
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +3 -3
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/panel.js +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +4 -4
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js +3 -3
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +39 -9
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +1 -1
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-fields/index.js +70 -0
- package/build/components/post-fields/index.js.map +1 -0
- package/build/components/post-format/check.js +9 -12
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +1 -1
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-last-revision/check.js +3 -3
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js +1 -1
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +3 -3
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +1 -1
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +5 -2
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-schedule/check.js +3 -3
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +1 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +1 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/check.js +3 -3
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +1 -1
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +3 -3
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +1 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +1 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +3 -3
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/panel.js +16 -13
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -2
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/panel.js +1 -1
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-text-editor/index.js +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +20 -18
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +1 -1
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-trash/check.js +3 -3
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +1 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +6 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +3 -3
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +1 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js +1 -1
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +1 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/check.js +1 -1
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +87 -0
- package/build/components/preferences-modal/block-visibility.js.map +1 -0
- package/build/components/preferences-modal/enable-panel.js +27 -19
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +13 -10
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -2
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/index.js +14 -8
- package/build/components/provider/index.js.map +1 -1
- package/build/components/table-of-contents/index.js +1 -1
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +4 -4
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js +1 -1
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js +1 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +8 -3
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/api.js +41 -0
- package/build/dataviews/api.js.map +1 -1
- package/build/dataviews/store/private-actions.js +26 -4
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/private-selectors.js +5 -0
- package/build/dataviews/store/private-selectors.js.map +1 -1
- package/build/dataviews/store/reducer.js +23 -0
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/private-apis.js +4 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +11 -9
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +5 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.native.js +1 -0
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +34 -42
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-template-info.js +60 -0
- package/build/utils/get-template-info.js.map +1 -0
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +18 -67
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-author-info.js +71 -0
- package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +2 -2
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-button.js +2 -2
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-form.js +59 -0
- package/build-module/components/collab-sidebar/comment-form.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +33 -91
- package/build-module/components/collab-sidebar/comments.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +10 -3
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +4 -4
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +8 -8
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +1 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +1 -1
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +1 -1
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/content-slot-fill.js +2 -11
- package/build-module/components/editor-interface/content-slot-fill.js.map +1 -1
- package/build-module/components/editor-interface/index.js +4 -10
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +1 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +9 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -2
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +3 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +1 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +1 -1
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +1 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +2 -2
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +2 -1
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +2 -2
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-status-info/index.js +4 -4
- package/build-module/components/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +2 -2
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +2 -1
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +1 -0
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +3 -3
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-author/check.js +3 -3
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +1 -1
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -4
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +1 -1
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -1
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +3 -3
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +4 -4
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +3 -3
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +40 -10
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js +1 -1
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-fields/index.js +62 -0
- package/build-module/components/post-fields/index.js.map +1 -0
- package/build-module/components/post-format/check.js +10 -11
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -1
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +3 -3
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-last-revision/panel.js +1 -1
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +3 -3
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +1 -1
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +5 -2
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +3 -3
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +1 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +1 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/check.js +3 -3
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +1 -1
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +3 -3
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +1 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +3 -3
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js +17 -12
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +2 -2
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/panel.js +1 -1
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -1
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +20 -18
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +1 -1
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-trash/check.js +3 -3
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -1
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +6 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +3 -3
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +1 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/check.js +1 -1
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -1
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +80 -0
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -0
- package/build-module/components/preferences-modal/enable-panel.js +27 -19
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +13 -10
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +2 -2
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/index.js +14 -8
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +1 -1
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +4 -4
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js +1 -1
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js +1 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +8 -3
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/api.js +39 -0
- package/build-module/dataviews/api.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +23 -3
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/private-selectors.js +4 -0
- package/build-module/dataviews/store/private-selectors.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +23 -0
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/private-apis.js +4 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +11 -9
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +6 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.native.js +2 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +33 -39
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-template-info.js +51 -0
- package/build-module/utils/get-template-info.js.map +1 -0
- package/build-style/style-rtl.css +11 -81
- package/build-style/style.css +11 -81
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +2 -2
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +2 -2
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +17 -0
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-form.d.ts +18 -0
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +2 -2
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +2 -2
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-outline/check.d.ts +5 -5
- package/build-types/components/document-outline/check.d.ts.map +1 -1
- package/build-types/components/document-outline/index.d.ts +4 -6
- package/build-types/components/document-outline/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/content-slot-fill.d.ts +12 -1
- package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/editor-notices/index.d.ts +2 -2
- package/build-types/components/editor-notices/index.d.ts.map +1 -1
- package/build-types/components/editor-snackbars/index.d.ts +2 -2
- package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts +4 -4
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/page-attributes/check.d.ts +5 -5
- package/build-types/components/page-attributes/check.d.ts.map +1 -1
- package/build-types/components/page-attributes/order.d.ts +2 -2
- package/build-types/components/page-attributes/order.d.ts.map +1 -1
- package/build-types/components/page-attributes/panel.d.ts +2 -2
- package/build-types/components/page-attributes/panel.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts +2 -2
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts +4 -4
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +4 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts +4 -4
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts +6 -6
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.d.ts +4 -4
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +4 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts +2 -0
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +4 -2
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/post-author/check.d.ts +5 -5
- package/build-types/components/post-author/check.d.ts.map +1 -1
- package/build-types/components/post-author/index.d.ts +2 -2
- package/build-types/components/post-author/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts +2 -2
- package/build-types/components/post-author/panel.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-discussion/panel.d.ts +2 -2
- package/build-types/components/post-discussion/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/check.d.ts +5 -5
- package/build-types/components/post-excerpt/check.d.ts.map +1 -1
- package/build-types/components/post-excerpt/panel.d.ts +2 -2
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.d.ts +6 -6
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
- package/build-types/components/post-featured-image/check.d.ts +5 -5
- package/build-types/components/post-featured-image/check.d.ts.map +1 -1
- package/build-types/components/post-featured-image/panel.d.ts +2 -2
- package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
- package/build-types/components/post-fields/index.d.ts +12 -0
- package/build-types/components/post-fields/index.d.ts.map +1 -0
- package/build-types/components/post-format/check.d.ts +11 -4
- package/build-types/components/post-format/check.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts +2 -2
- package/build-types/components/post-format/index.d.ts.map +1 -1
- package/build-types/components/post-format/panel.d.ts +2 -2
- package/build-types/components/post-format/panel.d.ts.map +1 -1
- package/build-types/components/post-last-revision/check.d.ts +5 -5
- package/build-types/components/post-last-revision/check.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts +2 -2
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/panel.d.ts +2 -2
- package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts +2 -2
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-pending-status/check.d.ts +5 -5
- package/build-types/components/post-pending-status/check.d.ts.map +1 -1
- package/build-types/components/post-pending-status/index.d.ts +2 -2
- package/build-types/components/post-pending-status/index.d.ts.map +1 -1
- package/build-types/components/post-preview-button/index.d.ts +2 -2
- package/build-types/components/post-preview-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/check.d.ts +5 -5
- package/build-types/components/post-schedule/check.d.ts.map +1 -1
- package/build-types/components/post-schedule/index.d.ts +2 -2
- package/build-types/components/post-schedule/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/label.d.ts +2 -2
- package/build-types/components/post-schedule/label.d.ts.map +1 -1
- package/build-types/components/post-schedule/panel.d.ts +2 -2
- package/build-types/components/post-schedule/panel.d.ts.map +1 -1
- package/build-types/components/post-slug/check.d.ts +5 -5
- package/build-types/components/post-slug/check.d.ts.map +1 -1
- package/build-types/components/post-slug/index.d.ts +2 -2
- package/build-types/components/post-slug/index.d.ts.map +1 -1
- package/build-types/components/post-sticky/check.d.ts +5 -5
- package/build-types/components/post-sticky/check.d.ts.map +1 -1
- package/build-types/components/post-sticky/index.d.ts +2 -2
- package/build-types/components/post-sticky/index.d.ts.map +1 -1
- package/build-types/components/post-switch-to-draft-button/index.d.ts +2 -2
- package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
- package/build-types/components/post-sync-status/index.d.ts +2 -2
- package/build-types/components/post-sync-status/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts +5 -5
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +2 -2
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/panel.d.ts +6 -2
- package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
- package/build-types/components/post-template/panel.d.ts +2 -2
- package/build-types/components/post-template/panel.d.ts.map +1 -1
- package/build-types/components/post-text-editor/index.d.ts +2 -2
- package/build-types/components/post-text-editor/index.d.ts.map +1 -1
- package/build-types/components/post-title/index.d.ts +1 -1
- package/build-types/components/post-trash/check.d.ts +5 -5
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-trash/index.d.ts +2 -2
- package/build-types/components/post-trash/index.d.ts.map +1 -1
- package/build-types/components/post-type-support-check/index.d.ts +8 -8
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
- package/build-types/components/post-url/check.d.ts +5 -5
- package/build-types/components/post-url/check.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts +2 -2
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/label.d.ts +2 -2
- package/build-types/components/post-url/label.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts +2 -2
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/post-visibility/check.d.ts +2 -2
- package/build-types/components/post-visibility/check.d.ts.map +1 -1
- package/build-types/components/post-visibility/index.d.ts +2 -2
- package/build-types/components/post-visibility/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/block-visibility.d.ts +2 -0
- package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-panel.d.ts +1 -2
- package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +1 -2
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts +2 -2
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/theme-support-check/index.d.ts +6 -6
- package/build-types/components/theme-support-check/index.d.ts.map +1 -1
- package/build-types/components/time-to-read/index.d.ts +2 -2
- package/build-types/components/time-to-read/index.d.ts.map +1 -1
- package/build-types/components/unsaved-changes-warning/index.d.ts +2 -2
- package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
- package/build-types/components/word-count/index.d.ts +2 -2
- package/build-types/components/word-count/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/dataviews/api.d.ts +24 -0
- package/build-types/dataviews/api.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +14 -2
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/private-selectors.d.ts +1 -0
- package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +10 -2
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +7 -5
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +1 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +5 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +4 -11
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/get-template-info.d.ts +6 -0
- package/build-types/utils/get-template-info.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
- package/src/components/collab-sidebar/add-comment.js +21 -78
- package/src/components/collab-sidebar/comment-author-info.js +68 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +3 -3
- package/src/components/collab-sidebar/comment-button.js +3 -3
- package/src/components/collab-sidebar/comment-form.js +62 -0
- package/src/components/collab-sidebar/comments.js +39 -101
- package/src/components/create-template-part-modal/index.js +3 -2
- package/src/components/document-bar/index.js +12 -3
- package/src/components/document-outline/check.js +4 -4
- package/src/components/document-outline/index.js +9 -9
- package/src/components/document-tools/index.js +3 -2
- package/src/components/editor-history/redo.js +1 -1
- package/src/components/editor-history/undo.js +1 -1
- package/src/components/editor-interface/content-slot-fill.js +4 -9
- package/src/components/editor-interface/index.js +1 -11
- package/src/components/editor-notices/index.js +1 -1
- package/src/components/editor-snackbars/index.js +1 -1
- package/src/components/entities-saved-states/entity-record-item.js +12 -4
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/header/style.scss +2 -1
- package/src/components/page-attributes/check.js +3 -3
- package/src/components/page-attributes/order.js +1 -1
- package/src/components/page-attributes/panel.js +1 -1
- package/src/components/page-attributes/parent.js +1 -1
- package/src/components/plugin-document-setting-panel/index.js +2 -2
- package/src/components/plugin-more-menu-item/index.js +2 -1
- package/src/components/plugin-post-publish-panel/index.js +2 -2
- package/src/components/plugin-post-status-info/index.js +4 -4
- package/src/components/plugin-pre-publish-panel/index.js +2 -2
- package/src/components/plugin-preview-menu-item/index.js +2 -1
- package/src/components/plugin-sidebar/index.js +1 -0
- package/src/components/plugin-sidebar-more-menu-item/index.js +2 -2
- package/src/components/post-actions/actions.js +3 -3
- package/src/components/post-author/check.js +3 -3
- package/src/components/post-author/index.js +1 -1
- package/src/components/post-author/panel.js +1 -1
- package/src/components/post-card-panel/index.js +18 -5
- package/src/components/post-comments/index.js +1 -1
- package/src/components/post-discussion/panel.js +1 -1
- package/src/components/post-excerpt/check.js +3 -3
- package/src/components/post-excerpt/panel.js +1 -1
- package/src/components/post-excerpt/plugin.js +4 -4
- package/src/components/post-featured-image/check.js +3 -3
- package/src/components/post-featured-image/index.js +107 -43
- package/src/components/post-featured-image/panel.js +1 -1
- package/src/components/post-featured-image/style.scss +23 -13
- package/src/components/post-fields/index.ts +76 -0
- package/src/components/post-format/check.js +9 -11
- package/src/components/post-format/index.js +1 -1
- package/src/components/post-format/panel.js +1 -1
- package/src/components/post-last-revision/check.js +3 -3
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-last-revision/panel.js +1 -1
- package/src/components/post-locked-modal/index.js +1 -1
- package/src/components/post-pending-status/check.js +3 -3
- package/src/components/post-pending-status/index.js +1 -1
- package/src/components/post-preview-button/index.js +1 -1
- package/src/components/post-publish-panel/index.js +7 -3
- package/src/components/post-schedule/check.js +3 -3
- package/src/components/post-schedule/index.js +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-schedule/panel.js +1 -1
- package/src/components/post-slug/check.js +3 -3
- package/src/components/post-slug/index.js +1 -1
- package/src/components/post-sticky/check.js +3 -3
- package/src/components/post-sticky/index.js +1 -1
- package/src/components/post-switch-to-draft-button/index.js +1 -1
- package/src/components/post-sync-status/index.js +1 -1
- package/src/components/post-taxonomies/check.js +3 -3
- package/src/components/post-taxonomies/flat-term-selector.js +1 -1
- package/src/components/post-taxonomies/panel.js +15 -12
- package/src/components/post-template/classic-theme.js +2 -2
- package/src/components/post-template/panel.js +1 -1
- package/src/components/post-text-editor/index.js +1 -1
- package/src/components/post-title/index.js +20 -18
- package/src/components/post-title/post-title-raw.js +1 -1
- package/src/components/post-trash/check.js +3 -3
- package/src/components/post-trash/index.js +1 -1
- package/src/components/post-type-support-check/index.js +6 -6
- package/src/components/post-url/check.js +3 -3
- package/src/components/post-url/index.js +1 -1
- package/src/components/post-url/label.js +1 -1
- package/src/components/post-url/panel.js +1 -1
- package/src/components/post-visibility/check.js +1 -1
- package/src/components/post-visibility/index.js +1 -1
- package/src/components/preferences-modal/block-visibility.js +96 -0
- package/src/components/preferences-modal/enable-panel.js +27 -17
- package/src/components/preferences-modal/enable-publish-sidebar.js +18 -15
- package/src/components/preferences-modal/index.js +2 -2
- package/src/components/provider/index.js +55 -30
- package/src/components/table-of-contents/index.js +1 -1
- package/src/components/theme-support-check/index.js +4 -4
- package/src/components/time-to-read/index.js +1 -1
- package/src/components/unsaved-changes-warning/index.js +1 -1
- package/src/components/word-count/index.js +1 -1
- package/src/components/zoom-out-toggle/index.js +26 -13
- package/src/dataviews/api.js +41 -0
- package/src/dataviews/store/private-actions.ts +57 -3
- package/src/dataviews/store/private-selectors.ts +4 -0
- package/src/dataviews/store/reducer.ts +38 -1
- package/src/private-apis.js +4 -1
- package/src/store/actions.js +13 -9
- package/src/store/private-selectors.js +13 -8
- package/src/store/reducer.native.js +2 -0
- package/src/store/selectors.js +80 -62
- package/src/store/test/selectors.js +0 -255
- package/src/style.scss +0 -1
- package/src/utils/get-template-info.js +52 -0
- package/src/utils/test/get-template-info.js +224 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-manager/category.js +0 -107
- package/build/components/block-manager/category.js.map +0 -1
- package/build/components/block-manager/checklist.js +0 -35
- package/build/components/block-manager/checklist.js.map +0 -1
- package/build/components/block-manager/index.js +0 -115
- package/build/components/block-manager/index.js.map +0 -1
- package/build-module/components/block-manager/category.js +0 -99
- package/build-module/components/block-manager/category.js.map +0 -1
- package/build-module/components/block-manager/checklist.js +0 -28
- package/build-module/components/block-manager/checklist.js.map +0 -1
- package/build-module/components/block-manager/index.js +0 -107
- package/build-module/components/block-manager/index.js.map +0 -1
- package/build-types/components/block-manager/category.d.ts +0 -6
- package/build-types/components/block-manager/category.d.ts.map +0 -1
- package/build-types/components/block-manager/checklist.d.ts +0 -7
- package/build-types/components/block-manager/checklist.d.ts.map +0 -1
- package/build-types/components/block-manager/index.d.ts +0 -2
- package/build-types/components/block-manager/index.d.ts.map +0 -1
- package/src/components/block-manager/category.js +0 -96
- package/src/components/block-manager/checklist.js +0 -30
- package/src/components/block-manager/index.js +0 -145
- package/src/components/block-manager/style.scss +0 -82
|
@@ -80,7 +80,7 @@ const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allow
|
|
|
80
80
|
* );
|
|
81
81
|
* ```
|
|
82
82
|
*
|
|
83
|
-
* @return {
|
|
83
|
+
* @return {React.ReactNode} The rendered component.
|
|
84
84
|
*/
|
|
85
85
|
const PluginBlockSettingsMenuItem = ({
|
|
86
86
|
allowedBlocks,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_components","_compose","_jsxRuntime","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","jsx","BlockSettingsMenuControls","children","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","_compose","_jsxRuntime","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","jsx","BlockSettingsMenuControls","children","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AAL7C;AACA;AACA;;AAKA,MAAMI,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,kBACA,IAAAlB,WAAA,CAAAmB,GAAA,EAACvB,YAAA,CAAAwB,yBAAyB;EAAAC,QAAA,EACvBA,CAAE;IAAEZ,cAAc;IAAEa;EAAQ,CAAC,KAAM;IACpC,IAAK,CAAEd,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;MAC1D,OAAO,IAAI;IACZ;IACA,oBACC,IAAAV,WAAA,CAAAmB,GAAA,EAACrB,WAAA,CAAAyB,QAAQ;MACRP,OAAO,EAAG,IAAAQ,gBAAO,EAAER,OAAO,EAAEM,OAAQ,CAAG;MACvCR,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGU,SAAW;MACnCP,IAAI,EAAGA,IAAM;MAAAG,QAAA,EAEX,CAAEJ,KAAK,IAAIF;IAAK,CACT,CAAC;EAEb;AAAC,CACyB,CAC3B;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaf,2BAA2B","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.AddComment = AddComment;
|
|
7
8
|
var _i18n = require("@wordpress/i18n");
|
|
8
9
|
var _data = require("@wordpress/data");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var _commentAuthorInfo = _interopRequireDefault(require("./comment-author-info"));
|
|
13
|
+
var _commentForm = _interopRequireDefault(require("./comment-form"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
/**
|
|
16
16
|
* WordPress dependencies
|
|
@@ -27,92 +27,44 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
27
27
|
* @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.
|
|
28
28
|
* @param {boolean} props.showCommentBoard - The function to edit the comment.
|
|
29
29
|
* @param {Function} props.setShowCommentBoard - The function to delete the comment.
|
|
30
|
-
* @return {
|
|
30
|
+
* @return {React.ReactNode} The rendered comment input UI.
|
|
31
31
|
*/
|
|
32
32
|
function AddComment({
|
|
33
33
|
onSubmit,
|
|
34
34
|
showCommentBoard,
|
|
35
35
|
setShowCommentBoard
|
|
36
36
|
}) {
|
|
37
|
-
var _currentUser$name;
|
|
38
|
-
// State to manage the comment thread.
|
|
39
|
-
const [inputComment, setInputComment] = (0, _element.useState)('');
|
|
40
37
|
const {
|
|
41
|
-
defaultAvatar,
|
|
42
38
|
clientId,
|
|
43
|
-
blockCommentId
|
|
44
|
-
currentUser
|
|
39
|
+
blockCommentId
|
|
45
40
|
} = (0, _data.useSelect)(select => {
|
|
46
41
|
const {
|
|
47
|
-
getSettings,
|
|
48
42
|
getSelectedBlock
|
|
49
43
|
} = select(_blockEditor.store);
|
|
50
|
-
const {
|
|
51
|
-
__experimentalDiscussionSettings
|
|
52
|
-
} = getSettings();
|
|
53
44
|
const selectedBlock = getSelectedBlock();
|
|
54
|
-
const userData = select(_coreData.store).getCurrentUser();
|
|
55
45
|
return {
|
|
56
|
-
defaultAvatar: __experimentalDiscussionSettings?.avatarURL,
|
|
57
46
|
clientId: selectedBlock?.clientId,
|
|
58
|
-
blockCommentId: selectedBlock?.attributes?.blockCommentId
|
|
59
|
-
currentUser: userData
|
|
47
|
+
blockCommentId: selectedBlock?.attributes?.blockCommentId
|
|
60
48
|
};
|
|
61
|
-
}
|
|
62
|
-
const userAvatar = currentUser && currentUser.avatar_urls && currentUser.avatar_urls[48] ? currentUser.avatar_urls[48] : defaultAvatar;
|
|
63
|
-
(0, _element.useEffect)(() => {
|
|
64
|
-
setInputComment('');
|
|
65
|
-
}, [clientId]);
|
|
66
|
-
const handleCancel = () => {
|
|
67
|
-
setShowCommentBoard(false);
|
|
68
|
-
setInputComment('');
|
|
69
|
-
};
|
|
49
|
+
});
|
|
70
50
|
if (!showCommentBoard || !clientId || undefined !== blockCommentId) {
|
|
71
51
|
return null;
|
|
72
52
|
}
|
|
73
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
74
54
|
spacing: "3",
|
|
75
55
|
className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread",
|
|
76
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
77
57
|
alignment: "left",
|
|
78
58
|
spacing: "3",
|
|
79
|
-
children:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
className: "editor-collab-sidebar-panel__user-name",
|
|
89
|
-
children: (_currentUser$name = currentUser?.name) !== null && _currentUser$name !== void 0 ? _currentUser$name : ''
|
|
90
|
-
})]
|
|
91
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
92
|
-
__next40pxDefaultSize: true,
|
|
93
|
-
__nextHasNoMarginBottom: true,
|
|
94
|
-
value: inputComment,
|
|
95
|
-
onChange: setInputComment,
|
|
96
|
-
placeholder: (0, _i18n._x)('Comment', 'noun')
|
|
97
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
98
|
-
alignment: "right",
|
|
99
|
-
spacing: "3",
|
|
100
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
101
|
-
__next40pxDefaultSize: true,
|
|
102
|
-
variant: "tertiary",
|
|
103
|
-
text: (0, _i18n._x)('Cancel', 'Cancel comment button'),
|
|
104
|
-
onClick: handleCancel
|
|
105
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
106
|
-
__next40pxDefaultSize: true,
|
|
107
|
-
accessibleWhenDisabled: true,
|
|
108
|
-
variant: "primary",
|
|
109
|
-
text: (0, _i18n._x)('Comment', 'Add comment button'),
|
|
110
|
-
disabled: 0 === (0, _utils.sanitizeCommentString)(inputComment).length,
|
|
111
|
-
onClick: () => {
|
|
112
|
-
onSubmit(inputComment);
|
|
113
|
-
setInputComment('');
|
|
114
|
-
}
|
|
115
|
-
})]
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_commentAuthorInfo.default, {})
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_commentForm.default, {
|
|
61
|
+
onSubmit: inputComment => {
|
|
62
|
+
onSubmit(inputComment);
|
|
63
|
+
},
|
|
64
|
+
onCancel: () => {
|
|
65
|
+
setShowCommentBoard(false);
|
|
66
|
+
},
|
|
67
|
+
submitButtonText: (0, _i18n._x)('Comment', 'Add comment button')
|
|
116
68
|
})]
|
|
117
69
|
});
|
|
118
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_components","_blockEditor","_commentAuthorInfo","_interopRequireDefault","_commentForm","_jsxRuntime","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","useSelect","select","getSelectedBlock","blockEditorStore","selectedBlock","attributes","undefined","jsxs","__experimentalVStack","spacing","className","children","jsx","__experimentalHStack","alignment","default","inputComment","onCancel","submitButtonText","_x"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t};\n\t} );\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread\"\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<CommentAuthorInfo />\n\t\t\t</HStack>\n\t\t\t<CommentForm\n\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,kBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,YAAA,GAAAD,sBAAA,CAAAL,OAAA;AAAyC,IAAAO,WAAA,GAAAP,OAAA;AAfzC;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IACvD,MAAMC,aAAa,GAAGF,gBAAgB,CAAC,CAAC;IACxC,OAAO;MACNJ,QAAQ,EAAEM,aAAa,EAAEN,QAAQ;MACjCC,cAAc,EAAEK,aAAa,EAAEC,UAAU,EAAEN;IAC5C,CAAC;EACF,CAAE,CAAC;EAEH,IAAK,CAAEH,gBAAgB,IAAI,CAAEE,QAAQ,IAAIQ,SAAS,KAAKP,cAAc,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAN,WAAA,CAAAc,IAAA,EAACnB,WAAA,CAAAoB,oBAAM;IACNC,OAAO,EAAC,GAAG;IACXC,SAAS,EAAC,gFAAgF;IAAAC,QAAA,gBAE1F,IAAAlB,WAAA,CAAAmB,GAAA,EAACxB,WAAA,CAAAyB,oBAAM;MAACC,SAAS,EAAC,MAAM;MAACL,OAAO,EAAC,GAAG;MAAAE,QAAA,eACnC,IAAAlB,WAAA,CAAAmB,GAAA,EAACtB,kBAAA,CAAAyB,OAAiB,IAAE;IAAC,CACd,CAAC,eACT,IAAAtB,WAAA,CAAAmB,GAAA,EAACpB,YAAA,CAAAuB,OAAW;MACXpB,QAAQ,EAAKqB,YAAY,IAAM;QAC9BrB,QAAQ,CAAEqB,YAAa,CAAC;MACzB,CAAG;MACHC,QAAQ,EAAGA,CAAA,KAAM;QAChBpB,mBAAmB,CAAE,KAAM,CAAC;MAC7B,CAAG;MACHqB,gBAAgB,EAAG,IAAAC,QAAE,EAAE,SAAS,EAAE,oBAAqB;IAAG,CAC1D,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _components = require("@wordpress/components");
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _date = require("@wordpress/date");
|
|
10
|
+
var _coreData = require("@wordpress/core-data");
|
|
11
|
+
var _data = require("@wordpress/data");
|
|
12
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Render author information for a comment.
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} props - Component properties.
|
|
22
|
+
* @param {string} props.avatar - URL of the author's avatar.
|
|
23
|
+
* @param {string} props.name - Name of the author.
|
|
24
|
+
* @param {string} props.date - Date of the comment.
|
|
25
|
+
*
|
|
26
|
+
* @return {React.ReactNode} The JSX element representing the author's information.
|
|
27
|
+
*/function CommentAuthorInfo({
|
|
28
|
+
avatar,
|
|
29
|
+
name,
|
|
30
|
+
date
|
|
31
|
+
}) {
|
|
32
|
+
const dateSettings = (0, _date.getSettings)();
|
|
33
|
+
const [dateTimeFormat = dateSettings.formats.time] = (0, _coreData.useEntityProp)('root', 'site', 'time_format');
|
|
34
|
+
const {
|
|
35
|
+
currentUserAvatar,
|
|
36
|
+
currentUserName
|
|
37
|
+
} = (0, _data.useSelect)(select => {
|
|
38
|
+
var _userData$avatar_urls;
|
|
39
|
+
const userData = select(_coreData.store).getCurrentUser();
|
|
40
|
+
const {
|
|
41
|
+
getSettings
|
|
42
|
+
} = select(_blockEditor.store);
|
|
43
|
+
const {
|
|
44
|
+
__experimentalDiscussionSettings
|
|
45
|
+
} = getSettings();
|
|
46
|
+
const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
|
|
47
|
+
return {
|
|
48
|
+
currentUserAvatar: (_userData$avatar_urls = userData?.avatar_urls[48]) !== null && _userData$avatar_urls !== void 0 ? _userData$avatar_urls : defaultAvatar,
|
|
49
|
+
currentUserName: userData?.name
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
const currentDate = new Date();
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
54
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
55
|
+
src: avatar !== null && avatar !== void 0 ? avatar : currentUserAvatar,
|
|
56
|
+
className: "editor-collab-sidebar-panel__user-avatar"
|
|
57
|
+
// translators: alt text for user avatar image
|
|
58
|
+
,
|
|
59
|
+
alt: (0, _i18n.__)('User avatar'),
|
|
60
|
+
width: 32,
|
|
61
|
+
height: 32
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
63
|
+
spacing: "0",
|
|
64
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
65
|
+
className: "editor-collab-sidebar-panel__user-name",
|
|
66
|
+
children: name !== null && name !== void 0 ? name : currentUserName
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
68
|
+
dateTime: (0, _date.dateI18n)('c', date !== null && date !== void 0 ? date : currentDate),
|
|
69
|
+
className: "editor-collab-sidebar-panel__user-time",
|
|
70
|
+
children: (0, _date.dateI18n)(dateTimeFormat, date !== null && date !== void 0 ? date : currentDate)
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
var _default = exports.default = CommentAuthorInfo;
|
|
76
|
+
//# sourceMappingURL=comment-author-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_date","_coreData","_data","_blockEditor","_jsxRuntime","CommentAuthorInfo","avatar","name","date","dateSettings","getDateSettings","dateTimeFormat","formats","time","useEntityProp","currentUserAvatar","currentUserName","useSelect","select","_userData$avatar_urls","userData","coreStore","getCurrentUser","getSettings","blockEditorStore","__experimentalDiscussionSettings","defaultAvatar","avatarURL","avatar_urls","currentDate","Date","jsxs","Fragment","children","jsx","src","className","alt","__","width","height","__experimentalVStack","spacing","dateTime","dateI18n","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-author-info.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { dateI18n, getSettings as getDateSettings } from '@wordpress/date';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Render author information for a comment.\n *\n * @param {Object} props - Component properties.\n * @param {string} props.avatar - URL of the author's avatar.\n * @param {string} props.name - Name of the author.\n * @param {string} props.date - Date of the comment.\n *\n * @return {React.ReactNode} The JSX element representing the author's information.\n */\nfunction CommentAuthorInfo( { avatar, name, date } ) {\n\tconst dateSettings = getDateSettings();\n\tconst [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst { currentUserAvatar, currentUserName } = useSelect( ( select ) => {\n\t\tconst userData = select( coreStore ).getCurrentUser();\n\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\tconst defaultAvatar = __experimentalDiscussionSettings?.avatarURL;\n\t\treturn {\n\t\t\tcurrentUserAvatar: userData?.avatar_urls[ 48 ] ?? defaultAvatar,\n\t\t\tcurrentUserName: userData?.name,\n\t\t};\n\t}, [] );\n\n\tconst currentDate = new Date();\n\n\treturn (\n\t\t<>\n\t\t\t<img\n\t\t\t\tsrc={ avatar ?? currentUserAvatar }\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\talt={ __( 'User avatar' ) }\n\t\t\t\twidth={ 32 }\n\t\t\t\theight={ 32 }\n\t\t\t/>\n\t\t\t<VStack spacing=\"0\">\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ name ?? currentUserName }\n\t\t\t\t</span>\n\t\t\t\t<time\n\t\t\t\t\tdateTime={ dateI18n( 'c', date ?? currentDate ) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t>\n\t\t\t\t\t{ dateI18n( dateTimeFormat, date ?? currentDate ) }\n\t\t\t\t</time>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default CommentAuthorInfo;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAAoE,IAAAM,WAAA,GAAAN,OAAA;AARpE;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,iBAAiBA,CAAE;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,EAAG;EACpD,MAAMC,YAAY,GAAG,IAAAC,iBAAe,EAAC,CAAC;EACtC,MAAM,CAAEC,cAAc,GAAGF,YAAY,CAACG,OAAO,CAACC,IAAI,CAAE,GAAG,IAAAC,uBAAa,EACnE,MAAM,EACN,MAAM,EACN,aACD,CAAC;EAED,MAAM;IAAEC,iBAAiB;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACvE,MAAMC,QAAQ,GAAGF,MAAM,CAAEG,eAAU,CAAC,CAACC,cAAc,CAAC,CAAC;IAErD,MAAM;MAAEC;IAAY,CAAC,GAAGL,MAAM,CAAEM,kBAAiB,CAAC;IAClD,MAAM;MAAEC;IAAiC,CAAC,GAAGF,WAAW,CAAC,CAAC;IAC1D,MAAMG,aAAa,GAAGD,gCAAgC,EAAEE,SAAS;IACjE,OAAO;MACNZ,iBAAiB,GAAAI,qBAAA,GAAEC,QAAQ,EAAEQ,WAAW,CAAE,EAAE,CAAE,cAAAT,qBAAA,cAAAA,qBAAA,GAAIO,aAAa;MAC/DV,eAAe,EAAEI,QAAQ,EAAEb;IAC5B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMsB,WAAW,GAAG,IAAIC,IAAI,CAAC,CAAC;EAE9B,oBACC,IAAA1B,WAAA,CAAA2B,IAAA,EAAA3B,WAAA,CAAA4B,QAAA;IAAAC,QAAA,gBACC,IAAA7B,WAAA,CAAA8B,GAAA;MACCC,GAAG,EAAG7B,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIS,iBAAmB;MACnCqB,SAAS,EAAC;MACV;MAAA;MACAC,GAAG,EAAG,IAAAC,QAAE,EAAE,aAAc,CAAG;MAC3BC,KAAK,EAAG,EAAI;MACZC,MAAM,EAAG;IAAI,CACb,CAAC,eACF,IAAApC,WAAA,CAAA2B,IAAA,EAAClC,WAAA,CAAA4C,oBAAM;MAACC,OAAO,EAAC,GAAG;MAAAT,QAAA,gBAClB,IAAA7B,WAAA,CAAA8B,GAAA;QAAME,SAAS,EAAC,wCAAwC;QAAAH,QAAA,EACrD1B,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIS;MAAe,CACpB,CAAC,eACP,IAAAZ,WAAA,CAAA8B,GAAA;QACCS,QAAQ,EAAG,IAAAC,cAAQ,EAAE,GAAG,EAAEpC,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIqB,WAAY,CAAG;QACjDO,SAAS,EAAC,wCAAwC;QAAAH,QAAA,EAEhD,IAAAW,cAAQ,EAAEjC,cAAc,EAAEH,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIqB,WAAY;MAAC,CAC5C,CAAC;IAAA,CACA,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1C,iBAAiB","ignoreList":[]}
|
|
@@ -19,12 +19,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const {
|
|
22
|
-
|
|
22
|
+
CommentIconToolbarSlotFill
|
|
23
23
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
24
24
|
const AddCommentToolbarButton = ({
|
|
25
25
|
onClick
|
|
26
26
|
}) => {
|
|
27
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentIconToolbarSlotFill.Fill, {
|
|
28
28
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
29
29
|
accessibleWhenDisabled: true,
|
|
30
30
|
icon: _icons.comment,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_blockEditor","_lockUnlock","_jsxRuntime","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_blockEditor","_lockUnlock","_jsxRuntime","CommentIconToolbarSlotFill","unlock","blockEditorPrivateApis","AddCommentToolbarButton","onClick","jsx","Fill","children","ToolbarButton","accessibleWhenDisabled","icon","commentIcon","label","_x","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconToolbarSlotFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentToolbarButton = ( { onClick } ) => {\n\treturn (\n\t\t<CommentIconToolbarSlotFill.Fill>\n\t\t\t<ToolbarButton\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\ticon={ commentIcon }\n\t\t\t\tlabel={ _x( 'Comment', 'View comment' ) }\n\t\t\t\tonClick={ onClick }\n\t\t\t/>\n\t\t</CommentIconToolbarSlotFill.Fill>\n\t);\n};\n\nexport default AddCommentToolbarButton;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAX3C;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEM;AAA2B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEvE,MAAMC,uBAAuB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAClD,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACL,0BAA0B,CAACM,IAAI;IAAAC,QAAA,eAC/B,IAAAR,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAe,aAAa;MACbC,sBAAsB;MACtBC,IAAI,EAAGC,cAAa;MACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAS,EAAE,cAAe,CAAG;MACzCT,OAAO,EAAGA;IAAS,CACnB;EAAC,CAC8B,CAAC;AAEpC,CAAC;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEab,uBAAuB","ignoreList":[]}
|
|
@@ -19,12 +19,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const {
|
|
22
|
-
|
|
22
|
+
CommentIconSlotFill
|
|
23
23
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
24
24
|
const AddCommentButton = ({
|
|
25
25
|
onClick
|
|
26
26
|
}) => {
|
|
27
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentIconSlotFill.Fill, {
|
|
28
28
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
29
29
|
icon: _icons.comment,
|
|
30
30
|
onClick: onClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_blockEditor","_lockUnlock","_jsxRuntime","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_blockEditor","_lockUnlock","_jsxRuntime","CommentIconSlotFill","unlock","blockEditorPrivateApis","AddCommentButton","onClick","jsx","Fill","children","MenuItem","icon","commentIcon","_x","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconSlotFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentButton = ( { onClick } ) => {\n\treturn (\n\t\t<CommentIconSlotFill.Fill>\n\t\t\t<MenuItem\n\t\t\t\ticon={ commentIcon }\n\t\t\t\tonClick={ onClick }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ _x( 'Comment', 'Add comment button' ) }\n\t\t\t</MenuItem>\n\t\t</CommentIconSlotFill.Fill>\n\t);\n};\n\nexport default AddCommentButton;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAZ3C;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAoB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEhE,MAAMC,gBAAgB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAC3C,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACL,mBAAmB,CAACM,IAAI;IAAAC,QAAA,eACxB,IAAAR,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAe,QAAQ;MACRC,IAAI,EAAGC,cAAa;MACpBN,OAAO,EAAGA,OAAS;MACnB,iBAAc,QAAQ;MAAAG,QAAA,EAEpB,IAAAI,QAAE,EAAE,SAAS,EAAE,oBAAqB;IAAC,CAC9B;EAAC,CACc,CAAC;AAE7B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaX,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _element = require("@wordpress/element");
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _i18n = require("@wordpress/i18n");
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* EditComment component.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} props - The component props.
|
|
24
|
+
* @param {Function} props.onSubmit - The function to call when updating the comment.
|
|
25
|
+
* @param {Function} props.onCancel - The function to call when canceling the comment update.
|
|
26
|
+
* @param {Object} props.thread - The comment thread object.
|
|
27
|
+
* @param {string} props.submitButtonText - The text to display on the submit button.
|
|
28
|
+
* @return {React.ReactNode} The CommentForm component.
|
|
29
|
+
*/function CommentForm({
|
|
30
|
+
onSubmit,
|
|
31
|
+
onCancel,
|
|
32
|
+
thread,
|
|
33
|
+
submitButtonText
|
|
34
|
+
}) {
|
|
35
|
+
var _thread$content$raw;
|
|
36
|
+
const [inputComment, setInputComment] = (0, _element.useState)((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : '');
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
38
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextareaControl, {
|
|
39
|
+
__next40pxDefaultSize: true,
|
|
40
|
+
__nextHasNoMarginBottom: true,
|
|
41
|
+
value: inputComment !== null && inputComment !== void 0 ? inputComment : '',
|
|
42
|
+
onChange: setInputComment
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
44
|
+
alignment: "left",
|
|
45
|
+
spacing: "3",
|
|
46
|
+
justify: "flex-start",
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
48
|
+
__next40pxDefaultSize: true,
|
|
49
|
+
accessibleWhenDisabled: true,
|
|
50
|
+
variant: "primary",
|
|
51
|
+
onClick: () => onSubmit(inputComment),
|
|
52
|
+
disabled: 0 === (0, _utils.sanitizeCommentString)(inputComment).length,
|
|
53
|
+
text: submitButtonText
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
55
|
+
__next40pxDefaultSize: true,
|
|
56
|
+
variant: "tertiary",
|
|
57
|
+
onClick: onCancel,
|
|
58
|
+
text: (0, _i18n._x)('Cancel', 'Cancel comment button')
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
var _default = exports.default = CommentForm;
|
|
64
|
+
//# sourceMappingURL=comment-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_utils","_jsxRuntime","CommentForm","onSubmit","onCancel","thread","submitButtonText","_thread$content$raw","inputComment","setInputComment","useState","content","raw","jsxs","Fragment","children","jsx","TextareaControl","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","__experimentalHStack","alignment","spacing","justify","Button","accessibleWhenDisabled","variant","onClick","disabled","sanitizeCommentString","length","text","_x","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTextareaControl,\n} from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @param {string} props.submitButtonText - The text to display on the submit button.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t/>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => onSubmit( inputComment ) }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\ttext={ submitButtonText }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</>\n\t);\n}\n\nexport default CommentForm;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAAgD,IAAAI,WAAA,GAAAJ,OAAA;AAdhD;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASK,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAiB,CAAC,EAAG;EAAA,IAAAC,mBAAA;EACxE,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAG,IAAAC,iBAAQ,GAAAH,mBAAA,GACjDF,MAAM,EAAEM,OAAO,EAAEC,GAAG,cAAAL,mBAAA,cAAAA,mBAAA,GAAI,EACzB,CAAC;EAED,oBACC,IAAAN,WAAA,CAAAY,IAAA,EAAAZ,WAAA,CAAAa,QAAA;IAAAC,QAAA,gBACC,IAAAd,WAAA,CAAAe,GAAA,EAAClB,WAAA,CAAAmB,eAAe;MACfC,qBAAqB;MACrBC,uBAAuB;MACvBC,KAAK,EAAGZ,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAI;MAC5Ba,QAAQ,EAAGZ;IAAiB,CAC5B,CAAC,eACF,IAAAR,WAAA,CAAAY,IAAA,EAACf,WAAA,CAAAwB,oBAAM;MAACC,SAAS,EAAC,MAAM;MAACC,OAAO,EAAC,GAAG;MAACC,OAAO,EAAC,YAAY;MAAAV,QAAA,gBACxD,IAAAd,WAAA,CAAAe,GAAA,EAAClB,WAAA,CAAA4B,MAAM;QACNR,qBAAqB;QACrBS,sBAAsB;QACtBC,OAAO,EAAC,SAAS;QACjBC,OAAO,EAAGA,CAAA,KAAM1B,QAAQ,CAAEK,YAAa,CAAG;QAC1CsB,QAAQ,EACP,CAAC,KAAK,IAAAC,4BAAqB,EAAEvB,YAAa,CAAC,CAACwB,MAC5C;QACDC,IAAI,EAAG3B;MAAkB,CACzB,CAAC,eACF,IAAAL,WAAA,CAAAe,GAAA,EAAClB,WAAA,CAAA4B,MAAM;QACNR,qBAAqB;QACrBU,OAAO,EAAC,UAAU;QAClBC,OAAO,EAAGzB,QAAU;QACpB6B,IAAI,EAAG,IAAAC,QAAE,EAAE,QAAQ,EAAE,uBAAwB;MAAG,CAChD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnC,WAAW","ignoreList":[]}
|
|
@@ -8,13 +8,12 @@ exports.Comments = Comments;
|
|
|
8
8
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
9
|
var _element = require("@wordpress/element");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
|
-
var _date = require("@wordpress/date");
|
|
12
11
|
var _icons = require("@wordpress/icons");
|
|
13
12
|
var _i18n = require("@wordpress/i18n");
|
|
14
13
|
var _data = require("@wordpress/data");
|
|
15
|
-
var _coreData = require("@wordpress/core-data");
|
|
16
14
|
var _blockEditor = require("@wordpress/block-editor");
|
|
17
|
-
var
|
|
15
|
+
var _commentAuthorInfo = _interopRequireDefault(require("./comment-author-info"));
|
|
16
|
+
var _commentForm = _interopRequireDefault(require("./comment-form"));
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
/**
|
|
20
19
|
* External dependencies
|
|
@@ -37,7 +36,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
37
36
|
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
38
37
|
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
39
38
|
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
40
|
-
* @return {
|
|
39
|
+
* @return {React.ReactNode} The rendered Comments component.
|
|
41
40
|
*/
|
|
42
41
|
function Comments({
|
|
43
42
|
threads,
|
|
@@ -107,13 +106,14 @@ function Comments({
|
|
|
107
106
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
108
107
|
spacing: "3",
|
|
109
108
|
className: "editor-collab-sidebar-panel__comment-field",
|
|
110
|
-
children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
109
|
+
children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(_commentForm.default, {
|
|
111
110
|
onSubmit: value => {
|
|
112
111
|
onEditComment(thread.id, value);
|
|
113
112
|
setActionState(false);
|
|
114
113
|
},
|
|
115
114
|
onCancel: () => setActionState(false),
|
|
116
|
-
thread: thread
|
|
115
|
+
thread: thread,
|
|
116
|
+
submitButtonText: (0, _i18n._x)('Update', 'verb')
|
|
117
117
|
}), (!actionState || 'edit' !== actionState?.action) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.RawHTML, {
|
|
118
118
|
children: thread?.content?.raw
|
|
119
119
|
})]
|
|
@@ -158,22 +158,6 @@ function Comments({
|
|
|
158
158
|
spacing: "3",
|
|
159
159
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CommentBoard, {
|
|
160
160
|
thread: thread
|
|
161
|
-
}), 'reply' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
162
|
-
alignment: "left",
|
|
163
|
-
spacing: "3",
|
|
164
|
-
justify: "flex-start",
|
|
165
|
-
className: "editor-collab-sidebar-panel__user-comment",
|
|
166
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
167
|
-
spacing: "3",
|
|
168
|
-
className: "editor-collab-sidebar-panel__comment-field",
|
|
169
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentForm, {
|
|
170
|
-
onSubmit: inputComment => {
|
|
171
|
-
onAddReply(inputComment, thread.id);
|
|
172
|
-
setActionState(false);
|
|
173
|
-
},
|
|
174
|
-
onCancel: () => setActionState(false)
|
|
175
|
-
})
|
|
176
|
-
})
|
|
177
161
|
}), 0 < thread?.reply?.length && thread.reply.map(reply => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
178
162
|
className: "editor-collab-sidebar-panel__child-thread",
|
|
179
163
|
id: reply.id,
|
|
@@ -182,54 +166,28 @@ function Comments({
|
|
|
182
166
|
thread: reply,
|
|
183
167
|
parentThread: thread
|
|
184
168
|
})
|
|
185
|
-
}, reply.id))
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
})
|
|
204
|
-
var _thread$content$raw;
|
|
205
|
-
const [inputComment, setInputComment] = (0, _element.useState)((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : '');
|
|
206
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
207
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextareaControl, {
|
|
208
|
-
__nextHasNoMarginBottom: true,
|
|
209
|
-
value: inputComment !== null && inputComment !== void 0 ? inputComment : '',
|
|
210
|
-
onChange: setInputComment
|
|
211
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
212
|
-
alignment: "left",
|
|
213
|
-
spacing: "3",
|
|
214
|
-
justify: "flex-start",
|
|
215
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
216
|
-
alignment: "left",
|
|
217
|
-
spacing: "3",
|
|
218
|
-
justify: "flex-start",
|
|
219
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
220
|
-
__next40pxDefaultSize: true,
|
|
221
|
-
accessibleWhenDisabled: true,
|
|
222
|
-
variant: "primary",
|
|
223
|
-
onClick: () => onSubmit(inputComment),
|
|
224
|
-
disabled: 0 === (0, _utils.sanitizeCommentString)(inputComment).length,
|
|
225
|
-
children: thread ? (0, _i18n._x)('Update', 'verb') : (0, _i18n._x)('Reply', 'Add reply comment')
|
|
226
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
227
|
-
__next40pxDefaultSize: true,
|
|
228
|
-
onClick: onCancel,
|
|
229
|
-
children: (0, _i18n._x)('Cancel', 'Cancel comment edit')
|
|
169
|
+
}, reply.id)), 'reply' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
170
|
+
className: "editor-collab-sidebar-panel__child-thread",
|
|
171
|
+
spacing: "2",
|
|
172
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
173
|
+
alignment: "left",
|
|
174
|
+
spacing: "3",
|
|
175
|
+
justify: "flex-start",
|
|
176
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_commentAuthorInfo.default, {})
|
|
177
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
178
|
+
spacing: "3",
|
|
179
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
180
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_commentForm.default, {
|
|
181
|
+
onSubmit: inputComment => {
|
|
182
|
+
onAddReply(inputComment, thread.id);
|
|
183
|
+
setActionState(false);
|
|
184
|
+
},
|
|
185
|
+
onCancel: () => setActionState(false),
|
|
186
|
+
submitButtonText: (0, _i18n._x)('Reply', 'Add reply comment')
|
|
187
|
+
})
|
|
230
188
|
})]
|
|
231
|
-
})
|
|
232
|
-
})]
|
|
189
|
+
})]
|
|
190
|
+
}, thread.id))]
|
|
233
191
|
});
|
|
234
192
|
}
|
|
235
193
|
|
|
@@ -243,7 +201,7 @@ function CommentForm({
|
|
|
243
201
|
* @param {Function} props.onDelete - The function to delete the comment.
|
|
244
202
|
* @param {Function} props.onReply - The function to reply to the comment.
|
|
245
203
|
* @param {string} props.status - The status of the comment.
|
|
246
|
-
* @return {
|
|
204
|
+
* @return {React.ReactNode} The rendered comment header.
|
|
247
205
|
*/
|
|
248
206
|
function CommentHeader({
|
|
249
207
|
thread,
|
|
@@ -253,8 +211,6 @@ function CommentHeader({
|
|
|
253
211
|
onReply,
|
|
254
212
|
status
|
|
255
213
|
}) {
|
|
256
|
-
const dateSettings = (0, _date.getSettings)();
|
|
257
|
-
const [dateTimeFormat = dateSettings.formats.time] = (0, _coreData.useEntityProp)('root', 'site', 'time_format');
|
|
258
214
|
const actions = [{
|
|
259
215
|
title: (0, _i18n._x)('Edit', 'Edit comment'),
|
|
260
216
|
onClick: onEdit
|
|
@@ -270,31 +226,17 @@ function CommentHeader({
|
|
|
270
226
|
alignment: "left",
|
|
271
227
|
spacing: "3",
|
|
272
228
|
justify: "flex-start",
|
|
273
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
,
|
|
278
|
-
alt: (0, _i18n.__)('User avatar'),
|
|
279
|
-
width: 32,
|
|
280
|
-
height: 32
|
|
281
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
282
|
-
spacing: "0",
|
|
283
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
284
|
-
className: "editor-collab-sidebar-panel__user-name",
|
|
285
|
-
children: thread.author_name
|
|
286
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
287
|
-
dateTime: (0, _date.format)('h:i A', thread.date),
|
|
288
|
-
className: "editor-collab-sidebar-panel__user-time",
|
|
289
|
-
children: (0, _date.dateI18n)(dateTimeFormat, thread.date)
|
|
290
|
-
})]
|
|
229
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_commentAuthorInfo.default, {
|
|
230
|
+
avatar: thread?.author_avatar_urls?.[48],
|
|
231
|
+
name: thread?.author_name,
|
|
232
|
+
date: thread?.date
|
|
291
233
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
292
234
|
className: "editor-collab-sidebar-panel__comment-status",
|
|
293
235
|
children: [status !== 'approved' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
294
236
|
alignment: "right",
|
|
295
237
|
justify: "flex-end",
|
|
296
238
|
spacing: "0",
|
|
297
|
-
children: [0 === thread
|
|
239
|
+
children: [0 === thread?.parent && onResolve && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
298
240
|
label: (0, _i18n._x)('Resolve', 'Mark comment as resolved'),
|
|
299
241
|
__next40pxDefaultSize: true,
|
|
300
242
|
icon: _icons.published,
|