@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
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Text, Image, View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import {
|
|
10
|
-
usePreferredColorScheme,
|
|
11
|
-
usePreferredColorSchemeStyle,
|
|
12
|
-
} from '@wordpress/compose';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import styles from './style.scss';
|
|
18
|
-
|
|
19
|
-
export const HelpDetailBodyText = ( { text } ) => {
|
|
20
|
-
const bodyStyle = usePreferredColorSchemeStyle(
|
|
21
|
-
styles.helpDetailBody,
|
|
22
|
-
styles.helpDetailBodyDark
|
|
23
|
-
);
|
|
24
|
-
return (
|
|
25
|
-
<Text selectable style={ bodyStyle }>
|
|
26
|
-
{ text }
|
|
27
|
-
</Text>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const HelpDetailSectionHeadingText = ( { text, badge } ) => {
|
|
32
|
-
const headingTextStyle = usePreferredColorSchemeStyle(
|
|
33
|
-
styles.helpDetailSectionHeadingText,
|
|
34
|
-
styles.helpDetailSectionHeadingTextDark
|
|
35
|
-
);
|
|
36
|
-
return (
|
|
37
|
-
<View style={ styles.helpDetailSectionHeading }>
|
|
38
|
-
{ badge && <HelpDetailBadge text={ badge } /> }
|
|
39
|
-
<Text
|
|
40
|
-
accessibilityRole="header"
|
|
41
|
-
selectable
|
|
42
|
-
style={ headingTextStyle }
|
|
43
|
-
>
|
|
44
|
-
{ text }
|
|
45
|
-
</Text>
|
|
46
|
-
</View>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const HelpDetailImage = ( {
|
|
51
|
-
accessible,
|
|
52
|
-
accessibilityLabel,
|
|
53
|
-
source,
|
|
54
|
-
sourceDarkMode,
|
|
55
|
-
} ) => {
|
|
56
|
-
const imageStyle = usePreferredColorSchemeStyle(
|
|
57
|
-
styles.helpDetailImage,
|
|
58
|
-
styles.helpDetailImageDark
|
|
59
|
-
);
|
|
60
|
-
const darkModeEnabled = usePreferredColorScheme() === 'dark';
|
|
61
|
-
return (
|
|
62
|
-
<Image
|
|
63
|
-
accessible={ accessible }
|
|
64
|
-
accessibilityLabel={ accessibilityLabel }
|
|
65
|
-
source={
|
|
66
|
-
darkModeEnabled && sourceDarkMode ? sourceDarkMode : source
|
|
67
|
-
}
|
|
68
|
-
style={ imageStyle }
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const HelpDetailBadge = ( { text } ) => {
|
|
74
|
-
return (
|
|
75
|
-
<View style={ styles.helpDetailBadgeContainer }>
|
|
76
|
-
<Text style={ styles.helpDetailBadgeText }>{ text }</Text>
|
|
77
|
-
</View>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
-
import Clipboard from '@react-native-clipboard/clipboard';
|
|
6
|
-
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { Component } from '@wordpress/element';
|
|
12
|
-
import { __ } from '@wordpress/i18n';
|
|
13
|
-
import { select } from '@wordpress/data';
|
|
14
|
-
import { logException } from '@wordpress/react-native-bridge';
|
|
15
|
-
import {
|
|
16
|
-
usePreferredColorSchemeStyle,
|
|
17
|
-
withPreferredColorScheme,
|
|
18
|
-
} from '@wordpress/compose';
|
|
19
|
-
import { cautionFilled } from '@wordpress/icons';
|
|
20
|
-
import { Icon as WCIcon } from '@wordpress/components';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
import { store as editorStore } from '../../store';
|
|
26
|
-
import styles from './style.scss';
|
|
27
|
-
|
|
28
|
-
function getContent() {
|
|
29
|
-
try {
|
|
30
|
-
// While `select` in a component is generally discouraged, it is
|
|
31
|
-
// used here because it (a) reduces the chance of data loss in the
|
|
32
|
-
// case of additional errors by performing a direct retrieval and
|
|
33
|
-
// (b) avoids the performance cost associated with unnecessary
|
|
34
|
-
// content serialization throughout the lifetime of a non-erroring
|
|
35
|
-
// application.
|
|
36
|
-
return select( editorStore ).getEditedPostContent();
|
|
37
|
-
} catch {}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function CopyButton( {
|
|
41
|
-
text,
|
|
42
|
-
label,
|
|
43
|
-
accessibilityLabel,
|
|
44
|
-
accessibilityHint,
|
|
45
|
-
secondary = false,
|
|
46
|
-
} ) {
|
|
47
|
-
const containerStyle = usePreferredColorSchemeStyle(
|
|
48
|
-
styles[ 'copy-button__container' ],
|
|
49
|
-
styles[ 'copy-button__container--dark' ]
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const containerSecondaryStyle = usePreferredColorSchemeStyle(
|
|
53
|
-
styles[ 'copy-button__container--secondary' ],
|
|
54
|
-
styles[ 'copy-button__container--secondary-dark' ]
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const textStyle = usePreferredColorSchemeStyle(
|
|
58
|
-
styles[ 'copy-button__text' ],
|
|
59
|
-
styles[ 'copy-button__text--dark' ]
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const textSecondaryStyle = usePreferredColorSchemeStyle(
|
|
63
|
-
styles[ 'copy-button__text--secondary' ],
|
|
64
|
-
styles[ 'copy-button__text--secondary-dark' ]
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<TouchableOpacity
|
|
69
|
-
activeOpacity={ 0.5 }
|
|
70
|
-
accessibilityLabel={ accessibilityLabel }
|
|
71
|
-
style={ [ containerStyle, secondary && containerSecondaryStyle ] }
|
|
72
|
-
accessibilityRole="button"
|
|
73
|
-
accessibilityHint={ accessibilityHint }
|
|
74
|
-
onPress={ () => {
|
|
75
|
-
Clipboard.setString(
|
|
76
|
-
typeof text === 'function' ? text() : text || ''
|
|
77
|
-
);
|
|
78
|
-
} }
|
|
79
|
-
>
|
|
80
|
-
<Text style={ [ textStyle, secondary && textSecondaryStyle ] }>
|
|
81
|
-
{ label }
|
|
82
|
-
</Text>
|
|
83
|
-
</TouchableOpacity>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
class ErrorBoundary extends Component {
|
|
88
|
-
constructor() {
|
|
89
|
-
super( ...arguments );
|
|
90
|
-
|
|
91
|
-
this.state = {
|
|
92
|
-
error: null,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
componentDidCatch( error ) {
|
|
97
|
-
logException( error, {
|
|
98
|
-
context: {
|
|
99
|
-
component_stack: error.componentStack,
|
|
100
|
-
},
|
|
101
|
-
isHandled: true,
|
|
102
|
-
handledBy: 'Editor-level Error Boundary',
|
|
103
|
-
} );
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
static getDerivedStateFromError( error ) {
|
|
107
|
-
return { error };
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
render() {
|
|
111
|
-
const { error } = this.state;
|
|
112
|
-
if ( ! error ) {
|
|
113
|
-
return this.props.children;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const { getStylesFromColorScheme } = this.props;
|
|
117
|
-
|
|
118
|
-
const iconContainerStyle = getStylesFromColorScheme(
|
|
119
|
-
styles[ 'error-boundary__icon-container' ],
|
|
120
|
-
styles[ 'error-boundary__icon-container--dark' ]
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
const titleStyle = getStylesFromColorScheme(
|
|
124
|
-
styles[ 'error-boundary__title' ],
|
|
125
|
-
styles[ 'error-boundary__title--dark' ]
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
const messageStyle = getStylesFromColorScheme(
|
|
129
|
-
styles[ 'error-boundary__message' ],
|
|
130
|
-
styles[ 'error-boundary__message--dark' ]
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
return (
|
|
134
|
-
<SafeAreaView>
|
|
135
|
-
<ScrollView
|
|
136
|
-
style={ styles[ 'error-boundary__scroll' ] }
|
|
137
|
-
contentContainerStyle={
|
|
138
|
-
styles[ 'error-boundary__scroll-container' ]
|
|
139
|
-
}
|
|
140
|
-
>
|
|
141
|
-
<View style={ styles[ 'error-boundary__container' ] }>
|
|
142
|
-
<View style={ iconContainerStyle }>
|
|
143
|
-
<WCIcon
|
|
144
|
-
icon={ cautionFilled }
|
|
145
|
-
{ ...styles[ 'error-boundary__icon' ] }
|
|
146
|
-
/>
|
|
147
|
-
</View>
|
|
148
|
-
<Text style={ titleStyle }>
|
|
149
|
-
{ __(
|
|
150
|
-
'The editor has encountered an unexpected error'
|
|
151
|
-
) }
|
|
152
|
-
</Text>
|
|
153
|
-
<Text style={ messageStyle }>
|
|
154
|
-
{ __(
|
|
155
|
-
'You can copy your post text in case your content is impacted. Copy error details to debug and share with support.'
|
|
156
|
-
) }
|
|
157
|
-
</Text>
|
|
158
|
-
<View
|
|
159
|
-
style={
|
|
160
|
-
styles[ 'error-boundary__actions-container' ]
|
|
161
|
-
}
|
|
162
|
-
>
|
|
163
|
-
<CopyButton
|
|
164
|
-
label={ __( 'Copy post text' ) }
|
|
165
|
-
accessibilityLabel={ __(
|
|
166
|
-
'Button to copy post text'
|
|
167
|
-
) }
|
|
168
|
-
accessibilityHint={ __(
|
|
169
|
-
'Tap here to copy post text'
|
|
170
|
-
) }
|
|
171
|
-
text={ getContent }
|
|
172
|
-
/>
|
|
173
|
-
<CopyButton
|
|
174
|
-
label={ __( 'Copy error details' ) }
|
|
175
|
-
accessibilityLabel={ __(
|
|
176
|
-
'Button to copy error details'
|
|
177
|
-
) }
|
|
178
|
-
accessibilityHint={ __(
|
|
179
|
-
'Tap here to copy error details'
|
|
180
|
-
) }
|
|
181
|
-
text={ error.stack }
|
|
182
|
-
secondary
|
|
183
|
-
/>
|
|
184
|
-
</View>
|
|
185
|
-
</View>
|
|
186
|
-
</ScrollView>
|
|
187
|
-
</SafeAreaView>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export default withPreferredColorScheme( ErrorBoundary );
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
.error-boundary__scroll {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.error-boundary__scroll-container {
|
|
7
|
-
flex-grow: 1;
|
|
8
|
-
max-height: 580px;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.error-boundary__container {
|
|
15
|
-
width: 100%;
|
|
16
|
-
max-width: 600px;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
padding: 0 24px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.error-boundary__icon-container {
|
|
23
|
-
$size: 40px;
|
|
24
|
-
|
|
25
|
-
width: $size;
|
|
26
|
-
height: $size;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
margin-bottom: 8px;
|
|
30
|
-
background-color: rgba(60, 60, 67, 0.3);
|
|
31
|
-
border-radius: 20px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.error-boundary__icon-container--dark {
|
|
35
|
-
background-color: rgba(235, 235, 245, 0.3);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.error-boundary__icon {
|
|
39
|
-
width: 24px;
|
|
40
|
-
height: 24px;
|
|
41
|
-
fill: $white;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.error-boundary__title {
|
|
45
|
-
font-size: 20px;
|
|
46
|
-
font-weight: 600;
|
|
47
|
-
line-height: 25px;
|
|
48
|
-
color: $black;
|
|
49
|
-
text-align: center;
|
|
50
|
-
margin-bottom: 8px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.error-boundary__title--dark {
|
|
54
|
-
color: $white;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.error-boundary__message {
|
|
58
|
-
font-size: 16px;
|
|
59
|
-
font-weight: 400;
|
|
60
|
-
line-height: 21px;
|
|
61
|
-
color: rgba(60, 60, 67, 0.6);
|
|
62
|
-
text-align: center;
|
|
63
|
-
margin-bottom: 16px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.error-boundary__message--dark {
|
|
67
|
-
color: rgba(235, 235, 245, 0.6);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.error-boundary__actions-container {
|
|
71
|
-
width: 100%;
|
|
72
|
-
max-width: 400px;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
gap: 12px;
|
|
75
|
-
padding-top: 16px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.copy-button__container {
|
|
79
|
-
border-radius: 5px;
|
|
80
|
-
padding: $grid-unit $grid-unit-20;
|
|
81
|
-
background-color: $light-primary;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.copy-button__container--dark {
|
|
85
|
-
background-color: $white;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.copy-button__container--secondary {
|
|
89
|
-
border: $border-width #c6c6c8;
|
|
90
|
-
background-color: $white;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.copy-button__container--secondary-dark {
|
|
94
|
-
border-color: rgba(255, 255, 255, 0.3);
|
|
95
|
-
background-color: $black;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.copy-button__text {
|
|
99
|
-
font-size: 17px;
|
|
100
|
-
font-weight: 400;
|
|
101
|
-
line-height: 22px;
|
|
102
|
-
text-align: center;
|
|
103
|
-
color: $white;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.copy-button__text--dark {
|
|
107
|
-
color: $background-dark-secondary;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.copy-button__text--secondary {
|
|
111
|
-
color: $black;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.copy-button__text--secondary-dark {
|
|
115
|
-
color: $white;
|
|
116
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Post Related Components.
|
|
2
|
-
export { default as AutosaveMonitor } from './autosave-monitor';
|
|
3
|
-
export { default as PostTitle } from './post-title';
|
|
4
|
-
export { default as EditorHistoryRedo } from './editor-history/redo';
|
|
5
|
-
export { default as EditorHistoryUndo } from './editor-history/undo';
|
|
6
|
-
|
|
7
|
-
// State Related Components.
|
|
8
|
-
export { default as EditorProvider } from './provider';
|
|
9
|
-
|
|
10
|
-
// Other Components.
|
|
11
|
-
export { default as EditorHelpTopics } from './editor-help';
|
|
12
|
-
export { default as OfflineStatus } from './offline-status';
|
|
13
|
-
export { default as ErrorBoundary } from './error-boundary';
|
|
14
|
-
|
|
15
|
-
export * from './deprecated';
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { AccessibilityInfo, Text, View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import {
|
|
10
|
-
usePreferredColorSchemeStyle,
|
|
11
|
-
useNetworkConnectivity,
|
|
12
|
-
usePrevious,
|
|
13
|
-
} from '@wordpress/compose';
|
|
14
|
-
import { Icon as WCIcon } from '@wordpress/components';
|
|
15
|
-
import { offline as offlineIcon } from '@wordpress/icons';
|
|
16
|
-
import { __ } from '@wordpress/i18n';
|
|
17
|
-
import { useEffect } from '@wordpress/element';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
import styles from './style.native.scss';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Conditionally announces messages for screen reader users. This Hook provides
|
|
26
|
-
* two benefits over React Native's `accessibilityLiveRegion`:
|
|
27
|
-
*
|
|
28
|
-
* 1. It works on both iOS and Android.
|
|
29
|
-
* 2. It allows announcing a secondary message when the component is inactive.
|
|
30
|
-
*
|
|
31
|
-
* @param {string} message The message to announce.
|
|
32
|
-
* @param {Object} options Options for the Hook.
|
|
33
|
-
* @param {boolean} [options.isActive] Whether the message should be announced.
|
|
34
|
-
* @param {string} [options.inactiveMessage] The message to announce when inactive.
|
|
35
|
-
*/
|
|
36
|
-
function useAccessibilityLiveRegion( message, { isActive, inactiveMessage } ) {
|
|
37
|
-
const { announceForAccessibility } = AccessibilityInfo;
|
|
38
|
-
const prevIsActive = usePrevious( isActive );
|
|
39
|
-
|
|
40
|
-
useEffect( () => {
|
|
41
|
-
const unconditionalMessage = typeof isActive === 'undefined';
|
|
42
|
-
const initialRender = typeof prevIsActive === 'undefined';
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
unconditionalMessage ||
|
|
46
|
-
( isActive && ! prevIsActive && ! initialRender )
|
|
47
|
-
) {
|
|
48
|
-
announceForAccessibility( message );
|
|
49
|
-
} else if ( ! isActive && prevIsActive && inactiveMessage ) {
|
|
50
|
-
announceForAccessibility( inactiveMessage );
|
|
51
|
-
}
|
|
52
|
-
}, [
|
|
53
|
-
message,
|
|
54
|
-
isActive,
|
|
55
|
-
prevIsActive,
|
|
56
|
-
inactiveMessage,
|
|
57
|
-
announceForAccessibility,
|
|
58
|
-
] );
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const OfflineStatus = () => {
|
|
62
|
-
const { isConnected } = useNetworkConnectivity();
|
|
63
|
-
|
|
64
|
-
useAccessibilityLiveRegion( __( 'Network connection re-established' ), {
|
|
65
|
-
isActive: isConnected,
|
|
66
|
-
inactiveMessage: __( 'Network connection lost, working offline' ),
|
|
67
|
-
} );
|
|
68
|
-
|
|
69
|
-
const containerStyle = usePreferredColorSchemeStyle(
|
|
70
|
-
styles.offline,
|
|
71
|
-
styles.offline__dark
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const textStyle = usePreferredColorSchemeStyle(
|
|
75
|
-
styles[ 'offline--text' ],
|
|
76
|
-
styles[ 'offline--text__dark' ]
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const iconStyle = usePreferredColorSchemeStyle(
|
|
80
|
-
styles[ 'offline--icon' ],
|
|
81
|
-
styles[ 'offline--icon__dark' ]
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
return ! isConnected ? (
|
|
85
|
-
<View
|
|
86
|
-
accessible
|
|
87
|
-
accessibilityRole="alert"
|
|
88
|
-
accessibilityLabel={ __(
|
|
89
|
-
'Network connection lost, working offline'
|
|
90
|
-
) }
|
|
91
|
-
style={ containerStyle }
|
|
92
|
-
>
|
|
93
|
-
<WCIcon fill={ iconStyle.fill } icon={ offlineIcon } />
|
|
94
|
-
<Text style={ textStyle }>{ __( 'Working Offline' ) } </Text>
|
|
95
|
-
</View>
|
|
96
|
-
) : null;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export default OfflineStatus;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
.offline {
|
|
2
|
-
background-color: $gray-lighten-30;
|
|
3
|
-
padding: $grid-unit;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
align-items: center;
|
|
6
|
-
flex-direction: row;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.offline__dark {
|
|
10
|
-
background-color: $gray-70;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.offline--text {
|
|
14
|
-
color: $black;
|
|
15
|
-
padding-left: 3;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.offline--text__dark {
|
|
19
|
-
color: $white;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.offline--icon {
|
|
23
|
-
fill: $gray-70;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.offline--icon__dark {
|
|
27
|
-
fill: $gray-10;
|
|
28
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { act, render, screen } from 'test/helpers';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import {
|
|
10
|
-
requestConnectionStatus,
|
|
11
|
-
subscribeConnectionStatus,
|
|
12
|
-
} from '@wordpress/react-native-bridge';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import OfflineStatus from '../index';
|
|
18
|
-
import { AccessibilityInfo } from 'react-native';
|
|
19
|
-
|
|
20
|
-
jest.mock( '../style.native.scss', () => ( {
|
|
21
|
-
'offline--icon': {
|
|
22
|
-
fill: '',
|
|
23
|
-
},
|
|
24
|
-
} ) );
|
|
25
|
-
|
|
26
|
-
describe( 'when network connectivity is unavailable', () => {
|
|
27
|
-
beforeAll( () => {
|
|
28
|
-
requestConnectionStatus.mockImplementation( ( callback ) => {
|
|
29
|
-
callback( false );
|
|
30
|
-
return { remove: jest.fn() };
|
|
31
|
-
} );
|
|
32
|
-
} );
|
|
33
|
-
|
|
34
|
-
it( 'should display a helpful message', () => {
|
|
35
|
-
render( <OfflineStatus /> );
|
|
36
|
-
|
|
37
|
-
expect( screen.getByText( 'Working Offline' ) ).toBeVisible();
|
|
38
|
-
} );
|
|
39
|
-
|
|
40
|
-
it( 'should display an accessible message', () => {
|
|
41
|
-
render( <OfflineStatus /> );
|
|
42
|
-
|
|
43
|
-
expect(
|
|
44
|
-
screen.getByLabelText( 'Network connection lost, working offline' )
|
|
45
|
-
).toBeVisible();
|
|
46
|
-
} );
|
|
47
|
-
|
|
48
|
-
it( 'should announce network status', () => {
|
|
49
|
-
render( <OfflineStatus /> );
|
|
50
|
-
|
|
51
|
-
expect(
|
|
52
|
-
AccessibilityInfo.announceForAccessibility
|
|
53
|
-
).toHaveBeenCalledWith( 'Network connection lost, working offline' );
|
|
54
|
-
} );
|
|
55
|
-
|
|
56
|
-
it( 'should announce changes to network status', () => {
|
|
57
|
-
let subscriptionCallback;
|
|
58
|
-
subscribeConnectionStatus.mockImplementation( ( callback ) => {
|
|
59
|
-
subscriptionCallback = callback;
|
|
60
|
-
return { remove: jest.fn() };
|
|
61
|
-
} );
|
|
62
|
-
render( <OfflineStatus /> );
|
|
63
|
-
|
|
64
|
-
act( () => subscriptionCallback( { isConnected: false } ) );
|
|
65
|
-
|
|
66
|
-
expect(
|
|
67
|
-
AccessibilityInfo.announceForAccessibility
|
|
68
|
-
).toHaveBeenCalledWith( 'Network connection lost, working offline' );
|
|
69
|
-
} );
|
|
70
|
-
} );
|
|
71
|
-
|
|
72
|
-
describe( 'when network connectivity is available', () => {
|
|
73
|
-
beforeAll( () => {
|
|
74
|
-
requestConnectionStatus.mockImplementation( ( callback ) => {
|
|
75
|
-
callback( true );
|
|
76
|
-
return { remove: jest.fn() };
|
|
77
|
-
} );
|
|
78
|
-
} );
|
|
79
|
-
|
|
80
|
-
it( 'should not display a helpful message', () => {
|
|
81
|
-
render( <OfflineStatus /> );
|
|
82
|
-
|
|
83
|
-
expect( screen.queryByText( 'Working Offline' ) ).toBeNull();
|
|
84
|
-
} );
|
|
85
|
-
|
|
86
|
-
it( 'should not announce network status', () => {
|
|
87
|
-
render( <OfflineStatus /> );
|
|
88
|
-
|
|
89
|
-
expect(
|
|
90
|
-
AccessibilityInfo.announceForAccessibility
|
|
91
|
-
).not.toHaveBeenCalled();
|
|
92
|
-
} );
|
|
93
|
-
|
|
94
|
-
it( 'should announce changes to network status', () => {
|
|
95
|
-
let subscriptionCallback;
|
|
96
|
-
subscribeConnectionStatus.mockImplementation( ( callback ) => {
|
|
97
|
-
subscriptionCallback = callback;
|
|
98
|
-
return { remove: jest.fn() };
|
|
99
|
-
} );
|
|
100
|
-
render( <OfflineStatus /> );
|
|
101
|
-
|
|
102
|
-
act( () => subscriptionCallback( { isConnected: false } ) );
|
|
103
|
-
|
|
104
|
-
expect(
|
|
105
|
-
AccessibilityInfo.announceForAccessibility
|
|
106
|
-
).toHaveBeenCalledWith( 'Network connection lost, working offline' );
|
|
107
|
-
} );
|
|
108
|
-
} );
|