@wordpress/editor 14.45.0 → 14.45.2-next.v.202605131006.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
|
@@ -111,12 +111,15 @@ export function Notes( { notes, sidebarRef, isFloating = false, styles } ) {
|
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
const adjacentThread = nextThread ?? prevThread;
|
|
115
|
+
if ( adjacentThread ) {
|
|
116
|
+
selectNote( adjacentThread.id );
|
|
117
|
+
focusNoteThread( adjacentThread.id, sidebarRef.current );
|
|
118
|
+
if ( adjacentThread.blockClientId ) {
|
|
119
|
+
toggleBlockSpotlight( adjacentThread.blockClientId, true );
|
|
120
|
+
// Pass `null` as the second parameter to prevent focusing the block.
|
|
121
|
+
selectBlock( adjacentThread.blockClientId, null );
|
|
122
|
+
}
|
|
120
123
|
} else {
|
|
121
124
|
selectNote( undefined );
|
|
122
125
|
toggleBlockSpotlight( note.blockClientId, false );
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
// so each thread tracks the canvas scroll.
|
|
52
52
|
transform: translateY(var(--canvas-scroll, 0));
|
|
53
53
|
will-change: transform;
|
|
54
|
+
// Keep the reply input reachable when a thread is taller than the viewport
|
|
55
|
+
// (e.g. many replies on short content where the canvas can't scroll).
|
|
56
|
+
max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - #{$header-height + $grid-unit-80});
|
|
57
|
+
overflow-y: auto;
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
|
|
@@ -198,18 +198,17 @@ export function calculateNotePositions( {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
201
|
+
* Resolve the DOM element for a note thread once it's mounted,
|
|
202
|
+
* or `null` if not found within 3 seconds.
|
|
203
203
|
*
|
|
204
|
-
* @
|
|
205
|
-
*
|
|
206
|
-
* @param {string}
|
|
207
|
-
* @
|
|
208
|
-
* @param {string} additionalSelector The additional selector to focus on.
|
|
204
|
+
* @param {string} noteId Note thread ID.
|
|
205
|
+
* @param {?HTMLElement} container Container to search within.
|
|
206
|
+
* @param {string} additionalSelector Optional descendant selector.
|
|
207
|
+
* @return {Promise<HTMLElement|null>} Resolved element, or `null` on timeout.
|
|
209
208
|
*/
|
|
210
|
-
|
|
209
|
+
function findNoteThread( noteId, container, additionalSelector ) {
|
|
211
210
|
if ( ! container ) {
|
|
212
|
-
return;
|
|
211
|
+
return Promise.resolve( null );
|
|
213
212
|
}
|
|
214
213
|
|
|
215
214
|
// A thread without a noteId is a new note thread.
|
|
@@ -236,15 +235,43 @@ export function focusNoteThread( noteId, container, additionalSelector ) {
|
|
|
236
235
|
}
|
|
237
236
|
} );
|
|
238
237
|
|
|
239
|
-
observer.observe( container, {
|
|
240
|
-
childList: true,
|
|
241
|
-
subtree: true,
|
|
242
|
-
} );
|
|
238
|
+
observer.observe( container, { childList: true, subtree: true } );
|
|
243
239
|
|
|
244
240
|
// Stop trying after 3 seconds.
|
|
245
241
|
timer = setTimeout( () => {
|
|
246
242
|
observer.disconnect();
|
|
247
243
|
resolve( null );
|
|
248
244
|
}, 3000 );
|
|
249
|
-
} )
|
|
245
|
+
} );
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Focus a note thread (or a descendant) and scroll it into view.
|
|
250
|
+
*
|
|
251
|
+
* @param {string} noteId Note thread ID.
|
|
252
|
+
* @param {?HTMLElement} container Container to search within.
|
|
253
|
+
* @param {string} additionalSelector Optional descendant selector.
|
|
254
|
+
*/
|
|
255
|
+
export function focusNoteThread( noteId, container, additionalSelector ) {
|
|
256
|
+
return findNoteThread( noteId, container, additionalSelector ).then(
|
|
257
|
+
( element ) => {
|
|
258
|
+
if ( ! element ) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
element.focus();
|
|
262
|
+
element.scrollIntoView( { block: 'nearest' } );
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Scroll a note thread into view without changing focus.
|
|
269
|
+
*
|
|
270
|
+
* @param {string} noteId Note thread ID.
|
|
271
|
+
* @param {?HTMLElement} container Container to search within.
|
|
272
|
+
*/
|
|
273
|
+
export function scrollNoteThreadIntoView( noteId, container ) {
|
|
274
|
+
return findNoteThread( noteId, container ).then( ( element ) => {
|
|
275
|
+
element?.scrollIntoView( { block: 'nearest' } );
|
|
276
|
+
} );
|
|
250
277
|
}
|
|
@@ -13,8 +13,6 @@ import { unlock } from '../../lock-unlock';
|
|
|
13
13
|
import { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';
|
|
14
14
|
import { getAvatarBorderColor } from '../collab-sidebar/utils';
|
|
15
15
|
import { createCursorRegistry } from '../collaborators-overlay/cursor-registry';
|
|
16
|
-
|
|
17
|
-
import './styles/collaborators-presence.scss';
|
|
18
16
|
import { CollaboratorsOverlay } from '../collaborators-overlay';
|
|
19
17
|
|
|
20
18
|
const { useActiveCollaborators } = unlock( privateApis );
|
|
@@ -9,8 +9,6 @@ import { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';
|
|
|
9
9
|
import { getAvatarBorderColor } from '../collab-sidebar/utils';
|
|
10
10
|
import { type CursorRegistry } from '../collaborators-overlay/cursor-registry';
|
|
11
11
|
|
|
12
|
-
import './styles/collaborators-list.scss';
|
|
13
|
-
|
|
14
12
|
interface CollaboratorsListProps {
|
|
15
13
|
activeCollaborators: PostEditorAwarenessState[];
|
|
16
14
|
popoverAnchor?: HTMLElement | null;
|
|
@@ -63,6 +63,11 @@ export function PrivatePostLastRevision() {
|
|
|
63
63
|
onClick={ () => setCurrentRevisionId( lastRevisionId ) }
|
|
64
64
|
className="editor-private-post-last-revision__button"
|
|
65
65
|
text={ revisionsCount }
|
|
66
|
+
aria-label={ sprintf(
|
|
67
|
+
/* translators: %s: number of revisions. */
|
|
68
|
+
__( 'Open revisions screen: %s revisions' ),
|
|
69
|
+
revisionsCount
|
|
70
|
+
) }
|
|
66
71
|
variant="tertiary"
|
|
67
72
|
size="compact"
|
|
68
73
|
/>
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
6
|
+
import { Button, Spinner, CheckboxControl } from '@wordpress/components';
|
|
7
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
8
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from '@wordpress/components';
|
|
13
|
-
import { withSelect, withDispatch } from '@wordpress/data';
|
|
14
|
-
import { compose } from '@wordpress/compose';
|
|
9
|
+
useConstrainedTabbing,
|
|
10
|
+
useEvent,
|
|
11
|
+
useFocusReturn,
|
|
12
|
+
useMergeRefs,
|
|
13
|
+
} from '@wordpress/compose';
|
|
15
14
|
import { closeSmall } from '@wordpress/icons';
|
|
16
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
17
16
|
|
|
@@ -23,135 +22,36 @@ import PostPublishPanelPrepublish from './prepublish';
|
|
|
23
22
|
import PostPublishPanelPostpublish from './postpublish';
|
|
24
23
|
import { store as editorStore } from '../../store';
|
|
25
24
|
|
|
26
|
-
export class PostPublishPanel extends Component {
|
|
27
|
-
constructor() {
|
|
28
|
-
super( ...arguments );
|
|
29
|
-
this.onSubmit = this.onSubmit.bind( this );
|
|
30
|
-
this.cancelButtonNode = createRef();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
componentDidMount() {
|
|
34
|
-
// This timeout is necessary to make sure the `useEffect` hook of
|
|
35
|
-
// `useFocusReturn` gets the correct element (the button that opens the
|
|
36
|
-
// PostPublishPanel) otherwise it will get this button.
|
|
37
|
-
this.timeoutID = setTimeout( () => {
|
|
38
|
-
this.cancelButtonNode.current.focus();
|
|
39
|
-
}, 0 );
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
componentWillUnmount() {
|
|
43
|
-
clearTimeout( this.timeoutID );
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
componentDidUpdate( prevProps ) {
|
|
47
|
-
// Automatically collapse the publish sidebar when a post
|
|
48
|
-
// is published and the user makes an edit.
|
|
49
|
-
if (
|
|
50
|
-
( prevProps.isPublished &&
|
|
51
|
-
! this.props.isSaving &&
|
|
52
|
-
this.props.isDirty ) ||
|
|
53
|
-
this.props.currentPostId !== prevProps.currentPostId
|
|
54
|
-
) {
|
|
55
|
-
this.props.onClose();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
onSubmit() {
|
|
60
|
-
const { onClose, hasPublishAction, isPostTypeViewable } = this.props;
|
|
61
|
-
if ( ! hasPublishAction || ! isPostTypeViewable ) {
|
|
62
|
-
onClose();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
render() {
|
|
67
|
-
const {
|
|
68
|
-
forceIsDirty,
|
|
69
|
-
isBeingScheduled,
|
|
70
|
-
isPublished,
|
|
71
|
-
isPublishSidebarEnabled,
|
|
72
|
-
isScheduled,
|
|
73
|
-
isSaving,
|
|
74
|
-
isSavingNonPostEntityChanges,
|
|
75
|
-
onClose,
|
|
76
|
-
onTogglePublishSidebar,
|
|
77
|
-
PostPublishExtension,
|
|
78
|
-
PrePublishExtension,
|
|
79
|
-
currentPostId,
|
|
80
|
-
...additionalProps
|
|
81
|
-
} = this.props;
|
|
82
|
-
const {
|
|
83
|
-
hasPublishAction,
|
|
84
|
-
isDirty,
|
|
85
|
-
isPostTypeViewable,
|
|
86
|
-
...propsForPanel
|
|
87
|
-
} = additionalProps;
|
|
88
|
-
const isPublishedOrScheduled =
|
|
89
|
-
isPublished || ( isScheduled && isBeingScheduled );
|
|
90
|
-
const isPrePublish = ! isPublishedOrScheduled && ! isSaving;
|
|
91
|
-
const isPostPublish = isPublishedOrScheduled && ! isSaving;
|
|
92
|
-
return (
|
|
93
|
-
<div className="editor-post-publish-panel" { ...propsForPanel }>
|
|
94
|
-
<div className="editor-post-publish-panel__header">
|
|
95
|
-
{ isPostPublish ? (
|
|
96
|
-
<Button
|
|
97
|
-
size="compact"
|
|
98
|
-
onClick={ onClose }
|
|
99
|
-
icon={ closeSmall }
|
|
100
|
-
label={ __( 'Close panel' ) }
|
|
101
|
-
/>
|
|
102
|
-
) : (
|
|
103
|
-
<>
|
|
104
|
-
<div className="editor-post-publish-panel__header-cancel-button">
|
|
105
|
-
<Button
|
|
106
|
-
ref={ this.cancelButtonNode }
|
|
107
|
-
accessibleWhenDisabled
|
|
108
|
-
disabled={ isSavingNonPostEntityChanges }
|
|
109
|
-
onClick={ onClose }
|
|
110
|
-
variant="secondary"
|
|
111
|
-
size="compact"
|
|
112
|
-
>
|
|
113
|
-
{ __( 'Cancel' ) }
|
|
114
|
-
</Button>
|
|
115
|
-
</div>
|
|
116
|
-
<div className="editor-post-publish-panel__header-publish-button">
|
|
117
|
-
<PostPublishButton
|
|
118
|
-
onSubmit={ this.onSubmit }
|
|
119
|
-
forceIsDirty={ forceIsDirty }
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
</>
|
|
123
|
-
) }
|
|
124
|
-
</div>
|
|
125
|
-
<div className="editor-post-publish-panel__content">
|
|
126
|
-
{ isPrePublish && (
|
|
127
|
-
<PostPublishPanelPrepublish>
|
|
128
|
-
{ PrePublishExtension && <PrePublishExtension /> }
|
|
129
|
-
</PostPublishPanelPrepublish>
|
|
130
|
-
) }
|
|
131
|
-
{ isPostPublish && (
|
|
132
|
-
<PostPublishPanelPostpublish focusOnMount>
|
|
133
|
-
{ PostPublishExtension && <PostPublishExtension /> }
|
|
134
|
-
</PostPublishPanelPostpublish>
|
|
135
|
-
) }
|
|
136
|
-
{ isSaving && <Spinner /> }
|
|
137
|
-
</div>
|
|
138
|
-
<div className="editor-post-publish-panel__footer">
|
|
139
|
-
<CheckboxControl
|
|
140
|
-
label={ __( 'Always show pre-publish checks.' ) }
|
|
141
|
-
checked={ isPublishSidebarEnabled }
|
|
142
|
-
onChange={ onTogglePublishSidebar }
|
|
143
|
-
/>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
25
|
/**
|
|
151
26
|
* Renders a panel for publishing a post.
|
|
27
|
+
*
|
|
28
|
+
* @param {Object} props Component props.
|
|
29
|
+
* @param {boolean} [props.forceIsDirty] Whether to force the dirty state.
|
|
30
|
+
* @param {()=>void} props.onClose Called when the panel requests to close.
|
|
31
|
+
* @param {React.ComponentType} [props.PostPublishExtension] Component rendered after publishing.
|
|
32
|
+
* @param {React.ComponentType} [props.PrePublishExtension] Component rendered before publishing.
|
|
33
|
+
*
|
|
34
|
+
* @return {React.JSX.Element} The post publish panel.
|
|
152
35
|
*/
|
|
153
|
-
export default
|
|
154
|
-
|
|
36
|
+
export default function PostPublishPanel( {
|
|
37
|
+
forceIsDirty,
|
|
38
|
+
onClose,
|
|
39
|
+
PostPublishExtension,
|
|
40
|
+
PrePublishExtension,
|
|
41
|
+
...propsForPanel
|
|
42
|
+
} ) {
|
|
43
|
+
const {
|
|
44
|
+
hasPublishAction,
|
|
45
|
+
isPostTypeViewable,
|
|
46
|
+
isBeingScheduled,
|
|
47
|
+
isDirty,
|
|
48
|
+
isPublished,
|
|
49
|
+
isPublishSidebarEnabled,
|
|
50
|
+
isSaving,
|
|
51
|
+
isSavingNonPostEntityChanges,
|
|
52
|
+
isScheduled,
|
|
53
|
+
currentPostId,
|
|
54
|
+
} = useSelect( ( select ) => {
|
|
155
55
|
const { getPostType } = select( coreStore );
|
|
156
56
|
const {
|
|
157
57
|
getCurrentPost,
|
|
@@ -163,9 +63,9 @@ export default compose( [
|
|
|
163
63
|
isEditedPostDirty,
|
|
164
64
|
isAutosavingPost,
|
|
165
65
|
isSavingPost,
|
|
166
|
-
isSavingNonPostEntityChanges,
|
|
66
|
+
isSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,
|
|
67
|
+
isPublishSidebarEnabled: _isPublishSidebarEnabled,
|
|
167
68
|
} = select( editorStore );
|
|
168
|
-
const { isPublishSidebarEnabled } = select( editorStore );
|
|
169
69
|
const postType = getPostType( getEditedPostAttribute( 'type' ) );
|
|
170
70
|
|
|
171
71
|
return {
|
|
@@ -175,26 +75,119 @@ export default compose( [
|
|
|
175
75
|
isBeingScheduled: isEditedPostBeingScheduled(),
|
|
176
76
|
isDirty: isEditedPostDirty(),
|
|
177
77
|
isPublished: isCurrentPostPublished(),
|
|
178
|
-
isPublishSidebarEnabled:
|
|
78
|
+
isPublishSidebarEnabled: _isPublishSidebarEnabled(),
|
|
179
79
|
isSaving: isSavingPost() && ! isAutosavingPost(),
|
|
180
|
-
isSavingNonPostEntityChanges:
|
|
80
|
+
isSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),
|
|
181
81
|
isScheduled: isCurrentPostScheduled(),
|
|
182
82
|
currentPostId: getCurrentPostId(),
|
|
183
83
|
};
|
|
184
|
-
} )
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
} )
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
84
|
+
}, [] );
|
|
85
|
+
|
|
86
|
+
const { disablePublishSidebar, enablePublishSidebar } =
|
|
87
|
+
useDispatch( editorStore );
|
|
88
|
+
|
|
89
|
+
const cancelButtonRef = useRef( null );
|
|
90
|
+
const wrapperRef = useMergeRefs( [
|
|
91
|
+
useFocusReturn(),
|
|
92
|
+
useConstrainedTabbing(),
|
|
93
|
+
] );
|
|
94
|
+
|
|
95
|
+
useEffect( () => {
|
|
96
|
+
cancelButtonRef.current?.focus();
|
|
97
|
+
}, [] );
|
|
98
|
+
|
|
99
|
+
// Auto-collapse the publish sidebar when a post is published and the user
|
|
100
|
+
// makes an edit, or when the edited post changes. The panel only mounts
|
|
101
|
+
// for unpublished posts, so `isPublished && isDirty` cannot be true on
|
|
102
|
+
// mount — it implies a publish-then-edit transition.
|
|
103
|
+
const prevPostIdRef = useRef( currentPostId );
|
|
104
|
+
const stableOnClose = useEvent( onClose );
|
|
105
|
+
useEffect( () => {
|
|
106
|
+
const postChanged = currentPostId !== prevPostIdRef.current;
|
|
107
|
+
prevPostIdRef.current = currentPostId;
|
|
108
|
+
|
|
109
|
+
if ( postChanged || ( isPublished && ! isSaving && isDirty ) ) {
|
|
110
|
+
stableOnClose();
|
|
111
|
+
}
|
|
112
|
+
}, [ isPublished, isSaving, isDirty, currentPostId, stableOnClose ] );
|
|
113
|
+
|
|
114
|
+
function onTogglePublishSidebar() {
|
|
115
|
+
if ( isPublishSidebarEnabled ) {
|
|
116
|
+
disablePublishSidebar();
|
|
117
|
+
} else {
|
|
118
|
+
enablePublishSidebar();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function onSubmit() {
|
|
123
|
+
if ( ! hasPublishAction || ! isPostTypeViewable ) {
|
|
124
|
+
onClose();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const isPublishedOrScheduled =
|
|
129
|
+
isPublished || ( isScheduled && isBeingScheduled );
|
|
130
|
+
const isPrePublish = ! isPublishedOrScheduled && ! isSaving;
|
|
131
|
+
const isPostPublish = isPublishedOrScheduled && ! isSaving;
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<div
|
|
135
|
+
ref={ wrapperRef }
|
|
136
|
+
tabIndex={ -1 }
|
|
137
|
+
className="editor-post-publish-panel"
|
|
138
|
+
{ ...propsForPanel }
|
|
139
|
+
>
|
|
140
|
+
<div className="editor-post-publish-panel__header">
|
|
141
|
+
{ isPostPublish ? (
|
|
142
|
+
<Button
|
|
143
|
+
size="compact"
|
|
144
|
+
onClick={ onClose }
|
|
145
|
+
icon={ closeSmall }
|
|
146
|
+
label={ __( 'Close panel' ) }
|
|
147
|
+
/>
|
|
148
|
+
) : (
|
|
149
|
+
<>
|
|
150
|
+
<div className="editor-post-publish-panel__header-cancel-button">
|
|
151
|
+
<Button
|
|
152
|
+
ref={ cancelButtonRef }
|
|
153
|
+
accessibleWhenDisabled
|
|
154
|
+
disabled={ isSavingNonPostEntityChanges }
|
|
155
|
+
onClick={ onClose }
|
|
156
|
+
variant="secondary"
|
|
157
|
+
size="compact"
|
|
158
|
+
>
|
|
159
|
+
{ __( 'Cancel' ) }
|
|
160
|
+
</Button>
|
|
161
|
+
</div>
|
|
162
|
+
<div className="editor-post-publish-panel__header-publish-button">
|
|
163
|
+
<PostPublishButton
|
|
164
|
+
onSubmit={ onSubmit }
|
|
165
|
+
forceIsDirty={ forceIsDirty }
|
|
166
|
+
/>
|
|
167
|
+
</div>
|
|
168
|
+
</>
|
|
169
|
+
) }
|
|
170
|
+
</div>
|
|
171
|
+
<div className="editor-post-publish-panel__content">
|
|
172
|
+
{ isPrePublish && (
|
|
173
|
+
<PostPublishPanelPrepublish>
|
|
174
|
+
{ PrePublishExtension && <PrePublishExtension /> }
|
|
175
|
+
</PostPublishPanelPrepublish>
|
|
176
|
+
) }
|
|
177
|
+
{ isPostPublish && (
|
|
178
|
+
<PostPublishPanelPostpublish focusOnMount>
|
|
179
|
+
{ PostPublishExtension && <PostPublishExtension /> }
|
|
180
|
+
</PostPublishPanelPostpublish>
|
|
181
|
+
) }
|
|
182
|
+
{ isSaving && <Spinner /> }
|
|
183
|
+
</div>
|
|
184
|
+
<div className="editor-post-publish-panel__footer">
|
|
185
|
+
<CheckboxControl
|
|
186
|
+
label={ __( 'Always show pre-publish checks.' ) }
|
|
187
|
+
checked={ isPublishSidebarEnabled }
|
|
188
|
+
onChange={ onTogglePublishSidebar }
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
@@ -54,6 +54,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
54
54
|
<div>
|
|
55
55
|
<div
|
|
56
56
|
class="editor-post-publish-panel"
|
|
57
|
+
tabindex="-1"
|
|
57
58
|
>
|
|
58
59
|
<div
|
|
59
60
|
class="editor-post-publish-panel__header"
|
|
@@ -278,6 +279,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
278
279
|
<div>
|
|
279
280
|
<div
|
|
280
281
|
class="editor-post-publish-panel"
|
|
282
|
+
tabindex="-1"
|
|
281
283
|
>
|
|
282
284
|
<div
|
|
283
285
|
class="editor-post-publish-panel__header"
|
|
@@ -329,7 +331,10 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
329
331
|
</span>
|
|
330
332
|
</a>
|
|
331
333
|
|
|
332
|
-
is now live
|
|
334
|
+
is now scheduled. It will go live on
|
|
335
|
+
|
|
336
|
+
Immediately
|
|
337
|
+
.
|
|
333
338
|
</div>
|
|
334
339
|
<div
|
|
335
340
|
class="components-panel__body is-opened"
|
|
@@ -380,30 +385,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
380
385
|
class="post-publish-panel__postpublish-buttons"
|
|
381
386
|
>
|
|
382
387
|
<a
|
|
383
|
-
class="components-button is-next-40px-default-size is-primary
|
|
384
|
-
href="https://wordpress.local/sample-page/"
|
|
385
|
-
target="_blank"
|
|
386
|
-
>
|
|
387
|
-
<span
|
|
388
|
-
data-visually-hidden=""
|
|
389
|
-
>
|
|
390
|
-
(opens in a new tab)
|
|
391
|
-
</span>
|
|
392
|
-
<svg
|
|
393
|
-
aria-hidden="true"
|
|
394
|
-
focusable="false"
|
|
395
|
-
height="24"
|
|
396
|
-
viewBox="0 0 24 24"
|
|
397
|
-
width="24"
|
|
398
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
399
|
-
>
|
|
400
|
-
<path
|
|
401
|
-
d="M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"
|
|
402
|
-
/>
|
|
403
|
-
</svg>
|
|
404
|
-
</a>
|
|
405
|
-
<a
|
|
406
|
-
class="components-button is-next-40px-default-size is-secondary"
|
|
388
|
+
class="components-button is-next-40px-default-size is-primary"
|
|
407
389
|
href="post-new.php?"
|
|
408
390
|
/>
|
|
409
391
|
</div>
|
|
@@ -492,6 +474,7 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is
|
|
|
492
474
|
<div>
|
|
493
475
|
<div
|
|
494
476
|
class="editor-post-publish-panel"
|
|
477
|
+
tabindex="-1"
|
|
495
478
|
>
|
|
496
479
|
<div
|
|
497
480
|
class="editor-post-publish-panel__header"
|
|
@@ -645,6 +628,7 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
|
|
|
645
628
|
<div>
|
|
646
629
|
<div
|
|
647
630
|
class="editor-post-publish-panel"
|
|
631
|
+
tabindex="-1"
|
|
648
632
|
>
|
|
649
633
|
<div
|
|
650
634
|
class="editor-post-publish-panel__header"
|
|
@@ -842,6 +826,7 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1
|
|
|
842
826
|
<div>
|
|
843
827
|
<div
|
|
844
828
|
class="editor-post-publish-panel"
|
|
829
|
+
tabindex="-1"
|
|
845
830
|
>
|
|
846
831
|
<div
|
|
847
832
|
class="editor-post-publish-panel__header"
|
|
@@ -861,7 +846,7 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1
|
|
|
861
846
|
>
|
|
862
847
|
<button
|
|
863
848
|
aria-disabled="true"
|
|
864
|
-
class="components-button editor-post-publish-button editor-post-publish-button__button is-primary is-compact"
|
|
849
|
+
class="components-button editor-post-publish-button editor-post-publish-button__button is-primary is-compact is-busy"
|
|
865
850
|
type="button"
|
|
866
851
|
>
|
|
867
852
|
Submit for Review
|
|
@@ -7,58 +7,76 @@ import { render } from '@testing-library/react';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { select } from '@wordpress/data';
|
|
10
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
11
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import PostPublishPanel from '../index';
|
|
17
17
|
|
|
18
18
|
describe( 'PostPublishPanel', () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
beforeEach( () => {
|
|
20
|
+
jest.spyOn( select( coreStore ), 'getPostType' ).mockReturnValue( {
|
|
21
|
+
labels: {
|
|
22
|
+
singular_name: 'post',
|
|
23
|
+
},
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
jest.spyOn( select( editorStore ), 'getCurrentPost' ).mockReturnValue( {
|
|
27
|
+
link: 'https://wordpress.local/sample-page/',
|
|
28
|
+
} );
|
|
23
29
|
} );
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
afterEach( () => {
|
|
32
|
+
jest.restoreAllMocks();
|
|
27
33
|
} );
|
|
28
34
|
|
|
29
35
|
it( 'should render the pre-publish panel if the post is not saving, published or scheduled', () => {
|
|
30
|
-
const { container } = render(
|
|
31
|
-
<PostPublishPanel
|
|
32
|
-
isPublished={ false }
|
|
33
|
-
isScheduled={ false }
|
|
34
|
-
isSaving={ false }
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
36
|
+
const { container } = render( <PostPublishPanel /> );
|
|
37
37
|
expect( container ).toMatchSnapshot();
|
|
38
38
|
} );
|
|
39
39
|
|
|
40
40
|
it( 'should render the pre-publish panel if post status is scheduled but date is before now', () => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
jest.spyOn(
|
|
42
|
+
select( editorStore ),
|
|
43
|
+
'isCurrentPostScheduled'
|
|
44
|
+
).mockReturnValue( true );
|
|
44
45
|
|
|
46
|
+
const { container } = render( <PostPublishPanel /> );
|
|
45
47
|
expect( container ).toMatchSnapshot();
|
|
46
48
|
} );
|
|
47
49
|
|
|
48
50
|
it( 'should render the spinner if the post is being saved', () => {
|
|
49
|
-
|
|
51
|
+
jest.spyOn( select( editorStore ), 'isSavingPost' ).mockReturnValue(
|
|
52
|
+
true
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const { container } = render( <PostPublishPanel /> );
|
|
50
56
|
expect( container ).toMatchSnapshot();
|
|
51
57
|
} );
|
|
52
58
|
|
|
53
59
|
it( 'should render the post-publish panel if the post is published', () => {
|
|
54
|
-
|
|
60
|
+
jest.spyOn(
|
|
61
|
+
select( editorStore ),
|
|
62
|
+
'isCurrentPostPublished'
|
|
63
|
+
).mockReturnValue( true );
|
|
64
|
+
|
|
65
|
+
const { container } = render( <PostPublishPanel /> );
|
|
55
66
|
expect( container ).toMatchSnapshot();
|
|
56
67
|
} );
|
|
57
68
|
|
|
58
69
|
it( 'should render the post-publish panel if the post is scheduled', () => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
jest.spyOn(
|
|
71
|
+
select( editorStore ),
|
|
72
|
+
'isCurrentPostScheduled'
|
|
73
|
+
).mockReturnValue( true );
|
|
74
|
+
jest.spyOn(
|
|
75
|
+
select( editorStore ),
|
|
76
|
+
'isEditedPostBeingScheduled'
|
|
77
|
+
).mockReturnValue( true );
|
|
78
|
+
|
|
79
|
+
const { container } = render( <PostPublishPanel /> );
|
|
62
80
|
expect( container ).toMatchSnapshot();
|
|
63
81
|
} );
|
|
64
82
|
} );
|