@wordpress/editor 14.9.0 → 14.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/build/bindings/api.js +0 -29
- package/build/bindings/api.js.map +1 -1
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-manager/index.js +2 -2
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +120 -0
- package/build/components/collab-sidebar/add-comment.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build/components/collab-sidebar/comment-button.js +37 -0
- package/build/components/collab-sidebar/comment-button.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +321 -0
- package/build/components/collab-sidebar/comments.js.map +1 -0
- package/build/components/collab-sidebar/constants.js +8 -0
- package/build/components/collab-sidebar/constants.js.map +1 -0
- package/build/components/collab-sidebar/index.js +272 -0
- package/build/components/collab-sidebar/index.js.map +1 -0
- package/build/components/collab-sidebar/utils.js +16 -0
- package/build/components/collab-sidebar/utils.js.map +1 -0
- package/build/components/commands/index.js +6 -6
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/utils.js.map +1 -1
- package/build/components/document-bar/index.js +8 -7
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +2 -6
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +4 -14
- package/build/components/editor-interface/index.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/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +13 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +5 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +2 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +13 -11
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +15 -13
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +0 -15
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/index.js +5 -5
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/panel.js +4 -4
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -36
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-content-information/index.js +2 -3
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +26 -7
- package/build/components/post-featured-image/index.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-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +2 -2
- package/build/components/post-locked-modal/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-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +1 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +1 -1
- package/build/components/post-publish-panel/postpublish.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-taxonomies/flat-term-selector.js +13 -5
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -4
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +15 -19
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +2 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-url/index.js +76 -63
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +49 -29
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -4
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +10 -12
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/resizable-editor/resize-handle.js.map +1 -1
- package/build/components/sidebar/header.js +2 -1
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +3 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -2
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/index.js +24 -25
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build/components/zoom-out-toggle/index.js +37 -5
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +3 -3
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +30 -4
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -0
- package/build/store/constants.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +8 -7
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +24 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/pageTypeBadge.js +51 -0
- package/build/utils/pageTypeBadge.js.map +1 -0
- package/build/utils/terms.js +2 -2
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/api.js +1 -29
- package/build-module/bindings/api.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -3
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -2
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -2
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +3 -4
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -3
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/blog-title/index.js +1 -3
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +114 -0
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button.js +30 -0
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +314 -0
- package/build-module/components/collab-sidebar/comments.js.map +1 -0
- package/build-module/components/collab-sidebar/constants.js +2 -0
- package/build-module/components/collab-sidebar/constants.js.map +1 -0
- package/build-module/components/collab-sidebar/index.js +264 -0
- package/build-module/components/collab-sidebar/index.js.map +1 -0
- package/build-module/components/collab-sidebar/utils.js +10 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -0
- package/build-module/components/collapsible-block-toolbar/index.js +1 -3
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js +6 -6
- package/build-module/components/commands/index.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/create-template-part-modal/utils.js.map +1 -1
- package/build-module/components/document-bar/index.js +10 -10
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -2
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +1 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +4 -10
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +1 -3
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +1 -3
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -3
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +1 -3
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +1 -3
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +1 -2
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-interface/index.js +5 -17
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -3
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +1 -2
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +3 -4
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +1 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +13 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -2
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +6 -7
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +1 -3
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +12 -10
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +14 -12
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +0 -15
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +6 -8
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +5 -6
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -38
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +2 -3
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -2
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -3
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +27 -9
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -3
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -2
- package/build-module/components/post-format/panel.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-locked-modal/index.js +3 -5
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +1 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +2 -4
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -2
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -3
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -2
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +1 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +2 -4
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -3
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -2
- package/build-module/components/post-saved-state/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-status/index.js +1 -3
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -3
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +16 -10
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +1 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +3 -6
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +1 -2
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +1 -3
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -3
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +15 -19
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +2 -2
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -2
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/index.js +78 -66
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +51 -31
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -2
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +1 -3
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -7
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +11 -15
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -3
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/resizable-editor/resize-handle.js +1 -3
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +1 -3
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/header.js +3 -3
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +5 -6
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +1 -3
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +1 -3
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -2
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -3
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +1 -3
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +2 -2
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/index.js +26 -29
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build-module/components/zoom-out-toggle/index.js +37 -5
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +4 -4
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -3
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +1 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +30 -4
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +1 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +9 -8
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +45 -0
- package/build-module/utils/pageTypeBadge.js.map +1 -0
- package/build-module/utils/terms.js +2 -2
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +116 -59
- package/build-style/style.css +116 -59
- package/build-types/bindings/api.d.ts +0 -13
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +19 -0
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/constants.d.ts +2 -0
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/index.d.ts +5 -0
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +8 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- 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-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +1 -4
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +21 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +5 -0
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts.map +1 -1
- package/package.json +39 -38
- package/src/bindings/api.js +1 -32
- package/src/bindings/post-meta.js +1 -0
- package/src/components/collab-sidebar/add-comment.js +124 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
- package/src/components/collab-sidebar/comment-button.js +31 -0
- package/src/components/collab-sidebar/comments.js +404 -0
- package/src/components/collab-sidebar/constants.js +1 -0
- package/src/components/collab-sidebar/index.js +307 -0
- package/src/components/collab-sidebar/style.scss +111 -0
- package/src/components/collab-sidebar/utils.js +9 -0
- package/src/components/commands/index.js +9 -7
- package/src/components/document-bar/index.js +15 -7
- package/src/components/document-bar/style.scss +0 -4
- package/src/components/document-tools/index.js +2 -8
- package/src/components/editor-interface/index.js +4 -18
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/src/components/global-styles-provider/index.js +20 -6
- package/src/components/header/index.js +3 -1
- package/src/components/header/style.scss +1 -0
- package/src/components/inserter-sidebar/index.js +3 -6
- package/src/components/page-attributes/parent.js +6 -4
- package/src/components/plugin-more-menu-item/index.js +12 -11
- package/src/components/plugin-preview-menu-item/index.js +14 -13
- package/src/components/plugin-sidebar/index.js +0 -13
- package/src/components/post-actions/index.js +8 -11
- package/src/components/post-author/panel.js +4 -2
- package/src/components/post-card-panel/index.js +9 -43
- package/src/components/post-card-panel/style.scss +1 -9
- package/src/components/post-content-information/index.js +1 -1
- package/src/components/post-featured-image/index.js +31 -16
- package/src/components/post-featured-image/style.scss +5 -2
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-sticky/test/index.js +6 -6
- package/src/components/post-taxonomies/flat-term-selector.js +15 -4
- package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/src/components/post-template/classic-theme.js +1 -2
- package/src/components/post-url/index.js +67 -55
- package/src/components/post-url/panel.js +61 -35
- package/src/components/post-url/style.scss +21 -3
- package/src/components/preview-dropdown/index.js +0 -2
- package/src/components/provider/index.js +32 -24
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/components/sidebar/header.js +3 -2
- package/src/components/sidebar/index.js +5 -3
- package/src/components/time-to-read/index.js +3 -3
- package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
- package/src/components/visual-editor/index.js +32 -39
- package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
- package/src/components/zoom-out-toggle/index.js +39 -5
- package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
- package/src/private-apis.js +1 -5
- package/src/store/actions.js +33 -4
- package/src/store/private-actions.js +3 -3
- package/src/store/selectors.js +24 -2
- package/src/style.scss +1 -0
- package/src/utils/pageTypeBadge.js +41 -0
- package/src/utils/terms.js +4 -2
- package/src/utils/test/terms.js +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { ToolbarButton } from '@wordpress/components';
|
|
5
|
+
import { _x } from '@wordpress/i18n';
|
|
6
|
+
import { comment as commentIcon } from '@wordpress/icons';
|
|
7
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
|
|
14
|
+
const { __unstableCommentIconToolbarFill } = unlock( blockEditorPrivateApis );
|
|
15
|
+
|
|
16
|
+
const AddCommentToolbarButton = ( { onClick } ) => {
|
|
17
|
+
return (
|
|
18
|
+
<__unstableCommentIconToolbarFill>
|
|
19
|
+
<ToolbarButton
|
|
20
|
+
accessibleWhenDisabled
|
|
21
|
+
icon={ commentIcon }
|
|
22
|
+
label={ _x( 'Comment', 'View comment' ) }
|
|
23
|
+
onClick={ onClick }
|
|
24
|
+
/>
|
|
25
|
+
</__unstableCommentIconToolbarFill>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default AddCommentToolbarButton;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { MenuItem } from '@wordpress/components';
|
|
5
|
+
import { _x } from '@wordpress/i18n';
|
|
6
|
+
import { comment as commentIcon } from '@wordpress/icons';
|
|
7
|
+
|
|
8
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
|
|
15
|
+
const { __unstableCommentIconFill } = unlock( blockEditorPrivateApis );
|
|
16
|
+
|
|
17
|
+
const AddCommentButton = ( { onClick } ) => {
|
|
18
|
+
return (
|
|
19
|
+
<__unstableCommentIconFill>
|
|
20
|
+
<MenuItem
|
|
21
|
+
icon={ commentIcon }
|
|
22
|
+
onClick={ onClick }
|
|
23
|
+
aria-haspopup="dialog"
|
|
24
|
+
>
|
|
25
|
+
{ _x( 'Comment', 'Add comment button' ) }
|
|
26
|
+
</MenuItem>
|
|
27
|
+
</__unstableCommentIconFill>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default AddCommentButton;
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState, RawHTML } from '@wordpress/element';
|
|
10
|
+
import {
|
|
11
|
+
__experimentalHStack as HStack,
|
|
12
|
+
__experimentalVStack as VStack,
|
|
13
|
+
__experimentalConfirmDialog as ConfirmDialog,
|
|
14
|
+
Button,
|
|
15
|
+
DropdownMenu,
|
|
16
|
+
TextareaControl,
|
|
17
|
+
Tooltip,
|
|
18
|
+
} from '@wordpress/components';
|
|
19
|
+
import {
|
|
20
|
+
dateI18n,
|
|
21
|
+
format,
|
|
22
|
+
getSettings as getDateSettings,
|
|
23
|
+
} from '@wordpress/date';
|
|
24
|
+
import { Icon, check, published, moreVertical } from '@wordpress/icons';
|
|
25
|
+
import { __, _x } from '@wordpress/i18n';
|
|
26
|
+
import { useSelect } from '@wordpress/data';
|
|
27
|
+
import { useEntityProp } from '@wordpress/core-data';
|
|
28
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Internal dependencies
|
|
32
|
+
*/
|
|
33
|
+
import { sanitizeCommentString } from './utils';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Renders the Comments component.
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} props - The component props.
|
|
39
|
+
* @param {Array} props.threads - The array of comment threads.
|
|
40
|
+
* @param {Function} props.onEditComment - The function to handle comment editing.
|
|
41
|
+
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
42
|
+
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
43
|
+
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
44
|
+
* @return {JSX.Element} The rendered Comments component.
|
|
45
|
+
*/
|
|
46
|
+
export function Comments( {
|
|
47
|
+
threads,
|
|
48
|
+
onEditComment,
|
|
49
|
+
onAddReply,
|
|
50
|
+
onCommentDelete,
|
|
51
|
+
onCommentResolve,
|
|
52
|
+
} ) {
|
|
53
|
+
const [ actionState, setActionState ] = useState( false );
|
|
54
|
+
const [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );
|
|
55
|
+
|
|
56
|
+
const handleConfirmDelete = () => {
|
|
57
|
+
onCommentDelete( actionState.id );
|
|
58
|
+
setActionState( false );
|
|
59
|
+
setIsConfirmDialogOpen( false );
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const handleConfirmResolve = () => {
|
|
63
|
+
onCommentResolve( actionState.id );
|
|
64
|
+
setActionState( false );
|
|
65
|
+
setIsConfirmDialogOpen( false );
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const handleCancelDelete = () => {
|
|
69
|
+
setActionState( false );
|
|
70
|
+
setIsConfirmDialogOpen( false );
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const blockCommentId = useSelect( ( select ) => {
|
|
74
|
+
const clientID = select( blockEditorStore ).getSelectedBlockClientId();
|
|
75
|
+
return (
|
|
76
|
+
select( blockEditorStore ).getBlock( clientID )?.attributes
|
|
77
|
+
?.blockCommentId ?? false
|
|
78
|
+
);
|
|
79
|
+
}, [] );
|
|
80
|
+
|
|
81
|
+
const CommentBoard = ( { thread, parentThread } ) => {
|
|
82
|
+
return (
|
|
83
|
+
<>
|
|
84
|
+
<CommentHeader
|
|
85
|
+
thread={ thread }
|
|
86
|
+
onResolve={ () => {
|
|
87
|
+
setActionState( {
|
|
88
|
+
action: 'resolve',
|
|
89
|
+
id: parentThread?.id ?? thread.id,
|
|
90
|
+
} );
|
|
91
|
+
setIsConfirmDialogOpen( true );
|
|
92
|
+
} }
|
|
93
|
+
onEdit={ () =>
|
|
94
|
+
setActionState( { action: 'edit', id: thread.id } )
|
|
95
|
+
}
|
|
96
|
+
onDelete={ () => {
|
|
97
|
+
setActionState( { action: 'delete', id: thread.id } );
|
|
98
|
+
setIsConfirmDialogOpen( true );
|
|
99
|
+
} }
|
|
100
|
+
onReply={
|
|
101
|
+
! parentThread
|
|
102
|
+
? () =>
|
|
103
|
+
setActionState( {
|
|
104
|
+
action: 'reply',
|
|
105
|
+
id: thread.id,
|
|
106
|
+
} )
|
|
107
|
+
: undefined
|
|
108
|
+
}
|
|
109
|
+
status={ parentThread?.status ?? thread.status }
|
|
110
|
+
/>
|
|
111
|
+
<HStack
|
|
112
|
+
alignment="left"
|
|
113
|
+
spacing="3"
|
|
114
|
+
justify="flex-start"
|
|
115
|
+
className="editor-collab-sidebar-panel__user-comment"
|
|
116
|
+
>
|
|
117
|
+
<VStack
|
|
118
|
+
spacing="3"
|
|
119
|
+
className="editor-collab-sidebar-panel__comment-field"
|
|
120
|
+
>
|
|
121
|
+
{ 'edit' === actionState?.action &&
|
|
122
|
+
thread.id === actionState?.id && (
|
|
123
|
+
<CommentForm
|
|
124
|
+
onSubmit={ ( value ) => {
|
|
125
|
+
onEditComment( thread.id, value );
|
|
126
|
+
setActionState( false );
|
|
127
|
+
} }
|
|
128
|
+
onCancel={ () => setActionState( false ) }
|
|
129
|
+
thread={ thread }
|
|
130
|
+
/>
|
|
131
|
+
) }
|
|
132
|
+
{ ( ! actionState ||
|
|
133
|
+
'edit' !== actionState?.action ) && (
|
|
134
|
+
<RawHTML>{ thread?.content?.raw }</RawHTML>
|
|
135
|
+
) }
|
|
136
|
+
</VStack>
|
|
137
|
+
</HStack>
|
|
138
|
+
{ 'resolve' === actionState?.action &&
|
|
139
|
+
thread.id === actionState?.id && (
|
|
140
|
+
<ConfirmDialog
|
|
141
|
+
isOpen={ isConfirmDialogOpen }
|
|
142
|
+
onConfirm={ handleConfirmResolve }
|
|
143
|
+
onCancel={ handleCancelDelete }
|
|
144
|
+
confirmButtonText="Yes"
|
|
145
|
+
cancelButtonText="No"
|
|
146
|
+
>
|
|
147
|
+
{
|
|
148
|
+
// translators: message displayed when confirming an action
|
|
149
|
+
__(
|
|
150
|
+
'Are you sure you want to mark this comment as resolved?'
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
</ConfirmDialog>
|
|
154
|
+
) }
|
|
155
|
+
{ 'delete' === actionState?.action &&
|
|
156
|
+
thread.id === actionState?.id && (
|
|
157
|
+
<ConfirmDialog
|
|
158
|
+
isOpen={ isConfirmDialogOpen }
|
|
159
|
+
onConfirm={ handleConfirmDelete }
|
|
160
|
+
onCancel={ handleCancelDelete }
|
|
161
|
+
confirmButtonText="Yes"
|
|
162
|
+
cancelButtonText="No"
|
|
163
|
+
>
|
|
164
|
+
{
|
|
165
|
+
// translators: message displayed when confirming an action
|
|
166
|
+
__(
|
|
167
|
+
'Are you sure you want to delete this comment?'
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
</ConfirmDialog>
|
|
171
|
+
) }
|
|
172
|
+
</>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<>
|
|
178
|
+
{
|
|
179
|
+
// If there are no comments, show a message indicating no comments are available.
|
|
180
|
+
( ! Array.isArray( threads ) || threads.length === 0 ) && (
|
|
181
|
+
<VStack
|
|
182
|
+
alignment="left"
|
|
183
|
+
className="editor-collab-sidebar-panel__thread"
|
|
184
|
+
justify="flex-start"
|
|
185
|
+
spacing="3"
|
|
186
|
+
>
|
|
187
|
+
{
|
|
188
|
+
// translators: message displayed when there are no comments available
|
|
189
|
+
__( 'No comments available' )
|
|
190
|
+
}
|
|
191
|
+
</VStack>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
{ Array.isArray( threads ) &&
|
|
196
|
+
threads.length > 0 &&
|
|
197
|
+
threads.map( ( thread ) => (
|
|
198
|
+
<VStack
|
|
199
|
+
key={ thread.id }
|
|
200
|
+
className={ clsx(
|
|
201
|
+
'editor-collab-sidebar-panel__thread',
|
|
202
|
+
{
|
|
203
|
+
'editor-collab-sidebar-panel__active-thread':
|
|
204
|
+
blockCommentId &&
|
|
205
|
+
blockCommentId === thread.id,
|
|
206
|
+
}
|
|
207
|
+
) }
|
|
208
|
+
id={ thread.id }
|
|
209
|
+
spacing="3"
|
|
210
|
+
>
|
|
211
|
+
<CommentBoard thread={ thread } />
|
|
212
|
+
{ 'reply' === actionState?.action &&
|
|
213
|
+
thread.id === actionState?.id && (
|
|
214
|
+
<HStack
|
|
215
|
+
alignment="left"
|
|
216
|
+
spacing="3"
|
|
217
|
+
justify="flex-start"
|
|
218
|
+
className="editor-collab-sidebar-panel__user-comment"
|
|
219
|
+
>
|
|
220
|
+
<VStack
|
|
221
|
+
spacing="3"
|
|
222
|
+
className="editor-collab-sidebar-panel__comment-field"
|
|
223
|
+
>
|
|
224
|
+
<CommentForm
|
|
225
|
+
onSubmit={ ( inputComment ) => {
|
|
226
|
+
onAddReply(
|
|
227
|
+
inputComment,
|
|
228
|
+
thread.id
|
|
229
|
+
);
|
|
230
|
+
setActionState( false );
|
|
231
|
+
} }
|
|
232
|
+
onCancel={ () =>
|
|
233
|
+
setActionState( false )
|
|
234
|
+
}
|
|
235
|
+
/>
|
|
236
|
+
</VStack>
|
|
237
|
+
</HStack>
|
|
238
|
+
) }
|
|
239
|
+
{ 0 < thread?.reply?.length &&
|
|
240
|
+
thread.reply.map( ( reply ) => (
|
|
241
|
+
<VStack
|
|
242
|
+
key={ reply.id }
|
|
243
|
+
className="editor-collab-sidebar-panel__child-thread"
|
|
244
|
+
id={ reply.id }
|
|
245
|
+
spacing="2"
|
|
246
|
+
>
|
|
247
|
+
<CommentBoard
|
|
248
|
+
thread={ reply }
|
|
249
|
+
parentThread={ thread }
|
|
250
|
+
/>
|
|
251
|
+
</VStack>
|
|
252
|
+
) ) }
|
|
253
|
+
</VStack>
|
|
254
|
+
) ) }
|
|
255
|
+
</>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* EditComment component.
|
|
261
|
+
*
|
|
262
|
+
* @param {Object} props - The component props.
|
|
263
|
+
* @param {Function} props.onSubmit - The function to call when updating the comment.
|
|
264
|
+
* @param {Function} props.onCancel - The function to call when canceling the comment update.
|
|
265
|
+
* @param {Object} props.thread - The comment thread object.
|
|
266
|
+
* @return {JSX.Element} The CommentForm component.
|
|
267
|
+
*/
|
|
268
|
+
function CommentForm( { onSubmit, onCancel, thread } ) {
|
|
269
|
+
const [ inputComment, setInputComment ] = useState(
|
|
270
|
+
thread?.content?.raw ?? ''
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<>
|
|
275
|
+
<TextareaControl
|
|
276
|
+
__nextHasNoMarginBottom
|
|
277
|
+
value={ inputComment ?? '' }
|
|
278
|
+
onChange={ setInputComment }
|
|
279
|
+
/>
|
|
280
|
+
<VStack alignment="left" spacing="3" justify="flex-start">
|
|
281
|
+
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
282
|
+
<Button
|
|
283
|
+
__next40pxDefaultSize
|
|
284
|
+
accessibleWhenDisabled
|
|
285
|
+
variant="primary"
|
|
286
|
+
onClick={ () => onSubmit( inputComment ) }
|
|
287
|
+
disabled={
|
|
288
|
+
0 === sanitizeCommentString( inputComment ).length
|
|
289
|
+
}
|
|
290
|
+
>
|
|
291
|
+
{ thread
|
|
292
|
+
? _x( 'Update', 'verb' )
|
|
293
|
+
: _x( 'Reply', 'Add reply comment' ) }
|
|
294
|
+
</Button>
|
|
295
|
+
<Button __next40pxDefaultSize onClick={ onCancel }>
|
|
296
|
+
{ _x( 'Cancel', 'Cancel comment edit' ) }
|
|
297
|
+
</Button>
|
|
298
|
+
</HStack>
|
|
299
|
+
</VStack>
|
|
300
|
+
</>
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Renders the header of a comment in the collaboration sidebar.
|
|
306
|
+
*
|
|
307
|
+
* @param {Object} props - The component props.
|
|
308
|
+
* @param {Object} props.thread - The comment thread object.
|
|
309
|
+
* @param {Function} props.onResolve - The function to resolve the comment.
|
|
310
|
+
* @param {Function} props.onEdit - The function to edit the comment.
|
|
311
|
+
* @param {Function} props.onDelete - The function to delete the comment.
|
|
312
|
+
* @param {Function} props.onReply - The function to reply to the comment.
|
|
313
|
+
* @param {string} props.status - The status of the comment.
|
|
314
|
+
* @return {JSX.Element} The rendered comment header.
|
|
315
|
+
*/
|
|
316
|
+
function CommentHeader( {
|
|
317
|
+
thread,
|
|
318
|
+
onResolve,
|
|
319
|
+
onEdit,
|
|
320
|
+
onDelete,
|
|
321
|
+
onReply,
|
|
322
|
+
status,
|
|
323
|
+
} ) {
|
|
324
|
+
const dateSettings = getDateSettings();
|
|
325
|
+
const [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(
|
|
326
|
+
'root',
|
|
327
|
+
'site',
|
|
328
|
+
'time_format'
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
const actions = [
|
|
332
|
+
{
|
|
333
|
+
title: _x( 'Edit', 'Edit comment' ),
|
|
334
|
+
onClick: onEdit,
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
title: _x( 'Delete', 'Delete comment' ),
|
|
338
|
+
onClick: onDelete,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
title: _x( 'Reply', 'Reply on a comment' ),
|
|
342
|
+
onClick: onReply,
|
|
343
|
+
},
|
|
344
|
+
];
|
|
345
|
+
|
|
346
|
+
const moreActions = actions.filter( ( item ) => item.onClick );
|
|
347
|
+
|
|
348
|
+
return (
|
|
349
|
+
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
350
|
+
<img
|
|
351
|
+
src={ thread?.author_avatar_urls?.[ 48 ] }
|
|
352
|
+
className="editor-collab-sidebar-panel__user-avatar"
|
|
353
|
+
// translators: alt text for user avatar image
|
|
354
|
+
alt={ __( 'User avatar' ) }
|
|
355
|
+
width={ 32 }
|
|
356
|
+
height={ 32 }
|
|
357
|
+
/>
|
|
358
|
+
<VStack spacing="0">
|
|
359
|
+
<span className="editor-collab-sidebar-panel__user-name">
|
|
360
|
+
{ thread.author_name }
|
|
361
|
+
</span>
|
|
362
|
+
<time
|
|
363
|
+
dateTime={ format( 'h:i A', thread.date ) }
|
|
364
|
+
className="editor-collab-sidebar-panel__user-time"
|
|
365
|
+
>
|
|
366
|
+
{ dateI18n( dateTimeFormat, thread.date ) }
|
|
367
|
+
</time>
|
|
368
|
+
</VStack>
|
|
369
|
+
<span className="editor-collab-sidebar-panel__comment-status">
|
|
370
|
+
{ status !== 'approved' && (
|
|
371
|
+
<HStack alignment="right" justify="flex-end" spacing="0">
|
|
372
|
+
{ 0 === thread.parent && onResolve && (
|
|
373
|
+
<Button
|
|
374
|
+
label={ _x(
|
|
375
|
+
'Resolve',
|
|
376
|
+
'Mark comment as resolved'
|
|
377
|
+
) }
|
|
378
|
+
__next40pxDefaultSize
|
|
379
|
+
icon={ published }
|
|
380
|
+
onClick={ onResolve }
|
|
381
|
+
showTooltip
|
|
382
|
+
/>
|
|
383
|
+
) }
|
|
384
|
+
<DropdownMenu
|
|
385
|
+
icon={ moreVertical }
|
|
386
|
+
label={ _x(
|
|
387
|
+
'Select an action',
|
|
388
|
+
'Select comment action'
|
|
389
|
+
) }
|
|
390
|
+
className="editor-collab-sidebar-panel__comment-dropdown-menu"
|
|
391
|
+
controls={ moreActions }
|
|
392
|
+
/>
|
|
393
|
+
</HStack>
|
|
394
|
+
) }
|
|
395
|
+
{ status === 'approved' && (
|
|
396
|
+
// translators: tooltip for resolved comment
|
|
397
|
+
<Tooltip text={ __( 'Resolved' ) }>
|
|
398
|
+
<Icon icon={ check } />
|
|
399
|
+
</Tooltip>
|
|
400
|
+
) }
|
|
401
|
+
</span>
|
|
402
|
+
</HStack>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const collabSidebarName = 'edit-post/collab-sidebar';
|