@wordpress/editor 14.44.0 → 14.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/collab-sidebar/{comment-menu-item.cjs → add-note-menu-item.cjs} +17 -14
- package/build/components/collab-sidebar/add-note-menu-item.cjs.map +7 -0
- package/build/components/collab-sidebar/add-note.cjs +100 -0
- package/build/components/collab-sidebar/add-note.cjs.map +7 -0
- package/build/components/collab-sidebar/board-store.cjs +106 -0
- package/build/components/collab-sidebar/board-store.cjs.map +7 -0
- package/build/components/collab-sidebar/floating-container.cjs +63 -0
- package/build/components/collab-sidebar/floating-container.cjs.map +7 -0
- package/build/components/collab-sidebar/hooks.cjs +105 -140
- package/build/components/collab-sidebar/hooks.cjs.map +3 -3
- package/build/components/collab-sidebar/index.cjs +28 -90
- package/build/components/collab-sidebar/index.cjs.map +3 -3
- package/build/components/collab-sidebar/{comment-author-info.cjs → note-byline.cjs} +13 -9
- package/build/components/collab-sidebar/note-byline.cjs.map +7 -0
- package/build/components/collab-sidebar/note-card.cjs +58 -0
- package/build/components/collab-sidebar/note-card.cjs.map +7 -0
- package/build/components/collab-sidebar/{comment-form.cjs → note-form.cjs} +46 -45
- package/build/components/collab-sidebar/note-form.cjs.map +7 -0
- package/build/components/collab-sidebar/{comment-indicator-toolbar.cjs → note-indicator-toolbar.cjs} +31 -27
- package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +7 -0
- package/build/components/collab-sidebar/note-thread.cjs +321 -0
- package/build/components/collab-sidebar/note-thread.cjs.map +7 -0
- package/build/components/collab-sidebar/note.cjs +207 -0
- package/build/components/collab-sidebar/note.cjs.map +7 -0
- package/build/components/collab-sidebar/notes.cjs +237 -0
- package/build/components/collab-sidebar/notes.cjs.map +7 -0
- package/build/components/collab-sidebar/utils.cjs +80 -14
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-presence/avatar/component.cjs.map +1 -1
- package/build/components/collaborators-presence/index.cjs +3 -3
- package/build/components/collaborators-presence/index.cjs.map +2 -2
- package/build/components/collaborators-presence/list.cjs +3 -3
- package/build/components/collaborators-presence/list.cjs.map +2 -2
- package/build/components/document-bar/index.cjs.map +3 -3
- package/build/components/error-boundary/index.cjs.map +3 -3
- package/build/components/list-view-sidebar/list-view-outline.cjs.map +3 -3
- package/build/components/media/media-editor-modal.cjs +93 -0
- package/build/components/media/media-editor-modal.cjs.map +7 -0
- package/build/components/media-categories/index.cjs +1 -1
- package/build/components/media-categories/index.cjs.map +1 -1
- package/build/components/more-menu/index.cjs +4 -3
- package/build/components/more-menu/index.cjs.map +2 -2
- package/build/components/post-actions/set-as-homepage.cjs.map +3 -3
- package/build/components/post-actions/set-as-posts-page.cjs.map +3 -3
- package/build/components/post-card-panel/index.cjs +2 -2
- package/build/components/post-card-panel/index.cjs.map +3 -3
- package/build/components/post-content-information/index.cjs.map +3 -3
- package/build/components/post-excerpt/panel.cjs.map +3 -3
- package/build/components/post-last-edited-panel/index.cjs.map +3 -3
- package/build/components/post-preview-button/index.cjs +3 -2
- package/build/components/post-preview-button/index.cjs.map +2 -2
- package/build/components/post-publish-button/index.cjs +2 -2
- package/build/components/post-publish-button/index.cjs.map +2 -2
- package/build/components/post-publish-button/label.cjs +4 -2
- package/build/components/post-publish-button/label.cjs.map +2 -2
- package/build/components/post-publish-panel/maybe-upload-media.cjs +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.cjs.map +1 -1
- package/build/components/post-publish-panel/postpublish.cjs +3 -2
- package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
- package/build/components/post-revisions-panel/index.cjs +2 -2
- package/build/components/post-revisions-panel/index.cjs.map +2 -2
- package/build/components/post-revisions-preview/diff-markers.cjs +1 -1
- package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-slider.cjs +1 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
- package/build/components/post-saved-state/index.cjs +4 -1
- package/build/components/post-saved-state/index.cjs.map +2 -2
- package/build/components/post-text-editor/index.cjs +3 -4
- package/build/components/post-text-editor/index.cjs.map +2 -2
- package/build/components/preview-dropdown/index.cjs +3 -2
- package/build/components/preview-dropdown/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +3 -1
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/use-block-editor-settings.cjs +7 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
- package/build/components/provider/use-upload-save-lock.cjs +2 -12
- package/build/components/provider/use-upload-save-lock.cjs.map +2 -2
- package/build/components/resizable-editor/resize-handle.cjs +2 -1
- package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
- package/build/components/revision-created-panel/index.cjs.map +3 -3
- package/build/components/site-discussion/index.cjs.map +2 -2
- package/build/components/style-book/constants.cjs +1 -1
- package/build/components/style-book/constants.cjs.map +1 -1
- package/build/components/style-book/index.cjs +1 -1
- package/build/components/style-book/index.cjs.map +1 -1
- package/build/components/template-actions-panel/classic-theme-content.cjs.map +2 -2
- package/build/components/template-part-menu-items/convert-to-regular.cjs +54 -11
- package/build/components/template-part-menu-items/convert-to-regular.cjs.map +3 -3
- package/build/components/visual-editor/index.cjs +5 -22
- package/build/components/visual-editor/index.cjs.map +2 -2
- package/build/store/private-actions.cjs +0 -8
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +0 -5
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +0 -10
- package/build/store/reducer.cjs.map +2 -2
- package/build/utils/media-finalize/index.cjs +3 -2
- package/build/utils/media-finalize/index.cjs.map +2 -2
- package/build/utils/media-upload/index.cjs +14 -25
- package/build/utils/media-upload/index.cjs.map +2 -2
- package/build-module/components/collab-sidebar/{comment-menu-item.mjs → add-note-menu-item.mjs} +10 -11
- package/build-module/components/collab-sidebar/add-note-menu-item.mjs.map +7 -0
- package/build-module/components/collab-sidebar/add-note.mjs +78 -0
- package/build-module/components/collab-sidebar/add-note.mjs.map +7 -0
- package/build-module/components/collab-sidebar/board-store.mjs +81 -0
- package/build-module/components/collab-sidebar/board-store.mjs.map +7 -0
- package/build-module/components/collab-sidebar/floating-container.mjs +28 -0
- package/build-module/components/collab-sidebar/floating-container.mjs.map +7 -0
- package/build-module/components/collab-sidebar/hooks.mjs +105 -144
- package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs +29 -95
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/{comment-author-info.mjs → note-byline.mjs} +7 -7
- package/build-module/components/collab-sidebar/note-byline.mjs.map +7 -0
- package/build-module/components/collab-sidebar/note-card.mjs +33 -0
- package/build-module/components/collab-sidebar/note-card.mjs.map +7 -0
- package/build-module/components/collab-sidebar/note-form.mjs +84 -0
- package/build-module/components/collab-sidebar/note-form.mjs.map +7 -0
- package/build-module/components/collab-sidebar/{comment-indicator-toolbar.mjs → note-indicator-toolbar.mjs} +25 -29
- package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +7 -0
- package/build-module/components/collab-sidebar/note-thread.mjs +289 -0
- package/build-module/components/collab-sidebar/note-thread.mjs.map +7 -0
- package/build-module/components/collab-sidebar/note.mjs +176 -0
- package/build-module/components/collab-sidebar/note.mjs.map +7 -0
- package/build-module/components/collab-sidebar/notes.mjs +215 -0
- package/build-module/components/collab-sidebar/notes.mjs.map +7 -0
- package/build-module/components/collab-sidebar/utils.mjs +76 -10
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-presence/avatar/component.mjs.map +1 -1
- package/build-module/components/collaborators-presence/index.mjs +3 -3
- package/build-module/components/collaborators-presence/index.mjs.map +2 -2
- package/build-module/components/collaborators-presence/list.mjs +3 -3
- package/build-module/components/collaborators-presence/list.mjs.map +2 -2
- package/build-module/components/document-bar/index.mjs +3 -3
- package/build-module/components/document-bar/index.mjs.map +2 -2
- package/build-module/components/error-boundary/index.mjs +2 -2
- package/build-module/components/error-boundary/index.mjs.map +2 -2
- package/build-module/components/list-view-sidebar/list-view-outline.mjs +5 -5
- package/build-module/components/list-view-sidebar/list-view-outline.mjs.map +2 -2
- package/build-module/components/media/media-editor-modal.mjs +62 -0
- package/build-module/components/media/media-editor-modal.mjs.map +7 -0
- package/build-module/components/media-categories/index.mjs +1 -1
- package/build-module/components/media-categories/index.mjs.map +1 -1
- package/build-module/components/more-menu/index.mjs +4 -8
- package/build-module/components/more-menu/index.mjs.map +2 -2
- package/build-module/components/post-actions/set-as-homepage.mjs +2 -2
- package/build-module/components/post-actions/set-as-homepage.mjs.map +2 -2
- package/build-module/components/post-actions/set-as-posts-page.mjs +2 -2
- package/build-module/components/post-actions/set-as-posts-page.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +5 -5
- package/build-module/components/post-card-panel/index.mjs.map +2 -2
- package/build-module/components/post-content-information/index.mjs +2 -2
- package/build-module/components/post-content-information/index.mjs.map +2 -2
- package/build-module/components/post-excerpt/panel.mjs +2 -2
- package/build-module/components/post-excerpt/panel.mjs.map +2 -2
- package/build-module/components/post-last-edited-panel/index.mjs +2 -2
- package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
- package/build-module/components/post-preview-button/index.mjs +3 -2
- package/build-module/components/post-preview-button/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/index.mjs +2 -2
- package/build-module/components/post-publish-button/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/label.mjs +4 -2
- package/build-module/components/post-publish-button/label.mjs.map +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.mjs +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.mjs.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.mjs +3 -3
- package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
- package/build-module/components/post-revisions-panel/index.mjs +2 -2
- package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/diff-markers.mjs +1 -1
- package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/components/post-saved-state/index.mjs +4 -1
- package/build-module/components/post-saved-state/index.mjs.map +2 -2
- package/build-module/components/post-text-editor/index.mjs +2 -3
- package/build-module/components/post-text-editor/index.mjs.map +2 -2
- package/build-module/components/preview-dropdown/index.mjs +2 -2
- package/build-module/components/preview-dropdown/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +3 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +7 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/provider/use-upload-save-lock.mjs +2 -12
- package/build-module/components/provider/use-upload-save-lock.mjs.map +2 -2
- package/build-module/components/resizable-editor/resize-handle.mjs +2 -5
- package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
- package/build-module/components/revision-created-panel/index.mjs +2 -2
- package/build-module/components/revision-created-panel/index.mjs.map +2 -2
- package/build-module/components/site-discussion/index.mjs +2 -2
- package/build-module/components/site-discussion/index.mjs.map +2 -2
- package/build-module/components/style-book/constants.mjs +1 -1
- package/build-module/components/style-book/constants.mjs.map +1 -1
- package/build-module/components/style-book/index.mjs +1 -1
- package/build-module/components/style-book/index.mjs.map +1 -1
- package/build-module/components/template-actions-panel/classic-theme-content.mjs +2 -2
- package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +2 -2
- package/build-module/components/template-part-menu-items/convert-to-regular.mjs +60 -14
- package/build-module/components/template-part-menu-items/convert-to-regular.mjs.map +2 -2
- package/build-module/components/visual-editor/index.mjs +5 -22
- package/build-module/components/visual-editor/index.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +0 -7
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +0 -4
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +0 -9
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/utils/media-finalize/index.mjs +3 -2
- package/build-module/utils/media-finalize/index.mjs.map +2 -2
- package/build-module/utils/media-upload/index.mjs +14 -25
- package/build-module/utils/media-upload/index.mjs.map +2 -2
- package/build-style/style-rtl.css +397 -171
- package/build-style/style.css +397 -171
- package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +5 -0
- package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/add-note.d.ts +6 -0
- package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/board-store.d.ts +9 -0
- package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/floating-container.d.ts +8 -0
- package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/hooks.d.ts +13 -22
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-byline.d.ts +7 -0
- package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/note-card.d.ts +8 -0
- package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/note-form.d.ts +7 -0
- package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +5 -0
- package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/note-thread.d.ts +11 -0
- package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/note.d.ts +9 -0
- package/build-types/components/collab-sidebar/note.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/notes.d.ts +7 -0
- package/build-types/components/collab-sidebar/notes.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +41 -17
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/media/media-editor-modal.d.ts +11 -0
- package/build-types/components/media/media-editor-modal.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/post-preview-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/label.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
- package/build-types/components/post-saved-state/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/provider/use-upload-save-lock.d.ts +0 -2
- package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
- package/build-types/components/style-book/constants.d.ts +1 -1
- package/build-types/components/style-book/constants.d.ts.map +1 -1
- package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +0 -7
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +0 -7
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +0 -10
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/utils/media-finalize/index.d.ts +1 -1
- package/build-types/utils/media-finalize/index.d.ts.map +1 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/package.json +46 -46
- package/src/components/collab-sidebar/README.md +117 -0
- package/src/components/collab-sidebar/{comment-menu-item.js → add-note-menu-item.js} +8 -10
- package/src/components/collab-sidebar/{add-comment.js → add-note.js} +26 -49
- package/src/components/collab-sidebar/board-store.js +85 -0
- package/src/components/collab-sidebar/floating-container.js +30 -0
- package/src/components/collab-sidebar/hooks.js +130 -178
- package/src/components/collab-sidebar/index.js +35 -106
- package/src/components/collab-sidebar/{comment-author-info.js → note-byline.js} +5 -6
- package/src/components/collab-sidebar/note-card.js +36 -0
- package/src/components/collab-sidebar/{comment-form.js → note-form.js} +29 -40
- package/src/components/collab-sidebar/{comment-indicator-toolbar.js → note-indicator-toolbar.js} +29 -32
- package/src/components/collab-sidebar/note-thread.js +331 -0
- package/src/components/collab-sidebar/note.js +209 -0
- package/src/components/collab-sidebar/notes.js +276 -0
- package/src/components/collab-sidebar/style.scss +21 -11
- package/src/components/collab-sidebar/test/utils.js +155 -0
- package/src/components/collab-sidebar/utils.js +125 -19
- package/src/components/collaborators-presence/avatar/component.tsx +1 -1
- package/src/components/collaborators-presence/styles/collaborators-list.scss +1 -1
- package/src/components/collaborators-presence/styles/collaborators-presence.scss +1 -1
- package/src/components/document-bar/index.js +4 -4
- package/src/components/document-outline/style.scss +1 -1
- package/src/components/error-boundary/index.js +3 -3
- package/src/components/list-view-sidebar/list-view-outline.js +6 -6
- package/src/components/media/media-editor-modal.js +95 -0
- package/src/components/media-categories/index.js +1 -1
- package/src/components/more-menu/index.js +4 -8
- package/src/components/post-actions/set-as-homepage.js +2 -2
- package/src/components/post-actions/set-as-posts-page.js +2 -2
- package/src/components/post-card-panel/index.js +7 -7
- package/src/components/post-content-information/index.js +3 -3
- package/src/components/post-excerpt/panel.js +3 -3
- package/src/components/post-last-edited-panel/index.js +3 -3
- package/src/components/post-preview-button/index.js +3 -2
- package/src/components/post-publish-button/index.js +6 -5
- package/src/components/post-publish-button/label.js +3 -1
- package/src/components/post-publish-panel/maybe-upload-media.js +1 -1
- package/src/components/post-publish-panel/postpublish.js +2 -2
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +10 -16
- package/src/components/post-revisions-panel/index.js +3 -3
- package/src/components/post-revisions-preview/diff-markers.js +1 -1
- package/src/components/post-revisions-preview/revisions-slider.js +1 -0
- package/src/components/post-revisions-preview/style.scss +1 -1
- package/src/components/post-saved-state/index.js +4 -1
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +0 -1
- package/src/components/post-text-editor/index.js +3 -3
- package/src/components/preview-dropdown/index.js +2 -2
- package/src/components/provider/index.js +4 -0
- package/src/components/provider/use-block-editor-settings.js +10 -0
- package/src/components/provider/use-upload-save-lock.js +2 -17
- package/src/components/resizable-editor/resize-handle.js +2 -5
- package/src/components/revision-created-panel/index.js +3 -3
- package/src/components/site-discussion/index.js +3 -3
- package/src/components/style-book/constants.ts +1 -1
- package/src/components/style-book/index.js +1 -1
- package/src/components/template-actions-panel/classic-theme-content.js +3 -3
- package/src/components/template-actions-panel/style.scss +1 -1
- package/src/components/template-part-menu-items/convert-to-regular.js +74 -12
- package/src/components/visual-editor/index.js +2 -29
- package/src/store/private-actions.js +0 -13
- package/src/store/private-selectors.js +0 -10
- package/src/store/reducer.js +0 -16
- package/src/utils/media-finalize/index.js +2 -1
- package/src/utils/media-finalize/test/index.js +25 -1
- package/src/utils/media-upload/index.js +26 -29
- package/build/components/collab-sidebar/add-comment.cjs +0 -129
- package/build/components/collab-sidebar/add-comment.cjs.map +0 -7
- package/build/components/collab-sidebar/comment-author-info.cjs.map +0 -7
- package/build/components/collab-sidebar/comment-form.cjs.map +0 -7
- package/build/components/collab-sidebar/comment-indicator-toolbar.cjs.map +0 -7
- package/build/components/collab-sidebar/comment-menu-item.cjs.map +0 -7
- package/build/components/collab-sidebar/comments.cjs +0 -816
- package/build/components/collab-sidebar/comments.cjs.map +0 -7
- package/build-module/components/collab-sidebar/add-comment.mjs +0 -100
- package/build-module/components/collab-sidebar/add-comment.mjs.map +0 -7
- package/build-module/components/collab-sidebar/comment-author-info.mjs.map +0 -7
- package/build-module/components/collab-sidebar/comment-form.mjs +0 -90
- package/build-module/components/collab-sidebar/comment-form.mjs.map +0 -7
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.mjs.map +0 -7
- package/build-module/components/collab-sidebar/comment-menu-item.mjs.map +0 -7
- package/build-module/components/collab-sidebar/comments.mjs +0 -799
- package/build-module/components/collab-sidebar/comments.mjs.map +0 -7
- package/build-types/components/collab-sidebar/add-comment.d.ts +0 -10
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-form.d.ts +0 -11
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comments.d.ts +0 -12
- package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
- package/src/components/collab-sidebar/comments.js +0 -985
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/collab-sidebar/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAAuC;AACvC,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport PluginSidebar from '../plugin-sidebar';\nimport {\n\tALL_NOTES_SIDEBAR,\n\tFLOATING_NOTES_SIDEBAR,\n\tSIDEBARS,\n} from './constants';\nimport { Notes } from './notes';\nimport { store as editorStore } from '../../store';\nimport { AddNoteMenuItem } from './add-note-menu-item';\nimport { NoteAvatarIndicator } from './note-indicator-toolbar';\nimport { useGlobalStylesContext } from '../global-styles-provider';\nimport { useNoteThreads, useEnableFloatingSidebar } from './hooks';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { unlock } from '../../lock-unlock';\n\nfunction NotesSidebar( { postId } ) {\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst { toggleBlockSpotlight, selectBlock } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { selectNote } = unlock( useDispatch( editorStore ) );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst sidebarRef = useRef( null );\n\n\tconst { clientId, noteId, isClassicBlock } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tclientId: _clientId,\n\t\t\tnoteId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.metadata?.noteId\n\t\t\t\t: null,\n\t\t\tisClassicBlock: _clientId\n\t\t\t\t? getBlockName( _clientId ) === 'core/freeform'\n\t\t\t\t: false,\n\t\t};\n\t}, [] );\n\tconst { isDistractionFree } = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\tconst selectedNote = useSelect(\n\t\t( select ) => unlock( select( editorStore ) ).getSelectedNote(),\n\t\t[]\n\t);\n\n\tconst { notes, unresolvedNotes } = useNoteThreads( postId );\n\n\t// Only enable the floating sidebar for large viewports.\n\tconst showFloatingSidebar = isLargeViewport;\n\t// Fallback to \"All notes\" sidebar on smaller viewports.\n\tconst showAllNotesSidebar = notes.length > 0 || ! showFloatingSidebar;\n\tuseEnableFloatingSidebar(\n\t\tshowFloatingSidebar &&\n\t\t\t( unresolvedNotes.length > 0 || selectedNote !== undefined )\n\t);\n\n\tuseShortcut(\n\t\t'core/editor/new-note',\n\t\t( event ) => {\n\t\t\tevent.preventDefault();\n\t\t\topenTheSidebar();\n\t\t},\n\t\t{\n\t\t\t// When multiple notes per block are supported. Remove note ID check.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/75147.\n\t\t\tisDisabled:\n\t\t\t\tisDistractionFree || isClassicBlock || ! clientId || !! noteId,\n\t\t}\n\t);\n\n\t// Get the global styles to set the background color of the sidebar.\n\tconst { merged: GlobalStyles } = useGlobalStylesContext();\n\tconst backgroundColor = GlobalStyles?.styles?.color?.background;\n\n\t// Find the current thread for the selected block.\n\tconst currentThread = noteId\n\t\t? notes.find( ( thread ) => thread.id === noteId )\n\t\t: null;\n\n\tasync function openTheSidebar( selectedClientId ) {\n\t\tconst prevArea = await getActiveComplementaryArea( 'core' );\n\t\tconst activeNotesArea = SIDEBARS.find( ( name ) => name === prevArea );\n\t\tconst targetClientId =\n\t\t\tselectedClientId && selectedClientId !== clientId\n\t\t\t\t? selectedClientId\n\t\t\t\t: clientId;\n\t\tconst targetNote = notes.find(\n\t\t\t( note ) => note.blockClientId === targetClientId\n\t\t);\n\n\t\tif ( targetNote?.status === 'approved' ) {\n\t\t\tenableComplementaryArea( 'core', ALL_NOTES_SIDEBAR );\n\t\t} else if ( ! activeNotesArea || ! showAllNotesSidebar ) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core',\n\t\t\t\tshowFloatingSidebar ? FLOATING_NOTES_SIDEBAR : ALL_NOTES_SIDEBAR\n\t\t\t);\n\t\t}\n\n\t\tconst currentArea = await getActiveComplementaryArea( 'core' );\n\t\t// Bail out if the current active area is not one of note sidebars.\n\t\tif ( ! SIDEBARS.includes( currentArea ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// A special case for the List View, where block selection isn't required to trigger an action.\n\t\t// The action won't do anything if the block is already selected.\n\t\tselectBlock( targetClientId, null );\n\t\ttoggleBlockSpotlight( targetClientId, true );\n\t\tselectNote( targetNote ? targetNote.id : 'new', { focus: true } );\n\t}\n\n\tif ( isDistractionFree ) {\n\t\treturn <AddNoteMenuItem isDistractionFree />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ !! currentThread && (\n\t\t\t\t<NoteAvatarIndicator\n\t\t\t\t\tnote={ currentThread }\n\t\t\t\t\tonClick={ openTheSidebar }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<AddNoteMenuItem onClick={ openTheSidebar } />\n\t\t\t{ showAllNotesSidebar && (\n\t\t\t\t<PluginSidebar\n\t\t\t\t\tidentifier={ ALL_NOTES_SIDEBAR }\n\t\t\t\t\tname={ ALL_NOTES_SIDEBAR }\n\t\t\t\t\ttitle={ __( 'All notes' ) }\n\t\t\t\t\theader={\n\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t{ __( 'All notes' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t}\n\t\t\t\t\ticon={ commentIcon }\n\t\t\t\t\tcloseLabel={ __( 'Close Notes' ) }\n\t\t\t\t>\n\t\t\t\t\t<Notes notes={ notes } sidebarRef={ sidebarRef } />\n\t\t\t\t</PluginSidebar>\n\t\t\t) }\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<PluginSidebar\n\t\t\t\t\tisPinnable={ false }\n\t\t\t\t\theader={ false }\n\t\t\t\t\tidentifier={ FLOATING_NOTES_SIDEBAR }\n\t\t\t\t\tclassName=\"editor-collab-sidebar\"\n\t\t\t\t\theaderClassName=\"editor-collab-sidebar__header\"\n\t\t\t\t\tbackgroundColor={ backgroundColor }\n\t\t\t\t>\n\t\t\t\t\t<Notes\n\t\t\t\t\t\tnotes={ unresolvedNotes }\n\t\t\t\t\t\tsidebarRef={ sidebarRef }\n\t\t\t\t\t\tstyles={ { backgroundColor } }\n\t\t\t\t\t\tisFloating\n\t\t\t\t\t/>\n\t\t\t\t</PluginSidebar>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default function NotesSidebarContainer() {\n\tconst { postId, editorMode, revisionsMode } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getEditorMode, isRevisionsMode } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\trevisionsMode: isRevisionsMode(),\n\t\t};\n\t}, [] );\n\n\tif ( ! postId || typeof postId !== 'number' ) {\n\t\treturn null;\n\t}\n\n\t// Hide Notes sidebar for Code Editor and in-editor revision mode.\n\tif ( editorMode === 'text' || revisionsMode ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"editor.notes\">\n\t\t\t<NotesSidebar postId={ postId } />\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAAuC;AACvC,qBAAuB;AACvB,qBAAiC;AACjC,gCAA4B;AAC5B,mBAAuC;AACvC,0BAA0C;AAC1C,uBAAwC;AACxC,yBAA0C;AAK1C,4BAA0B;AAC1B,uBAIO;AACP,mBAAsB;AACtB,mBAAqC;AACrC,gCAAgC;AAChC,oCAAoC;AACpC,oCAAuC;AACvC,mBAAyD;AACzD,qCAAiC;AACjC,yBAAuB;AAyGd;AAvGT,SAAS,aAAc,EAAE,OAAO,GAAI;AACnC,QAAM,EAAE,2BAA2B,QAAI,uBAAW,iBAAAA,KAAe;AACjE,QAAM,EAAE,wBAAwB,QAAI,yBAAa,iBAAAA,KAAe;AAChE,QAAM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A,QAED,MAAO,aAAAC;AAAA,QACP,gBAAa,gBAAI,aAAc;AAAA,QAE/B,sDAAC,sBAAM,OAAgB,YAA0B;AAAA;AAAA,IAClD;AAAA,IAEC,mBACD;AAAA,MAAC,sBAAAD;AAAA,MAAA;AAAA,QACA,YAAa;AAAA,QACb,QAAS;AAAA,QACT,YAAa;AAAA,QACb,WAAU;AAAA,QACV,iBAAgB;AAAA,QAChB;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR;AAAA,YACA,QAAS,EAAE,gBAAgB;AAAA,YAC3B,YAAU;AAAA;AAAA,QACX;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;AAEe,SAAR,wBAAyC;AAC/C,QAAM,EAAE,QAAQ,YAAY,cAAc,QAAI,uBAAW,CAAE,WAAY;AACtE,UAAM,EAAE,kBAAkB,eAAe,gBAAgB,QAAI;AAAA,MAC5D,OAAQ,aAAAF,KAAY;AAAA,IACrB;AACA,WAAO;AAAA,MACN,QAAQ,iBAAiB;AAAA,MACzB,YAAY,cAAc;AAAA,MAC1B,eAAe,gBAAgB;AAAA,IAChC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,UAAU,OAAO,WAAW,UAAW;AAC7C,WAAO;AAAA,EACR;AAGA,MAAK,eAAe,UAAU,eAAgB;AAC7C,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,+BAAAI,SAAA,EAAqB,aAAY,gBACjC,sDAAC,gBAAa,QAAkB,GACjC;AAEF;",
|
|
6
|
+
"names": ["interfaceStore", "blockEditorStore", "editorStore", "preferencesStore", "PluginSidebar", "commentIcon", "PostTypeSupportCheck"]
|
|
7
7
|
}
|
|
@@ -17,13 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// packages/editor/src/components/collab-sidebar/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// packages/editor/src/components/collab-sidebar/note-byline.js
|
|
21
|
+
var note_byline_exports = {};
|
|
22
|
+
__export(note_byline_exports, {
|
|
23
|
+
NoteByline: () => NoteByline
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(note_byline_exports);
|
|
26
26
|
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_ui = require("@wordpress/ui");
|
|
27
28
|
var import_i18n = require("@wordpress/i18n");
|
|
28
29
|
var import_date = require("@wordpress/date");
|
|
29
30
|
var import_core_data = require("@wordpress/core-data");
|
|
@@ -31,7 +32,7 @@ var import_data = require("@wordpress/data");
|
|
|
31
32
|
var import_block_editor = require("@wordpress/block-editor");
|
|
32
33
|
var import_utils = require("./utils.cjs");
|
|
33
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
-
function
|
|
35
|
+
function NoteByline({ avatar, name, date, userId }) {
|
|
35
36
|
const hasAvatar = !!avatar;
|
|
36
37
|
const dateSettings = (0, import_date.getSettings)();
|
|
37
38
|
const {
|
|
@@ -89,7 +90,7 @@ function CommentAuthorInfo({ avatar, name, date, userId }) {
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
),
|
|
92
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "column", children: [
|
|
93
94
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "editor-collab-sidebar-panel__user-name", children: name ?? currentUserName }),
|
|
94
95
|
date && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Tooltip, { text: tooltipText, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
96
|
"time",
|
|
@@ -102,5 +103,8 @@ function CommentAuthorInfo({ avatar, name, date, userId }) {
|
|
|
102
103
|
] })
|
|
103
104
|
] });
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
107
|
+
0 && (module.exports = {
|
|
108
|
+
NoteByline
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=note-byline.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/collab-sidebar/note-byline.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Tooltip } from '@wordpress/components';\nimport { Stack } from '@wordpress/ui';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tdateI18n,\n\tgetSettings as getDateSettings,\n\thumanTimeDiff,\n\tgetDate,\n} from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getAvatarBorderColor } from './utils';\n\nexport function NoteByline( { avatar, name, date, userId } ) {\n\tconst hasAvatar = !! avatar;\n\tconst dateSettings = getDateSettings();\n\tconst {\n\t\tcurrentUserAvatar,\n\t\tcurrentUserName,\n\t\tcurrentUserId,\n\t\tdateFormat = dateSettings.formats.date,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser, getCurrentUser, getEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tif ( hasAvatar ) {\n\t\t\t\treturn {\n\t\t\t\t\tdateFormat: siteSettings?.date_format,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\t\tconst defaultAvatar = __experimentalDiscussionSettings?.avatarURL;\n\t\t\tconst userData = getCurrentUser();\n\t\t\treturn {\n\t\t\t\tcurrentUserAvatar:\n\t\t\t\t\tuserData?.avatar_urls?.[ 48 ] ?? defaultAvatar,\n\t\t\t\tcurrentUserName: userData?.name,\n\t\t\t\tcurrentUserId: userData?.id,\n\t\t\t\tdateFormat: siteSettings?.date_format,\n\t\t\t};\n\t\t},\n\t\t[ hasAvatar ]\n\t);\n\n\tconst commentDate = getDate( date );\n\tconst commentDateTime = dateI18n( 'c', commentDate );\n\tconst shouldShowHumanTimeDiff =\n\t\tMath.floor( ( new Date() - commentDate ) / ( 1000 * 60 * 60 * 24 ) ) <\n\t\t30;\n\n\tconst commentDateText = shouldShowHumanTimeDiff\n\t\t? humanTimeDiff( commentDate )\n\t\t: dateI18n( dateFormat, commentDate );\n\n\tconst tooltipText = dateI18n(\n\t\t// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.\n\t\t_x( 'F j, Y g:i\\xa0a', 'Note date full date format' ),\n\t\tdate\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<img\n\t\t\t\tsrc={ avatar || currentUserAvatar }\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\talt={ __( 'User avatar' ) }\n\t\t\t\twidth={ 32 }\n\t\t\t\theight={ 32 }\n\t\t\t\tstyle={ {\n\t\t\t\t\tborderColor: getAvatarBorderColor(\n\t\t\t\t\t\tuserId ?? currentUserId\n\t\t\t\t\t),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Stack direction=\"column\">\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ name ?? currentUserName }\n\t\t\t\t</span>\n\t\t\t\t{ date && (\n\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t<time\n\t\t\t\t\t\t\tdateTime={ commentDateTime }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t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;AACnD,QAAM,0BACL,KAAK,OAAS,oBAAI,KAAK,IAAI,gBAAkB,MAAO,KAAK,KAAK,GAAK,IACnE;AAED,QAAM,kBAAkB,8BACrB,2BAAe,WAAY,QAC3B,sBAAU,YAAY,WAAY;AAErC,QAAM,kBAAc;AAAA;AAAA,QAEnB,gBAAI,mBAAmB,4BAA6B;AAAA,IACpD;AAAA,EACD;AAEA,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,KAAM,UAAU;AAAA,QAChB,WAAU;AAAA,QAEV,SAAM,gBAAI,aAAc;AAAA,QACxB,OAAQ;AAAA,QACR,QAAS;AAAA,QACT,OAAQ;AAAA,UACP,iBAAa;AAAA,YACZ,UAAU;AAAA,UACX;AAAA,QACD;AAAA;AAAA,IACD;AAAA,IACA,6CAAC,mBAAM,WAAU,UAChB;AAAA,kDAAC,UAAK,WAAU,0CACb,kBAAQ,iBACX;AAAA,MACE,QACD,4CAAC,6BAAQ,MAAO,aACf;AAAA,QAAC;AAAA;AAAA,UACA,UAAW;AAAA,UACX,WAAU;AAAA,UAER;AAAA;AAAA,MACH,GACD;AAAA,OAEF;AAAA,KACD;AAEF;",
|
|
6
|
+
"names": ["getDateSettings", "coreStore", "blockEditorStore"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/collab-sidebar/note-card.js
|
|
21
|
+
var note_card_exports = {};
|
|
22
|
+
__export(note_card_exports, {
|
|
23
|
+
NoteCard: () => NoteCard
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(note_card_exports);
|
|
26
|
+
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_ui = require("@wordpress/ui");
|
|
28
|
+
var import_note_byline = require("./note-byline.cjs");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
function NoteCard({ note, actions, className, children, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "column", gap: "sm", className, ...props, children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "row", align: "center", justify: "flex-start", gap: "md", children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
34
|
+
import_note_byline.NoteByline,
|
|
35
|
+
{
|
|
36
|
+
avatar: note?.author_avatar_urls?.[48],
|
|
37
|
+
name: note?.author_name,
|
|
38
|
+
date: note?.date,
|
|
39
|
+
userId: note?.author
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
import_components.FlexItem,
|
|
44
|
+
{
|
|
45
|
+
className: "editor-collab-sidebar-panel__note-actions",
|
|
46
|
+
onClick: (event) => event.stopPropagation(),
|
|
47
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Stack, { direction: "row", align: "center", children: actions })
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] }),
|
|
51
|
+
children
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
NoteCard
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=note-card.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/collab-sidebar/note-card.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { FlexItem } from '@wordpress/components';\nimport { Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { NoteByline } from './note-byline';\n\nexport function NoteCard( { note, actions, className, children, ...props } ) {\n\treturn (\n\t\t<Stack direction=\"column\" gap=\"sm\" className={ className } { ...props }>\n\t\t\t<Stack direction=\"row\" align=\"center\" justify=\"flex-start\" gap=\"md\">\n\t\t\t\t<NoteByline\n\t\t\t\t\tavatar={ note?.author_avatar_urls?.[ 48 ] }\n\t\t\t\t\tname={ note?.author_name }\n\t\t\t\t\tdate={ note?.date }\n\t\t\t\t\tuserId={ note?.author }\n\t\t\t\t/>\n\t\t\t\t{ actions && (\n\t\t\t\t\t<FlexItem\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__note-actions\"\n\t\t\t\t\t\tonClick={ ( event ) => event.stopPropagation() }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack direction=\"row\" align=\"center\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</Stack>\n\t\t\t{ children }\n\t\t</Stack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAyB;AACzB,gBAAsB;AAKtB,yBAA2B;AAKxB;AAHI,SAAS,SAAU,EAAE,MAAM,SAAS,WAAW,UAAU,GAAG,MAAM,GAAI;AAC5E,SACC,6CAAC,mBAAM,WAAU,UAAS,KAAI,MAAK,WAA0B,GAAG,OAC/D;AAAA,iDAAC,mBAAM,WAAU,OAAM,OAAM,UAAS,SAAQ,cAAa,KAAI,MAC9D;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,QAAS,MAAM,qBAAsB,EAAG;AAAA,UACxC,MAAO,MAAM;AAAA,UACb,MAAO,MAAM;AAAA,UACb,QAAS,MAAM;AAAA;AAAA,MAChB;AAAA,MACE,WACD;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UACV,SAAU,CAAE,UAAW,MAAM,gBAAgB;AAAA,UAE7C,sDAAC,mBAAM,WAAU,OAAM,OAAM,UAC1B,mBACH;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,IACE;AAAA,KACH;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -27,59 +27,47 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// packages/editor/src/components/collab-sidebar/
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
|
|
30
|
+
// packages/editor/src/components/collab-sidebar/note-form.js
|
|
31
|
+
var note_form_exports = {};
|
|
32
|
+
__export(note_form_exports, {
|
|
33
|
+
NoteForm: () => NoteForm
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(note_form_exports);
|
|
36
36
|
var import_react_autosize_textarea = __toESM(require("react-autosize-textarea"));
|
|
37
37
|
var import_element = require("@wordpress/element");
|
|
38
38
|
var import_components = require("@wordpress/components");
|
|
39
|
+
var import_ui = require("@wordpress/ui");
|
|
39
40
|
var import_i18n = require("@wordpress/i18n");
|
|
40
41
|
var import_compose = require("@wordpress/compose");
|
|
41
42
|
var import_keycodes = require("@wordpress/keycodes");
|
|
42
43
|
var import_utils = require("./utils.cjs");
|
|
43
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
function
|
|
45
|
-
onSubmit,
|
|
46
|
-
onCancel,
|
|
47
|
-
thread,
|
|
48
|
-
submitButtonText,
|
|
49
|
-
labelText,
|
|
50
|
-
reflowComments = import_utils.noop
|
|
51
|
-
}) {
|
|
45
|
+
function NoteForm({ onSubmit, onCancel, note, labels }) {
|
|
52
46
|
const [inputComment, setInputComment] = (0, import_element.useState)(
|
|
53
|
-
|
|
47
|
+
note?.content?.raw ?? ""
|
|
54
48
|
);
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
setInputComment(value);
|
|
58
|
-
};
|
|
59
|
-
const inputId = (0, import_compose.useInstanceId)(CommentForm, "comment-input");
|
|
60
|
-
const isDisabled = inputComment === thread?.content?.raw || !(0, import_utils.sanitizeCommentString)(inputComment).length;
|
|
49
|
+
const inputId = (0, import_compose.useInstanceId)(NoteForm, "comment-input");
|
|
50
|
+
const isDisabled = inputComment === note?.content?.raw || !(0, import_utils.sanitizeNoteContent)(inputComment).length;
|
|
61
51
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
62
|
-
|
|
52
|
+
import_ui.Stack,
|
|
63
53
|
{
|
|
64
|
-
className: "editor-collab-sidebar-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
className: "editor-collab-sidebar-panel__note-form",
|
|
55
|
+
direction: "column",
|
|
56
|
+
gap: "lg",
|
|
57
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", {}),
|
|
67
58
|
onSubmit: (event) => {
|
|
68
59
|
event.preventDefault();
|
|
69
60
|
onSubmit(inputComment);
|
|
70
61
|
setInputComment("");
|
|
71
62
|
},
|
|
72
63
|
children: [
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: inputId }), children: labels?.input ?? (0, import_i18n.__)("Note") }),
|
|
74
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
66
|
import_react_autosize_textarea.default,
|
|
76
67
|
{
|
|
77
68
|
id: inputId,
|
|
78
69
|
value: inputComment ?? "",
|
|
79
|
-
onChange: (comment) =>
|
|
80
|
-
updateComment(comment.target.value);
|
|
81
|
-
debouncedCommentUpdated();
|
|
82
|
-
},
|
|
70
|
+
onChange: (comment) => setInputComment(comment.target.value),
|
|
83
71
|
rows: 1,
|
|
84
72
|
maxRows: 20,
|
|
85
73
|
onKeyDown: (event) => {
|
|
@@ -93,23 +81,36 @@ function CommentForm({
|
|
|
93
81
|
}
|
|
94
82
|
}
|
|
95
83
|
),
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
85
|
+
import_ui.Stack,
|
|
86
|
+
{
|
|
87
|
+
direction: "row",
|
|
88
|
+
align: "center",
|
|
89
|
+
justify: "flex-end",
|
|
90
|
+
gap: "sm",
|
|
91
|
+
wrap: "wrap",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Button, { size: "compact", variant: "tertiary", onClick: onCancel, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalTruncate, { children: (0, import_i18n.__)("Cancel") }) }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
import_components.Button,
|
|
96
|
+
{
|
|
97
|
+
size: "compact",
|
|
98
|
+
accessibleWhenDisabled: true,
|
|
99
|
+
variant: "primary",
|
|
100
|
+
type: "submit",
|
|
101
|
+
disabled: isDisabled,
|
|
102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalTruncate, { children: labels?.submit ?? (0, import_i18n.__)("Add note") })
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
110
108
|
]
|
|
111
109
|
}
|
|
112
110
|
);
|
|
113
111
|
}
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
113
|
+
0 && (module.exports = {
|
|
114
|
+
NoteForm
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=note-form.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/collab-sidebar/note-form.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport TextareaAutosize from 'react-autosize-textarea';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalTruncate as Truncate,\n\tButton,\n} from '@wordpress/components';\nimport { Stack, VisuallyHidden } from '@wordpress/ui';\nimport { __ } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { isKeyboardEvent } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeNoteContent } from './utils';\n\nexport function NoteForm( { onSubmit, onCancel, note, labels } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tnote?.content?.raw ?? ''\n\t);\n\n\tconst inputId = useInstanceId( NoteForm, 'comment-input' );\n\tconst isDisabled =\n\t\tinputComment === note?.content?.raw ||\n\t\t! sanitizeNoteContent( inputComment ).length;\n\n\treturn (\n\t\t<Stack\n\t\t\tclassName=\"editor-collab-sidebar-panel__note-form\"\n\t\t\tdirection=\"column\"\n\t\t\tgap=\"lg\"\n\t\t\trender={ <form /> }\n\t\t\tonSubmit={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonSubmit( inputComment );\n\t\t\t\tsetInputComment( '' );\n\t\t\t} }\n\t\t>\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/label-has-associated-control */ }\n\t\t\t<VisuallyHidden render={ <label htmlFor={ inputId } /> }>\n\t\t\t\t{ labels?.input ?? __( 'Note' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<TextareaAutosize\n\t\t\t\tid={ inputId }\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ ( comment ) =>\n\t\t\t\t\tsetInputComment( comment.target.value )\n\t\t\t\t}\n\t\t\t\trows={ 1 }\n\t\t\t\tmaxRows={ 20 }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisKeyboardEvent.primary( event, 'Enter' ) &&\n\t\t\t\t\t\t! isDisabled\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.target.parentNode.requestSubmit();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t// Passing event for reply forms.\n\t\t\t\t\t\tonCancel( event );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Stack\n\t\t\t\tdirection=\"row\"\n\t\t\t\talign=\"center\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\tgap=\"sm\"\n\t\t\t\twrap=\"wrap\"\n\t\t\t>\n\t\t\t\t<Button size=\"compact\" variant=\"tertiary\" onClick={ onCancel }>\n\t\t\t\t\t<Truncate>{ __( 'Cancel' ) }</Truncate>\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\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WAAW,cAAc;AAAA,cACvC;AAEA,kBAAK,MAAM,QAAQ,UAAW;AAC7B,sBAAM,eAAe;AAErB,yBAAU,KAAM;AAAA,cACjB;AAAA,YACD;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,OAAM;AAAA,YACN,SAAQ;AAAA,YACR,KAAI;AAAA,YACJ,MAAK;AAAA,YAEL;AAAA,0DAAC,4BAAO,MAAK,WAAU,SAAQ,YAAW,SAAU,UACnD,sDAAC,kBAAAC,wBAAA,EAAW,8BAAI,QAAS,GAAG,GAC7B;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACA,MAAK;AAAA,kBACL,wBAAsB;AAAA,kBACtB,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,UAAW;AAAA,kBAEX,sDAAC,kBAAAA,wBAAA,EAAW,kBAAQ,cAAU,gBAAI,UAAW,GAAG;AAAA;AAAA,cACjD;AAAA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["TextareaAutosize", "Truncate"]
|
|
7
|
+
}
|
package/build/components/collab-sidebar/{comment-indicator-toolbar.cjs → note-indicator-toolbar.cjs}
RENAMED
|
@@ -17,42 +17,43 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// packages/editor/src/components/collab-sidebar/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
20
|
+
// packages/editor/src/components/collab-sidebar/note-indicator-toolbar.js
|
|
21
|
+
var note_indicator_toolbar_exports = {};
|
|
22
|
+
__export(note_indicator_toolbar_exports, {
|
|
23
|
+
NoteAvatarIndicator: () => NoteAvatarIndicator
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(note_indicator_toolbar_exports);
|
|
26
26
|
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_ui = require("@wordpress/ui");
|
|
27
28
|
var import_i18n = require("@wordpress/i18n");
|
|
28
29
|
var import_element = require("@wordpress/element");
|
|
29
30
|
var import_block_editor = require("@wordpress/block-editor");
|
|
30
31
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
31
32
|
var import_utils = require("./utils.cjs");
|
|
32
33
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var {
|
|
34
|
-
|
|
34
|
+
var { NoteIconToolbarSlotFill } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
35
|
+
function NoteAvatarIndicator({ onClick, note }) {
|
|
35
36
|
const threadParticipants = (0, import_element.useMemo)(() => {
|
|
36
|
-
if (!
|
|
37
|
+
if (!note) {
|
|
37
38
|
return [];
|
|
38
39
|
}
|
|
39
40
|
const participantsMap = /* @__PURE__ */ new Map();
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
if (!participantsMap.has(
|
|
45
|
-
participantsMap.set(
|
|
46
|
-
name:
|
|
47
|
-
avatar:
|
|
48
|
-
id:
|
|
49
|
-
date:
|
|
41
|
+
const allNotes = [note, ...note.reply];
|
|
42
|
+
allNotes.sort((a, b) => new Date(a.date) - new Date(b.date));
|
|
43
|
+
allNotes.forEach((entry) => {
|
|
44
|
+
if (entry.author_name && entry.author_avatar_urls) {
|
|
45
|
+
if (!participantsMap.has(entry.author)) {
|
|
46
|
+
participantsMap.set(entry.author, {
|
|
47
|
+
name: entry.author_name,
|
|
48
|
+
avatar: entry.author_avatar_urls?.["48"] || entry.author_avatar_urls?.["96"],
|
|
49
|
+
id: entry.author,
|
|
50
|
+
date: entry.date
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
55
|
return Array.from(participantsMap.values());
|
|
55
|
-
}, [
|
|
56
|
+
}, [note]);
|
|
56
57
|
if (!threadParticipants.length) {
|
|
57
58
|
return null;
|
|
58
59
|
}
|
|
@@ -69,20 +70,20 @@ var CommentAvatarIndicator = ({ onClick, thread }) => {
|
|
|
69
70
|
(0, import_i18n.__)("+%s"),
|
|
70
71
|
overflowCount
|
|
71
72
|
);
|
|
72
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoteIconToolbarSlotFill.Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
74
|
import_components.ToolbarButton,
|
|
74
75
|
{
|
|
75
|
-
className: "
|
|
76
|
+
className: "editor-note-indicator",
|
|
76
77
|
label: (0, import_i18n.__)("View notes"),
|
|
77
78
|
onClick: () => onClick(),
|
|
78
79
|
showTooltip: true,
|
|
79
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "row", align: "center", gap: "xs", children: [
|
|
80
81
|
visibleParticipants.map((participant) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
82
|
"img",
|
|
82
83
|
{
|
|
83
84
|
src: participant.avatar,
|
|
84
85
|
alt: participant.name,
|
|
85
|
-
className: "
|
|
86
|
+
className: "editor-note-indicator__avatar",
|
|
86
87
|
style: {
|
|
87
88
|
borderColor: (0, import_utils.getAvatarBorderColor)(
|
|
88
89
|
participant.id
|
|
@@ -91,10 +92,13 @@ var CommentAvatarIndicator = ({ onClick, thread }) => {
|
|
|
91
92
|
},
|
|
92
93
|
participant.id
|
|
93
94
|
)),
|
|
94
|
-
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "editor-note-indicator__overflow", children: overflowText })
|
|
95
96
|
] })
|
|
96
97
|
}
|
|
97
98
|
) });
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
}
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
NoteAvatarIndicator
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=note-indicator-toolbar.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/collab-sidebar/note-indicator-toolbar.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport { Stack } from '@wordpress/ui';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarBorderColor } from './utils';\n\nconst { NoteIconToolbarSlotFill } = unlock( blockEditorPrivateApis );\n\nexport function NoteAvatarIndicator( { onClick, note } ) {\n\tconst threadParticipants = useMemo( () => {\n\t\tif ( ! note ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst participantsMap = new Map();\n\t\tconst allNotes = [ note, ...note.reply ];\n\n\t\t// Sort by date to show participants in chronological order.\n\t\tallNotes.sort( ( a, b ) => new Date( a.date ) - new Date( b.date ) );\n\n\t\tallNotes.forEach( ( entry ) => {\n\t\t\t// Track thread participants (original author + repliers).\n\t\t\tif ( entry.author_name && entry.author_avatar_urls ) {\n\t\t\t\tif ( ! participantsMap.has( entry.author ) ) {\n\t\t\t\t\tparticipantsMap.set( entry.author, {\n\t\t\t\t\t\tname: entry.author_name,\n\t\t\t\t\t\tavatar:\n\t\t\t\t\t\t\tentry.author_avatar_urls?.[ '48' ] ||\n\t\t\t\t\t\t\tentry.author_avatar_urls?.[ '96' ],\n\t\t\t\t\t\tid: entry.author,\n\t\t\t\t\t\tdate: entry.date,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\treturn Array.from( participantsMap.values() );\n\t}, [ note ] );\n\n\tif ( ! threadParticipants.length ) {\n\t\treturn null;\n\t}\n\n\t// If there are more than 3 participants, show 2 avatars and a \"+n\" number.\n\tconst maxAvatars = 3;\n\tconst isOverflow = threadParticipants.length > maxAvatars;\n\tconst visibleParticipants = isOverflow\n\t\t? threadParticipants.slice( 0, maxAvatars - 1 )\n\t\t: threadParticipants;\n\tconst overflowCount = Math.max(\n\t\t0,\n\t\tthreadParticipants.length - visibleParticipants.length\n\t);\n\tconst threadHasMoreParticipants = threadParticipants.length > 100;\n\n\t// If we hit the note limit, show \"100+\" instead of exact overflow count.\n\tconst overflowText =\n\t\tthreadHasMoreParticipants && overflowCount > 0\n\t\t\t? __( '100+' )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: Number of participants.\n\t\t\t\t\t__( '+%s' ),\n\t\t\t\t\toverflowCount\n\t\t\t );\n\n\treturn (\n\t\t<NoteIconToolbarSlotFill.Fill>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName=\"editor-note-indicator\"\n\t\t\t\tlabel={ __( 'View notes' ) }\n\t\t\t\tonClick={ () => onClick() }\n\t\t\t\tshowTooltip\n\t\t\t>\n\t\t\t\t<Stack direction=\"row\" align=\"center\" gap=\"xs\">\n\t\t\t\t\t{ visibleParticipants.map( ( participant ) => (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tkey={ participant.id }\n\t\t\t\t\t\t\tsrc={ participant.avatar }\n\t\t\t\t\t\t\talt={ participant.name }\n\t\t\t\t\t\t\tclassName=\"editor-note-indicator__avatar\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tborderColor: getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\tparticipant.id\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t\t{ overflowCount > 0 && (\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