@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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 14.12.0 (2024-11-16)
|
|
6
|
+
|
|
7
|
+
## 14.11.0 (2024-10-30)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- `Post Featured Image`: Fix `Set featured image` button's `box-shadow` transition to prevent border from flashing when focused.
|
|
12
|
+
|
|
5
13
|
## 14.10.0 (2024-10-16)
|
|
6
14
|
|
|
7
15
|
## 14.9.0 (2024-10-03)
|
package/README.md
CHANGED
|
@@ -878,9 +878,9 @@ function onPreviewClick() {
|
|
|
878
878
|
}
|
|
879
879
|
|
|
880
880
|
const ExternalPreviewMenuItem = () => (
|
|
881
|
-
<
|
|
881
|
+
<PluginPreviewMenuItem icon={ external } onClick={ onPreviewClick }>
|
|
882
882
|
{ __( 'Preview in new tab' ) }
|
|
883
|
-
</
|
|
883
|
+
</PluginPreviewMenuItem>
|
|
884
884
|
);
|
|
885
885
|
registerPlugin( 'external-preview-menu-item', {
|
|
886
886
|
render: ExternalPreviewMenuItem,
|
|
@@ -1631,10 +1631,6 @@ _Related_
|
|
|
1631
1631
|
|
|
1632
1632
|
- <https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore>
|
|
1633
1633
|
|
|
1634
|
-
_Type_
|
|
1635
|
-
|
|
1636
|
-
- `Object`
|
|
1637
|
-
|
|
1638
1634
|
### storeConfig
|
|
1639
1635
|
|
|
1640
1636
|
Post editor data store configuration.
|
|
@@ -1643,10 +1639,6 @@ _Related_
|
|
|
1643
1639
|
|
|
1644
1640
|
- <https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore>
|
|
1645
1641
|
|
|
1646
|
-
_Type_
|
|
1647
|
-
|
|
1648
|
-
- `Object`
|
|
1649
|
-
|
|
1650
1642
|
### TableOfContents
|
|
1651
1643
|
|
|
1652
1644
|
Renders a table of contents component.
|
|
@@ -63,7 +63,8 @@ function getPostMetaFields(select, context) {
|
|
|
63
63
|
value: // When using the entity value, an empty string IS a valid value.
|
|
64
64
|
(_entityMetaValues$key = entityMetaValues?.[key]) !== null && _entityMetaValues$key !== void 0 ? _entityMetaValues$key :
|
|
65
65
|
// When using the default, an empty string IS NOT a valid value.
|
|
66
|
-
props.default || undefined
|
|
66
|
+
props.default || undefined,
|
|
67
|
+
type: props.type
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_store","_lockUnlock","getPostMetaFields","select","context","getEditedEntityRecord","coreDataStore","getRegisteredPostMeta","unlock","entityMetaValues","postType","postId","meta","registeredFields","metaFields","Object","entries","forEach","key","props","charAt","_entityMetaValues$key","label","title","value","default","undefined","keys","length","_default","exports","name","getValues","bindings","newValues","attributeName","source","_ref","fieldKey","args","fieldValue","fieldLabel","setValues","dispatch","newMeta","values","newValue","editEntityRecord","canUserEditValue","query","queryId","editorStore","getCurrentPostType","areCustomFieldsEnabled","getEditorSettings","enableCustomFields","canUserEdit","canUser","kind","id","getFieldsList"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst { getEditedEntityRecord } = select( coreDataStore );\n\tconst { getRegisteredPostMeta } = unlock( select( coreDataStore ) );\n\n\tlet entityMetaValues;\n\t// Try to get the current entity meta values.\n\tif ( context?.postType && context?.postId ) {\n\t\tentityMetaValues = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t).meta;\n\t}\n\n\tconst registeredFields = getRegisteredPostMeta( context?.postType );\n\tconst metaFields = {};\n\tObject.entries( registeredFields || {} ).forEach( ( [ key, props ] ) => {\n\t\t// Don't include footnotes or private fields.\n\t\tif ( key !== 'footnotes' && key.charAt( 0 ) !== '_' ) {\n\t\t\tmetaFields[ key ] = {\n\t\t\t\tlabel: props.title || key,\n\t\t\t\tvalue:\n\t\t\t\t\t// When using the entity value, an empty string IS a valid value.\n\t\t\t\t\tentityMetaValues?.[ key ] ??\n\t\t\t\t\t// When using the default, an empty string IS NOT a valid value.\n\t\t\t\t\t( props.default || undefined ),\n\t\t\t};\n\t\t}\n\t} );\n\n\tif ( ! Object.keys( metaFields || {} ).length ) {\n\t\treturn null;\n\t}\n\n\treturn metaFields;\n}\n\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { select, context, bindings } ) {\n\t\tconst metaFields = getPostMetaFields( select, context );\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the value, the field label, or the field key.\n\t\t\tconst fieldKey = source.args.key;\n\t\t\tconst { value: fieldValue, label: fieldLabel } =\n\t\t\t\tmetaFields?.[ fieldKey ] || {};\n\t\t\tnewValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\t{\n\t\t\t\tmeta: newMeta,\n\t\t\t}\n\t\t);\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType =\n\t\t\tcontext?.postType || select( editorStore ).getCurrentPostType();\n\n\t\t// Check that editing is happening in the post editor and not a template.\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fieldValue = getPostMetaFields( select, context )?.[ args.key ]\n\t\t\t?.value;\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\treturn getPostMetaFields( select, context );\n\t},\n};\n"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AA;QACzB;QACEF,KAAK,CAACM,OAAO,IAAIC;
|
|
1
|
+
{"version":3,"names":["_coreData","require","_store","_lockUnlock","getPostMetaFields","select","context","getEditedEntityRecord","coreDataStore","getRegisteredPostMeta","unlock","entityMetaValues","postType","postId","meta","registeredFields","metaFields","Object","entries","forEach","key","props","charAt","_entityMetaValues$key","label","title","value","default","undefined","type","keys","length","_default","exports","name","getValues","bindings","newValues","attributeName","source","_ref","fieldKey","args","fieldValue","fieldLabel","setValues","dispatch","newMeta","values","newValue","editEntityRecord","canUserEditValue","query","queryId","editorStore","getCurrentPostType","areCustomFieldsEnabled","getEditorSettings","enableCustomFields","canUserEdit","canUser","kind","id","getFieldsList"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst { getEditedEntityRecord } = select( coreDataStore );\n\tconst { getRegisteredPostMeta } = unlock( select( coreDataStore ) );\n\n\tlet entityMetaValues;\n\t// Try to get the current entity meta values.\n\tif ( context?.postType && context?.postId ) {\n\t\tentityMetaValues = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t).meta;\n\t}\n\n\tconst registeredFields = getRegisteredPostMeta( context?.postType );\n\tconst metaFields = {};\n\tObject.entries( registeredFields || {} ).forEach( ( [ key, props ] ) => {\n\t\t// Don't include footnotes or private fields.\n\t\tif ( key !== 'footnotes' && key.charAt( 0 ) !== '_' ) {\n\t\t\tmetaFields[ key ] = {\n\t\t\t\tlabel: props.title || key,\n\t\t\t\tvalue:\n\t\t\t\t\t// When using the entity value, an empty string IS a valid value.\n\t\t\t\t\tentityMetaValues?.[ key ] ??\n\t\t\t\t\t// When using the default, an empty string IS NOT a valid value.\n\t\t\t\t\t( props.default || undefined ),\n\t\t\t\ttype: props.type,\n\t\t\t};\n\t\t}\n\t} );\n\n\tif ( ! Object.keys( metaFields || {} ).length ) {\n\t\treturn null;\n\t}\n\n\treturn metaFields;\n}\n\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { select, context, bindings } ) {\n\t\tconst metaFields = getPostMetaFields( select, context );\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the value, the field label, or the field key.\n\t\t\tconst fieldKey = source.args.key;\n\t\t\tconst { value: fieldValue, label: fieldLabel } =\n\t\t\t\tmetaFields?.[ fieldKey ] || {};\n\t\t\tnewValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\t{\n\t\t\t\tmeta: newMeta,\n\t\t\t}\n\t\t);\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType =\n\t\t\tcontext?.postType || select( editorStore ).getCurrentPostType();\n\n\t\t// Check that editing is happening in the post editor and not a template.\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fieldValue = getPostMetaFields( select, context )?.[ args.key ]\n\t\t\t?.value;\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\treturn getPostMetaFields( select, context );\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,iBAAiBA,CAAEC,MAAM,EAAEC,OAAO,EAAG;EAC7C,MAAM;IAAEC;EAAsB,CAAC,GAAGF,MAAM,CAAEG,eAAc,CAAC;EACzD,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAC,kBAAM,EAAEL,MAAM,CAAEG,eAAc,CAAE,CAAC;EAEnE,IAAIG,gBAAgB;EACpB;EACA,IAAKL,OAAO,EAAEM,QAAQ,IAAIN,OAAO,EAAEO,MAAM,EAAG;IAC3CF,gBAAgB,GAAGJ,qBAAqB,CACvC,UAA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ACb;IAEA,MAAM+B,UAAU,GAAGvC,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC,GAAIoC,IAAI,CAACtB,GAAG,CAAE,EAClEM,KAAK;IACR;IACA,IAAKiB,UAAU,KAAKf,SAAS,EAAG;MAC/B,OAAO,KAAK;IACb;IACA;IACA,MAAM4B,sBAAsB,GAC3BnD,MAAM,CAAEiD,YAAY,CAAC,CAACG,iBAAiB,CAAC,CAAC,CAACC,kBAAkB;IAC7D,IAAKF,sBAAsB,EAAG;MAC7B,OAAO,KAAK;IACb;;IAEA;IACA,MAAMG,WAAW,GAAGtD,MAAM,CAAEG,eAAc,CAAC,CAACoD,OAAO,CAAE,QAAQ,EAAE;MAC9DC,IAAI,EAAE,UAAU;MAChB3B,IAAI,EAAE5B,OAAO,EAAEM,QAAQ;MACvBkD,EAAE,EAAExD,OAAO,EAAEO;IACd,CAAE,CAAC;IACH,IAAK,CAAE8C,WAAW,EAAG;MACpB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ,CAAC;EACDI,aAAaA,CAAE;IAAE1D,MAAM;IAAEC;EAAQ,CAAC,EAAG;IACpC,OAAOF,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC;EAC5C;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AddComment = AddComment;
|
|
7
|
+
var _i18n = require("@wordpress/i18n");
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
var _element = require("@wordpress/element");
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
+
var _coreData = require("@wordpress/core-data");
|
|
13
|
+
var _utils = require("./utils");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* WordPress dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} props - The component props.
|
|
27
|
+
* @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.
|
|
28
|
+
* @param {boolean} props.showCommentBoard - The function to edit the comment.
|
|
29
|
+
* @param {Function} props.setShowCommentBoard - The function to delete the comment.
|
|
30
|
+
* @return {JSX.Element} The rendered comment input UI.
|
|
31
|
+
*/
|
|
32
|
+
function AddComment({
|
|
33
|
+
onSubmit,
|
|
34
|
+
showCommentBoard,
|
|
35
|
+
setShowCommentBoard
|
|
36
|
+
}) {
|
|
37
|
+
var _currentUser$name;
|
|
38
|
+
// State to manage the comment thread.
|
|
39
|
+
const [inputComment, setInputComment] = (0, _element.useState)('');
|
|
40
|
+
const {
|
|
41
|
+
defaultAvatar,
|
|
42
|
+
clientId,
|
|
43
|
+
blockCommentId,
|
|
44
|
+
currentUser
|
|
45
|
+
} = (0, _data.useSelect)(select => {
|
|
46
|
+
const {
|
|
47
|
+
getSettings,
|
|
48
|
+
getSelectedBlock
|
|
49
|
+
} = select(_blockEditor.store);
|
|
50
|
+
const {
|
|
51
|
+
__experimentalDiscussionSettings
|
|
52
|
+
} = getSettings();
|
|
53
|
+
const selectedBlock = getSelectedBlock();
|
|
54
|
+
const userData = select(_coreData.store).getCurrentUser();
|
|
55
|
+
return {
|
|
56
|
+
defaultAvatar: __experimentalDiscussionSettings?.avatarURL,
|
|
57
|
+
clientId: selectedBlock?.clientId,
|
|
58
|
+
blockCommentId: selectedBlock?.attributes?.blockCommentId,
|
|
59
|
+
currentUser: userData
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
62
|
+
const userAvatar = currentUser && currentUser.avatar_urls && currentUser.avatar_urls[48] ? currentUser.avatar_urls[48] : defaultAvatar;
|
|
63
|
+
(0, _element.useEffect)(() => {
|
|
64
|
+
setInputComment('');
|
|
65
|
+
}, [clientId]);
|
|
66
|
+
const handleCancel = () => {
|
|
67
|
+
setShowCommentBoard(false);
|
|
68
|
+
setInputComment('');
|
|
69
|
+
};
|
|
70
|
+
if (!showCommentBoard || !clientId || undefined !== blockCommentId) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
74
|
+
spacing: "3",
|
|
75
|
+
className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread",
|
|
76
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
77
|
+
alignment: "left",
|
|
78
|
+
spacing: "3",
|
|
79
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
80
|
+
src: userAvatar
|
|
81
|
+
// translators: alt text for user avatar image
|
|
82
|
+
,
|
|
83
|
+
alt: (0, _i18n.__)('User Avatar'),
|
|
84
|
+
className: "editor-collab-sidebar-panel__user-avatar",
|
|
85
|
+
width: 32,
|
|
86
|
+
height: 32
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
88
|
+
className: "editor-collab-sidebar-panel__user-name",
|
|
89
|
+
children: (_currentUser$name = currentUser?.name) !== null && _currentUser$name !== void 0 ? _currentUser$name : ''
|
|
90
|
+
})]
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
92
|
+
__next40pxDefaultSize: true,
|
|
93
|
+
__nextHasNoMarginBottom: true,
|
|
94
|
+
value: inputComment,
|
|
95
|
+
onChange: setInputComment,
|
|
96
|
+
placeholder: (0, _i18n._x)('Comment', 'noun')
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
98
|
+
alignment: "right",
|
|
99
|
+
spacing: "3",
|
|
100
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
101
|
+
__next40pxDefaultSize: true,
|
|
102
|
+
variant: "tertiary",
|
|
103
|
+
text: (0, _i18n._x)('Cancel', 'Cancel comment button'),
|
|
104
|
+
onClick: handleCancel
|
|
105
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
106
|
+
__next40pxDefaultSize: true,
|
|
107
|
+
accessibleWhenDisabled: true,
|
|
108
|
+
variant: "primary",
|
|
109
|
+
text: (0, _i18n._x)('Comment', 'Add comment button'),
|
|
110
|
+
disabled: 0 === (0, _utils.sanitizeCommentString)(inputComment).length,
|
|
111
|
+
onClick: () => {
|
|
112
|
+
onSubmit(inputComment);
|
|
113
|
+
setInputComment('');
|
|
114
|
+
}
|
|
115
|
+
})]
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=add-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_element","_components","_blockEditor","_coreData","_utils","_jsxRuntime","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","_currentUser$name","inputComment","setInputComment","useState","defaultAvatar","clientId","blockCommentId","currentUser","useSelect","select","getSettings","getSelectedBlock","blockEditorStore","__experimentalDiscussionSettings","selectedBlock","userData","coreStore","getCurrentUser","avatarURL","attributes","userAvatar","avatar_urls","useEffect","handleCancel","undefined","jsxs","__experimentalVStack","spacing","className","children","__experimentalHStack","alignment","jsx","src","alt","__","width","height","name","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","placeholder","_x","Button","variant","text","onClick","accessibleWhenDisabled","disabled","sanitizeCommentString","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>\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AAE,EAAE,SAAS,EAAE,MAAO;IAAG,CACvC,CAAC,eACF,IAAAlD,WAAA,CAAA8B,IAAA,EAAClC,WAAA,CAAAuC,oBAAM;MAACC,SAAS,EAAC,OAAO;MAACJ,OAAO,EAAC,GAAG;MAAAE,QAAA,gBACpC,IAAAlC,WAAA,CAAAqC,GAAA,EAACzC,WAAA,CAAAuD,MAAM;QACNN,qBAAqB;QACrBO,OAAO,EAAC,UAAU;QAClBC,IAAI,EAAG,IAAAH,QAAE,EAAE,QAAQ,EAAE,uBAAwB,CAAG;QAChDI,OAAO,EAAG1B;MAAc,CACxB,CAAC,eACF,IAAA5B,WAAA,CAAAqC,GAAA,EAACzC,WAAA,CAAAuD,MAAM;QACNN,qBAAqB;QACrBU,sBAAsB;QACtBH,OAAO,EAAC,SAAS;QACjBC,IAAI,EAAG,IAAAH,QAAE,EAAE,SAAS,EAAE,oBAAqB,CAAG;QAC9CM,QAAQ,EACP,CAAC,KAAK,IAAAC,4BAAqB,EAAEnD,YAAa,CAAC,CAACoD,MAC5C;QACDJ,OAAO,EAAGA,CAAA,KAAM;UACfpD,QAAQ,CAAEI,YAAa,CAAC;UACxBC,eAAe,CAAE,EAAG,CAAC;QACtB;MAAG,CACH,CAAC;IAAA,CACK,CAAC;EAAA,CACF,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _components = require("@wordpress/components");
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _icons = require("@wordpress/icons");
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* WordPress dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
__unstableCommentIconToolbarFill
|
|
23
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
24
|
+
const AddCommentToolbarButton = ({
|
|
25
|
+
onClick
|
|
26
|
+
}) => {
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(__unstableCommentIconToolbarFill, {
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
29
|
+
accessibleWhenDisabled: true,
|
|
30
|
+
icon: _icons.comment,
|
|
31
|
+
label: (0, _i18n._x)('Comment', 'View comment'),
|
|
32
|
+
onClick: onClick
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var _default = exports.default = AddCommentToolbarButton;
|
|
37
|
+
//# sourceMappingURL=comment-button-toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_blockEditor","_lockUnlock","_jsxRuntime","__unstableCommentIconToolbarFill","unlock","blockEditorPrivateApis","AddCommentToolbarButton","onClick","jsx","children","ToolbarButton","accessibleWhenDisabled","icon","commentIcon","label","_x","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { __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":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAX3C;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAiC,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE7E,MAAMC,uBAAuB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAClD,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACL,gCAAgC;IAAAM,QAAA,eAChC,IAAAP,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAc,aAAa;MACbC,sBAAsB;MACtBC,IAAI,EAAGC,cAAa;MACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAS,EAAE,cAAe,CAAG;MACzCR,OAAO,EAAGA;IAAS,CACnB;EAAC,CAC+B,CAAC;AAErC,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaZ,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _components = require("@wordpress/components");
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _icons = require("@wordpress/icons");
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* WordPress dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
__unstableCommentIconFill
|
|
23
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
24
|
+
const AddCommentButton = ({
|
|
25
|
+
onClick
|
|
26
|
+
}) => {
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(__unstableCommentIconFill, {
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
29
|
+
icon: _icons.comment,
|
|
30
|
+
onClick: onClick,
|
|
31
|
+
"aria-haspopup": "dialog",
|
|
32
|
+
children: (0, _i18n._x)('Comment', 'Add comment button')
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var _default = exports.default = AddCommentButton;
|
|
37
|
+
//# sourceMappingURL=comment-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_blockEditor","_lockUnlock","_jsxRuntime","__unstableCommentIconFill","unlock","blockEditorPrivateApis","AddCommentButton","onClick","jsx","children","MenuItem","icon","commentIcon","_x","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { __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":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAZ3C;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAA0B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEtE,MAAMC,gBAAgB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAC3C,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACL,yBAAyB;IAAAM,QAAA,eACzB,IAAAP,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAc,QAAQ;MACRC,IAAI,EAAGC,cAAa;MACpBL,OAAO,EAAGA,OAAS;MACnB,iBAAc,QAAQ;MAAAE,QAAA,EAEpB,IAAAI,QAAE,EAAE,SAAS,EAAE,oBAAqB;IAAC,CAC9B;EAAC,CACe,CAAC;AAE9B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaV,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Comments = Comments;
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _element = require("@wordpress/element");
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
var _date = require("@wordpress/date");
|
|
12
|
+
var _icons = require("@wordpress/icons");
|
|
13
|
+
var _i18n = require("@wordpress/i18n");
|
|
14
|
+
var _data = require("@wordpress/data");
|
|
15
|
+
var _coreData = require("@wordpress/core-data");
|
|
16
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
17
|
+
var _utils = require("./utils");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
/**
|
|
20
|
+
* External dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* WordPress dependencies
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Internal dependencies
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Renders the Comments component.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} props - The component props.
|
|
35
|
+
* @param {Array} props.threads - The array of comment threads.
|
|
36
|
+
* @param {Function} props.onEditComment - The function to handle comment editing.
|
|
37
|
+
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
38
|
+
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
39
|
+
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
40
|
+
* @return {JSX.Element} The rendered Comments component.
|
|
41
|
+
*/
|
|
42
|
+
function Comments({
|
|
43
|
+
threads,
|
|
44
|
+
onEditComment,
|
|
45
|
+
onAddReply,
|
|
46
|
+
onCommentDelete,
|
|
47
|
+
onCommentResolve
|
|
48
|
+
}) {
|
|
49
|
+
const [actionState, setActionState] = (0, _element.useState)(false);
|
|
50
|
+
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = (0, _element.useState)(false);
|
|
51
|
+
const handleConfirmDelete = () => {
|
|
52
|
+
onCommentDelete(actionState.id);
|
|
53
|
+
setActionState(false);
|
|
54
|
+
setIsConfirmDialogOpen(false);
|
|
55
|
+
};
|
|
56
|
+
const handleConfirmResolve = () => {
|
|
57
|
+
onCommentResolve(actionState.id);
|
|
58
|
+
setActionState(false);
|
|
59
|
+
setIsConfirmDialogOpen(false);
|
|
60
|
+
};
|
|
61
|
+
const handleCancelDelete = () => {
|
|
62
|
+
setActionState(false);
|
|
63
|
+
setIsConfirmDialogOpen(false);
|
|
64
|
+
};
|
|
65
|
+
const blockCommentId = (0, _data.useSelect)(select => {
|
|
66
|
+
var _select$getBlock$attr;
|
|
67
|
+
const clientID = select(_blockEditor.store).getSelectedBlockClientId();
|
|
68
|
+
return (_select$getBlock$attr = select(_blockEditor.store).getBlock(clientID)?.attributes?.blockCommentId) !== null && _select$getBlock$attr !== void 0 ? _select$getBlock$attr : false;
|
|
69
|
+
}, []);
|
|
70
|
+
const CommentBoard = ({
|
|
71
|
+
thread,
|
|
72
|
+
parentThread
|
|
73
|
+
}) => {
|
|
74
|
+
var _parentThread$status;
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
76
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CommentHeader, {
|
|
77
|
+
thread: thread,
|
|
78
|
+
onResolve: () => {
|
|
79
|
+
var _parentThread$id;
|
|
80
|
+
setActionState({
|
|
81
|
+
action: 'resolve',
|
|
82
|
+
id: (_parentThread$id = parentThread?.id) !== null && _parentThread$id !== void 0 ? _parentThread$id : thread.id
|
|
83
|
+
});
|
|
84
|
+
setIsConfirmDialogOpen(true);
|
|
85
|
+
},
|
|
86
|
+
onEdit: () => setActionState({
|
|
87
|
+
action: 'edit',
|
|
88
|
+
id: thread.id
|
|
89
|
+
}),
|
|
90
|
+
onDelete: () => {
|
|
91
|
+
setActionState({
|
|
92
|
+
action: 'delete',
|
|
93
|
+
id: thread.id
|
|
94
|
+
});
|
|
95
|
+
setIsConfirmDialogOpen(true);
|
|
96
|
+
},
|
|
97
|
+
onReply: !parentThread ? () => setActionState({
|
|
98
|
+
action: 'reply',
|
|
99
|
+
id: thread.id
|
|
100
|
+
}) : undefined,
|
|
101
|
+
status: (_parentThread$status = parentThread?.status) !== null && _parentThread$status !== void 0 ? _parentThread$status : thread.status
|
|
102
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
103
|
+
alignment: "left",
|
|
104
|
+
spacing: "3",
|
|
105
|
+
justify: "flex-start",
|
|
106
|
+
className: "editor-collab-sidebar-panel__user-comment",
|
|
107
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
108
|
+
spacing: "3",
|
|
109
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
110
|
+
children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentForm, {
|
|
111
|
+
onSubmit: value => {
|
|
112
|
+
onEditComment(thread.id, value);
|
|
113
|
+
setActionState(false);
|
|
114
|
+
},
|
|
115
|
+
onCancel: () => setActionState(false),
|
|
116
|
+
thread: thread
|
|
117
|
+
}), (!actionState || 'edit' !== actionState?.action) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.RawHTML, {
|
|
118
|
+
children: thread?.content?.raw
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
}), 'resolve' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalConfirmDialog, {
|
|
122
|
+
isOpen: isConfirmDialogOpen,
|
|
123
|
+
onConfirm: handleConfirmResolve,
|
|
124
|
+
onCancel: handleCancelDelete,
|
|
125
|
+
confirmButtonText: "Yes",
|
|
126
|
+
cancelButtonText: "No",
|
|
127
|
+
children:
|
|
128
|
+
// translators: message displayed when confirming an action
|
|
129
|
+
(0, _i18n.__)('Are you sure you want to mark this comment as resolved?')
|
|
130
|
+
}), 'delete' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalConfirmDialog, {
|
|
131
|
+
isOpen: isConfirmDialogOpen,
|
|
132
|
+
onConfirm: handleConfirmDelete,
|
|
133
|
+
onCancel: handleCancelDelete,
|
|
134
|
+
confirmButtonText: "Yes",
|
|
135
|
+
cancelButtonText: "No",
|
|
136
|
+
children:
|
|
137
|
+
// translators: message displayed when confirming an action
|
|
138
|
+
(0, _i18n.__)('Are you sure you want to delete this comment?')
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
143
|
+
children: [
|
|
144
|
+
// If there are no comments, show a message indicating no comments are available.
|
|
145
|
+
(!Array.isArray(threads) || threads.length === 0) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
146
|
+
alignment: "left",
|
|
147
|
+
className: "editor-collab-sidebar-panel__thread",
|
|
148
|
+
justify: "flex-start",
|
|
149
|
+
spacing: "3",
|
|
150
|
+
children:
|
|
151
|
+
// translators: message displayed when there are no comments available
|
|
152
|
+
(0, _i18n.__)('No comments available')
|
|
153
|
+
}), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
154
|
+
className: (0, _clsx.default)('editor-collab-sidebar-panel__thread', {
|
|
155
|
+
'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id
|
|
156
|
+
}),
|
|
157
|
+
id: thread.id,
|
|
158
|
+
spacing: "3",
|
|
159
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CommentBoard, {
|
|
160
|
+
thread: thread
|
|
161
|
+
}), 'reply' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
162
|
+
alignment: "left",
|
|
163
|
+
spacing: "3",
|
|
164
|
+
justify: "flex-start",
|
|
165
|
+
className: "editor-collab-sidebar-panel__user-comment",
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
167
|
+
spacing: "3",
|
|
168
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
169
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentForm, {
|
|
170
|
+
onSubmit: inputComment => {
|
|
171
|
+
onAddReply(inputComment, thread.id);
|
|
172
|
+
setActionState(false);
|
|
173
|
+
},
|
|
174
|
+
onCancel: () => setActionState(false)
|
|
175
|
+
})
|
|
176
|
+
})
|
|
177
|
+
}), 0 < thread?.reply?.length && thread.reply.map(reply => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
178
|
+
className: "editor-collab-sidebar-panel__child-thread",
|
|
179
|
+
id: reply.id,
|
|
180
|
+
spacing: "2",
|
|
181
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentBoard, {
|
|
182
|
+
thread: reply,
|
|
183
|
+
parentThread: thread
|
|
184
|
+
})
|
|
185
|
+
}, reply.id))]
|
|
186
|
+
}, thread.id))]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* EditComment component.
|
|
192
|
+
*
|
|
193
|
+
* @param {Object} props - The component props.
|
|
194
|
+
* @param {Function} props.onSubmit - The function to call when updating the comment.
|
|
195
|
+
* @param {Function} props.onCancel - The function to call when canceling the comment update.
|
|
196
|
+
* @param {Object} props.thread - The comment thread object.
|
|
197
|
+
* @return {JSX.Element} The CommentForm component.
|
|
198
|
+
*/
|
|
199
|
+
function CommentForm({
|
|
200
|
+
onSubmit,
|
|
201
|
+
onCancel,
|
|
202
|
+
thread
|
|
203
|
+
}) {
|
|
204
|
+
var _thread$content$raw;
|
|
205
|
+
const [inputComment, setInputComment] = (0, _element.useState)((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : '');
|
|
206
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
207
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextareaControl, {
|
|
208
|
+
__nextHasNoMarginBottom: true,
|
|
209
|
+
value: inputComment !== null && inputComment !== void 0 ? inputComment : '',
|
|
210
|
+
onChange: setInputComment
|
|
211
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
212
|
+
alignment: "left",
|
|
213
|
+
spacing: "3",
|
|
214
|
+
justify: "flex-start",
|
|
215
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
216
|
+
alignment: "left",
|
|
217
|
+
spacing: "3",
|
|
218
|
+
justify: "flex-start",
|
|
219
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
220
|
+
__next40pxDefaultSize: true,
|
|
221
|
+
accessibleWhenDisabled: true,
|
|
222
|
+
variant: "primary",
|
|
223
|
+
onClick: () => onSubmit(inputComment),
|
|
224
|
+
disabled: 0 === (0, _utils.sanitizeCommentString)(inputComment).length,
|
|
225
|
+
children: thread ? (0, _i18n._x)('Update', 'verb') : (0, _i18n._x)('Reply', 'Add reply comment')
|
|
226
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
227
|
+
__next40pxDefaultSize: true,
|
|
228
|
+
onClick: onCancel,
|
|
229
|
+
children: (0, _i18n._x)('Cancel', 'Cancel comment edit')
|
|
230
|
+
})]
|
|
231
|
+
})
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Renders the header of a comment in the collaboration sidebar.
|
|
238
|
+
*
|
|
239
|
+
* @param {Object} props - The component props.
|
|
240
|
+
* @param {Object} props.thread - The comment thread object.
|
|
241
|
+
* @param {Function} props.onResolve - The function to resolve the comment.
|
|
242
|
+
* @param {Function} props.onEdit - The function to edit the comment.
|
|
243
|
+
* @param {Function} props.onDelete - The function to delete the comment.
|
|
244
|
+
* @param {Function} props.onReply - The function to reply to the comment.
|
|
245
|
+
* @param {string} props.status - The status of the comment.
|
|
246
|
+
* @return {JSX.Element} The rendered comment header.
|
|
247
|
+
*/
|
|
248
|
+
function CommentHeader({
|
|
249
|
+
thread,
|
|
250
|
+
onResolve,
|
|
251
|
+
onEdit,
|
|
252
|
+
onDelete,
|
|
253
|
+
onReply,
|
|
254
|
+
status
|
|
255
|
+
}) {
|
|
256
|
+
const dateSettings = (0, _date.getSettings)();
|
|
257
|
+
const [dateTimeFormat = dateSettings.formats.time] = (0, _coreData.useEntityProp)('root', 'site', 'time_format');
|
|
258
|
+
const actions = [{
|
|
259
|
+
title: (0, _i18n._x)('Edit', 'Edit comment'),
|
|
260
|
+
onClick: onEdit
|
|
261
|
+
}, {
|
|
262
|
+
title: (0, _i18n._x)('Delete', 'Delete comment'),
|
|
263
|
+
onClick: onDelete
|
|
264
|
+
}, {
|
|
265
|
+
title: (0, _i18n._x)('Reply', 'Reply on a comment'),
|
|
266
|
+
onClick: onReply
|
|
267
|
+
}];
|
|
268
|
+
const moreActions = actions.filter(item => item.onClick);
|
|
269
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
270
|
+
alignment: "left",
|
|
271
|
+
spacing: "3",
|
|
272
|
+
justify: "flex-start",
|
|
273
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
274
|
+
src: thread?.author_avatar_urls?.[48],
|
|
275
|
+
className: "editor-collab-sidebar-panel__user-avatar"
|
|
276
|
+
// translators: alt text for user avatar image
|
|
277
|
+
,
|
|
278
|
+
alt: (0, _i18n.__)('User avatar'),
|
|
279
|
+
width: 32,
|
|
280
|
+
height: 32
|
|
281
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
282
|
+
spacing: "0",
|
|
283
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
284
|
+
className: "editor-collab-sidebar-panel__user-name",
|
|
285
|
+
children: thread.author_name
|
|
286
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
287
|
+
dateTime: (0, _date.format)('h:i A', thread.date),
|
|
288
|
+
className: "editor-collab-sidebar-panel__user-time",
|
|
289
|
+
children: (0, _date.dateI18n)(dateTimeFormat, thread.date)
|
|
290
|
+
})]
|
|
291
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
292
|
+
className: "editor-collab-sidebar-panel__comment-status",
|
|
293
|
+
children: [status !== 'approved' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
294
|
+
alignment: "right",
|
|
295
|
+
justify: "flex-end",
|
|
296
|
+
spacing: "0",
|
|
297
|
+
children: [0 === thread.parent && onResolve && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
298
|
+
label: (0, _i18n._x)('Resolve', 'Mark comment as resolved'),
|
|
299
|
+
__next40pxDefaultSize: true,
|
|
300
|
+
icon: _icons.published,
|
|
301
|
+
onClick: onResolve,
|
|
302
|
+
showTooltip: true
|
|
303
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
|
|
304
|
+
icon: _icons.moreVertical,
|
|
305
|
+
label: (0, _i18n._x)('Select an action', 'Select comment action'),
|
|
306
|
+
className: "editor-collab-sidebar-panel__comment-dropdown-menu",
|
|
307
|
+
controls: moreActions
|
|
308
|
+
})]
|
|
309
|
+
}), status === 'approved' &&
|
|
310
|
+
/*#__PURE__*/
|
|
311
|
+
// translators: tooltip for resolved comment
|
|
312
|
+
(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
313
|
+
text: (0, _i18n.__)('Resolved'),
|
|
314
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
315
|
+
icon: _icons.check
|
|
316
|
+
})
|
|
317
|
+
})]
|
|
318
|
+
})]
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=comments.js.map
|