@wordpress/editor 14.48.1 → 14.48.2-next.v.202606191442.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/build/bindings/pattern-overrides.cjs +1 -1
- package/build/bindings/pattern-overrides.cjs.map +2 -2
- package/build/components/collab-sidebar/note-byline.cjs +1 -1
- package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
- package/build/components/collab-sidebar/note.cjs +49 -17
- package/build/components/collab-sidebar/note.cjs.map +3 -3
- package/build/components/collab-sidebar/notes.cjs.map +1 -1
- package/build/components/collab-sidebar/utils.cjs +1 -1
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +1 -1
- package/build/components/collaborators-overlay/collaborator-styles.cjs.map +1 -1
- package/build/components/collaborators-overlay/compute-selection.cjs.map +1 -1
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +1 -1
- package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +1 -1
- package/build/components/collaborators-presence/avatar/component.cjs.map +2 -2
- package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +1 -1
- package/build/components/document-bar/index.cjs +7 -5
- package/build/components/document-bar/index.cjs.map +2 -2
- package/build/components/global-keyboard-shortcuts/index.cjs +3 -2
- package/build/components/global-keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/global-styles-sidebar/welcome-guide.cjs +3 -3
- package/build/components/global-styles-sidebar/welcome-guide.cjs.map +1 -1
- package/build/components/local-autosave-monitor/index.cjs +14 -15
- package/build/components/local-autosave-monitor/index.cjs.map +2 -2
- package/build/components/page-attributes/parent.cjs +1 -1
- package/build/components/page-attributes/parent.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +1 -1
- package/build/components/post-card-panel/index.cjs.map +2 -2
- package/build/components/post-excerpt/panel.cjs +1 -1
- package/build/components/post-excerpt/panel.cjs.map +2 -2
- package/build/components/post-locked-modal/index.cjs +3 -3
- package/build/components/post-locked-modal/index.cjs.map +1 -1
- package/build/components/post-preview-button/index.cjs +2 -2
- package/build/components/post-preview-button/index.cjs.map +2 -2
- package/build/components/post-publish-button/index.cjs +4 -3
- package/build/components/post-publish-button/index.cjs.map +2 -2
- package/build/components/post-publish-button/label.cjs +2 -2
- package/build/components/post-publish-button/label.cjs.map +2 -2
- package/build/components/post-publish-panel/index.cjs.map +1 -1
- package/build/components/post-publish-panel/postpublish.cjs +1 -1
- package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
- package/build/components/post-revisions-preview/block-diff.cjs.map +1 -1
- package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-slider.cjs +1 -1
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
- package/build/components/post-revisions-timeline/index.cjs +173 -0
- package/build/components/post-revisions-timeline/index.cjs.map +7 -0
- package/build/components/post-saved-state/index.cjs +17 -26
- package/build/components/post-saved-state/index.cjs.map +2 -2
- package/build/components/post-schedule/label.cjs +5 -5
- package/build/components/post-schedule/label.cjs.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.cjs +2 -1
- package/build/components/post-taxonomies/flat-term-selector.cjs.map +3 -3
- package/build/components/post-taxonomies/hierarchical-term-selector.cjs +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
- package/build/components/post-text-editor/index.cjs +51 -0
- package/build/components/post-text-editor/index.cjs.map +2 -2
- package/build/components/post-text-editor/utils.cjs +150 -0
- package/build/components/post-text-editor/utils.cjs.map +7 -0
- package/build/components/post-url/index.cjs +1 -1
- package/build/components/post-url/index.cjs.map +2 -2
- package/build/components/post-view-link/index.cjs +1 -1
- package/build/components/post-view-link/index.cjs.map +2 -2
- package/build/components/provider/disable-non-page-content-blocks.cjs.map +1 -1
- package/build/components/provider/index.cjs +1 -1
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
- package/build/components/revision-diff-panel/index.cjs +7 -2
- package/build/components/revision-diff-panel/index.cjs.map +2 -2
- package/build/components/revision-fields-diff/index.cjs +6 -2
- package/build/components/revision-fields-diff/index.cjs.map +2 -2
- package/build/components/sidebar/dataform-post-summary.cjs +125 -20
- package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
- package/build/components/sidebar/index.cjs +1 -11
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-revision-summary.cjs +11 -17
- package/build/components/sidebar/post-revision-summary.cjs.map +3 -3
- package/build/components/sidebar/post-summary.cjs +1 -1
- package/build/components/sidebar/post-summary.cjs.map +2 -2
- package/build/components/style-book/examples.cjs +1 -1
- package/build/components/style-book/examples.cjs.map +1 -1
- package/build/components/style-book/index.cjs +1 -1
- package/build/components/style-book/index.cjs.map +2 -2
- package/build/components/sync-connection-error-modal/index.cjs +3 -3
- package/build/components/sync-connection-error-modal/index.cjs.map +1 -1
- package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
- package/build/components/template-actions-panel/index.cjs +0 -9
- package/build/components/template-actions-panel/index.cjs.map +3 -3
- package/build/components/template-validation-notice/index.cjs +1 -1
- package/build/components/template-validation-notice/index.cjs.map +1 -1
- package/build/components/upload-progress-snackbar/index.cjs +3 -3
- package/build/components/upload-progress-snackbar/index.cjs.map +2 -2
- package/build/components/upload-progress-snackbar/tracker.cjs.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.cjs +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.cjs.map +1 -1
- package/build/{components/revision-author-panel → dataviews/fields/revisions}/index.cjs +18 -26
- package/build/dataviews/fields/revisions/index.cjs.map +7 -0
- package/build/dataviews/fields/revisions/revisions-view.cjs +74 -0
- package/build/dataviews/fields/revisions/revisions-view.cjs.map +7 -0
- package/build/dataviews/store/private-actions.cjs +14 -4
- package/build/dataviews/store/private-actions.cjs.map +3 -3
- package/build/hooks/push-changes-to-global-styles/index.cjs +1 -1
- package/build/hooks/push-changes-to-global-styles/index.cjs.map +1 -1
- package/build/store/actions.cjs +1 -1
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +6 -1
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/utils/media-upload/index.cjs.map +1 -1
- package/build/utils/set-nested-value.cjs.map +1 -1
- package/build-module/bindings/pattern-overrides.mjs +1 -1
- package/build-module/bindings/pattern-overrides.mjs.map +2 -2
- package/build-module/components/collab-sidebar/note-byline.mjs +1 -1
- package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
- package/build-module/components/collab-sidebar/note.mjs +50 -18
- package/build-module/components/collab-sidebar/note.mjs.map +2 -2
- package/build-module/components/collab-sidebar/notes.mjs.map +1 -1
- package/build-module/components/collab-sidebar/utils.mjs +1 -1
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +1 -1
- package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +1 -1
- package/build-module/components/collaborators-overlay/compute-selection.mjs.map +1 -1
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +1 -1
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +1 -1
- package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
- package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +1 -1
- package/build-module/components/document-bar/index.mjs +7 -5
- package/build-module/components/document-bar/index.mjs.map +2 -2
- package/build-module/components/global-keyboard-shortcuts/index.mjs +3 -2
- package/build-module/components/global-keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/global-styles-sidebar/welcome-guide.mjs +3 -3
- package/build-module/components/global-styles-sidebar/welcome-guide.mjs.map +1 -1
- package/build-module/components/local-autosave-monitor/index.mjs +15 -16
- package/build-module/components/local-autosave-monitor/index.mjs.map +2 -2
- package/build-module/components/page-attributes/parent.mjs +1 -1
- package/build-module/components/page-attributes/parent.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +1 -1
- package/build-module/components/post-card-panel/index.mjs.map +2 -2
- package/build-module/components/post-excerpt/panel.mjs +1 -1
- package/build-module/components/post-excerpt/panel.mjs.map +2 -2
- package/build-module/components/post-locked-modal/index.mjs +3 -3
- package/build-module/components/post-locked-modal/index.mjs.map +1 -1
- package/build-module/components/post-preview-button/index.mjs +2 -2
- package/build-module/components/post-preview-button/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/index.mjs +4 -3
- package/build-module/components/post-publish-button/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/label.mjs +2 -2
- package/build-module/components/post-publish-button/label.mjs.map +2 -2
- package/build-module/components/post-publish-panel/index.mjs.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.mjs +1 -1
- package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/block-diff.mjs.map +1 -1
- package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -1
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/components/post-revisions-timeline/index.mjs +152 -0
- package/build-module/components/post-revisions-timeline/index.mjs.map +7 -0
- package/build-module/components/post-saved-state/index.mjs +17 -26
- package/build-module/components/post-saved-state/index.mjs.map +2 -2
- package/build-module/components/post-schedule/label.mjs +5 -5
- package/build-module/components/post-schedule/label.mjs.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.mjs +3 -6
- package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
- package/build-module/components/post-text-editor/index.mjs +51 -0
- package/build-module/components/post-text-editor/index.mjs.map +2 -2
- package/build-module/components/post-text-editor/utils.mjs +123 -0
- package/build-module/components/post-text-editor/utils.mjs.map +7 -0
- package/build-module/components/post-url/index.mjs +1 -1
- package/build-module/components/post-url/index.mjs.map +2 -2
- package/build-module/components/post-view-link/index.mjs +1 -1
- package/build-module/components/post-view-link/index.mjs.map +2 -2
- package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +1 -1
- package/build-module/components/provider/index.mjs +1 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
- package/build-module/components/revision-diff-panel/index.mjs +7 -2
- package/build-module/components/revision-diff-panel/index.mjs.map +2 -2
- package/build-module/components/revision-fields-diff/index.mjs +6 -2
- package/build-module/components/revision-fields-diff/index.mjs.map +2 -2
- package/build-module/components/sidebar/dataform-post-summary.mjs +125 -20
- package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +1 -11
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-revision-summary.mjs +11 -17
- package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +1 -1
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/style-book/examples.mjs +1 -1
- package/build-module/components/style-book/examples.mjs.map +1 -1
- package/build-module/components/style-book/index.mjs +1 -1
- package/build-module/components/style-book/index.mjs.map +2 -2
- package/build-module/components/sync-connection-error-modal/index.mjs +3 -3
- package/build-module/components/sync-connection-error-modal/index.mjs.map +1 -1
- package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
- package/build-module/components/template-actions-panel/index.mjs +0 -9
- package/build-module/components/template-actions-panel/index.mjs.map +2 -2
- package/build-module/components/template-validation-notice/index.mjs +1 -1
- package/build-module/components/template-validation-notice/index.mjs.map +1 -1
- package/build-module/components/upload-progress-snackbar/index.mjs +3 -3
- package/build-module/components/upload-progress-snackbar/index.mjs.map +2 -2
- package/build-module/components/upload-progress-snackbar/tracker.mjs.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.mjs +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.mjs.map +1 -1
- package/build-module/dataviews/fields/revisions/index.mjs +20 -0
- package/build-module/dataviews/fields/revisions/index.mjs.map +7 -0
- package/build-module/dataviews/fields/revisions/revisions-view.mjs +53 -0
- package/build-module/dataviews/fields/revisions/revisions-view.mjs.map +7 -0
- package/build-module/dataviews/store/private-actions.mjs +23 -7
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/hooks/push-changes-to-global-styles/index.mjs +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.mjs.map +1 -1
- package/build-module/store/actions.mjs +1 -1
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +7 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/utils/media-upload/index.mjs.map +1 -1
- package/build-module/utils/set-nested-value.mjs.map +1 -1
- package/build-style/style-rtl.css +270 -206
- package/build-style/style.css +270 -206
- package/build-types/components/collab-sidebar/note-byline.d.ts +0 -3
- package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +2 -2
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
- package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
- package/build-types/components/post-revisions-timeline/index.d.ts +2 -0
- package/build-types/components/post-revisions-timeline/index.d.ts.map +1 -0
- package/build-types/components/post-saved-state/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.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/provider/index.d.ts.map +1 -1
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
- package/build-types/components/revision-diff-panel/index.d.ts +3 -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/sidebar/dataform-post-summary.d.ts.map +1 -1
- 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/template-actions-panel/block-theme-content.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
- package/build-types/dataviews/fields/revisions/index.d.ts +8 -0
- package/build-types/dataviews/fields/revisions/index.d.ts.map +1 -0
- package/build-types/dataviews/fields/revisions/revisions-view.d.ts +2 -0
- package/build-types/dataviews/fields/revisions/revisions-view.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +1 -1
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +1 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +53 -47
- package/src/bindings/pattern-overrides.js +1 -1
- package/src/bindings/test/pattern-overrides.js +65 -0
- package/src/components/collab-sidebar/note-byline.js +0 -1
- package/src/components/collab-sidebar/note.js +64 -29
- package/src/components/collab-sidebar/style.scss +20 -0
- package/src/components/collaborators-presence/avatar/component.tsx +0 -1
- package/src/components/collaborators-presence/avatar/test/index.tsx +0 -1
- package/src/components/document-bar/index.js +8 -3
- package/src/components/document-bar/style.scss +4 -2
- package/src/components/global-keyboard-shortcuts/index.js +2 -1
- package/src/components/local-autosave-monitor/index.js +23 -21
- package/src/components/post-card-panel/index.js +1 -1
- package/src/components/post-publish-button/index.js +6 -3
- package/src/components/post-publish-button/test/index.js +13 -0
- package/src/components/post-revisions-preview/diff-markers.js +0 -1
- package/src/components/post-revisions-timeline/index.js +186 -0
- package/src/components/post-revisions-timeline/style.scss +43 -0
- package/src/components/post-saved-state/index.js +23 -26
- package/src/components/post-saved-state/test/index.js +18 -0
- package/src/components/post-taxonomies/flat-term-selector.js +4 -7
- package/src/components/post-text-editor/index.js +65 -0
- package/src/components/post-text-editor/test/utils.js +210 -0
- package/src/components/post-text-editor/utils.js +204 -0
- package/src/components/post-type-support-check/test/index.js +11 -0
- package/src/components/post-url/index.js +1 -1
- package/src/components/post-view-link/index.js +1 -1
- package/src/components/post-view-link/test/index.js +71 -0
- package/src/components/provider/index.js +2 -1
- package/src/components/resizable-editor/resize-handle.js +0 -1
- package/src/components/revision-diff-panel/index.js +8 -2
- package/src/components/revision-fields-diff/index.js +12 -1
- package/src/components/sidebar/dataform-post-summary.js +196 -25
- package/src/components/sidebar/index.js +2 -12
- package/src/components/sidebar/post-revision-summary.js +8 -15
- package/src/components/sidebar/post-summary.js +1 -1
- package/src/components/style-book/index.js +1 -1
- package/src/components/template-actions-panel/block-theme-content.js +0 -1
- package/src/components/template-actions-panel/index.js +0 -15
- package/src/dataviews/fields/revisions/index.tsx +28 -0
- package/src/dataviews/fields/revisions/revisions-view.tsx +59 -0
- package/src/dataviews/store/private-actions.ts +27 -6
- package/src/store/private-selectors.js +11 -1
- package/src/store/test/private-selectors.js +69 -0
- package/src/style.scss +1 -1
- package/build/components/post-revisions-panel/index.cjs +0 -173
- package/build/components/post-revisions-panel/index.cjs.map +0 -7
- package/build/components/revision-author-panel/index.cjs.map +0 -7
- package/build/components/revision-created-panel/index.cjs +0 -47
- package/build/components/revision-created-panel/index.cjs.map +0 -7
- package/build-module/components/post-revisions-panel/index.mjs +0 -148
- package/build-module/components/post-revisions-panel/index.mjs.map +0 -7
- package/build-module/components/revision-author-panel/index.mjs +0 -28
- package/build-module/components/revision-author-panel/index.mjs.map +0 -7
- package/build-module/components/revision-created-panel/index.mjs +0 -26
- package/build-module/components/revision-created-panel/index.mjs.map +0 -7
- package/build-types/components/collab-sidebar/add-comment.d.ts +0 -6
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-form.d.ts +0 -9
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comments.d.ts +0 -10
- package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
- package/build-types/components/global-styles-provider/index.d.ts +0 -16
- package/build-types/components/global-styles-provider/index.d.ts.map +0 -1
- package/build-types/components/media/index.d.ts +0 -3
- package/build-types/components/media/index.d.ts.map +0 -1
- package/build-types/components/media/metadata-panel.d.ts +0 -12
- package/build-types/components/media/metadata-panel.d.ts.map +0 -1
- package/build-types/components/media/preview.d.ts +0 -9
- package/build-types/components/media/preview.d.ts.map +0 -1
- package/build-types/components/post-revisions-panel/index.d.ts +0 -2
- package/build-types/components/post-revisions-panel/index.d.ts.map +0 -1
- package/build-types/components/revision-author-panel/index.d.ts +0 -2
- package/build-types/components/revision-author-panel/index.d.ts.map +0 -1
- package/build-types/components/revision-created-panel/index.d.ts +0 -2
- package/build-types/components/revision-created-panel/index.d.ts.map +0 -1
- package/src/components/editor-help/images/add-dark.png +0 -0
- package/src/components/editor-help/images/add-dark@2x.png +0 -0
- package/src/components/editor-help/images/add-dark@3x.png +0 -0
- package/src/components/editor-help/images/add-light.png +0 -0
- package/src/components/editor-help/images/add-light@2x.png +0 -0
- package/src/components/editor-help/images/add-light@3x.png +0 -0
- package/src/components/editor-help/images/block-layout-collage.png +0 -0
- package/src/components/editor-help/images/block-layout-collage@2x.png +0 -0
- package/src/components/editor-help/images/block-layout-collage@3x.png +0 -0
- package/src/components/editor-help/images/build-layouts-dark.png +0 -0
- package/src/components/editor-help/images/build-layouts-dark@2x.png +0 -0
- package/src/components/editor-help/images/build-layouts-dark@3x.png +0 -0
- package/src/components/editor-help/images/build-layouts-light.png +0 -0
- package/src/components/editor-help/images/build-layouts-light@2x.png +0 -0
- package/src/components/editor-help/images/build-layouts-light@3x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
- package/src/components/editor-help/images/edit-media-dark.png +0 -0
- package/src/components/editor-help/images/edit-media-dark@2x.png +0 -0
- package/src/components/editor-help/images/edit-media-dark@3x.png +0 -0
- package/src/components/editor-help/images/edit-media-light.png +0 -0
- package/src/components/editor-help/images/edit-media-light@2x.png +0 -0
- package/src/components/editor-help/images/edit-media-light@3x.png +0 -0
- package/src/components/editor-help/images/embed-media-dark.png +0 -0
- package/src/components/editor-help/images/embed-media-dark@2x.png +0 -0
- package/src/components/editor-help/images/embed-media-dark@3x.png +0 -0
- package/src/components/editor-help/images/embed-media-light.png +0 -0
- package/src/components/editor-help/images/embed-media-light@2x.png +0 -0
- package/src/components/editor-help/images/embed-media-light@3x.png +0 -0
- package/src/components/editor-help/images/move-dark.png +0 -0
- package/src/components/editor-help/images/move-dark@2x.png +0 -0
- package/src/components/editor-help/images/move-dark@3x.png +0 -0
- package/src/components/editor-help/images/move-light.png +0 -0
- package/src/components/editor-help/images/move-light@2x.png +0 -0
- package/src/components/editor-help/images/move-light@3x.png +0 -0
- package/src/components/editor-help/images/options-dark.png +0 -0
- package/src/components/editor-help/images/options-dark@2x.png +0 -0
- package/src/components/editor-help/images/options-dark@3x.png +0 -0
- package/src/components/editor-help/images/options-light.png +0 -0
- package/src/components/editor-help/images/options-light@2x.png +0 -0
- package/src/components/editor-help/images/options-light@3x.png +0 -0
- package/src/components/editor-help/images/rich-text-dark.png +0 -0
- package/src/components/editor-help/images/rich-text-dark@2x.png +0 -0
- package/src/components/editor-help/images/rich-text-dark@3x.png +0 -0
- package/src/components/editor-help/images/rich-text-light.png +0 -0
- package/src/components/editor-help/images/rich-text-light@2x.png +0 -0
- package/src/components/editor-help/images/rich-text-light@3x.png +0 -0
- package/src/components/editor-help/images/settings-dark.png +0 -0
- package/src/components/editor-help/images/settings-dark@2x.png +0 -0
- package/src/components/editor-help/images/settings-dark@3x.png +0 -0
- package/src/components/editor-help/images/settings-light.png +0 -0
- package/src/components/editor-help/images/settings-light@2x.png +0 -0
- package/src/components/editor-help/images/settings-light@3x.png +0 -0
- package/src/components/editor-help/style.scss +0 -123
- package/src/components/post-revisions-panel/index.js +0 -161
- package/src/components/post-revisions-panel/style.scss +0 -16
- package/src/components/revision-author-panel/index.js +0 -36
- package/src/components/revision-created-panel/index.js +0 -36
|
@@ -75,10 +75,30 @@
|
|
|
75
75
|
color: $gray-700;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
.editor-collab-sidebar-panel__show-more-button {
|
|
79
|
+
width: fit-content;
|
|
80
|
+
color: var(--wpds-color-foreground-interactive-brand);
|
|
81
|
+
cursor: var(--wpds-cursor-control);
|
|
82
|
+
|
|
83
|
+
&:hover,
|
|
84
|
+
&:focus,
|
|
85
|
+
&:active {
|
|
86
|
+
color: var(--wpds-color-foreground-interactive-brand-active);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
78
90
|
.editor-collab-sidebar-panel__note-content {
|
|
79
91
|
p:last-child {
|
|
80
92
|
margin-bottom: 0;
|
|
81
93
|
}
|
|
94
|
+
|
|
95
|
+
&.is-collapsed {
|
|
96
|
+
-webkit-line-clamp: 3;
|
|
97
|
+
line-clamp: 3;
|
|
98
|
+
display: -webkit-box;
|
|
99
|
+
-webkit-box-orient: vertical;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
}
|
|
82
102
|
}
|
|
83
103
|
|
|
84
104
|
.editor-collab-sidebar-panel__user-avatar {
|
|
@@ -12,7 +12,6 @@ extend( [ a11yPlugin ] );
|
|
|
12
12
|
*/
|
|
13
13
|
import { Icon as WCIcon } from '@wordpress/components';
|
|
14
14
|
import { useMemo } from '@wordpress/element';
|
|
15
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
16
15
|
import { Tooltip } from '@wordpress/ui';
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -7,7 +7,6 @@ import userEvent from '@testing-library/user-event';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
11
10
|
import { Tooltip } from '@wordpress/ui';
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -141,6 +141,8 @@ export default function DocumentBar( props ) {
|
|
|
141
141
|
const { open: openCommandCenter } = useDispatch( commandsStore );
|
|
142
142
|
const isReducedMotion = useReducedMotion();
|
|
143
143
|
|
|
144
|
+
const hasShortcut = ! window.__experimentalAdminBarInEditor;
|
|
145
|
+
|
|
144
146
|
const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
|
|
145
147
|
const hasBackButton =
|
|
146
148
|
!! onNavigateToPreviousEntityRecord || !! unlockedPatternInfo;
|
|
@@ -175,6 +177,7 @@ export default function DocumentBar( props ) {
|
|
|
175
177
|
<div
|
|
176
178
|
className={ clsx( 'editor-document-bar', {
|
|
177
179
|
'has-back-button': hasBackButton,
|
|
180
|
+
'has-shortcut': hasShortcut,
|
|
178
181
|
} ) }
|
|
179
182
|
>
|
|
180
183
|
<AnimatePresence>
|
|
@@ -267,9 +270,11 @@ export default function DocumentBar( props ) {
|
|
|
267
270
|
) }
|
|
268
271
|
</WCText>
|
|
269
272
|
</motion.div>
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
{ hasShortcut && (
|
|
274
|
+
<span className="editor-document-bar__shortcut">
|
|
275
|
+
{ displayShortcut.primary( 'k' ) }
|
|
276
|
+
</span>
|
|
277
|
+
) }
|
|
273
278
|
</Button>
|
|
274
279
|
) }
|
|
275
280
|
</div>
|
|
@@ -55,8 +55,10 @@
|
|
|
55
55
|
max-width: 70%;
|
|
56
56
|
|
|
57
57
|
// Offset the layout based on the width of the ⌘K label. This ensures the title is centrally aligned.
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
.editor-document-bar.has-shortcut & {
|
|
59
|
+
@include break-medium() {
|
|
60
|
+
padding-left: $grid-unit-30;
|
|
61
|
+
}
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
h1 {
|
|
@@ -41,6 +41,7 @@ export default function EditorKeyboardShortcuts() {
|
|
|
41
41
|
isPostSavingLocked,
|
|
42
42
|
isListViewOpened,
|
|
43
43
|
getEditorMode,
|
|
44
|
+
isSavingNonPostEntityChanges,
|
|
44
45
|
} = useSelect( editorStore );
|
|
45
46
|
|
|
46
47
|
useShortcut(
|
|
@@ -75,7 +76,7 @@ export default function EditorKeyboardShortcuts() {
|
|
|
75
76
|
/**
|
|
76
77
|
* Do not save the post if post saving is locked.
|
|
77
78
|
*/
|
|
78
|
-
if ( isPostSavingLocked() ) {
|
|
79
|
+
if ( isPostSavingLocked() || isSavingNonPostEntityChanges() ) {
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useCallback, useEffect, useRef } from '@wordpress/element';
|
|
5
5
|
import { ifCondition, usePrevious } from '@wordpress/compose';
|
|
6
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
+
import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { parse } from '@wordpress/blocks';
|
|
9
9
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -53,19 +53,14 @@ const hasSessionStorageSupport = () => {
|
|
|
53
53
|
* restore a local autosave, if one exists.
|
|
54
54
|
*/
|
|
55
55
|
function useAutosaveNotice() {
|
|
56
|
-
const
|
|
56
|
+
const registry = useRegistry();
|
|
57
|
+
const { postId, isEditedPostNew } = useSelect(
|
|
57
58
|
( select ) => ( {
|
|
58
59
|
postId: select( editorStore ).getCurrentPostId(),
|
|
59
60
|
isEditedPostNew: select( editorStore ).isEditedPostNew(),
|
|
60
|
-
hasRemoteAutosave:
|
|
61
|
-
!! select( editorStore ).getEditorSettings().autosave,
|
|
62
61
|
} ),
|
|
63
62
|
[]
|
|
64
63
|
);
|
|
65
|
-
const { getEditedPostAttribute } = useSelect( editorStore );
|
|
66
|
-
|
|
67
|
-
const { createWarningNotice, removeNotice } = useDispatch( noticesStore );
|
|
68
|
-
const { editPost, resetEditorBlocks } = useDispatch( editorStore );
|
|
69
64
|
|
|
70
65
|
useEffect( () => {
|
|
71
66
|
let localAutosave = localAutosaveGet( postId, isEditedPostNew );
|
|
@@ -83,24 +78,31 @@ function useAutosaveNotice() {
|
|
|
83
78
|
const { post_title: title, content, excerpt } = localAutosave;
|
|
84
79
|
const edits = { title, content, excerpt };
|
|
85
80
|
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
const { getEditedPostAttribute, getEditorSettings } =
|
|
82
|
+
registry.select( editorStore );
|
|
83
|
+
|
|
84
|
+
// Only display a notice if there is a difference between what has been
|
|
85
|
+
// saved and that which is stored in sessionStorage.
|
|
86
|
+
const hasDifference = Object.keys( edits ).some( ( key ) => {
|
|
87
|
+
return edits[ key ] !== getEditedPostAttribute( key );
|
|
88
|
+
} );
|
|
89
|
+
|
|
90
|
+
if ( ! hasDifference ) {
|
|
91
|
+
// If there is no difference, it can be safely ejected from storage.
|
|
92
|
+
localAutosaveClear( postId, isEditedPostNew );
|
|
93
|
+
return;
|
|
98
94
|
}
|
|
99
95
|
|
|
96
|
+
const hasRemoteAutosave = !! getEditorSettings().autosave;
|
|
100
97
|
if ( hasRemoteAutosave ) {
|
|
101
98
|
return;
|
|
102
99
|
}
|
|
103
100
|
|
|
101
|
+
const { createWarningNotice, removeNotice } =
|
|
102
|
+
registry.dispatch( noticesStore );
|
|
103
|
+
const { editPost, resetEditorBlocks } =
|
|
104
|
+
registry.dispatch( editorStore );
|
|
105
|
+
|
|
104
106
|
const id = 'wpEditorAutosaveRestore';
|
|
105
107
|
|
|
106
108
|
createWarningNotice(
|
|
@@ -125,7 +127,7 @@ function useAutosaveNotice() {
|
|
|
125
127
|
],
|
|
126
128
|
}
|
|
127
129
|
);
|
|
128
|
-
}, [
|
|
130
|
+
}, [ registry, postId, isEditedPostNew ] );
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
/**
|
|
@@ -168,7 +168,7 @@ export default function PostCardPanel( {
|
|
|
168
168
|
{ sprintf(
|
|
169
169
|
// translators: %s: Name of the plural post type e.g: "Posts".
|
|
170
170
|
__( 'Changes will be applied to all selected %s.' ),
|
|
171
|
-
labels?.name
|
|
171
|
+
labels?.name?.toLowerCase()
|
|
172
172
|
) }
|
|
173
173
|
</WCText>
|
|
174
174
|
) }
|
|
@@ -48,7 +48,7 @@ export function PostPublishButton( {
|
|
|
48
48
|
isPublishable: store.isEditedPostPublishable(),
|
|
49
49
|
isPublished: store.isCurrentPostPublished(),
|
|
50
50
|
hasPublishAction:
|
|
51
|
-
store.getCurrentPost()
|
|
51
|
+
!! store.getCurrentPost()?._links?.[ 'wp:action-publish' ],
|
|
52
52
|
postType: store.getCurrentPostType(),
|
|
53
53
|
postId: store.getCurrentPostId(),
|
|
54
54
|
postStatus: store.getEditedPostAttribute( 'status' ),
|
|
@@ -103,18 +103,21 @@ export function PostPublishButton( {
|
|
|
103
103
|
|
|
104
104
|
const isButtonDisabled =
|
|
105
105
|
isPostSavingLocked ||
|
|
106
|
+
// Disable while a non-post entity (e.g. a newly created term) is mid-save.
|
|
107
|
+
isSavingNonPostEntityChanges ||
|
|
106
108
|
( ( isSaving ||
|
|
107
109
|
! isSaveable ||
|
|
108
110
|
( ! isPublishable && ! forceIsDirty ) ) &&
|
|
109
|
-
|
|
111
|
+
! hasNonPostEntityChanges );
|
|
110
112
|
|
|
111
113
|
const isToggleDisabled =
|
|
112
114
|
isPostSavingLocked ||
|
|
115
|
+
isSavingNonPostEntityChanges ||
|
|
113
116
|
( ( isPublished ||
|
|
114
117
|
isSaving ||
|
|
115
118
|
! isSaveable ||
|
|
116
119
|
( ! isPublishable && ! forceIsDirty ) ) &&
|
|
117
|
-
|
|
120
|
+
! hasNonPostEntityChanges );
|
|
118
121
|
|
|
119
122
|
// If the new status has not changed explicitly, we derive it from
|
|
120
123
|
// other factors, like having a publish action, etc.. We need to preserve
|
|
@@ -89,6 +89,19 @@ describe( 'PostPublishButton', () => {
|
|
|
89
89
|
);
|
|
90
90
|
} );
|
|
91
91
|
|
|
92
|
+
it( 'should be true if a non-post entity is being saved', () => {
|
|
93
|
+
mockSelector( 'isEditedPostPublishable', true );
|
|
94
|
+
mockSelector( 'isEditedPostSaveable', true );
|
|
95
|
+
mockSelector( 'isSavingNonPostEntityChanges', true );
|
|
96
|
+
|
|
97
|
+
render( <PostPublishButton /> );
|
|
98
|
+
|
|
99
|
+
expect( screen.getByRole( 'button' ) ).toHaveAttribute(
|
|
100
|
+
'aria-disabled',
|
|
101
|
+
'true'
|
|
102
|
+
);
|
|
103
|
+
} );
|
|
104
|
+
|
|
92
105
|
it( 'should be false if post is saveable but not publishable and forceIsDirty is true', () => {
|
|
93
106
|
mockSelector( 'isEditedPostSaveable', true );
|
|
94
107
|
mockSelector( 'isEditedPostPublishable', false );
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
store as blockEditorStore,
|
|
16
16
|
} from '@wordpress/block-editor';
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
19
18
|
import { Tooltip } from '@wordpress/ui';
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { DataViewsPicker, filterSortAndPaginate } from '@wordpress/dataviews';
|
|
7
|
+
import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
|
|
8
|
+
import { useCallback, useEffect, useMemo, useState } from '@wordpress/element';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { authorField } from '@wordpress/fields';
|
|
11
|
+
import { Text } from '@wordpress/ui';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
import { store as editorStore } from '../../store';
|
|
17
|
+
import { unlock } from '../../lock-unlock';
|
|
18
|
+
import { PostContentInformationUI } from '../post-content-information';
|
|
19
|
+
|
|
20
|
+
const PAGE_SIZE = 10;
|
|
21
|
+
const EMPTY_ARRAY = [];
|
|
22
|
+
const defaultLayouts = { pickerActivity: true };
|
|
23
|
+
const baseView = {
|
|
24
|
+
type: 'pickerActivity',
|
|
25
|
+
titleField: 'date',
|
|
26
|
+
descriptionField: 'details',
|
|
27
|
+
fields: [ 'author' ],
|
|
28
|
+
layout: { density: 'compact' },
|
|
29
|
+
page: 1,
|
|
30
|
+
perPage: PAGE_SIZE,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const DAY_IN_MILLISECONDS = 86400000;
|
|
34
|
+
|
|
35
|
+
function getDisplayDate( value ) {
|
|
36
|
+
const dateNowInMs = getDate( null ).getTime();
|
|
37
|
+
const date = getDate( value ?? null );
|
|
38
|
+
return dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS
|
|
39
|
+
? dateI18n( getSettings().formats.datetimeAbbreviated, date )
|
|
40
|
+
: humanTimeDiff( date );
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function PostRevisionsTimeline() {
|
|
44
|
+
const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
|
|
45
|
+
const [ view, setView ] = useState( baseView );
|
|
46
|
+
|
|
47
|
+
const { revisions, revisionKey, currentRevisionId, currentRevision } =
|
|
48
|
+
useSelect( ( select ) => {
|
|
49
|
+
const { getCurrentPostType } = select( editorStore );
|
|
50
|
+
const {
|
|
51
|
+
getCurrentRevisionId: _getCurrentRevisionId,
|
|
52
|
+
getCurrentRevision,
|
|
53
|
+
getRevisionPage,
|
|
54
|
+
getPageRevisions,
|
|
55
|
+
} = unlock( select( editorStore ) );
|
|
56
|
+
const { getEntityConfig } = select( coreStore );
|
|
57
|
+
|
|
58
|
+
const _postType = getCurrentPostType();
|
|
59
|
+
const entityConfig = getEntityConfig( 'postType', _postType );
|
|
60
|
+
const _revisionKey = entityConfig?.revisionKey || 'id';
|
|
61
|
+
const _currentRevisionId = _getCurrentRevisionId();
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
// Same desc-ordered window the header slider renders (warm cache).
|
|
65
|
+
revisions: getPageRevisions( getRevisionPage() ),
|
|
66
|
+
revisionKey: _revisionKey,
|
|
67
|
+
currentRevisionId: _currentRevisionId,
|
|
68
|
+
currentRevision: _currentRevisionId
|
|
69
|
+
? getCurrentRevision()
|
|
70
|
+
: undefined,
|
|
71
|
+
};
|
|
72
|
+
}, [] );
|
|
73
|
+
|
|
74
|
+
const postContent = currentRevision?.content?.raw;
|
|
75
|
+
|
|
76
|
+
const isLoading = ! revisions;
|
|
77
|
+
|
|
78
|
+
const fields = useMemo(
|
|
79
|
+
() => [
|
|
80
|
+
{
|
|
81
|
+
id: 'date',
|
|
82
|
+
label: __( 'Date' ),
|
|
83
|
+
// Return the humanized label the row renders so the picker
|
|
84
|
+
// option's accessible name announces e.g. "5 minutes ago"
|
|
85
|
+
// instead of the raw ISO timestamp.
|
|
86
|
+
getValue: ( { item } ) => getDisplayDate( item.date ),
|
|
87
|
+
render: ( { item } ) => (
|
|
88
|
+
<Text
|
|
89
|
+
variant="heading-sm"
|
|
90
|
+
render={ <time dateTime={ item.date } /> }
|
|
91
|
+
>
|
|
92
|
+
{ getDisplayDate( item.date ) }
|
|
93
|
+
</Text>
|
|
94
|
+
),
|
|
95
|
+
enableSorting: false,
|
|
96
|
+
enableHiding: false,
|
|
97
|
+
},
|
|
98
|
+
authorField,
|
|
99
|
+
{
|
|
100
|
+
id: 'details',
|
|
101
|
+
label: __( 'Details' ),
|
|
102
|
+
render: ( { item } ) => {
|
|
103
|
+
if (
|
|
104
|
+
String( item[ revisionKey ] ) !==
|
|
105
|
+
String( currentRevisionId )
|
|
106
|
+
) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return (
|
|
110
|
+
<PostContentInformationUI postContent={ postContent } />
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
enableSorting: false,
|
|
114
|
+
enableHiding: false,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
[ revisionKey, currentRevisionId, postContent ]
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const { data: shownRevisions, paginationInfo } = useMemo(
|
|
121
|
+
() => filterSortAndPaginate( revisions || EMPTY_ARRAY, view, fields ),
|
|
122
|
+
[ revisions, view, fields ]
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
// Keep the selected revision visible: when it changes (e.g. the slider
|
|
126
|
+
// scrubs), jump to the client-side page that contains it. Keyed on the
|
|
127
|
+
// selection/data, not view.page, so manual paging stays free browsing.
|
|
128
|
+
useEffect( () => {
|
|
129
|
+
if ( ! currentRevisionId || ! revisions ) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const index = revisions.findIndex(
|
|
133
|
+
( r ) => String( r[ revisionKey ] ) === String( currentRevisionId )
|
|
134
|
+
);
|
|
135
|
+
if ( index < 0 ) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const page = Math.floor( index / view.perPage ) + 1;
|
|
139
|
+
setView( ( v ) => ( v.page === page ? v : { ...v, page } ) );
|
|
140
|
+
}, [ currentRevisionId, revisions, revisionKey, view.perPage ] );
|
|
141
|
+
|
|
142
|
+
const selection = useMemo(
|
|
143
|
+
() =>
|
|
144
|
+
currentRevisionId ? [ String( currentRevisionId ) ] : EMPTY_ARRAY,
|
|
145
|
+
[ currentRevisionId ]
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const onChangeSelection = useCallback(
|
|
149
|
+
( newSelection ) => {
|
|
150
|
+
// Revisions mode always keeps one revision selected. Clicking the
|
|
151
|
+
// active revision yields an empty selection, which we ignore so the
|
|
152
|
+
// timeline never ends up with nothing selected.
|
|
153
|
+
if ( newSelection.length === 0 ) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const selectedId = newSelection[ newSelection.length - 1 ];
|
|
157
|
+
setCurrentRevisionId( Number( selectedId ) );
|
|
158
|
+
},
|
|
159
|
+
[ setCurrentRevisionId ]
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const getItemId = useCallback(
|
|
163
|
+
( item ) => String( item[ revisionKey ] ),
|
|
164
|
+
[ revisionKey ]
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<div className="editor-post-revisions-timeline">
|
|
169
|
+
<DataViewsPicker
|
|
170
|
+
view={ view }
|
|
171
|
+
onChangeView={ setView }
|
|
172
|
+
fields={ fields }
|
|
173
|
+
data={ shownRevisions }
|
|
174
|
+
isLoading={ isLoading }
|
|
175
|
+
paginationInfo={ paginationInfo }
|
|
176
|
+
defaultLayouts={ defaultLayouts }
|
|
177
|
+
getItemId={ getItemId }
|
|
178
|
+
selection={ selection }
|
|
179
|
+
onChangeSelection={ onChangeSelection }
|
|
180
|
+
>
|
|
181
|
+
<DataViewsPicker.Layout />
|
|
182
|
+
<DataViewsPicker.Footer />
|
|
183
|
+
</DataViewsPicker>
|
|
184
|
+
</div>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Give the revisions inspector a bounded height so the timeline scrolls
|
|
2
|
+
// internally and the picker's pagination stays pinned to the bottom.
|
|
3
|
+
//
|
|
4
|
+
// The timeline only renders in revisions mode, so its ancestors are scoped
|
|
5
|
+
// with `:has()` — keeping this layout out of the generic editor sidebar.
|
|
6
|
+
.interface-complementary-area:has(.editor-post-revisions-timeline) {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
|
+
// The tabs header keeps its natural height.
|
|
12
|
+
.editor-sidebar__panel-tabs {
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.editor-sidebar__panel:has(.editor-post-revisions-timeline) {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
flex: 1;
|
|
21
|
+
min-height: 0;
|
|
22
|
+
|
|
23
|
+
// The document tab panel hands its bounded height down to the timeline.
|
|
24
|
+
[role="tabpanel"]:has(.editor-post-revisions-timeline) {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
flex: 1;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Cap only the post-meta diff content so a large
|
|
32
|
+
// diff (e.g. footnotes) can't dominate the column.
|
|
33
|
+
.editor-revision-meta-diff__content {
|
|
34
|
+
max-height: 80px;
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// timeline grows to fill the leftover space and scrolls internally.
|
|
39
|
+
.editor-post-revisions-timeline {
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -46,6 +46,7 @@ export default function PostSavedState( { forceIsDirty } ) {
|
|
|
46
46
|
isSaveable,
|
|
47
47
|
isSaving,
|
|
48
48
|
isSavingLocked,
|
|
49
|
+
isSavingNonPostEntityChanges,
|
|
49
50
|
isScheduled,
|
|
50
51
|
hasPublishAction,
|
|
51
52
|
showIconLabels,
|
|
@@ -54,35 +55,25 @@ export default function PostSavedState( { forceIsDirty } ) {
|
|
|
54
55
|
postType,
|
|
55
56
|
} = useSelect(
|
|
56
57
|
( select ) => {
|
|
57
|
-
const
|
|
58
|
-
isEditedPostNew,
|
|
59
|
-
isCurrentPostPublished,
|
|
60
|
-
isCurrentPostScheduled,
|
|
61
|
-
isEditedPostDirty,
|
|
62
|
-
isSavingPost,
|
|
63
|
-
isEditedPostSaveable,
|
|
64
|
-
isPostSavingLocked,
|
|
65
|
-
getCurrentPost,
|
|
66
|
-
isAutosavingPost,
|
|
67
|
-
getEditedPostAttribute,
|
|
68
|
-
getPostEdits,
|
|
69
|
-
} = select( editorStore );
|
|
58
|
+
const store = select( editorStore );
|
|
70
59
|
const { get } = select( preferencesStore );
|
|
71
60
|
return {
|
|
72
|
-
isAutosaving: isAutosavingPost(),
|
|
73
|
-
isDirty: forceIsDirty || isEditedPostDirty(),
|
|
74
|
-
isNew: isEditedPostNew(),
|
|
75
|
-
isPublished: isCurrentPostPublished(),
|
|
76
|
-
isSaving: isSavingPost(),
|
|
77
|
-
isSaveable: isEditedPostSaveable(),
|
|
78
|
-
isSavingLocked: isPostSavingLocked(),
|
|
79
|
-
|
|
61
|
+
isAutosaving: store.isAutosavingPost(),
|
|
62
|
+
isDirty: forceIsDirty || store.isEditedPostDirty(),
|
|
63
|
+
isNew: store.isEditedPostNew(),
|
|
64
|
+
isPublished: store.isCurrentPostPublished(),
|
|
65
|
+
isSaving: store.isSavingPost(),
|
|
66
|
+
isSaveable: store.isEditedPostSaveable(),
|
|
67
|
+
isSavingLocked: store.isPostSavingLocked(),
|
|
68
|
+
isSavingNonPostEntityChanges:
|
|
69
|
+
store.isSavingNonPostEntityChanges(),
|
|
70
|
+
isScheduled: store.isCurrentPostScheduled(),
|
|
80
71
|
hasPublishAction:
|
|
81
|
-
getCurrentPost()?._links?.[ 'wp:action-publish' ]
|
|
72
|
+
!! store.getCurrentPost()?._links?.[ 'wp:action-publish' ],
|
|
82
73
|
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
83
|
-
postStatus: getEditedPostAttribute( 'status' ),
|
|
84
|
-
postStatusHasChanged: !! getPostEdits()?.status,
|
|
85
|
-
postType:
|
|
74
|
+
postStatus: store.getEditedPostAttribute( 'status' ),
|
|
75
|
+
postStatusHasChanged: !! store.getPostEdits()?.status,
|
|
76
|
+
postType: store.getCurrentPostType(),
|
|
86
77
|
};
|
|
87
78
|
},
|
|
88
79
|
[ forceIsDirty ]
|
|
@@ -143,7 +134,13 @@ export default function PostSavedState( { forceIsDirty } ) {
|
|
|
143
134
|
|
|
144
135
|
const isSaved = forceSavedMessage || ( ! isNew && ! isDirty );
|
|
145
136
|
const isSavedState = isSaving || isSaved;
|
|
146
|
-
const isDisabled =
|
|
137
|
+
const isDisabled =
|
|
138
|
+
isSaving ||
|
|
139
|
+
isSaved ||
|
|
140
|
+
! isSaveable ||
|
|
141
|
+
isSavingLocked ||
|
|
142
|
+
// Disable while a non-post entity (e.g. a newly created term) is mid-save.
|
|
143
|
+
isSavingNonPostEntityChanges;
|
|
147
144
|
let text;
|
|
148
145
|
|
|
149
146
|
if ( isSaving ) {
|
|
@@ -71,6 +71,24 @@ describe( 'PostSavedState', () => {
|
|
|
71
71
|
expect( screen.getByRole( 'button' ) ).toMatchSnapshot();
|
|
72
72
|
} );
|
|
73
73
|
|
|
74
|
+
it( 'returns a disabled button while a non-post entity is being saved', () => {
|
|
75
|
+
useSelect.mockImplementation( () => ( {
|
|
76
|
+
isDirty: true,
|
|
77
|
+
isNew: false,
|
|
78
|
+
isSaveable: true,
|
|
79
|
+
isSaving: false,
|
|
80
|
+
isSavingNonPostEntityChanges: true,
|
|
81
|
+
postStatus: 'draft',
|
|
82
|
+
} ) );
|
|
83
|
+
|
|
84
|
+
render( <PostSavedState /> );
|
|
85
|
+
|
|
86
|
+
expect( screen.getByRole( 'button' ) ).toHaveAttribute(
|
|
87
|
+
'aria-disabled',
|
|
88
|
+
'true'
|
|
89
|
+
);
|
|
90
|
+
} );
|
|
91
|
+
|
|
74
92
|
it( 'should return Saved text if not new and not dirty', () => {
|
|
75
93
|
useSelect.mockImplementation( () => ( {
|
|
76
94
|
isDirty: false,
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import { useEffect, useMemo, useState } from '@wordpress/element';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
withFilters,
|
|
9
|
-
__experimentalVStack as VStack,
|
|
10
|
-
} from '@wordpress/components';
|
|
6
|
+
import { FormTokenField, withFilters } from '@wordpress/components';
|
|
7
|
+
import { Stack } from '@wordpress/ui';
|
|
11
8
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
10
|
import { useDebounce } from '@wordpress/compose';
|
|
@@ -280,7 +277,7 @@ export function FlatTermSelector( { slug } ) {
|
|
|
280
277
|
);
|
|
281
278
|
|
|
282
279
|
return (
|
|
283
|
-
<
|
|
280
|
+
<Stack direction="column" gap="lg">
|
|
284
281
|
<FormTokenField
|
|
285
282
|
__next40pxDefaultSize
|
|
286
283
|
value={ values }
|
|
@@ -296,7 +293,7 @@ export function FlatTermSelector( { slug } ) {
|
|
|
296
293
|
} }
|
|
297
294
|
/>
|
|
298
295
|
<MostUsedTerms taxonomy={ taxonomy } onSelect={ appendTerm } />
|
|
299
|
-
</
|
|
296
|
+
</Stack>
|
|
300
297
|
);
|
|
301
298
|
}
|
|
302
299
|
|