@wordpress/editor 14.48.0 → 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/CHANGELOG.md +25 -1
- package/build/bindings/pattern-overrides.cjs +1 -1
- package/build/bindings/pattern-overrides.cjs.map +2 -2
- package/build/components/block-removal-warnings/index.cjs +0 -3
- package/build/components/block-removal-warnings/index.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-indicator-toolbar.cjs +49 -43
- package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +3 -3
- 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 +1 -8
- package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +3 -3
- package/build/components/collaborators-overlay/use-render-cursors.cjs +1 -7
- package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
- 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/more-menu/view-more-menu-group.cjs +1 -2
- package/build/components/more-menu/view-more-menu-group.cjs.map +2 -2
- package/build/components/page-attributes/parent.cjs +2 -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 +115 -157
- package/build/components/post-publish-button/index.cjs.map +3 -3
- 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 +21 -9
- package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
- package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
- package/build/components/post-revisions-preview/preserve-client-ids.cjs +2 -2
- package/build/components/post-revisions-preview/preserve-client-ids.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 +3 -1
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/use-network-reconnect.cjs +51 -0
- package/build/components/provider/use-network-reconnect.cjs.map +7 -0
- 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 +8 -4
- 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 +2 -15
- 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 +7 -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 +161 -0
- package/build/components/upload-progress-snackbar/index.cjs.map +7 -0
- package/build/components/upload-progress-snackbar/tracker.cjs +90 -0
- package/build/components/upload-progress-snackbar/tracker.cjs.map +7 -0
- 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/private-apis.cjs +2 -0
- package/build/private-apis.cjs.map +3 -3
- 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/store/selectors.cjs +1 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/media-upload/index.cjs +16 -0
- package/build/utils/media-upload/index.cjs.map +3 -3
- 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/block-removal-warnings/index.mjs +0 -3
- package/build-module/components/block-removal-warnings/index.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-indicator-toolbar.mjs +53 -44
- package/build-module/components/collab-sidebar/note-indicator-toolbar.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 +1 -8
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs +1 -7
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
- 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/more-menu/view-more-menu-group.mjs +1 -2
- package/build-module/components/more-menu/view-more-menu-group.mjs.map +2 -2
- package/build-module/components/page-attributes/parent.mjs +2 -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 +117 -159
- 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 +20 -8
- package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/preserve-client-ids.mjs +1 -1
- package/build-module/components/post-revisions-preview/preserve-client-ids.mjs.map +1 -1
- 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 +3 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-network-reconnect.mjs +30 -0
- package/build-module/components/provider/use-network-reconnect.mjs.map +7 -0
- 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 +8 -4
- 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 +3 -22
- 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 +7 -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 +135 -0
- package/build-module/components/upload-progress-snackbar/index.mjs.map +7 -0
- package/build-module/components/upload-progress-snackbar/tracker.mjs +61 -0
- package/build-module/components/upload-progress-snackbar/tracker.mjs.map +7 -0
- 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/private-apis.mjs +2 -0
- package/build-module/private-apis.mjs.map +2 -2
- 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/store/selectors.mjs +1 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/media-upload/index.mjs +19 -0
- package/build-module/utils/media-upload/index.mjs.map +2 -2
- package/build-module/utils/set-nested-value.mjs.map +1 -1
- package/build-style/style-rtl.css +707 -270
- package/build-style/style.css +707 -270
- package/build-types/components/block-removal-warnings/index.d.ts.map +1 -1
- 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-indicator-toolbar.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +0 -3
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
- 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/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-publish-button/index.d.ts +9 -9
- package/build-types/components/post-publish-button/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/block-diff.d.ts +3 -0
- package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
- package/build-types/components/post-revisions-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.map +1 -1
- package/build-types/components/post-text-editor/utils.d.ts +29 -0
- package/build-types/components/post-text-editor/utils.d.ts.map +1 -0
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-network-reconnect.d.ts +8 -0
- package/build-types/components/provider/use-network-reconnect.d.ts.map +1 -0
- package/build-types/components/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 +3 -0
- 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/components/upload-progress-snackbar/index.d.ts +19 -0
- package/build-types/components/upload-progress-snackbar/index.d.ts.map +1 -0
- package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts +28 -0
- package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts.map +1 -0
- package/build-types/components/upload-progress-snackbar/tracker.d.ts +41 -0
- package/build-types/components/upload-progress-snackbar/tracker.d.ts.map +1 -0
- package/build-types/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/private-apis.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/build-types/utils/get-template-part-icon.d.ts.map +1 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/package.json +59 -50
- package/src/bindings/pattern-overrides.js +1 -1
- package/src/bindings/test/pattern-overrides.js +65 -0
- package/src/components/README.md +1 -1
- package/src/components/block-removal-warnings/index.js +0 -7
- package/src/components/collab-sidebar/note-byline.js +0 -1
- package/src/components/collab-sidebar/note-indicator-toolbar.js +73 -60
- package/src/components/collab-sidebar/note.js +64 -29
- package/src/components/collab-sidebar/style.scss +20 -0
- package/src/components/collaborators-overlay/use-block-highlighting.ts +0 -9
- package/src/components/collaborators-overlay/use-render-cursors.ts +0 -8
- package/src/components/collaborators-presence/avatar/component.tsx +0 -1
- package/src/components/collaborators-presence/avatar/test/index.tsx +8 -4
- 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/more-menu/view-more-menu-group.js +1 -2
- package/src/components/page-attributes/parent.js +1 -0
- package/src/components/post-card-panel/index.js +1 -1
- package/src/components/post-publish-button/index.js +146 -192
- package/src/components/post-publish-button/test/index.js +149 -113
- package/src/components/post-revisions-preview/block-diff.js +63 -19
- package/src/components/post-revisions-preview/diff-markers.js +0 -1
- package/src/components/post-revisions-preview/preserve-client-ids.js +1 -1
- package/src/components/post-revisions-preview/test/block-diff.js +109 -6
- 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 +6 -1
- package/src/components/provider/test/use-network-reconnect.js +137 -0
- package/src/components/provider/use-network-reconnect.js +44 -0
- 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 +19 -3
- package/src/components/sidebar/dataform-post-summary.js +196 -25
- package/src/components/sidebar/index.js +4 -23
- 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 +10 -2
- package/src/components/template-actions-panel/index.js +0 -15
- package/src/components/upload-progress-snackbar/README.md +26 -0
- package/src/components/upload-progress-snackbar/index.js +216 -0
- package/src/components/upload-progress-snackbar/stories/index.story.tsx +85 -0
- package/src/components/upload-progress-snackbar/style.scss +30 -0
- package/src/components/upload-progress-snackbar/test/index.js +199 -0
- package/src/components/upload-progress-snackbar/tracker.js +105 -0
- 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/private-apis.js +2 -0
- package/src/store/private-selectors.js +11 -1
- package/src/store/selectors.js +1 -3
- package/src/store/test/private-selectors.js +69 -0
- package/src/style.scss +2 -1
- package/src/utils/media-upload/index.js +27 -0
- 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/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/commands/index.native.js +0 -2
- package/src/components/deprecated.native.js +0 -47
- package/src/components/editor-help/add-blocks.native.js +0 -40
- package/src/components/editor-help/customize-blocks.native.js +0 -40
- package/src/components/editor-help/help-detail-navigation-screen.native.js +0 -67
- package/src/components/editor-help/help-get-support-button.native.js +0 -38
- package/src/components/editor-help/help-section-title.native.js +0 -29
- package/src/components/editor-help/help-topic-row.native.js +0 -33
- package/src/components/editor-help/icon-move-blocks.native.js +0 -10
- 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/index.native.js +0 -208
- package/src/components/editor-help/intro-to-blocks.native.js +0 -91
- package/src/components/editor-help/move-blocks.native.js +0 -55
- package/src/components/editor-help/remove-blocks.native.js +0 -35
- package/src/components/editor-help/style.android.scss +0 -6
- package/src/components/editor-help/style.ios.scss +0 -6
- package/src/components/editor-help/style.scss +0 -123
- package/src/components/editor-help/test/index.native.js +0 -81
- package/src/components/editor-help/view-sections.native.js +0 -79
- package/src/components/error-boundary/index.native.js +0 -192
- package/src/components/error-boundary/style.native.scss +0 -116
- package/src/components/index.native.js +0 -15
- package/src/components/offline-status/index.native.js +0 -99
- package/src/components/offline-status/style.native.scss +0 -28
- package/src/components/offline-status/test/index.native.js +0 -108
- package/src/components/post-revisions-panel/index.js +0 -161
- package/src/components/post-revisions-panel/style.scss +0 -16
- package/src/components/post-title/index.native.js +0 -282
- package/src/components/post-title/style.native.scss +0 -13
- package/src/components/post-title/test/__snapshots__/index.native.js.snap +0 -25
- package/src/components/post-title/test/index.native.js +0 -78
- package/src/components/provider/index.native.js +0 -497
- package/src/components/provider/use-block-editor-settings.native.js +0 -48
- package/src/components/revision-author-panel/index.js +0 -36
- package/src/components/revision-created-panel/index.js +0 -36
- package/src/components/template-part-menu-items/index.native.js +0 -3
- package/src/hooks/index.native.js +0 -0
- package/src/index.native.js +0 -16
- package/src/private-apis.native.js +0 -33
- package/src/store/actions.native.js +0 -27
- package/src/store/reducer.native.js +0 -94
- package/src/store/selectors.native.js +0 -57
- package/src/store/test/actions.native.js +0 -16
- package/src/store/test/reducer.native.js +0 -36
- package/src/store/test/selectors.native.js +0 -28
- package/src/utils/index.native.js +0 -6
- package/src/utils/media-sideload/index.native.js +0 -1
- package/src/utils/media-upload/index.native.js +0 -1
|
@@ -33,7 +33,7 @@ __export(revision_fields_diff_exports, {
|
|
|
33
33
|
default: () => RevisionFieldsDiffPanel
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(revision_fields_diff_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_diff = require("diff");
|
|
37
37
|
var import_data = require("@wordpress/data");
|
|
38
38
|
var import_element = require("@wordpress/element");
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -50,6 +50,9 @@ function stringifyValue(value) {
|
|
|
50
50
|
}
|
|
51
51
|
return String(value);
|
|
52
52
|
}
|
|
53
|
+
function isEmptyMeta(str) {
|
|
54
|
+
return !str || str === "[]" || str === "{}";
|
|
55
|
+
}
|
|
53
56
|
function RevisionFieldsDiffPanel() {
|
|
54
57
|
const { revision, previousRevision } = (0, import_data.useSelect)((select) => {
|
|
55
58
|
const { getCurrentRevision, getPreviousRevision } = (0, import_lock_unlock.unlock)(
|
|
@@ -74,10 +77,10 @@ function RevisionFieldsDiffPanel() {
|
|
|
74
77
|
for (const key of allMetaKeys) {
|
|
75
78
|
const revStr = stringifyValue(revisionMeta[key]);
|
|
76
79
|
const prevStr = stringifyValue(previousMeta[key]);
|
|
77
|
-
if (
|
|
80
|
+
if (isEmptyMeta(revStr) && isEmptyMeta(prevStr)) {
|
|
78
81
|
continue;
|
|
79
82
|
}
|
|
80
|
-
result[key] = (0,
|
|
83
|
+
result[key] = (0, import_diff.diffWordsWithSpace)(prevStr, revStr);
|
|
81
84
|
}
|
|
82
85
|
if (Object.keys(result).length === 0) {
|
|
83
86
|
return null;
|
|
@@ -89,7 +92,8 @@ function RevisionFieldsDiffPanel() {
|
|
|
89
92
|
{
|
|
90
93
|
title: (0, import_i18n.__)("Meta"),
|
|
91
94
|
entries,
|
|
92
|
-
initialOpen: false
|
|
95
|
+
initialOpen: false,
|
|
96
|
+
className: "editor-revision-meta-diff__content"
|
|
93
97
|
}
|
|
94
98
|
);
|
|
95
99
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/revision-fields-diff/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\n/*\n * `diffWordsWithSpace` preserves the v4-style per-word output. v6+\n * stopped treating whitespace as a token in `diffWords`, which coalesces\n * adjacent word changes into a single removed/added pair.\n */\nimport { diffWordsWithSpace } from 'diff';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport RevisionDiffPanel from '../revision-diff-panel';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Safely stringifies a value for display and comparison.\n *\n * @param {*} value The value to stringify.\n * @return {string} The stringified value.\n */\nfunction stringifyValue( value ) {\n\tif ( value === null || value === undefined ) {\n\t\treturn '';\n\t}\n\tif ( typeof value === 'object' ) {\n\t\treturn JSON.stringify( value, null, 2 );\n\t}\n\treturn String( value );\n}\n\n/**\n * Determines whether a meta value should be treated as empty.\n *\n * @param {string} str The stringified value.\n * @return {boolean} Whether the value is effectively empty.\n */\nfunction isEmptyMeta( str ) {\n\treturn ! str || str === '[]' || str === '{}';\n}\n\n/**\n * Panel that shows meta field diffs between the current revision and\n * the previous revision in the document sidebar during revision mode.\n */\nexport default function RevisionFieldsDiffPanel() {\n\tconst { revision, previousRevision } = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision, getPreviousRevision } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\n\t\treturn {\n\t\t\trevision: getCurrentRevision(),\n\t\t\tpreviousRevision: getPreviousRevision(),\n\t\t};\n\t}, [] );\n\n\tconst entries = useMemo( () => {\n\t\tif ( ! revision ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst revisionMeta = revision.meta ?? {};\n\t\tconst previousMeta = previousRevision?.meta ?? {};\n\t\tconst allMetaKeys = new Set( [\n\t\t\t...Object.keys( revisionMeta ),\n\t\t\t...Object.keys( previousMeta ),\n\t\t] );\n\n\t\tconst result = {};\n\n\t\tfor ( const key of allMetaKeys ) {\n\t\t\tconst revStr = stringifyValue( revisionMeta[ key ] );\n\t\t\tconst prevStr = stringifyValue( previousMeta[ key ] );\n\n\t\t\tif ( isEmptyMeta( revStr ) && isEmptyMeta( prevStr ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tresult[ key ] = diffWordsWithSpace( prevStr, revStr );\n\t\t}\n\n\t\tif ( Object.keys( result ).length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn result;\n\t}, [ revision, previousRevision ] );\n\n\treturn (\n\t\t<RevisionDiffPanel\n\t\t\ttitle={ __( 'Meta' ) }\n\t\t\tentries={ entries }\n\t\t\tinitialOpen={ false }\n\t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AAK,YAAa,MAAO,KAAK,YAAa,OAAQ,GAAI;AACtD;AAAA,MACD;AAEA,aAAQ,GAAI,QAAI,gCAAoB,SAAS,MAAO;AAAA,IACrD;AAEA,QAAK,OAAO,KAAM,MAAO,EAAE,WAAW,GAAI;AACzC,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR,GAAG,CAAE,UAAU,gBAAiB,CAAE;AAElC,SACC;AAAA,IAAC,2BAAAC;AAAA,IAAA;AAAA,MACA,WAAQ,gBAAI,MAAO;AAAA,MACnB;AAAA,MACA,aAAc;AAAA,MACd,WAAU;AAAA;AAAA,EACX;AAEF;",
|
|
6
6
|
"names": ["editorStore", "RevisionDiffPanel"]
|
|
7
7
|
}
|
|
@@ -46,8 +46,38 @@ var import_store = require("../../store/index.cjs");
|
|
|
46
46
|
var import_post_trash = __toESM(require("../post-trash/index.cjs"));
|
|
47
47
|
var import_post_fields = __toESM(require("../post-fields/index.cjs"));
|
|
48
48
|
var import_hooks = require("../post-template/hooks.cjs");
|
|
49
|
+
var import_revisions = __toESM(require("../../dataviews/fields/revisions/index.cjs"));
|
|
49
50
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
51
|
var EMPTY_FORM = { layout: { type: "panel" }, fields: [] };
|
|
52
|
+
var ENTITIES = {
|
|
53
|
+
wp_template: {
|
|
54
|
+
root_site: {
|
|
55
|
+
kind: "root",
|
|
56
|
+
name: "site",
|
|
57
|
+
fields: ["posts_per_page", "default_comment_status"],
|
|
58
|
+
isVisible: (item) => ["home", "index"].includes(item.slug ?? "")
|
|
59
|
+
},
|
|
60
|
+
posttype_page: {
|
|
61
|
+
kind: "postType",
|
|
62
|
+
name: "page",
|
|
63
|
+
getId: (select) => select(import_core_data.store).getEditedEntityRecord("root", "site")?.page_for_posts,
|
|
64
|
+
fields: ["posts_page_title"],
|
|
65
|
+
isVisible: (item) => ["home", "index"].includes(item.slug ?? "")
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
function bindFieldToNamespace(field, namespace, isVisible = () => true) {
|
|
70
|
+
const subItem = (item) => item?.[namespace] ?? {};
|
|
71
|
+
return {
|
|
72
|
+
...field,
|
|
73
|
+
getValue: ({ item }) => field.getValue ? field.getValue({ item: subItem(item) }) : subItem(item)[field.id],
|
|
74
|
+
setValue: ({ item, value }) => ({
|
|
75
|
+
[namespace]: field.setValue({ item: subItem(item), value })
|
|
76
|
+
}),
|
|
77
|
+
render: field.render ? (props) => field.render({ ...props, item: subItem(props.item) }) : void 0,
|
|
78
|
+
isVisible: (item) => isVisible(item) && !!item[namespace]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
51
81
|
function DataFormPostSummary({ onActionPerformed }) {
|
|
52
82
|
const { postType, postId } = (0, import_data.useSelect)((select) => {
|
|
53
83
|
const { getCurrentPostType, getCurrentPostId } = select(import_store.store);
|
|
@@ -75,25 +105,76 @@ function DataFormPostSummary({ onActionPerformed }) {
|
|
|
75
105
|
[postType, postId]
|
|
76
106
|
);
|
|
77
107
|
const templatePanelMode = (0, import_hooks.usePostTemplatePanelMode)();
|
|
78
|
-
const availableTemplates = (0, import_data.useSelect)(
|
|
79
|
-
|
|
80
|
-
|
|
108
|
+
const { entityData, entityIds, availableTemplates } = (0, import_data.useSelect)(
|
|
109
|
+
(select) => {
|
|
110
|
+
const { getEditedEntityRecord, canUser, getCurrentTheme } = select(import_core_data.store);
|
|
111
|
+
const _availableTemplates = getCurrentTheme()?.is_block_theme ? null : select(import_store.store).getEditorSettings().availableTemplates ?? {};
|
|
112
|
+
const extra = {};
|
|
113
|
+
const ids = {};
|
|
114
|
+
for (const [key, entity] of Object.entries(
|
|
115
|
+
ENTITIES[postType] ?? {}
|
|
116
|
+
)) {
|
|
117
|
+
if (!canUser("read", {
|
|
118
|
+
kind: entity.kind,
|
|
119
|
+
name: entity.name
|
|
120
|
+
})) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const id = entity.getId ? entity.getId(select) : void 0;
|
|
124
|
+
if (entity.getId && !id) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
extra[key] = getEditedEntityRecord(
|
|
128
|
+
entity.kind,
|
|
129
|
+
entity.name,
|
|
130
|
+
id
|
|
131
|
+
);
|
|
132
|
+
ids[key] = id;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
entityData: extra,
|
|
136
|
+
entityIds: ids,
|
|
137
|
+
availableTemplates: _availableTemplates
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
[postType]
|
|
141
|
+
);
|
|
142
|
+
const data = (0, import_element.useMemo)(() => {
|
|
143
|
+
if (!record) {
|
|
144
|
+
return record;
|
|
81
145
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
146
|
+
const extra = { ...entityData };
|
|
147
|
+
if (availableTemplates && Object.keys(availableTemplates).length) {
|
|
148
|
+
extra.available_templates = availableTemplates;
|
|
149
|
+
}
|
|
150
|
+
if (!Object.keys(extra).length) {
|
|
86
151
|
return record;
|
|
87
152
|
}
|
|
88
|
-
return {
|
|
89
|
-
|
|
90
|
-
available_templates: availableTemplates
|
|
91
|
-
};
|
|
92
|
-
}, [record, availableTemplates]);
|
|
153
|
+
return { ...record, ...extra };
|
|
154
|
+
}, [record, entityData, availableTemplates]);
|
|
93
155
|
const { editEntityRecord } = (0, import_data.useDispatch)(import_core_data.store);
|
|
156
|
+
const fieldNamespaces = (0, import_element.useMemo)(() => {
|
|
157
|
+
const map = {};
|
|
158
|
+
for (const [namespace, entity] of Object.entries(
|
|
159
|
+
ENTITIES[postType] ?? {}
|
|
160
|
+
)) {
|
|
161
|
+
for (const id of entity.fields ?? []) {
|
|
162
|
+
map[id] = namespace;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return map;
|
|
166
|
+
}, [postType]);
|
|
94
167
|
const _fields = (0, import_post_fields.default)({ postType });
|
|
95
168
|
const fields = (0, import_element.useMemo)(
|
|
96
169
|
() => _fields?.map((field) => {
|
|
170
|
+
const namespace = fieldNamespaces[field.id];
|
|
171
|
+
if (namespace) {
|
|
172
|
+
return bindFieldToNamespace(
|
|
173
|
+
field,
|
|
174
|
+
namespace,
|
|
175
|
+
ENTITIES[postType]?.[namespace]?.isVisible
|
|
176
|
+
);
|
|
177
|
+
}
|
|
97
178
|
if (field.id === "status") {
|
|
98
179
|
return {
|
|
99
180
|
...field,
|
|
@@ -116,17 +197,41 @@ function DataFormPostSummary({ onActionPerformed }) {
|
|
|
116
197
|
return field;
|
|
117
198
|
}
|
|
118
199
|
return field;
|
|
119
|
-
}).filter(Boolean),
|
|
120
|
-
[
|
|
200
|
+
}).filter(Boolean).concat(import_revisions.default),
|
|
201
|
+
[
|
|
202
|
+
_fields,
|
|
203
|
+
templatePanelMode,
|
|
204
|
+
availableTemplates,
|
|
205
|
+
fieldNamespaces,
|
|
206
|
+
postType
|
|
207
|
+
]
|
|
121
208
|
);
|
|
122
209
|
const onChange = (edits) => {
|
|
123
|
-
|
|
124
|
-
|
|
210
|
+
const entities = ENTITIES[postType] ?? {};
|
|
211
|
+
const baseEdits = {};
|
|
212
|
+
for (const [key, value] of Object.entries(edits)) {
|
|
213
|
+
const entity = entities[key];
|
|
214
|
+
if (entity) {
|
|
215
|
+
editEntityRecord(
|
|
216
|
+
entity.kind,
|
|
217
|
+
entity.name,
|
|
218
|
+
entityIds[key],
|
|
219
|
+
value
|
|
220
|
+
);
|
|
221
|
+
} else {
|
|
222
|
+
baseEdits[key] = value;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (!Object.keys(baseEdits).length) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (baseEdits.status && baseEdits.status !== "future" && record?.status === "future" && new Date(record.date) > /* @__PURE__ */ new Date()) {
|
|
229
|
+
baseEdits.date = null;
|
|
125
230
|
}
|
|
126
|
-
if (
|
|
127
|
-
|
|
231
|
+
if (baseEdits.status && baseEdits.status === "private" && record?.password) {
|
|
232
|
+
baseEdits.password = "";
|
|
128
233
|
}
|
|
129
|
-
editEntityRecord("postType", postType, postId,
|
|
234
|
+
editEntityRecord("postType", postType, postId, baseEdits);
|
|
130
235
|
};
|
|
131
236
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_panel_section.default, { className: "editor-post-summary", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
132
237
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -140,7 +245,7 @@ function DataFormPostSummary({ onActionPerformed }) {
|
|
|
140
245
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
246
|
import_dataviews.DataForm,
|
|
142
247
|
{
|
|
143
|
-
data
|
|
248
|
+
data,
|
|
144
249
|
fields,
|
|
145
250
|
form,
|
|
146
251
|
onChange
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar/dataform-post-summary.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { DataForm } from '@wordpress/dataviews';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport PostCardPanel from '../post-card-panel';\nimport PostPanelSection from '../post-panel-section';\nimport { store as editorStore } from '../../store';\nimport PostTrash from '../post-trash';\nimport usePostFields from '../post-fields';\nimport { usePostTemplatePanelMode } from '../post-template/hooks';\n\nconst EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };\n\nexport default function DataFormPostSummary( { onActionPerformed } ) {\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\tconst { form: formConfig } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t} );\n\tconst form = formConfig ?? EMPTY_FORM;\n\tconst record = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType || ! postId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst templatePanelMode = usePostTemplatePanelMode();\n\n\tconst availableTemplates = useSelect( ( select ) => {\n\t\tif ( select( coreDataStore ).getCurrentTheme()?.is_block_theme ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\tselect( editorStore ).getEditorSettings().availableTemplates ?? {}\n\t\t);\n\t}, [] );\n\n\t// Augment record only when needed(not a block theme with available templates).\n\tconst augmentedRecord = useMemo( () => {\n\t\tif ( ! record || ! availableTemplates ) {\n\t\t\treturn record;\n\t\t}\n\t\treturn {\n\t\t\t...record,\n\t\t\tavailable_templates: availableTemplates,\n\t\t};\n\t}, [ record, availableTemplates ] );\n\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\n\tconst _fields = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields\n\t\t\t\t?.map( ( field ) => {\n\t\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif ( field.id === 'template' ) {\n\t\t\t\t\t\t// `usePostTemplatePanelMode` is reused in the Post Template panel to match\n\t\t\t\t\t\t// the existing behavior. If the panel rendered nothing we should exclude the\n\t\t\t\t\t\t// template field from the form.\n\t\t\t\t\t\tif ( ! templatePanelMode ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// In classic themes without available templates we need to make the field read-only.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttemplatePanelMode === 'classic' &&\n\t\t\t\t\t\t\tObject.keys( availableTemplates ?? {} ).length === 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\t\treadOnly: true,\n\t\t\t\t\t\t\t\trender: () => __( 'Default template' ),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn field;\n\t\t\t\t\t}\n\t\t\t\t\treturn field;\n\t\t\t\t} )\n\t\t\t\t.filter( Boolean ),\n\t\t[ _fields, templatePanelMode, availableTemplates ]\n\t);\n\n\tconst onChange = ( edits ) => {\n\t\tif (\n\t\t\tedits.status &&\n\t\t\tedits.status !== 'future' &&\n\t\t\trecord?.status === 'future' &&\n\t\t\tnew Date( record.date ) > new Date()\n\t\t) {\n\t\t\tedits.date = null;\n\t\t}\n\t\tif ( edits.status && edits.status === 'private' && record?.password ) {\n\t\t\tedits.password = '';\n\t\t}\n\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\t};\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<PostCardPanel\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t\t<DataForm\n\t\t\t\t\tdata={ augmentedRecord }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tform={ form }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t<PostTrash onActionPerformed={ onActionPerformed } />\n\t\t\t</VStack>\n\t\t</PostPanelSection>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAAuC;AACvC,uBAAuC;AACvC,uBAAyB;AACzB,wBAA+C;AAC/C,qBAAwB;AACxB,mBAA8B;AAK9B,6BAA0B;AAC1B,gCAA6B;AAC7B,mBAAqC;AACrC,wBAAsB;AACtB,yBAA0B;AAC1B,mBAAyC;
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { DataForm } from '@wordpress/dataviews';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport PostCardPanel from '../post-card-panel';\nimport PostPanelSection from '../post-panel-section';\nimport { store as editorStore } from '../../store';\nimport PostTrash from '../post-trash';\nimport usePostFields from '../post-fields';\nimport { usePostTemplatePanelMode } from '../post-template/hooks';\nimport revisionsField from '../../dataviews/fields/revisions';\n\nconst EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };\n\n// Some post types expose summary fields that edit entities other than the one\n// being edited. Keyed by the post type that needs them, the related records are\n// merged into the form data under a `${ kind }_${ name }` namespace key so that\n// a single DataForm can read and write all of them, and edits to those keys are\n// routed back to their entity.\n//\n// The fields themselves are namespace-agnostic: they read and write a plain\n// record. The `fields` list ties each one to the entity it edits, and this\n// component overrides their `getValue`/`setValue`/`render` to operate on the\n// namespaced record, plus their `isVisible` to only show where that record is\n// present (e.g. the `home`/`index` template summary).\n//\n// Currently only `wp_template` uses this: `posts_per_page` and\n// `default_comment_status` target `root/site`, and `posts_page_title` targets\n// the posts page (the `page` assigned as `page_for_posts`).\nconst ENTITIES = {\n\twp_template: {\n\t\troot_site: {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t\tfields: [ 'posts_per_page', 'default_comment_status' ],\n\t\t\tisVisible: ( item ) =>\n\t\t\t\t[ 'home', 'index' ].includes( item.slug ?? '' ),\n\t\t},\n\t\tposttype_page: {\n\t\t\tkind: 'postType',\n\t\t\tname: 'page',\n\t\t\tgetId: ( select ) =>\n\t\t\t\tselect( coreDataStore ).getEditedEntityRecord( 'root', 'site' )\n\t\t\t\t\t?.page_for_posts,\n\t\t\tfields: [ 'posts_page_title' ],\n\t\t\tisVisible: ( item ) =>\n\t\t\t\t[ 'home', 'index' ].includes( item.slug ?? '' ),\n\t\t},\n\t},\n};\n\n// Rebinds a namespace-agnostic field to the namespaced record it edits. Every\n// field callback that receives the form `item` is redirected to the\n// `item[ namespace ]` sub-record so the field operates on its own entity:\n// `getValue`/`setValue`/`render` here, and the rest indirectly because they all\n// funnel through the (remapped) `getValue` (default `render`, `getValueFormatted`\n// and `isValid` range/`custom` validation). Edits are wrapped back under the\n// namespace key. The caller-supplied `isVisible` encodes entity-specific\n// conditions (e.g. only for `home`/`index` templates); the generic guard\n// `!! item[ namespace ]` ensures the field is hidden when the sub-record\n// hasn't been fetched.\nfunction bindFieldToNamespace( field, namespace, isVisible = () => true ) {\n\tconst subItem = ( item ) => item?.[ namespace ] ?? {};\n\treturn {\n\t\t...field,\n\t\tgetValue: ( { item } ) =>\n\t\t\tfield.getValue\n\t\t\t\t? field.getValue( { item: subItem( item ) } )\n\t\t\t\t: subItem( item )[ field.id ],\n\t\tsetValue: ( { item, value } ) => ( {\n\t\t\t[ namespace ]: field.setValue( { item: subItem( item ), value } ),\n\t\t} ),\n\t\trender: field.render\n\t\t\t? ( props ) =>\n\t\t\t\t\tfield.render( { ...props, item: subItem( props.item ) } )\n\t\t\t: undefined,\n\t\tisVisible: ( item ) => isVisible( item ) && !! item[ namespace ],\n\t};\n}\n\nexport default function DataFormPostSummary( { onActionPerformed } ) {\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\tconst { form: formConfig } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t} );\n\tconst form = formConfig ?? EMPTY_FORM;\n\tconst record = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType || ! postId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst templatePanelMode = usePostTemplatePanelMode();\n\n\t// Assemble every piece of supplementary data merged into the form `data`\n\t// alongside the post record: read-only editor data that the post's own\n\t// fields consume (e.g. the `template` field's `available_templates` in\n\t// classic themes), and the records of other entities targeted by namespaced\n\t// fields (keyed by `${ kind }_${ name }`) together with the id used to\n\t// persist edits back to each one.\n\tconst { entityData, entityIds, availableTemplates } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, canUser, getCurrentTheme } =\n\t\t\t\tselect( coreDataStore );\n\n\t\t\tconst _availableTemplates = getCurrentTheme()?.is_block_theme\n\t\t\t\t? null\n\t\t\t\t: select( editorStore ).getEditorSettings()\n\t\t\t\t\t\t.availableTemplates ?? {};\n\n\t\t\tconst extra = {};\n\t\t\tconst ids = {};\n\n\t\t\t// Other entities the current post type needs merged into its form.\n\t\t\tfor ( const [ key, entity ] of Object.entries(\n\t\t\t\tENTITIES[ postType ] ?? {}\n\t\t\t) ) {\n\t\t\t\tif (\n\t\t\t\t\t! canUser( 'read', {\n\t\t\t\t\t\tkind: entity.kind,\n\t\t\t\t\t\tname: entity.name,\n\t\t\t\t\t} )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst id = entity.getId ? entity.getId( select ) : undefined;\n\t\t\t\t// Entities resolved through another record need a valid id.\n\t\t\t\tif ( entity.getId && ! id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\textra[ key ] = getEditedEntityRecord(\n\t\t\t\t\tentity.kind,\n\t\t\t\t\tentity.name,\n\t\t\t\t\tid\n\t\t\t\t);\n\t\t\t\tids[ key ] = id;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tentityData: extra,\n\t\t\t\tentityIds: ids,\n\t\t\t\tavailableTemplates: _availableTemplates,\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\t// Merge the supplementary data onto the record only when there is any.\n\tconst data = useMemo( () => {\n\t\tif ( ! record ) {\n\t\t\treturn record;\n\t\t}\n\t\tconst extra = { ...entityData };\n\t\tif ( availableTemplates && Object.keys( availableTemplates ).length ) {\n\t\t\textra.available_templates = availableTemplates;\n\t\t}\n\t\tif ( ! Object.keys( extra ).length ) {\n\t\t\treturn record;\n\t\t}\n\t\treturn { ...record, ...extra };\n\t}, [ record, entityData, availableTemplates ] );\n\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\n\t// Map of namespaced field id to the namespace key its entity is merged under.\n\tconst fieldNamespaces = useMemo( () => {\n\t\tconst map = {};\n\t\tfor ( const [ namespace, entity ] of Object.entries(\n\t\t\tENTITIES[ postType ] ?? {}\n\t\t) ) {\n\t\t\tfor ( const id of entity.fields ?? [] ) {\n\t\t\t\tmap[ id ] = namespace;\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}, [ postType ] );\n\n\tconst _fields = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields\n\t\t\t\t?.map( ( field ) => {\n\t\t\t\t\tconst namespace = fieldNamespaces[ field.id ];\n\t\t\t\t\tif ( namespace ) {\n\t\t\t\t\t\treturn bindFieldToNamespace(\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\t\tENTITIES[ postType ]?.[ namespace ]?.isVisible\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif ( field.id === 'template' ) {\n\t\t\t\t\t\t// `usePostTemplatePanelMode` is reused in the Post Template panel to match\n\t\t\t\t\t\t// the existing behavior. If the panel rendered nothing we should exclude the\n\t\t\t\t\t\t// template field from the form.\n\t\t\t\t\t\tif ( ! templatePanelMode ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// In classic themes without available templates we need to make the field read-only.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttemplatePanelMode === 'classic' &&\n\t\t\t\t\t\t\tObject.keys( availableTemplates ?? {} ).length === 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\t\treadOnly: true,\n\t\t\t\t\t\t\t\trender: () => __( 'Default template' ),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn field;\n\t\t\t\t\t}\n\t\t\t\t\treturn field;\n\t\t\t\t} )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t// Editor-only field, injected here rather than registered\n\t\t\t\t// so it never leaks into the site editor list / quick-edit fields.\n\t\t\t\t.concat( revisionsField ),\n\t\t[\n\t\t\t_fields,\n\t\t\ttemplatePanelMode,\n\t\t\tavailableTemplates,\n\t\t\tfieldNamespaces,\n\t\t\tpostType,\n\t\t]\n\t);\n\n\tconst onChange = ( edits ) => {\n\t\t// Route edits that target another entity (merged in under a namespace)\n\t\t// back to that entity; collect the rest for the post being edited.\n\t\tconst entities = ENTITIES[ postType ] ?? {};\n\t\tconst baseEdits = {};\n\t\tfor ( const [ key, value ] of Object.entries( edits ) ) {\n\t\t\tconst entity = entities[ key ];\n\t\t\tif ( entity ) {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\tentity.kind,\n\t\t\t\t\tentity.name,\n\t\t\t\t\tentityIds[ key ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tbaseEdits[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! Object.keys( baseEdits ).length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tbaseEdits.status &&\n\t\t\tbaseEdits.status !== 'future' &&\n\t\t\trecord?.status === 'future' &&\n\t\t\tnew Date( record.date ) > new Date()\n\t\t) {\n\t\t\tbaseEdits.date = null;\n\t\t}\n\t\tif (\n\t\t\tbaseEdits.status &&\n\t\t\tbaseEdits.status === 'private' &&\n\t\t\trecord?.password\n\t\t) {\n\t\t\tbaseEdits.password = '';\n\t\t}\n\n\t\teditEntityRecord( 'postType', postType, postId, baseEdits );\n\t};\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<PostCardPanel\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t\t<DataForm\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tform={ form }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t<PostTrash onActionPerformed={ onActionPerformed } />\n\t\t\t</VStack>\n\t\t</PostPanelSection>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAAuC;AACvC,uBAAuC;AACvC,uBAAyB;AACzB,wBAA+C;AAC/C,qBAAwB;AACxB,mBAA8B;AAK9B,6BAA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OAAO;AAAA,IAClB;AACA,QACC,UAAU,UACV,UAAU,WAAW,aACrB,QAAQ,UACP;AACD,gBAAU,WAAW;AAAA,IACtB;AAEA,qBAAkB,YAAY,UAAU,QAAQ,SAAU;AAAA,EAC3D;AACA,SACC,4CAAC,0BAAAC,SAAA,EAAiB,WAAU,uBAC3B,uDAAC,kBAAAC,sBAAA,EAAO,SAAU,GACjB;AAAA;AAAA,MAAC,uBAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA,4CAAC,kBAAAC,SAAA,EAAU,mBAAwC;AAAA,KACpD,GACD;AAEF;",
|
|
6
|
+
"names": ["coreDataStore", "editorStore", "usePostFields", "revisionsField", "PostPanelSection", "VStack", "PostCardPanel", "PostTrash"]
|
|
7
7
|
}
|
|
@@ -52,7 +52,6 @@ var import_header = __toESM(require("./header.cjs"));
|
|
|
52
52
|
var import_template_actions_panel = __toESM(require("../template-actions-panel/index.cjs"));
|
|
53
53
|
var import_template_content_panel = __toESM(require("../template-content-panel/index.cjs"));
|
|
54
54
|
var import_template_part_content_panel = __toESM(require("../template-part-content-panel/index.cjs"));
|
|
55
|
-
var import_post_revisions_panel = __toESM(require("../post-revisions-panel/index.cjs"));
|
|
56
55
|
var import_revision_block_diff = __toESM(require("../revision-block-diff/index.cjs"));
|
|
57
56
|
var import_use_auto_switch_editor_sidebars = __toESM(require("../provider/use-auto-switch-editor-sidebars.cjs"));
|
|
58
57
|
var import_constants = require("./constants.cjs");
|
|
@@ -61,10 +60,7 @@ var import_store = require("../../store/index.cjs");
|
|
|
61
60
|
var import_constants2 = require("../../store/constants.cjs");
|
|
62
61
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
63
62
|
var { Tabs } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
64
|
-
var SIDEBAR_ACTIVE_BY_DEFAULT =
|
|
65
|
-
web: true,
|
|
66
|
-
native: false
|
|
67
|
-
});
|
|
63
|
+
var SIDEBAR_ACTIVE_BY_DEFAULT = true;
|
|
68
64
|
var SidebarContent = ({
|
|
69
65
|
tabName,
|
|
70
66
|
keyboardShortcut,
|
|
@@ -103,16 +99,7 @@ var SidebarContent = ({
|
|
|
103
99
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_summary.default, { onActionPerformed }),
|
|
104
100
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_document_setting_panel.default.Slot, {}),
|
|
105
101
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_content_panel.default, {}),
|
|
106
|
-
window?.__experimentalDataFormInspector && [
|
|
107
|
-
"post",
|
|
108
|
-
"page",
|
|
109
|
-
"wp_template",
|
|
110
|
-
"wp_template_part",
|
|
111
|
-
"wp_block"
|
|
112
|
-
].includes(postType) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_actions_panel.default, {}),
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_revisions_panel.default, {})
|
|
115
|
-
] }),
|
|
102
|
+
window?.__experimentalDataFormInspector && ["page", "post"].includes(postType) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_actions_panel.default, {}),
|
|
116
103
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_part_content_panel.default, {}),
|
|
117
104
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_transform_panel.default, {}),
|
|
118
105
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_panel.default, {}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AACP,kBAAuC;AACvC,
|
|
6
|
-
"names": ["import_constants", "componentsPrivateApis", "editorStore", "PostRevisionSummary", "PostSummary", "PluginDocumentSettingPanel", "TemplateContentPanel", "TemplateActionsPanel", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback, useContext, useEffect, useRef } from '@wordpress/element';\nimport { isRTL, __, _x } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostRevisionSummary from './post-revision-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateActionsPanel from '../template-actions-panel';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport RevisionBlockDiffPanel from '../revision-block-diff';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = true;\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n\tpostType,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\tconst isRevisionsMode = useSelect( ( select ) => {\n\t\treturn unlock( select( editorStore ) ).isRevisionsMode();\n\t} );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\tlet tabContent;\n\tif ( isRevisionsMode ) {\n\t\ttabContent = <PostRevisionSummary />;\n\t} else {\n\t\ttabContent = (\n\t\t\t<>\n\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t<TemplateContentPanel />\n\t\t\t\t{ window?.__experimentalDataFormInspector &&\n\t\t\t\t\t[ 'page', 'post' ].includes( postType ) && (\n\t\t\t\t\t\t<TemplateActionsPanel />\n\t\t\t\t\t) }\n\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t<PostTransformPanel />\n\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t{ extraPanels }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\ttitle={\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t_x( 'Settings', 'panel button label' )\n\t\t\t}\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ tabContent }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t{ isRevisionsMode && <RevisionBlockDiffPanel /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\tconst _postType = select( editorStore ).getCurrentPostType();\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( _postType ),\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSummary={ showSummary }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t\tpostType={ postType }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AACP,kBAAuC;AACvC,qBAA2D;AAC3D,kBAA8B;AAC9B,mBAAwC;AACxC,gCAAgD;AAChD,wBAAqD;AACrD,uBAAwC;AAKxC,qCAAkC;AAClC,2CAAuC;AACvC,4BAA0B;AAC1B,0BAAwB;AACxB,mCAAgC;AAChC,mBAAgC;AAChC,kCAA+B;AAC/B,oBAA0B;AAC1B,oCAAiC;AACjC,oCAAiC;AACjC,yCAAqC;AACrC,iCAAmC;AACnC,6CAAwC;AACxC,uBAAyB;AACzB,yBAAuB;AACvB,mBAAqC;AACrC,IAAAA,oBAIO;AAmDQ;AAjDf,IAAM,EAAE,KAAK,QAAI,2BAAQ,kBAAAC,WAAsB;AAE/C,IAAM,4BAA4B;AAElC,IAAM,iBAAiB,CAAE;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,iBAAa,uBAAQ,IAAK;AAIhC,QAAM,uBAAmB,2BAAY,KAAK,OAAQ;AAClD,QAAM,sBAAkB,uBAAW,CAAE,WAAY;AAChD,eAAO,2BAAQ,OAAQ,aAAAC,KAAY,CAAE,EAAE,gBAAgB;AAAA,EACxD,CAAE;AAMF,gCAAW,MAAM;AAChB,UAAM,eAAe,MAAM;AAAA,MAC1B,WAAW,SAAS,iBAAkB,cAAe,KAAK,CAAC;AAAA,IAC5D;AACA,UAAM,qBAAqB,aAAa;AAAA;AAAA;AAAA;AAAA,MAIvC,CA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AQ,gBAAiB;AAAA,MACnD;AAAA,IACD;AAAA,IACA,CAAE,uBAAwB;AAAA,EAC3B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAgB;AAAA,MAChB,UAAW;AAAA,MACX,cAAe;AAAA,MAEf;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": ["import_constants", "componentsPrivateApis", "editorStore", "PostRevisionSummary", "PostSummary", "PluginDocumentSettingPanel", "TemplateContentPanel", "TemplateActionsPanel", "TemplatePartContentPanel", "PostTransformPanel", "PostTaxonomiesPanel", "PatternOverridesPanel", "PluginSidebar", "SidebarHeader", "RevisionBlockDiffPanel", "useAutoSwitchEditorSidebars", "keyboardShortcutsStore", "interfaceStore", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -39,21 +39,19 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
39
39
|
var import_url = require("@wordpress/url");
|
|
40
40
|
var import_store = require("../../store/index.cjs");
|
|
41
41
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
42
|
-
var
|
|
43
|
-
var import_revision_created_panel = __toESM(require("../revision-created-panel/index.cjs"));
|
|
44
|
-
var import_post_content_information = require("../post-content-information/index.cjs");
|
|
45
|
-
var import_revision_fields_diff = __toESM(require("../revision-fields-diff/index.cjs"));
|
|
42
|
+
var import_post_revisions_timeline = __toESM(require("../post-revisions-timeline/index.cjs"));
|
|
46
43
|
var import_post_panel_section = __toESM(require("../post-panel-section/index.cjs"));
|
|
47
44
|
var import_post_card_panel = __toESM(require("../post-card-panel/index.cjs"));
|
|
45
|
+
var import_revision_fields_diff = __toESM(require("../revision-fields-diff/index.cjs"));
|
|
48
46
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
47
|
function PostRevisionSummary() {
|
|
50
|
-
const { revisionId, postId
|
|
51
|
-
const { getCurrentRevisionId,
|
|
52
|
-
|
|
48
|
+
const { revisionId, postId } = (0, import_data.useSelect)((select) => {
|
|
49
|
+
const { getCurrentRevisionId, getCurrentPostId } = (0, import_lock_unlock.unlock)(
|
|
50
|
+
select(import_store.store)
|
|
51
|
+
);
|
|
53
52
|
return {
|
|
54
|
-
revisionId:
|
|
55
|
-
postId: getCurrentPostId()
|
|
56
|
-
postContent: _revisionId && getCurrentRevision()?.content?.raw
|
|
53
|
+
revisionId: getCurrentRevisionId(),
|
|
54
|
+
postId: getCurrentPostId()
|
|
57
55
|
};
|
|
58
56
|
}, []);
|
|
59
57
|
if (!revisionId) {
|
|
@@ -62,10 +60,6 @@ function PostRevisionSummary() {
|
|
|
62
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
63
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_panel_section.default, { className: "editor-post-summary", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
64
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_card_panel.default, { postId, hideActions: true }),
|
|
65
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 1, children: [
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_content_information.PostContentInformationUI, { postContent }),
|
|
67
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_revision_created_panel.default, {})
|
|
68
|
-
] }),
|
|
69
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
64
|
import_components.ExternalLink,
|
|
71
65
|
{
|
|
@@ -74,10 +68,10 @@ function PostRevisionSummary() {
|
|
|
74
68
|
}),
|
|
75
69
|
children: (0, import_i18n.__)("Open classic revisions screen")
|
|
76
70
|
}
|
|
77
|
-
)
|
|
78
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_revision_author_panel.default, {})
|
|
71
|
+
)
|
|
79
72
|
] }) }),
|
|
80
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_revision_fields_diff.default, {})
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_revision_fields_diff.default, {}),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_revisions_timeline.default, {})
|
|
81
75
|
] });
|
|
82
76
|
}
|
|
83
77
|
//# sourceMappingURL=post-revision-summary.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar/post-revision-summary.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tExternalLink,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,wBAGO;AACP,kBAAmB;AACnB,iBAA6B;AAK7B,mBAAqC;AACrC,yBAAuB;AACvB,
|
|
6
|
-
"names": ["editorStore", "PostPanelSection", "VStack", "PostCardPanel", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tExternalLink,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport PostRevisionsTimeline from '../post-revisions-timeline';\nimport PostPanelSection from '../post-panel-section';\nimport PostCardPanel from '../post-card-panel';\nimport RevisionFieldsDiffPanel from '../revision-fields-diff';\n\nexport default function PostRevisionSummary() {\n\tconst { revisionId, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentRevisionId, getCurrentPostId } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\treturn {\n\t\t\trevisionId: getCurrentRevisionId(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\tif ( ! revisionId ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<PostCardPanel postId={ postId } hideActions />\n\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\t\t\trevision: revisionId,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open classic revisions screen' ) }\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</VStack>\n\t\t\t</PostPanelSection>\n\t\t\t<RevisionFieldsDiffPanel />\n\t\t\t<PostRevisionsTimeline />\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,wBAGO;AACP,kBAAmB;AACnB,iBAA6B;AAK7B,mBAAqC;AACrC,yBAAuB;AACvB,qCAAkC;AAClC,gCAA6B;AAC7B,6BAA0B;AAC1B,kCAAoC;AAgBlC;AAda,SAAR,sBAAuC;AAC7C,QAAM,EAAE,YAAY,OAAO,QAAI,uBAAW,CAAE,WAAY;AACvD,UAAM,EAAE,sBAAsB,iBAAiB,QAAI;AAAA,MAClD,OAAQ,aAAAA,KAAY;AAAA,IACrB;AACA,WAAO;AAAA,MACN,YAAY,qBAAqB;AAAA,MACjC,QAAQ,iBAAiB;AAAA,IAC1B;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AACA,SACC,4EACC;AAAA,gDAAC,0BAAAC,SAAA,EAAiB,WAAU,uBAC3B,uDAAC,kBAAAC,sBAAA,EAAO,SAAU,GACjB;AAAA,kDAAC,uBAAAC,SAAA,EAAc,QAAkB,aAAW,MAAC;AAAA,MAC7C;AAAA,QAAC;AAAA;AAAA,UACA,UAAO,yBAAc,gBAAgB;AAAA,YACpC,UAAU;AAAA,UACX,CAAE;AAAA,UAEA,8BAAI,+BAAgC;AAAA;AAAA,MACvC;AAAA,OACD,GACD;AAAA,IACA,4CAAC,4BAAAC,SAAA,EAAwB;AAAA,IACzB,4CAAC,+BAAAC,SAAA,EAAsB;AAAA,KACxB;AAEF;",
|
|
6
|
+
"names": ["editorStore", "PostPanelSection", "VStack", "PostCardPanel", "RevisionFieldsDiffPanel", "PostRevisionsTimeline"]
|
|
7
7
|
}
|
|
@@ -65,7 +65,7 @@ function PostSummary({ onActionPerformed }) {
|
|
|
65
65
|
(select) => select(import_store.store).getCurrentPostType(),
|
|
66
66
|
[]
|
|
67
67
|
);
|
|
68
|
-
if (window?.__experimentalDataFormInspector && ["page", "post"].includes(postType)) {
|
|
68
|
+
if (window?.__experimentalDataFormInspector && ["page", "post", "wp_template"].includes(postType)) {
|
|
69
69
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dataform_post_summary.default, { onActionPerformed });
|
|
70
70
|
}
|
|
71
71
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClassicPostSummary, { onActionPerformed });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar/post-summary.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DataFormPostSummary from './dataform-post-summary';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PageAttributesPanel from '../page-attributes/panel';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostURLPanel from '../post-url/panel';\nimport BlogTitle from '../blog-title';\nimport PostsPerPage from '../posts-per-page';\nimport SiteDiscussion from '../site-discussion';\nimport { store as editorStore } from '../../store';\nimport { PrivatePostLastRevision } from '../post-last-revision';\nimport PostTrash from '../post-trash';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\tif (\n\t\twindow?.__experimentalDataFormInspector &&\n\t\t[ 'page', 'post' ].includes( postType )\n\t) {\n\t\treturn <DataFormPostSummary onActionPerformed={ onActionPerformed } />;\n\t}\n\treturn <ClassicPostSummary onActionPerformed={ onActionPerformed } />;\n}\n\nfunction ClassicPostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PrivatePostLastRevision />\n\t\t\t\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t\t<BlogTitle />\n\t\t\t\t\t\t\t\t\t\t<PostsPerPage />\n\t\t\t\t\t\t\t\t\t\t<SiteDiscussion />\n\t\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<PostTrash\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA+C;AAC/C,kBAA0B;AAK1B,mCAAgC;AAChC,qCAAiC;AACjC,mBAA4B;AAC5B,6BAA0B;AAC1B,sCAAmC;AACnC,IAAAA,gBAAgC;AAChC,IAAAA,gBAAgC;AAChC,IAAAA,gBAA4D;AAC5D,IAAAA,gBAAmC;AACnC,IAAAA,gBAA4B;AAC5B,oCAAgC;AAChC,gCAA6B;AAC7B,IAAAA,gBAA8B;AAC9B,yBAA4B;AAC5B,8BAA2B;AAC3B,IAAAA,gBAA8B;AAC9B,IAAAA,gBAAyB;AACzB,wBAAsB;AACtB,4BAAyB;AACzB,6BAA2B;AAC3B,mBAAqC;AACrC,gCAAwC;AACxC,wBAAsB;AAgBb;AAXT,IAAM,aAAa;AAEJ,SAAR,YAA8B,EAAE,kBAAkB,GAAI;AAC5D,QAAM,eAAW;AAAA,IAChB,CAAE,WAAY,OAAQ,aAAAC,KAAY,EAAE,mBAAmB;AAAA,IACvD,CAAC;AAAA,EACF;AACA,MACC,QAAQ,mCACR,CAAE,QAAQ,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DataFormPostSummary from './dataform-post-summary';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PageAttributesPanel from '../page-attributes/panel';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostURLPanel from '../post-url/panel';\nimport BlogTitle from '../blog-title';\nimport PostsPerPage from '../posts-per-page';\nimport SiteDiscussion from '../site-discussion';\nimport { store as editorStore } from '../../store';\nimport { PrivatePostLastRevision } from '../post-last-revision';\nimport PostTrash from '../post-trash';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\tif (\n\t\twindow?.__experimentalDataFormInspector &&\n\t\t[ 'page', 'post', 'wp_template' ].includes( postType )\n\t) {\n\t\treturn <DataFormPostSummary onActionPerformed={ onActionPerformed } />;\n\t}\n\treturn <ClassicPostSummary onActionPerformed={ onActionPerformed } />;\n}\n\nfunction ClassicPostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PrivatePostLastRevision />\n\t\t\t\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t\t<BlogTitle />\n\t\t\t\t\t\t\t\t\t\t<PostsPerPage />\n\t\t\t\t\t\t\t\t\t\t<SiteDiscussion />\n\t\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<PostTrash\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA+C;AAC/C,kBAA0B;AAK1B,mCAAgC;AAChC,qCAAiC;AACjC,mBAA4B;AAC5B,6BAA0B;AAC1B,sCAAmC;AACnC,IAAAA,gBAAgC;AAChC,IAAAA,gBAAgC;AAChC,IAAAA,gBAA4D;AAC5D,IAAAA,gBAAmC;AACnC,IAAAA,gBAA4B;AAC5B,oCAAgC;AAChC,gCAA6B;AAC7B,IAAAA,gBAA8B;AAC9B,yBAA4B;AAC5B,8BAA2B;AAC3B,IAAAA,gBAA8B;AAC9B,IAAAA,gBAAyB;AACzB,wBAAsB;AACtB,4BAAyB;AACzB,6BAA2B;AAC3B,mBAAqC;AACrC,gCAAwC;AACxC,wBAAsB;AAgBb;AAXT,IAAM,aAAa;AAEJ,SAAR,YAA8B,EAAE,kBAAkB,GAAI;AAC5D,QAAM,eAAW;AAAA,IAChB,CAAE,WAAY,OAAQ,aAAAC,KAAY,EAAE,mBAAmB;AAAA,IACvD,CAAC;AAAA,EACF;AACA,MACC,QAAQ,mCACR,CAAE,QAAQ,QAAQ,aAAc,EAAE,SAAU,QAAS,GACpD;AACD,WAAO,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AAA,EAAoB;AAAA,QACrB,4CAAC,qDAAwB;AAAA,QACzB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,wBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,kBAAAC,SAAA,EAAU;AAAA,QACX,4CAAC,sBAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,uBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,cAAAC,SAAA,EAAgB;AAAA,QACf;AAAA,SACH;AAAA,MACA;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,KAEF,GACD,GAEF,GACD;AAEF;",
|
|
6
6
|
"names": ["import_panel", "editorStore", "DataFormPostSummary", "PostPanelSection", "PluginPostStatusInfo", "VStack", "PostCardPanel", "PostFeaturedImagePanel", "PostExcerptPanel", "PostContentInformation", "PostLastEditedPanel", "PostStatusPanel", "PostSchedulePanel", "PostURLPanel", "PostAuthorPanel", "PostTemplatePanel", "PostDiscussionPanel", "PageAttributesPanel", "PostSyncStatus", "BlogTitle", "PostsPerPage", "SiteDiscussion", "PostFormatPanel", "PostTrash"]
|
|
7
7
|
}
|
|
@@ -104,7 +104,7 @@ function getOverviewBlockExamples(colors) {
|
|
|
104
104
|
const headingBlock = (0, import_blocks.createBlock)("core/heading", {
|
|
105
105
|
// translators: Typography example. Your local alphabet, numbers and some common special characters.
|
|
106
106
|
content: (0, import_i18n.__)(
|
|
107
|
-
`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789X{(
|
|
107
|
+
`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789X{(…)},.-<>?!*&:/A@HELFO™©`
|
|
108
108
|
),
|
|
109
109
|
level: 1
|
|
110
110
|
});
|