@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
|
@@ -10,7 +10,9 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
10
10
|
import {
|
|
11
11
|
getDefaultRenderingMode,
|
|
12
12
|
getPostBlocksByName,
|
|
13
|
+
isCollaborationEnabledForCurrentPost,
|
|
13
14
|
} from '../private-selectors';
|
|
15
|
+
import { lock } from '../../lock-unlock';
|
|
14
16
|
|
|
15
17
|
describe( 'getPostBlocksByName', () => {
|
|
16
18
|
const state = {
|
|
@@ -86,6 +88,73 @@ describe( 'getPostBlocksByName', () => {
|
|
|
86
88
|
} );
|
|
87
89
|
} );
|
|
88
90
|
|
|
91
|
+
describe( 'isCollaborationEnabledForCurrentPost', () => {
|
|
92
|
+
let originalCollaborationEnabled;
|
|
93
|
+
|
|
94
|
+
beforeEach( () => {
|
|
95
|
+
originalCollaborationEnabled = window._wpCollaborationEnabled;
|
|
96
|
+
window._wpCollaborationEnabled = true;
|
|
97
|
+
} );
|
|
98
|
+
|
|
99
|
+
afterEach( () => {
|
|
100
|
+
window._wpCollaborationEnabled = originalCollaborationEnabled;
|
|
101
|
+
} );
|
|
102
|
+
|
|
103
|
+
function setupRegistry( {
|
|
104
|
+
collaborationSupported = true,
|
|
105
|
+
syncConfig = {},
|
|
106
|
+
} = {} ) {
|
|
107
|
+
isCollaborationEnabledForCurrentPost.registry = {
|
|
108
|
+
select: ( store ) => {
|
|
109
|
+
if ( store === coreStore ) {
|
|
110
|
+
const selectors = {
|
|
111
|
+
getEntityConfig: () => ( { syncConfig } ),
|
|
112
|
+
};
|
|
113
|
+
lock( selectors, {
|
|
114
|
+
isCollaborationSupported: () => collaborationSupported,
|
|
115
|
+
} );
|
|
116
|
+
return selectors;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
it( 'returns true when the current post type sync config should sync', () => {
|
|
123
|
+
const shouldSync = jest.fn( () => true );
|
|
124
|
+
setupRegistry( {
|
|
125
|
+
syncConfig: { shouldSync, supportsPersistence: true },
|
|
126
|
+
} );
|
|
127
|
+
|
|
128
|
+
const state = { postType: 'book', postId: 123 };
|
|
129
|
+
|
|
130
|
+
expect( isCollaborationEnabledForCurrentPost( state ) ).toBe( true );
|
|
131
|
+
expect( shouldSync ).toHaveBeenCalledWith( 'postType/book', 123 );
|
|
132
|
+
} );
|
|
133
|
+
|
|
134
|
+
it( 'returns false when the current post type sync config does not support persistence', () => {
|
|
135
|
+
const shouldSync = jest.fn( () => true );
|
|
136
|
+
setupRegistry( { syncConfig: { shouldSync } } );
|
|
137
|
+
|
|
138
|
+
const state = { postType: 'book', postId: 123 };
|
|
139
|
+
|
|
140
|
+
expect( isCollaborationEnabledForCurrentPost( state ) ).toBe( false );
|
|
141
|
+
expect( shouldSync ).not.toHaveBeenCalled();
|
|
142
|
+
} );
|
|
143
|
+
|
|
144
|
+
it( 'returns false when the current post type sync config should not sync', () => {
|
|
145
|
+
setupRegistry( {
|
|
146
|
+
syncConfig: {
|
|
147
|
+
shouldSync: () => false,
|
|
148
|
+
supportsPersistence: true,
|
|
149
|
+
},
|
|
150
|
+
} );
|
|
151
|
+
|
|
152
|
+
const state = { postType: 'book', postId: 123 };
|
|
153
|
+
|
|
154
|
+
expect( isCollaborationEnabledForCurrentPost( state ) ).toBe( false );
|
|
155
|
+
} );
|
|
156
|
+
} );
|
|
157
|
+
|
|
89
158
|
describe( 'getDefaultRenderingMode', () => {
|
|
90
159
|
function setupRegistry( {
|
|
91
160
|
supportsEditor = true,
|
package/src/style.scss
CHANGED
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
@use "./components/post-panel-row/style.scss" as *;
|
|
41
41
|
@use "./components/post-panel-section/style.scss" as *;
|
|
42
42
|
@use "./components/post-publish-panel/style.scss" as *;
|
|
43
|
-
@use "./components/post-revisions-panel/style.scss" as *;
|
|
44
43
|
@use "./components/post-revisions-preview/style.scss" as *;
|
|
44
|
+
@use "./components/post-revisions-timeline/style.scss" as *;
|
|
45
45
|
@use "./components/revision-diff-panel/style.scss" as *;
|
|
46
46
|
@use "./components/post-saved-state/style.scss" as *;
|
|
47
47
|
@use "./components/post-schedule/style.scss" as *;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/editor/src/components/post-revisions-panel/index.js
|
|
31
|
-
var post_revisions_panel_exports = {};
|
|
32
|
-
__export(post_revisions_panel_exports, {
|
|
33
|
-
default: () => PostRevisionsPanel
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(post_revisions_panel_exports);
|
|
36
|
-
var import_components = require("@wordpress/components");
|
|
37
|
-
var import_core_data = require("@wordpress/core-data");
|
|
38
|
-
var import_dataviews = require("@wordpress/dataviews");
|
|
39
|
-
var import_date = require("@wordpress/date");
|
|
40
|
-
var import_data = require("@wordpress/data");
|
|
41
|
-
var import_i18n = require("@wordpress/i18n");
|
|
42
|
-
var import_fields = require("@wordpress/fields");
|
|
43
|
-
var import_check = __toESM(require("../post-last-revision/check.cjs"));
|
|
44
|
-
var import_store = require("../../store/index.cjs");
|
|
45
|
-
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
46
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
-
var { Badge: WCBadge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
48
|
-
var DAY_IN_MILLISECONDS = 864e5;
|
|
49
|
-
var EMPTY_ARRAY = [];
|
|
50
|
-
var defaultLayouts = { activity: true };
|
|
51
|
-
var noop = () => {
|
|
52
|
-
};
|
|
53
|
-
var paginationInfo = {};
|
|
54
|
-
var view = {
|
|
55
|
-
type: "activity",
|
|
56
|
-
titleField: "date",
|
|
57
|
-
fields: ["author"],
|
|
58
|
-
layout: { density: "compact" }
|
|
59
|
-
};
|
|
60
|
-
var fields = [
|
|
61
|
-
{
|
|
62
|
-
id: "date",
|
|
63
|
-
label: (0, import_i18n.__)("Date"),
|
|
64
|
-
render: ({ item, field }) => {
|
|
65
|
-
const dateNowInMs = (0, import_date.getDate)(null).getTime();
|
|
66
|
-
const _value = field.getValue({ item });
|
|
67
|
-
const date = (0, import_date.getDate)(_value ?? null);
|
|
68
|
-
const displayDate = dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS ? (0, import_date.dateI18n)(
|
|
69
|
-
(0, import_date.getSettings)().formats.datetimeAbbreviated,
|
|
70
|
-
date
|
|
71
|
-
) : (0, import_date.humanTimeDiff)(date);
|
|
72
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
-
"time",
|
|
74
|
-
{
|
|
75
|
-
className: "editor-post-revisions-panel__revision-date",
|
|
76
|
-
dateTime: _value,
|
|
77
|
-
children: displayDate
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
enableSorting: false,
|
|
82
|
-
enableHiding: false
|
|
83
|
-
},
|
|
84
|
-
import_fields.authorField
|
|
85
|
-
];
|
|
86
|
-
function PostRevisionsPanelContent() {
|
|
87
|
-
const { setCurrentRevisionId } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_store.store));
|
|
88
|
-
const {
|
|
89
|
-
revisionsCount,
|
|
90
|
-
revisions,
|
|
91
|
-
revisionKey,
|
|
92
|
-
isLoading,
|
|
93
|
-
lastRevisionId
|
|
94
|
-
} = (0, import_data.useSelect)((select) => {
|
|
95
|
-
const { getCurrentPostId, getCurrentPostType } = select(import_store.store);
|
|
96
|
-
const { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } = select(import_store.store);
|
|
97
|
-
const { getRevisions, getEntityConfig, isResolving } = select(import_core_data.store);
|
|
98
|
-
const _postType = getCurrentPostType();
|
|
99
|
-
const entityConfig = getEntityConfig("postType", _postType);
|
|
100
|
-
const _revisionKey = entityConfig?.revisionKey || "id";
|
|
101
|
-
const revisionsQuery = {
|
|
102
|
-
per_page: 3,
|
|
103
|
-
orderby: "date",
|
|
104
|
-
order: "desc",
|
|
105
|
-
_fields: `${_revisionKey},date,author`
|
|
106
|
-
};
|
|
107
|
-
const query = [
|
|
108
|
-
"postType",
|
|
109
|
-
_postType,
|
|
110
|
-
getCurrentPostId(),
|
|
111
|
-
revisionsQuery
|
|
112
|
-
];
|
|
113
|
-
const _revisions = getRevisions(...query);
|
|
114
|
-
return {
|
|
115
|
-
revisionsCount: getCurrentPostRevisionsCount(),
|
|
116
|
-
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
117
|
-
revisions: _revisions,
|
|
118
|
-
revisionKey: _revisionKey,
|
|
119
|
-
isLoading: isResolving("getRevisions", query)
|
|
120
|
-
};
|
|
121
|
-
}, []);
|
|
122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
-
import_components.PanelBody,
|
|
124
|
-
{
|
|
125
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", align: "center", as: "span", children: [
|
|
126
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (0, import_i18n.__)("Revisions") }),
|
|
127
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(WCBadge, { className: "editor-post-revisions-panel__revisions-count", children: revisionsCount })
|
|
128
|
-
] }),
|
|
129
|
-
initialOpen: false,
|
|
130
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { className: "editor-post-revisions-panel", children: [
|
|
131
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
-
import_dataviews.DataViews,
|
|
133
|
-
{
|
|
134
|
-
view,
|
|
135
|
-
onChangeView: noop,
|
|
136
|
-
fields,
|
|
137
|
-
data: revisions || EMPTY_ARRAY,
|
|
138
|
-
isLoading,
|
|
139
|
-
paginationInfo,
|
|
140
|
-
defaultLayouts,
|
|
141
|
-
getItemId: (item) => item[revisionKey],
|
|
142
|
-
isItemClickable: () => true,
|
|
143
|
-
onClickItem: (item) => {
|
|
144
|
-
setCurrentRevisionId(item[revisionKey]);
|
|
145
|
-
},
|
|
146
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dataviews.DataViews.Layout, {})
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
150
|
-
import_components.Button,
|
|
151
|
-
{
|
|
152
|
-
className: "editor-post-revisions-panel__view-all",
|
|
153
|
-
__next40pxDefaultSize: true,
|
|
154
|
-
variant: "secondary",
|
|
155
|
-
onClick: () => setCurrentRevisionId(lastRevisionId),
|
|
156
|
-
children: (0, import_i18n.__)("View all revisions")
|
|
157
|
-
}
|
|
158
|
-
)
|
|
159
|
-
] })
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
function PostRevisionsPanel() {
|
|
164
|
-
const disableVisualRevisions = (0, import_data.useSelect)(
|
|
165
|
-
(select) => !!select(import_store.store).getEditorSettings().disableVisualRevisions,
|
|
166
|
-
[]
|
|
167
|
-
);
|
|
168
|
-
if (disableVisualRevisions) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_check.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PostRevisionsPanelContent, {}) });
|
|
172
|
-
}
|
|
173
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/post-revisions-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { DataViews } from '@wordpress/dataviews';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { authorField } from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from '../post-last-revision/check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\nconst DAY_IN_MILLISECONDS = 86400000;\nconst EMPTY_ARRAY = [];\nconst defaultLayouts = { activity: true };\nconst noop = () => {};\nconst paginationInfo = {};\nconst view = {\n\ttype: 'activity',\n\ttitleField: 'date',\n\tfields: [ 'author' ],\n\tlayout: { density: 'compact' },\n};\nconst fields = [\n\t{\n\t\tid: 'date',\n\t\tlabel: __( 'Date' ),\n\t\trender: ( { item, field } ) => {\n\t\t\tconst dateNowInMs = getDate( null ).getTime();\n\t\t\tconst _value = field.getValue( { item } );\n\t\t\tconst date = getDate( _value ?? null );\n\t\t\tconst displayDate =\n\t\t\t\tdateNowInMs - date.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t? dateI18n(\n\t\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t )\n\t\t\t\t\t: humanTimeDiff( date );\n\t\t\treturn (\n\t\t\t\t<time\n\t\t\t\t\tclassName=\"editor-post-revisions-panel__revision-date\"\n\t\t\t\t\tdateTime={ _value }\n\t\t\t\t>\n\t\t\t\t\t{ displayDate }\n\t\t\t\t</time>\n\t\t\t);\n\t\t},\n\t\tenableSorting: false,\n\t\tenableHiding: false,\n\t},\n\tauthorField,\n];\n\nfunction PostRevisionsPanelContent() {\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\tconst {\n\t\trevisionsCount,\n\t\trevisions,\n\t\trevisionKey,\n\t\tisLoading,\n\t\tlastRevisionId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } =\n\t\t\tselect( editorStore );\n\t\tconst { getRevisions, getEntityConfig, isResolving } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst entityConfig = getEntityConfig( 'postType', _postType );\n\t\tconst _revisionKey = entityConfig?.revisionKey || 'id';\n\t\tconst revisionsQuery = {\n\t\t\tper_page: 3,\n\t\t\torderby: 'date',\n\t\t\torder: 'desc',\n\t\t\t_fields: `${ _revisionKey },date,author`,\n\t\t};\n\t\tconst query = [\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\tgetCurrentPostId(),\n\t\t\trevisionsQuery,\n\t\t];\n\t\tconst _revisions = getRevisions( ...query );\n\t\treturn {\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisions: _revisions,\n\t\t\trevisionKey: _revisionKey,\n\t\t\tisLoading: isResolving( 'getRevisions', query ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={\n\t\t\t\t<HStack justify=\"space-between\" align=\"center\" as=\"span\">\n\t\t\t\t\t<span>{ __( 'Revisions' ) }</span>\n\t\t\t\t\t<WCBadge className=\"editor-post-revisions-panel__revisions-count\">\n\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t</WCBadge>\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\tinitialOpen={ false }\n\t\t>\n\t\t\t<VStack className=\"editor-post-revisions-panel\">\n\t\t\t\t<DataViews\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ noop }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tdata={ revisions || EMPTY_ARRAY }\n\t\t\t\t\tisLoading={ isLoading }\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\t\tgetItemId={ ( item ) => item[ revisionKey ] }\n\t\t\t\t\tisItemClickable={ () => true }\n\t\t\t\t\tonClickItem={ ( item ) => {\n\t\t\t\t\t\tsetCurrentRevisionId( item[ revisionKey ] );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<DataViews.Layout />\n\t\t\t\t</DataViews>\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-post-revisions-panel__view-all\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'View all revisions' ) }\n\t\t\t\t</Button>\n\t\t\t</VStack>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostRevisionsPanel() {\n\tconst disableVisualRevisions = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( editorStore ).getEditorSettings().disableVisualRevisions,\n\t\t[]\n\t);\n\tif ( disableVisualRevisions ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostRevisionsPanelContent />\n\t\t</PostLastRevisionCheck>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["componentsPrivateApis", "editorStore", "coreStore", "HStack", "VStack", "PostLastRevisionCheck"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/revision-author-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionAuthorPanel() {\n\tconst authorName = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\tconst revision = getCurrentRevision();\n\t\tif ( ! revision?.author ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst author = select( coreStore ).getUser( revision.author );\n\t\treturn author?.name;\n\t}, [] );\n\n\tif ( ! authorName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Author' ) }>\n\t\t\t{ decodeEntities( authorName ) }\n\t\t</PostPanelRow>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AACnC,2BAA+B;AAC/B,kBAAmB;AAKnB,4BAAyB;AACzB,mBAAqC;AACrC,yBAAuB;AAkBrB;AAhBa,SAAR,sBAAuC;AAC7C,QAAM,iBAAa,uBAAW,CAAE,WAAY;AAC3C,UAAM,EAAE,mBAAmB,QAAI,2BAAQ,OAAQ,aAAAA,KAAY,CAAE;AAC7D,UAAM,WAAW,mBAAmB;AACpC,QAAK,CAAE,UAAU,QAAS;AACzB,aAAO;AAAA,IACR;AACA,UAAM,SAAS,OAAQ,iBAAAC,KAAU,EAAE,QAAS,SAAS,MAAO;AAC5D,WAAO,QAAQ;AAAA,EAChB,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,sBAAAC,SAAA,EAAa,WAAQ,gBAAI,QAAS,GAChC,mDAAgB,UAAW,GAC9B;AAEF;",
|
|
6
|
-
"names": ["editorStore", "coreStore", "PostPanelRow"]
|
|
7
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/editor/src/components/revision-created-panel/index.js
|
|
21
|
-
var revision_created_panel_exports = {};
|
|
22
|
-
__export(revision_created_panel_exports, {
|
|
23
|
-
default: () => RevisionCreatedPanel
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(revision_created_panel_exports);
|
|
26
|
-
var import_components = require("@wordpress/components");
|
|
27
|
-
var import_data = require("@wordpress/data");
|
|
28
|
-
var import_i18n = require("@wordpress/i18n");
|
|
29
|
-
var import_date = require("@wordpress/date");
|
|
30
|
-
var import_store = require("../../store/index.cjs");
|
|
31
|
-
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
function RevisionCreatedPanel() {
|
|
34
|
-
const date = (0, import_data.useSelect)((select) => {
|
|
35
|
-
const { getCurrentRevision } = (0, import_lock_unlock.unlock)(select(import_store.store));
|
|
36
|
-
return getCurrentRevision()?.date;
|
|
37
|
-
}, []);
|
|
38
|
-
if (!date) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-last-edited-panel", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalText, { children: (0, import_i18n.sprintf)(
|
|
42
|
-
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
43
|
-
(0, import_i18n.__)("Created %s."),
|
|
44
|
-
(0, import_date.humanTimeDiff)(date)
|
|
45
|
-
) }) });
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/revision-created-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as WCText } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionCreatedPanel() {\n\tconst date = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\treturn getCurrentRevision()?.date;\n\t}, [] );\n\n\tif ( ! date ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-last-edited-panel\">\n\t\t\t<WCText>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t__( 'Created %s.' ),\n\t\t\t\t\thumanTimeDiff( date )\n\t\t\t\t) }\n\t\t\t</WCText>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA6C;AAC7C,kBAA0B;AAC1B,kBAA4B;AAC5B,kBAA8B;AAK9B,mBAAqC;AACrC,yBAAuB;AAcpB;AAZY,SAAR,uBAAwC;AAC9C,QAAM,WAAO,uBAAW,CAAE,WAAY;AACrC,UAAM,EAAE,mBAAmB,QAAI,2BAAQ,OAAQ,aAAAA,KAAY,CAAE;AAC7D,WAAO,mBAAmB,GAAG;AAAA,EAC9B,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,SAAI,WAAU,iCACd,sDAAC,kBAAAC,oBAAA,EACE;AAAA;AAAA,QAED,gBAAI,aAAc;AAAA,QAClB,2BAAe,IAAK;AAAA,EACrB,GACD,GACD;AAEF;",
|
|
6
|
-
"names": ["editorStore", "WCText"]
|
|
7
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
// packages/editor/src/components/post-revisions-panel/index.js
|
|
2
|
-
import {
|
|
3
|
-
PanelBody,
|
|
4
|
-
Button,
|
|
5
|
-
__experimentalHStack as HStack,
|
|
6
|
-
__experimentalVStack as VStack,
|
|
7
|
-
privateApis as componentsPrivateApis
|
|
8
|
-
} from "@wordpress/components";
|
|
9
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
10
|
-
import { DataViews } from "@wordpress/dataviews";
|
|
11
|
-
import { dateI18n, getDate, humanTimeDiff, getSettings } from "@wordpress/date";
|
|
12
|
-
import { useSelect, useDispatch } from "@wordpress/data";
|
|
13
|
-
import { __ } from "@wordpress/i18n";
|
|
14
|
-
import { authorField } from "@wordpress/fields";
|
|
15
|
-
import PostLastRevisionCheck from "../post-last-revision/check.mjs";
|
|
16
|
-
import { store as editorStore } from "../../store/index.mjs";
|
|
17
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
var { Badge: WCBadge } = unlock(componentsPrivateApis);
|
|
20
|
-
var DAY_IN_MILLISECONDS = 864e5;
|
|
21
|
-
var EMPTY_ARRAY = [];
|
|
22
|
-
var defaultLayouts = { activity: true };
|
|
23
|
-
var noop = () => {
|
|
24
|
-
};
|
|
25
|
-
var paginationInfo = {};
|
|
26
|
-
var view = {
|
|
27
|
-
type: "activity",
|
|
28
|
-
titleField: "date",
|
|
29
|
-
fields: ["author"],
|
|
30
|
-
layout: { density: "compact" }
|
|
31
|
-
};
|
|
32
|
-
var fields = [
|
|
33
|
-
{
|
|
34
|
-
id: "date",
|
|
35
|
-
label: __("Date"),
|
|
36
|
-
render: ({ item, field }) => {
|
|
37
|
-
const dateNowInMs = getDate(null).getTime();
|
|
38
|
-
const _value = field.getValue({ item });
|
|
39
|
-
const date = getDate(_value ?? null);
|
|
40
|
-
const displayDate = dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS ? dateI18n(
|
|
41
|
-
getSettings().formats.datetimeAbbreviated,
|
|
42
|
-
date
|
|
43
|
-
) : humanTimeDiff(date);
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
-
"time",
|
|
46
|
-
{
|
|
47
|
-
className: "editor-post-revisions-panel__revision-date",
|
|
48
|
-
dateTime: _value,
|
|
49
|
-
children: displayDate
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
},
|
|
53
|
-
enableSorting: false,
|
|
54
|
-
enableHiding: false
|
|
55
|
-
},
|
|
56
|
-
authorField
|
|
57
|
-
];
|
|
58
|
-
function PostRevisionsPanelContent() {
|
|
59
|
-
const { setCurrentRevisionId } = unlock(useDispatch(editorStore));
|
|
60
|
-
const {
|
|
61
|
-
revisionsCount,
|
|
62
|
-
revisions,
|
|
63
|
-
revisionKey,
|
|
64
|
-
isLoading,
|
|
65
|
-
lastRevisionId
|
|
66
|
-
} = useSelect((select) => {
|
|
67
|
-
const { getCurrentPostId, getCurrentPostType } = select(editorStore);
|
|
68
|
-
const { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } = select(editorStore);
|
|
69
|
-
const { getRevisions, getEntityConfig, isResolving } = select(coreStore);
|
|
70
|
-
const _postType = getCurrentPostType();
|
|
71
|
-
const entityConfig = getEntityConfig("postType", _postType);
|
|
72
|
-
const _revisionKey = entityConfig?.revisionKey || "id";
|
|
73
|
-
const revisionsQuery = {
|
|
74
|
-
per_page: 3,
|
|
75
|
-
orderby: "date",
|
|
76
|
-
order: "desc",
|
|
77
|
-
_fields: `${_revisionKey},date,author`
|
|
78
|
-
};
|
|
79
|
-
const query = [
|
|
80
|
-
"postType",
|
|
81
|
-
_postType,
|
|
82
|
-
getCurrentPostId(),
|
|
83
|
-
revisionsQuery
|
|
84
|
-
];
|
|
85
|
-
const _revisions = getRevisions(...query);
|
|
86
|
-
return {
|
|
87
|
-
revisionsCount: getCurrentPostRevisionsCount(),
|
|
88
|
-
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
89
|
-
revisions: _revisions,
|
|
90
|
-
revisionKey: _revisionKey,
|
|
91
|
-
isLoading: isResolving("getRevisions", query)
|
|
92
|
-
};
|
|
93
|
-
}, []);
|
|
94
|
-
return /* @__PURE__ */ jsx(
|
|
95
|
-
PanelBody,
|
|
96
|
-
{
|
|
97
|
-
title: /* @__PURE__ */ jsxs(HStack, { justify: "space-between", align: "center", as: "span", children: [
|
|
98
|
-
/* @__PURE__ */ jsx("span", { children: __("Revisions") }),
|
|
99
|
-
/* @__PURE__ */ jsx(WCBadge, { className: "editor-post-revisions-panel__revisions-count", children: revisionsCount })
|
|
100
|
-
] }),
|
|
101
|
-
initialOpen: false,
|
|
102
|
-
children: /* @__PURE__ */ jsxs(VStack, { className: "editor-post-revisions-panel", children: [
|
|
103
|
-
/* @__PURE__ */ jsx(
|
|
104
|
-
DataViews,
|
|
105
|
-
{
|
|
106
|
-
view,
|
|
107
|
-
onChangeView: noop,
|
|
108
|
-
fields,
|
|
109
|
-
data: revisions || EMPTY_ARRAY,
|
|
110
|
-
isLoading,
|
|
111
|
-
paginationInfo,
|
|
112
|
-
defaultLayouts,
|
|
113
|
-
getItemId: (item) => item[revisionKey],
|
|
114
|
-
isItemClickable: () => true,
|
|
115
|
-
onClickItem: (item) => {
|
|
116
|
-
setCurrentRevisionId(item[revisionKey]);
|
|
117
|
-
},
|
|
118
|
-
children: /* @__PURE__ */ jsx(DataViews.Layout, {})
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
122
|
-
Button,
|
|
123
|
-
{
|
|
124
|
-
className: "editor-post-revisions-panel__view-all",
|
|
125
|
-
__next40pxDefaultSize: true,
|
|
126
|
-
variant: "secondary",
|
|
127
|
-
onClick: () => setCurrentRevisionId(lastRevisionId),
|
|
128
|
-
children: __("View all revisions")
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
] })
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
function PostRevisionsPanel() {
|
|
136
|
-
const disableVisualRevisions = useSelect(
|
|
137
|
-
(select) => !!select(editorStore).getEditorSettings().disableVisualRevisions,
|
|
138
|
-
[]
|
|
139
|
-
);
|
|
140
|
-
if (disableVisualRevisions) {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
return /* @__PURE__ */ jsx(PostLastRevisionCheck, { children: /* @__PURE__ */ jsx(PostRevisionsPanelContent, {}) });
|
|
144
|
-
}
|
|
145
|
-
export {
|
|
146
|
-
PostRevisionsPanel as default
|
|
147
|
-
};
|
|
148
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/post-revisions-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { DataViews } from '@wordpress/dataviews';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { authorField } from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from '../post-last-revision/check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\nconst DAY_IN_MILLISECONDS = 86400000;\nconst EMPTY_ARRAY = [];\nconst defaultLayouts = { activity: true };\nconst noop = () => {};\nconst paginationInfo = {};\nconst view = {\n\ttype: 'activity',\n\ttitleField: 'date',\n\tfields: [ 'author' ],\n\tlayout: { density: 'compact' },\n};\nconst fields = [\n\t{\n\t\tid: 'date',\n\t\tlabel: __( 'Date' ),\n\t\trender: ( { item, field } ) => {\n\t\t\tconst dateNowInMs = getDate( null ).getTime();\n\t\t\tconst _value = field.getValue( { item } );\n\t\t\tconst date = getDate( _value ?? null );\n\t\t\tconst displayDate =\n\t\t\t\tdateNowInMs - date.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t? dateI18n(\n\t\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t )\n\t\t\t\t\t: humanTimeDiff( date );\n\t\t\treturn (\n\t\t\t\t<time\n\t\t\t\t\tclassName=\"editor-post-revisions-panel__revision-date\"\n\t\t\t\t\tdateTime={ _value }\n\t\t\t\t>\n\t\t\t\t\t{ displayDate }\n\t\t\t\t</time>\n\t\t\t);\n\t\t},\n\t\tenableSorting: false,\n\t\tenableHiding: false,\n\t},\n\tauthorField,\n];\n\nfunction PostRevisionsPanelContent() {\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\tconst {\n\t\trevisionsCount,\n\t\trevisions,\n\t\trevisionKey,\n\t\tisLoading,\n\t\tlastRevisionId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } =\n\t\t\tselect( editorStore );\n\t\tconst { getRevisions, getEntityConfig, isResolving } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst entityConfig = getEntityConfig( 'postType', _postType );\n\t\tconst _revisionKey = entityConfig?.revisionKey || 'id';\n\t\tconst revisionsQuery = {\n\t\t\tper_page: 3,\n\t\t\torderby: 'date',\n\t\t\torder: 'desc',\n\t\t\t_fields: `${ _revisionKey },date,author`,\n\t\t};\n\t\tconst query = [\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\tgetCurrentPostId(),\n\t\t\trevisionsQuery,\n\t\t];\n\t\tconst _revisions = getRevisions( ...query );\n\t\treturn {\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisions: _revisions,\n\t\t\trevisionKey: _revisionKey,\n\t\t\tisLoading: isResolving( 'getRevisions', query ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={\n\t\t\t\t<HStack justify=\"space-between\" align=\"center\" as=\"span\">\n\t\t\t\t\t<span>{ __( 'Revisions' ) }</span>\n\t\t\t\t\t<WCBadge className=\"editor-post-revisions-panel__revisions-count\">\n\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t</WCBadge>\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\tinitialOpen={ false }\n\t\t>\n\t\t\t<VStack className=\"editor-post-revisions-panel\">\n\t\t\t\t<DataViews\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ noop }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tdata={ revisions || EMPTY_ARRAY }\n\t\t\t\t\tisLoading={ isLoading }\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\t\tgetItemId={ ( item ) => item[ revisionKey ] }\n\t\t\t\t\tisItemClickable={ () => true }\n\t\t\t\t\tonClickItem={ ( item ) => {\n\t\t\t\t\t\tsetCurrentRevisionId( item[ revisionKey ] );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<DataViews.Layout />\n\t\t\t\t</DataViews>\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-post-revisions-panel__view-all\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'View all revisions' ) }\n\t\t\t\t</Button>\n\t\t\t</VStack>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostRevisionsPanel() {\n\tconst disableVisualRevisions = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( editorStore ).getEditorSettings().disableVisualRevisions,\n\t\t[]\n\t);\n\tif ( disableVisualRevisions ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostRevisionsPanelContent />\n\t\t</PostLastRevisionCheck>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// packages/editor/src/components/revision-author-panel/index.js
|
|
2
|
-
import { useSelect } from "@wordpress/data";
|
|
3
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
4
|
-
import { decodeEntities } from "@wordpress/html-entities";
|
|
5
|
-
import { __ } from "@wordpress/i18n";
|
|
6
|
-
import PostPanelRow from "../post-panel-row/index.mjs";
|
|
7
|
-
import { store as editorStore } from "../../store/index.mjs";
|
|
8
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
function RevisionAuthorPanel() {
|
|
11
|
-
const authorName = useSelect((select) => {
|
|
12
|
-
const { getCurrentRevision } = unlock(select(editorStore));
|
|
13
|
-
const revision = getCurrentRevision();
|
|
14
|
-
if (!revision?.author) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
const author = select(coreStore).getUser(revision.author);
|
|
18
|
-
return author?.name;
|
|
19
|
-
}, []);
|
|
20
|
-
if (!authorName) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return /* @__PURE__ */ jsx(PostPanelRow, { label: __("Author"), children: decodeEntities(authorName) });
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
RevisionAuthorPanel as default
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/revision-author-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionAuthorPanel() {\n\tconst authorName = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\tconst revision = getCurrentRevision();\n\t\tif ( ! revision?.author ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst author = select( coreStore ).getUser( revision.author );\n\t\treturn author?.name;\n\t}, [] );\n\n\tif ( ! authorName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Author' ) }>\n\t\t\t{ decodeEntities( authorName ) }\n\t\t</PostPanelRow>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,sBAAsB;AAC/B,SAAS,UAAU;AAKnB,OAAO,kBAAkB;AACzB,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AAkBrB;AAhBa,SAAR,sBAAuC;AAC7C,QAAM,aAAa,UAAW,CAAE,WAAY;AAC3C,UAAM,EAAE,mBAAmB,IAAI,OAAQ,OAAQ,WAAY,CAAE;AAC7D,UAAM,WAAW,mBAAmB;AACpC,QAAK,CAAE,UAAU,QAAS;AACzB,aAAO;AAAA,IACR;AACA,UAAM,SAAS,OAAQ,SAAU,EAAE,QAAS,SAAS,MAAO;AAC5D,WAAO,QAAQ;AAAA,EAChB,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,gBAAa,OAAQ,GAAI,QAAS,GAChC,yBAAgB,UAAW,GAC9B;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// packages/editor/src/components/revision-created-panel/index.js
|
|
2
|
-
import { __experimentalText as WCText } from "@wordpress/components";
|
|
3
|
-
import { useSelect } from "@wordpress/data";
|
|
4
|
-
import { __, sprintf } from "@wordpress/i18n";
|
|
5
|
-
import { humanTimeDiff } from "@wordpress/date";
|
|
6
|
-
import { store as editorStore } from "../../store/index.mjs";
|
|
7
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
function RevisionCreatedPanel() {
|
|
10
|
-
const date = useSelect((select) => {
|
|
11
|
-
const { getCurrentRevision } = unlock(select(editorStore));
|
|
12
|
-
return getCurrentRevision()?.date;
|
|
13
|
-
}, []);
|
|
14
|
-
if (!date) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ jsx("div", { className: "editor-post-last-edited-panel", children: /* @__PURE__ */ jsx(WCText, { children: sprintf(
|
|
18
|
-
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
19
|
-
__("Created %s."),
|
|
20
|
-
humanTimeDiff(date)
|
|
21
|
-
) }) });
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
RevisionCreatedPanel as default
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/revision-created-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as WCText } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionCreatedPanel() {\n\tconst date = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\treturn getCurrentRevision()?.date;\n\t}, [] );\n\n\tif ( ! date ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-last-edited-panel\">\n\t\t\t<WCText>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t__( 'Created %s.' ),\n\t\t\t\t\thumanTimeDiff( date )\n\t\t\t\t) }\n\t\t\t</WCText>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,sBAAsB,cAAc;AAC7C,SAAS,iBAAiB;AAC1B,SAAS,IAAI,eAAe;AAC5B,SAAS,qBAAqB;AAK9B,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AAcpB;AAZY,SAAR,uBAAwC;AAC9C,QAAM,OAAO,UAAW,CAAE,WAAY;AACrC,UAAM,EAAE,mBAAmB,IAAI,OAAQ,OAAQ,WAAY,CAAE;AAC7D,WAAO,mBAAmB,GAAG;AAAA,EAC9B,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,SAAI,WAAU,iCACd,8BAAC,UACE;AAAA;AAAA,IAED,GAAI,aAAc;AAAA,IAClB,cAAe,IAAK;AAAA,EACrB,GACD,GACD;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-comment.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/add-comment.js"],"names":[],"mappings":"AAuBA;;;;uCA+DC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comment-author-info.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/comment-author-info.js"],"names":[],"mappings":";AAqBA;;;;;gCAwFC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default CommentForm;
|
|
2
|
-
declare function CommentForm({ onSubmit, onCancel, thread, submitButtonText, labelText, }: {
|
|
3
|
-
onSubmit: any;
|
|
4
|
-
onCancel: any;
|
|
5
|
-
thread: any;
|
|
6
|
-
submitButtonText: any;
|
|
7
|
-
labelText: any;
|
|
8
|
-
}): import("react").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=comment-form.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comment-form.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/comment-form.js"],"names":[],"mappings":";AAuBA;;;;;;gCA6EC"}
|