@wordpress/editor 14.10.0 → 14.12.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 -10
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +119 -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 +274 -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 +148 -40
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +1 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +17 -10
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-tools/index.js +7 -7
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +4 -4
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- 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 +25 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +12 -11
- 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/more-menu/index.js +9 -7
- package/build/components/more-menu/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-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 +1 -2
- 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-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +11 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +0 -3
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/index.js +0 -3
- package/build/components/post-transform-panel/index.js.map +1 -1
- package/build/components/post-url/index.js +1 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +3 -3
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +26 -22
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +23 -8
- 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 +11 -10
- package/build/components/provider/use-block-editor-settings.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/sidebar/post-summary.js +2 -2
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/start-page-options/index.js +0 -3
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +0 -3
- package/build/components/start-template-options/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/index.js +30 -29
- package/build/components/visual-editor/index.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 +2 -2
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/store/actions.js +68 -18
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +0 -2
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +0 -4
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +2 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +5 -4
- package/build/store/selectors.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/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +113 -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 +266 -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/commands/index.js +151 -44
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +19 -12
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +8 -8
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-interface/index.js +4 -4
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.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 +25 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +12 -11
- 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/more-menu/index.js +9 -7
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -5
- package/build-module/components/page-attributes/parent.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 +5 -5
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +4 -4
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +8 -36
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +1 -2
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +26 -7
- package/build-module/components/post-featured-image/index.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-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +14 -4
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +0 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/index.js +0 -3
- package/build-module/components/post-transform-panel/index.js.map +1 -1
- package/build-module/components/post-url/index.js +1 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +3 -3
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +26 -22
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +24 -9
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +10 -12
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +12 -11
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/header.js +2 -1
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +4 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +2 -2
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/start-page-options/index.js +0 -3
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +0 -3
- package/build-module/components/start-template-options/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/index.js +31 -30
- package/build-module/components/visual-editor/index.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 +3 -3
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/store/actions.js +64 -16
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +0 -4
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +3 -3
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +5 -4
- package/build-module/store/selectors.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 +118 -60
- package/build-style/style.css +118 -60
- 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/create-template-part-modal/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/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts +1 -2
- 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/more-menu/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-template/hooks.d.ts +2 -2
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
- package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.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/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/start-template-options/index.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/dataviews/store/reducer.d.ts +5 -2
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts +2 -2
- package/build-types/store/actions.d.ts +9 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +0 -2
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/index.d.ts +9 -11
- package/build-types/store/index.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +24 -4
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +3 -3
- 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 -37
- package/src/bindings/post-meta.js +1 -0
- package/src/components/collab-sidebar/add-comment.js +121 -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 +298 -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 +390 -268
- package/src/components/create-template-part-modal/index.js +1 -0
- package/src/components/document-bar/index.js +25 -8
- package/src/components/document-bar/style.scss +13 -4
- package/src/components/document-tools/index.js +8 -8
- package/src/components/editor-interface/index.js +4 -4
- 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 +32 -6
- package/src/components/header/index.js +20 -10
- package/src/components/inserter-sidebar/index.js +3 -6
- package/src/components/more-menu/index.js +12 -7
- package/src/components/page-attributes/parent.js +6 -4
- package/src/components/plugin-more-menu-item/index.js +12 -11
- package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -1
- 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-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 +2 -2
- package/src/components/post-template/swap-template-button.js +0 -3
- package/src/components/post-transform-panel/index.js +0 -3
- package/src/components/post-url/index.js +1 -1
- package/src/components/post-url/panel.js +4 -2
- package/src/components/preferences-modal/index.js +26 -19
- package/src/components/preferences-modal/test/index.js +1 -1
- package/src/components/preview-dropdown/index.js +45 -18
- package/src/components/provider/index.js +31 -24
- package/src/components/provider/use-block-editor-settings.js +11 -10
- package/src/components/sidebar/header.js +3 -2
- package/src/components/sidebar/index.js +5 -3
- package/src/components/sidebar/post-summary.js +1 -1
- package/src/components/sidebar/style.scss +1 -3
- package/src/components/start-page-options/index.js +0 -3
- package/src/components/start-template-options/index.js +0 -3
- package/src/components/time-to-read/index.js +3 -3
- package/src/components/visual-editor/index.js +39 -42
- package/src/components/visual-editor/style.scss +11 -0
- 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/store/actions.js +113 -34
- package/src/store/constants.ts +0 -2
- package/src/store/index.js +0 -4
- package/src/store/private-actions.js +3 -3
- package/src/store/selectors.js +5 -4
- 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,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, _x } from '@wordpress/i18n';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { useState, useEffect } from '@wordpress/element';
|
|
7
|
+
import { __experimentalHStack as HStack, __experimentalVStack as VStack, Button, TextControl } from '@wordpress/components';
|
|
8
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { sanitizeCommentString } from './utils';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} props - The component props.
|
|
20
|
+
* @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.
|
|
21
|
+
* @param {boolean} props.showCommentBoard - The function to edit the comment.
|
|
22
|
+
* @param {Function} props.setShowCommentBoard - The function to delete the comment.
|
|
23
|
+
* @return {JSX.Element} The rendered comment input UI.
|
|
24
|
+
*/
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
export function AddComment({
|
|
27
|
+
onSubmit,
|
|
28
|
+
showCommentBoard,
|
|
29
|
+
setShowCommentBoard
|
|
30
|
+
}) {
|
|
31
|
+
var _currentUser$name;
|
|
32
|
+
// State to manage the comment thread.
|
|
33
|
+
const [inputComment, setInputComment] = useState('');
|
|
34
|
+
const {
|
|
35
|
+
defaultAvatar,
|
|
36
|
+
clientId,
|
|
37
|
+
blockCommentId,
|
|
38
|
+
currentUser
|
|
39
|
+
} = useSelect(select => {
|
|
40
|
+
const {
|
|
41
|
+
getSettings,
|
|
42
|
+
getSelectedBlock
|
|
43
|
+
} = select(blockEditorStore);
|
|
44
|
+
const {
|
|
45
|
+
__experimentalDiscussionSettings
|
|
46
|
+
} = getSettings();
|
|
47
|
+
const selectedBlock = getSelectedBlock();
|
|
48
|
+
const userData = select(coreStore).getCurrentUser();
|
|
49
|
+
return {
|
|
50
|
+
defaultAvatar: __experimentalDiscussionSettings?.avatarURL,
|
|
51
|
+
clientId: selectedBlock?.clientId,
|
|
52
|
+
blockCommentId: selectedBlock?.attributes?.blockCommentId,
|
|
53
|
+
currentUser: userData
|
|
54
|
+
};
|
|
55
|
+
}, []);
|
|
56
|
+
const userAvatar = currentUser && currentUser.avatar_urls && currentUser.avatar_urls[48] ? currentUser.avatar_urls[48] : defaultAvatar;
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
setInputComment('');
|
|
59
|
+
}, [clientId]);
|
|
60
|
+
const handleCancel = () => {
|
|
61
|
+
setShowCommentBoard(false);
|
|
62
|
+
setInputComment('');
|
|
63
|
+
};
|
|
64
|
+
if (!showCommentBoard || !clientId || undefined !== blockCommentId) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
68
|
+
spacing: "3",
|
|
69
|
+
className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread",
|
|
70
|
+
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
71
|
+
alignment: "left",
|
|
72
|
+
spacing: "3",
|
|
73
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
74
|
+
src: userAvatar
|
|
75
|
+
// translators: alt text for user avatar image
|
|
76
|
+
,
|
|
77
|
+
alt: __('User Avatar'),
|
|
78
|
+
className: "editor-collab-sidebar-panel__user-avatar",
|
|
79
|
+
width: 32,
|
|
80
|
+
height: 32
|
|
81
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
82
|
+
className: "editor-collab-sidebar-panel__user-name",
|
|
83
|
+
children: (_currentUser$name = currentUser?.name) !== null && _currentUser$name !== void 0 ? _currentUser$name : ''
|
|
84
|
+
})]
|
|
85
|
+
}), /*#__PURE__*/_jsx(TextControl, {
|
|
86
|
+
__next40pxDefaultSize: true,
|
|
87
|
+
__nextHasNoMarginBottom: true,
|
|
88
|
+
value: inputComment,
|
|
89
|
+
onChange: setInputComment,
|
|
90
|
+
placeholder: _x('Comment', 'noun')
|
|
91
|
+
}), /*#__PURE__*/_jsxs(HStack, {
|
|
92
|
+
alignment: "right",
|
|
93
|
+
spacing: "3",
|
|
94
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
95
|
+
__next40pxDefaultSize: true,
|
|
96
|
+
variant: "tertiary",
|
|
97
|
+
text: _x('Cancel', 'Cancel comment button'),
|
|
98
|
+
onClick: handleCancel
|
|
99
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
100
|
+
__next40pxDefaultSize: true,
|
|
101
|
+
accessibleWhenDisabled: true,
|
|
102
|
+
variant: "primary",
|
|
103
|
+
text: _x('Comment', 'Add comment button'),
|
|
104
|
+
disabled: 0 === sanitizeCommentString(inputComment).length,
|
|
105
|
+
onClick: () => {
|
|
106
|
+
onSubmit(inputComment);
|
|
107
|
+
setInputComment('');
|
|
108
|
+
}
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=add-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","_x","useSelect","useState","useEffect","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","store","blockEditorStore","coreStore","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","_currentUser$name","inputComment","setInputComment","defaultAvatar","clientId","blockCommentId","currentUser","select","getSettings","getSelectedBlock","__experimentalDiscussionSettings","selectedBlock","userData","getCurrentUser","avatarURL","attributes","userAvatar","avatar_urls","handleCancel","undefined","spacing","className","children","alignment","src","alt","width","height","name","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","placeholder","variant","text","onClick","accessibleWhenDisabled","disabled","length"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {JSX.Element} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\t// State to manage the comment thread.\n\tconst [ inputComment, setInputComment ] = useState( '' );\n\n\tconst { defaultAvatar, clientId, blockCommentId, currentUser } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, getSelectedBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\t\tconst selectedBlock = getSelectedBlock();\n\t\t\tconst userData = select( coreStore ).getCurrentUser();\n\t\t\treturn {\n\t\t\t\tdefaultAvatar: __experimentalDiscussionSettings?.avatarURL,\n\t\t\t\tclientId: selectedBlock?.clientId,\n\t\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t\t\tcurrentUser: userData,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst userAvatar =\n\t\tcurrentUser && currentUser.avatar_urls && currentUser.avatar_urls[ 48 ]\n\t\t\t? currentUser.avatar_urls[ 48 ]\n\t\t\t: defaultAvatar;\n\n\tuseEffect( () => {\n\t\tsetInputComment( '' );\n\t}, [ clientId ] );\n\n\tconst handleCancel = () => {\n\t\tsetShowCommentBoard( false );\n\t\tsetInputComment( '' );\n\t};\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread\"\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<img\n\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\t\talt={ __( 'User Avatar' ) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t\twidth={ 32 }\n\t\t\t\t\theight={ 32 }\n\t\t\t\t/>\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ currentUser?.name ?? '' }\n\t\t\t\t</span>\n\t\t\t</HStack>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t\tplaceholder={ _x( 'Comment', 'noun' ) }\n\t\t\t/>\n\t\t\t<HStack alignment=\"right\" spacing=\"3\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t\tonClick={ handleCancel }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\ttext={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t\t\tsetInputComment( '' );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,WAAW,QACL,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,qBAAqB,QAAQ,SAAS;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASA,OAAO,SAASC,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EAAA,IAAAC,iBAAA;EACH;EACA,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGtB,QAAQ,CAAE,EAAG,CAAC;EAExD,MAAM;IAAEuB,aAAa;IAAEC,QAAQ;IAAEC,c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
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const {
|
|
15
|
+
__unstableCommentIconToolbarFill
|
|
16
|
+
} = unlock(blockEditorPrivateApis);
|
|
17
|
+
const AddCommentToolbarButton = ({
|
|
18
|
+
onClick
|
|
19
|
+
}) => {
|
|
20
|
+
return /*#__PURE__*/_jsx(__unstableCommentIconToolbarFill, {
|
|
21
|
+
children: /*#__PURE__*/_jsx(ToolbarButton, {
|
|
22
|
+
accessibleWhenDisabled: true,
|
|
23
|
+
icon: commentIcon,
|
|
24
|
+
label: _x('Comment', 'View comment'),
|
|
25
|
+
onClick: onClick
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export default AddCommentToolbarButton;
|
|
30
|
+
//# sourceMappingURL=comment-button-toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ToolbarButton","_x","comment","commentIcon","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","__unstableCommentIconToolbarFill","AddCommentToolbarButton","onClick","children","accessibleWhenDisabled","icon","label"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { __unstableCommentIconToolbarFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentToolbarButton = ( { onClick } ) => {\n\treturn (\n\t\t<__unstableCommentIconToolbarFill>\n\t\t\t<ToolbarButton\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\ticon={ commentIcon }\n\t\t\t\tlabel={ _x( 'Comment', 'View comment' ) }\n\t\t\t\tonClick={ onClick }\n\t\t\t/>\n\t\t</__unstableCommentIconToolbarFill>\n\t);\n};\n\nexport default AddCommentToolbarButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AACzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAiC,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAE7E,MAAMK,uBAAuB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAClD,oBACCH,IAAA,CAACC,gCAAgC;IAAAG,QAAA,eAChCJ,IAAA,CAACR,aAAa;MACba,sBAAsB;MACtBC,IAAI,EAAGX,WAAa;MACpBY,KAAK,EAAGd,EAAE,CAAE,SAAS,EAAE,cAAe,CAAG;MACzCU,OAAO,EAAGA;IAAS,CACnB;EAAC,CAC+B,CAAC;AAErC,CAAC;AAED,eAAeD,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const {
|
|
15
|
+
__unstableCommentIconFill
|
|
16
|
+
} = unlock(blockEditorPrivateApis);
|
|
17
|
+
const AddCommentButton = ({
|
|
18
|
+
onClick
|
|
19
|
+
}) => {
|
|
20
|
+
return /*#__PURE__*/_jsx(__unstableCommentIconFill, {
|
|
21
|
+
children: /*#__PURE__*/_jsx(MenuItem, {
|
|
22
|
+
icon: commentIcon,
|
|
23
|
+
onClick: onClick,
|
|
24
|
+
"aria-haspopup": "dialog",
|
|
25
|
+
children: _x('Comment', 'Add comment button')
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export default AddCommentButton;
|
|
30
|
+
//# sourceMappingURL=comment-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MenuItem","_x","comment","commentIcon","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","__unstableCommentIconFill","AddCommentButton","onClick","children","icon"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { __unstableCommentIconFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentButton = ( { onClick } ) => {\n\treturn (\n\t\t<__unstableCommentIconFill>\n\t\t\t<MenuItem\n\t\t\t\ticon={ commentIcon }\n\t\t\t\tonClick={ onClick }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ _x( 'Comment', 'Add comment button' ) }\n\t\t\t</MenuItem>\n\t\t</__unstableCommentIconFill>\n\t);\n};\n\nexport default AddCommentButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AAEzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAA0B,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAEtE,MAAMK,gBAAgB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAC3C,oBACCH,IAAA,CAACC,yBAAyB;IAAAG,QAAA,eACzBJ,IAAA,CAACR,QAAQ;MACRa,IAAI,EAAGV,WAAa;MACpBQ,OAAO,EAAGA,OAAS;MACnB,iBAAc,QAAQ;MAAAC,QAAA,EAEpBX,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAC,CAC9B;EAAC,CACe,CAAC;AAE9B,CAAC;AAED,eAAeS,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,314 @@
|
|
|
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 { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalConfirmDialog as ConfirmDialog, Button, DropdownMenu, TextareaControl, Tooltip } from '@wordpress/components';
|
|
11
|
+
import { dateI18n, format, getSettings as getDateSettings } from '@wordpress/date';
|
|
12
|
+
import { Icon, check, published, moreVertical } from '@wordpress/icons';
|
|
13
|
+
import { __, _x } from '@wordpress/i18n';
|
|
14
|
+
import { useSelect } from '@wordpress/data';
|
|
15
|
+
import { useEntityProp } from '@wordpress/core-data';
|
|
16
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import { sanitizeCommentString } from './utils';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders the Comments component.
|
|
25
|
+
*
|
|
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
|
+
* @return {JSX.Element} The rendered Comments component.
|
|
33
|
+
*/
|
|
34
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
|
+
export function Comments({
|
|
36
|
+
threads,
|
|
37
|
+
onEditComment,
|
|
38
|
+
onAddReply,
|
|
39
|
+
onCommentDelete,
|
|
40
|
+
onCommentResolve
|
|
41
|
+
}) {
|
|
42
|
+
const [actionState, setActionState] = useState(false);
|
|
43
|
+
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = useState(false);
|
|
44
|
+
const handleConfirmDelete = () => {
|
|
45
|
+
onCommentDelete(actionState.id);
|
|
46
|
+
setActionState(false);
|
|
47
|
+
setIsConfirmDialogOpen(false);
|
|
48
|
+
};
|
|
49
|
+
const handleConfirmResolve = () => {
|
|
50
|
+
onCommentResolve(actionState.id);
|
|
51
|
+
setActionState(false);
|
|
52
|
+
setIsConfirmDialogOpen(false);
|
|
53
|
+
};
|
|
54
|
+
const handleCancelDelete = () => {
|
|
55
|
+
setActionState(false);
|
|
56
|
+
setIsConfirmDialogOpen(false);
|
|
57
|
+
};
|
|
58
|
+
const blockCommentId = useSelect(select => {
|
|
59
|
+
var _select$getBlock$attr;
|
|
60
|
+
const clientID = select(blockEditorStore).getSelectedBlockClientId();
|
|
61
|
+
return (_select$getBlock$attr = select(blockEditorStore).getBlock(clientID)?.attributes?.blockCommentId) !== null && _select$getBlock$attr !== void 0 ? _select$getBlock$attr : false;
|
|
62
|
+
}, []);
|
|
63
|
+
const CommentBoard = ({
|
|
64
|
+
thread,
|
|
65
|
+
parentThread
|
|
66
|
+
}) => {
|
|
67
|
+
var _parentThread$status;
|
|
68
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
69
|
+
children: [/*#__PURE__*/_jsx(CommentHeader, {
|
|
70
|
+
thread: thread,
|
|
71
|
+
onResolve: () => {
|
|
72
|
+
var _parentThread$id;
|
|
73
|
+
setActionState({
|
|
74
|
+
action: 'resolve',
|
|
75
|
+
id: (_parentThread$id = parentThread?.id) !== null && _parentThread$id !== void 0 ? _parentThread$id : thread.id
|
|
76
|
+
});
|
|
77
|
+
setIsConfirmDialogOpen(true);
|
|
78
|
+
},
|
|
79
|
+
onEdit: () => setActionState({
|
|
80
|
+
action: 'edit',
|
|
81
|
+
id: thread.id
|
|
82
|
+
}),
|
|
83
|
+
onDelete: () => {
|
|
84
|
+
setActionState({
|
|
85
|
+
action: 'delete',
|
|
86
|
+
id: thread.id
|
|
87
|
+
});
|
|
88
|
+
setIsConfirmDialogOpen(true);
|
|
89
|
+
},
|
|
90
|
+
onReply: !parentThread ? () => setActionState({
|
|
91
|
+
action: 'reply',
|
|
92
|
+
id: thread.id
|
|
93
|
+
}) : undefined,
|
|
94
|
+
status: (_parentThread$status = parentThread?.status) !== null && _parentThread$status !== void 0 ? _parentThread$status : thread.status
|
|
95
|
+
}), /*#__PURE__*/_jsx(HStack, {
|
|
96
|
+
alignment: "left",
|
|
97
|
+
spacing: "3",
|
|
98
|
+
justify: "flex-start",
|
|
99
|
+
className: "editor-collab-sidebar-panel__user-comment",
|
|
100
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
101
|
+
spacing: "3",
|
|
102
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
103
|
+
children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(CommentForm, {
|
|
104
|
+
onSubmit: value => {
|
|
105
|
+
onEditComment(thread.id, value);
|
|
106
|
+
setActionState(false);
|
|
107
|
+
},
|
|
108
|
+
onCancel: () => setActionState(false),
|
|
109
|
+
thread: thread
|
|
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
|
+
});
|
|
134
|
+
};
|
|
135
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
136
|
+
children: [
|
|
137
|
+
// If there are no comments, show a message indicating no comments are available.
|
|
138
|
+
(!Array.isArray(threads) || threads.length === 0) && /*#__PURE__*/_jsx(VStack, {
|
|
139
|
+
alignment: "left",
|
|
140
|
+
className: "editor-collab-sidebar-panel__thread",
|
|
141
|
+
justify: "flex-start",
|
|
142
|
+
spacing: "3",
|
|
143
|
+
children:
|
|
144
|
+
// translators: message displayed when there are no comments available
|
|
145
|
+
__('No comments available')
|
|
146
|
+
}), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/_jsxs(VStack, {
|
|
147
|
+
className: clsx('editor-collab-sidebar-panel__thread', {
|
|
148
|
+
'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id
|
|
149
|
+
}),
|
|
150
|
+
id: thread.id,
|
|
151
|
+
spacing: "3",
|
|
152
|
+
children: [/*#__PURE__*/_jsx(CommentBoard, {
|
|
153
|
+
thread: thread
|
|
154
|
+
}), 'reply' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(HStack, {
|
|
155
|
+
alignment: "left",
|
|
156
|
+
spacing: "3",
|
|
157
|
+
justify: "flex-start",
|
|
158
|
+
className: "editor-collab-sidebar-panel__user-comment",
|
|
159
|
+
children: /*#__PURE__*/_jsx(VStack, {
|
|
160
|
+
spacing: "3",
|
|
161
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
162
|
+
children: /*#__PURE__*/_jsx(CommentForm, {
|
|
163
|
+
onSubmit: inputComment => {
|
|
164
|
+
onAddReply(inputComment, thread.id);
|
|
165
|
+
setActionState(false);
|
|
166
|
+
},
|
|
167
|
+
onCancel: () => setActionState(false)
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
}), 0 < thread?.reply?.length && thread.reply.map(reply => /*#__PURE__*/_jsx(VStack, {
|
|
171
|
+
className: "editor-collab-sidebar-panel__child-thread",
|
|
172
|
+
id: reply.id,
|
|
173
|
+
spacing: "2",
|
|
174
|
+
children: /*#__PURE__*/_jsx(CommentBoard, {
|
|
175
|
+
thread: reply,
|
|
176
|
+
parentThread: thread
|
|
177
|
+
})
|
|
178
|
+
}, reply.id))]
|
|
179
|
+
}, thread.id))]
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* EditComment component.
|
|
185
|
+
*
|
|
186
|
+
* @param {Object} props - The component props.
|
|
187
|
+
* @param {Function} props.onSubmit - The function to call when updating the comment.
|
|
188
|
+
* @param {Function} props.onCancel - The function to call when canceling the comment update.
|
|
189
|
+
* @param {Object} props.thread - The comment thread object.
|
|
190
|
+
* @return {JSX.Element} The CommentForm component.
|
|
191
|
+
*/
|
|
192
|
+
function CommentForm({
|
|
193
|
+
onSubmit,
|
|
194
|
+
onCancel,
|
|
195
|
+
thread
|
|
196
|
+
}) {
|
|
197
|
+
var _thread$content$raw;
|
|
198
|
+
const [inputComment, setInputComment] = useState((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : '');
|
|
199
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
200
|
+
children: [/*#__PURE__*/_jsx(TextareaControl, {
|
|
201
|
+
__nextHasNoMarginBottom: true,
|
|
202
|
+
value: inputComment !== null && inputComment !== void 0 ? inputComment : '',
|
|
203
|
+
onChange: setInputComment
|
|
204
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
205
|
+
alignment: "left",
|
|
206
|
+
spacing: "3",
|
|
207
|
+
justify: "flex-start",
|
|
208
|
+
children: /*#__PURE__*/_jsxs(HStack, {
|
|
209
|
+
alignment: "left",
|
|
210
|
+
spacing: "3",
|
|
211
|
+
justify: "flex-start",
|
|
212
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
213
|
+
__next40pxDefaultSize: true,
|
|
214
|
+
accessibleWhenDisabled: true,
|
|
215
|
+
variant: "primary",
|
|
216
|
+
onClick: () => onSubmit(inputComment),
|
|
217
|
+
disabled: 0 === sanitizeCommentString(inputComment).length,
|
|
218
|
+
children: thread ? _x('Update', 'verb') : _x('Reply', 'Add reply comment')
|
|
219
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
220
|
+
__next40pxDefaultSize: true,
|
|
221
|
+
onClick: onCancel,
|
|
222
|
+
children: _x('Cancel', 'Cancel comment edit')
|
|
223
|
+
})]
|
|
224
|
+
})
|
|
225
|
+
})]
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Renders the header of a comment in the collaboration sidebar.
|
|
231
|
+
*
|
|
232
|
+
* @param {Object} props - The component props.
|
|
233
|
+
* @param {Object} props.thread - The comment thread object.
|
|
234
|
+
* @param {Function} props.onResolve - The function to resolve the comment.
|
|
235
|
+
* @param {Function} props.onEdit - The function to edit the comment.
|
|
236
|
+
* @param {Function} props.onDelete - The function to delete the comment.
|
|
237
|
+
* @param {Function} props.onReply - The function to reply to the comment.
|
|
238
|
+
* @param {string} props.status - The status of the comment.
|
|
239
|
+
* @return {JSX.Element} The rendered comment header.
|
|
240
|
+
*/
|
|
241
|
+
function CommentHeader({
|
|
242
|
+
thread,
|
|
243
|
+
onResolve,
|
|
244
|
+
onEdit,
|
|
245
|
+
onDelete,
|
|
246
|
+
onReply,
|
|
247
|
+
status
|
|
248
|
+
}) {
|
|
249
|
+
const dateSettings = getDateSettings();
|
|
250
|
+
const [dateTimeFormat = dateSettings.formats.time] = useEntityProp('root', 'site', 'time_format');
|
|
251
|
+
const actions = [{
|
|
252
|
+
title: _x('Edit', 'Edit comment'),
|
|
253
|
+
onClick: onEdit
|
|
254
|
+
}, {
|
|
255
|
+
title: _x('Delete', 'Delete comment'),
|
|
256
|
+
onClick: onDelete
|
|
257
|
+
}, {
|
|
258
|
+
title: _x('Reply', 'Reply on a comment'),
|
|
259
|
+
onClick: onReply
|
|
260
|
+
}];
|
|
261
|
+
const moreActions = actions.filter(item => item.onClick);
|
|
262
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
263
|
+
alignment: "left",
|
|
264
|
+
spacing: "3",
|
|
265
|
+
justify: "flex-start",
|
|
266
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
267
|
+
src: thread?.author_avatar_urls?.[48],
|
|
268
|
+
className: "editor-collab-sidebar-panel__user-avatar"
|
|
269
|
+
// translators: alt text for user avatar image
|
|
270
|
+
,
|
|
271
|
+
alt: __('User avatar'),
|
|
272
|
+
width: 32,
|
|
273
|
+
height: 32
|
|
274
|
+
}), /*#__PURE__*/_jsxs(VStack, {
|
|
275
|
+
spacing: "0",
|
|
276
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
277
|
+
className: "editor-collab-sidebar-panel__user-name",
|
|
278
|
+
children: thread.author_name
|
|
279
|
+
}), /*#__PURE__*/_jsx("time", {
|
|
280
|
+
dateTime: format('h:i A', thread.date),
|
|
281
|
+
className: "editor-collab-sidebar-panel__user-time",
|
|
282
|
+
children: dateI18n(dateTimeFormat, thread.date)
|
|
283
|
+
})]
|
|
284
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
285
|
+
className: "editor-collab-sidebar-panel__comment-status",
|
|
286
|
+
children: [status !== 'approved' && /*#__PURE__*/_jsxs(HStack, {
|
|
287
|
+
alignment: "right",
|
|
288
|
+
justify: "flex-end",
|
|
289
|
+
spacing: "0",
|
|
290
|
+
children: [0 === thread.parent && onResolve && /*#__PURE__*/_jsx(Button, {
|
|
291
|
+
label: _x('Resolve', 'Mark comment as resolved'),
|
|
292
|
+
__next40pxDefaultSize: true,
|
|
293
|
+
icon: published,
|
|
294
|
+
onClick: onResolve,
|
|
295
|
+
showTooltip: true
|
|
296
|
+
}), /*#__PURE__*/_jsx(DropdownMenu, {
|
|
297
|
+
icon: moreVertical,
|
|
298
|
+
label: _x('Select an action', 'Select comment action'),
|
|
299
|
+
className: "editor-collab-sidebar-panel__comment-dropdown-menu",
|
|
300
|
+
controls: moreActions
|
|
301
|
+
})]
|
|
302
|
+
}), status === 'approved' &&
|
|
303
|
+
/*#__PURE__*/
|
|
304
|
+
// translators: tooltip for resolved comment
|
|
305
|
+
_jsx(Tooltip, {
|
|
306
|
+
text: __('Resolved'),
|
|
307
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
308
|
+
icon: check
|
|
309
|
+
})
|
|
310
|
+
})]
|
|
311
|
+
})]
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clsx","useState","RawHTML","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","TextareaControl","Tooltip","dateI18n","format","getSettings","getDateSettings","Icon","check","published","moreVertical","__","_x","useSelect","useEntityProp","store","blockEditorStore","sanitizeCommentString","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","CommentForm","onSubmit","value","onCancel","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText","Array","isArray","length","map","inputComment","reply","_thread$content$raw","setInputComment","__nextHasNoMarginBottom","onChange","__next40pxDefaultSize","accessibleWhenDisabled","variant","onClick","disabled","dateSettings","dateTimeFormat","formats","time","actions","title","moreActions","filter","item","src","author_avatar_urls","alt","width","height","author_name","dateTime","date","parent","label","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\tTextareaControl,\n\tTooltip,\n} from '@wordpress/components';\nimport {\n\tdateI18n,\n\tformat,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\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 {JSX.Element} 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/>\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{ 'reply' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\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\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/>\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t) }\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</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @return {JSX.Element} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t/>\n\t\t\t<VStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => onSubmit( inputComment ) }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ thread\n\t\t\t\t\t\t\t? _x( 'Update', 'verb' )\n\t\t\t\t\t\t\t: _x( 'Reply', 'Add reply comment' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button __next40pxDefaultSize onClick={ onCancel }>\n\t\t\t\t\t\t{ _x( 'Cancel', 'Cancel comment edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\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 {JSX.Element} The rendered comment header.\n */\nfunction CommentHeader( {\n\tthread,\n\tonResolve,\n\tonEdit,\n\tonDelete,\n\tonReply,\n\tstatus,\n} ) {\n\tconst dateSettings = getDateSettings();\n\tconst [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst 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<img\n\t\t\t\tsrc={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\talt={ __( 'User avatar' ) }\n\t\t\t\twidth={ 32 }\n\t\t\t\theight={ 32 }\n\t\t\t/>\n\t\t\t<VStack spacing=\"0\">\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ thread.author_name }\n\t\t\t\t</span>\n\t\t\t\t<time\n\t\t\t\t\tdateTime={ format( 'h:i A', thread.date ) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t>\n\t\t\t\t\t{ dateI18n( dateTimeFormat, thread.date ) }\n\t\t\t\t</time>\n\t\t\t</VStack>\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,eAAe,EACfC,OAAO,QACD,uBAAuB;AAC9B,SACCC,QAAQ,EACRC,MAAM,EACNC,WAAW,IAAIC,eAAe,QACxB,iBAAiB;AACxB,SAASC,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AACvE,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C3B,MAAM;QAACiE,SAAS,EAAC,OAAO;QAACE,OAAO,EAAC,UAAU;QAACD,OAAO,EAAC,GAAG;QAAAX,QAAA,GACrD,CAAC,KAAKH,MAAM,CAAC2D,MAAM,IAAItD,SAAS,iBACjChC,IAAA,CAACpB,MAAM;UACN2G,KAAK,EAAG9F,EAAE,CACT,SAAS,EACT,0BACD,CAAG;UACHuE,qBAAqB;UACrBwB,IAAI,EAAGlG,SAAW;UAClB6E,OAAO,EAAGnC,SAAW;UACrByD,WAAW;QAAA,CACX,CACD,eACDzF,IAAA,CAACnB,YAAY;UACZ2G,IAAI,EAAGjG,YAAc;UACrBgG,KAAK,EAAG9F,EAAE,CACT,kBAAkB,EAClB,uBACD,CAAG;UACHkD,SAAS,EAAC,oDAAoD;UAC9D+C,QAAQ,EAAGf;QAAa,CACxB,CAAC;MAAA,CACK,CACR,EACCpC,MAAM,KAAK,UAAU;MAAA;MACtB;MACAvC,IAAA,CAACjB,OAAO;QAAC4G,IAAI,EAAGnG,EAAE,CAAE,UAAW,CAAG;QAAAsC,QAAA,eACjC9B,IAAA,CAACZ,IAAI;UAACoG,IAAI,EAAGnG;QAAO,CAAE;MAAC,CACf,CACT;IAAA,CACI,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["collabSidebarName"],"sources":["@wordpress/editor/src/components/collab-sidebar/constants.js"],"sourcesContent":["export const collabSidebarName = 'edit-post/collab-sidebar';\n"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB,GAAG,0BAA0B","ignoreList":[]}
|