@wordpress/editor 14.45.0 → 14.45.2-next.v.202605131032.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +12 -0
- package/build/components/collab-sidebar/index.cjs +42 -25
- package/build/components/collab-sidebar/index.cjs.map +2 -2
- package/build/components/collab-sidebar/note-thread.cjs +19 -9
- package/build/components/collab-sidebar/note-thread.cjs.map +2 -2
- package/build/components/collab-sidebar/notes.cjs +8 -6
- package/build/components/collab-sidebar/notes.cjs.map +2 -2
- package/build/components/collab-sidebar/utils.cjs +24 -9
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-presence/index.cjs +0 -10
- package/build/components/collaborators-presence/index.cjs.map +3 -3
- package/build/components/collaborators-presence/list.cjs +0 -10
- package/build/components/collaborators-presence/list.cjs.map +3 -3
- package/build/components/post-last-revision/index.cjs +5 -0
- package/build/components/post-last-revision/index.cjs.map +2 -2
- package/build/components/post-publish-panel/index.cjs +112 -124
- package/build/components/post-publish-panel/index.cjs.map +3 -3
- package/build/components/post-revisions-preview/block-diff.cjs +91 -23
- package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
- package/build/components/post-revisions-preview/diff-markers.cjs +3 -2
- package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-slider.cjs +98 -50
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
- package/build/store/private-actions.cjs +21 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +93 -42
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +15 -0
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs +42 -25
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/note-thread.mjs +24 -10
- package/build-module/components/collab-sidebar/note-thread.mjs.map +2 -2
- package/build-module/components/collab-sidebar/notes.mjs +8 -6
- package/build-module/components/collab-sidebar/notes.mjs.map +2 -2
- package/build-module/components/collab-sidebar/utils.mjs +22 -8
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-presence/index.mjs +0 -10
- package/build-module/components/collaborators-presence/index.mjs.map +3 -3
- package/build-module/components/collaborators-presence/list.mjs +0 -10
- package/build-module/components/collaborators-presence/list.mjs.map +3 -3
- package/build-module/components/post-last-revision/index.mjs +5 -0
- package/build-module/components/post-last-revision/index.mjs.map +2 -2
- package/build-module/components/post-publish-panel/index.mjs +120 -129
- package/build-module/components/post-publish-panel/index.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/block-diff.mjs +91 -23
- package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/diff-markers.mjs +3 -2
- package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +101 -53
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +20 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +95 -43
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +14 -0
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/style-rtl.css +398 -33
- package/build-style/style.css +398 -33
- package/build-types/bindings/api.d.ts +1 -1
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/bindings/pattern-overrides.d.ts +8 -5
- package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
- package/build-types/bindings/post-data.d.ts +8 -5
- package/build-types/bindings/post-data.d.ts.map +1 -1
- package/build-types/bindings/post-meta.d.ts +10 -7
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/bindings/term-data.d.ts +9 -6
- package/build-types/bindings/term-data.d.ts.map +1 -1
- package/build-types/components/autocompleters/index.d.ts +2 -2
- package/build-types/components/autocompleters/index.d.ts.map +1 -1
- package/build-types/components/autocompleters/link.d.ts +6 -10
- package/build-types/components/autocompleters/link.d.ts.map +1 -1
- package/build-types/components/autocompleters/user.d.ts +7 -12
- package/build-types/components/autocompleters/user.d.ts.map +1 -1
- package/build-types/components/autosave-monitor/index.d.ts +28 -4
- package/build-types/components/autosave-monitor/index.d.ts.map +1 -1
- package/build-types/components/block-removal-warnings/index.d.ts +3 -0
- package/build-types/components/block-removal-warnings/index.d.ts.map +1 -1
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +7 -7
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
- package/build-types/components/block-visibility/index.d.ts.map +1 -1
- package/build-types/components/blog-title/index.d.ts.map +1 -1
- package/build-types/components/character-count/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +2 -2
- package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-note.d.ts +2 -2
- package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/board-store.d.ts +1 -1
- package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/constants.d.ts +3 -3
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/floating-container.d.ts +3 -3
- package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts +7 -7
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-byline.d.ts +2 -2
- package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-card.d.ts +3 -3
- package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-form.d.ts +4 -4
- package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +2 -2
- package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-thread.d.ts +5 -5
- package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note.d.ts +4 -4
- package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/notes.d.ts +2 -2
- package/build-types/components/collab-sidebar/notes.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts +17 -24
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/cursor-dom-utils.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/index.d.ts +4 -1
- package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts +1 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/index.d.ts +1 -2
- package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/list.d.ts +1 -2
- package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
- package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -1
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/deprecated.d.ts +82 -53
- package/build-types/components/deprecated.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +3 -3
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -1
- package/build-types/components/document-outline/check.d.ts +2 -2
- package/build-types/components/document-outline/check.d.ts.map +1 -1
- package/build-types/components/document-outline/index.d.ts +2 -2
- package/build-types/components/document-outline/index.d.ts.map +1 -1
- package/build-types/components/document-outline/item.d.ts +5 -5
- package/build-types/components/document-outline/item.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor/index.d.ts +7 -7
- package/build-types/components/editor/index.d.ts.map +1 -1
- package/build-types/components/editor-history/redo.d.ts +11 -2
- package/build-types/components/editor-history/redo.d.ts.map +1 -1
- package/build-types/components/editor-history/undo.d.ts +11 -2
- package/build-types/components/editor-history/undo.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +5 -5
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/editor-notices/index.d.ts +1 -1
- package/build-types/components/editor-notices/index.d.ts.map +1 -1
- package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-record-item.d.ts +1 -1
- package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-type-list.d.ts +2 -2
- package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +10 -1
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts +4 -4
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/error-boundary/index.d.ts +18 -8
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
- package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +1 -1
- package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -1
- package/build-types/components/global-styles/block-link.d.ts +1 -1
- package/build-types/components/global-styles/block-link.d.ts.map +1 -1
- package/build-types/components/global-styles/header.d.ts +2 -2
- package/build-types/components/global-styles/header.d.ts.map +1 -1
- package/build-types/components/global-styles/hooks.d.ts +3 -3
- package/build-types/components/global-styles/hooks.d.ts.map +1 -1
- package/build-types/components/global-styles/index.d.ts +3 -3
- package/build-types/components/global-styles/index.d.ts.map +1 -1
- package/build-types/components/global-styles/menu.d.ts +2 -2
- package/build-types/components/global-styles/menu.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/global-styles-renderer/index.d.ts +1 -1
- package/build-types/components/global-styles-renderer/index.d.ts.map +1 -1
- package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +6 -6
- package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -1
- package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -1
- package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +1 -1
- package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -1
- package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts +3 -3
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/header/header-skeleton.d.ts +5 -5
- package/build-types/components/header/header-skeleton.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts +2 -2
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/index.d.ts +94 -91
- package/build-types/components/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +3 -3
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +3 -3
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -1
- package/build-types/components/list-view-sidebar/index.d.ts.map +1 -1
- package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -1
- package/build-types/components/local-autosave-monitor/index.d.ts +12 -0
- package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
- package/build-types/components/media/index.d.ts +2 -2
- package/build-types/components/media/index.d.ts.map +1 -1
- package/build-types/components/media/media-editor-modal.d.ts.map +1 -1
- package/build-types/components/media/metadata-panel.d.ts.map +1 -1
- package/build-types/components/media/preview.d.ts.map +1 -1
- package/build-types/components/media-categories/index.d.ts +11 -4
- package/build-types/components/media-categories/index.d.ts.map +1 -1
- package/build-types/components/mode-switcher/index.d.ts +1 -1
- package/build-types/components/mode-switcher/index.d.ts.map +1 -1
- package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/more-menu/tools-more-menu-group.d.ts +2 -2
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts +2 -2
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/page-attributes/check.d.ts +3 -3
- package/build-types/components/page-attributes/check.d.ts.map +1 -1
- package/build-types/components/page-attributes/order.d.ts +1 -1
- package/build-types/components/page-attributes/order.d.ts.map +1 -1
- package/build-types/components/page-attributes/panel.d.ts +1 -1
- package/build-types/components/page-attributes/panel.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts +3 -3
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/pattern-duplicate-modal/index.d.ts +1 -1
- package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -1
- package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -1
- package/build-types/components/pattern-rename-modal/index.d.ts +1 -1
- package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts +8 -61
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +5 -5
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts +9 -40
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts +6 -47
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.d.ts +9 -43
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +5 -5
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts +4 -4
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +3 -3
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/post-actions/actions.d.ts +3 -3
- package/build-types/components/post-actions/actions.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts +4 -4
- package/build-types/components/post-actions/index.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-homepage.d.ts +2 -2
- package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-posts-page.d.ts +2 -2
- package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -1
- package/build-types/components/post-author/check.d.ts +2 -2
- package/build-types/components/post-author/check.d.ts.map +1 -1
- package/build-types/components/post-author/combobox.d.ts.map +1 -1
- package/build-types/components/post-author/constants.d.ts +10 -8
- package/build-types/components/post-author/constants.d.ts.map +1 -1
- package/build-types/components/post-author/hook.d.ts +1 -1
- package/build-types/components/post-author/hook.d.ts.map +1 -1
- package/build-types/components/post-author/index.d.ts +2 -2
- package/build-types/components/post-author/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts +1 -1
- package/build-types/components/post-author/panel.d.ts.map +1 -1
- package/build-types/components/post-author/select.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts +7 -7
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-comments/index.d.ts +6 -1
- package/build-types/components/post-comments/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts +1 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-discussion/panel.d.ts +1 -1
- package/build-types/components/post-discussion/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/check.d.ts +3 -3
- package/build-types/components/post-excerpt/check.d.ts.map +1 -1
- package/build-types/components/post-excerpt/index.d.ts +3 -3
- package/build-types/components/post-excerpt/index.d.ts.map +1 -1
- package/build-types/components/post-excerpt/panel.d.ts +2 -2
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.d.ts +6 -43
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
- package/build-types/components/post-featured-image/check.d.ts +3 -3
- package/build-types/components/post-featured-image/check.d.ts.map +1 -1
- package/build-types/components/post-featured-image/index.d.ts +15 -0
- package/build-types/components/post-featured-image/index.d.ts.map +1 -1
- package/build-types/components/post-featured-image/panel.d.ts +1 -1
- package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
- package/build-types/components/post-fields/index.d.ts +1 -1
- package/build-types/components/post-fields/index.d.ts.map +1 -1
- package/build-types/components/post-format/check.d.ts +2 -2
- package/build-types/components/post-format/check.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts +12 -12
- package/build-types/components/post-format/index.d.ts.map +1 -1
- package/build-types/components/post-format/panel.d.ts +2 -2
- package/build-types/components/post-format/panel.d.ts.map +1 -1
- package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/check.d.ts +3 -3
- package/build-types/components/post-last-revision/check.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts +3 -3
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/panel.d.ts +2 -2
- package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts +11 -5
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-panel-row/index.d.ts +1 -1
- package/build-types/components/post-panel-row/index.d.ts.map +1 -1
- package/build-types/components/post-panel-section/index.d.ts +2 -2
- package/build-types/components/post-panel-section/index.d.ts.map +1 -1
- package/build-types/components/post-pending-status/check.d.ts +3 -3
- package/build-types/components/post-pending-status/check.d.ts.map +1 -1
- package/build-types/components/post-pending-status/index.d.ts +1 -1
- package/build-types/components/post-pending-status/index.d.ts.map +1 -1
- package/build-types/components/post-pingbacks/index.d.ts +7 -1
- package/build-types/components/post-pingbacks/index.d.ts.map +1 -1
- package/build-types/components/post-preview-button/index.d.ts +2 -2
- package/build-types/components/post-preview-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/index.d.ts +5 -5
- package/build-types/components/post-publish-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/label.d.ts.map +1 -1
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +1 -1
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts +17 -13
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +1 -1
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +1 -1
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/media-util.d.ts +2 -2
- package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/postpublish.d.ts +2 -2
- package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/prepublish.d.ts +1 -1
- package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -1
- package/build-types/components/post-revisions-panel/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/block-diff.d.ts +1 -1
- package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/diff-format-types.d.ts +2 -2
- package/build-types/components/post-revisions-preview/diff-format-types.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/diff-markers.d.ts +1 -1
- package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/index.d.ts +2 -2
- package/build-types/components/post-revisions-preview/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/preserve-client-ids.d.ts +1 -1
- package/build-types/components/post-revisions-preview/preserve-client-ids.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +1 -1
- 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 +2 -2
- 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 +3 -3
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
- package/build-types/components/post-saved-state/index.d.ts +1 -1
- package/build-types/components/post-saved-state/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/check.d.ts +2 -2
- package/build-types/components/post-schedule/check.d.ts.map +1 -1
- package/build-types/components/post-schedule/index.d.ts +3 -3
- package/build-types/components/post-schedule/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/label.d.ts +4 -4
- package/build-types/components/post-schedule/label.d.ts.map +1 -1
- package/build-types/components/post-schedule/panel.d.ts +1 -1
- package/build-types/components/post-schedule/panel.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts +2 -2
- package/build-types/components/post-status/index.d.ts.map +1 -1
- package/build-types/components/post-sticky/check.d.ts +2 -2
- package/build-types/components/post-sticky/check.d.ts.map +1 -1
- package/build-types/components/post-sticky/index.d.ts +1 -1
- package/build-types/components/post-sticky/index.d.ts.map +1 -1
- package/build-types/components/post-sticky/panel.d.ts +1 -1
- package/build-types/components/post-sticky/panel.d.ts.map +1 -1
- package/build-types/components/post-switch-to-draft-button/index.d.ts +1 -1
- package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
- package/build-types/components/post-sync-status/index.d.ts +1 -1
- package/build-types/components/post-sync-status/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts +2 -2
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +4 -4
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +6 -6
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/index.d.ts +9 -1
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/panel.d.ts +1 -1
- package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
- package/build-types/components/post-template/block-theme.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts +8 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
- package/build-types/components/post-template/create-new-template.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +5 -5
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/build-types/components/post-template/panel.d.ts +1 -1
- package/build-types/components/post-template/panel.d.ts.map +1 -1
- package/build-types/components/post-template/reset-default-template.d.ts.map +1 -1
- package/build-types/components/post-template/swap-template-button.d.ts +1 -1
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
- package/build-types/components/post-text-editor/index.d.ts +1 -1
- package/build-types/components/post-text-editor/index.d.ts.map +1 -1
- package/build-types/components/post-title/constants.d.ts +2 -2
- package/build-types/components/post-title/constants.d.ts.map +1 -1
- package/build-types/components/post-title/index.d.ts +9 -1
- package/build-types/components/post-title/index.d.ts.map +1 -1
- package/build-types/components/post-title/post-title-raw.d.ts +1 -1
- package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -1
- package/build-types/components/post-title/use-post-title.d.ts.map +1 -1
- package/build-types/components/post-transform-panel/hooks.d.ts +1 -1
- package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -1
- package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
- package/build-types/components/post-trash/check.d.ts +2 -2
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-trash/index.d.ts +1 -1
- package/build-types/components/post-trash/index.d.ts.map +1 -1
- package/build-types/components/post-type-support-check/index.d.ts +3 -3
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
- package/build-types/components/post-url/check.d.ts +2 -2
- package/build-types/components/post-url/check.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/label.d.ts +2 -2
- package/build-types/components/post-url/label.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/post-view-link/index.d.ts.map +1 -1
- package/build-types/components/post-visibility/check.d.ts +1 -1
- package/build-types/components/post-visibility/check.d.ts.map +1 -1
- package/build-types/components/post-visibility/index.d.ts +1 -1
- package/build-types/components/post-visibility/index.d.ts.map +1 -1
- package/build-types/components/post-visibility/label.d.ts +1 -1
- package/build-types/components/post-visibility/label.d.ts.map +1 -1
- package/build-types/components/post-visibility/utils.d.ts +1 -1
- package/build-types/components/post-visibility/utils.d.ts.map +1 -1
- package/build-types/components/posts-per-page/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +4 -5
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts +3 -0
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts +33 -33
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -1
- package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +1 -1
- package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +1 -1
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -1
- package/build-types/components/provider/use-post-content-block-types.d.ts.map +1 -1
- package/build-types/components/provider/use-revision-blocks.d.ts +1 -1
- package/build-types/components/provider/use-revision-blocks.d.ts.map +1 -1
- package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
- package/build-types/components/provider/with-registry-provider.d.ts +1 -1
- package/build-types/components/provider/with-registry-provider.d.ts.map +1 -1
- package/build-types/components/resizable-editor/index.d.ts +2 -2
- package/build-types/components/resizable-editor/index.d.ts.map +1 -1
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
- package/build-types/components/revision-author-panel/index.d.ts.map +1 -1
- package/build-types/components/revision-block-diff/index.d.ts.map +1 -1
- package/build-types/components/revision-created-panel/index.d.ts.map +1 -1
- package/build-types/components/revision-diff-panel/index.d.ts.map +1 -1
- package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts +7 -7
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/sidebar/constants.d.ts +4 -4
- package/build-types/components/sidebar/constants.d.ts.map +1 -1
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/header.d.ts +1 -1
- package/build-types/components/sidebar/index.d.ts +3 -3
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/site-discussion/index.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/start-template-options/index.d.ts.map +1 -1
- package/build-types/components/style-book/categories.d.ts +3 -0
- package/build-types/components/style-book/categories.d.ts.map +1 -1
- package/build-types/components/style-book/color-examples.d.ts.map +1 -1
- package/build-types/components/style-book/duotone-examples.d.ts.map +1 -1
- package/build-types/components/style-book/index.d.ts +19 -8
- package/build-types/components/style-book/index.d.ts.map +1 -1
- package/build-types/components/styles-canvas/index.d.ts +2 -2
- package/build-types/components/styles-canvas/index.d.ts.map +1 -1
- package/build-types/components/styles-canvas/revisions.d.ts +1 -1
- package/build-types/components/styles-canvas/style-book.d.ts +1 -1
- package/build-types/components/table-of-contents/index.d.ts +11 -1
- package/build-types/components/table-of-contents/index.d.ts.map +1 -1
- package/build-types/components/table-of-contents/panel.d.ts +1 -1
- package/build-types/components/table-of-contents/panel.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
- package/build-types/components/template-content-panel/index.d.ts.map +1 -1
- package/build-types/components/template-part-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/template-part-menu-items/convert-to-template-part.d.ts +1 -1
- package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -1
- package/build-types/components/template-part-menu-items/index.d.ts.map +1 -1
- package/build-types/components/template-validation-notice/index.d.ts.map +1 -1
- package/build-types/components/text-editor/index.d.ts.map +1 -1
- package/build-types/components/theme-support-check/index.d.ts +2 -2
- package/build-types/components/theme-support-check/index.d.ts.map +1 -1
- package/build-types/components/time-to-read/index.d.ts +1 -1
- package/build-types/components/time-to-read/index.d.ts.map +1 -1
- package/build-types/components/unsaved-changes-warning/index.d.ts +1 -1
- package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts +4 -4
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-edit-content-only-section-exit.d.ts +1 -1
- package/build-types/components/visual-editor/use-edit-content-only-section-exit.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-padding-appender.d.ts +1 -1
- package/build-types/components/visual-editor/use-padding-appender.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts +1 -1
- package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -1
- package/build-types/components/word-count/index.d.ts +1 -1
- package/build-types/components/word-count/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -3
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/dataviews/api.d.ts +6 -6
- package/build-types/dataviews/api.d.ts.map +1 -1
- package/build-types/dataviews/fields/content-preview/index.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +5 -5
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +2 -2
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +3 -9
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
- package/build-types/hooks/index.d.ts +10 -1
- package/build-types/hooks/index.d.ts.map +1 -1
- package/build-types/hooks/pattern-overrides.d.ts +1 -1
- package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
- package/build-types/hooks/use-global-styles-output.d.ts +2 -2
- package/build-types/hooks/use-global-styles-output.d.ts.map +1 -1
- package/build-types/index.d.ts +10 -5
- package/build-types/index.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts +1 -2
- package/build-types/lock-unlock.d.ts.map +1 -1
- package/build-types/private-apis.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +330 -116
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/defaults.d.ts +1 -1
- package/build-types/store/defaults.d.ts.map +1 -1
- package/build-types/store/index.d.ts +77 -9
- package/build-types/store/index.d.ts.map +1 -1
- package/build-types/store/local-autosave.d.ts +3 -3
- package/build-types/store/local-autosave.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +106 -46
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +96 -68
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +47 -52
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +422 -429
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts +3 -3
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/build-types/utils/get-item-title.d.ts +1 -1
- package/build-types/utils/get-item-title.d.ts.map +1 -1
- package/build-types/utils/get-template-info.d.ts +11 -4
- package/build-types/utils/get-template-info.d.ts.map +1 -1
- package/build-types/utils/get-template-part-icon.d.ts +1 -1
- package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
- package/build-types/utils/index.d.ts +6 -3
- package/build-types/utils/index.d.ts.map +1 -1
- package/build-types/utils/media-finalize/index.d.ts.map +1 -1
- package/build-types/utils/media-sideload/index.d.ts +1 -1
- package/build-types/utils/media-sideload/index.d.ts.map +1 -1
- package/build-types/utils/media-upload/index.d.ts +1 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/build-types/utils/media-upload/on-success.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
- package/build-types/utils/search-templates.d.ts +1 -1
- package/build-types/utils/search-templates.d.ts.map +1 -1
- package/build-types/utils/set-nested-value.d.ts.map +1 -1
- package/build-types/utils/terms.d.ts +19 -4
- package/build-types/utils/terms.d.ts.map +1 -1
- package/build-types/utils/url.d.ts +1 -1
- package/build-types/utils/url.d.ts.map +1 -1
- package/package.json +48 -48
- package/src/components/block-visibility/style.scss +2 -2
- package/src/components/collab-sidebar/index.js +48 -36
- package/src/components/collab-sidebar/note-thread.js +28 -10
- package/src/components/collab-sidebar/notes.js +9 -6
- package/src/components/collab-sidebar/style.scss +4 -0
- package/src/components/collab-sidebar/utils.js +41 -14
- package/src/components/collaborators-presence/index.tsx +0 -2
- package/src/components/collaborators-presence/list.tsx +0 -2
- package/src/components/post-last-revision/index.js +5 -0
- package/src/components/post-publish-panel/index.js +149 -156
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +11 -26
- package/src/components/post-publish-panel/test/index.js +41 -23
- package/src/components/post-revisions-preview/block-diff.js +165 -41
- package/src/components/post-revisions-preview/diff-markers.js +12 -9
- package/src/components/post-revisions-preview/revisions-slider.js +130 -71
- package/src/components/post-revisions-preview/style.scss +3 -3
- package/src/components/post-revisions-preview/test/block-diff.js +133 -4
- package/src/components/post-template/style.scss +1 -1
- package/src/components/start-page-options/style.scss +2 -2
- package/src/components/start-template-options/style.scss +2 -2
- package/src/store/private-actions.js +34 -0
- package/src/store/private-selectors.js +127 -51
- package/src/store/reducer.js +21 -0
- package/src/store/selectors.js +6 -0
- package/src/store/test/private-selectors.js +107 -1
- package/src/style.scss +2 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/collaborators-presence/index.tsx"
|
|
4
|
-
"sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tprivateApis,\n\ttype PostEditorAwarenessState,\n} from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport Avatar from './avatar';\nimport AvatarGroup from './avatar-group';\nimport { CollaboratorsList } from './list';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { createCursorRegistry } from '../collaborators-overlay/cursor-registry';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,qBAAkC;AAClC,uBAGO;AACP,kBAA4B;AAE5B,oBAAmB;AACnB,0BAAwB;AACxB,kBAAkC;AAClC,yBAAuB;AACvB,4BAA6B;AAC7B,mBAAqC;AACrC,6BAAqC
|
|
3
|
+
"sources": ["../../../src/components/collaborators-presence/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tprivateApis,\n\ttype PostEditorAwarenessState,\n} from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport Avatar from './avatar';\nimport AvatarGroup from './avatar-group';\nimport { CollaboratorsList } from './list';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { createCursorRegistry } from '../collaborators-overlay/cursor-registry';\nimport { CollaboratorsOverlay } from '../collaborators-overlay';\n\nconst { useActiveCollaborators } = unlock( privateApis );\n\ninterface CollaboratorsPresenceProps {\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * Renders a list of avatars for the active collaborators, with a maximum of 3 visible avatars.\n * Shows a popover with all collaborators on hover.\n *\n * @param props CollaboratorsPresence component props\n * @param props.postId ID of the post\n * @param props.postType Type of the post\n */\nexport function CollaboratorsPresence( {\n\tpostId,\n\tpostType,\n}: CollaboratorsPresenceProps ) {\n\tconst activeCollaborators = useActiveCollaborators(\n\t\tpostId,\n\t\tpostType\n\t) as PostEditorAwarenessState[];\n\n\tconst otherActiveCollaborators = activeCollaborators.filter(\n\t\t( c ) => ! c.isMe\n\t);\n\n\t// Always include self in the list sorted first.\n\tconst collaboratorsForList = useMemo( () => {\n\t\treturn [ ...activeCollaborators ].sort( ( a, b ) => {\n\t\t\tif ( a.isMe && ! b.isMe ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( ! a.isMe && b.isMe ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} );\n\t}, [ activeCollaborators ] );\n\n\tconst [ cursorRegistry ] = useState( createCursorRegistry );\n\n\tconst [ isPopoverVisible, setIsPopoverVisible ] = useState( false );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(\n\t\tnull\n\t);\n\n\t// When there are no other collaborators, this component should not render\n\t// at all. This will always be the case when collaboration is not enabled, but\n\t// also when the current user is the only editor with the post open.\n\tif ( otherActiveCollaborators.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst me = activeCollaborators.find( ( c ) => c.isMe );\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-collaborators-presence\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"editor-collaborators-presence__button\"\n\t\t\t\t\tonClick={ () => setIsPopoverVisible( ! isPopoverVisible ) }\n\t\t\t\t\tisPressed={ isPopoverVisible }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %d: number of online collaborators.\n\t\t\t\t\t\t__( 'Collaborators list, %d online' ),\n\t\t\t\t\t\tcollaboratorsForList.length\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<AvatarGroup max={ 4 }>\n\t\t\t\t\t\t{ me && (\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\tkey={ me.clientId }\n\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\tme.collaboratorInfo.avatar_urls\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tname={ me.collaboratorInfo.name }\n\t\t\t\t\t\t\t\tborderColor=\"var(--wp-admin-theme-color)\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ otherActiveCollaborators.map(\n\t\t\t\t\t\t\t( collaboratorState ) => (\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AvatarGroup>\n\t\t\t\t</Button>\n\t\t\t\t{ isPopoverVisible && (\n\t\t\t\t\t<CollaboratorsList\n\t\t\t\t\t\tactiveCollaborators={ collaboratorsForList }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tsetIsPopoverVisible={ setIsPopoverVisible }\n\t\t\t\t\t\tcursorRegistry={ cursorRegistry }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<CollaboratorsOverlay\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tcursorRegistry={ cursorRegistry }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,qBAAkC;AAClC,uBAGO;AACP,kBAA4B;AAE5B,oBAAmB;AACnB,0BAAwB;AACxB,kBAAkC;AAClC,yBAAuB;AACvB,4BAA6B;AAC7B,mBAAqC;AACrC,6BAAqC;AACrC,mCAAqC;AA4DnC;AA1DF,IAAM,EAAE,uBAAuB,QAAI,2BAAQ,4BAAY;AAehD,SAAS,sBAAuB;AAAA,EACtC;AAAA,EACA;AACD,GAAgC;AAC/B,QAAM,sBAAsB;AAAA,IAC3B;AAAA,IACA;AAAA,EACD;AAEA,QAAM,2BAA2B,oBAAoB;AAAA,IACpD,CAAE,MAAO,CAAE,EAAE;AAAA,EACd;AAGA,QAAM,2BAAuB,wBAAS,MAAM;AAC3C,WAAO,CAAE,GAAG,mBAAoB,EAAE,KAAM,CAAE,GAAG,MAAO;AACnD,UAAK,EAAE,QAAQ,CAAE,EAAE,MAAO;AACzB,eAAO;AAAA,MACR;AACA,UAAK,CAAE,EAAE,QAAQ,EAAE,MAAO;AACzB,eAAO;AAAA,MACR;AACA,aAAO;AAAA,IACR,CAAE;AAAA,EACH,GAAG,CAAE,mBAAoB,CAAE;AAE3B,QAAM,CAAE,cAAe,QAAI,yBAAU,2CAAqB;AAE1D,QAAM,CAAE,kBAAkB,mBAAoB,QAAI,yBAAU,KAAM;AAClE,QAAM,CAAE,eAAe,gBAAiB,QAAI;AAAA,IAC3C;AAAA,EACD;AAKA,MAAK,yBAAyB,WAAW,GAAI;AAC5C,WAAO;AAAA,EACR;AAEA,QAAM,KAAK,oBAAoB,KAAM,CAAE,MAAO,EAAE,IAAK;AAErD,SACC,4EACC;AAAA,iDAAC,SAAI,WAAU,iCACd;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,uBAAqB;AAAA,UACrB,WAAU;AAAA,UACV,SAAU,MAAM,oBAAqB,CAAE,gBAAiB;AAAA,UACxD,WAAY;AAAA,UACZ,KAAM;AAAA,UACN,kBAAa;AAAA;AAAA,gBAEZ,gBAAI,+BAAgC;AAAA,YACpC,qBAAqB;AAAA,UACtB;AAAA,UAEA,uDAAC,oBAAAA,SAAA,EAAY,KAAM,GAChB;AAAA,kBACD;AAAA,cAAC,cAAAC;AAAA,cAAA;AAAA,gBAEA,SAAM;AAAA,kBACL,GAAG,iBAAiB;AAAA,gBACrB;AAAA,gBACA,MAAO,GAAG,iBAAiB;AAAA,gBAC3B,aAAY;AAAA,gBACZ,MAAK;AAAA;AAAA,cANC,GAAG;AAAA,YAOV;AAAA,YAEC,yBAAyB;AAAA,cAC1B,CAAE,sBACD;AAAA,gBAAC,cAAAA;AAAA,gBAAA;AAAA,kBAEA,SAAM;AAAA,oBACL,kBAAkB,iBAChB;AAAA,kBACH;AAAA,kBACA,MACC,kBAAkB,iBAAiB;AAAA,kBAEpC,iBAAc;AAAA,oBACb,kBAAkB,iBAAiB;AAAA,kBACpC;AAAA,kBACA,MAAK;AAAA;AAAA,gBAXC,kBAAkB;AAAA,cAYzB;AAAA,YAEF;AAAA,aACD;AAAA;AAAA,MACD;AAAA,MACE,oBACD;AAAA,QAAC;AAAA;AAAA,UACA,qBAAsB;AAAA,UACtB;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["AvatarGroup", "Avatar"]
|
|
7
7
|
}
|
|
@@ -40,16 +40,6 @@ var import_a11y = require("@wordpress/a11y");
|
|
|
40
40
|
var import_avatar = __toESM(require("./avatar/index.cjs"));
|
|
41
41
|
var import_get_avatar_url = require("../collaborators-overlay/get-avatar-url.cjs");
|
|
42
42
|
var import_utils = require("../collab-sidebar/utils.cjs");
|
|
43
|
-
|
|
44
|
-
// packages/editor/src/components/collaborators-presence/styles/collaborators-list.scss
|
|
45
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='b52a84ee9f']")) {
|
|
46
|
-
const style = document.createElement("style");
|
|
47
|
-
style.setAttribute("data-wp-hash", "b52a84ee9f");
|
|
48
|
-
style.appendChild(document.createTextNode(".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:8px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{display:flex;font-size:13px;font-weight:499;gap:4px;line-height:20px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:32px;padding:0;width:32px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding-bottom:16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);display:flex;gap:8px;padding:12px 16px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#3858e9);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;min-width:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-name{color:#1e1e1e;font-size:13px;font-weight:499;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"));
|
|
49
|
-
document.head.appendChild(style);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// packages/editor/src/components/collaborators-presence/list.tsx
|
|
53
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
44
|
function CollaboratorsList({
|
|
55
45
|
activeCollaborators,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/collaborators-presence/list.tsx"
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Popover, Button } from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { type PostEditorAwarenessState } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\n\nimport Avatar from './avatar';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { type CursorRegistry } from '../collaborators-overlay/cursor-registry';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAChC,mBAA2B;AAE3B,kBAAsB;AAEtB,oBAAmB;AACnB,4BAA6B;AAC7B,mBAAqC
|
|
3
|
+
"sources": ["../../../src/components/collaborators-presence/list.tsx"],
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Popover, Button } from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { type PostEditorAwarenessState } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\n\nimport Avatar from './avatar';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { type CursorRegistry } from '../collaborators-overlay/cursor-registry';\n\ninterface CollaboratorsListProps {\n\tactiveCollaborators: PostEditorAwarenessState[];\n\tpopoverAnchor?: HTMLElement | null;\n\tsetIsPopoverVisible: ( isVisible: boolean ) => void;\n\tcursorRegistry: CursorRegistry;\n}\n\n/**\n * Renders a list showing all active collaborators with their details.\n * When the showCollaborationCursor preference is enabled, the current user\n * is included and expected to be first in the list.\n * @param props Component props\n * @param props.activeCollaborators List of active collaborators\n * @param props.popoverAnchor Anchor element for the popover\n * @param props.setIsPopoverVisible Callback to set the visibility of the popover\n * @param props.cursorRegistry Shared registry for scroll-to-cursor support\n */\nexport function CollaboratorsList( {\n\tactiveCollaborators,\n\tpopoverAnchor,\n\tsetIsPopoverVisible,\n\tcursorRegistry,\n}: CollaboratorsListProps ) {\n\tconst handleCollaboratorClick = ( clientId: number ) => {\n\t\tconst success = cursorRegistry.scrollToCursor( clientId, {\n\t\t\tbehavior: 'smooth',\n\t\t\tblock: 'center',\n\t\t\thighlightDuration: 2000,\n\t\t} );\n\n\t\tif ( success ) {\n\t\t\tspeak( __( 'Scrolled to cursor' ), 'polite' );\n\n\t\t\tsetIsPopoverVisible( false );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Popover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tplacement=\"bottom\"\n\t\t\toffset={ 8 }\n\t\t\tclassName=\"editor-collaborators-presence__list\"\n\t\t\tonClose={ () => setIsPopoverVisible( false ) }\n\t\t>\n\t\t\t<div className=\"editor-collaborators-presence__list-content\">\n\t\t\t\t<div className=\"editor-collaborators-presence__list-header\">\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-title\">\n\t\t\t\t\t\t{ __( 'Collaborators' ) }\n\t\t\t\t\t\t<span>{ activeCollaborators.length }</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-action\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tlabel={ __( 'Close Collaborators List' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsPopoverVisible( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-collaborators-presence__list-items\">\n\t\t\t\t\t{ activeCollaborators.map( ( collaboratorState ) => {\n\t\t\t\t\t\tconst isCurrentUser = collaboratorState.isMe;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\tclassName=\"editor-collaborators-presence__list-item\"\n\t\t\t\t\t\t\t\tdisabled={ isCurrentUser }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\thandleCollaboratorClick(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.clientId\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={\n\t\t\t\t\t\t\t\t\t\tisCurrentUser\n\t\t\t\t\t\t\t\t\t\t\t? 'var(--wp-admin-theme-color)'\n\t\t\t\t\t\t\t\t\t\t\t: getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcollaboratorState\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdimmed={ ! collaboratorState.isConnected }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-info\">\n\t\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-name\">\n\t\t\t\t\t\t\t\t\t\t{ isCurrentUser\n\t\t\t\t\t\t\t\t\t\t\t? __( 'You' )\n\t\t\t\t\t\t\t\t\t\t\t: collaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t\t\t.name }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAgC;AAChC,mBAA2B;AAE3B,kBAAsB;AAEtB,oBAAmB;AACnB,4BAA6B;AAC7B,mBAAqC;AAkDhC;AA9BE,SAAS,kBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAA4B;AAC3B,QAAM,0BAA0B,CAAE,aAAsB;AACvD,UAAM,UAAU,eAAe,eAAgB,UAAU;AAAA,MACxD,UAAU;AAAA,MACV,OAAO;AAAA,MACP,mBAAmB;AAAA,IACpB,CAAE;AAEF,QAAK,SAAU;AACd,iCAAO,gBAAI,oBAAqB,GAAG,QAAS;AAE5C,0BAAqB,KAAM;AAAA,IAC5B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,QAAS;AAAA,MACT,WAAU;AAAA,MACV,QAAS;AAAA,MACT,WAAU;AAAA,MACV,SAAU,MAAM,oBAAqB,KAAM;AAAA,MAE3C,uDAAC,SAAI,WAAU,+CACd;AAAA,qDAAC,SAAI,WAAU,8CACd;AAAA,uDAAC,SAAI,WAAU,oDACZ;AAAA,gCAAI,eAAgB;AAAA,YACtB,4CAAC,UAAO,8BAAoB,QAAQ;AAAA,aACrC;AAAA,UACA,4CAAC,SAAI,WAAU,qDACd;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,MAAO;AAAA,cACP,UAAW;AAAA,cACX,WAAQ,gBAAI,0BAA2B;AAAA,cACvC,SAAU,MAAM,oBAAqB,KAAM;AAAA;AAAA,UAC5C,GACD;AAAA,WACD;AAAA,QACA,4CAAC,SAAI,WAAU,6CACZ,8BAAoB,IAAK,CAAE,sBAAuB;AACnD,gBAAM,gBAAgB,kBAAkB;AACxC,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA,WAAU;AAAA,cACV,UAAW;AAAA,cACX,SAAU,MACT;AAAA,gBACC,kBAAkB;AAAA,cACnB;AAAA,cAGD;AAAA;AAAA,kBAAC,cAAAA;AAAA,kBAAA;AAAA,oBACA,SAAM;AAAA,sBACL,kBAAkB,iBAChB;AAAA,oBACH;AAAA,oBACA,MACC,kBAAkB,iBAAiB;AAAA,oBAEpC,aACC,gBACG,oCACA;AAAA,sBACA,kBACE,iBAAiB;AAAA,oBACnB;AAAA,oBAEJ,QAAS,CAAE,kBAAkB;AAAA;AAAA,gBAC9B;AAAA,gBACA,4CAAC,SAAI,WAAU,iDACd,sDAAC,SAAI,WAAU,iDACZ,8BACC,gBAAI,KAAM,IACV,kBAAkB,iBACjB,MACL,GACD;AAAA;AAAA;AAAA,YAlCM,kBAAkB;AAAA,UAmCzB;AAAA,QAEF,CAAE,GACH;AAAA,SACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["Avatar"]
|
|
7
7
|
}
|
|
@@ -80,6 +80,11 @@ function PrivatePostLastRevision() {
|
|
|
80
80
|
onClick: () => setCurrentRevisionId(lastRevisionId),
|
|
81
81
|
className: "editor-private-post-last-revision__button",
|
|
82
82
|
text: revisionsCount,
|
|
83
|
+
"aria-label": (0, import_i18n.sprintf)(
|
|
84
|
+
/* translators: %s: number of revisions. */
|
|
85
|
+
(0, import_i18n.__)("Open revisions screen: %s revisions"),
|
|
86
|
+
revisionsCount
|
|
87
|
+
),
|
|
83
88
|
variant: "tertiary",
|
|
84
89
|
size: "compact"
|
|
85
90
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-last-revision/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default PostLastRevision;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAAuB;AACvB,kBAAuC;AACvC,mBAAuB;AAKvB,mBAAkC;AAClC,4BAAyB;AACzB,mBAAqC;AACrC,yBAAuB;AAwBpB;AAtBH,SAAS,0BAA0B;AAClC,aAAO,uBAAW,CAAE,WAAY;AAC/B,UAAM,EAAE,8BAA8B,6BAA6B,IAClE,OAAQ,aAAAA,KAAY;AACrB,WAAO;AAAA,MACN,gBAAgB,6BAA6B;AAAA,MAC7C,gBAAgB,6BAA6B;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACP;AAOA,SAAS,mBAAmB;AAC3B,QAAM,EAAE,gBAAgB,eAAe,IAAI,wBAAwB;AACnE,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAA,KAAY,CAAE;AAEpE,SACC,4CAAC,aAAAC,SAAA,EACA;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,SAAU,MAAM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,cAAa;AAAA,MACb,UAAO;AAAA;AAAA,YAEN,gBAAI,gBAAiB;AAAA,QACrB;AAAA,MACD;AAAA;AAAA,EACD,GACD;AAEF;AAEO,SAAS,0BAA0B;AACzC,QAAM,EAAE,gBAAgB,eAAe,IAAI,wBAAwB;AACnE,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAD,KAAY,CAAE;AAEpE,SACC,4CAAC,aAAAC,SAAA,EACA,sDAAC,sBAAAC,SAAA,EAAa,WAAQ,gBAAI,WAAY,GACrC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA;AAAA,EACN,GACD,GACD;AAEF;AAEA,IAAO,6BAAQ;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t\t__( 'Open revisions screen: %s revisions' ),\n\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t) }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default PostLastRevision;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAAuB;AACvB,kBAAuC;AACvC,mBAAuB;AAKvB,mBAAkC;AAClC,4BAAyB;AACzB,mBAAqC;AACrC,yBAAuB;AAwBpB;AAtBH,SAAS,0BAA0B;AAClC,aAAO,uBAAW,CAAE,WAAY;AAC/B,UAAM,EAAE,8BAA8B,6BAA6B,IAClE,OAAQ,aAAAA,KAAY;AACrB,WAAO;AAAA,MACN,gBAAgB,6BAA6B;AAAA,MAC7C,gBAAgB,6BAA6B;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACP;AAOA,SAAS,mBAAmB;AAC3B,QAAM,EAAE,gBAAgB,eAAe,IAAI,wBAAwB;AACnE,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAA,KAAY,CAAE;AAEpE,SACC,4CAAC,aAAAC,SAAA,EACA;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,SAAU,MAAM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,cAAa;AAAA,MACb,UAAO;AAAA;AAAA,YAEN,gBAAI,gBAAiB;AAAA,QACrB;AAAA,MACD;AAAA;AAAA,EACD,GACD;AAEF;AAEO,SAAS,0BAA0B;AACzC,QAAM,EAAE,gBAAgB,eAAe,IAAI,wBAAwB;AACnE,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAD,KAAY,CAAE;AAEpE,SACC,4CAAC,aAAAC,SAAA,EACA,sDAAC,sBAAAC,SAAA,EAAa,WAAQ,gBAAI,WAAY,GACrC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM,qBAAsB,cAAe;AAAA,MACrD,WAAU;AAAA,MACV,MAAO;AAAA,MACP,kBAAa;AAAA;AAAA,YAEZ,gBAAI,qCAAsC;AAAA,QAC1C;AAAA,MACD;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA;AAAA,EACN,GACD,GACD;AAEF;AAEA,IAAO,6BAAQ;",
|
|
6
6
|
"names": ["editorStore", "PostLastRevisionCheck", "PostPanelRow"]
|
|
7
7
|
}
|
|
@@ -30,8 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// packages/editor/src/components/post-publish-panel/index.js
|
|
31
31
|
var post_publish_panel_exports = {};
|
|
32
32
|
__export(post_publish_panel_exports, {
|
|
33
|
-
|
|
34
|
-
default: () => post_publish_panel_default
|
|
33
|
+
default: () => PostPublishPanel
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(post_publish_panel_exports);
|
|
37
36
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -46,104 +45,25 @@ var import_prepublish = __toESM(require("./prepublish.cjs"));
|
|
|
46
45
|
var import_postpublish = __toESM(require("./postpublish.cjs"));
|
|
47
46
|
var import_store = require("../../store/index.cjs");
|
|
48
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
onSubmit() {
|
|
69
|
-
const { onClose, hasPublishAction, isPostTypeViewable } = this.props;
|
|
70
|
-
if (!hasPublishAction || !isPostTypeViewable) {
|
|
71
|
-
onClose();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
render() {
|
|
75
|
-
const {
|
|
76
|
-
forceIsDirty,
|
|
77
|
-
isBeingScheduled,
|
|
78
|
-
isPublished,
|
|
79
|
-
isPublishSidebarEnabled,
|
|
80
|
-
isScheduled,
|
|
81
|
-
isSaving,
|
|
82
|
-
isSavingNonPostEntityChanges,
|
|
83
|
-
onClose,
|
|
84
|
-
onTogglePublishSidebar,
|
|
85
|
-
PostPublishExtension,
|
|
86
|
-
PrePublishExtension,
|
|
87
|
-
currentPostId,
|
|
88
|
-
...additionalProps
|
|
89
|
-
} = this.props;
|
|
90
|
-
const {
|
|
91
|
-
hasPublishAction,
|
|
92
|
-
isDirty,
|
|
93
|
-
isPostTypeViewable,
|
|
94
|
-
...propsForPanel
|
|
95
|
-
} = additionalProps;
|
|
96
|
-
const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
|
|
97
|
-
const isPrePublish = !isPublishedOrScheduled && !isSaving;
|
|
98
|
-
const isPostPublish = isPublishedOrScheduled && !isSaving;
|
|
99
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-publish-panel", ...propsForPanel, children: [
|
|
100
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header", children: isPostPublish ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
-
import_components.Button,
|
|
102
|
-
{
|
|
103
|
-
size: "compact",
|
|
104
|
-
onClick: onClose,
|
|
105
|
-
icon: import_icons.closeSmall,
|
|
106
|
-
label: (0, import_i18n.__)("Close panel")
|
|
107
|
-
}
|
|
108
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
109
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-cancel-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
-
import_components.Button,
|
|
111
|
-
{
|
|
112
|
-
ref: this.cancelButtonNode,
|
|
113
|
-
accessibleWhenDisabled: true,
|
|
114
|
-
disabled: isSavingNonPostEntityChanges,
|
|
115
|
-
onClick: onClose,
|
|
116
|
-
variant: "secondary",
|
|
117
|
-
size: "compact",
|
|
118
|
-
children: (0, import_i18n.__)("Cancel")
|
|
119
|
-
}
|
|
120
|
-
) }),
|
|
121
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-publish-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
-
import_post_publish_button.default,
|
|
123
|
-
{
|
|
124
|
-
onSubmit: this.onSubmit,
|
|
125
|
-
forceIsDirty
|
|
126
|
-
}
|
|
127
|
-
) })
|
|
128
|
-
] }) }),
|
|
129
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-publish-panel__content", children: [
|
|
130
|
-
isPrePublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_prepublish.default, { children: PrePublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrePublishExtension, {}) }),
|
|
131
|
-
isPostPublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_postpublish.default, { focusOnMount: true, children: PostPublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PostPublishExtension, {}) }),
|
|
132
|
-
isSaving && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {})
|
|
133
|
-
] }),
|
|
134
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
135
|
-
import_components.CheckboxControl,
|
|
136
|
-
{
|
|
137
|
-
label: (0, import_i18n.__)("Always show pre-publish checks."),
|
|
138
|
-
checked: isPublishSidebarEnabled,
|
|
139
|
-
onChange: onTogglePublishSidebar
|
|
140
|
-
}
|
|
141
|
-
) })
|
|
142
|
-
] });
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
var post_publish_panel_default = (0, import_compose.compose)([
|
|
146
|
-
(0, import_data.withSelect)((select) => {
|
|
48
|
+
function PostPublishPanel({
|
|
49
|
+
forceIsDirty,
|
|
50
|
+
onClose,
|
|
51
|
+
PostPublishExtension,
|
|
52
|
+
PrePublishExtension,
|
|
53
|
+
...propsForPanel
|
|
54
|
+
}) {
|
|
55
|
+
const {
|
|
56
|
+
hasPublishAction,
|
|
57
|
+
isPostTypeViewable,
|
|
58
|
+
isBeingScheduled,
|
|
59
|
+
isDirty,
|
|
60
|
+
isPublished,
|
|
61
|
+
isPublishSidebarEnabled,
|
|
62
|
+
isSaving,
|
|
63
|
+
isSavingNonPostEntityChanges,
|
|
64
|
+
isScheduled,
|
|
65
|
+
currentPostId
|
|
66
|
+
} = (0, import_data.useSelect)((select) => {
|
|
147
67
|
const { getPostType } = select(import_core_data.store);
|
|
148
68
|
const {
|
|
149
69
|
getCurrentPost,
|
|
@@ -155,9 +75,9 @@ var post_publish_panel_default = (0, import_compose.compose)([
|
|
|
155
75
|
isEditedPostDirty,
|
|
156
76
|
isAutosavingPost,
|
|
157
77
|
isSavingPost,
|
|
158
|
-
isSavingNonPostEntityChanges
|
|
78
|
+
isSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,
|
|
79
|
+
isPublishSidebarEnabled: _isPublishSidebarEnabled
|
|
159
80
|
} = select(import_store.store);
|
|
160
|
-
const { isPublishSidebarEnabled } = select(import_store.store);
|
|
161
81
|
const postType = getPostType(getEditedPostAttribute("type"));
|
|
162
82
|
return {
|
|
163
83
|
hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
|
|
@@ -165,30 +85,98 @@ var post_publish_panel_default = (0, import_compose.compose)([
|
|
|
165
85
|
isBeingScheduled: isEditedPostBeingScheduled(),
|
|
166
86
|
isDirty: isEditedPostDirty(),
|
|
167
87
|
isPublished: isCurrentPostPublished(),
|
|
168
|
-
isPublishSidebarEnabled:
|
|
88
|
+
isPublishSidebarEnabled: _isPublishSidebarEnabled(),
|
|
169
89
|
isSaving: isSavingPost() && !isAutosavingPost(),
|
|
170
|
-
isSavingNonPostEntityChanges:
|
|
90
|
+
isSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),
|
|
171
91
|
isScheduled: isCurrentPostScheduled(),
|
|
172
92
|
currentPostId: getCurrentPostId()
|
|
173
93
|
};
|
|
174
|
-
})
|
|
175
|
-
(0, import_data.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
94
|
+
}, []);
|
|
95
|
+
const { disablePublishSidebar, enablePublishSidebar } = (0, import_data.useDispatch)(import_store.store);
|
|
96
|
+
const cancelButtonRef = (0, import_element.useRef)(null);
|
|
97
|
+
const wrapperRef = (0, import_compose.useMergeRefs)([
|
|
98
|
+
(0, import_compose.useFocusReturn)(),
|
|
99
|
+
(0, import_compose.useConstrainedTabbing)()
|
|
100
|
+
]);
|
|
101
|
+
(0, import_element.useEffect)(() => {
|
|
102
|
+
cancelButtonRef.current?.focus();
|
|
103
|
+
}, []);
|
|
104
|
+
const prevPostIdRef = (0, import_element.useRef)(currentPostId);
|
|
105
|
+
const stableOnClose = (0, import_compose.useEvent)(onClose);
|
|
106
|
+
(0, import_element.useEffect)(() => {
|
|
107
|
+
const postChanged = currentPostId !== prevPostIdRef.current;
|
|
108
|
+
prevPostIdRef.current = currentPostId;
|
|
109
|
+
if (postChanged || isPublished && !isSaving && isDirty) {
|
|
110
|
+
stableOnClose();
|
|
111
|
+
}
|
|
112
|
+
}, [isPublished, isSaving, isDirty, currentPostId, stableOnClose]);
|
|
113
|
+
function onTogglePublishSidebar() {
|
|
114
|
+
if (isPublishSidebarEnabled) {
|
|
115
|
+
disablePublishSidebar();
|
|
116
|
+
} else {
|
|
117
|
+
enablePublishSidebar();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function onSubmit() {
|
|
121
|
+
if (!hasPublishAction || !isPostTypeViewable) {
|
|
122
|
+
onClose();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
|
|
126
|
+
const isPrePublish = !isPublishedOrScheduled && !isSaving;
|
|
127
|
+
const isPostPublish = isPublishedOrScheduled && !isSaving;
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref: wrapperRef,
|
|
132
|
+
tabIndex: -1,
|
|
133
|
+
className: "editor-post-publish-panel",
|
|
134
|
+
...propsForPanel,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header", children: isPostPublish ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
import_components.Button,
|
|
138
|
+
{
|
|
139
|
+
size: "compact",
|
|
140
|
+
onClick: onClose,
|
|
141
|
+
icon: import_icons.closeSmall,
|
|
142
|
+
label: (0, import_i18n.__)("Close panel")
|
|
143
|
+
}
|
|
144
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-cancel-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
146
|
+
import_components.Button,
|
|
147
|
+
{
|
|
148
|
+
ref: cancelButtonRef,
|
|
149
|
+
accessibleWhenDisabled: true,
|
|
150
|
+
disabled: isSavingNonPostEntityChanges,
|
|
151
|
+
onClick: onClose,
|
|
152
|
+
variant: "secondary",
|
|
153
|
+
size: "compact",
|
|
154
|
+
children: (0, import_i18n.__)("Cancel")
|
|
155
|
+
}
|
|
156
|
+
) }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__header-publish-button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
import_post_publish_button.default,
|
|
159
|
+
{
|
|
160
|
+
onSubmit,
|
|
161
|
+
forceIsDirty
|
|
162
|
+
}
|
|
163
|
+
) })
|
|
164
|
+
] }) }),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-publish-panel__content", children: [
|
|
166
|
+
isPrePublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_prepublish.default, { children: PrePublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrePublishExtension, {}) }),
|
|
167
|
+
isPostPublish && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_postpublish.default, { focusOnMount: true, children: PostPublishExtension && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PostPublishExtension, {}) }),
|
|
168
|
+
isSaving && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {})
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-publish-panel__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
171
|
+
import_components.CheckboxControl,
|
|
172
|
+
{
|
|
173
|
+
label: (0, import_i18n.__)("Always show pre-publish checks."),
|
|
174
|
+
checked: isPublishSidebarEnabled,
|
|
175
|
+
onChange: onTogglePublishSidebar
|
|
176
|
+
}
|
|
177
|
+
) })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
194
182
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { Button, Spinner, CheckboxControl } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseConstrainedTabbing,\n\tuseEvent,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders a panel for publishing a post.\n *\n * @param {Object} props Component props.\n * @param {boolean} [props.forceIsDirty] Whether to force the dirty state.\n * @param {()=>void} props.onClose Called when the panel requests to close.\n * @param {React.ComponentType} [props.PostPublishExtension] Component rendered after publishing.\n * @param {React.ComponentType} [props.PrePublishExtension] Component rendered before publishing.\n *\n * @return {React.JSX.Element} The post publish panel.\n */\nexport default function PostPublishPanel( {\n\tforceIsDirty,\n\tonClose,\n\tPostPublishExtension,\n\tPrePublishExtension,\n\t...propsForPanel\n} ) {\n\tconst {\n\t\thasPublishAction,\n\t\tisPostTypeViewable,\n\t\tisBeingScheduled,\n\t\tisDirty,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisSaving,\n\t\tisSavingNonPostEntityChanges,\n\t\tisScheduled,\n\t\tcurrentPostId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled,\n\t\t} = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\n\tconst cancelButtonRef = useRef( null );\n\tconst wrapperRef = useMergeRefs( [\n\t\tuseFocusReturn(),\n\t\tuseConstrainedTabbing(),\n\t] );\n\n\tuseEffect( () => {\n\t\tcancelButtonRef.current?.focus();\n\t}, [] );\n\n\t// Auto-collapse the publish sidebar when a post is published and the user\n\t// makes an edit, or when the edited post changes. The panel only mounts\n\t// for unpublished posts, so `isPublished && isDirty` cannot be true on\n\t// mount \u2014 it implies a publish-then-edit transition.\n\tconst prevPostIdRef = useRef( currentPostId );\n\tconst stableOnClose = useEvent( onClose );\n\tuseEffect( () => {\n\t\tconst postChanged = currentPostId !== prevPostIdRef.current;\n\t\tprevPostIdRef.current = currentPostId;\n\n\t\tif ( postChanged || ( isPublished && ! isSaving && isDirty ) ) {\n\t\t\tstableOnClose();\n\t\t}\n\t}, [ isPublished, isSaving, isDirty, currentPostId, stableOnClose ] );\n\n\tfunction onTogglePublishSidebar() {\n\t\tif ( isPublishSidebarEnabled ) {\n\t\t\tdisablePublishSidebar();\n\t\t} else {\n\t\t\tenablePublishSidebar();\n\t\t}\n\t}\n\n\tfunction onSubmit() {\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tconst isPublishedOrScheduled =\n\t\tisPublished || ( isScheduled && isBeingScheduled );\n\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\n\treturn (\n\t\t<div\n\t\t\tref={ wrapperRef }\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName=\"editor-post-publish-panel\"\n\t\t\t{ ...propsForPanel }\n\t\t>\n\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ cancelButtonRef }\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\tonSubmit={ onSubmit }\n\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t) }\n\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t) }\n\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,qBAAkC;AAClC,wBAAiD;AACjD,kBAAuC;AACvC,qBAKO;AACP,mBAA2B;AAC3B,uBAAmC;AAKnC,iCAA8B;AAC9B,wBAAuC;AACvC,yBAAwC;AACxC,mBAAqC;AAuHhC;AA1GU,SAAR,iBAAmC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,YAAY,IAAI,OAAQ,iBAAAA,KAAU;AAC1C,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,8BAA8B;AAAA,MAC9B,yBAAyB;AAAA,IAC1B,IAAI,OAAQ,aAAAC,KAAY;AACxB,UAAM,WAAW,YAAa,uBAAwB,MAAO,CAAE;AAE/D,WAAO;AAAA,MACN,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,oBAAoB,UAAU;AAAA,MAC9B,kBAAkB,2BAA2B;AAAA,MAC7C,SAAS,kBAAkB;AAAA,MAC3B,aAAa,uBAAuB;AAAA,MACpC,yBAAyB,yBAAyB;AAAA,MAClD,UAAU,aAAa,KAAK,CAAE,iBAAiB;AAAA,MAC/C,8BAA8B,8BAA8B;AAAA,MAC5D,aAAa,uBAAuB;AAAA,MACpC,eAAe,iBAAiB;AAAA,IACjC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,EAAE,uBAAuB,qBAAqB,QACnD,yBAAa,aAAAA,KAAY;AAE1B,QAAM,sBAAkB,uBAAQ,IAAK;AACrC,QAAM,iBAAa,6BAAc;AAAA,QAChC,+BAAe;AAAA,QACf,sCAAsB;AAAA,EACvB,CAAE;AAEF,gCAAW,MAAM;AAChB,oBAAgB,SAAS,MAAM;AAAA,EAChC,GAAG,CAAC,CAAE;AAMN,QAAM,oBAAgB,uBAAQ,aAAc;AAC5C,QAAM,oBAAgB,yBAAU,OAAQ;AACxC,gCAAW,MAAM;AAChB,UAAM,cAAc,kBAAkB,cAAc;AACpD,kBAAc,UAAU;AAExB,QAAK,eAAiB,eAAe,CAAE,YAAY,SAAY;AAC9D,oBAAc;AAAA,IACf;AAAA,EACD,GAAG,CAAE,aAAa,UAAU,SAAS,eAAe,aAAc,CAAE;AAEpE,WAAS,yBAAyB;AACjC,QAAK,yBAA0B;AAC9B,4BAAsB;AAAA,IACvB,OAAO;AACN,2BAAqB;AAAA,IACtB;AAAA,EACD;AAEA,WAAS,WAAW;AACnB,QAAK,CAAE,oBAAoB,CAAE,oBAAqB;AACjD,cAAQ;AAAA,IACT;AAAA,EACD;AAEA,QAAM,yBACL,eAAiB,eAAe;AACjC,QAAM,eAAe,CAAE,0BAA0B,CAAE;AACnD,QAAM,gBAAgB,0BAA0B,CAAE;AAElD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,KAAM;AAAA,MACN,UAAW;AAAA,MACX,WAAU;AAAA,MACR,GAAG;AAAA,MAEL;AAAA,oDAAC,SAAI,WAAU,qCACZ,0BACD;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,SAAU;AAAA,YACV,MAAO;AAAA,YACP,WAAQ,gBAAI,aAAc;AAAA;AAAA,QAC3B,IAEA,4EACC;AAAA,sDAAC,SAAI,WAAU,mDACd;AAAA,YAAC;AAAA;AAAA,cACA,KAAM;AAAA,cACN,wBAAsB;AAAA,cACtB,UAAW;AAAA,cACX,SAAU;AAAA,cACV,SAAQ;AAAA,cACR,MAAK;AAAA,cAEH,8BAAI,QAAS;AAAA;AAAA,UAChB,GACD;AAAA,UACA,4CAAC,SAAI,WAAU,oDACd;AAAA,YAAC,2BAAAC;AAAA,YAAA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACD,GACD;AAAA,WACD,GAEF;AAAA,QACA,6CAAC,SAAI,WAAU,sCACZ;AAAA,0BACD,4CAAC,kBAAAC,SAAA,EACE,iCAAuB,4CAAC,uBAAoB,GAC/C;AAAA,UAEC,iBACD,4CAAC,mBAAAC,SAAA,EAA4B,cAAY,MACtC,kCAAwB,4CAAC,wBAAqB,GACjD;AAAA,UAEC,YAAY,4CAAC,6BAAQ;AAAA,WACxB;AAAA,QACA,4CAAC,SAAI,WAAU,qCACd;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,iCAAkC;AAAA,YAC9C,SAAU;AAAA,YACV,UAAW;AAAA;AAAA,QACZ,GACD;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["coreStore", "editorStore", "PostPublishButton", "PostPublishPanelPrepublish", "PostPublishPanelPostpublish"]
|
|
7
7
|
}
|
|
@@ -47,10 +47,33 @@ function textSimilarity(text1, text2) {
|
|
|
47
47
|
if (!text1 || !text2) {
|
|
48
48
|
return 0;
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const segmenter = new Intl.Segmenter(void 0, {
|
|
51
|
+
granularity: "word"
|
|
52
|
+
});
|
|
53
|
+
const wordLikeRegex = /[\p{L}\p{N}]/u;
|
|
54
|
+
const getWords = (text) => {
|
|
55
|
+
const words = [];
|
|
56
|
+
for (const { segment, isWordLike } of segmenter.segment(text)) {
|
|
57
|
+
if (isWordLike || wordLikeRegex.test(segment)) {
|
|
58
|
+
words.push(segment);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return words;
|
|
62
|
+
};
|
|
63
|
+
const words1 = getWords(text1);
|
|
64
|
+
const words2 = getWords(text2);
|
|
65
|
+
if (words1.length === 0 && words2.length === 0) {
|
|
66
|
+
return 1;
|
|
67
|
+
}
|
|
68
|
+
const set1 = new Set(words1);
|
|
69
|
+
let intersection = 0;
|
|
70
|
+
for (const word of words2) {
|
|
71
|
+
if (set1.has(word)) {
|
|
72
|
+
intersection++;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const total = Math.max(words1.length, words2.length);
|
|
76
|
+
return total > 0 ? intersection / total : 0;
|
|
54
77
|
}
|
|
55
78
|
function pairSimilarBlocks(blocks) {
|
|
56
79
|
const removed = [];
|
|
@@ -67,39 +90,84 @@ function pairSimilarBlocks(blocks) {
|
|
|
67
90
|
return blocks;
|
|
68
91
|
}
|
|
69
92
|
const pairedRemoved = /* @__PURE__ */ new Set();
|
|
93
|
+
const pairedAdded = /* @__PURE__ */ new Set();
|
|
70
94
|
const modifications = /* @__PURE__ */ new Map();
|
|
71
|
-
const SIMILARITY_THRESHOLD = 0.
|
|
95
|
+
const SIMILARITY_THRESHOLD = 0.5;
|
|
96
|
+
const addedByName = /* @__PURE__ */ new Map();
|
|
97
|
+
for (const add of added) {
|
|
98
|
+
const name = add.block.blockName;
|
|
99
|
+
if (!addedByName.has(name)) {
|
|
100
|
+
addedByName.set(name, []);
|
|
101
|
+
}
|
|
102
|
+
addedByName.get(name).push(add);
|
|
103
|
+
}
|
|
104
|
+
const removedByName = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const rem of removed) {
|
|
106
|
+
const name = rem.block.blockName;
|
|
107
|
+
if (!removedByName.has(name)) {
|
|
108
|
+
removedByName.set(name, []);
|
|
109
|
+
}
|
|
110
|
+
removedByName.get(name).push(rem);
|
|
111
|
+
}
|
|
112
|
+
let maxPairedAddedIndex = -1;
|
|
72
113
|
for (const rem of removed) {
|
|
114
|
+
const candidates = addedByName.get(rem.block.blockName) || [];
|
|
115
|
+
const sameNameRemoved = removedByName.get(rem.block.blockName) || [];
|
|
116
|
+
const unpaired = candidates.filter(
|
|
117
|
+
(add) => !modifications.has(add.index) && add.index > maxPairedAddedIndex
|
|
118
|
+
);
|
|
119
|
+
if (unpaired.length === 0) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
73
122
|
let bestMatch = null;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (modifications.has(add.index)) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (add.block.blockName !== rem.block.blockName) {
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
const score = textSimilarity(
|
|
83
|
-
rem.block.innerHTML || "",
|
|
84
|
-
add.block.innerHTML || ""
|
|
85
|
-
);
|
|
123
|
+
if (sameNameRemoved.length === 1 && unpaired.length === 1) {
|
|
124
|
+
const add = unpaired[0];
|
|
86
125
|
const attrsMatch = JSON.stringify(rem.block.attrs) === JSON.stringify(add.block.attrs);
|
|
87
|
-
|
|
88
|
-
|
|
126
|
+
const contentMatch = (rem.block.innerHTML || "") === (add.block.innerHTML || "");
|
|
127
|
+
if (!contentMatch || !attrsMatch) {
|
|
89
128
|
bestMatch = add;
|
|
90
129
|
}
|
|
130
|
+
} else {
|
|
131
|
+
let bestScore = 0;
|
|
132
|
+
for (const add of unpaired) {
|
|
133
|
+
const score = textSimilarity(
|
|
134
|
+
rem.block.innerHTML || "",
|
|
135
|
+
add.block.innerHTML || ""
|
|
136
|
+
);
|
|
137
|
+
const attrsMatch = JSON.stringify(rem.block.attrs) === JSON.stringify(add.block.attrs);
|
|
138
|
+
if (score > bestScore && score > SIMILARITY_THRESHOLD && (score < 1 || !attrsMatch)) {
|
|
139
|
+
bestScore = score;
|
|
140
|
+
bestMatch = add;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
91
143
|
}
|
|
92
144
|
if (bestMatch) {
|
|
93
|
-
|
|
94
|
-
|
|
145
|
+
maxPairedAddedIndex = bestMatch.index;
|
|
146
|
+
const modifiedBlock = {
|
|
95
147
|
...bestMatch.block,
|
|
96
148
|
__revisionDiffStatus: { status: "modified" },
|
|
97
149
|
__previousRawBlock: rem.block
|
|
98
|
-
}
|
|
150
|
+
};
|
|
151
|
+
const lo = Math.min(rem.index, bestMatch.index);
|
|
152
|
+
const hi = Math.max(rem.index, bestMatch.index);
|
|
153
|
+
let hasAddedBetween = false;
|
|
154
|
+
for (let i = lo + 1; i < hi; i++) {
|
|
155
|
+
if (blocks[i].__revisionDiffStatus?.status === "added" && !pairedAdded.has(i)) {
|
|
156
|
+
hasAddedBetween = true;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (hasAddedBetween) {
|
|
161
|
+
modifications.set(bestMatch.index, modifiedBlock);
|
|
162
|
+
pairedRemoved.add(rem.index);
|
|
163
|
+
} else {
|
|
164
|
+
modifications.set(rem.index, modifiedBlock);
|
|
165
|
+
pairedAdded.add(bestMatch.index);
|
|
166
|
+
}
|
|
99
167
|
}
|
|
100
168
|
}
|
|
101
169
|
return blocks.map((block, index) => {
|
|
102
|
-
if (pairedRemoved.has(index)) {
|
|
170
|
+
if (pairedRemoved.has(index) || pairedAdded.has(index)) {
|
|
103
171
|
return null;
|
|
104
172
|
}
|
|
105
173
|
if (modifications.has(index)) {
|