@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
|
@@ -91,7 +91,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
91
91
|
name: 'core/paragraph',
|
|
92
92
|
attributes: {
|
|
93
93
|
content: 'Hello',
|
|
94
|
-
__revisionDiffStatus: 'added',
|
|
94
|
+
__revisionDiffStatus: { status: 'added' },
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
] );
|
|
@@ -108,7 +108,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
108
108
|
name: 'core/paragraph',
|
|
109
109
|
attributes: {
|
|
110
110
|
content: 'Hello',
|
|
111
|
-
__revisionDiffStatus: 'removed',
|
|
111
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
] );
|
|
@@ -144,7 +144,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
144
144
|
{
|
|
145
145
|
name: 'core/paragraph',
|
|
146
146
|
attributes: {
|
|
147
|
-
__revisionDiffStatus:
|
|
147
|
+
__revisionDiffStatus: {
|
|
148
|
+
status: 'modified',
|
|
149
|
+
},
|
|
148
150
|
},
|
|
149
151
|
},
|
|
150
152
|
] );
|
|
@@ -167,7 +169,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
167
169
|
name: 'core/paragraph',
|
|
168
170
|
attributes: {
|
|
169
171
|
content: 'NEW',
|
|
170
|
-
__revisionDiffStatus: 'added',
|
|
172
|
+
__revisionDiffStatus: { status: 'added' },
|
|
171
173
|
},
|
|
172
174
|
},
|
|
173
175
|
{
|
|
@@ -204,21 +206,23 @@ describe( 'diffRevisionContent', () => {
|
|
|
204
206
|
const normalized = normalizeBlockTree( blocks );
|
|
205
207
|
|
|
206
208
|
// Post-LCS pairing detects similar blocks and marks them as modified.
|
|
207
|
-
//
|
|
209
|
+
// Added blocks between the removed and added positions mean the
|
|
210
|
+
// modified block stays at the added position to preserve the
|
|
211
|
+
// current revision's layout.
|
|
208
212
|
expect( normalized ).toHaveLength( 3 );
|
|
209
213
|
expect( normalized ).toMatchObject( [
|
|
210
214
|
{
|
|
211
215
|
name: 'core/paragraph',
|
|
212
216
|
attributes: {
|
|
213
217
|
content: 'First new block',
|
|
214
|
-
__revisionDiffStatus: 'added',
|
|
218
|
+
__revisionDiffStatus: { status: 'added' },
|
|
215
219
|
},
|
|
216
220
|
},
|
|
217
221
|
{
|
|
218
222
|
name: 'core/paragraph',
|
|
219
223
|
attributes: {
|
|
220
224
|
content: 'Second new block',
|
|
221
|
-
__revisionDiffStatus: 'added',
|
|
225
|
+
__revisionDiffStatus: { status: 'added' },
|
|
222
226
|
},
|
|
223
227
|
},
|
|
224
228
|
{
|
|
@@ -227,7 +231,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
227
231
|
// Inline diff: "existing" → "modified"
|
|
228
232
|
content:
|
|
229
233
|
'This is some <del title="Removed" class="revision-diff-removed">existing</del><ins title="Added" class="revision-diff-added">modified</ins> content',
|
|
230
|
-
__revisionDiffStatus:
|
|
234
|
+
__revisionDiffStatus: {
|
|
235
|
+
status: 'modified',
|
|
236
|
+
},
|
|
231
237
|
},
|
|
232
238
|
},
|
|
233
239
|
] );
|
|
@@ -265,7 +271,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
265
271
|
name: 'core/paragraph',
|
|
266
272
|
attributes: {
|
|
267
273
|
content: 'B',
|
|
268
|
-
__revisionDiffStatus: 'added',
|
|
274
|
+
__revisionDiffStatus: { status: 'added' },
|
|
269
275
|
},
|
|
270
276
|
},
|
|
271
277
|
],
|
|
@@ -305,7 +311,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
305
311
|
name: 'core/paragraph',
|
|
306
312
|
attributes: {
|
|
307
313
|
content: 'B',
|
|
308
|
-
__revisionDiffStatus: 'removed',
|
|
314
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
309
315
|
},
|
|
310
316
|
},
|
|
311
317
|
],
|
|
@@ -342,7 +348,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
342
348
|
name: 'core/paragraph',
|
|
343
349
|
attributes: {
|
|
344
350
|
content: 'Second block content',
|
|
345
|
-
__revisionDiffStatus: 'added',
|
|
351
|
+
__revisionDiffStatus: { status: 'added' },
|
|
346
352
|
},
|
|
347
353
|
},
|
|
348
354
|
{
|
|
@@ -356,7 +362,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
356
362
|
name: 'core/paragraph',
|
|
357
363
|
attributes: {
|
|
358
364
|
content: 'Second block content',
|
|
359
|
-
__revisionDiffStatus: 'removed',
|
|
365
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
360
366
|
},
|
|
361
367
|
},
|
|
362
368
|
] );
|
|
@@ -381,7 +387,17 @@ describe( 'diffRevisionContent', () => {
|
|
|
381
387
|
attributes: {
|
|
382
388
|
content: 'Same content',
|
|
383
389
|
className: 'new-class',
|
|
384
|
-
__revisionDiffStatus:
|
|
390
|
+
__revisionDiffStatus: {
|
|
391
|
+
status: 'modified',
|
|
392
|
+
changedAttributes: {
|
|
393
|
+
className: [
|
|
394
|
+
{
|
|
395
|
+
added: true,
|
|
396
|
+
value: 'new-class',
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
},
|
|
385
401
|
},
|
|
386
402
|
},
|
|
387
403
|
] );
|
|
@@ -410,7 +426,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
410
426
|
attributes: {
|
|
411
427
|
content:
|
|
412
428
|
'Second block content<ins title="Added" class="revision-diff-added"> modified</ins>',
|
|
413
|
-
__revisionDiffStatus:
|
|
429
|
+
__revisionDiffStatus: {
|
|
430
|
+
status: 'modified',
|
|
431
|
+
},
|
|
414
432
|
},
|
|
415
433
|
},
|
|
416
434
|
{
|
|
@@ -466,7 +484,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
466
484
|
name: 'core/paragraph',
|
|
467
485
|
attributes: {
|
|
468
486
|
content: 'New',
|
|
469
|
-
__revisionDiffStatus:
|
|
487
|
+
__revisionDiffStatus: {
|
|
488
|
+
status: 'added',
|
|
489
|
+
},
|
|
470
490
|
},
|
|
471
491
|
},
|
|
472
492
|
],
|
|
@@ -490,7 +510,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
490
510
|
{
|
|
491
511
|
name: 'core/group',
|
|
492
512
|
attributes: {
|
|
493
|
-
__revisionDiffStatus: 'added',
|
|
513
|
+
__revisionDiffStatus: { status: 'added' },
|
|
494
514
|
},
|
|
495
515
|
innerBlocks: [
|
|
496
516
|
{
|
|
@@ -526,7 +546,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
526
546
|
{
|
|
527
547
|
name: 'core/group',
|
|
528
548
|
attributes: {
|
|
529
|
-
__revisionDiffStatus: 'removed',
|
|
549
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
530
550
|
},
|
|
531
551
|
innerBlocks: [
|
|
532
552
|
{
|
|
@@ -577,7 +597,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
577
597
|
name: 'core/paragraph',
|
|
578
598
|
attributes: {
|
|
579
599
|
content: 'NEW',
|
|
580
|
-
__revisionDiffStatus: 'added',
|
|
600
|
+
__revisionDiffStatus: { status: 'added' },
|
|
581
601
|
},
|
|
582
602
|
},
|
|
583
603
|
{
|
|
@@ -629,7 +649,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
629
649
|
{
|
|
630
650
|
name: 'core/paragraph',
|
|
631
651
|
attributes: {
|
|
632
|
-
__revisionDiffStatus:
|
|
652
|
+
__revisionDiffStatus: {
|
|
653
|
+
status: 'modified',
|
|
654
|
+
},
|
|
633
655
|
},
|
|
634
656
|
},
|
|
635
657
|
],
|
|
@@ -654,7 +676,8 @@ describe( 'diffRevisionContent', () => {
|
|
|
654
676
|
const blocks = diffRevisionContent( current, previous );
|
|
655
677
|
|
|
656
678
|
// Post-LCS pairing matches B with D (same block type, high HTML similarity).
|
|
657
|
-
//
|
|
679
|
+
// Post-LCS pairing matches B with D. Modified block appears at
|
|
680
|
+
// B's position (earlier than D), C removed after.
|
|
658
681
|
expect( normalizeBlockTree( blocks ) ).toMatchObject( [
|
|
659
682
|
{
|
|
660
683
|
name: 'core/group',
|
|
@@ -669,20 +692,81 @@ describe( 'diffRevisionContent', () => {
|
|
|
669
692
|
__revisionDiffStatus: undefined,
|
|
670
693
|
},
|
|
671
694
|
},
|
|
695
|
+
{
|
|
696
|
+
name: 'core/paragraph',
|
|
697
|
+
attributes: {
|
|
698
|
+
// B→D modification with inline diff
|
|
699
|
+
content:
|
|
700
|
+
'<del title="Removed" class="revision-diff-removed">B</del><ins title="Added" class="revision-diff-added">D</ins>',
|
|
701
|
+
__revisionDiffStatus: {
|
|
702
|
+
status: 'modified',
|
|
703
|
+
},
|
|
704
|
+
},
|
|
705
|
+
},
|
|
672
706
|
{
|
|
673
707
|
name: 'core/paragraph',
|
|
674
708
|
attributes: {
|
|
675
709
|
content: 'C',
|
|
676
|
-
__revisionDiffStatus: 'removed',
|
|
710
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
677
711
|
},
|
|
678
712
|
},
|
|
713
|
+
],
|
|
714
|
+
},
|
|
715
|
+
] );
|
|
716
|
+
} );
|
|
717
|
+
|
|
718
|
+
it( 'handles multiple inner block changes at once (similar content)', () => {
|
|
719
|
+
const previous = serialize( [
|
|
720
|
+
createBlock( 'core/group', {}, [
|
|
721
|
+
createBlock( 'core/paragraph', { content: 'A' } ),
|
|
722
|
+
createBlock( 'core/paragraph', {
|
|
723
|
+
content: 'The quick brown fox jumps over the lazy dog',
|
|
724
|
+
} ),
|
|
725
|
+
createBlock( 'core/paragraph', { content: 'C' } ),
|
|
726
|
+
] ),
|
|
727
|
+
] );
|
|
728
|
+
const current = serialize( [
|
|
729
|
+
createBlock( 'core/group', {}, [
|
|
730
|
+
createBlock( 'core/paragraph', { content: 'A' } ),
|
|
731
|
+
createBlock( 'core/paragraph', {
|
|
732
|
+
content: 'The quick brown fox leaps over the lazy dog',
|
|
733
|
+
} ),
|
|
734
|
+
] ),
|
|
735
|
+
] );
|
|
736
|
+
const blocks = diffRevisionContent( current, previous );
|
|
737
|
+
|
|
738
|
+
// Post-LCS pairing matches the fox sentences (high word overlap).
|
|
739
|
+
// Modified block at fox's original position, C removed after.
|
|
740
|
+
expect( normalizeBlockTree( blocks ) ).toMatchObject( [
|
|
741
|
+
{
|
|
742
|
+
name: 'core/group',
|
|
743
|
+
attributes: {
|
|
744
|
+
__revisionDiffStatus: undefined,
|
|
745
|
+
},
|
|
746
|
+
innerBlocks: [
|
|
679
747
|
{
|
|
680
748
|
name: 'core/paragraph',
|
|
681
749
|
attributes: {
|
|
682
|
-
|
|
750
|
+
content: 'A',
|
|
751
|
+
__revisionDiffStatus: undefined,
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
name: 'core/paragraph',
|
|
756
|
+
attributes: {
|
|
757
|
+
// jumps→leaps modification with inline diff
|
|
683
758
|
content:
|
|
684
|
-
'<del title="Removed" class="revision-diff-removed">
|
|
685
|
-
__revisionDiffStatus:
|
|
759
|
+
'The quick brown fox <del title="Removed" class="revision-diff-removed">jumps</del><ins title="Added" class="revision-diff-added">leaps</ins> over the lazy dog',
|
|
760
|
+
__revisionDiffStatus: {
|
|
761
|
+
status: 'modified',
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: 'core/paragraph',
|
|
767
|
+
attributes: {
|
|
768
|
+
content: 'C',
|
|
769
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
686
770
|
},
|
|
687
771
|
},
|
|
688
772
|
],
|
|
@@ -690,6 +774,73 @@ describe( 'diffRevisionContent', () => {
|
|
|
690
774
|
] );
|
|
691
775
|
} );
|
|
692
776
|
|
|
777
|
+
it( 'pairs paragraphs in order when section is condensed', () => {
|
|
778
|
+
// Four paragraphs condensed into two. The first paragraph
|
|
779
|
+
// should pair and appear first, not after the removed blocks.
|
|
780
|
+
const previous = serialize( [
|
|
781
|
+
createBlock( 'core/paragraph', {
|
|
782
|
+
content:
|
|
783
|
+
'The International Space Station is the largest structure ever built in space. Assembled over more than a decade from modules launched by the United States, Russia, Europe, Japan, and Canada, it spans the area of a football field and weighs nearly a million pounds. It orbits Earth every ninety minutes at an altitude of roughly 250 miles, traveling at 17,500 miles per hour.',
|
|
784
|
+
} ),
|
|
785
|
+
createBlock( 'core/paragraph', {
|
|
786
|
+
content:
|
|
787
|
+
'The station has been continuously occupied since November 2, 2000 — the longest unbroken human presence in space. More than 270 people from twenty-one countries have visited. Its laboratories have hosted thousands of experiments in biology, physics, materials science, and medicine. Research on the ISS has advanced our understanding of protein crystallization, combustion, fluid dynamics, and the long-term effects of microgravity on the human body.',
|
|
788
|
+
} ),
|
|
789
|
+
createBlock( 'core/paragraph', {
|
|
790
|
+
content:
|
|
791
|
+
'But the ISS is also a lesson in the costs of international cooperation. Originally estimated at $8 billion, the total cost has exceeded $150 billion, making it by far the most expensive single object ever constructed. Its scientific output, while significant, has been modest relative to that investment. Critics argue that the same money spent on robotic missions and ground-based research would have yielded far greater scientific returns.',
|
|
792
|
+
} ),
|
|
793
|
+
createBlock( 'core/paragraph', {
|
|
794
|
+
content:
|
|
795
|
+
"The station's supporters counter that its value lies beyond pure science. The ISS demonstrated that former Cold War adversaries could work together on a project of extraordinary complexity. It kept human spaceflight alive during a period when no alternative destination existed. And it served as a testbed for the technologies and operational experience needed for future deep-space missions — life support systems, spacewalk procedures, crew psychology, and the logistics of sustaining humans far from Earth.",
|
|
796
|
+
} ),
|
|
797
|
+
] );
|
|
798
|
+
const current = serialize( [
|
|
799
|
+
createBlock( 'core/paragraph', {
|
|
800
|
+
content:
|
|
801
|
+
'The International Space Station is the largest structure ever built in space. Assembled over more than a decade from modules launched by the United States, Russia, Europe, Japan, and Canada, it spans the area of a football field. It has been continuously occupied since November 2000.',
|
|
802
|
+
} ),
|
|
803
|
+
createBlock( 'core/paragraph', {
|
|
804
|
+
content:
|
|
805
|
+
'More than 270 people from twenty-one countries have visited. Its laboratories have hosted thousands of experiments. The total cost has exceeded $150 billion, making it the most expensive single object ever constructed.',
|
|
806
|
+
} ),
|
|
807
|
+
] );
|
|
808
|
+
const blocks = diffRevisionContent( current, previous );
|
|
809
|
+
const normalized = normalizeBlockTree( blocks );
|
|
810
|
+
|
|
811
|
+
const statuses = normalized.map(
|
|
812
|
+
( b ) =>
|
|
813
|
+
b.attributes.__revisionDiffStatus?.status || 'unchanged'
|
|
814
|
+
);
|
|
815
|
+
|
|
816
|
+
// Pairings must not cross: if prev P1 pairs with curr P1,
|
|
817
|
+
// then prev P2 can only pair with curr P2 (not curr P1).
|
|
818
|
+
// Verify no crossing by checking modified blocks appear
|
|
819
|
+
// in a consistent order.
|
|
820
|
+
const modifiedIndices = [];
|
|
821
|
+
const removedIndices = [];
|
|
822
|
+
statuses.forEach( ( s, i ) => {
|
|
823
|
+
if ( s === 'modified' ) {
|
|
824
|
+
modifiedIndices.push( i );
|
|
825
|
+
}
|
|
826
|
+
if ( s === 'removed' ) {
|
|
827
|
+
removedIndices.push( i );
|
|
828
|
+
}
|
|
829
|
+
} );
|
|
830
|
+
|
|
831
|
+
// Prev P1 pairs with Curr P1 (high overlap — same opening,
|
|
832
|
+
// condensed ending). Prev P2-P4 are too different from
|
|
833
|
+
// Curr P2 to pair (score below 0.5 threshold), so they
|
|
834
|
+
// appear as separate removed + added blocks.
|
|
835
|
+
expect( statuses ).toEqual( [
|
|
836
|
+
'modified',
|
|
837
|
+
'removed',
|
|
838
|
+
'removed',
|
|
839
|
+
'removed',
|
|
840
|
+
'added',
|
|
841
|
+
] );
|
|
842
|
+
} );
|
|
843
|
+
|
|
693
844
|
it( 'does not pair blocks with completely different content', () => {
|
|
694
845
|
const previous = serialize( [
|
|
695
846
|
createBlock( 'core/group', {}, [
|
|
@@ -739,7 +890,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
739
890
|
attributes: {
|
|
740
891
|
content:
|
|
741
892
|
'The quick brown fox jumps over the lazy dog near the riverbank',
|
|
742
|
-
__revisionDiffStatus: 'removed',
|
|
893
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
743
894
|
},
|
|
744
895
|
},
|
|
745
896
|
{
|
|
@@ -747,7 +898,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
747
898
|
attributes: {
|
|
748
899
|
content:
|
|
749
900
|
'Third paragraph also removed from this post',
|
|
750
|
-
__revisionDiffStatus: 'removed',
|
|
901
|
+
__revisionDiffStatus: { status: 'removed' },
|
|
751
902
|
},
|
|
752
903
|
},
|
|
753
904
|
{
|
|
@@ -755,7 +906,7 @@ describe( 'diffRevisionContent', () => {
|
|
|
755
906
|
attributes: {
|
|
756
907
|
content:
|
|
757
908
|
'Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod',
|
|
758
|
-
__revisionDiffStatus: 'added',
|
|
909
|
+
__revisionDiffStatus: { status: 'added' },
|
|
759
910
|
},
|
|
760
911
|
},
|
|
761
912
|
],
|
|
@@ -803,7 +954,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
803
954
|
attributes: {
|
|
804
955
|
content:
|
|
805
956
|
'Hello <strong><span title="1 format added" class="revision-diff-format-added">world</span></strong>',
|
|
806
|
-
__revisionDiffStatus:
|
|
957
|
+
__revisionDiffStatus: {
|
|
958
|
+
status: 'modified',
|
|
959
|
+
},
|
|
807
960
|
},
|
|
808
961
|
},
|
|
809
962
|
] );
|
|
@@ -829,7 +982,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
829
982
|
attributes: {
|
|
830
983
|
content:
|
|
831
984
|
'Hello <strong><del title="Removed" class="revision-diff-removed">world</del><ins title="Added" class="revision-diff-added">everyone</ins></strong>',
|
|
832
|
-
__revisionDiffStatus:
|
|
985
|
+
__revisionDiffStatus: {
|
|
986
|
+
status: 'modified',
|
|
987
|
+
},
|
|
833
988
|
},
|
|
834
989
|
},
|
|
835
990
|
] );
|
|
@@ -879,7 +1034,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
879
1034
|
attributes: {
|
|
880
1035
|
content:
|
|
881
1036
|
'Visit <a href="https://new-site.com"><span title="1 format changed" class="revision-diff-format-changed">our site</span></a> today',
|
|
882
|
-
__revisionDiffStatus:
|
|
1037
|
+
__revisionDiffStatus: {
|
|
1038
|
+
status: 'modified',
|
|
1039
|
+
},
|
|
883
1040
|
},
|
|
884
1041
|
},
|
|
885
1042
|
] );
|
|
@@ -907,7 +1064,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
907
1064
|
attributes: {
|
|
908
1065
|
content:
|
|
909
1066
|
'Visit <a href="https://example.com"><del title="Removed" class="revision-diff-removed">our</del><ins title="Added" class="revision-diff-added">the</ins> <del title="Removed" class="revision-diff-removed">site</del><ins title="Added" class="revision-diff-added">website</ins></a> today',
|
|
910
|
-
__revisionDiffStatus:
|
|
1067
|
+
__revisionDiffStatus: {
|
|
1068
|
+
status: 'modified',
|
|
1069
|
+
},
|
|
911
1070
|
},
|
|
912
1071
|
},
|
|
913
1072
|
] );
|
|
@@ -955,7 +1114,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
955
1114
|
attributes: {
|
|
956
1115
|
content:
|
|
957
1116
|
'<span title="1 format removed" class="revision-diff-format-removed">Bold</span> and <span title="1 format removed" class="revision-diff-format-removed">italic</span> text',
|
|
958
|
-
__revisionDiffStatus:
|
|
1117
|
+
__revisionDiffStatus: {
|
|
1118
|
+
status: 'modified',
|
|
1119
|
+
},
|
|
959
1120
|
},
|
|
960
1121
|
},
|
|
961
1122
|
] );
|
|
@@ -981,7 +1142,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
981
1142
|
attributes: {
|
|
982
1143
|
content:
|
|
983
1144
|
'Hello <em><span title="1 format added, 1 format removed" class="revision-diff-format-changed">world</span></em>',
|
|
984
|
-
__revisionDiffStatus:
|
|
1145
|
+
__revisionDiffStatus: {
|
|
1146
|
+
status: 'modified',
|
|
1147
|
+
},
|
|
985
1148
|
},
|
|
986
1149
|
},
|
|
987
1150
|
] );
|
|
@@ -1026,7 +1189,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
1026
1189
|
attributes: {
|
|
1027
1190
|
content:
|
|
1028
1191
|
'<del title="Removed" class="revision-diff-removed">Hello</del><ins title="Added" class="revision-diff-added">Goodbye</ins> <strong>world</strong>!',
|
|
1029
|
-
__revisionDiffStatus:
|
|
1192
|
+
__revisionDiffStatus: {
|
|
1193
|
+
status: 'modified',
|
|
1194
|
+
},
|
|
1030
1195
|
},
|
|
1031
1196
|
},
|
|
1032
1197
|
] );
|
|
@@ -1062,7 +1227,9 @@ describe( 'diffRevisionContent', () => {
|
|
|
1062
1227
|
attributes: {
|
|
1063
1228
|
content:
|
|
1064
1229
|
'<del title="Removed" class="revision-diff-removed">Hello</del><ins title="Added" class="revision-diff-added">Goodbye</ins> <strong><del title="Removed" class="revision-diff-removed">world</del><ins title="Added" class="revision-diff-added">everyone</ins></strong>',
|
|
1065
|
-
__revisionDiffStatus:
|
|
1230
|
+
__revisionDiffStatus: {
|
|
1231
|
+
status: 'modified',
|
|
1232
|
+
},
|
|
1066
1233
|
},
|
|
1067
1234
|
},
|
|
1068
1235
|
],
|
|
@@ -55,20 +55,25 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
55
55
|
|
|
56
56
|
function PreferencesModalContents( { extraSections = {} } ) {
|
|
57
57
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
58
|
-
const showBlockBreadcrumbsOption = useSelect(
|
|
58
|
+
const { showBlockBreadcrumbsOption, showCollaborationOptions } = useSelect(
|
|
59
59
|
( select ) => {
|
|
60
|
-
const { getEditorSettings } =
|
|
60
|
+
const { getEditorSettings, isCollaborationEnabledForCurrentPost } =
|
|
61
|
+
unlock( select( editorStore ) );
|
|
61
62
|
const { get } = select( preferencesStore );
|
|
62
63
|
const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
|
|
63
64
|
const isDistractionFreeEnabled = get( 'core', 'distractionFree' );
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
return {
|
|
66
|
+
showBlockBreadcrumbsOption:
|
|
67
|
+
! isDistractionFreeEnabled &&
|
|
68
|
+
isLargeViewport &&
|
|
69
|
+
isRichEditingEnabled,
|
|
70
|
+
showCollaborationOptions:
|
|
71
|
+
isCollaborationEnabledForCurrentPost(),
|
|
72
|
+
};
|
|
69
73
|
},
|
|
70
74
|
[ isLargeViewport ]
|
|
71
75
|
);
|
|
76
|
+
|
|
72
77
|
const { setIsListViewOpened, setIsInserterOpened } =
|
|
73
78
|
useDispatch( editorStore );
|
|
74
79
|
const { set: setPreference } = useDispatch( preferencesStore );
|
|
@@ -120,6 +125,30 @@ function PreferencesModalContents( { extraSections = {} } ) {
|
|
|
120
125
|
) }
|
|
121
126
|
label={ __( 'Show starter patterns' ) }
|
|
122
127
|
/>
|
|
128
|
+
{ showCollaborationOptions && (
|
|
129
|
+
<>
|
|
130
|
+
<PreferenceToggleControl
|
|
131
|
+
scope="core"
|
|
132
|
+
featureName="showCollaborationCursor"
|
|
133
|
+
help={ __(
|
|
134
|
+
'Show your own avatar inside blocks during collaborative editing sessions.'
|
|
135
|
+
) }
|
|
136
|
+
label={ __(
|
|
137
|
+
'Show avatar in blocks'
|
|
138
|
+
) }
|
|
139
|
+
/>
|
|
140
|
+
<PreferenceToggleControl
|
|
141
|
+
scope="core"
|
|
142
|
+
featureName="showCollaborationNotifications"
|
|
143
|
+
help={ __(
|
|
144
|
+
'Show notifications when collaborators join, leave, or save the post.'
|
|
145
|
+
) }
|
|
146
|
+
label={ __(
|
|
147
|
+
'Show collaboration notifications'
|
|
148
|
+
) }
|
|
149
|
+
/>
|
|
150
|
+
</>
|
|
151
|
+
) }
|
|
123
152
|
</PreferencesModalSection>
|
|
124
153
|
<PreferencesModalSection
|
|
125
154
|
title={ __( 'Document settings' ) }
|
|
@@ -332,6 +361,7 @@ function PreferencesModalContents( { extraSections = {} } ) {
|
|
|
332
361
|
].filter( Boolean ),
|
|
333
362
|
[
|
|
334
363
|
showBlockBreadcrumbsOption,
|
|
364
|
+
showCollaborationOptions,
|
|
335
365
|
extraSections,
|
|
336
366
|
setIsInserterOpened,
|
|
337
367
|
setIsListViewOpened,
|
|
@@ -8,21 +8,33 @@ import { useEffect } from '@wordpress/element';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import
|
|
11
|
+
import { store as editorStore } from '../../store';
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
import usePostContentBlockTypes from './use-post-content-block-types';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Component that when rendered, makes it so that the site editor allows only
|
|
15
17
|
* page content to be edited.
|
|
16
18
|
*/
|
|
17
19
|
export default function DisableNonPageContentBlocks() {
|
|
18
|
-
const
|
|
19
|
-
const { templateParts } = useSelect(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const postContentBlockTypes = usePostContentBlockTypes();
|
|
21
|
+
const { contentOnlyIds, templateParts } = useSelect(
|
|
22
|
+
( select ) => {
|
|
23
|
+
const { getPostBlocksByName } = unlock( select( editorStore ) );
|
|
24
|
+
const { getBlocksByName } = select( blockEditorStore );
|
|
25
|
+
return {
|
|
26
|
+
contentOnlyIds: getPostBlocksByName( postContentBlockTypes ),
|
|
27
|
+
templateParts: getBlocksByName( 'core/template-part' ),
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
[ postContentBlockTypes ]
|
|
31
|
+
);
|
|
32
|
+
// This is a separate `useSelect` because `templatePartChildren` is
|
|
33
|
+
// derived via flatMap, which always produces a new array. Combining it
|
|
34
|
+
// with the above subscription causes an infinite render loop: the new
|
|
35
|
+
// array fails useSelect's shallow equality check → re-render → effect
|
|
36
|
+
// fires setBlockEditingMode → store changes → useSelect re-runs → …
|
|
37
|
+
const templatePartChildren = useSelect(
|
|
26
38
|
( select ) => {
|
|
27
39
|
const { getBlockOrder } = select( blockEditorStore );
|
|
28
40
|
return templateParts.flatMap( ( clientId ) =>
|
|
@@ -34,14 +46,11 @@ export default function DisableNonPageContentBlocks() {
|
|
|
34
46
|
|
|
35
47
|
const registry = useRegistry();
|
|
36
48
|
|
|
37
|
-
// The
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
// It's also unlikely that these different types of blocks are being inserted
|
|
44
|
-
// or removed at the same time, so using different effects reflects that.
|
|
49
|
+
// The effects below are split so that changes to one group of blocks
|
|
50
|
+
// don't cause unnecessary set/unset cycles for the others. For example,
|
|
51
|
+
// the root block ('') editing mode only needs to be set once.
|
|
52
|
+
// Child blocks of templates and templateParts are also loaded separately,
|
|
53
|
+
// so these are kept in separate effects.
|
|
45
54
|
useEffect( () => {
|
|
46
55
|
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
47
56
|
registry.dispatch( blockEditorStore );
|
|
@@ -53,25 +62,6 @@ export default function DisableNonPageContentBlocks() {
|
|
|
53
62
|
};
|
|
54
63
|
}, [ registry ] );
|
|
55
64
|
|
|
56
|
-
useEffect( () => {
|
|
57
|
-
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
58
|
-
registry.dispatch( blockEditorStore );
|
|
59
|
-
|
|
60
|
-
registry.batch( () => {
|
|
61
|
-
for ( const clientId of contentOnlyIds ) {
|
|
62
|
-
setBlockEditingMode( clientId, 'contentOnly' );
|
|
63
|
-
}
|
|
64
|
-
} );
|
|
65
|
-
|
|
66
|
-
return () => {
|
|
67
|
-
registry.batch( () => {
|
|
68
|
-
for ( const clientId of contentOnlyIds ) {
|
|
69
|
-
unsetBlockEditingMode( clientId );
|
|
70
|
-
}
|
|
71
|
-
} );
|
|
72
|
-
};
|
|
73
|
-
}, [ contentOnlyIds, registry ] );
|
|
74
|
-
|
|
75
65
|
useEffect( () => {
|
|
76
66
|
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
77
67
|
registry.dispatch( blockEditorStore );
|
|
@@ -95,20 +85,32 @@ export default function DisableNonPageContentBlocks() {
|
|
|
95
85
|
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
96
86
|
registry.dispatch( blockEditorStore );
|
|
97
87
|
|
|
88
|
+
const contentOnlySet = new Set( contentOnlyIds );
|
|
89
|
+
|
|
98
90
|
registry.batch( () => {
|
|
99
|
-
for ( const clientId of
|
|
100
|
-
setBlockEditingMode( clientId, '
|
|
91
|
+
for ( const clientId of contentOnlyIds ) {
|
|
92
|
+
setBlockEditingMode( clientId, 'contentOnly' );
|
|
93
|
+
}
|
|
94
|
+
for ( const clientId of templatePartChildren ) {
|
|
95
|
+
if ( ! contentOnlySet.has( clientId ) ) {
|
|
96
|
+
setBlockEditingMode( clientId, 'disabled' );
|
|
97
|
+
}
|
|
101
98
|
}
|
|
102
99
|
} );
|
|
103
100
|
|
|
104
101
|
return () => {
|
|
105
102
|
registry.batch( () => {
|
|
106
|
-
for ( const clientId of
|
|
103
|
+
for ( const clientId of contentOnlyIds ) {
|
|
107
104
|
unsetBlockEditingMode( clientId );
|
|
108
105
|
}
|
|
106
|
+
for ( const clientId of templatePartChildren ) {
|
|
107
|
+
if ( ! contentOnlySet.has( clientId ) ) {
|
|
108
|
+
unsetBlockEditingMode( clientId );
|
|
109
|
+
}
|
|
110
|
+
}
|
|
109
111
|
} );
|
|
110
112
|
};
|
|
111
|
-
}, [
|
|
113
|
+
}, [ contentOnlyIds, templatePartChildren, registry ] );
|
|
112
114
|
|
|
113
115
|
return null;
|
|
114
116
|
}
|