@wordpress/editor 14.40.2-next.v.202602241322.0 → 14.40.2
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 +6 -0
- package/build/components/collab-sidebar/index.cjs +7 -4
- package/build/components/collab-sidebar/index.cjs.map +2 -2
- package/build/components/collab-sidebar/utils.cjs +13 -15
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/avatar-iframe-styles.cjs +141 -0
- package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +7 -0
- package/build/components/collaborators-overlay/collaborator-styles.cjs +38 -2
- package/build/components/collaborators-overlay/collaborator-styles.cjs.map +2 -2
- package/build/components/collaborators-overlay/compute-selection.cjs +185 -0
- package/build/components/collaborators-overlay/compute-selection.cjs.map +7 -0
- package/build/components/collaborators-overlay/cursor-dom-utils.cjs +243 -0
- package/build/components/collaborators-overlay/cursor-dom-utils.cjs.map +7 -0
- package/build/components/collaborators-overlay/cursor-registry.cjs +86 -0
- package/build/components/collaborators-overlay/cursor-registry.cjs.map +7 -0
- package/build/components/collaborators-overlay/index.cjs +7 -2
- package/build/components/collaborators-overlay/index.cjs.map +2 -2
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +148 -0
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +7 -0
- package/build/components/collaborators-overlay/overlay.cjs +146 -236
- package/build/components/collaborators-overlay/overlay.cjs.map +3 -3
- package/build/components/collaborators-overlay/timing-utils.cjs +46 -0
- package/build/components/collaborators-overlay/timing-utils.cjs.map +7 -0
- package/build/components/collaborators-overlay/use-block-highlighting.cjs +91 -42
- package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +2 -2
- package/build/components/collaborators-overlay/use-debounced-recompute.cjs +49 -0
- package/build/components/collaborators-overlay/use-debounced-recompute.cjs.map +7 -0
- package/build/components/collaborators-overlay/use-render-cursors.cjs +82 -172
- package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
- package/build/components/collaborators-presence/avatar/component.cjs +121 -0
- package/build/components/collaborators-presence/avatar/component.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar/index.cjs +37 -0
- package/build/components/collaborators-presence/avatar/index.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar/types.cjs +19 -0
- package/build/components/collaborators-presence/avatar/types.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs +44 -0
- package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar-group/component.cjs +78 -0
- package/build/components/collaborators-presence/avatar-group/component.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar-group/index.cjs +37 -0
- package/build/components/collaborators-presence/avatar-group/index.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar-group/types.cjs +19 -0
- package/build/components/collaborators-presence/avatar-group/types.cjs.map +7 -0
- package/build/components/collaborators-presence/index.cjs +66 -19
- package/build/components/collaborators-presence/index.cjs.map +3 -3
- package/build/components/collaborators-presence/list.cjs +60 -38
- package/build/components/collaborators-presence/list.cjs.map +3 -3
- package/build/components/collaborators-presence/use-collaborator-notifications.cjs +149 -0
- package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +7 -0
- package/build/components/editor-interface/index.cjs +11 -6
- package/build/components/editor-interface/index.cjs.map +2 -2
- package/build/components/inserter-sidebar/index.cjs +2 -1
- package/build/components/inserter-sidebar/index.cjs.map +2 -2
- package/build/components/post-last-revision/index.cjs +27 -6
- package/build/components/post-last-revision/index.cjs.map +2 -2
- package/build/components/post-locked-modal/index.cjs +49 -17
- package/build/components/post-locked-modal/index.cjs.map +3 -3
- package/build/components/post-revisions-preview/block-diff.cjs +130 -34
- package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
- package/build/components/post-revisions-preview/diff-markers.cjs +6 -5
- package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-canvas.cjs +16 -60
- package/build/components/post-revisions-preview/revisions-canvas.cjs.map +3 -3
- package/build/components/post-revisions-preview/revisions-header.cjs +33 -26
- package/build/components/post-revisions-preview/revisions-header.cjs.map +3 -3
- package/build/components/post-revisions-preview/revisions-slider.cjs +104 -39
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +3 -3
- package/build/components/preferences-modal/index.cjs +36 -4
- package/build/components/preferences-modal/index.cjs.map +2 -2
- package/build/components/provider/disable-non-page-content-blocks.cjs +31 -28
- package/build/components/provider/disable-non-page-content-blocks.cjs.map +3 -3
- package/build/components/provider/index.cjs +17 -5
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-block-editor-settings.cjs +20 -4
- package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
- package/build/components/provider/{use-post-content-blocks.cjs → use-post-content-block-types.cjs} +8 -19
- package/build/components/provider/use-post-content-block-types.cjs.map +7 -0
- package/build/components/provider/use-revision-blocks.cjs +106 -0
- package/build/components/provider/use-revision-blocks.cjs.map +7 -0
- package/build/components/revision-block-diff/index.cjs +61 -0
- package/build/components/revision-block-diff/index.cjs.map +7 -0
- package/build/components/revision-diff-panel/index.cjs +68 -0
- package/build/components/revision-diff-panel/index.cjs.map +7 -0
- package/build/components/revision-fields-diff/index.cjs +96 -0
- package/build/components/revision-fields-diff/index.cjs.map +7 -0
- package/build/components/sidebar/header.cjs +1 -1
- package/build/components/sidebar/header.cjs.map +2 -2
- package/build/components/sidebar/index.cjs +7 -1
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/style-book/index.cjs +4 -3
- package/build/components/style-book/index.cjs.map +2 -2
- package/build/components/sync-connection-error-modal/index.cjs +187 -0
- package/build/components/sync-connection-error-modal/index.cjs.map +7 -0
- package/build/components/sync-connection-error-modal/use-retry-countdown.cjs +84 -0
- package/build/components/sync-connection-error-modal/use-retry-countdown.cjs.map +7 -0
- package/build/components/template-content-panel/index.cjs +35 -31
- package/build/components/template-content-panel/index.cjs.map +3 -3
- 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 +6 -15
- package/build/components/visual-editor/index.cjs.map +2 -2
- package/build/store/private-actions.cjs +46 -2
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +156 -21
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +27 -0
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +0 -14
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/media-finalize/index.cjs +43 -0
- package/build/utils/media-finalize/index.cjs.map +7 -0
- package/build/utils/media-upload/on-success.cjs +46 -0
- package/build/utils/media-upload/on-success.cjs.map +7 -0
- package/build/utils/sync-error-messages.cjs +32 -15
- package/build/utils/sync-error-messages.cjs.map +3 -3
- package/build-module/components/collab-sidebar/index.mjs +7 -4
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/utils.mjs +13 -15
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs +128 -0
- package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/collaborator-styles.mjs +25 -1
- package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/compute-selection.mjs +166 -0
- package/build-module/components/collaborators-overlay/compute-selection.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs +213 -0
- package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/cursor-registry.mjs +61 -0
- package/build-module/components/collaborators-overlay/cursor-registry.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/index.mjs +7 -2
- package/build-module/components/collaborators-overlay/index.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +130 -0
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/overlay.mjs +137 -237
- package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/timing-utils.mjs +21 -0
- package/build-module/components/collaborators-overlay/timing-utils.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +93 -45
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs +24 -0
- package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs +83 -176
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
- package/build-module/components/collaborators-presence/avatar/component.mjs +90 -0
- package/build-module/components/collaborators-presence/avatar/component.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar/index.mjs +6 -0
- package/build-module/components/collaborators-presence/avatar/index.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar/types.mjs +1 -0
- package/build-module/components/collaborators-presence/avatar/types.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs +19 -0
- package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar-group/component.mjs +47 -0
- package/build-module/components/collaborators-presence/avatar-group/component.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar-group/index.mjs +6 -0
- package/build-module/components/collaborators-presence/avatar-group/index.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar-group/types.mjs +1 -0
- package/build-module/components/collaborators-presence/avatar-group/types.mjs.map +7 -0
- package/build-module/components/collaborators-presence/index.mjs +57 -23
- package/build-module/components/collaborators-presence/index.mjs.map +2 -2
- package/build-module/components/collaborators-presence/list.mjs +52 -44
- package/build-module/components/collaborators-presence/list.mjs.map +2 -2
- package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +126 -0
- package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +7 -0
- package/build-module/components/editor-interface/index.mjs +12 -7
- package/build-module/components/editor-interface/index.mjs.map +2 -2
- package/build-module/components/inserter-sidebar/index.mjs +2 -1
- package/build-module/components/inserter-sidebar/index.mjs.map +2 -2
- package/build-module/components/post-last-revision/index.mjs +27 -6
- package/build-module/components/post-last-revision/index.mjs.map +2 -2
- package/build-module/components/post-locked-modal/index.mjs +49 -17
- package/build-module/components/post-locked-modal/index.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/block-diff.mjs +130 -34
- package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/diff-markers.mjs +6 -5
- package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs +18 -65
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-header.mjs +36 -33
- package/build-module/components/post-revisions-preview/revisions-header.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +112 -42
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/components/preferences-modal/index.mjs +36 -4
- package/build-module/components/preferences-modal/index.mjs.map +2 -2
- package/build-module/components/provider/disable-non-page-content-blocks.mjs +31 -28
- package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +17 -5
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +20 -4
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/provider/use-post-content-block-types.mjs +23 -0
- package/build-module/components/provider/use-post-content-block-types.mjs.map +7 -0
- package/build-module/components/provider/use-revision-blocks.mjs +81 -0
- package/build-module/components/provider/use-revision-blocks.mjs.map +7 -0
- package/build-module/components/revision-block-diff/index.mjs +30 -0
- package/build-module/components/revision-block-diff/index.mjs.map +7 -0
- package/build-module/components/revision-diff-panel/index.mjs +37 -0
- package/build-module/components/revision-diff-panel/index.mjs.map +7 -0
- package/build-module/components/revision-fields-diff/index.mjs +65 -0
- package/build-module/components/revision-fields-diff/index.mjs.map +7 -0
- package/build-module/components/sidebar/header.mjs +1 -1
- package/build-module/components/sidebar/header.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +7 -1
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/style-book/index.mjs +4 -3
- package/build-module/components/style-book/index.mjs.map +2 -2
- package/build-module/components/sync-connection-error-modal/index.mjs +170 -0
- package/build-module/components/sync-connection-error-modal/index.mjs.map +7 -0
- package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs +59 -0
- package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs.map +7 -0
- package/build-module/components/template-content-panel/index.mjs +25 -31
- package/build-module/components/template-content-panel/index.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 +6 -15
- package/build-module/components/visual-editor/index.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +44 -2
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +155 -21
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +25 -0
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +0 -13
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/media-finalize/index.mjs +12 -0
- package/build-module/utils/media-finalize/index.mjs.map +7 -0
- package/build-module/utils/media-upload/on-success.mjs +25 -0
- package/build-module/utils/media-upload/on-success.mjs.map +7 -0
- package/build-module/utils/sync-error-messages.mjs +27 -15
- package/build-module/utils/sync-error-messages.mjs.map +3 -3
- package/build-style/style-rtl.css +388 -132
- package/build-style/style.css +388 -132
- package/build-types/components/autocompleters/link.d.ts +8 -0
- package/build-types/components/autocompleters/link.d.ts.map +1 -0
- 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/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-byline.d.ts +10 -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.map +1 -1
- package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts +11 -0
- package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/collaborator-styles.d.ts +17 -2
- package/build-types/components/collaborators-overlay/collaborator-styles.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/compute-selection.d.ts +24 -0
- package/build-types/components/collaborators-overlay/compute-selection.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts +72 -0
- package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts +36 -0
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/index.d.ts +7 -4
- package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +6 -0
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/overlay.d.ts +4 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/timing-utils.d.ts +11 -0
- package/build-types/components/collaborators-overlay/timing-utils.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +21 -5
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts +10 -0
- package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts +6 -1
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/avatar/component.d.ts +7 -0
- package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar/index.d.ts +3 -0
- package/build-types/components/collaborators-presence/avatar/index.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar/types.d.ts +66 -0
- package/build-types/components/collaborators-presence/avatar/types.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts +17 -0
- package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar-group/component.d.ts +7 -0
- package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar-group/index.d.ts +3 -0
- package/build-types/components/collaborators-presence/avatar-group/index.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar-group/types.d.ts +14 -0
- package/build-types/components/collaborators-presence/avatar-group/types.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/list.d.ts +6 -2
- package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts +9 -0
- package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -0
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/media/media-editor-modal.d.ts +15 -0
- package/build-types/components/media/media-editor-modal.d.ts.map +1 -0
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-panel/index.d.ts +2 -0
- package/build-types/components/post-revisions-panel/index.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +2 -5
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-header.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts +1 -1
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
- package/build-types/components/post-text-editor/utils.d.ts +29 -0
- package/build-types/components/post-text-editor/utils.d.ts.map +1 -0
- package/build-types/components/provider/disable-non-page-content-blocks.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-network-reconnect.d.ts +8 -0
- package/build-types/components/provider/use-network-reconnect.d.ts.map +1 -0
- package/build-types/components/provider/use-post-content-block-types.d.ts +9 -0
- package/build-types/components/provider/use-post-content-block-types.d.ts.map +1 -0
- package/build-types/components/provider/use-revision-blocks.d.ts +10 -0
- package/build-types/components/provider/use-revision-blocks.d.ts.map +1 -0
- package/build-types/components/revision-block-diff/index.d.ts +6 -0
- package/build-types/components/revision-block-diff/index.d.ts.map +1 -0
- package/build-types/components/revision-diff-panel/index.d.ts +14 -0
- package/build-types/components/revision-diff-panel/index.d.ts.map +1 -0
- package/build-types/components/revision-fields-diff/index.d.ts +6 -0
- package/build-types/components/revision-fields-diff/index.d.ts.map +1 -0
- package/build-types/components/sidebar/dataform-post-summary.d.ts +4 -0
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-revision-summary.d.ts +2 -0
- package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -0
- package/build-types/components/style-book/index.d.ts +2 -1
- package/build-types/components/style-book/index.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/index.d.ts +8 -0
- package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -0
- package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts +11 -0
- package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/block-theme-content.d.ts +2 -0
- package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts +2 -0
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/index.d.ts +2 -0
- package/build-types/components/template-actions-panel/index.d.ts.map +1 -0
- package/build-types/components/template-content-panel/index.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/upload-progress-snackbar/index.d.ts +19 -0
- package/build-types/components/upload-progress-snackbar/index.d.ts.map +1 -0
- package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts +28 -0
- package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts.map +1 -0
- package/build-types/components/upload-progress-snackbar/tracker.d.ts +41 -0
- package/build-types/components/upload-progress-snackbar/tracker.d.ts.map +1 -0
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +12 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +45 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +21 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +0 -10
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/media-delete/index.d.ts +2 -0
- package/build-types/utils/media-delete/index.d.ts.map +1 -0
- package/build-types/utils/media-finalize/index.d.ts +2 -0
- package/build-types/utils/media-finalize/index.d.ts.map +1 -0
- package/build-types/utils/media-upload/on-success.d.ts +9 -0
- package/build-types/utils/media-upload/on-success.d.ts.map +1 -0
- package/build-types/utils/sync-error-messages.d.ts +17 -3
- package/build-types/utils/sync-error-messages.d.ts.map +1 -1
- package/package.json +45 -44
- package/src/components/collab-sidebar/index.js +7 -4
- package/src/components/collab-sidebar/utils.js +9 -10
- package/src/components/collaborators-overlay/avatar-iframe-styles.ts +134 -0
- package/src/components/collaborators-overlay/collaborator-styles.ts +43 -2
- package/src/components/collaborators-overlay/compute-selection.ts +315 -0
- package/src/components/collaborators-overlay/cursor-dom-utils.ts +382 -0
- package/src/components/collaborators-overlay/cursor-registry.ts +96 -0
- package/src/components/collaborators-overlay/index.tsx +12 -4
- package/src/components/collaborators-overlay/overlay-iframe-styles.ts +131 -0
- package/src/components/collaborators-overlay/overlay.tsx +145 -229
- package/src/components/collaborators-overlay/timing-utils.ts +30 -0
- package/src/components/collaborators-overlay/use-block-highlighting.ts +152 -64
- package/src/components/collaborators-overlay/use-debounced-recompute.ts +32 -0
- package/src/components/collaborators-overlay/use-render-cursors.ts +120 -282
- package/src/components/collaborators-presence/avatar/component.tsx +123 -0
- package/src/components/collaborators-presence/avatar/index.ts +2 -0
- package/src/components/collaborators-presence/avatar/styles.scss +184 -0
- package/src/components/collaborators-presence/avatar/test/index.tsx +389 -0
- package/src/components/collaborators-presence/avatar/types.ts +66 -0
- package/src/components/collaborators-presence/avatar/use-image-loading-status.ts +36 -0
- package/src/components/collaborators-presence/avatar-group/component.tsx +55 -0
- package/src/components/collaborators-presence/avatar-group/index.ts +2 -0
- package/src/components/collaborators-presence/avatar-group/styles.scss +33 -0
- package/src/components/collaborators-presence/avatar-group/test/index.tsx +139 -0
- package/src/components/collaborators-presence/avatar-group/types.ts +13 -0
- package/src/components/collaborators-presence/index.tsx +43 -12
- package/src/components/collaborators-presence/list.tsx +68 -40
- package/src/components/collaborators-presence/styles/collaborators-list.scss +26 -19
- package/src/components/collaborators-presence/styles/collaborators-presence.scss +6 -2
- package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +397 -0
- package/src/components/collaborators-presence/use-collaborator-notifications.ts +203 -0
- package/src/components/document-bar/style.scss +1 -1
- package/src/components/editor-interface/index.js +13 -6
- package/src/components/inserter-sidebar/index.js +4 -1
- package/src/components/post-last-revision/index.js +35 -6
- package/src/components/post-last-revision/style.scss +0 -3
- package/src/components/post-locked-modal/index.js +69 -25
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-revisions-preview/block-diff.js +224 -61
- package/src/components/post-revisions-preview/diff-markers.js +15 -12
- package/src/components/post-revisions-preview/revisions-canvas.js +23 -86
- package/src/components/post-revisions-preview/revisions-header.js +35 -37
- package/src/components/post-revisions-preview/revisions-slider.js +138 -62
- package/src/components/post-revisions-preview/style.scss +3 -3
- package/src/components/post-revisions-preview/test/block-diff.js +202 -35
- package/src/components/preferences-modal/index.js +37 -7
- package/src/components/provider/disable-non-page-content-blocks.js +42 -40
- package/src/components/provider/index.js +20 -2
- package/src/components/provider/use-block-editor-settings.js +21 -1
- package/src/components/provider/use-post-content-block-types.js +30 -0
- package/src/components/provider/use-revision-blocks.js +105 -0
- package/src/components/revision-block-diff/index.js +39 -0
- package/src/components/revision-diff-panel/index.js +59 -0
- package/src/components/revision-diff-panel/style.scss +13 -0
- package/src/components/revision-fields-diff/index.js +91 -0
- package/src/components/sidebar/header.js +1 -1
- package/src/components/sidebar/index.js +4 -0
- package/src/components/style-book/index.js +4 -2
- package/src/components/sync-connection-error-modal/index.tsx +253 -0
- package/src/components/sync-connection-error-modal/style.scss +14 -0
- package/src/components/sync-connection-error-modal/use-retry-countdown.ts +93 -0
- package/src/components/template-content-panel/index.js +30 -38
- package/src/components/template-part-menu-items/convert-to-regular.js +74 -12
- package/src/components/visual-editor/index.js +6 -23
- package/src/store/private-actions.js +70 -1
- package/src/store/private-selectors.js +216 -28
- package/src/store/reducer.js +41 -0
- package/src/store/selectors.js +0 -19
- package/src/style.scss +4 -1
- package/src/utils/media-finalize/index.js +11 -0
- package/src/utils/media-finalize/test/index.js +34 -0
- package/src/utils/media-upload/on-success.js +34 -0
- package/src/utils/sync-error-messages.ts +72 -0
- package/src/utils/test/sync-error-messages.js +34 -0
- package/build/components/provider/use-post-content-blocks.cjs.map +0 -7
- package/build/components/sync-connection-modal/index.cjs +0 -130
- package/build/components/sync-connection-modal/index.cjs.map +0 -7
- package/build-module/components/provider/use-post-content-blocks.mjs +0 -34
- package/build-module/components/provider/use-post-content-blocks.mjs.map +0 -7
- package/build-module/components/sync-connection-modal/index.mjs +0 -114
- package/build-module/components/sync-connection-modal/index.mjs.map +0 -7
- package/build-types/components/provider/use-post-content-blocks.d.ts +0 -2
- package/build-types/components/provider/use-post-content-blocks.d.ts.map +0 -1
- package/build-types/components/sync-connection-modal/index.d.ts +0 -8
- package/build-types/components/sync-connection-modal/index.d.ts.map +0 -1
- package/src/components/provider/use-post-content-blocks.js +0 -42
- package/src/components/sync-connection-modal/index.js +0 -140
- package/src/components/sync-connection-modal/style.scss +0 -11
- package/src/utils/sync-error-messages.js +0 -53
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Children } from '@wordpress/element';
|
|
10
|
+
import { sprintf, _n } from '@wordpress/i18n';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import type { AvatarGroupProps } from './types';
|
|
16
|
+
|
|
17
|
+
function AvatarGroup( {
|
|
18
|
+
className,
|
|
19
|
+
max = 3,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}: AvatarGroupProps &
|
|
23
|
+
Omit< React.HTMLAttributes< HTMLDivElement >, keyof AvatarGroupProps > ) {
|
|
24
|
+
const childArray = Children.toArray( children );
|
|
25
|
+
const visible = childArray.slice( 0, max );
|
|
26
|
+
const overflowCount = childArray.length - max;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
role="group"
|
|
31
|
+
className={ clsx( 'editor-avatar-group', className ) }
|
|
32
|
+
{ ...props }
|
|
33
|
+
>
|
|
34
|
+
{ visible }
|
|
35
|
+
{ overflowCount > 0 && (
|
|
36
|
+
<span
|
|
37
|
+
className="editor-avatar-group__overflow"
|
|
38
|
+
aria-label={ sprintf(
|
|
39
|
+
/* translators: %d: number of additional collaborators not shown */
|
|
40
|
+
_n(
|
|
41
|
+
'%d more collaborator',
|
|
42
|
+
'%d more collaborators',
|
|
43
|
+
overflowCount
|
|
44
|
+
),
|
|
45
|
+
overflowCount
|
|
46
|
+
) }
|
|
47
|
+
>
|
|
48
|
+
{ `+${ overflowCount }` }
|
|
49
|
+
</span>
|
|
50
|
+
) }
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default AvatarGroup;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/colors" as *;
|
|
2
|
+
@use "@wordpress/base-styles/variables" as *;
|
|
3
|
+
|
|
4
|
+
.editor-avatar-group {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
|
|
8
|
+
// Overlap subsequent avatars.
|
|
9
|
+
> .editor-avatar + .editor-avatar {
|
|
10
|
+
margin-inline-start: -$grid-unit-10;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Stack earlier avatars on top of later ones so the overlap
|
|
14
|
+
// is visually correct, and elevate on hover for badge expansion.
|
|
15
|
+
> .editor-avatar {
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
@for $i from 1 through 10 {
|
|
19
|
+
&:nth-child(#{$i}) {
|
|
20
|
+
z-index: #{11 - $i};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.editor-avatar-group__overflow {
|
|
27
|
+
margin-inline-start: $grid-unit-05;
|
|
28
|
+
margin-inline-end: $grid-unit-05;
|
|
29
|
+
font-size: $font-size-small;
|
|
30
|
+
line-height: $font-line-height-small;
|
|
31
|
+
color: $gray-900;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import AvatarGroup from '..';
|
|
10
|
+
import Avatar from '../../avatar';
|
|
11
|
+
|
|
12
|
+
describe( 'AvatarGroup', () => {
|
|
13
|
+
it( 'should render all children when count is within max', () => {
|
|
14
|
+
render(
|
|
15
|
+
<AvatarGroup>
|
|
16
|
+
<Avatar name="Alice" />
|
|
17
|
+
<Avatar name="Bob" />
|
|
18
|
+
</AvatarGroup>
|
|
19
|
+
);
|
|
20
|
+
expect(
|
|
21
|
+
screen.getByRole( 'img', { name: 'Alice' } )
|
|
22
|
+
).toBeInTheDocument();
|
|
23
|
+
expect(
|
|
24
|
+
screen.getByRole( 'img', { name: 'Bob' } )
|
|
25
|
+
).toBeInTheDocument();
|
|
26
|
+
expect( screen.queryByText( /^\+/ ) ).not.toBeInTheDocument();
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
it( 'should show overflow indicator when children exceed max', () => {
|
|
30
|
+
render(
|
|
31
|
+
<AvatarGroup max={ 2 }>
|
|
32
|
+
<Avatar name="Alice" />
|
|
33
|
+
<Avatar name="Bob" />
|
|
34
|
+
<Avatar name="Charlie" />
|
|
35
|
+
<Avatar name="Diana" />
|
|
36
|
+
</AvatarGroup>
|
|
37
|
+
);
|
|
38
|
+
expect(
|
|
39
|
+
screen.getByRole( 'img', { name: 'Alice' } )
|
|
40
|
+
).toBeInTheDocument();
|
|
41
|
+
expect(
|
|
42
|
+
screen.getByRole( 'img', { name: 'Bob' } )
|
|
43
|
+
).toBeInTheDocument();
|
|
44
|
+
expect(
|
|
45
|
+
screen.queryByRole( 'img', { name: 'Charlie' } )
|
|
46
|
+
).not.toBeInTheDocument();
|
|
47
|
+
const overflow = screen.getByText( '+2' );
|
|
48
|
+
expect( overflow ).toBeInTheDocument();
|
|
49
|
+
expect( overflow ).toHaveAttribute(
|
|
50
|
+
'aria-label',
|
|
51
|
+
'2 more collaborators'
|
|
52
|
+
);
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
it( 'should use singular form for one overflow collaborator', () => {
|
|
56
|
+
render(
|
|
57
|
+
<AvatarGroup max={ 2 }>
|
|
58
|
+
<Avatar name="Alice" />
|
|
59
|
+
<Avatar name="Bob" />
|
|
60
|
+
<Avatar name="Charlie" />
|
|
61
|
+
</AvatarGroup>
|
|
62
|
+
);
|
|
63
|
+
const overflow = screen.getByText( '+1' );
|
|
64
|
+
expect( overflow ).toHaveAttribute(
|
|
65
|
+
'aria-label',
|
|
66
|
+
'1 more collaborator'
|
|
67
|
+
);
|
|
68
|
+
} );
|
|
69
|
+
|
|
70
|
+
it( 'should default max to 3', () => {
|
|
71
|
+
render(
|
|
72
|
+
<AvatarGroup>
|
|
73
|
+
<Avatar name="A" />
|
|
74
|
+
<Avatar name="B" />
|
|
75
|
+
<Avatar name="C" />
|
|
76
|
+
<Avatar name="D" />
|
|
77
|
+
<Avatar name="E" />
|
|
78
|
+
</AvatarGroup>
|
|
79
|
+
);
|
|
80
|
+
expect( screen.getByRole( 'img', { name: 'A' } ) ).toBeInTheDocument();
|
|
81
|
+
expect( screen.getByRole( 'img', { name: 'B' } ) ).toBeInTheDocument();
|
|
82
|
+
expect( screen.getByRole( 'img', { name: 'C' } ) ).toBeInTheDocument();
|
|
83
|
+
expect(
|
|
84
|
+
screen.queryByRole( 'img', { name: 'D' } )
|
|
85
|
+
).not.toBeInTheDocument();
|
|
86
|
+
expect( screen.getByText( '+2' ) ).toBeInTheDocument();
|
|
87
|
+
} );
|
|
88
|
+
|
|
89
|
+
it( 'should not show overflow when children equal max', () => {
|
|
90
|
+
render(
|
|
91
|
+
<AvatarGroup max={ 3 }>
|
|
92
|
+
<Avatar name="A" />
|
|
93
|
+
<Avatar name="B" />
|
|
94
|
+
<Avatar name="C" />
|
|
95
|
+
</AvatarGroup>
|
|
96
|
+
);
|
|
97
|
+
expect( screen.queryByText( /^\+/ ) ).not.toBeInTheDocument();
|
|
98
|
+
} );
|
|
99
|
+
|
|
100
|
+
it( 'should not show overflow when children are fewer than max', () => {
|
|
101
|
+
render(
|
|
102
|
+
<AvatarGroup max={ 5 }>
|
|
103
|
+
<Avatar name="A" />
|
|
104
|
+
<Avatar name="B" />
|
|
105
|
+
</AvatarGroup>
|
|
106
|
+
);
|
|
107
|
+
expect( screen.queryByText( /^\+/ ) ).not.toBeInTheDocument();
|
|
108
|
+
} );
|
|
109
|
+
|
|
110
|
+
it( 'should combine custom className with default class', () => {
|
|
111
|
+
render(
|
|
112
|
+
<AvatarGroup data-testid="group" className="custom">
|
|
113
|
+
<Avatar name="A" />
|
|
114
|
+
</AvatarGroup>
|
|
115
|
+
);
|
|
116
|
+
const group = screen.getByTestId( 'group' );
|
|
117
|
+
expect( group ).toHaveClass( 'editor-avatar-group' );
|
|
118
|
+
expect( group ).toHaveClass( 'custom' );
|
|
119
|
+
} );
|
|
120
|
+
|
|
121
|
+
it( 'should have group role and support aria-label', () => {
|
|
122
|
+
render(
|
|
123
|
+
<AvatarGroup aria-label="Collaborators">
|
|
124
|
+
<Avatar name="A" />
|
|
125
|
+
</AvatarGroup>
|
|
126
|
+
);
|
|
127
|
+
const group = screen.getByRole( 'group', {
|
|
128
|
+
name: 'Collaborators',
|
|
129
|
+
} );
|
|
130
|
+
expect( group ).toBeInTheDocument();
|
|
131
|
+
} );
|
|
132
|
+
|
|
133
|
+
it( 'should render with no children', () => {
|
|
134
|
+
render( <AvatarGroup data-testid="group" /> );
|
|
135
|
+
const group = screen.getByTestId( 'group' );
|
|
136
|
+
expect( group ).toBeInTheDocument();
|
|
137
|
+
expect( screen.queryByText( /^\+/ ) ).not.toBeInTheDocument();
|
|
138
|
+
} );
|
|
139
|
+
} );
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AvatarGroupProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Maximum number of avatars to display before showing an
|
|
4
|
+
* overflow indicator.
|
|
5
|
+
*
|
|
6
|
+
* @default 3
|
|
7
|
+
*/
|
|
8
|
+
max?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Avatar elements to display in the group.
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
privateApis as componentsPrivateApis,
|
|
4
|
-
} from '@wordpress/components';
|
|
5
|
-
import { useState } from '@wordpress/element';
|
|
1
|
+
import { Button } from '@wordpress/components';
|
|
2
|
+
import { useMemo, useState } from '@wordpress/element';
|
|
6
3
|
import {
|
|
7
4
|
privateApis,
|
|
8
5
|
type PostEditorAwarenessState,
|
|
9
6
|
} from '@wordpress/core-data';
|
|
10
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
11
8
|
|
|
9
|
+
import Avatar from './avatar';
|
|
10
|
+
import AvatarGroup from './avatar-group';
|
|
12
11
|
import { CollaboratorsList } from './list';
|
|
13
12
|
import { unlock } from '../../lock-unlock';
|
|
14
13
|
import { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';
|
|
15
14
|
import { getAvatarBorderColor } from '../collab-sidebar/utils';
|
|
15
|
+
import { createCursorRegistry } from '../collaborators-overlay/cursor-registry';
|
|
16
16
|
|
|
17
17
|
import './styles/collaborators-presence.scss';
|
|
18
18
|
import { CollaboratorsOverlay } from '../collaborators-overlay';
|
|
19
19
|
|
|
20
20
|
const { useActiveCollaborators } = unlock( privateApis );
|
|
21
|
-
const { Avatar, AvatarGroup } = unlock( componentsPrivateApis );
|
|
22
21
|
|
|
23
22
|
interface CollaboratorsPresenceProps {
|
|
24
23
|
postId: number | null;
|
|
@@ -42,11 +41,25 @@ export function CollaboratorsPresence( {
|
|
|
42
41
|
postType
|
|
43
42
|
) as PostEditorAwarenessState[];
|
|
44
43
|
|
|
45
|
-
// Filter out current user - we never show ourselves in the list
|
|
46
44
|
const otherActiveCollaborators = activeCollaborators.filter(
|
|
47
|
-
(
|
|
45
|
+
( c ) => ! c.isMe
|
|
48
46
|
);
|
|
49
47
|
|
|
48
|
+
// Always include self in the list sorted first.
|
|
49
|
+
const collaboratorsForList = useMemo( () => {
|
|
50
|
+
return [ ...activeCollaborators ].sort( ( a, b ) => {
|
|
51
|
+
if ( a.isMe && ! b.isMe ) {
|
|
52
|
+
return -1;
|
|
53
|
+
}
|
|
54
|
+
if ( ! a.isMe && b.isMe ) {
|
|
55
|
+
return 1;
|
|
56
|
+
}
|
|
57
|
+
return 0;
|
|
58
|
+
} );
|
|
59
|
+
}, [ activeCollaborators ] );
|
|
60
|
+
|
|
61
|
+
const [ cursorRegistry ] = useState( createCursorRegistry );
|
|
62
|
+
|
|
50
63
|
const [ isPopoverVisible, setIsPopoverVisible ] = useState( false );
|
|
51
64
|
const [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(
|
|
52
65
|
null
|
|
@@ -59,6 +72,8 @@ export function CollaboratorsPresence( {
|
|
|
59
72
|
return null;
|
|
60
73
|
}
|
|
61
74
|
|
|
75
|
+
const me = activeCollaborators.find( ( c ) => c.isMe );
|
|
76
|
+
|
|
62
77
|
return (
|
|
63
78
|
<>
|
|
64
79
|
<div className="editor-collaborators-presence">
|
|
@@ -71,10 +86,21 @@ export function CollaboratorsPresence( {
|
|
|
71
86
|
aria-label={ sprintf(
|
|
72
87
|
// translators: %d: number of online collaborators.
|
|
73
88
|
__( 'Collaborators list, %d online' ),
|
|
74
|
-
|
|
89
|
+
collaboratorsForList.length
|
|
75
90
|
) }
|
|
76
91
|
>
|
|
77
|
-
<AvatarGroup max={
|
|
92
|
+
<AvatarGroup max={ 4 }>
|
|
93
|
+
{ me && (
|
|
94
|
+
<Avatar
|
|
95
|
+
key={ me.clientId }
|
|
96
|
+
src={ getAvatarUrl(
|
|
97
|
+
me.collaboratorInfo.avatar_urls
|
|
98
|
+
) }
|
|
99
|
+
name={ me.collaboratorInfo.name }
|
|
100
|
+
borderColor="var(--wp-admin-theme-color)"
|
|
101
|
+
size="small"
|
|
102
|
+
/>
|
|
103
|
+
) }
|
|
78
104
|
{ otherActiveCollaborators.map(
|
|
79
105
|
( collaboratorState ) => (
|
|
80
106
|
<Avatar
|
|
@@ -97,13 +123,18 @@ export function CollaboratorsPresence( {
|
|
|
97
123
|
</Button>
|
|
98
124
|
{ isPopoverVisible && (
|
|
99
125
|
<CollaboratorsList
|
|
100
|
-
activeCollaborators={
|
|
126
|
+
activeCollaborators={ collaboratorsForList }
|
|
101
127
|
popoverAnchor={ popoverAnchor }
|
|
102
128
|
setIsPopoverVisible={ setIsPopoverVisible }
|
|
129
|
+
cursorRegistry={ cursorRegistry }
|
|
103
130
|
/>
|
|
104
131
|
) }
|
|
105
132
|
</div>
|
|
106
|
-
<CollaboratorsOverlay
|
|
133
|
+
<CollaboratorsOverlay
|
|
134
|
+
postId={ postId }
|
|
135
|
+
postType={ postType }
|
|
136
|
+
cursorRegistry={ cursorRegistry }
|
|
137
|
+
/>
|
|
107
138
|
</>
|
|
108
139
|
);
|
|
109
140
|
}
|
|
@@ -1,39 +1,53 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Button,
|
|
5
|
-
privateApis as componentsPrivateApis,
|
|
6
|
-
} from '@wordpress/components';
|
|
7
|
-
import { close } from '@wordpress/icons';
|
|
2
|
+
import { Popover, Button } from '@wordpress/components';
|
|
3
|
+
import { closeSmall } from '@wordpress/icons';
|
|
8
4
|
import { type PostEditorAwarenessState } from '@wordpress/core-data';
|
|
5
|
+
import { speak } from '@wordpress/a11y';
|
|
9
6
|
|
|
10
|
-
import
|
|
7
|
+
import Avatar from './avatar';
|
|
11
8
|
import { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';
|
|
12
9
|
import { getAvatarBorderColor } from '../collab-sidebar/utils';
|
|
10
|
+
import { type CursorRegistry } from '../collaborators-overlay/cursor-registry';
|
|
13
11
|
|
|
14
12
|
import './styles/collaborators-list.scss';
|
|
15
13
|
|
|
16
|
-
const { Avatar } = unlock( componentsPrivateApis );
|
|
17
|
-
|
|
18
14
|
interface CollaboratorsListProps {
|
|
19
15
|
activeCollaborators: PostEditorAwarenessState[];
|
|
20
16
|
popoverAnchor?: HTMLElement | null;
|
|
21
17
|
setIsPopoverVisible: ( isVisible: boolean ) => void;
|
|
18
|
+
cursorRegistry: CursorRegistry;
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* Renders a list showing all active collaborators with their details.
|
|
26
|
-
*
|
|
23
|
+
* When the showCollaborationCursor preference is enabled, the current user
|
|
24
|
+
* is included and expected to be first in the list.
|
|
27
25
|
* @param props Component props
|
|
28
26
|
* @param props.activeCollaborators List of active collaborators
|
|
29
27
|
* @param props.popoverAnchor Anchor element for the popover
|
|
30
28
|
* @param props.setIsPopoverVisible Callback to set the visibility of the popover
|
|
29
|
+
* @param props.cursorRegistry Shared registry for scroll-to-cursor support
|
|
31
30
|
*/
|
|
32
31
|
export function CollaboratorsList( {
|
|
33
32
|
activeCollaborators,
|
|
34
33
|
popoverAnchor,
|
|
35
34
|
setIsPopoverVisible,
|
|
35
|
+
cursorRegistry,
|
|
36
36
|
}: CollaboratorsListProps ) {
|
|
37
|
+
const handleCollaboratorClick = ( clientId: number ) => {
|
|
38
|
+
const success = cursorRegistry.scrollToCursor( clientId, {
|
|
39
|
+
behavior: 'smooth',
|
|
40
|
+
block: 'center',
|
|
41
|
+
highlightDuration: 2000,
|
|
42
|
+
} );
|
|
43
|
+
|
|
44
|
+
if ( success ) {
|
|
45
|
+
speak( __( 'Scrolled to cursor' ), 'polite' );
|
|
46
|
+
|
|
47
|
+
setIsPopoverVisible( false );
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
37
51
|
return (
|
|
38
52
|
<Popover
|
|
39
53
|
anchor={ popoverAnchor }
|
|
@@ -46,47 +60,61 @@ export function CollaboratorsList( {
|
|
|
46
60
|
<div className="editor-collaborators-presence__list-header">
|
|
47
61
|
<div className="editor-collaborators-presence__list-header-title">
|
|
48
62
|
{ __( 'Collaborators' ) }
|
|
49
|
-
<span>
|
|
63
|
+
<span>{ activeCollaborators.length }</span>
|
|
50
64
|
</div>
|
|
51
65
|
<div className="editor-collaborators-presence__list-header-action">
|
|
52
66
|
<Button
|
|
53
67
|
__next40pxDefaultSize
|
|
54
|
-
icon={
|
|
55
|
-
iconSize={
|
|
68
|
+
icon={ closeSmall }
|
|
69
|
+
iconSize={ 24 }
|
|
56
70
|
label={ __( 'Close Collaborators List' ) }
|
|
57
71
|
onClick={ () => setIsPopoverVisible( false ) }
|
|
58
72
|
/>
|
|
59
73
|
</div>
|
|
60
74
|
</div>
|
|
61
75
|
<div className="editor-collaborators-presence__list-items">
|
|
62
|
-
{ activeCollaborators.map( ( collaboratorState ) =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
{ activeCollaborators.map( ( collaboratorState ) => {
|
|
77
|
+
const isCurrentUser = collaboratorState.isMe;
|
|
78
|
+
return (
|
|
79
|
+
<button
|
|
80
|
+
key={ collaboratorState.clientId }
|
|
81
|
+
className="editor-collaborators-presence__list-item"
|
|
82
|
+
disabled={ isCurrentUser }
|
|
83
|
+
onClick={ () =>
|
|
84
|
+
handleCollaboratorClick(
|
|
85
|
+
collaboratorState.clientId
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
<Avatar
|
|
90
|
+
src={ getAvatarUrl(
|
|
91
|
+
collaboratorState.collaboratorInfo
|
|
92
|
+
.avatar_urls
|
|
93
|
+
) }
|
|
94
|
+
name={
|
|
95
|
+
collaboratorState.collaboratorInfo.name
|
|
96
|
+
}
|
|
97
|
+
borderColor={
|
|
98
|
+
isCurrentUser
|
|
99
|
+
? 'var(--wp-admin-theme-color)'
|
|
100
|
+
: getAvatarBorderColor(
|
|
101
|
+
collaboratorState
|
|
102
|
+
.collaboratorInfo.id
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
dimmed={ ! collaboratorState.isConnected }
|
|
106
|
+
/>
|
|
107
|
+
<div className="editor-collaborators-presence__list-item-info">
|
|
108
|
+
<div className="editor-collaborators-presence__list-item-name">
|
|
109
|
+
{ isCurrentUser
|
|
110
|
+
? __( 'You' )
|
|
111
|
+
: collaboratorState.collaboratorInfo
|
|
112
|
+
.name }
|
|
113
|
+
</div>
|
|
86
114
|
</div>
|
|
87
|
-
</
|
|
88
|
-
|
|
89
|
-
|
|
115
|
+
</button>
|
|
116
|
+
);
|
|
117
|
+
} ) }
|
|
90
118
|
</div>
|
|
91
119
|
</div>
|
|
92
120
|
</Popover>
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
.editor-collaborators-presence__list.components-popover {
|
|
5
5
|
// Popover wrapper styles
|
|
6
6
|
.components-popover__content {
|
|
7
|
-
border:
|
|
8
|
-
border-width:
|
|
7
|
+
border: $border-width solid $gray-300;
|
|
8
|
+
border-width: $border-width 0 0 $border-width;
|
|
9
9
|
border-radius: $radius-large;
|
|
10
10
|
background: $white;
|
|
11
11
|
box-shadow: $elevation-small;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.editor-collaborators-presence__list-content {
|
|
15
|
-
min-width:
|
|
15
|
+
min-width: $sidebar-width;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
// Header with title and action button
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
display: flex;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
align-items: center;
|
|
23
|
-
padding:
|
|
23
|
+
padding: $grid-unit-10 $grid-unit-20;
|
|
24
24
|
|
|
25
25
|
&-title {
|
|
26
26
|
font-size: $font-size-medium;
|
|
27
27
|
font-weight: $font-weight-medium;
|
|
28
|
-
text-transform: uppercase;
|
|
29
28
|
line-height: $font-line-height-small;
|
|
30
|
-
|
|
29
|
+
display: flex;
|
|
30
|
+
gap: $grid-unit-05;
|
|
31
31
|
|
|
32
32
|
span {
|
|
33
33
|
color: $gray-700;
|
|
@@ -35,12 +35,11 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
&-action {
|
|
38
|
-
padding:
|
|
39
|
-
|
|
38
|
+
padding: 0;
|
|
40
39
|
button {
|
|
41
40
|
color: $gray-900;
|
|
42
|
-
height: $button-size-
|
|
43
|
-
width: $button-size-
|
|
41
|
+
height: $button-size-compact;
|
|
42
|
+
width: $button-size-compact;
|
|
44
43
|
padding: 0;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
.editor-collaborators-presence__list-items {
|
|
51
50
|
display: flex;
|
|
52
51
|
flex-direction: column;
|
|
53
|
-
padding:
|
|
52
|
+
padding-bottom: $grid-unit-20;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
.editor-collaborators-presence__list-item {
|
|
@@ -61,24 +60,23 @@
|
|
|
61
60
|
// Layout styles
|
|
62
61
|
display: flex;
|
|
63
62
|
align-items: center;
|
|
64
|
-
padding: $grid-unit-
|
|
63
|
+
padding: $grid-unit-15 $grid-unit-20;
|
|
65
64
|
gap: $grid-unit-10;
|
|
66
|
-
border-radius: $radius-large + $grid-unit-05;
|
|
67
65
|
width: 100%;
|
|
68
66
|
cursor: pointer;
|
|
69
67
|
transition: background-color 0.2s ease;
|
|
70
68
|
|
|
71
69
|
&:hover:not(:disabled) {
|
|
72
|
-
background-color: rgba(
|
|
70
|
+
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
&:active:not(:disabled) {
|
|
76
|
-
background-color: rgba(
|
|
74
|
+
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
&:focus-visible {
|
|
80
|
-
outline:
|
|
81
|
-
outline-offset: -
|
|
78
|
+
outline: $border-width-focus-fallback solid var(--wp-admin-theme-color, #3858e9);
|
|
79
|
+
outline-offset: -$border-width-focus-fallback;
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
&:disabled {
|
|
@@ -89,8 +87,17 @@
|
|
|
89
87
|
display: flex;
|
|
90
88
|
flex-direction: column;
|
|
91
89
|
flex: 1;
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&-name {
|
|
94
|
+
font-size: $font-size-medium;
|
|
95
|
+
font-weight: $font-weight-medium;
|
|
96
|
+
line-height: $font-line-height-small;
|
|
97
|
+
color: $gray-900;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
text-overflow: ellipsis;
|
|
100
|
+
white-space: nowrap;
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
103
|
}
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
&:hover {
|
|
14
14
|
background-color: $gray-200;
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
&:has(.is-pressed) {
|
|
18
|
+
background-color: $gray-200;
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button {
|
|
@@ -33,10 +37,10 @@
|
|
|
33
37
|
color: $gray-800;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
// Override pressed state -
|
|
40
|
+
// Override pressed state - let the container handle the background
|
|
37
41
|
&.is-pressed,
|
|
38
42
|
&.is-pressed:hover {
|
|
39
|
-
background:
|
|
43
|
+
background: transparent;
|
|
40
44
|
color: $gray-800;
|
|
41
45
|
}
|
|
42
46
|
|