@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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/upload-progress-snackbar/index.js
|
|
21
|
+
var upload_progress_snackbar_exports = {};
|
|
22
|
+
__export(upload_progress_snackbar_exports, {
|
|
23
|
+
UPLOAD_DONE: () => UPLOAD_DONE,
|
|
24
|
+
UPLOAD_SPINNER: () => UPLOAD_SPINNER,
|
|
25
|
+
default: () => UploadProgressSnackbar
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(upload_progress_snackbar_exports);
|
|
28
|
+
var import_data = require("@wordpress/data");
|
|
29
|
+
var import_element = require("@wordpress/element");
|
|
30
|
+
var import_i18n = require("@wordpress/i18n");
|
|
31
|
+
var import_a11y = require("@wordpress/a11y");
|
|
32
|
+
var import_upload_media = require("@wordpress/upload-media");
|
|
33
|
+
var import_notices = require("@wordpress/notices");
|
|
34
|
+
var import_components = require("@wordpress/components");
|
|
35
|
+
var import_icons = require("@wordpress/icons");
|
|
36
|
+
var import_tracker = require("./tracker.cjs");
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var NOTICE_ID = "upload-progress";
|
|
39
|
+
var COMPLETION_DISPLAY_MS = 3e3;
|
|
40
|
+
var MAX_FILENAME_LENGTH = 40;
|
|
41
|
+
function truncateFilename(filename) {
|
|
42
|
+
if (filename.length <= MAX_FILENAME_LENGTH) {
|
|
43
|
+
return filename;
|
|
44
|
+
}
|
|
45
|
+
const ellipsis = "…";
|
|
46
|
+
const visible = MAX_FILENAME_LENGTH - ellipsis.length;
|
|
47
|
+
const front = Math.ceil(visible / 2);
|
|
48
|
+
const back = Math.floor(visible / 2);
|
|
49
|
+
return filename.slice(0, front) + ellipsis + filename.slice(filename.length - back);
|
|
50
|
+
}
|
|
51
|
+
var UPLOAD_SPINNER = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
className: "editor-upload-progress-snackbar__spinner",
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {})
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
var UPLOAD_DONE = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "editor-upload-progress-snackbar__check", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Icon, { icon: import_icons.check }) });
|
|
60
|
+
function UploadProgressSnackbar() {
|
|
61
|
+
const items = (0, import_data.useSelect)(
|
|
62
|
+
(select) => select(import_upload_media.store).getItems(),
|
|
63
|
+
[]
|
|
64
|
+
);
|
|
65
|
+
const tracker = (0, import_tracker.useTracker)();
|
|
66
|
+
const csmOriginals = (0, import_element.useMemo)(
|
|
67
|
+
() => items.filter((item) => !item.parentId),
|
|
68
|
+
[items]
|
|
69
|
+
);
|
|
70
|
+
const csmRemaining = csmOriginals.length;
|
|
71
|
+
const trackedRemaining = tracker ? tracker.total - tracker.completed : 0;
|
|
72
|
+
const remaining = csmRemaining + trackedRemaining;
|
|
73
|
+
const [peak, setPeak] = (0, import_element.useState)(0);
|
|
74
|
+
const sessionTotal = csmRemaining + (tracker ? tracker.total : 0);
|
|
75
|
+
if (sessionTotal > peak) {
|
|
76
|
+
setPeak(sessionTotal);
|
|
77
|
+
}
|
|
78
|
+
const { createNotice, removeNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
79
|
+
const dismissedRef = (0, import_element.useRef)(false);
|
|
80
|
+
const wasUploadingRef = (0, import_element.useRef)(false);
|
|
81
|
+
const completionTimeoutRef = (0, import_element.useRef)(null);
|
|
82
|
+
(0, import_element.useEffect)(() => {
|
|
83
|
+
return () => {
|
|
84
|
+
if (completionTimeoutRef.current) {
|
|
85
|
+
clearTimeout(completionTimeoutRef.current);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
(0, import_element.useEffect)(() => {
|
|
90
|
+
const isUploading = remaining > 0;
|
|
91
|
+
if (isUploading && !wasUploadingRef.current) {
|
|
92
|
+
dismissedRef.current = false;
|
|
93
|
+
(0, import_a11y.speak)((0, import_i18n.__)("Media upload started"), "polite");
|
|
94
|
+
if (completionTimeoutRef.current) {
|
|
95
|
+
clearTimeout(completionTimeoutRef.current);
|
|
96
|
+
completionTimeoutRef.current = null;
|
|
97
|
+
setPeak(0);
|
|
98
|
+
}
|
|
99
|
+
} else if (!isUploading && wasUploadingRef.current) {
|
|
100
|
+
(0, import_a11y.speak)((0, import_i18n.__)("Media upload complete"), "polite");
|
|
101
|
+
if (!dismissedRef.current) {
|
|
102
|
+
createNotice("info", (0, import_i18n.__)("Upload complete"), {
|
|
103
|
+
id: NOTICE_ID,
|
|
104
|
+
type: "snackbar",
|
|
105
|
+
isDismissible: false,
|
|
106
|
+
explicitDismiss: false,
|
|
107
|
+
speak: false,
|
|
108
|
+
icon: UPLOAD_DONE,
|
|
109
|
+
onDismiss: () => {
|
|
110
|
+
dismissedRef.current = true;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
completionTimeoutRef.current = setTimeout(() => {
|
|
114
|
+
removeNotice(NOTICE_ID);
|
|
115
|
+
completionTimeoutRef.current = null;
|
|
116
|
+
setPeak(0);
|
|
117
|
+
}, COMPLETION_DISPLAY_MS);
|
|
118
|
+
} else {
|
|
119
|
+
setPeak(0);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
wasUploadingRef.current = isUploading;
|
|
123
|
+
if (!isUploading || dismissedRef.current) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const total = peak;
|
|
127
|
+
const current = total - remaining + 1;
|
|
128
|
+
const filename = truncateFilename(
|
|
129
|
+
csmOriginals[0]?.sourceFile?.name || tracker?.pending[0] || (0, import_i18n.__)("Uploading")
|
|
130
|
+
);
|
|
131
|
+
const content = total === 1 ? (0, import_i18n.sprintf)(
|
|
132
|
+
/* translators: %s: filename. */
|
|
133
|
+
(0, import_i18n.__)("Uploading — %s"),
|
|
134
|
+
filename
|
|
135
|
+
) : (0, import_i18n.sprintf)(
|
|
136
|
+
/* translators: 1: current upload number, 2: total uploads, 3: filename. */
|
|
137
|
+
(0, import_i18n.__)("Uploading %1$d of %2$d — %3$s"),
|
|
138
|
+
current,
|
|
139
|
+
total,
|
|
140
|
+
filename
|
|
141
|
+
);
|
|
142
|
+
createNotice("info", content, {
|
|
143
|
+
id: NOTICE_ID,
|
|
144
|
+
type: "snackbar",
|
|
145
|
+
isDismissible: false,
|
|
146
|
+
explicitDismiss: true,
|
|
147
|
+
speak: false,
|
|
148
|
+
icon: UPLOAD_SPINNER,
|
|
149
|
+
onDismiss: () => {
|
|
150
|
+
dismissedRef.current = true;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}, [remaining, peak, csmOriginals, tracker, createNotice, removeNotice]);
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
157
|
+
0 && (module.exports = {
|
|
158
|
+
UPLOAD_DONE,
|
|
159
|
+
UPLOAD_SPINNER
|
|
160
|
+
});
|
|
161
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/upload-progress-snackbar/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useMemo, useRef, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { store as uploadStore } from '@wordpress/upload-media';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Icon as WCIcon, Spinner } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useTracker } from './tracker';\n\nconst NOTICE_ID = 'upload-progress';\n\n// How long the completion checkmark is shown before the snackbar dismisses.\nconst COMPLETION_DISPLAY_MS = 3000;\n\n// Longest filename shown before it is middle-truncated. Long names (e.g. the\n// UUID-style names some sources produce) would otherwise stretch the snackbar.\nconst MAX_FILENAME_LENGTH = 40;\n\n/**\n * Middle-truncates a filename that exceeds `MAX_FILENAME_LENGTH`, keeping the\n * start and the end (so the file extension stays visible).\n *\n * @param {string} filename The filename to truncate.\n * @return {string} The original or middle-truncated filename.\n */\nfunction truncateFilename( filename ) {\n\tif ( filename.length <= MAX_FILENAME_LENGTH ) {\n\t\treturn filename;\n\t}\n\tconst ellipsis = '…';\n\tconst visible = MAX_FILENAME_LENGTH - ellipsis.length;\n\tconst front = Math.ceil( visible / 2 );\n\tconst back = Math.floor( visible / 2 );\n\treturn (\n\t\tfilename.slice( 0, front ) +\n\t\tellipsis +\n\t\tfilename.slice( filename.length - back )\n\t);\n}\n\n// Exported so the Storybook story can render the exact icon markup the notice\n// uses, keeping the visual review faithful to what ships.\nexport const UPLOAD_SPINNER = (\n\t<span\n\t\tclassName=\"editor-upload-progress-snackbar__spinner\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<Spinner />\n\t</span>\n);\n\nexport const UPLOAD_DONE = (\n\t<span className=\"editor-upload-progress-snackbar__check\" aria-hidden=\"true\">\n\t\t<WCIcon icon={ check } />\n\t</span>\n);\n\n/**\n * Manages a snackbar notice that shows media upload progress while uploads are\n * in progress. It creates/updates a notice via the notices store so that it\n * positions and stacks with every other snackbar in the editor.\n *\n * Reads from two sources to cover both upload paths:\n * - `@wordpress/upload-media` store (client-side media processing path).\n * - An editor-local tracker populated by the traditional `mediaUpload`\n * wrapper (non-CSM path — e.g. Safari, or when a filter disables CSM).\n *\n * Only counts original user-uploaded files (items without a `parentId`),\n * ignoring generated subsizes/thumbnails.\n *\n * @return {null} This component renders nothing — it only manages a notice.\n */\nexport default function UploadProgressSnackbar() {\n\tconst items = useSelect(\n\t\t( select ) => select( uploadStore ).getItems(),\n\t\t[]\n\t);\n\tconst tracker = useTracker();\n\n\t// CSM path: originals in the upload-media queue (subsizes excluded). Memoized\n\t// so its reference is stable across renders where `items` is unchanged, since\n\t// it's a dependency of the effect below.\n\tconst csmOriginals = useMemo(\n\t\t() => items.filter( ( item ) => ! item.parentId ),\n\t\t[ items ]\n\t);\n\tconst csmRemaining = csmOriginals.length;\n\n\t// Non-CSM path: files tracked by the editor's mediaUpload wrapper.\n\tconst trackedRemaining = tracker ? tracker.total - tracker.completed : 0;\n\n\tconst remaining = csmRemaining + trackedRemaining;\n\n\t// Track peak total across sources during a session. The CSM queue removes\n\t// items on completion, and the tracker tops out at its recorded total, so\n\t// `total` has to be tracked as the high-water mark.\n\tconst [ peak, setPeak ] = useState( 0 );\n\tconst sessionTotal = csmRemaining + ( tracker ? tracker.total : 0 );\n\tif ( sessionTotal > peak ) {\n\t\tsetPeak( sessionTotal );\n\t}\n\n\tconst { createNotice, removeNotice } = useDispatch( noticesStore );\n\n\t// Track whether the user has dismissed the notice. If so, don't re-create\n\t// it until the current batch finishes and a new one starts.\n\tconst dismissedRef = useRef( false );\n\tconst wasUploadingRef = useRef( false );\n\n\t// Timeout that removes the completion-state (checkmark) notice after a\n\t// brief display. Held so a new upload can cancel it.\n\tconst completionTimeoutRef = useRef( null );\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( completionTimeoutRef.current ) {\n\t\t\t\tclearTimeout( completionTimeoutRef.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tconst isUploading = remaining > 0;\n\n\t\tif ( isUploading && ! wasUploadingRef.current ) {\n\t\t\tdismissedRef.current = false;\n\t\t\tspeak( __( 'Media upload started' ), 'polite' );\n\t\t\t// A new batch started during the completion display: cancel the\n\t\t\t// pending dismissal so the snackbar transitions straight back\n\t\t\t// into the uploading state, and reset the peak so the new batch\n\t\t\t// counts from `1 of N` rather than resuming the previous total.\n\t\t\tif ( completionTimeoutRef.current ) {\n\t\t\t\tclearTimeout( completionTimeoutRef.current );\n\t\t\t\tcompletionTimeoutRef.current = null;\n\t\t\t\tsetPeak( 0 );\n\t\t\t}\n\t\t} else if ( ! isUploading && wasUploadingRef.current ) {\n\t\t\tspeak( __( 'Media upload complete' ), 'polite' );\n\n\t\t\tif ( ! dismissedRef.current ) {\n\t\t\t\tcreateNotice( 'info', __( 'Upload complete' ), {\n\t\t\t\t\tid: NOTICE_ID,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: false,\n\t\t\t\t\texplicitDismiss: false,\n\t\t\t\t\tspeak: false,\n\t\t\t\t\ticon: UPLOAD_DONE,\n\t\t\t\t\tonDismiss: () => {\n\t\t\t\t\t\tdismissedRef.current = true;\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tcompletionTimeoutRef.current = setTimeout( () => {\n\t\t\t\t\tremoveNotice( NOTICE_ID );\n\t\t\t\t\tcompletionTimeoutRef.current = null;\n\t\t\t\t\tsetPeak( 0 );\n\t\t\t\t}, COMPLETION_DISPLAY_MS );\n\t\t\t} else {\n\t\t\t\tsetPeak( 0 );\n\t\t\t}\n\t\t}\n\n\t\twasUploadingRef.current = isUploading;\n\n\t\tif ( ! isUploading || dismissedRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst total = peak;\n\t\tconst current = total - remaining + 1;\n\n\t\t// Prefer the CSM queue's first original filename, then fall back to\n\t\t// the tracker's first pending filename.\n\t\tconst filename = truncateFilename(\n\t\t\tcsmOriginals[ 0 ]?.sourceFile?.name ||\n\t\t\t\ttracker?.pending[ 0 ] ||\n\t\t\t\t__( 'Uploading' )\n\t\t);\n\n\t\tconst content =\n\t\t\ttotal === 1\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: filename. */\n\t\t\t\t\t\t__( 'Uploading — %s' ),\n\t\t\t\t\t\tfilename\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: 1: current upload number, 2: total uploads, 3: filename. */\n\t\t\t\t\t\t__( 'Uploading %1$d of %2$d — %3$s' ),\n\t\t\t\t\t\tcurrent,\n\t\t\t\t\t\ttotal,\n\t\t\t\t\t\tfilename\n\t\t\t\t );\n\n\t\tcreateNotice( 'info', content, {\n\t\t\tid: NOTICE_ID,\n\t\t\ttype: 'snackbar',\n\t\t\tisDismissible: false,\n\t\t\texplicitDismiss: true,\n\t\t\tspeak: false,\n\t\t\ticon: UPLOAD_SPINNER,\n\t\t\tonDismiss: () => {\n\t\t\t\tdismissedRef.current = true;\n\t\t\t},\n\t\t} );\n\t}, [ remaining, peak, csmOriginals, tracker, createNotice, removeNotice ] );\n\n\treturn null;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["WCIcon", "uploadStore", "noticesStore"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/upload-progress-snackbar/tracker.js
|
|
21
|
+
var tracker_exports = {};
|
|
22
|
+
__export(tracker_exports, {
|
|
23
|
+
addFiles: () => addFiles,
|
|
24
|
+
advance: () => advance,
|
|
25
|
+
getState: () => getState,
|
|
26
|
+
reset: () => reset,
|
|
27
|
+
useTracker: () => useTracker
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(tracker_exports);
|
|
30
|
+
var import_element = require("@wordpress/element");
|
|
31
|
+
var state = null;
|
|
32
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
33
|
+
function notify() {
|
|
34
|
+
listeners.forEach((listener) => listener());
|
|
35
|
+
}
|
|
36
|
+
function addFiles(filenames) {
|
|
37
|
+
if (!filenames.length) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!state) {
|
|
41
|
+
state = { total: 0, completed: 0, pending: [] };
|
|
42
|
+
}
|
|
43
|
+
state = {
|
|
44
|
+
total: state.total + filenames.length,
|
|
45
|
+
completed: state.completed,
|
|
46
|
+
pending: [...state.pending, ...filenames]
|
|
47
|
+
};
|
|
48
|
+
notify();
|
|
49
|
+
}
|
|
50
|
+
function advance(count) {
|
|
51
|
+
if (!state || count <= 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const completed = Math.min(state.total, state.completed + count);
|
|
55
|
+
const pending = state.pending.slice(count);
|
|
56
|
+
if (completed >= state.total) {
|
|
57
|
+
state = null;
|
|
58
|
+
} else {
|
|
59
|
+
state = { total: state.total, completed, pending };
|
|
60
|
+
}
|
|
61
|
+
notify();
|
|
62
|
+
}
|
|
63
|
+
function reset() {
|
|
64
|
+
if (state === null) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
state = null;
|
|
68
|
+
notify();
|
|
69
|
+
}
|
|
70
|
+
function getState() {
|
|
71
|
+
return state;
|
|
72
|
+
}
|
|
73
|
+
function subscribe(listener) {
|
|
74
|
+
listeners.add(listener);
|
|
75
|
+
return () => {
|
|
76
|
+
listeners.delete(listener);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function useTracker() {
|
|
80
|
+
return (0, import_element.useSyncExternalStore)(subscribe, getState, getState);
|
|
81
|
+
}
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
addFiles,
|
|
85
|
+
advance,
|
|
86
|
+
getState,
|
|
87
|
+
reset,
|
|
88
|
+
useTracker
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=tracker.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/upload-progress-snackbar/tracker.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSyncExternalStore } from '@wordpress/element';\n\n/**\n * A minimal in-memory tracker for in-flight media uploads that happen outside\n * the `@wordpress/upload-media` store (i.e. the traditional / non-CSM upload\n * path). The editor's `mediaUpload` wrapper writes to it; the\n * `UploadProgressSnackbar` reads from it.\n *\n * State shape: { total, completed, pending: string[] }\n * - `total`: total files registered in the current session.\n * - `completed`: files that have finished (succeeded OR errored).\n * - `pending`: remaining filenames in submission order.\n *\n * The tracker holds at most one \"session\" at a time — if a new batch starts\n * while one is in progress, its files are appended to the existing session.\n */\n\nlet state = null;\nconst listeners = new Set();\n\nfunction notify() {\n\tlisteners.forEach( ( listener ) => listener() );\n}\n\n/**\n * Registers a new batch of files that have started uploading.\n *\n * @param {string[]} filenames Filenames in submission order.\n */\nexport function addFiles( filenames ) {\n\tif ( ! filenames.length ) {\n\t\treturn;\n\t}\n\tif ( ! state ) {\n\t\tstate = { total: 0, completed: 0, pending: [] };\n\t}\n\tstate = {\n\t\ttotal: state.total + filenames.length,\n\t\tcompleted: state.completed,\n\t\tpending: [ ...state.pending, ...filenames ],\n\t};\n\tnotify();\n}\n\n/**\n * Advances the tracker by a number of finished files (success or error).\n *\n * @param {number} count Number of files that finished since the last call.\n */\nexport function advance( count ) {\n\tif ( ! state || count <= 0 ) {\n\t\treturn;\n\t}\n\tconst completed = Math.min( state.total, state.completed + count );\n\tconst pending = state.pending.slice( count );\n\tif ( completed >= state.total ) {\n\t\tstate = null;\n\t} else {\n\t\tstate = { total: state.total, completed, pending };\n\t}\n\tnotify();\n}\n\n/**\n * Resets the tracker to its empty state.\n *\n * Test-only helper: `state` is a module-level singleton, so tests call this in\n * `beforeEach` to isolate cases from one another. Not used in production -\n * `advance` clears the state on its own once every file in a batch finishes.\n */\nexport function reset() {\n\tif ( state === null ) {\n\t\treturn;\n\t}\n\tstate = null;\n\tnotify();\n}\n\n/**\n * Returns the current tracker state, or `null` when idle.\n *\n * @return {?{total: number, completed: number, pending: string[]}} Tracker state.\n */\nexport function getState() {\n\treturn state;\n}\n\nfunction subscribe( listener ) {\n\tlisteners.add( listener );\n\treturn () => {\n\t\tlisteners.delete( listener );\n\t};\n}\n\n/**\n * React hook that subscribes to the tracker.\n *\n * @return {?{total: number, completed: number, pending: string[]}} Tracker state.\n */\nexport function useTracker() {\n\treturn useSyncExternalStore( subscribe, getState, getState );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAqC;AAiBrC,IAAI,QAAQ;AACZ,IAAM,YAAY,oBAAI,IAAI;AAE1B,SAAS,SAAS;AACjB,YAAU,QAAS,CAAE,aAAc,SAAS,CAAE;AAC/C;AAOO,SAAS,SAAU,WAAY;AACrC,MAAK,CAAE,UAAU,QAAS;AACzB;AAAA,EACD;AACA,MAAK,CAAE,OAAQ;AACd,YAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC,EAAE;AAAA,EAC/C;AACA,UAAQ;AAAA,IACP,OAAO,MAAM,QAAQ,UAAU;AAAA,IAC/B,WAAW,MAAM;AAAA,IACjB,SAAS,CAAE,GAAG,MAAM,SAAS,GAAG,SAAU;AAAA,EAC3C;AACA,SAAO;AACR;AAOO,SAAS,QAAS,OAAQ;AAChC,MAAK,CAAE,SAAS,SAAS,GAAI;AAC5B;AAAA,EACD;AACA,QAAM,YAAY,KAAK,IAAK,MAAM,OAAO,MAAM,YAAY,KAAM;AACjE,QAAM,UAAU,MAAM,QAAQ,MAAO,KAAM;AAC3C,MAAK,aAAa,MAAM,OAAQ;AAC/B,YAAQ;AAAA,EACT,OAAO;AACN,YAAQ,EAAE,OAAO,MAAM,OAAO,WAAW,QAAQ;AAAA,EAClD;AACA,SAAO;AACR;AASO,SAAS,QAAQ;AACvB,MAAK,UAAU,MAAO;AACrB;AAAA,EACD;AACA,UAAQ;AACR,SAAO;AACR;AAOO,SAAS,WAAW;AAC1B,SAAO;AACR;AAEA,SAAS,UAAW,UAAW;AAC9B,YAAU,IAAK,QAAS;AACxB,SAAO,MAAM;AACZ,cAAU,OAAQ,QAAS;AAAA,EAC5B;AACD;AAOO,SAAS,aAAa;AAC5B,aAAO,qCAAsB,WAAW,UAAU,QAAS;AAC5D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -83,7 +83,7 @@ function EditTemplateBlocksNotification({ contentRef }) {
|
|
|
83
83
|
onCancel: () => setIsDialogOpen(false),
|
|
84
84
|
size: "medium",
|
|
85
85
|
children: (0, import_i18n.__)(
|
|
86
|
-
"You
|
|
86
|
+
"You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?"
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
89
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/visual-editor/edit-template-blocks-notification.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page content and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {React.RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t[]\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t! event.target.classList.contains( 'is-root-container' ) ||\n\t\t\t\tevent.target.dataset?.type === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsDialogOpen( true );\n\t\t\t}\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page content and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {React.RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t[]\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t! event.target.classList.contains( 'is-root-container' ) ||\n\t\t\t\tevent.target.dataset?.type === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsDialogOpen( true );\n\t\t\t}\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AACnC,qBAAoC;AACpC,kBAAmB;AACnB,wBAA6D;AAK7D,mBAAqC;AAsEnC;AAtDa,SAAR,+BAAiD,EAAE,WAAW,GAAI;AACxE,QAAM,EAAE,0BAA0B,WAAW,QAAI,uBAAW,CAAE,WAAY;AACzE,UAAM,EAAE,mBAAmB,qBAAqB,IAC/C,OAAQ,aAAAA,KAAY;AAErB,WAAO;AAAA,MACN,0BACC,kBAAkB,EAAE;AAAA,MACrB,YAAY,qBAAqB;AAAA,IAClC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,sBAAkB;AAAA,IACvB,CAAE,WACD,CAAC,CAAE,OAAQ,iBAAAC,KAAU,EAAE,QAAS,UAAU;AAAA,MACzC,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE;AAAA,IACH,CAAC;AAAA,EACF;AAEA,QAAM,CAAE,cAAc,eAAgB,QAAI,yBAAU,KAAM;AAE1D,gCAAW,MAAM;AAChB,UAAM,iBAAiB,CAAE,UAAW;AACnC,UAAK,CAAE,iBAAkB;AACxB;AAAA,MACD;AAEA,UACC,CAAE,MAAM,OAAO,UAAU,SAAU,mBAAoB,KACvD,MAAM,OAAO,SAAS,SAAS,sBAC9B;AACD;AAAA,MACD;AAEA,UAAK,CAAE,MAAM,kBAAmB;AAC/B,cAAM,eAAe;AACrB,wBAAiB,IAAK;AAAA,MACvB;AAAA,IACD;AAEA,UAAM,SAAS,WAAW;AAC1B,YAAQ,iBAAkB,YAAY,cAAe;AACrD,WAAO,MAAM;AACZ,cAAQ,oBAAqB,YAAY,cAAe;AAAA,IACzD;AAAA,EACD,GAAG,CAAE,YAAY,eAAgB,CAAE;AAEnC,MAAK,CAAE,iBAAkB;AACxB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACA,QAAS;AAAA,MACT,uBAAoB,gBAAI,eAAgB;AAAA,MACxC,WAAY,MAAM;AACjB,wBAAiB,KAAM;AACvB,iCAA0B;AAAA,UACzB,QAAQ;AAAA,UACR,UAAU;AAAA,QACX,CAAE;AAAA,MACH;AAAA,MACA,UAAW,MAAM,gBAAiB,KAAM;AAAA,MACxC,MAAK;AAAA,MAEH;AAAA,QACD;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "coreStore", "ConfirmDialog"]
|
|
7
7
|
}
|
|
@@ -27,33 +27,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// packages/editor/src/
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
default: () =>
|
|
30
|
+
// packages/editor/src/dataviews/fields/revisions/index.tsx
|
|
31
|
+
var revisions_exports = {};
|
|
32
|
+
__export(revisions_exports, {
|
|
33
|
+
default: () => revisions_default
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
36
|
-
var import_data = require("@wordpress/data");
|
|
37
|
-
var import_core_data = require("@wordpress/core-data");
|
|
38
|
-
var import_html_entities = require("@wordpress/html-entities");
|
|
35
|
+
module.exports = __toCommonJS(revisions_exports);
|
|
39
36
|
var import_i18n = require("@wordpress/i18n");
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const author = select(import_core_data.store).getUser(revision.author);
|
|
52
|
-
return author?.name;
|
|
53
|
-
}, []);
|
|
54
|
-
if (!authorName) {
|
|
55
|
-
return null;
|
|
37
|
+
var import_revisions_view = __toESM(require("./revisions-view.cjs"));
|
|
38
|
+
var revisionsField = {
|
|
39
|
+
id: "revisions",
|
|
40
|
+
label: (0, import_i18n.__)("Revisions"),
|
|
41
|
+
readOnly: true,
|
|
42
|
+
enableSorting: false,
|
|
43
|
+
render: import_revisions_view.default,
|
|
44
|
+
isVisible: (item) => {
|
|
45
|
+
const revisionsCount = item._links?.["version-history"]?.[0]?.count ?? 0;
|
|
46
|
+
const lastRevisionId = item._links?.["predecessor-version"]?.[0]?.id ?? null;
|
|
47
|
+
return !!lastRevisionId && revisionsCount >= 2;
|
|
56
48
|
}
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
};
|
|
50
|
+
var revisions_default = revisionsField;
|
|
59
51
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/dataviews/fields/revisions/index.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Field } from '@wordpress/dataviews';\nimport type { BasePost } from '@wordpress/fields';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport RevisionsView from './revisions-view';\n\nconst revisionsField: Field< BasePost > = {\n\tid: 'revisions',\n\tlabel: __( 'Revisions' ),\n\treadOnly: true,\n\tenableSorting: false,\n\trender: RevisionsView,\n\tisVisible: ( item ) => {\n\t\tconst revisionsCount =\n\t\t\titem._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\tconst lastRevisionId =\n\t\t\titem._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\t\treturn !! lastRevisionId && revisionsCount >= 2;\n\t},\n};\n\nexport default revisionsField;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,kBAAmB;AAKnB,4BAA0B;AAE1B,IAAM,iBAAoC;AAAA,EACzC,IAAI;AAAA,EACJ,WAAO,gBAAI,WAAY;AAAA,EACvB,UAAU;AAAA,EACV,eAAe;AAAA,EACf,QAAQ,sBAAAA;AAAA,EACR,WAAW,CAAE,SAAU;AACtB,UAAM,iBACL,KAAK,SAAU,iBAAkB,IAAK,CAAE,GAAG,SAAS;AACrD,UAAM,iBACL,KAAK,SAAU,qBAAsB,IAAK,CAAE,GAAG,MAAM;AACtD,WAAO,CAAC,CAAE,kBAAkB,kBAAkB;AAAA,EAC/C;AACD;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": ["RevisionsView"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/dataviews/fields/revisions/revisions-view.tsx
|
|
21
|
+
var revisions_view_exports = {};
|
|
22
|
+
__export(revisions_view_exports, {
|
|
23
|
+
default: () => RevisionsView
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(revisions_view_exports);
|
|
26
|
+
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_data = require("@wordpress/data");
|
|
28
|
+
var import_i18n = require("@wordpress/i18n");
|
|
29
|
+
var import_url = require("@wordpress/url");
|
|
30
|
+
var import_store = require("../../../store/index.cjs");
|
|
31
|
+
var import_lock_unlock = require("../../../lock-unlock.cjs");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
function RevisionsView() {
|
|
34
|
+
const { lastRevisionId, revisionsCount, disableVisualRevisions } = (0, import_data.useSelect)((select) => {
|
|
35
|
+
const {
|
|
36
|
+
getCurrentPostLastRevisionId,
|
|
37
|
+
getCurrentPostRevisionsCount,
|
|
38
|
+
getEditorSettings
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
} = select(import_store.store);
|
|
41
|
+
return {
|
|
42
|
+
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
43
|
+
revisionsCount: getCurrentPostRevisionsCount(),
|
|
44
|
+
disableVisualRevisions: (
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
!!getEditorSettings().disableVisualRevisions
|
|
47
|
+
)
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
const { setCurrentRevisionId } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_store.store));
|
|
51
|
+
const buttonProps = disableVisualRevisions ? {
|
|
52
|
+
href: (0, import_url.addQueryArgs)("revision.php", {
|
|
53
|
+
revision: lastRevisionId
|
|
54
|
+
})
|
|
55
|
+
} : { onClick: () => setCurrentRevisionId(lastRevisionId) };
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_components.Button,
|
|
58
|
+
{
|
|
59
|
+
...buttonProps,
|
|
60
|
+
variant: "link",
|
|
61
|
+
text: String(revisionsCount),
|
|
62
|
+
"aria-label": (0, import_i18n.sprintf)(
|
|
63
|
+
/* translators: %d: number of revisions. */
|
|
64
|
+
(0, import_i18n._n)(
|
|
65
|
+
"Open revisions screen: %d revision",
|
|
66
|
+
"Open revisions screen: %d revisions",
|
|
67
|
+
revisionsCount
|
|
68
|
+
),
|
|
69
|
+
revisionsCount
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=revisions-view.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/dataviews/fields/revisions/revisions-view.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\n// @ts-ignore\nimport { store as editorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nexport default function RevisionsView() {\n\tconst { lastRevisionId, revisionsCount, disableVisualRevisions } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostLastRevisionId,\n\t\t\t\tgetCurrentPostRevisionsCount,\n\t\t\t\tgetEditorSettings,\n\t\t\t\t// @ts-ignore\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t\t\tdisableVisualRevisions:\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t!! getEditorSettings().disableVisualRevisions,\n\t\t\t};\n\t\t}, [] );\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\tconst buttonProps = disableVisualRevisions\n\t\t? {\n\t\t\t\thref: addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t} ),\n\t\t }\n\t\t: { onClick: () => setCurrentRevisionId( lastRevisionId ) };\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...buttonProps }\n\t\t\tvariant=\"link\"\n\t\t\ttext={ String( revisionsCount ) }\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %d: number of revisions. */\n\t\t\t\t_n(\n\t\t\t\t\t'Open revisions screen: %d revision',\n\t\t\t\t\t'Open revisions screen: %d revisions',\n\t\t\t\t\trevisionsCount\n\t\t\t\t),\n\t\t\t\trevisionsCount\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuB;AACvB,kBAAuC;AACvC,kBAA4B;AAC5B,iBAA6B;AAM7B,mBAAqC;AACrC,yBAAuB;AA8BrB;AA5Ba,SAAR,gBAAiC;AACvC,QAAM,EAAE,gBAAgB,gBAAgB,uBAAuB,QAC9D,uBAAW,CAAE,WAAY;AACxB,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAED,IAAI,OAAQ,aAAAA,KAAY;AACxB,WAAO;AAAA,MACN,gBAAgB,6BAA6B;AAAA,MAC7C,gBAAgB,6BAA6B;AAAA,MAC7C;AAAA;AAAA,QAEC,CAAC,CAAE,kBAAkB,EAAE;AAAA;AAAA,IACzB;AAAA,EACD,GAAG,CAAC,CAAE;AACP,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAA,KAAY,CAAE;AAEpE,QAAM,cAAc,yBACjB;AAAA,IACA,UAAM,yBAAc,gBAAgB;AAAA,MACnC,UAAU;AAAA,IACX,CAAE;AAAA,EACF,IACA,EAAE,SAAS,MAAM,qBAAsB,cAAe,EAAE;AAE3D,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,SAAQ;AAAA,MACR,MAAO,OAAQ,cAAe;AAAA,MAC9B,kBAAa;AAAA;AAAA,YAEZ;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["editorStore"]
|
|
7
|
+
}
|
|
@@ -160,20 +160,30 @@ var registerPostTypeSchema = (postType) => async ({ registry }) => {
|
|
|
160
160
|
fields = [
|
|
161
161
|
postTypeConfig.supports?.thumbnail && currentTheme?.theme_supports?.["post-thumbnails"] && import_fields.featuredImageField,
|
|
162
162
|
postTypeConfig.supports?.author && import_fields.authorField,
|
|
163
|
-
import_fields.statusField,
|
|
163
|
+
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.statusField,
|
|
164
164
|
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.dateField,
|
|
165
165
|
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.scheduledDateField,
|
|
166
|
-
import_fields.
|
|
166
|
+
import_fields.lastEditedDateField,
|
|
167
|
+
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.slugField,
|
|
167
168
|
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.excerpt && import_fields.excerptField,
|
|
168
169
|
postTypeConfig.supports?.["page-attributes"] && import_fields.parentField,
|
|
169
170
|
postTypeConfig.supports?.comments && import_fields.commentStatusField,
|
|
170
171
|
postTypeConfig.supports?.trackbacks && import_fields.pingStatusField,
|
|
171
172
|
(postTypeConfig.supports?.comments || postTypeConfig.supports?.trackbacks) && import_fields.discussionField,
|
|
172
|
-
import_fields.templateField,
|
|
173
|
+
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.templateField,
|
|
173
174
|
postTypeConfig.supports?.["post-formats"] && !disablePostFormats && import_fields.formatField,
|
|
174
175
|
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.editor && import_fields.postContentInfoField,
|
|
175
|
-
import_fields.passwordField,
|
|
176
|
+
!import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.passwordField,
|
|
176
177
|
postTypeConfig.slug === "post" && import_fields.stickyField,
|
|
178
|
+
postTypeConfig.slug === "wp_template" && import_fields.descriptionField,
|
|
179
|
+
postTypeConfig.slug === "wp_template" && import_fields.readOnlyDescriptionField,
|
|
180
|
+
// The `home`/`index` template summary exposes a few fields that
|
|
181
|
+
// target other entities (`root/site` and the posts page).
|
|
182
|
+
// `DataFormPostSummary` overrides them to read/write the right
|
|
183
|
+
// entity and to control their visibility.
|
|
184
|
+
postTypeConfig.slug === "wp_template" && import_fields.postsPageTitleField,
|
|
185
|
+
postTypeConfig.slug === "wp_template" && import_fields.postsPerPageField,
|
|
186
|
+
postTypeConfig.slug === "wp_template" && import_fields.siteDiscussionField,
|
|
177
187
|
postTypeConfig.supports?.editor && postTypeConfig.viewable && import_content_preview.default,
|
|
178
188
|
hasEditorNotesSupport(postTypeConfig.supports) && import_fields.notesField
|
|
179
189
|
].filter(Boolean);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/dataviews/store/private-actions.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\texcerptField,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n\tnotesField,\n\tscheduledDateField,\n\tformatField,\n\tpostContentInfoField,\n\tstickyField,\n} from '@wordpress/fields';\nimport {\n\taltTextField,\n\tattachedToField,\n\tauthorField as mediaAuthorField,\n\tcaptionField,\n\tdateAddedField,\n\tdescriptionField,\n\tfilenameField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tmimeTypeField,\n} from '@wordpress/media-fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE, DESIGN_POST_TYPES } from '../../store/constants';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalTemplateActivate?: boolean;\n\t}\n}\n\n/**\n * Check if a post type supports editor notes.\n *\n * @param supports The post type supports object.\n * @return Whether editor notes are supported.\n */\nfunction hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {\n\tconst editor = supports?.editor;\n\tif ( Array.isArray( editor ) ) {\n\t\treturn !! editor[ 0 ]?.notes;\n\t}\n\treturn false;\n}\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\n/*\n * Media fields for the attachment post type.\n *\n * Field order follows a logical grouping:\n * 1. Metadata fields in panels (date, author, file info)\n * 2. Core editable fields (title, alt text, caption, description)\n *\n * Note: media_thumbnail is not included as it's shown in the canvas preview\n */\nconst ORDERED_MEDIA_FIELDS = [\n\t// Metadata in panels (collapsed by default).\n\tdateAddedField,\n\tmediaAuthorField,\n\tfilenameField,\n\tmimeTypeField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tattachedToField,\n\t// Regular layout fields (always visible).\n\ttitleField,\n\taltTextField,\n\tcaptionField,\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAmC;AAEnC,mBAAyB;AAEzB,
|
|
6
|
-
"names": ["mediaAuthorField", "editorStore", "coreStore", "postPreviewField"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\texcerptField,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n\tnotesField,\n\tscheduledDateField,\n\tlastEditedDateField,\n\tformatField,\n\tpostContentInfoField,\n\tstickyField,\n\tdescriptionField,\n\treadOnlyDescriptionField,\n\tpostsPerPageField,\n\tsiteDiscussionField,\n\tpostsPageTitleField,\n} from '@wordpress/fields';\nimport {\n\taltTextField,\n\tattachedToField,\n\tauthorField as mediaAuthorField,\n\tcaptionField,\n\tdateAddedField,\n\tdescriptionField as mediaDescriptionField,\n\tfilenameField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tmimeTypeField,\n} from '@wordpress/media-fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE, DESIGN_POST_TYPES } from '../../store/constants';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\ndeclare global {\n\tinterface Window {\n\t\t__experimentalTemplateActivate?: boolean;\n\t}\n}\n\n/**\n * Check if a post type supports editor notes.\n *\n * @param supports The post type supports object.\n * @return Whether editor notes are supported.\n */\nfunction hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {\n\tconst editor = supports?.editor;\n\tif ( Array.isArray( editor ) ) {\n\t\treturn !! editor[ 0 ]?.notes;\n\t}\n\treturn false;\n}\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\n/*\n * Media fields for the attachment post type.\n *\n * Field order follows a logical grouping:\n * 1. Metadata fields in panels (date, author, file info)\n * 2. Core editable fields (title, alt text, caption, description)\n *\n * Note: media_thumbnail is not included as it's shown in the canvas preview\n */\nconst ORDERED_MEDIA_FIELDS = [\n\t// Metadata in panels (collapsed by default).\n\tdateAddedField,\n\tmediaAuthorField,\n\tfilenameField,\n\tmimeTypeField,\n\tfilesizeField,\n\tmediaDimensionsField,\n\tattachedToField,\n\t// Regular layout fields (always visible).\n\ttitleField,\n\taltTextField,\n\tcaptionField,\n\tmediaDescriptionField,\n];\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\t\tconst { disablePostFormats } = registry\n\t\t\t.select( editorStore )\n\t\t\t.getEditorSettings();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// When template activation experiment is disabled, templates cannot be duplicated.\n\t\t// @ts-ignore\n\t\tif (\n\t\t\tpostTypeConfig.slug === 'wp_template' &&\n\t\t\t! window?.__experimentalTemplateActivate\n\t\t) {\n\t\t\tcanDuplicate = undefined;\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\t// Handle attachment post type separately with media-specific fields\n\t\tlet fields;\n\n\t\tif ( postType === ATTACHMENT_POST_TYPE ) {\n\t\t\tfields = ORDERED_MEDIA_FIELDS;\n\t\t} else {\n\t\t\tfields = [\n\t\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\t\tfeaturedImageField,\n\t\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tstatusField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tdateField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tscheduledDateField,\n\t\t\t\tlastEditedDateField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tslugField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tpostTypeConfig.supports?.excerpt &&\n\t\t\t\t\texcerptField,\n\t\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\t\tdiscussionField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\ttemplateField,\n\t\t\t\tpostTypeConfig.supports?.[ 'post-formats' ] &&\n\t\t\t\t\t! disablePostFormats &&\n\t\t\t\t\tformatField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostContentInfoField,\n\t\t\t\t! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&\n\t\t\t\t\tpasswordField,\n\t\t\t\tpostTypeConfig.slug === 'post' && stickyField,\n\t\t\t\tpostTypeConfig.slug === 'wp_template' && descriptionField,\n\t\t\t\tpostTypeConfig.slug === 'wp_template' &&\n\t\t\t\t\treadOnlyDescriptionField,\n\t\t\t\t// The `home`/`index` template summary exposes a few fields that\n\t\t\t\t// target other entities (`root/site` and the posts page).\n\t\t\t\t// `DataFormPostSummary` overrides them to read/write the right\n\t\t\t\t// entity and to control their visibility.\n\t\t\t\tpostTypeConfig.slug === 'wp_template' && postsPageTitleField,\n\t\t\t\tpostTypeConfig.slug === 'wp_template' && postsPerPageField,\n\t\t\t\tpostTypeConfig.slug === 'wp_template' && siteDiscussionField,\n\t\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\t\tpostPreviewField,\n\t\t\t\thasEditorNotesSupport( postTypeConfig.supports ) && notesField,\n\t\t\t].filter( Boolean );\n\t\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\t\tlet _titleField;\n\t\t\t\tif ( postType === 'page' ) {\n\t\t\t\t\t_titleField = pageTitleField;\n\t\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t\t_titleField = templateTitleField;\n\t\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t\t_titleField = patternTitleField;\n\t\t\t\t} else {\n\t\t\t\t\t_titleField = titleField;\n\t\t\t\t}\n\t\t\t\tfields.push( _titleField );\n\t\t\t}\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["mediaAuthorField", "mediaDescriptionField", "editorStore", "coreStore", "postPreviewField"]
|
|
7
7
|
}
|
|
@@ -273,7 +273,7 @@ function PushChangesToGlobalStylesControl({
|
|
|
273
273
|
help: (0, import_i18n.sprintf)(
|
|
274
274
|
// translators: %s: Title of the block e.g. 'Heading'.
|
|
275
275
|
(0, import_i18n.__)(
|
|
276
|
-
"Apply this block
|
|
276
|
+
"Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."
|
|
277
277
|
),
|
|
278
278
|
(0, import_blocks.getBlockType)(name).title
|
|
279
279
|
),
|