@wordpress/editor 14.44.1-next.v.202604201441.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-comment.cjs → add-note.cjs} +28 -41
- package/build/components/collab-sidebar/add-note.cjs.map +7 -0
- package/build/components/collab-sidebar/board-store.cjs +3 -0
- package/build/components/collab-sidebar/board-store.cjs.map +2 -2
- package/build/components/collab-sidebar/floating-container.cjs +4 -3
- package/build/components/collab-sidebar/floating-container.cjs.map +3 -3
- package/build/components/collab-sidebar/hooks.cjs +92 -135
- package/build/components/collab-sidebar/hooks.cjs.map +3 -3
- package/build/components/collab-sidebar/index.cjs +28 -79
- 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} +45 -36
- 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 +23 -25
- package/build/components/collab-sidebar/utils.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/more-menu/index.cjs +3 -2
- 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/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/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-comment.mjs → add-note.mjs} +26 -29
- package/build-module/components/collab-sidebar/add-note.mjs.map +7 -0
- package/build-module/components/collab-sidebar/board-store.mjs +3 -0
- package/build-module/components/collab-sidebar/board-store.mjs.map +2 -2
- package/build-module/components/collab-sidebar/floating-container.mjs +4 -3
- package/build-module/components/collab-sidebar/floating-container.mjs.map +2 -2
- package/build-module/components/collab-sidebar/hooks.mjs +91 -137
- package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs +29 -84
- 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 +19 -21
- package/build-module/components/collab-sidebar/utils.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/more-menu/index.mjs +3 -7
- 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/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/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 +386 -142
- package/build-style/style.css +386 -142
- 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 +1 -0
- package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts +8 -21
- 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 +21 -20
- 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/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} +20 -21
- package/src/components/collab-sidebar/board-store.js +4 -2
- package/src/components/collab-sidebar/floating-container.js +5 -4
- package/src/components/collab-sidebar/hooks.js +115 -175
- package/src/components/collab-sidebar/index.js +35 -95
- 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} +25 -27
- 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 +65 -63
- package/src/components/collab-sidebar/utils.js +33 -35
- package/src/components/document-bar/index.js +4 -4
- 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/more-menu/index.js +3 -7
- 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/postpublish.js +2 -2
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -14
- 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-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/template-actions-panel/classic-theme-content.js +3 -3
- 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.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 -696
- package/build/components/collab-sidebar/comments.cjs.map +0 -7
- 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 -82
- 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 -678
- package/build-module/components/collab-sidebar/comments.mjs.map +0 -7
- package/build-types/components/collab-sidebar/add-comment.d.ts +0 -6
- 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 -9
- 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 -10
- package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
- package/src/components/collab-sidebar/comments.js +0 -812
|
@@ -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\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tdisabled={ isDisabled }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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 && (\n\t\t\t\t\t\t<span className=\"editor-note-indicator__overflow\">\n\t\t\t\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AC/C,QAAM,sBAAsB,aACzB,mBAAmB,MAAO,GAAG,aAAa,CAAE,IAC5C;AACH,QAAM,gBAAgB,KAAK;AAAA,IAC1B;AAAA,IACA,mBAAmB,SAAS,oBAAoB;AAAA,EACjD;AACA,QAAM,4BAA4B,mBAAmB,SAAS;AAG9D,QAAM,eACL,6BAA6B,gBAAgB,QAC1C,gBAAI,MAAO,QACX;AAAA;AAAA,QAEA,gBAAI,KAAM;AAAA,IACV;AAAA,EACA;AAEJ,SACC,4CAAC,wBAAwB,MAAxB,EACA;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,WAAQ,gBAAI,YAAa;AAAA,MACzB,SAAU,MAAM,QAAQ;AAAA,MACxB,aAAW;AAAA,MAEX,uDAAC,mBAAM,WAAU,OAAM,OAAM,UAAS,KAAI,MACvC;AAAA,4BAAoB,IAAK,CAAE,gBAC5B;AAAA,UAAC;AAAA;AAAA,YAEA,KAAM,YAAY;AAAA,YAClB,KAAM,YAAY;AAAA,YAClB,WAAU;AAAA,YACV,OAAQ;AAAA,cACP,iBAAa;AAAA,gBACZ,YAAY;AAAA,cACb;AAAA,YACD;AAAA;AAAA,UARM,YAAY;AAAA,QASnB,CACC;AAAA,QACA,gBAAgB,KACjB,4CAAC,UAAK,WAAU,mCACb,wBACH;AAAA,SAEF;AAAA;AAAA,EACD,GACD;AAEF;",
|
|
6
|
+
"names": ["blockEditorPrivateApis"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/collab-sidebar/note-thread.js
|
|
31
|
+
var note_thread_exports = {};
|
|
32
|
+
__export(note_thread_exports, {
|
|
33
|
+
NoteThread: () => NoteThread
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(note_thread_exports);
|
|
36
|
+
var import_clsx = __toESM(require("clsx"));
|
|
37
|
+
var import_element = require("@wordpress/element");
|
|
38
|
+
var import_components = require("@wordpress/components");
|
|
39
|
+
var import_ui = require("@wordpress/ui");
|
|
40
|
+
var import_compose = require("@wordpress/compose");
|
|
41
|
+
var import_i18n = require("@wordpress/i18n");
|
|
42
|
+
var import_data = require("@wordpress/data");
|
|
43
|
+
var import_dom = require("@wordpress/dom");
|
|
44
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
45
|
+
var import_add_note = require("./add-note.cjs");
|
|
46
|
+
var import_note = require("./note.cjs");
|
|
47
|
+
var import_note_card = require("./note-card.cjs");
|
|
48
|
+
var import_note_form = require("./note-form.cjs");
|
|
49
|
+
var import_floating_container = require("./floating-container.cjs");
|
|
50
|
+
var import_utils = require("./utils.cjs");
|
|
51
|
+
var import_store = require("../../store/index.cjs");
|
|
52
|
+
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
53
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
+
var { useBlockElement } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
55
|
+
function NoteThread({
|
|
56
|
+
note,
|
|
57
|
+
onEditNote,
|
|
58
|
+
onAddReply,
|
|
59
|
+
onDeleteNote,
|
|
60
|
+
isSelected,
|
|
61
|
+
sidebarRef,
|
|
62
|
+
floating,
|
|
63
|
+
onKeyDown
|
|
64
|
+
}) {
|
|
65
|
+
const isFloating = !!floating;
|
|
66
|
+
const { toggleBlockHighlight, selectBlock, toggleBlockSpotlight } = (0, import_lock_unlock.unlock)(
|
|
67
|
+
(0, import_data.useDispatch)(import_block_editor.store)
|
|
68
|
+
);
|
|
69
|
+
const { selectNote } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_store.store));
|
|
70
|
+
const relatedBlockElement = useBlockElement(note.blockClientId);
|
|
71
|
+
const debouncedToggleBlockHighlight = (0, import_compose.useDebounce)(
|
|
72
|
+
toggleBlockHighlight,
|
|
73
|
+
50
|
|
74
|
+
);
|
|
75
|
+
const floatingRef = (0, import_element.useRef)(null);
|
|
76
|
+
const isKeyboardTabbingRef = (0, import_element.useRef)(false);
|
|
77
|
+
const registerThread = floating?.registerThread;
|
|
78
|
+
const unregisterThread = floating?.unregisterThread;
|
|
79
|
+
(0, import_element.useEffect)(() => {
|
|
80
|
+
const floatingEl = floatingRef.current;
|
|
81
|
+
if (floatingEl && registerThread) {
|
|
82
|
+
registerThread(note.id, relatedBlockElement, floatingEl);
|
|
83
|
+
}
|
|
84
|
+
return () => unregisterThread?.(note.id);
|
|
85
|
+
}, [relatedBlockElement, note.id, registerThread, unregisterThread]);
|
|
86
|
+
const onMouseEnter = () => {
|
|
87
|
+
debouncedToggleBlockHighlight(note.blockClientId, true);
|
|
88
|
+
};
|
|
89
|
+
const onMouseLeave = () => {
|
|
90
|
+
debouncedToggleBlockHighlight(note.blockClientId, false);
|
|
91
|
+
};
|
|
92
|
+
const onFocus = () => {
|
|
93
|
+
toggleBlockHighlight(note.blockClientId, true);
|
|
94
|
+
};
|
|
95
|
+
const onBlur = (event) => {
|
|
96
|
+
if (!document.hasFocus()) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const isNoteFocused = event.relatedTarget?.closest(
|
|
100
|
+
".editor-collab-sidebar-panel__thread"
|
|
101
|
+
);
|
|
102
|
+
const isDialogFocused = event.relatedTarget?.closest('[role="dialog"]');
|
|
103
|
+
const isTabbing = isKeyboardTabbingRef.current;
|
|
104
|
+
if (isNoteFocused && !isTabbing) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (isDialogFocused) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (isTabbing && event.currentTarget.contains(event.relatedTarget)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
toggleBlockHighlight(note.blockClientId, false);
|
|
114
|
+
unselectNote();
|
|
115
|
+
};
|
|
116
|
+
const handleNoteSelect = () => {
|
|
117
|
+
selectNote(note.id);
|
|
118
|
+
toggleBlockSpotlight(note.blockClientId, true);
|
|
119
|
+
if (!!note.blockClientId) {
|
|
120
|
+
selectBlock(note.blockClientId, null);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const unselectNote = () => {
|
|
124
|
+
selectNote(void 0);
|
|
125
|
+
toggleBlockSpotlight(note.blockClientId, false);
|
|
126
|
+
};
|
|
127
|
+
const handleResolve = () => {
|
|
128
|
+
onEditNote({ id: note.id, status: "approved" });
|
|
129
|
+
unselectNote();
|
|
130
|
+
if (isFloating) {
|
|
131
|
+
relatedBlockElement?.focus();
|
|
132
|
+
} else {
|
|
133
|
+
(0, import_utils.focusNoteThread)(note.id, sidebarRef.current);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const allReplies = note?.reply || [];
|
|
137
|
+
const lastReply = allReplies.length > 0 ? allReplies[allReplies.length - 1] : void 0;
|
|
138
|
+
const restReplies = allReplies.length > 0 ? allReplies.slice(0, -1) : [];
|
|
139
|
+
const noteExcerpt = (0, import_utils.getNoteExcerpt)(
|
|
140
|
+
(0, import_dom.__unstableStripHTML)(note.content?.rendered),
|
|
141
|
+
10
|
|
142
|
+
);
|
|
143
|
+
const ariaLabel = !!note.blockClientId ? (0, import_i18n.sprintf)(
|
|
144
|
+
// translators: %s: note excerpt
|
|
145
|
+
(0, import_i18n.__)("Note: %s"),
|
|
146
|
+
noteExcerpt
|
|
147
|
+
) : (0, import_i18n.sprintf)(
|
|
148
|
+
// translators: %s: note excerpt
|
|
149
|
+
(0, import_i18n.__)("Original block deleted. Note: %s"),
|
|
150
|
+
noteExcerpt
|
|
151
|
+
);
|
|
152
|
+
if (isFloating && note.id === "new") {
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
import_add_note.AddNote,
|
|
155
|
+
{
|
|
156
|
+
onSubmit: onAddReply,
|
|
157
|
+
sidebarRef,
|
|
158
|
+
floating: { y: floating.y, ref: floatingRef }
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
163
|
+
import_floating_container.FloatingContainer,
|
|
164
|
+
{
|
|
165
|
+
floating: isFloating ? { y: floating.y, ref: floatingRef } : void 0,
|
|
166
|
+
className: (0, import_clsx.default)("editor-collab-sidebar-panel__thread", {
|
|
167
|
+
"is-selected": isSelected
|
|
168
|
+
}),
|
|
169
|
+
id: `note-thread-${note.id}`,
|
|
170
|
+
gap: "md",
|
|
171
|
+
onClick: handleNoteSelect,
|
|
172
|
+
onMouseEnter,
|
|
173
|
+
onMouseLeave,
|
|
174
|
+
onFocus,
|
|
175
|
+
onBlur,
|
|
176
|
+
onKeyUp: (event) => {
|
|
177
|
+
if (event.key === "Tab") {
|
|
178
|
+
isKeyboardTabbingRef.current = false;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
onKeyDown: (event) => {
|
|
182
|
+
if (event.key === "Tab") {
|
|
183
|
+
isKeyboardTabbingRef.current = true;
|
|
184
|
+
} else {
|
|
185
|
+
onKeyDown(event);
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
tabIndex: 0,
|
|
189
|
+
role: "treeitem",
|
|
190
|
+
"aria-label": ariaLabel,
|
|
191
|
+
"aria-expanded": isSelected,
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
194
|
+
import_components.Button,
|
|
195
|
+
{
|
|
196
|
+
className: "editor-collab-sidebar-panel__skip-to-note",
|
|
197
|
+
variant: "secondary",
|
|
198
|
+
size: "compact",
|
|
199
|
+
onClick: () => {
|
|
200
|
+
(0, import_utils.focusNoteThread)(note.id, sidebarRef.current, "textarea");
|
|
201
|
+
},
|
|
202
|
+
children: (0, import_i18n.__)("Add new reply")
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
!note.blockClientId && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "editor-collab-sidebar-panel__deleted-block-notice", children: (0, import_i18n.__)("Original block deleted.") }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
207
|
+
import_note.Note,
|
|
208
|
+
{
|
|
209
|
+
note,
|
|
210
|
+
isSelected,
|
|
211
|
+
onEditNote,
|
|
212
|
+
onDeleteNote,
|
|
213
|
+
onResolve: handleResolve
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
isSelected && allReplies.map((reply) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
217
|
+
import_note.Note,
|
|
218
|
+
{
|
|
219
|
+
note: reply,
|
|
220
|
+
parentNote: note,
|
|
221
|
+
isSelected,
|
|
222
|
+
onEditNote,
|
|
223
|
+
onDeleteNote
|
|
224
|
+
},
|
|
225
|
+
reply.id
|
|
226
|
+
)),
|
|
227
|
+
!isSelected && restReplies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
import_ui.Stack,
|
|
229
|
+
{
|
|
230
|
+
direction: "row",
|
|
231
|
+
align: "center",
|
|
232
|
+
justify: "space-between",
|
|
233
|
+
className: "editor-collab-sidebar-panel__more-reply-separator",
|
|
234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
235
|
+
import_components.Button,
|
|
236
|
+
{
|
|
237
|
+
size: "compact",
|
|
238
|
+
variant: "tertiary",
|
|
239
|
+
className: "editor-collab-sidebar-panel__more-reply-button",
|
|
240
|
+
onClick: () => {
|
|
241
|
+
selectNote(note.id);
|
|
242
|
+
(0, import_utils.focusNoteThread)(note.id, sidebarRef.current);
|
|
243
|
+
},
|
|
244
|
+
children: (0, import_i18n.sprintf)(
|
|
245
|
+
// translators: %s: number of replies.
|
|
246
|
+
(0, import_i18n._n)(
|
|
247
|
+
"%s more reply",
|
|
248
|
+
"%s more replies",
|
|
249
|
+
restReplies.length
|
|
250
|
+
),
|
|
251
|
+
restReplies.length
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
!isSelected && lastReply && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
258
|
+
import_note.Note,
|
|
259
|
+
{
|
|
260
|
+
note: lastReply,
|
|
261
|
+
parentNote: note,
|
|
262
|
+
isSelected: false,
|
|
263
|
+
onEditNote,
|
|
264
|
+
onDeleteNote
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_note_card.NoteCard, { role: "treeitem", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
268
|
+
import_note_form.NoteForm,
|
|
269
|
+
{
|
|
270
|
+
onSubmit: (inputComment) => {
|
|
271
|
+
if ("approved" === note.status) {
|
|
272
|
+
onEditNote({
|
|
273
|
+
id: note.id,
|
|
274
|
+
status: "hold",
|
|
275
|
+
content: inputComment
|
|
276
|
+
});
|
|
277
|
+
} else {
|
|
278
|
+
onAddReply({
|
|
279
|
+
content: inputComment,
|
|
280
|
+
parent: note.id
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
onCancel: (event) => {
|
|
285
|
+
event.stopPropagation();
|
|
286
|
+
unselectNote();
|
|
287
|
+
(0, import_utils.focusNoteThread)(note.id, sidebarRef.current);
|
|
288
|
+
},
|
|
289
|
+
labels: {
|
|
290
|
+
submit: "approved" === note.status ? (0, import_i18n.__)("Reopen & Reply") : (0, import_i18n.__)("Reply"),
|
|
291
|
+
input: (0, import_i18n.sprintf)(
|
|
292
|
+
// translators: %1$s: note identifier, %2$s: author name
|
|
293
|
+
(0, import_i18n.__)("Reply to note %1$s by %2$s"),
|
|
294
|
+
note.id,
|
|
295
|
+
note.author_name
|
|
296
|
+
)
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
) }),
|
|
300
|
+
!!note.blockClientId && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
301
|
+
import_components.Button,
|
|
302
|
+
{
|
|
303
|
+
className: "editor-collab-sidebar-panel__skip-to-block",
|
|
304
|
+
variant: "secondary",
|
|
305
|
+
size: "compact",
|
|
306
|
+
onClick: (event) => {
|
|
307
|
+
event.stopPropagation();
|
|
308
|
+
relatedBlockElement?.focus();
|
|
309
|
+
},
|
|
310
|
+
children: (0, import_i18n.__)("Back to block")
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
318
|
+
0 && (module.exports = {
|
|
319
|
+
NoteThread
|
|
320
|
+
});
|
|
321
|
+
//# sourceMappingURL=note-thread.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/collab-sidebar/note-thread.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { Button } from '@wordpress/components';\nimport { Stack } from '@wordpress/ui';\nimport { useDebounce } from '@wordpress/compose';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { AddNote } from './add-note';\nimport { Note } from './note';\nimport { NoteCard } from './note-card';\nimport { NoteForm } from './note-form';\nimport { FloatingContainer } from './floating-container';\nimport { focusNoteThread, getNoteExcerpt } from './utils';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useBlockElement } = unlock( blockEditorPrivateApis );\n\nexport function NoteThread( {\n\tnote,\n\tonEditNote,\n\tonAddReply,\n\tonDeleteNote,\n\tisSelected,\n\tsidebarRef,\n\tfloating,\n\tonKeyDown,\n} ) {\n\tconst isFloating = !! floating;\n\tconst { toggleBlockHighlight, selectBlock, toggleBlockSpotlight } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { selectNote } = unlock( useDispatch( editorStore ) );\n\tconst relatedBlockElement = useBlockElement( note.blockClientId );\n\tconst debouncedToggleBlockHighlight = useDebounce(\n\t\ttoggleBlockHighlight,\n\t\t50\n\t);\n\tconst floatingRef = useRef( null );\n\tconst isKeyboardTabbingRef = useRef( false );\n\n\tconst registerThread = floating?.registerThread;\n\tconst unregisterThread = floating?.unregisterThread;\n\n\t// Register block + floating elements with the board.\n\t// The board's ResizeObserver and autoUpdate track changes automatically.\n\tuseEffect( () => {\n\t\tconst floatingEl = floatingRef.current;\n\t\tif ( floatingEl && registerThread ) {\n\t\t\tregisterThread( note.id, relatedBlockElement, floatingEl );\n\t\t}\n\t\treturn () => unregisterThread?.( note.id );\n\t}, [ relatedBlockElement, note.id, registerThread, unregisterThread ] );\n\n\tconst onMouseEnter = () => {\n\t\tdebouncedToggleBlockHighlight( note.blockClientId, true );\n\t};\n\n\tconst onMouseLeave = () => {\n\t\tdebouncedToggleBlockHighlight( note.blockClientId, false );\n\t};\n\n\tconst onFocus = () => {\n\t\ttoggleBlockHighlight( note.blockClientId, true );\n\t};\n\n\tconst onBlur = ( event ) => {\n\t\t// Don't deselect notes when the browser window/tab loses focus.\n\t\tif ( ! document.hasFocus() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isNoteFocused = event.relatedTarget?.closest(\n\t\t\t'.editor-collab-sidebar-panel__thread'\n\t\t);\n\t\tconst isDialogFocused =\n\t\t\tevent.relatedTarget?.closest( '[role=\"dialog\"]' );\n\t\tconst isTabbing = isKeyboardTabbingRef.current;\n\n\t\t// When another note is clicked, do nothing because the current note is automatically closed.\n\t\tif ( isNoteFocused && ! isTabbing ) {\n\t\t\treturn;\n\t\t}\n\t\t// When deleting a note, a dialog appears, but the note should not be collapsed.\n\t\tif ( isDialogFocused ) {\n\t\t\treturn;\n\t\t}\n\t\t// When tabbing, do nothing if the focus is within the current note.\n\t\tif (\n\t\t\tisTabbing &&\n\t\t\tevent.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Closes a note that has lost focus when any of the following conditions are met:\n\t\t// - An element other than a note is clicked.\n\t\t// - Focus was lost by tabbing.\n\t\ttoggleBlockHighlight( note.blockClientId, false );\n\t\tunselectNote();\n\t};\n\n\tconst handleNoteSelect = () => {\n\t\tselectNote( note.id );\n\t\ttoggleBlockSpotlight( note.blockClientId, true );\n\t\tif ( !! note.blockClientId ) {\n\t\t\t// Pass `null` as the second parameter to prevent focusing the block.\n\t\t\tselectBlock( note.blockClientId, null );\n\t\t}\n\t};\n\n\tconst unselectNote = () => {\n\t\tselectNote( undefined );\n\t\ttoggleBlockSpotlight( note.blockClientId, false );\n\t};\n\n\tconst handleResolve = () => {\n\t\tonEditNote( { id: note.id, status: 'approved' } );\n\t\tunselectNote();\n\t\tif ( isFloating ) {\n\t\t\trelatedBlockElement?.focus();\n\t\t} else {\n\t\t\tfocusNoteThread( note.id, sidebarRef.current );\n\t\t}\n\t};\n\n\tconst allReplies = note?.reply || [];\n\tconst lastReply =\n\t\tallReplies.length > 0 ? allReplies[ allReplies.length - 1 ] : undefined;\n\tconst restReplies = allReplies.length > 0 ? allReplies.slice( 0, -1 ) : [];\n\n\tconst noteExcerpt = getNoteExcerpt(\n\t\tstripHTML( note.content?.rendered ),\n\t\t10\n\t);\n\tconst ariaLabel = !! note.blockClientId\n\t\t? sprintf(\n\t\t\t\t// translators: %s: note excerpt\n\t\t\t\t__( 'Note: %s' ),\n\t\t\t\tnoteExcerpt\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %s: note excerpt\n\t\t\t\t__( 'Original block deleted. Note: %s' ),\n\t\t\t\tnoteExcerpt\n\t\t );\n\n\tif ( isFloating && note.id === 'new' ) {\n\t\treturn (\n\t\t\t<AddNote\n\t\t\t\tonSubmit={ onAddReply }\n\t\t\t\tsidebarRef={ sidebarRef }\n\t\t\t\tfloating={ { y: floating.y, ref: floatingRef } }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FloatingContainer\n\t\t\tfloating={\n\t\t\t\tisFloating ? { y: floating.y, ref: floatingRef } : undefined\n\t\t\t}\n\t\t\tclassName={ clsx( 'editor-collab-sidebar-panel__thread', {\n\t\t\t\t'is-selected': isSelected,\n\t\t\t} ) }\n\t\t\tid={ `note-thread-${ note.id }` }\n\t\t\tgap=\"md\"\n\t\t\tonClick={ handleNoteSelect }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onFocus }\n\t\t\tonBlur={ onBlur }\n\t\t\tonKeyUp={ ( event ) => {\n\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\tisKeyboardTabbingRef.current = false;\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\tisKeyboardTabbingRef.current = true;\n\t\t\t\t} else {\n\t\t\t\t\tonKeyDown( event );\n\t\t\t\t}\n\t\t\t} }\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"treeitem\"\n\t\t\taria-label={ ariaLabel }\n\t\t\taria-expanded={ isSelected }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__skip-to-note\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tsize=\"compact\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tfocusNoteThread( note.id, sidebarRef.current, 'textarea' );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Add new reply' ) }\n\t\t\t</Button>\n\t\t\t{ ! note.blockClientId && (\n\t\t\t\t<p className=\"editor-collab-sidebar-panel__deleted-block-notice\">\n\t\t\t\t\t{ __( 'Original block deleted.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t<Note\n\t\t\t\tnote={ note }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tonEditNote={ onEditNote }\n\t\t\t\tonDeleteNote={ onDeleteNote }\n\t\t\t\tonResolve={ handleResolve }\n\t\t\t/>\n\t\t\t{ isSelected &&\n\t\t\t\tallReplies.map( ( reply ) => (\n\t\t\t\t\t<Note\n\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\tnote={ reply }\n\t\t\t\t\t\tparentNote={ note }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonEditNote={ onEditNote }\n\t\t\t\t\t\tonDeleteNote={ onDeleteNote }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t{ ! isSelected && restReplies.length > 0 && (\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tjustify=\"space-between\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__more-reply-separator\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__more-reply-button\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tselectNote( note.id );\n\t\t\t\t\t\t\tfocusNoteThread( note.id, sidebarRef.current );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: number of replies.\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%s more reply',\n\t\t\t\t\t\t\t\t'%s more replies',\n\t\t\t\t\t\t\t\trestReplies.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\trestReplies.length\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Button>\n\t\t\t\t</Stack>\n\t\t\t) }\n\t\t\t{ ! isSelected && lastReply && (\n\t\t\t\t<Note\n\t\t\t\t\tnote={ lastReply }\n\t\t\t\t\tparentNote={ note }\n\t\t\t\t\tisSelected={ false }\n\t\t\t\t\tonEditNote={ onEditNote }\n\t\t\t\t\tonDeleteNote={ onDeleteNote }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isSelected && (\n\t\t\t\t<NoteCard role=\"treeitem\">\n\t\t\t\t\t<NoteForm\n\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\tif ( 'approved' === note.status ) {\n\t\t\t\t\t\t\t\t// For reopening, include the content in the reopen action.\n\t\t\t\t\t\t\t\tonEditNote( {\n\t\t\t\t\t\t\t\t\tid: note.id,\n\t\t\t\t\t\t\t\t\tstatus: 'hold',\n\t\t\t\t\t\t\t\t\tcontent: inputComment,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// For regular replies, add as separate comment.\n\t\t\t\t\t\t\t\tonAddReply( {\n\t\t\t\t\t\t\t\t\tcontent: inputComment,\n\t\t\t\t\t\t\t\t\tparent: note.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\tonCancel={ ( event ) => {\n\t\t\t\t\t\t\t// Prevent the parent onClick from being triggered.\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tunselectNote();\n\t\t\t\t\t\t\tfocusNoteThread( note.id, sidebarRef.current );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\tsubmit:\n\t\t\t\t\t\t\t\t'approved' === note.status\n\t\t\t\t\t\t\t\t\t? __( 'Reopen & Reply' )\n\t\t\t\t\t\t\t\t\t: __( 'Reply' ),\n\t\t\t\t\t\t\tinput: sprintf(\n\t\t\t\t\t\t\t\t// translators: %1$s: note identifier, %2$s: author name\n\t\t\t\t\t\t\t\t__( 'Reply to note %1$s by %2$s' ),\n\t\t\t\t\t\t\t\tnote.id,\n\t\t\t\t\t\t\t\tnote.author_name\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</NoteCard>\n\t\t\t) }\n\t\t\t{ !! note.blockClientId && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__skip-to-block\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\trelatedBlockElement?.focus();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back to block' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</FloatingContainer>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAkC;AAClC,wBAAuB;AACvB,gBAAsB;AACtB,qBAA4B;AAC5B,kBAAgC;AAChC,kBAA4B;AAC5B,iBAAiD;AACjD,0BAGO;AAKP,sBAAwB;AACxB,kBAAqB;AACrB,uBAAyB;AACzB,uBAAyB;AACzB,gCAAkC;AAClC,mBAAgD;AAChD,mBAAqC;AACrC,yBAAuB;AAuIpB;AArIH,IAAM,EAAE,gBAAgB,QAAI,2BAAQ,oBAAAA,WAAuB;AAEpD,SAAS,WAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,aAAa,CAAC,CAAE;AACtB,QAAM,EAAE,sBAAsB,aAAa,qBAAqB,QAAI;AAAA,QACnE,yBAAa,oBAAAC,KAAiB;AAAA,EAC/B;AACA,QAAM,EAAE,WAAW,QAAI,+BAAQ,yBAAa,aAAAC,KAAY,CAAE;AAC1D,QAAM,sBAAsB,gBAAiB,KAAK,aAAc;AAChE,QAAM,oCAAgC;AAAA,IACrC;AAAA,IACA;AAAA,EACD;AACA,QAAM,kBAAc,uBAAQ,IAAK;AACjC,QAAM,2BAAuB,uBAAQ,KAAM;AAE3C,QAAM,iBAAiB,UAAU;AACjC,QAAM,mBAAmB,UAAU;AAInC,gCAAW,MAAM;AAChB,UAAM,aAAa,YAAY;AAC/B,QAAK,cAAc,gBAAiB;AACnC,qBAAgB,KAAK,IAAI,qBAAqB,UAA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