@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
|
@@ -18,9 +18,76 @@ import { store as editorStore } from '../../store';
|
|
|
18
18
|
import PostTrash from '../post-trash';
|
|
19
19
|
import usePostFields from '../post-fields';
|
|
20
20
|
import { usePostTemplatePanelMode } from '../post-template/hooks';
|
|
21
|
+
import revisionsField from '../../dataviews/fields/revisions';
|
|
21
22
|
|
|
22
23
|
const EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };
|
|
23
24
|
|
|
25
|
+
// Some post types expose summary fields that edit entities other than the one
|
|
26
|
+
// being edited. Keyed by the post type that needs them, the related records are
|
|
27
|
+
// merged into the form data under a `${ kind }_${ name }` namespace key so that
|
|
28
|
+
// a single DataForm can read and write all of them, and edits to those keys are
|
|
29
|
+
// routed back to their entity.
|
|
30
|
+
//
|
|
31
|
+
// The fields themselves are namespace-agnostic: they read and write a plain
|
|
32
|
+
// record. The `fields` list ties each one to the entity it edits, and this
|
|
33
|
+
// component overrides their `getValue`/`setValue`/`render` to operate on the
|
|
34
|
+
// namespaced record, plus their `isVisible` to only show where that record is
|
|
35
|
+
// present (e.g. the `home`/`index` template summary).
|
|
36
|
+
//
|
|
37
|
+
// Currently only `wp_template` uses this: `posts_per_page` and
|
|
38
|
+
// `default_comment_status` target `root/site`, and `posts_page_title` targets
|
|
39
|
+
// the posts page (the `page` assigned as `page_for_posts`).
|
|
40
|
+
const ENTITIES = {
|
|
41
|
+
wp_template: {
|
|
42
|
+
root_site: {
|
|
43
|
+
kind: 'root',
|
|
44
|
+
name: 'site',
|
|
45
|
+
fields: [ 'posts_per_page', 'default_comment_status' ],
|
|
46
|
+
isVisible: ( item ) =>
|
|
47
|
+
[ 'home', 'index' ].includes( item.slug ?? '' ),
|
|
48
|
+
},
|
|
49
|
+
posttype_page: {
|
|
50
|
+
kind: 'postType',
|
|
51
|
+
name: 'page',
|
|
52
|
+
getId: ( select ) =>
|
|
53
|
+
select( coreDataStore ).getEditedEntityRecord( 'root', 'site' )
|
|
54
|
+
?.page_for_posts,
|
|
55
|
+
fields: [ 'posts_page_title' ],
|
|
56
|
+
isVisible: ( item ) =>
|
|
57
|
+
[ 'home', 'index' ].includes( item.slug ?? '' ),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Rebinds a namespace-agnostic field to the namespaced record it edits. Every
|
|
63
|
+
// field callback that receives the form `item` is redirected to the
|
|
64
|
+
// `item[ namespace ]` sub-record so the field operates on its own entity:
|
|
65
|
+
// `getValue`/`setValue`/`render` here, and the rest indirectly because they all
|
|
66
|
+
// funnel through the (remapped) `getValue` (default `render`, `getValueFormatted`
|
|
67
|
+
// and `isValid` range/`custom` validation). Edits are wrapped back under the
|
|
68
|
+
// namespace key. The caller-supplied `isVisible` encodes entity-specific
|
|
69
|
+
// conditions (e.g. only for `home`/`index` templates); the generic guard
|
|
70
|
+
// `!! item[ namespace ]` ensures the field is hidden when the sub-record
|
|
71
|
+
// hasn't been fetched.
|
|
72
|
+
function bindFieldToNamespace( field, namespace, isVisible = () => true ) {
|
|
73
|
+
const subItem = ( item ) => item?.[ namespace ] ?? {};
|
|
74
|
+
return {
|
|
75
|
+
...field,
|
|
76
|
+
getValue: ( { item } ) =>
|
|
77
|
+
field.getValue
|
|
78
|
+
? field.getValue( { item: subItem( item ) } )
|
|
79
|
+
: subItem( item )[ field.id ],
|
|
80
|
+
setValue: ( { item, value } ) => ( {
|
|
81
|
+
[ namespace ]: field.setValue( { item: subItem( item ), value } ),
|
|
82
|
+
} ),
|
|
83
|
+
render: field.render
|
|
84
|
+
? ( props ) =>
|
|
85
|
+
field.render( { ...props, item: subItem( props.item ) } )
|
|
86
|
+
: undefined,
|
|
87
|
+
isVisible: ( item ) => isVisible( item ) && !! item[ namespace ],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
24
91
|
export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
25
92
|
const { postType, postId } = useSelect( ( select ) => {
|
|
26
93
|
const { getCurrentPostType, getCurrentPostId } = select( editorStore );
|
|
@@ -50,33 +117,102 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
50
117
|
|
|
51
118
|
const templatePanelMode = usePostTemplatePanelMode();
|
|
52
119
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
120
|
+
// Assemble every piece of supplementary data merged into the form `data`
|
|
121
|
+
// alongside the post record: read-only editor data that the post's own
|
|
122
|
+
// fields consume (e.g. the `template` field's `available_templates` in
|
|
123
|
+
// classic themes), and the records of other entities targeted by namespaced
|
|
124
|
+
// fields (keyed by `${ kind }_${ name }`) together with the id used to
|
|
125
|
+
// persist edits back to each one.
|
|
126
|
+
const { entityData, entityIds, availableTemplates } = useSelect(
|
|
127
|
+
( select ) => {
|
|
128
|
+
const { getEditedEntityRecord, canUser, getCurrentTheme } =
|
|
129
|
+
select( coreDataStore );
|
|
130
|
+
|
|
131
|
+
const _availableTemplates = getCurrentTheme()?.is_block_theme
|
|
132
|
+
? null
|
|
133
|
+
: select( editorStore ).getEditorSettings()
|
|
134
|
+
.availableTemplates ?? {};
|
|
135
|
+
|
|
136
|
+
const extra = {};
|
|
137
|
+
const ids = {};
|
|
138
|
+
|
|
139
|
+
// Other entities the current post type needs merged into its form.
|
|
140
|
+
for ( const [ key, entity ] of Object.entries(
|
|
141
|
+
ENTITIES[ postType ] ?? {}
|
|
142
|
+
) ) {
|
|
143
|
+
if (
|
|
144
|
+
! canUser( 'read', {
|
|
145
|
+
kind: entity.kind,
|
|
146
|
+
name: entity.name,
|
|
147
|
+
} )
|
|
148
|
+
) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const id = entity.getId ? entity.getId( select ) : undefined;
|
|
152
|
+
// Entities resolved through another record need a valid id.
|
|
153
|
+
if ( entity.getId && ! id ) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
extra[ key ] = getEditedEntityRecord(
|
|
157
|
+
entity.kind,
|
|
158
|
+
entity.name,
|
|
159
|
+
id
|
|
160
|
+
);
|
|
161
|
+
ids[ key ] = id;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
entityData: extra,
|
|
166
|
+
entityIds: ids,
|
|
167
|
+
availableTemplates: _availableTemplates,
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
[ postType ]
|
|
171
|
+
);
|
|
61
172
|
|
|
62
|
-
//
|
|
63
|
-
const
|
|
64
|
-
if ( ! record
|
|
173
|
+
// Merge the supplementary data onto the record only when there is any.
|
|
174
|
+
const data = useMemo( () => {
|
|
175
|
+
if ( ! record ) {
|
|
65
176
|
return record;
|
|
66
177
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
available_templates
|
|
70
|
-
}
|
|
71
|
-
|
|
178
|
+
const extra = { ...entityData };
|
|
179
|
+
if ( availableTemplates && Object.keys( availableTemplates ).length ) {
|
|
180
|
+
extra.available_templates = availableTemplates;
|
|
181
|
+
}
|
|
182
|
+
if ( ! Object.keys( extra ).length ) {
|
|
183
|
+
return record;
|
|
184
|
+
}
|
|
185
|
+
return { ...record, ...extra };
|
|
186
|
+
}, [ record, entityData, availableTemplates ] );
|
|
72
187
|
|
|
73
188
|
const { editEntityRecord } = useDispatch( coreDataStore );
|
|
74
189
|
|
|
190
|
+
// Map of namespaced field id to the namespace key its entity is merged under.
|
|
191
|
+
const fieldNamespaces = useMemo( () => {
|
|
192
|
+
const map = {};
|
|
193
|
+
for ( const [ namespace, entity ] of Object.entries(
|
|
194
|
+
ENTITIES[ postType ] ?? {}
|
|
195
|
+
) ) {
|
|
196
|
+
for ( const id of entity.fields ?? [] ) {
|
|
197
|
+
map[ id ] = namespace;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return map;
|
|
201
|
+
}, [ postType ] );
|
|
202
|
+
|
|
75
203
|
const _fields = usePostFields( { postType } );
|
|
76
204
|
const fields = useMemo(
|
|
77
205
|
() =>
|
|
78
206
|
_fields
|
|
79
207
|
?.map( ( field ) => {
|
|
208
|
+
const namespace = fieldNamespaces[ field.id ];
|
|
209
|
+
if ( namespace ) {
|
|
210
|
+
return bindFieldToNamespace(
|
|
211
|
+
field,
|
|
212
|
+
namespace,
|
|
213
|
+
ENTITIES[ postType ]?.[ namespace ]?.isVisible
|
|
214
|
+
);
|
|
215
|
+
}
|
|
80
216
|
if ( field.id === 'status' ) {
|
|
81
217
|
return {
|
|
82
218
|
...field,
|
|
@@ -107,24 +243,59 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
107
243
|
}
|
|
108
244
|
return field;
|
|
109
245
|
} )
|
|
110
|
-
.filter( Boolean )
|
|
111
|
-
|
|
246
|
+
.filter( Boolean )
|
|
247
|
+
// Editor-only field, injected here rather than registered
|
|
248
|
+
// so it never leaks into the site editor list / quick-edit fields.
|
|
249
|
+
.concat( revisionsField ),
|
|
250
|
+
[
|
|
251
|
+
_fields,
|
|
252
|
+
templatePanelMode,
|
|
253
|
+
availableTemplates,
|
|
254
|
+
fieldNamespaces,
|
|
255
|
+
postType,
|
|
256
|
+
]
|
|
112
257
|
);
|
|
113
258
|
|
|
114
259
|
const onChange = ( edits ) => {
|
|
260
|
+
// Route edits that target another entity (merged in under a namespace)
|
|
261
|
+
// back to that entity; collect the rest for the post being edited.
|
|
262
|
+
const entities = ENTITIES[ postType ] ?? {};
|
|
263
|
+
const baseEdits = {};
|
|
264
|
+
for ( const [ key, value ] of Object.entries( edits ) ) {
|
|
265
|
+
const entity = entities[ key ];
|
|
266
|
+
if ( entity ) {
|
|
267
|
+
editEntityRecord(
|
|
268
|
+
entity.kind,
|
|
269
|
+
entity.name,
|
|
270
|
+
entityIds[ key ],
|
|
271
|
+
value
|
|
272
|
+
);
|
|
273
|
+
} else {
|
|
274
|
+
baseEdits[ key ] = value;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if ( ! Object.keys( baseEdits ).length ) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
115
282
|
if (
|
|
116
|
-
|
|
117
|
-
|
|
283
|
+
baseEdits.status &&
|
|
284
|
+
baseEdits.status !== 'future' &&
|
|
118
285
|
record?.status === 'future' &&
|
|
119
286
|
new Date( record.date ) > new Date()
|
|
120
287
|
) {
|
|
121
|
-
|
|
288
|
+
baseEdits.date = null;
|
|
122
289
|
}
|
|
123
|
-
if (
|
|
124
|
-
|
|
290
|
+
if (
|
|
291
|
+
baseEdits.status &&
|
|
292
|
+
baseEdits.status === 'private' &&
|
|
293
|
+
record?.password
|
|
294
|
+
) {
|
|
295
|
+
baseEdits.password = '';
|
|
125
296
|
}
|
|
126
297
|
|
|
127
|
-
editEntityRecord( 'postType', postType, postId,
|
|
298
|
+
editEntityRecord( 'postType', postType, postId, baseEdits );
|
|
128
299
|
};
|
|
129
300
|
return (
|
|
130
301
|
<PostPanelSection className="editor-post-summary">
|
|
@@ -135,7 +306,7 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
135
306
|
onActionPerformed={ onActionPerformed }
|
|
136
307
|
/>
|
|
137
308
|
<DataForm
|
|
138
|
-
data={
|
|
309
|
+
data={ data }
|
|
139
310
|
fields={ fields }
|
|
140
311
|
form={ form }
|
|
141
312
|
onChange={ onChange }
|
|
@@ -6,13 +6,7 @@ import {
|
|
|
6
6
|
store as blockEditorStore,
|
|
7
7
|
} from '@wordpress/block-editor';
|
|
8
8
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
-
import {
|
|
10
|
-
Platform,
|
|
11
|
-
useCallback,
|
|
12
|
-
useContext,
|
|
13
|
-
useEffect,
|
|
14
|
-
useRef,
|
|
15
|
-
} from '@wordpress/element';
|
|
9
|
+
import { useCallback, useContext, useEffect, useRef } from '@wordpress/element';
|
|
16
10
|
import { isRTL, __, _x } from '@wordpress/i18n';
|
|
17
11
|
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
18
12
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
@@ -33,7 +27,6 @@ import SidebarHeader from './header';
|
|
|
33
27
|
import TemplateActionsPanel from '../template-actions-panel';
|
|
34
28
|
import TemplateContentPanel from '../template-content-panel';
|
|
35
29
|
import TemplatePartContentPanel from '../template-part-content-panel';
|
|
36
|
-
import PostRevisionsPanel from '../post-revisions-panel';
|
|
37
30
|
import RevisionBlockDiffPanel from '../revision-block-diff';
|
|
38
31
|
import useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';
|
|
39
32
|
import { sidebars } from './constants';
|
|
@@ -47,10 +40,7 @@ import {
|
|
|
47
40
|
|
|
48
41
|
const { Tabs } = unlock( componentsPrivateApis );
|
|
49
42
|
|
|
50
|
-
const SIDEBAR_ACTIVE_BY_DEFAULT =
|
|
51
|
-
web: true,
|
|
52
|
-
native: false,
|
|
53
|
-
} );
|
|
43
|
+
const SIDEBAR_ACTIVE_BY_DEFAULT = true;
|
|
54
44
|
|
|
55
45
|
const SidebarContent = ( {
|
|
56
46
|
tabName,
|
|
@@ -105,17 +95,8 @@ const SidebarContent = ( {
|
|
|
105
95
|
<PluginDocumentSettingPanel.Slot />
|
|
106
96
|
<TemplateContentPanel />
|
|
107
97
|
{ window?.__experimentalDataFormInspector &&
|
|
108
|
-
[
|
|
109
|
-
|
|
110
|
-
'page',
|
|
111
|
-
'wp_template',
|
|
112
|
-
'wp_template_part',
|
|
113
|
-
'wp_block',
|
|
114
|
-
].includes( postType ) && (
|
|
115
|
-
<>
|
|
116
|
-
<TemplateActionsPanel />
|
|
117
|
-
<PostRevisionsPanel />
|
|
118
|
-
</>
|
|
98
|
+
[ 'page', 'post' ].includes( postType ) && (
|
|
99
|
+
<TemplateActionsPanel />
|
|
119
100
|
) }
|
|
120
101
|
<TemplatePartContentPanel />
|
|
121
102
|
<PostTransformPanel />
|
|
@@ -14,22 +14,19 @@ import { addQueryArgs } from '@wordpress/url';
|
|
|
14
14
|
*/
|
|
15
15
|
import { store as editorStore } from '../../store';
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
|
-
import
|
|
18
|
-
import RevisionCreatedPanel from '../revision-created-panel';
|
|
19
|
-
import { PostContentInformationUI } from '../post-content-information';
|
|
20
|
-
import RevisionFieldsDiffPanel from '../revision-fields-diff';
|
|
17
|
+
import PostRevisionsTimeline from '../post-revisions-timeline';
|
|
21
18
|
import PostPanelSection from '../post-panel-section';
|
|
22
19
|
import PostCardPanel from '../post-card-panel';
|
|
20
|
+
import RevisionFieldsDiffPanel from '../revision-fields-diff';
|
|
23
21
|
|
|
24
22
|
export default function PostRevisionSummary() {
|
|
25
|
-
const { revisionId, postId
|
|
26
|
-
const { getCurrentRevisionId,
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const { revisionId, postId } = useSelect( ( select ) => {
|
|
24
|
+
const { getCurrentRevisionId, getCurrentPostId } = unlock(
|
|
25
|
+
select( editorStore )
|
|
26
|
+
);
|
|
29
27
|
return {
|
|
30
|
-
revisionId:
|
|
28
|
+
revisionId: getCurrentRevisionId(),
|
|
31
29
|
postId: getCurrentPostId(),
|
|
32
|
-
postContent: _revisionId && getCurrentRevision()?.content?.raw,
|
|
33
30
|
};
|
|
34
31
|
}, [] );
|
|
35
32
|
if ( ! revisionId ) {
|
|
@@ -40,10 +37,6 @@ export default function PostRevisionSummary() {
|
|
|
40
37
|
<PostPanelSection className="editor-post-summary">
|
|
41
38
|
<VStack spacing={ 4 }>
|
|
42
39
|
<PostCardPanel postId={ postId } hideActions />
|
|
43
|
-
<VStack spacing={ 1 }>
|
|
44
|
-
<PostContentInformationUI postContent={ postContent } />
|
|
45
|
-
<RevisionCreatedPanel />
|
|
46
|
-
</VStack>
|
|
47
40
|
<ExternalLink
|
|
48
41
|
href={ addQueryArgs( 'revision.php', {
|
|
49
42
|
revision: revisionId,
|
|
@@ -51,10 +44,10 @@ export default function PostRevisionSummary() {
|
|
|
51
44
|
>
|
|
52
45
|
{ __( 'Open classic revisions screen' ) }
|
|
53
46
|
</ExternalLink>
|
|
54
|
-
<RevisionAuthorPanel />
|
|
55
47
|
</VStack>
|
|
56
48
|
</PostPanelSection>
|
|
57
49
|
<RevisionFieldsDiffPanel />
|
|
50
|
+
<PostRevisionsTimeline />
|
|
58
51
|
</>
|
|
59
52
|
);
|
|
60
53
|
}
|
|
@@ -43,7 +43,7 @@ export default function PostSummary( { onActionPerformed } ) {
|
|
|
43
43
|
);
|
|
44
44
|
if (
|
|
45
45
|
window?.__experimentalDataFormInspector &&
|
|
46
|
-
[ 'page', 'post' ].includes( postType )
|
|
46
|
+
[ 'page', 'post', 'wp_template' ].includes( postType )
|
|
47
47
|
) {
|
|
48
48
|
return <DataFormPostSummary onActionPerformed={ onActionPerformed } />;
|
|
49
49
|
}
|
|
@@ -500,7 +500,7 @@ export const StyleBookPreview = ( {
|
|
|
500
500
|
return { examples: examplesForSinglePageUse };
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
if ( blockVariation ) {
|
|
503
|
+
if ( blockVariation && filteredExamples?.examples?.length ) {
|
|
504
504
|
return {
|
|
505
505
|
examples: applyBlockVariationsToExamples(
|
|
506
506
|
filteredExamples.examples,
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
import { useState } from '@wordpress/element';
|
|
18
18
|
import { __, sprintf } from '@wordpress/i18n';
|
|
19
19
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
20
|
+
import { ENTER, SPACE } from '@wordpress/keycodes';
|
|
20
21
|
import { store as noticesStore } from '@wordpress/notices';
|
|
21
22
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
22
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
23
23
|
import { Tooltip } from '@wordpress/ui';
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -127,7 +127,15 @@ export default function TemplateActionsPanelContent() {
|
|
|
127
127
|
tabIndex={ 0 }
|
|
128
128
|
aria-label={ tooltipText }
|
|
129
129
|
onClick={ () => setIsSwapModalOpen( true ) }
|
|
130
|
-
|
|
130
|
+
onKeyDown={ ( event ) => {
|
|
131
|
+
if (
|
|
132
|
+
event.keyCode === ENTER ||
|
|
133
|
+
event.keyCode === SPACE
|
|
134
|
+
) {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
setIsSwapModalOpen( true );
|
|
137
|
+
}
|
|
138
|
+
} }
|
|
131
139
|
>
|
|
132
140
|
{ previewContent }
|
|
133
141
|
</div>
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
9
|
-
import { store as editorStore } from '../../store';
|
|
10
4
|
import { usePostTemplatePanelMode } from '../post-template/hooks';
|
|
11
5
|
import BlockThemeContent from './block-theme-content';
|
|
12
6
|
import ClassicThemeContent from './classic-theme-content';
|
|
13
7
|
|
|
14
8
|
export default function TemplateActionsPanel() {
|
|
15
|
-
const postType = useSelect(
|
|
16
|
-
( select ) => select( editorStore ).getCurrentPostType(),
|
|
17
|
-
[]
|
|
18
|
-
);
|
|
19
9
|
const mode = usePostTemplatePanelMode();
|
|
20
|
-
// This check is because the experiment is gated for these post
|
|
21
|
-
// types for now. Later we should use `postType.viewable`.
|
|
22
|
-
if ( ! [ 'page', 'post' ].includes( postType ) ) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
10
|
if ( mode === 'classic' ) {
|
|
26
11
|
return <ClassicThemeContent />;
|
|
27
12
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# UploadProgressSnackbar
|
|
2
|
+
|
|
3
|
+
`UploadProgressSnackbar` manages a snackbar notice that shows media upload progress. It creates and updates a notice via the notices store, so the snackbar positions and stacks with every other snackbar in the editor.
|
|
4
|
+
|
|
5
|
+
The component reads from two sources so it works for both upload paths:
|
|
6
|
+
|
|
7
|
+
- **`@wordpress/upload-media`** — the client-side media processing (CSM) path. Only counts original user-uploaded files, ignoring generated subsizes and thumbnails (items with a `parentId`).
|
|
8
|
+
- **Editor-local tracker** — populated by the editor's `mediaUpload` wrapper for the traditional (non-CSM) upload path (e.g. Safari, or when a filter disables CSM).
|
|
9
|
+
|
|
10
|
+
While uploads are in progress the snackbar shows a spinner to the left of the text. When the last upload finishes, the spinner is replaced with a green checkmark for a brief moment before the snackbar dismisses.
|
|
11
|
+
|
|
12
|
+
The component renders nothing itself — it is a controller that manages a notice.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```jsx
|
|
17
|
+
import { UploadProgressSnackbar } from '@wordpress/editor';
|
|
18
|
+
|
|
19
|
+
// Mount anywhere in the editor — it doesn't render DOM, just manages a notice.
|
|
20
|
+
<UploadProgressSnackbar />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Accessibility
|
|
24
|
+
|
|
25
|
+
- The component calls `wp.a11y.speak()` once when uploads start and once when they complete, avoiding per-tick chatter.
|
|
26
|
+
- The snackbar is created with `speak: false` to prevent the notices store from re-announcing on every text update.
|