@wordpress/editor 14.13.1-next.a9f418477.0 → 14.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/bindings/pattern-overrides.js +1 -0
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +1 -0
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +1 -0
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +1 -0
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +1 -1
- package/build/components/collab-sidebar/add-comment.js.map +1 -1
- package/build/components/collab-sidebar/comment-button.js +7 -2
- package/build/components/collab-sidebar/comment-button.js.map +1 -1
- package/build/components/collab-sidebar/comment-form.js +4 -1
- package/build/components/collab-sidebar/comment-form.js.map +1 -1
- package/build/components/collab-sidebar/comments.js +199 -185
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/collab-sidebar/index.js +11 -4
- package/build/components/collab-sidebar/index.js.map +1 -1
- package/build/components/collab-sidebar/utils.js +1 -0
- package/build/components/collab-sidebar/utils.js.map +1 -1
- package/build/components/deprecated.js +1 -0
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/index.js +1 -0
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/editor-help/index.native.js +1 -0
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -0
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +1 -0
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +1 -0
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -0
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +1 -0
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +1 -0
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +1 -0
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -0
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +1 -0
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +77 -91
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/hook.js +1 -0
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-card-panel/index.js +55 -20
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-fields/index.js +1 -0
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -0
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +1 -0
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-publish-button/index.js +1 -0
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +1 -0
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
- 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-saved-state/index.js +1 -0
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +1 -0
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +1 -0
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -0
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -0
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +1 -0
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/classic-theme.js +1 -0
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +1 -0
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +1 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -1
- package/build/components/post-type-support-check/index.js +1 -0
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +1 -0
- package/build/components/preferences-modal/block-visibility.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -0
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +1 -0
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.native.js +1 -0
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -0
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/index.js +1 -0
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/start-page-options/index.js +1 -0
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +1 -0
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +1 -0
- package/build/components/template-part-content-panel/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +1 -0
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js +1 -0
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/dataviews/store/private-actions.js +1 -0
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/reducer.js +1 -0
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +1 -0
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/pattern-overrides.js +1 -0
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/store/actions.js +1 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +1 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +1 -0
- package/build/store/reducer.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 +1 -0
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-template-info.js +1 -0
- package/build/utils/get-template-info.js.map +1 -1
- package/build/utils/pageTypeBadge.js +4 -3
- package/build/utils/pageTypeBadge.js.map +1 -1
- package/build/utils/terms.js +1 -0
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +1 -0
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +1 -0
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -0
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +1 -0
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
- 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 +1 -1
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-button.js +7 -2
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-form.js +4 -1
- package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
- package/build-module/components/collab-sidebar/comments.js +201 -187
- package/build-module/components/collab-sidebar/comments.js.map +1 -1
- package/build-module/components/collab-sidebar/index.js +11 -4
- package/build-module/components/collab-sidebar/index.js.map +1 -1
- package/build-module/components/collab-sidebar/utils.js +1 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -1
- package/build-module/components/deprecated.js +1 -0
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -0
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -0
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -0
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +1 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +1 -0
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -0
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +1 -0
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +1 -0
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +1 -0
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +1 -0
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +1 -0
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +77 -92
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/hook.js +1 -0
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +58 -21
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +1 -0
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -0
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -0
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -0
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -0
- 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 +1 -0
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -0
- 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-saved-state/index.js +1 -0
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +1 -0
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +1 -0
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +1 -0
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -0
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -0
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +1 -0
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -0
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +1 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +1 -0
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +1 -0
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -0
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +1 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -0
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -0
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -0
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +1 -0
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -0
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +1 -0
- package/build-module/components/template-part-content-panel/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +1 -0
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +1 -0
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +1 -0
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +1 -0
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +1 -0
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -0
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/store/actions.js +1 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +1 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +1 -0
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-template-info.js +1 -0
- package/build-module/utils/get-template-info.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +4 -3
- package/build-module/utils/pageTypeBadge.js.map +1 -1
- package/build-module/utils/terms.js +1 -0
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +12 -1
- package/build-style/style.css +12 -1
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +11 -7
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts +5 -0
- package/build-types/components/post-actions/index.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts +13 -4
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +20 -4
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +375 -75
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +2 -2
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
- package/package.json +36 -36
- package/src/components/collab-sidebar/add-comment.js +1 -1
- package/src/components/collab-sidebar/comment-button.js +12 -7
- package/src/components/collab-sidebar/comment-form.js +4 -1
- package/src/components/collab-sidebar/comments.js +260 -243
- package/src/components/collab-sidebar/index.js +10 -2
- package/src/components/collab-sidebar/style.scss +10 -1
- package/src/components/post-actions/index.js +89 -95
- package/src/components/post-card-panel/index.js +64 -26
- package/src/components/post-card-panel/style.scss +4 -0
- package/src/utils/pageTypeBadge.js +5 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
/**
|
|
2
3
|
* External dependencies
|
|
3
4
|
*/
|
|
@@ -9,7 +10,7 @@ import clsx from 'clsx';
|
|
|
9
10
|
import { useState, RawHTML } from '@wordpress/element';
|
|
10
11
|
import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalConfirmDialog as ConfirmDialog, Button, DropdownMenu, Tooltip } from '@wordpress/components';
|
|
11
12
|
import { Icon, check, published, moreVertical } from '@wordpress/icons';
|
|
12
|
-
import { __, _x } from '@wordpress/i18n';
|
|
13
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
13
14
|
import { useSelect } from '@wordpress/data';
|
|
14
15
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
15
16
|
|
|
@@ -22,115 +23,42 @@ import CommentForm from './comment-form';
|
|
|
22
23
|
/**
|
|
23
24
|
* Renders the Comments component.
|
|
24
25
|
*
|
|
25
|
-
* @param {Object} props
|
|
26
|
-
* @param {Array} props.threads
|
|
27
|
-
* @param {Function} props.onEditComment
|
|
28
|
-
* @param {Function} props.onAddReply
|
|
29
|
-
* @param {Function} props.onCommentDelete
|
|
30
|
-
* @param {Function} props.onCommentResolve
|
|
26
|
+
* @param {Object} props - The component props.
|
|
27
|
+
* @param {Array} props.threads - The array of comment threads.
|
|
28
|
+
* @param {Function} props.onEditComment - The function to handle comment editing.
|
|
29
|
+
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
30
|
+
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
31
|
+
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
32
|
+
* @param {boolean} props.showCommentBoard - Whether to show the comment board.
|
|
33
|
+
* @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
|
|
31
34
|
* @return {React.ReactNode} The rendered Comments component.
|
|
32
35
|
*/
|
|
33
|
-
import { jsx as _jsx,
|
|
36
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
37
|
export function Comments({
|
|
35
38
|
threads,
|
|
36
39
|
onEditComment,
|
|
37
40
|
onAddReply,
|
|
38
41
|
onCommentDelete,
|
|
39
|
-
onCommentResolve
|
|
42
|
+
onCommentResolve,
|
|
43
|
+
showCommentBoard,
|
|
44
|
+
setShowCommentBoard
|
|
40
45
|
}) {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
const handleCancelDelete = () => {
|
|
54
|
-
setActionState(false);
|
|
55
|
-
setIsConfirmDialogOpen(false);
|
|
56
|
-
};
|
|
57
|
-
const blockCommentId = useSelect(select => {
|
|
58
|
-
var _select$getBlock$attr;
|
|
59
|
-
const clientID = select(blockEditorStore).getSelectedBlockClientId();
|
|
60
|
-
return (_select$getBlock$attr = select(blockEditorStore).getBlock(clientID)?.attributes?.blockCommentId) !== null && _select$getBlock$attr !== void 0 ? _select$getBlock$attr : false;
|
|
46
|
+
const {
|
|
47
|
+
blockCommentId
|
|
48
|
+
} = useSelect(select => {
|
|
49
|
+
const {
|
|
50
|
+
getBlockAttributes,
|
|
51
|
+
getSelectedBlockClientId
|
|
52
|
+
} = select(blockEditorStore);
|
|
53
|
+
const _clientId = getSelectedBlockClientId();
|
|
54
|
+
return {
|
|
55
|
+
blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null
|
|
56
|
+
};
|
|
61
57
|
}, []);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var _parentThread$status;
|
|
67
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
68
|
-
children: [/*#__PURE__*/_jsx(CommentHeader, {
|
|
69
|
-
thread: thread,
|
|
70
|
-
onResolve: () => {
|
|
71
|
-
var _parentThread$id;
|
|
72
|
-
setActionState({
|
|
73
|
-
action: 'resolve',
|
|
74
|
-
id: (_parentThread$id = parentThread?.id) !== null && _parentThread$id !== void 0 ? _parentThread$id : thread.id
|
|
75
|
-
});
|
|
76
|
-
setIsConfirmDialogOpen(true);
|
|
77
|
-
},
|
|
78
|
-
onEdit: () => setActionState({
|
|
79
|
-
action: 'edit',
|
|
80
|
-
id: thread.id
|
|
81
|
-
}),
|
|
82
|
-
onDelete: () => {
|
|
83
|
-
setActionState({
|
|
84
|
-
action: 'delete',
|
|
85
|
-
id: thread.id
|
|
86
|
-
});
|
|
87
|
-
setIsConfirmDialogOpen(true);
|
|
88
|
-
},
|
|
89
|
-
onReply: !parentThread ? () => setActionState({
|
|
90
|
-
action: 'reply',
|
|
91
|
-
id: thread.id
|
|
92
|
-
}) : undefined,
|
|
93
|
-
status: (_parentThread$status = parentThread?.status) !== null && _parentThread$status !== void 0 ? _parentThread$status : thread.status
|
|
94
|
-
}), /*#__PURE__*/_jsx(HStack, {
|
|
95
|
-
alignment: "left",
|
|
96
|
-
spacing: "3",
|
|
97
|
-
justify: "flex-start",
|
|
98
|
-
className: "editor-collab-sidebar-panel__user-comment",
|
|
99
|
-
children: /*#__PURE__*/_jsxs(VStack, {
|
|
100
|
-
spacing: "3",
|
|
101
|
-
className: "editor-collab-sidebar-panel__comment-field",
|
|
102
|
-
children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(CommentForm, {
|
|
103
|
-
onSubmit: value => {
|
|
104
|
-
onEditComment(thread.id, value);
|
|
105
|
-
setActionState(false);
|
|
106
|
-
},
|
|
107
|
-
onCancel: () => setActionState(false),
|
|
108
|
-
thread: thread,
|
|
109
|
-
submitButtonText: _x('Update', 'verb')
|
|
110
|
-
}), (!actionState || 'edit' !== actionState?.action) && /*#__PURE__*/_jsx(RawHTML, {
|
|
111
|
-
children: thread?.content?.raw
|
|
112
|
-
})]
|
|
113
|
-
})
|
|
114
|
-
}), 'resolve' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
115
|
-
isOpen: isConfirmDialogOpen,
|
|
116
|
-
onConfirm: handleConfirmResolve,
|
|
117
|
-
onCancel: handleCancelDelete,
|
|
118
|
-
confirmButtonText: "Yes",
|
|
119
|
-
cancelButtonText: "No",
|
|
120
|
-
children:
|
|
121
|
-
// translators: message displayed when confirming an action
|
|
122
|
-
__('Are you sure you want to mark this comment as resolved?')
|
|
123
|
-
}), 'delete' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
124
|
-
isOpen: isConfirmDialogOpen,
|
|
125
|
-
onConfirm: handleConfirmDelete,
|
|
126
|
-
onCancel: handleCancelDelete,
|
|
127
|
-
confirmButtonText: "Yes",
|
|
128
|
-
cancelButtonText: "No",
|
|
129
|
-
children:
|
|
130
|
-
// translators: message displayed when confirming an action
|
|
131
|
-
__('Are you sure you want to delete this comment?')
|
|
132
|
-
})]
|
|
133
|
-
});
|
|
58
|
+
const [focusThread, setFocusThread] = useState(showCommentBoard && blockCommentId ? blockCommentId : null);
|
|
59
|
+
const clearThreadFocus = () => {
|
|
60
|
+
setFocusThread(null);
|
|
61
|
+
setShowCommentBoard(false);
|
|
134
62
|
};
|
|
135
63
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
136
64
|
children: [
|
|
@@ -143,114 +71,200 @@ export function Comments({
|
|
|
143
71
|
children:
|
|
144
72
|
// translators: message displayed when there are no comments available
|
|
145
73
|
__('No comments available')
|
|
146
|
-
}), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/
|
|
74
|
+
}), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/_jsx(VStack, {
|
|
147
75
|
className: clsx('editor-collab-sidebar-panel__thread', {
|
|
148
|
-
'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id
|
|
76
|
+
'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id,
|
|
77
|
+
'editor-collab-sidebar-panel__focus-thread': focusThread && focusThread === thread.id
|
|
149
78
|
}),
|
|
150
79
|
id: thread.id,
|
|
151
80
|
spacing: "3",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
81
|
+
onClick: () => setFocusThread(thread.id),
|
|
82
|
+
children: /*#__PURE__*/_jsx(Thread, {
|
|
83
|
+
thread: thread,
|
|
84
|
+
onAddReply: onAddReply,
|
|
85
|
+
onCommentDelete: onCommentDelete,
|
|
86
|
+
onCommentResolve: onCommentResolve,
|
|
87
|
+
onEditComment: onEditComment,
|
|
88
|
+
isFocused: focusThread === thread.id,
|
|
89
|
+
clearThreadFocus: clearThreadFocus
|
|
90
|
+
})
|
|
91
|
+
}, thread.id))]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function Thread({
|
|
95
|
+
thread,
|
|
96
|
+
onEditComment,
|
|
97
|
+
onAddReply,
|
|
98
|
+
onCommentDelete,
|
|
99
|
+
onCommentResolve,
|
|
100
|
+
isFocused,
|
|
101
|
+
clearThreadFocus
|
|
102
|
+
}) {
|
|
103
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
104
|
+
children: [/*#__PURE__*/_jsx(CommentBoard, {
|
|
105
|
+
thread: thread,
|
|
106
|
+
onResolve: onCommentResolve,
|
|
107
|
+
onEdit: onEditComment,
|
|
108
|
+
onDelete: onCommentDelete,
|
|
109
|
+
status: thread.status
|
|
110
|
+
}), 0 < thread?.reply?.length && /*#__PURE__*/_jsxs(_Fragment, {
|
|
111
|
+
children: [!isFocused && /*#__PURE__*/_jsx(VStack, {
|
|
112
|
+
className: "editor-collab-sidebar-panel__show-more-reply",
|
|
113
|
+
children: sprintf(
|
|
114
|
+
// translators: 1: number of replies.
|
|
115
|
+
_x('%s more replies..', 'Show replies button'), thread?.reply?.length)
|
|
116
|
+
}), isFocused && thread.reply.map(reply => /*#__PURE__*/_jsxs(VStack, {
|
|
155
117
|
className: "editor-collab-sidebar-panel__child-thread",
|
|
156
118
|
id: reply.id,
|
|
157
119
|
spacing: "2",
|
|
158
|
-
children: /*#__PURE__*/_jsx(CommentBoard, {
|
|
120
|
+
children: ['approved' !== thread.status && /*#__PURE__*/_jsx(CommentBoard, {
|
|
159
121
|
thread: reply,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
spacing: "2",
|
|
165
|
-
children: [/*#__PURE__*/_jsx(HStack, {
|
|
166
|
-
alignment: "left",
|
|
167
|
-
spacing: "3",
|
|
168
|
-
justify: "flex-start",
|
|
169
|
-
children: /*#__PURE__*/_jsx(CommentAuthorInfo, {})
|
|
170
|
-
}), /*#__PURE__*/_jsx(VStack, {
|
|
171
|
-
spacing: "3",
|
|
172
|
-
className: "editor-collab-sidebar-panel__comment-field",
|
|
173
|
-
children: /*#__PURE__*/_jsx(CommentForm, {
|
|
174
|
-
onSubmit: inputComment => {
|
|
175
|
-
onAddReply(inputComment, thread.id);
|
|
176
|
-
setActionState(false);
|
|
177
|
-
},
|
|
178
|
-
onCancel: () => setActionState(false),
|
|
179
|
-
submitButtonText: _x('Reply', 'Add reply comment')
|
|
180
|
-
})
|
|
122
|
+
onEdit: onEditComment,
|
|
123
|
+
onDelete: onCommentDelete
|
|
124
|
+
}), 'approved' === thread.status && /*#__PURE__*/_jsx(CommentBoard, {
|
|
125
|
+
thread: reply
|
|
181
126
|
})]
|
|
127
|
+
}, reply.id))]
|
|
128
|
+
}), 'approved' !== thread.status && isFocused && /*#__PURE__*/_jsxs(VStack, {
|
|
129
|
+
className: "editor-collab-sidebar-panel__child-thread",
|
|
130
|
+
spacing: "2",
|
|
131
|
+
children: [/*#__PURE__*/_jsx(HStack, {
|
|
132
|
+
alignment: "left",
|
|
133
|
+
spacing: "3",
|
|
134
|
+
justify: "flex-start",
|
|
135
|
+
children: /*#__PURE__*/_jsx(CommentAuthorInfo, {})
|
|
136
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
137
|
+
spacing: "3",
|
|
138
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
139
|
+
children: /*#__PURE__*/_jsx(CommentForm, {
|
|
140
|
+
onSubmit: inputComment => {
|
|
141
|
+
onAddReply(inputComment, thread.id);
|
|
142
|
+
},
|
|
143
|
+
onCancel: event => {
|
|
144
|
+
event.stopPropagation(); // Prevent the parent onClick from being triggered
|
|
145
|
+
clearThreadFocus();
|
|
146
|
+
},
|
|
147
|
+
submitButtonText: _x('Reply', 'Add reply comment')
|
|
148
|
+
})
|
|
182
149
|
})]
|
|
183
|
-
}
|
|
150
|
+
})]
|
|
184
151
|
});
|
|
185
152
|
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Renders the header of a comment in the collaboration sidebar.
|
|
189
|
-
*
|
|
190
|
-
* @param {Object} props - The component props.
|
|
191
|
-
* @param {Object} props.thread - The comment thread object.
|
|
192
|
-
* @param {Function} props.onResolve - The function to resolve the comment.
|
|
193
|
-
* @param {Function} props.onEdit - The function to edit the comment.
|
|
194
|
-
* @param {Function} props.onDelete - The function to delete the comment.
|
|
195
|
-
* @param {Function} props.onReply - The function to reply to the comment.
|
|
196
|
-
* @param {string} props.status - The status of the comment.
|
|
197
|
-
* @return {React.ReactNode} The rendered comment header.
|
|
198
|
-
*/
|
|
199
|
-
function CommentHeader({
|
|
153
|
+
const CommentBoard = ({
|
|
200
154
|
thread,
|
|
201
155
|
onResolve,
|
|
202
156
|
onEdit,
|
|
203
157
|
onDelete,
|
|
204
|
-
onReply,
|
|
205
158
|
status
|
|
206
|
-
}) {
|
|
207
|
-
const
|
|
159
|
+
}) => {
|
|
160
|
+
const [actionState, setActionState] = useState(false);
|
|
161
|
+
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
|
162
|
+
const handleConfirmDelete = () => {
|
|
163
|
+
onDelete(thread.id);
|
|
164
|
+
setActionState(false);
|
|
165
|
+
setShowConfirmDialog(false);
|
|
166
|
+
};
|
|
167
|
+
const handleConfirmResolve = () => {
|
|
168
|
+
onResolve(thread.id);
|
|
169
|
+
setActionState(false);
|
|
170
|
+
setShowConfirmDialog(false);
|
|
171
|
+
};
|
|
172
|
+
const handleCancel = () => {
|
|
173
|
+
setActionState(false);
|
|
174
|
+
setShowConfirmDialog(false);
|
|
175
|
+
};
|
|
176
|
+
const actions = [onEdit && {
|
|
208
177
|
title: _x('Edit', 'Edit comment'),
|
|
209
|
-
onClick:
|
|
210
|
-
|
|
178
|
+
onClick: () => {
|
|
179
|
+
setActionState('edit');
|
|
180
|
+
}
|
|
181
|
+
}, onDelete && {
|
|
211
182
|
title: _x('Delete', 'Delete comment'),
|
|
212
|
-
onClick:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
183
|
+
onClick: () => {
|
|
184
|
+
setActionState('delete');
|
|
185
|
+
setShowConfirmDialog(true);
|
|
186
|
+
}
|
|
216
187
|
}];
|
|
217
|
-
const moreActions = actions.filter(item => item
|
|
218
|
-
return /*#__PURE__*/_jsxs(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
188
|
+
const moreActions = actions.filter(item => item?.onClick);
|
|
189
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
190
|
+
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
191
|
+
alignment: "left",
|
|
192
|
+
spacing: "3",
|
|
193
|
+
justify: "flex-start",
|
|
194
|
+
children: [/*#__PURE__*/_jsx(CommentAuthorInfo, {
|
|
195
|
+
avatar: thread?.author_avatar_urls?.[48],
|
|
196
|
+
name: thread?.author_name,
|
|
197
|
+
date: thread?.date
|
|
198
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
199
|
+
className: "editor-collab-sidebar-panel__comment-status",
|
|
200
|
+
children: [status !== 'approved' && /*#__PURE__*/_jsxs(HStack, {
|
|
201
|
+
alignment: "right",
|
|
202
|
+
justify: "flex-end",
|
|
203
|
+
spacing: "0",
|
|
204
|
+
children: [0 === thread?.parent && onResolve && /*#__PURE__*/_jsx(Button, {
|
|
205
|
+
label: _x('Resolve', 'Mark comment as resolved'),
|
|
206
|
+
__next40pxDefaultSize: true,
|
|
207
|
+
icon: published,
|
|
208
|
+
onClick: () => {
|
|
209
|
+
setActionState('resolve');
|
|
210
|
+
setShowConfirmDialog(true);
|
|
211
|
+
},
|
|
212
|
+
showTooltip: true
|
|
213
|
+
}), 0 < moreActions.length && /*#__PURE__*/_jsx(DropdownMenu, {
|
|
214
|
+
icon: moreVertical,
|
|
215
|
+
label: _x('Select an action', 'Select comment action'),
|
|
216
|
+
className: "editor-collab-sidebar-panel__comment-dropdown-menu",
|
|
217
|
+
controls: moreActions
|
|
218
|
+
})]
|
|
219
|
+
}), status === 'approved' &&
|
|
220
|
+
/*#__PURE__*/
|
|
221
|
+
// translators: tooltip for resolved comment
|
|
222
|
+
_jsx(Tooltip, {
|
|
223
|
+
text: __('Resolved'),
|
|
224
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
225
|
+
icon: check
|
|
226
|
+
})
|
|
243
227
|
})]
|
|
244
|
-
}), status === 'approved' &&
|
|
245
|
-
/*#__PURE__*/
|
|
246
|
-
// translators: tooltip for resolved comment
|
|
247
|
-
_jsx(Tooltip, {
|
|
248
|
-
text: __('Resolved'),
|
|
249
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
250
|
-
icon: check
|
|
251
|
-
})
|
|
252
228
|
})]
|
|
229
|
+
}), /*#__PURE__*/_jsx(HStack, {
|
|
230
|
+
alignment: "left",
|
|
231
|
+
spacing: "3",
|
|
232
|
+
justify: "flex-start",
|
|
233
|
+
className: "editor-collab-sidebar-panel__user-comment",
|
|
234
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
235
|
+
spacing: "3",
|
|
236
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
237
|
+
children: ['edit' === actionState && /*#__PURE__*/_jsx(CommentForm, {
|
|
238
|
+
onSubmit: value => {
|
|
239
|
+
onEdit(thread.id, value);
|
|
240
|
+
setActionState(false);
|
|
241
|
+
},
|
|
242
|
+
onCancel: () => handleCancel(),
|
|
243
|
+
thread: thread,
|
|
244
|
+
submitButtonText: _x('Update', 'verb')
|
|
245
|
+
}), 'edit' !== actionState && /*#__PURE__*/_jsx(RawHTML, {
|
|
246
|
+
children: thread?.content?.raw
|
|
247
|
+
})]
|
|
248
|
+
})
|
|
249
|
+
}), 'resolve' === actionState && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
250
|
+
isOpen: showConfirmDialog,
|
|
251
|
+
onConfirm: handleConfirmResolve,
|
|
252
|
+
onCancel: handleCancel,
|
|
253
|
+
confirmButtonText: "Yes",
|
|
254
|
+
cancelButtonText: "No",
|
|
255
|
+
children:
|
|
256
|
+
// translators: message displayed when confirming an action
|
|
257
|
+
__('Are you sure you want to mark this comment as resolved?')
|
|
258
|
+
}), 'delete' === actionState && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
259
|
+
isOpen: showConfirmDialog,
|
|
260
|
+
onConfirm: handleConfirmDelete,
|
|
261
|
+
onCancel: handleCancel,
|
|
262
|
+
confirmButtonText: "Yes",
|
|
263
|
+
cancelButtonText: "No",
|
|
264
|
+
children:
|
|
265
|
+
// translators: message displayed when confirming an action
|
|
266
|
+
__('Are you sure you want to delete this comment?')
|
|
253
267
|
})]
|
|
254
268
|
});
|
|
255
|
-
}
|
|
269
|
+
};
|
|
256
270
|
//# sourceMappingURL=comments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useState","RawHTML","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","Tooltip","Icon","check","published","moreVertical","__","_x","useSelect","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","select","_select$getBlock$attr","clientID","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","children","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","alignment","spacing","justify","className","onSubmit","value","onCancel","submitButtonText","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText","Array","isArray","length","map","reply","inputComment","actions","title","onClick","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","label","__next40pxDefaultSize","icon","showTooltip","controls","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTooltip,\n} from '@wordpress/components';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\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 Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @return {React.ReactNode} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n} ) {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonCommentDelete( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonCommentResolve( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleCancelDelete = () => {\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst blockCommentId = useSelect( ( select ) => {\n\t\tconst clientID = select( blockEditorStore ).getSelectedBlockClientId();\n\t\treturn (\n\t\t\tselect( blockEditorStore ).getBlock( clientID )?.attributes\n\t\t\t\t?.blockCommentId ?? false\n\t\t);\n\t}, [] );\n\n\tconst CommentBoard = ( { thread, parentThread } ) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<CommentHeader\n\t\t\t\t\tthread={ thread }\n\t\t\t\t\tonResolve={ () => {\n\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\taction: 'resolve',\n\t\t\t\t\t\t\tid: parentThread?.id ?? thread.id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonEdit={ () =>\n\t\t\t\t\t\tsetActionState( { action: 'edit', id: thread.id } )\n\t\t\t\t\t}\n\t\t\t\t\tonDelete={ () => {\n\t\t\t\t\t\tsetActionState( { action: 'delete', id: thread.id } );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonReply={\n\t\t\t\t\t\t! parentThread\n\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\t\t\t\taction: 'reply',\n\t\t\t\t\t\t\t\t\t\tid: thread.id,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tstatus={ parentThread?.status ?? thread.status }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"left\"\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ 'edit' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonEditComment( thread.id, value );\n\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonCancel={ () => setActionState( false ) }\n\t\t\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\t\t\tsubmitButtonText={ _x( 'Update', 'verb' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ( ! actionState ||\n\t\t\t\t\t\t\t'edit' !== actionState?.action ) && (\n\t\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</HStack>\n\t\t\t\t{ 'resolve' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t\t{ 'delete' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to delete this comment?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentBoard thread={ thread } />\n\t\t\t\t\t\t{ 0 < thread?.reply?.length &&\n\t\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tparentThread={ thread }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t{ 'reply' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentAuthorInfo />\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tonAddReply(\n\t\t\t\t\t\t\t\t\t\t\t\t\tinputComment,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthread.id\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsubmitButtonText={ _x(\n\t\t\t\t\t\t\t\t\t\t\t\t'Reply',\n\t\t\t\t\t\t\t\t\t\t\t\t'Add reply comment'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders the header of a comment in the collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Object} props.thread - The comment thread object.\n * @param {Function} props.onResolve - The function to resolve the comment.\n * @param {Function} props.onEdit - The function to edit the comment.\n * @param {Function} props.onDelete - The function to delete the comment.\n * @param {Function} props.onReply - The function to reply to the comment.\n * @param {string} props.status - The status of the comment.\n * @return {React.ReactNode} The rendered comment header.\n */\nfunction CommentHeader( {\n\tthread,\n\tonResolve,\n\tonEdit,\n\tonDelete,\n\tonReply,\n\tstatus,\n} ) {\n\tconst actions = [\n\t\t{\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: onEdit,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: onDelete,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Reply', 'Reply on a comment' ),\n\t\t\tonClick: onReply,\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item.onClick );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t<CommentAuthorInfo\n\t\t\t\tavatar={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\tname={ thread?.author_name }\n\t\t\t\tdate={ thread?.date }\n\t\t\t/>\n\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t<HStack alignment=\"right\" justify=\"flex-end\" spacing=\"0\">\n\t\t\t\t\t\t{ 0 === thread?.parent && onResolve && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\tonClick={ onResolve }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t) }\n\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,2BAA2B,IAAIC,aAAa,EAC5CC,MAAM,EACNC,YAAY,EACZC,OAAO,QACD,uBAAuB;AAC9B,SAASC,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,QAAQ,kBAA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;UACrBiF,KAAK,EAAG/E,EAAE,CACT,kBAAkB,EAClB,uBACD,CAAG;UACHkD,SAAS,EAAC,oDAAoD;UAC9DiC,QAAQ,EAAGb;QAAa,CACxB,CAAC;MAAA,CACK,CACR,EACCxB,MAAM,KAAK,UAAU;MAAA;MACtB;MACAvC,IAAA,CAACb,OAAO;QAAC0F,IAAI,EAAGrF,EAAE,CAAE,UAAW,CAAG;QAAAsC,QAAA,eACjC9B,IAAA,CAACZ,IAAI;UAACsF,IAAI,EAAGrF;QAAO,CAAE;MAAC,CACf,CACT;IAAA,CACI,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useState","RawHTML","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","Tooltip","Icon","check","published","moreVertical","__","_x","sprintf","useSelect","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","showCommentBoard","setShowCommentBoard","blockCommentId","select","getBlockAttributes","getSelectedBlockClientId","_clientId","focusThread","setFocusThread","clearThreadFocus","children","Array","isArray","length","alignment","className","justify","spacing","map","thread","id","onClick","Thread","isFocused","CommentBoard","onResolve","onEdit","onDelete","status","reply","onSubmit","inputComment","onCancel","event","stopPropagation","submitButtonText","actionState","setActionState","showConfirmDialog","setShowConfirmDialog","handleConfirmDelete","handleConfirmResolve","handleCancel","actions","title","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","label","__next40pxDefaultSize","icon","showTooltip","controls","text","value","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTooltip,\n} from '@wordpress/components';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\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 Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @param {boolean} props.showCommentBoard - Whether to show the comment board.\n * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.\n * @return {React.ReactNode} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tblockCommentId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.blockCommentId\n\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tconst [ focusThread, setFocusThread ] = useState(\n\t\tshowCommentBoard && blockCommentId ? blockCommentId : null\n\t);\n\n\tconst clearThreadFocus = () => {\n\t\tsetFocusThread( null );\n\t\tsetShowCommentBoard( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__focus-thread':\n\t\t\t\t\t\t\t\t\tfocusThread && focusThread === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tonClick={ () => setFocusThread( thread.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thread\n\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\tonAddReply={ onAddReply }\n\t\t\t\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\t\t\t\tisFocused={ focusThread === thread.id }\n\t\t\t\t\t\t\tclearThreadFocus={ clearThreadFocus }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction Thread( {\n\tthread,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n\tisFocused,\n\tclearThreadFocus,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<CommentBoard\n\t\t\t\tthread={ thread }\n\t\t\t\tonResolve={ onCommentResolve }\n\t\t\t\tonEdit={ onEditComment }\n\t\t\t\tonDelete={ onCommentDelete }\n\t\t\t\tstatus={ thread.status }\n\t\t\t/>\n\t\t\t{ 0 < thread?.reply?.length && (\n\t\t\t\t<>\n\t\t\t\t\t{ ! isFocused && (\n\t\t\t\t\t\t<VStack className=\"editor-collab-sidebar-panel__show-more-reply\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t// translators: 1: number of replies.\n\t\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t\t'%s more replies..',\n\t\t\t\t\t\t\t\t\t'Show replies button'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tthread?.reply?.length\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isFocused &&\n\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ 'approved' !== thread.status && (\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tonEdit={ onEditComment }\n\t\t\t\t\t\t\t\t\t\tonDelete={ onCommentDelete }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ 'approved' === thread.status && (\n\t\t\t\t\t\t\t\t\t<CommentBoard thread={ reply } />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ 'approved' !== thread.status && isFocused && (\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\tspacing=\"2\"\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t\t\t<CommentAuthorInfo />\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\tonAddReply( inputComment, thread.id );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ ( event ) => {\n\t\t\t\t\t\t\t\tevent.stopPropagation(); // Prevent the parent onClick from being triggered\n\t\t\t\t\t\t\t\tclearThreadFocus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsubmitButtonText={ _x(\n\t\t\t\t\t\t\t\t'Reply',\n\t\t\t\t\t\t\t\t'Add reply comment'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonDelete( thread.id );\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonResolve( thread.id );\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst handleCancel = () => {\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst actions = [\n\t\tonEdit && {\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: () => {\n\t\t\t\tsetActionState( 'edit' );\n\t\t\t},\n\t\t},\n\t\tonDelete && {\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: () => {\n\t\t\t\tsetActionState( 'delete' );\n\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item?.onClick );\n\n\treturn (\n\t\t<>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<CommentAuthorInfo\n\t\t\t\t\tavatar={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\t\tname={ thread?.author_name }\n\t\t\t\t\tdate={ thread?.date }\n\t\t\t\t/>\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"right\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\tspacing=\"0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ 0 === thread?.parent && onResolve && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetActionState( 'resolve' );\n\t\t\t\t\t\t\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ 0 < moreActions.length && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t</HStack>\n\t\t\t<HStack\n\t\t\t\talignment=\"left\"\n\t\t\t\tspacing=\"3\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t>\n\t\t\t\t<VStack\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t>\n\t\t\t\t\t{ 'edit' === actionState && (\n\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\tonEdit( thread.id, value );\n\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ () => handleCancel() }\n\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\tsubmitButtonText={ _x( 'Update', 'verb' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ 'edit' !== actionState && (\n\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</HStack>\n\t\t\t{ 'resolve' === actionState && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\tonCancel={ handleCancel }\n\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t\t{ 'delete' === actionState && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\tonCancel={ handleCancel }\n\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t__( 'Are you sure you want to delete this comment?' )\n\t\t\t\t\t}\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,2BAA2B,IAAIC,aAAa,EAC5CC,MAAM,EACNC,YAAY,EACZC,OAAO,QACD,uBA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,gBAAgB,EAAGtD,EAAE,CAAE,QAAQ,EAAE,MAAO;QAAG,CAC3C,CACD,EACC,MAAM,KAAKuD,WAAW,iBACvB/C,IAAA,CAACvB,OAAO;UAAA4C,QAAA,EAAGS,MAAM,EAAE0C,OAAO,EAAEC;QAAG,CAAW,CAC1C;MAAA,CACM;IAAC,CACF,CAAC,EACP,SAAS,KAAK1B,WAAW,iBAC1B/C,IAAA,CAACjB,aAAa;MACb2F,MAAM,EAAGzB,iBAAmB;MAC5B0B,SAAS,EAAGvB,oBAAsB;MAClCT,QAAQ,EAAGU,YAAc;MACzBuB,iBAAiB,EAAC,KAAK;MACvBC,gBAAgB,EAAC,IAAI;MAAAxD,QAAA;MAGpB;MACA9B,EAAE,CACD,yDACD;IAAC,CAEY,CACf,EACC,QAAQ,KAAKwD,WAAW,iBACzB/C,IAAA,CAACjB,aAAa;MACb2F,MAAM,EAAGzB,iBAAmB;MAC5B0B,SAAS,EAAGxB,mBAAqB;MACjCR,QAAQ,EAAGU,YAAc;MACzBuB,iBAAiB,EAAC,KAAK;MACvBC,gBAAgB,EAAC,IAAI;MAAAxD,QAAA;MAGpB;MACA9B,EAAE,CAAE,+CAAgD;IAAC,CAExC,CACf;EAAA,CACA,CAAC;AAEL,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
/**
|
|
2
3
|
* WordPress dependencies
|
|
3
4
|
*/
|
|
@@ -174,8 +175,10 @@ function CollabSidebarContent({
|
|
|
174
175
|
onEditComment: onEditComment,
|
|
175
176
|
onAddReply: addNewComment,
|
|
176
177
|
onCommentDelete: onCommentDelete,
|
|
177
|
-
onCommentResolve: onCommentResolve
|
|
178
|
-
|
|
178
|
+
onCommentResolve: onCommentResolve,
|
|
179
|
+
showCommentBoard: showCommentBoard,
|
|
180
|
+
setShowCommentBoard: setShowCommentBoard
|
|
181
|
+
}, getSelectedBlockClientId())]
|
|
179
182
|
});
|
|
180
183
|
}
|
|
181
184
|
|
|
@@ -268,11 +271,15 @@ export default function CollabSidebar() {
|
|
|
268
271
|
sortedThreads: []
|
|
269
272
|
};
|
|
270
273
|
}
|
|
274
|
+
const updatedResult = result.map(item => ({
|
|
275
|
+
...item,
|
|
276
|
+
reply: [...item.reply].reverse()
|
|
277
|
+
}));
|
|
271
278
|
const blockCommentIds = getCommentIdsFromBlocks(blocks);
|
|
272
|
-
const threadIdMap = new Map(
|
|
279
|
+
const threadIdMap = new Map(updatedResult.map(thread => [thread.id, thread]));
|
|
273
280
|
const sortedComments = blockCommentIds.map(id => threadIdMap.get(id)).filter(thread => thread !== undefined);
|
|
274
281
|
return {
|
|
275
|
-
resultComments:
|
|
282
|
+
resultComments: updatedResult,
|
|
276
283
|
sortedThreads: sortedComments
|
|
277
284
|
};
|
|
278
285
|
}, [threads, blocks]);
|