@wordpress/editor 14.46.0 → 14.47.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 +11 -0
- package/build/components/collab-sidebar/add-note.cjs +6 -0
- package/build/components/collab-sidebar/add-note.cjs.map +2 -2
- package/build/components/collab-sidebar/hooks.cjs +36 -24
- package/build/components/collab-sidebar/hooks.cjs.map +2 -2
- package/build/components/collab-sidebar/index.cjs +19 -10
- package/build/components/collab-sidebar/index.cjs.map +2 -2
- package/build/components/collab-sidebar/note-byline.cjs +16 -9
- package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
- package/build/components/collab-sidebar/notes.cjs +20 -11
- package/build/components/collab-sidebar/notes.cjs.map +2 -2
- package/build/components/collab-sidebar/utils.cjs +42 -2
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/compute-selection.cjs +39 -15
- package/build/components/collaborators-overlay/compute-selection.cjs.map +3 -3
- package/build/components/collaborators-overlay/use-block-highlighting.cjs +10 -2
- package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +3 -3
- package/build/components/collaborators-overlay/use-render-cursors.cjs +15 -7
- package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
- package/build/components/collaborators-presence/avatar/component.cjs +5 -1
- package/build/components/collaborators-presence/avatar/component.cjs.map +3 -3
- package/build/components/collaborators-presence/use-collaborator-notifications.cjs +6 -3
- package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +2 -2
- package/build/components/editor-interface/index.cjs +17 -16
- package/build/components/editor-interface/index.cjs.map +3 -3
- package/build/components/editor-notices/index.cjs +6 -1
- package/build/components/editor-notices/index.cjs.map +3 -3
- package/build/components/global-styles/hooks.cjs +12 -1
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/header/index.cjs +11 -6
- package/build/components/header/index.cjs.map +2 -2
- package/build/components/media/media-editor-modal.cjs +14 -1
- package/build/components/media/media-editor-modal.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +7 -1
- package/build/components/post-card-panel/index.cjs.map +3 -3
- package/build/components/post-last-revision/index.cjs +28 -8
- package/build/components/post-last-revision/index.cjs.map +2 -2
- package/build/components/post-locked-modal/index.cjs +9 -6
- package/build/components/post-locked-modal/index.cjs.map +2 -2
- package/build/components/post-publish-button/label.cjs +0 -7
- package/build/components/post-publish-button/label.cjs.map +2 -2
- package/build/components/post-publish-panel/prepublish.cjs +8 -1
- package/build/components/post-publish-panel/prepublish.cjs.map +3 -3
- package/build/components/post-revisions-panel/index.cjs +7 -0
- package/build/components/post-revisions-panel/index.cjs.map +2 -2
- package/build/components/post-revisions-preview/diff-markers.cjs +21 -13
- package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-canvas.cjs +7 -1
- package/build/components/post-revisions-preview/revisions-canvas.cjs.map +2 -2
- package/build/components/post-taxonomies/check.cjs +1 -2
- package/build/components/post-taxonomies/check.cjs.map +2 -2
- package/build/components/post-taxonomies/index.cjs +1 -2
- package/build/components/post-taxonomies/index.cjs.map +2 -2
- package/build/components/preferences-modal/index.cjs +1 -1
- package/build/components/preferences-modal/index.cjs.map +2 -2
- package/build/components/preview-dropdown/index.cjs.map +3 -3
- package/build/components/provider/index.cjs +5 -21
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/use-block-editor-settings.cjs +16 -9
- package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
- package/build/components/resizable-editor/resize-handle.cjs +24 -16
- package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
- package/build/components/sidebar/header.cjs +16 -21
- package/build/components/sidebar/header.cjs.map +3 -3
- package/build/components/sidebar/index.cjs +2 -6
- package/build/components/sidebar/index.cjs.map +2 -2
- package/build/components/start-page-options/index.cjs +14 -4
- package/build/components/start-page-options/index.cjs.map +2 -2
- package/build/components/start-template-options/index.cjs +8 -6
- package/build/components/start-template-options/index.cjs.map +2 -2
- package/build/components/styles-canvas/style-book.cjs +59 -2
- package/build/components/styles-canvas/style-book.cjs.map +2 -2
- package/build/components/sync-connection-error-modal/index.cjs +10 -7
- package/build/components/sync-connection-error-modal/index.cjs.map +3 -3
- package/build/components/template-actions-panel/block-theme-content.cjs +21 -12
- package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
- package/build/dataviews/store/private-actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +17 -1
- package/build/store/private-actions.cjs.map +3 -3
- package/build/store/private-selectors.cjs +18 -0
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/selectors.cjs +0 -17
- package/build/store/selectors.cjs.map +2 -2
- package/build/{components/media → utils/media-delete}/index.cjs +12 -13
- package/build/utils/media-delete/index.cjs.map +7 -0
- package/build/utils/media-finalize/index.cjs +3 -1
- package/build/utils/media-finalize/index.cjs.map +2 -2
- package/build/utils/sync-error-messages.cjs +9 -0
- package/build/utils/sync-error-messages.cjs.map +2 -2
- package/build-module/components/collab-sidebar/add-note.mjs +6 -0
- package/build-module/components/collab-sidebar/add-note.mjs.map +2 -2
- package/build-module/components/collab-sidebar/hooks.mjs +42 -25
- package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs +19 -10
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/note-byline.mjs +17 -10
- package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
- package/build-module/components/collab-sidebar/notes.mjs +26 -13
- package/build-module/components/collab-sidebar/notes.mjs.map +2 -2
- package/build-module/components/collab-sidebar/utils.mjs +38 -2
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/compute-selection.mjs +36 -12
- package/build-module/components/collaborators-overlay/compute-selection.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +10 -3
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs +11 -6
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
- package/build-module/components/collaborators-presence/avatar/component.mjs +7 -3
- package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
- package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +6 -3
- package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +2 -2
- package/build-module/components/editor-interface/index.mjs +22 -17
- package/build-module/components/editor-interface/index.mjs.map +2 -2
- package/build-module/components/editor-notices/index.mjs +6 -1
- package/build-module/components/editor-notices/index.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +12 -1
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/header/index.mjs +11 -6
- package/build-module/components/header/index.mjs.map +2 -2
- package/build-module/components/media/media-editor-modal.mjs +14 -1
- package/build-module/components/media/media-editor-modal.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +8 -2
- package/build-module/components/post-card-panel/index.mjs.map +2 -2
- package/build-module/components/post-last-revision/index.mjs +29 -9
- package/build-module/components/post-last-revision/index.mjs.map +2 -2
- package/build-module/components/post-locked-modal/index.mjs +9 -6
- package/build-module/components/post-locked-modal/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/label.mjs +0 -7
- package/build-module/components/post-publish-button/label.mjs.map +2 -2
- package/build-module/components/post-publish-panel/prepublish.mjs +9 -2
- package/build-module/components/post-publish-panel/prepublish.mjs.map +2 -2
- package/build-module/components/post-revisions-panel/index.mjs +7 -0
- package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/diff-markers.mjs +22 -14
- package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs +7 -1
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
- package/build-module/components/post-taxonomies/check.mjs +1 -2
- package/build-module/components/post-taxonomies/check.mjs.map +2 -2
- package/build-module/components/post-taxonomies/index.mjs +1 -2
- package/build-module/components/post-taxonomies/index.mjs.map +2 -2
- package/build-module/components/preferences-modal/index.mjs +1 -1
- package/build-module/components/preferences-modal/index.mjs.map +2 -2
- package/build-module/components/preview-dropdown/index.mjs +2 -2
- package/build-module/components/preview-dropdown/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +6 -22
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +16 -9
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/resizable-editor/resize-handle.mjs +26 -18
- package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
- package/build-module/components/sidebar/header.mjs +11 -16
- package/build-module/components/sidebar/header.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +2 -7
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/start-page-options/index.mjs +14 -4
- package/build-module/components/start-page-options/index.mjs.map +2 -2
- package/build-module/components/start-template-options/index.mjs +8 -6
- package/build-module/components/start-template-options/index.mjs.map +2 -2
- package/build-module/components/styles-canvas/style-book.mjs +60 -3
- package/build-module/components/styles-canvas/style-book.mjs.map +2 -2
- package/build-module/components/sync-connection-error-modal/index.mjs +14 -8
- package/build-module/components/sync-connection-error-modal/index.mjs.map +2 -2
- package/build-module/components/template-actions-panel/block-theme-content.mjs +21 -13
- package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +16 -1
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +18 -0
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/selectors.mjs +0 -16
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/media-delete/index.mjs +12 -0
- package/build-module/utils/media-delete/index.mjs.map +7 -0
- package/build-module/utils/media-finalize/index.mjs +3 -1
- package/build-module/utils/media-finalize/index.mjs.map +2 -2
- package/build-module/utils/sync-error-messages.mjs +8 -0
- package/build-module/utils/sync-error-messages.mjs.map +2 -2
- package/build-style/style-rtl.css +462 -408
- package/build-style/style.css +462 -408
- package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/note-byline.d.ts +3 -0
- package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/notes.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts +33 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/compute-selection.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +3 -0
- 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/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/editor-notices/index.d.ts.map +1 -1
- package/build-types/components/global-styles/hooks.d.ts.map +1 -1
- package/build-types/components/media/media-editor-modal.d.ts +6 -2
- package/build-types/components/media/media-editor-modal.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts +1 -6
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/label.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -1
- package/build-types/components/post-revisions-panel/index.d.ts +1 -1
- package/build-types/components/post-revisions-panel/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +1 -6
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -6
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/start-template-options/index.d.ts.map +1 -1
- package/build-types/components/styles-canvas/style-book.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +0 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +15 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +10 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +0 -10
- 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-delete/index.d.ts +2 -0
- package/build-types/utils/media-delete/index.d.ts.map +1 -0
- package/build-types/utils/media-finalize/index.d.ts +1 -1
- package/build-types/utils/media-finalize/index.d.ts.map +1 -1
- package/build-types/utils/sync-error-messages.d.ts +1 -0
- package/build-types/utils/sync-error-messages.d.ts.map +1 -1
- package/package.json +48 -48
- package/src/components/collab-sidebar/add-note.js +9 -0
- package/src/components/collab-sidebar/hooks.js +53 -29
- package/src/components/collab-sidebar/index.js +28 -14
- package/src/components/collab-sidebar/note-byline.js +15 -10
- package/src/components/collab-sidebar/notes.js +36 -14
- package/src/components/collab-sidebar/test/utils.js +375 -1
- package/src/components/collab-sidebar/utils.js +70 -1
- package/src/components/collaborators-overlay/compute-selection.ts +67 -19
- package/src/components/collaborators-overlay/use-block-highlighting.ts +14 -1
- package/src/components/collaborators-overlay/use-render-cursors.ts +15 -4
- package/src/components/collaborators-presence/avatar/component.tsx +10 -3
- package/src/components/collaborators-presence/avatar/test/index.tsx +50 -18
- package/src/components/collaborators-presence/styles/collaborators-presence.scss +4 -1
- package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +2 -1
- package/src/components/collaborators-presence/use-collaborator-notifications.ts +6 -4
- package/src/components/editor-help/help-topic-row.native.js +2 -2
- package/src/components/editor-interface/index.js +22 -23
- package/src/components/editor-interface/style.scss +4 -0
- package/src/components/editor-notices/index.js +7 -1
- package/src/components/error-boundary/index.native.js +2 -2
- package/src/components/global-styles/hooks.js +26 -0
- package/src/components/global-styles-sidebar/style.scss +0 -9
- package/src/components/header/index.js +12 -12
- package/src/components/media/media-editor-modal.js +20 -2
- package/src/components/offline-status/index.native.js +2 -2
- package/src/components/post-card-panel/index.js +5 -2
- package/src/components/post-last-revision/index.js +37 -9
- package/src/components/post-last-revision/style.scss +0 -3
- package/src/components/post-locked-modal/index.js +8 -5
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-publish-button/label.js +0 -11
- package/src/components/post-publish-panel/prepublish.js +6 -2
- package/src/components/post-revisions-panel/index.js +8 -0
- package/src/components/post-revisions-preview/diff-markers.js +17 -11
- package/src/components/post-revisions-preview/revisions-canvas.js +7 -1
- package/src/components/post-revisions-preview/style.scss +4 -4
- package/src/components/post-taxonomies/check.js +1 -2
- package/src/components/post-taxonomies/index.js +1 -2
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/preview-dropdown/index.js +2 -2
- package/src/components/provider/index.js +10 -31
- package/src/components/provider/use-block-editor-settings.js +19 -12
- package/src/components/resizable-editor/resize-handle.js +22 -16
- package/src/components/sidebar/header.js +18 -28
- package/src/components/sidebar/index.js +5 -14
- package/src/components/start-page-options/index.js +19 -4
- package/src/components/start-template-options/index.js +13 -6
- package/src/components/styles-canvas/style-book.js +75 -13
- package/src/components/sync-connection-error-modal/index.tsx +25 -11
- package/src/components/template-actions-panel/block-theme-content.js +19 -13
- package/src/components/text-editor/style.scss +2 -2
- package/src/dataviews/store/private-actions.ts +0 -1
- package/src/store/private-actions.js +27 -0
- package/src/store/private-selectors.js +26 -0
- package/src/store/selectors.js +0 -24
- package/src/store/test/actions.js +34 -0
- package/src/utils/media-delete/index.js +11 -0
- package/src/utils/media-finalize/index.js +6 -1
- package/src/utils/media-finalize/test/index.js +32 -2
- package/src/utils/sync-error-messages.ts +8 -0
- package/src/utils/test/sync-error-messages.js +1 -0
- package/build/components/global-styles-provider/index.cjs +0 -181
- package/build/components/global-styles-provider/index.cjs.map +0 -7
- package/build/components/media/index.cjs.map +0 -7
- package/build/components/media/metadata-panel.cjs +0 -96
- package/build/components/media/metadata-panel.cjs.map +0 -7
- package/build/components/media/preview.cjs +0 -39
- package/build/components/media/preview.cjs.map +0 -7
- package/build-module/components/global-styles-provider/index.mjs +0 -156
- package/build-module/components/global-styles-provider/index.mjs.map +0 -7
- package/build-module/components/media/index.mjs +0 -8
- package/build-module/components/media/index.mjs.map +0 -7
- package/build-module/components/media/metadata-panel.mjs +0 -65
- package/build-module/components/media/metadata-panel.mjs.map +0 -7
- package/build-module/components/media/preview.mjs +0 -21
- package/build-module/components/media/preview.mjs.map +0 -7
- package/build-types/components/global-styles-provider/index.d.ts +0 -16
- package/build-types/components/global-styles-provider/index.d.ts.map +0 -1
- package/build-types/components/media/index.d.ts +0 -3
- package/build-types/components/media/index.d.ts.map +0 -1
- package/build-types/components/media/metadata-panel.d.ts +0 -12
- package/build-types/components/media/metadata-panel.d.ts.map +0 -1
- package/build-types/components/media/preview.d.ts +0 -9
- package/build-types/components/media/preview.d.ts.map +0 -1
- package/src/components/global-styles-provider/index.js +0 -207
- package/src/components/media/index.js +0 -2
- package/src/components/media/metadata-panel.js +0 -77
- package/src/components/media/preview.js +0 -35
|
@@ -26,10 +26,13 @@ import { store as editorStore } from '../../store';
|
|
|
26
26
|
function CollaborationContext() {
|
|
27
27
|
const { isCollaborationSupported, syncConnectionStatus } = useSelect(
|
|
28
28
|
( select ) => {
|
|
29
|
-
const
|
|
29
|
+
const {
|
|
30
|
+
isCollaborationSupported: isSupported,
|
|
31
|
+
getSyncConnectionStatus,
|
|
32
|
+
} = unlock( select( coreStore ) );
|
|
30
33
|
return {
|
|
31
|
-
isCollaborationSupported:
|
|
32
|
-
syncConnectionStatus:
|
|
34
|
+
isCollaborationSupported: isSupported(),
|
|
35
|
+
syncConnectionStatus: getSyncConnectionStatus(),
|
|
33
36
|
};
|
|
34
37
|
},
|
|
35
38
|
[]
|
|
@@ -74,7 +77,6 @@ function PostLockedModal() {
|
|
|
74
77
|
previewLink,
|
|
75
78
|
} = useSelect( ( select ) => {
|
|
76
79
|
const {
|
|
77
|
-
isCollaborationEnabledForCurrentPost,
|
|
78
80
|
isPostLocked,
|
|
79
81
|
isPostLockTakeover,
|
|
80
82
|
getPostLockUser,
|
|
@@ -83,7 +85,8 @@ function PostLockedModal() {
|
|
|
83
85
|
getEditedPostAttribute,
|
|
84
86
|
getEditedPostPreviewLink,
|
|
85
87
|
getEditorSettings,
|
|
86
|
-
|
|
88
|
+
isCollaborationEnabledForCurrentPost,
|
|
89
|
+
} = unlock( select( editorStore ) );
|
|
87
90
|
const { getPostType } = select( coreStore );
|
|
88
91
|
return {
|
|
89
92
|
isCollaborationEnabled: isCollaborationEnabledForCurrentPost(),
|
|
@@ -9,7 +9,6 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import { store as editorStore } from '../../store';
|
|
12
|
-
import { ATTACHMENT_POST_TYPE } from '../../store/constants';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Renders the label for the publish button.
|
|
@@ -28,7 +27,6 @@ export default function PublishButtonLabel() {
|
|
|
28
27
|
hasNonPostEntityChanges,
|
|
29
28
|
postStatusHasChanged,
|
|
30
29
|
postStatus,
|
|
31
|
-
postType,
|
|
32
30
|
isPostSavingLocked,
|
|
33
31
|
} = useSelect( ( select ) => {
|
|
34
32
|
const {
|
|
@@ -37,7 +35,6 @@ export default function PublishButtonLabel() {
|
|
|
37
35
|
isSavingPost,
|
|
38
36
|
isPublishingPost,
|
|
39
37
|
getCurrentPost,
|
|
40
|
-
getCurrentPostType,
|
|
41
38
|
isAutosavingPost,
|
|
42
39
|
getPostEdits,
|
|
43
40
|
getEditedPostAttribute,
|
|
@@ -49,7 +46,6 @@ export default function PublishButtonLabel() {
|
|
|
49
46
|
isPublishing: isPublishingPost(),
|
|
50
47
|
hasPublishAction:
|
|
51
48
|
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
|
|
52
|
-
postType: getCurrentPostType(),
|
|
53
49
|
isAutosaving: isAutosavingPost(),
|
|
54
50
|
hasNonPostEntityChanges:
|
|
55
51
|
select( editorStore ).hasNonPostEntityChanges(),
|
|
@@ -70,13 +66,6 @@ export default function PublishButtonLabel() {
|
|
|
70
66
|
return __( 'Saving…' );
|
|
71
67
|
}
|
|
72
68
|
if ( ! hasPublishAction ) {
|
|
73
|
-
// For attachments, always show "Save" since they don't have a publish workflow
|
|
74
|
-
if (
|
|
75
|
-
postType === ATTACHMENT_POST_TYPE &&
|
|
76
|
-
window?.__experimentalMediaEditor
|
|
77
|
-
) {
|
|
78
|
-
return __( 'Save' );
|
|
79
|
-
}
|
|
80
69
|
// TODO: this is because "Submit for review" string is too long in some languages.
|
|
81
70
|
// @see https://github.com/WordPress/gutenberg/issues/10475
|
|
82
71
|
return isSmallerThanMediumViewport
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { Icon, PanelBody } from '@wordpress/components';
|
|
5
|
+
import { Icon as WCIcon, PanelBody } from '@wordpress/components';
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
7
|
import { wordpress } from '@wordpress/icons';
|
|
8
8
|
import { filterURLForDisplay } from '@wordpress/url';
|
|
@@ -53,7 +53,11 @@ function PostPublishPanelPrepublish( { children } ) {
|
|
|
53
53
|
}, [] );
|
|
54
54
|
|
|
55
55
|
let siteIcon = (
|
|
56
|
-
<
|
|
56
|
+
<WCIcon
|
|
57
|
+
className="components-site-icon"
|
|
58
|
+
size="36px"
|
|
59
|
+
icon={ wordpress }
|
|
60
|
+
/>
|
|
57
61
|
);
|
|
58
62
|
|
|
59
63
|
if ( siteIconUrl ) {
|
|
@@ -145,6 +145,14 @@ function PostRevisionsPanelContent() {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
export default function PostRevisionsPanel() {
|
|
148
|
+
const disableVisualRevisions = useSelect(
|
|
149
|
+
( select ) =>
|
|
150
|
+
!! select( editorStore ).getEditorSettings().disableVisualRevisions,
|
|
151
|
+
[]
|
|
152
|
+
);
|
|
153
|
+
if ( disableVisualRevisions ) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
148
156
|
return (
|
|
149
157
|
<PostLastRevisionCheck>
|
|
150
158
|
<PostRevisionsPanelContent />
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
store as blockEditorStore,
|
|
16
16
|
} from '@wordpress/block-editor';
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
|
-
|
|
18
|
+
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
19
|
+
import { Tooltip } from '@wordpress/ui';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Internal dependencies
|
|
@@ -98,17 +99,22 @@ function DiffMarkerButton( { clientId, status, subscribe } ) {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
return (
|
|
101
|
-
<Tooltip
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
<Tooltip.Root>
|
|
103
|
+
<Tooltip.Trigger
|
|
104
|
+
render={
|
|
105
|
+
<button
|
|
106
|
+
className={ `revision-diff-marker is-${ status }` }
|
|
107
|
+
style={ {
|
|
108
|
+
top: `${ position.top }%`,
|
|
109
|
+
height: `${ Math.max( position.height, 0.5 ) }%`,
|
|
110
|
+
} }
|
|
111
|
+
onClick={ () => blockRef.current?.focus() }
|
|
112
|
+
aria-label={ STATUS_LABELS[ status ] }
|
|
113
|
+
/>
|
|
114
|
+
}
|
|
110
115
|
/>
|
|
111
|
-
|
|
116
|
+
<Tooltip.Popup>{ STATUS_LABELS[ status ] }</Tooltip.Popup>
|
|
117
|
+
</Tooltip.Root>
|
|
112
118
|
);
|
|
113
119
|
}
|
|
114
120
|
|
|
@@ -58,14 +58,20 @@ const REVISION_REMOVED_FILTER_SVG = `
|
|
|
58
58
|
const REVISION_DIFF_STYLES = `
|
|
59
59
|
.is-revision-added {
|
|
60
60
|
box-shadow: inset 0 0 0 9999px color-mix(in srgb, currentColor 5%, #00a32a 15%), 0 0 0 4px color-mix(in srgb, currentColor 5%, #00a32a 15%);
|
|
61
|
+
outline: 3px solid #00a32a;
|
|
62
|
+
outline-offset: 2px;
|
|
61
63
|
}
|
|
62
64
|
.is-revision-removed,
|
|
63
65
|
.revision-diff-removed {
|
|
64
66
|
text-decoration: line-through;
|
|
65
67
|
filter: url(#revision-removed-filter);
|
|
66
68
|
}
|
|
69
|
+
.is-revision-removed {
|
|
70
|
+
outline: 3px dashed #d63638;
|
|
71
|
+
outline-offset: 2px;
|
|
72
|
+
}
|
|
67
73
|
.is-revision-modified {
|
|
68
|
-
outline:
|
|
74
|
+
outline: 3px dotted #9a7000 !important;
|
|
69
75
|
outline-offset: 2px;
|
|
70
76
|
}
|
|
71
77
|
.revision-diff-added {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
.revision-diff-markers {
|
|
36
36
|
position: relative;
|
|
37
37
|
flex-shrink: 0;
|
|
38
|
-
width:
|
|
38
|
+
width: max(16px, 1rem);
|
|
39
39
|
background: rgba(0, 0, 0, 0.05);
|
|
40
40
|
|
|
41
41
|
.revision-diff-marker {
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
transition: opacity 0.1s ease;
|
|
49
49
|
|
|
50
50
|
&.is-added {
|
|
51
|
-
background: #
|
|
51
|
+
background: #008a20;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
&.is-removed {
|
|
55
|
-
background: repeating-linear-gradient(45deg, #d63638, #d63638
|
|
55
|
+
background: repeating-linear-gradient(45deg, #d63638, #d63638 6px, rgba(#d63638, 0.45) 6px, rgba(#d63638, 0.45) 8px);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
&.is-modified {
|
|
59
|
-
background: repeating-linear-gradient(-45deg, #
|
|
59
|
+
background: repeating-linear-gradient(-45deg, #9a7000, #9a7000 6px, rgba(#9a7000, 0.45) 6px, rgba(#9a7000, 0.45) 8px);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&:hover {
|
|
@@ -22,8 +22,7 @@ export default function PostTaxonomiesCheck( { children } ) {
|
|
|
22
22
|
const postType = select( editorStore ).getCurrentPostType();
|
|
23
23
|
const taxonomies = select( coreStore ).getEntityRecords(
|
|
24
24
|
'root',
|
|
25
|
-
'taxonomy'
|
|
26
|
-
{ per_page: -1 }
|
|
25
|
+
'taxonomy'
|
|
27
26
|
);
|
|
28
27
|
return taxonomies?.some( ( taxonomy ) =>
|
|
29
28
|
taxonomy.types.includes( postType )
|
|
@@ -20,8 +20,7 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
|
|
|
20
20
|
postType: select( editorStore ).getCurrentPostType(),
|
|
21
21
|
taxonomies: select( coreStore ).getEntityRecords(
|
|
22
22
|
'root',
|
|
23
|
-
'taxonomy'
|
|
24
|
-
{ per_page: -1 }
|
|
23
|
+
'taxonomy'
|
|
25
24
|
),
|
|
26
25
|
};
|
|
27
26
|
}, [] );
|
|
@@ -58,7 +58,7 @@ function PreferencesModalContents( { extraSections = {} } ) {
|
|
|
58
58
|
const { showBlockBreadcrumbsOption, showCollaborationOptions } = useSelect(
|
|
59
59
|
( select ) => {
|
|
60
60
|
const { getEditorSettings, isCollaborationEnabledForCurrentPost } =
|
|
61
|
-
select( editorStore );
|
|
61
|
+
unlock( select( editorStore ) );
|
|
62
62
|
const { get } = select( preferencesStore );
|
|
63
63
|
const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
|
|
64
64
|
const isDistractionFreeEnabled = get( 'core', 'distractionFree' );
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
MenuGroup,
|
|
13
13
|
MenuItem,
|
|
14
14
|
MenuItemsChoice,
|
|
15
|
-
Icon,
|
|
15
|
+
Icon as WCIcon,
|
|
16
16
|
} from '@wordpress/components';
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
18
|
import { desktop, mobile, tablet, external, check } from '@wordpress/icons';
|
|
@@ -189,7 +189,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
189
189
|
textContent={
|
|
190
190
|
<>
|
|
191
191
|
{ __( 'Preview in new tab' ) }
|
|
192
|
-
<
|
|
192
|
+
<WCIcon icon={ external } />
|
|
193
193
|
</>
|
|
194
194
|
}
|
|
195
195
|
onPreview={ onClose }
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useLayoutEffect,
|
|
8
8
|
useMemo,
|
|
9
9
|
} from '@wordpress/element';
|
|
10
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
|
+
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import {
|
|
13
13
|
EntityProvider,
|
|
@@ -28,7 +28,6 @@ import { createBlock } from '@wordpress/blocks';
|
|
|
28
28
|
*/
|
|
29
29
|
import withRegistryProvider from './with-registry-provider';
|
|
30
30
|
import { store as editorStore } from '../../store';
|
|
31
|
-
import { ATTACHMENT_POST_TYPE } from '../../store/constants';
|
|
32
31
|
import useBlockEditorSettings from './use-block-editor-settings';
|
|
33
32
|
import { unlock } from '../../lock-unlock';
|
|
34
33
|
import DisableNonPageContentBlocks from './disable-non-page-content-blocks';
|
|
@@ -311,6 +310,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
311
310
|
setRenderingMode,
|
|
312
311
|
} = unlock( useDispatch( editorStore ) );
|
|
313
312
|
const { editEntityRecord } = useDispatch( coreStore );
|
|
313
|
+
const registry = useRegistry();
|
|
314
314
|
|
|
315
315
|
const onChangeSelection = useCallback(
|
|
316
316
|
( newSelection ) => {
|
|
@@ -335,7 +335,13 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
updatePostLock( settings.postLock );
|
|
338
|
-
setupEditor
|
|
338
|
+
// `setupEditor` may already have been dispatched by the
|
|
339
|
+
// editor's pre-mount kickoff (see edit-post's
|
|
340
|
+
// `initializeEditor`). Skip the redundant dispatch — it
|
|
341
|
+
// would otherwise re-parse + reset blocks for new posts.
|
|
342
|
+
if ( ! registry.select( editorStore ).__unstableIsEditorReady() ) {
|
|
343
|
+
setupEditor( post, initialEdits, settings.template );
|
|
344
|
+
}
|
|
339
345
|
if ( settings.autosave ) {
|
|
340
346
|
createWarningNotice(
|
|
341
347
|
__(
|
|
@@ -401,31 +407,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
401
407
|
return null;
|
|
402
408
|
}
|
|
403
409
|
|
|
404
|
-
const isAttachment =
|
|
405
|
-
post.type === ATTACHMENT_POST_TYPE &&
|
|
406
|
-
window?.__experimentalMediaEditor;
|
|
407
|
-
|
|
408
|
-
// Early return for attachments - no block editor needed
|
|
409
|
-
if ( isAttachment ) {
|
|
410
|
-
return (
|
|
411
|
-
<EntityProvider kind="root" type="site">
|
|
412
|
-
<EntityProvider
|
|
413
|
-
kind="postType"
|
|
414
|
-
type={ post.type }
|
|
415
|
-
id={ post.id }
|
|
416
|
-
>
|
|
417
|
-
{ children }
|
|
418
|
-
{ ! settings.isPreviewMode && (
|
|
419
|
-
<>
|
|
420
|
-
<EditorKeyboardShortcuts />
|
|
421
|
-
<KeyboardShortcutHelpModal />
|
|
422
|
-
</>
|
|
423
|
-
) }
|
|
424
|
-
</EntityProvider>
|
|
425
|
-
</EntityProvider>
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
410
|
return (
|
|
430
411
|
<EntityProvider kind="root" type="site">
|
|
431
412
|
<EntityProvider
|
|
@@ -466,9 +447,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
466
447
|
<StartTemplateOptions />
|
|
467
448
|
<PatternRenameModal />
|
|
468
449
|
<PatternDuplicateModal />
|
|
469
|
-
|
|
470
|
-
<MediaEditorModalMount />
|
|
471
|
-
) }
|
|
450
|
+
<MediaEditorModalMount />
|
|
472
451
|
</>
|
|
473
452
|
) }
|
|
474
453
|
</BlockEditorProviderComponent>
|
|
@@ -27,9 +27,10 @@ import { mediaUpload } from '../../utils';
|
|
|
27
27
|
import mediaUploadOnSuccess from '../../utils/media-upload/on-success';
|
|
28
28
|
import { default as mediaSideload } from '../../utils/media-sideload';
|
|
29
29
|
import { default as mediaFinalize } from '../../utils/media-finalize';
|
|
30
|
+
import { default as mediaDelete } from '../../utils/media-delete';
|
|
30
31
|
import { store as editorStore } from '../../store';
|
|
31
32
|
import { unlock } from '../../lock-unlock';
|
|
32
|
-
import {
|
|
33
|
+
import { useGlobalStyles } from '../global-styles';
|
|
33
34
|
|
|
34
35
|
const { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );
|
|
35
36
|
|
|
@@ -44,6 +45,10 @@ function __experimentalReusableBlocksSelect( select ) {
|
|
|
44
45
|
} );
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
function __experimentalUserPatternCategoriesSelect( select ) {
|
|
49
|
+
return select( coreStore ).getUserPatternCategories();
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
const BLOCK_EDITOR_SETTINGS = [
|
|
48
53
|
'__experimentalBlockBindingsSupportedAttributes',
|
|
49
54
|
'__experimentalBlockDirectory',
|
|
@@ -102,11 +107,13 @@ const {
|
|
|
102
107
|
globalStylesLinksDataKey,
|
|
103
108
|
selectBlockPatternsKey,
|
|
104
109
|
reusableBlocksSelectKey,
|
|
110
|
+
userPatternCategoriesSelectKey,
|
|
105
111
|
sectionRootClientIdKey,
|
|
106
112
|
mediaEditKey,
|
|
107
113
|
getMediaSelectKey,
|
|
108
114
|
isIsolatedEditorKey,
|
|
109
115
|
deviceTypeKey,
|
|
116
|
+
onViewportStateChangeKey,
|
|
110
117
|
isNavigationOverlayContextKey,
|
|
111
118
|
isNavigationPostEditorKey,
|
|
112
119
|
mediaUploadOnSuccessKey,
|
|
@@ -140,7 +147,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
140
147
|
userCanCreatePages,
|
|
141
148
|
pageOnFront,
|
|
142
149
|
pageForPosts,
|
|
143
|
-
userPatternCategories,
|
|
144
150
|
restBlockPatternCategories,
|
|
145
151
|
sectionRootClientId,
|
|
146
152
|
deviceType,
|
|
@@ -152,7 +158,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
152
158
|
canUser,
|
|
153
159
|
getRawEntityRecord,
|
|
154
160
|
getEntityRecord,
|
|
155
|
-
getUserPatternCategories,
|
|
156
161
|
getBlockPatternCategories,
|
|
157
162
|
} = select( coreStore );
|
|
158
163
|
const { get } = select( preferencesStore );
|
|
@@ -215,7 +220,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
215
220
|
} ),
|
|
216
221
|
pageOnFront: siteSettings?.page_on_front,
|
|
217
222
|
pageForPosts: siteSettings?.page_for_posts,
|
|
218
|
-
userPatternCategories: getUserPatternCategories(),
|
|
219
223
|
restBlockPatternCategories: getBlockPatternCategories(),
|
|
220
224
|
sectionRootClientId: getSectionRootBlock(),
|
|
221
225
|
deviceType: getDeviceType(),
|
|
@@ -233,7 +237,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
233
237
|
[ postType, postId, isLargeViewport, renderingMode ]
|
|
234
238
|
);
|
|
235
239
|
|
|
236
|
-
const { merged: mergedGlobalStyles } =
|
|
240
|
+
const { merged: mergedGlobalStyles } = useGlobalStyles();
|
|
237
241
|
const globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;
|
|
238
242
|
const globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;
|
|
239
243
|
|
|
@@ -271,6 +275,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
271
275
|
);
|
|
272
276
|
|
|
273
277
|
const { undo, setIsInserterOpened } = useDispatch( editorStore );
|
|
278
|
+
const { updateDeviceTypeForViewportState } = unlock(
|
|
279
|
+
useDispatch( editorStore )
|
|
280
|
+
);
|
|
274
281
|
const { editMediaEntity } = unlock( useDispatch( coreStore ) );
|
|
275
282
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
276
283
|
const { openMediaEditorModal } = useDispatch( mediaEditorStore );
|
|
@@ -344,16 +351,15 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
344
351
|
[ mediaEditKey ]: hasUploadPermissions
|
|
345
352
|
? editMediaEntity
|
|
346
353
|
: undefined,
|
|
347
|
-
[ openMediaEditorModalKey ]:
|
|
348
|
-
|
|
349
|
-
openMediaEditorModal( { id, onUpdate } )
|
|
350
|
-
: undefined,
|
|
354
|
+
[ openMediaEditorModalKey ]: ( { id, onUpdate } ) =>
|
|
355
|
+
openMediaEditorModal( { id, onUpdate } ),
|
|
351
356
|
mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
|
|
352
357
|
[ mediaUploadOnSuccessKey ]: hasUploadPermissions
|
|
353
358
|
? mediaUploadOnSuccess
|
|
354
359
|
: undefined,
|
|
355
360
|
mediaSideload: hasUploadPermissions ? mediaSideload : undefined,
|
|
356
361
|
mediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,
|
|
362
|
+
mediaDelete: hasUploadPermissions ? mediaDelete : undefined,
|
|
357
363
|
__experimentalBlockPatterns: blockPatterns,
|
|
358
364
|
[ selectBlockPatternsKey ]: ( select ) => {
|
|
359
365
|
const { hasFinishedResolution, getBlockPatternsForPostType } =
|
|
@@ -364,8 +370,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
364
370
|
: undefined;
|
|
365
371
|
},
|
|
366
372
|
[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,
|
|
373
|
+
[ userPatternCategoriesSelectKey ]:
|
|
374
|
+
__experimentalUserPatternCategoriesSelect,
|
|
367
375
|
__experimentalBlockPatternCategories: blockPatternCategories,
|
|
368
|
-
__experimentalUserPatternCategories: userPatternCategories,
|
|
369
376
|
__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>
|
|
370
377
|
fetchLinkSuggestions( search, searchOptions, settings ),
|
|
371
378
|
inserterMediaCategories,
|
|
@@ -409,6 +416,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
409
416
|
disableContentOnlyForTemplateParts:
|
|
410
417
|
renderingMode === 'template-locked',
|
|
411
418
|
...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),
|
|
419
|
+
[ onViewportStateChangeKey ]: updateDeviceTypeForViewportState,
|
|
412
420
|
[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,
|
|
413
421
|
};
|
|
414
422
|
|
|
@@ -428,7 +436,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
428
436
|
keepCaretInsideBlock,
|
|
429
437
|
settings,
|
|
430
438
|
hasUploadPermissions,
|
|
431
|
-
userPatternCategories,
|
|
432
439
|
blockPatterns,
|
|
433
440
|
blockPatternCategories,
|
|
434
441
|
canUseUnfilteredHTML,
|
|
@@ -445,7 +452,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
445
452
|
renderingMode,
|
|
446
453
|
editMediaEntity,
|
|
447
454
|
openMediaEditorModal,
|
|
448
|
-
|
|
455
|
+
updateDeviceTypeForViewportState,
|
|
449
456
|
deviceType,
|
|
450
457
|
allImageSizes,
|
|
451
458
|
bigImageSizeThreshold,
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { LEFT, RIGHT } from '@wordpress/keycodes';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { __unstableMotion as motion } from '@wordpress/components';
|
|
7
|
+
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
8
|
+
import { Tooltip, VisuallyHidden } from '@wordpress/ui';
|
|
8
9
|
|
|
9
10
|
const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.
|
|
10
11
|
|
|
@@ -41,21 +42,26 @@ export default function ResizeHandle( { direction, resizeWidthBy } ) {
|
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
44
|
<>
|
|
44
|
-
<Tooltip
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
<Tooltip.Root>
|
|
46
|
+
<Tooltip.Trigger
|
|
47
|
+
render={
|
|
48
|
+
<motion.button
|
|
49
|
+
className={ `editor-resizable-editor__resize-handle is-${ direction }` }
|
|
50
|
+
aria-label={ __( 'Drag to resize' ) }
|
|
51
|
+
aria-describedby={ resizableHandleHelpId }
|
|
52
|
+
onKeyDown={ handleKeyDown }
|
|
53
|
+
variants={ resizeHandleVariants }
|
|
54
|
+
whileFocus="active"
|
|
55
|
+
whileHover="active"
|
|
56
|
+
whileTap="active"
|
|
57
|
+
key="handle"
|
|
58
|
+
role="separator"
|
|
59
|
+
aria-orientation="vertical"
|
|
60
|
+
/>
|
|
61
|
+
}
|
|
57
62
|
/>
|
|
58
|
-
|
|
63
|
+
<Tooltip.Popup>{ __( 'Drag to resize' ) }</Tooltip.Popup>
|
|
64
|
+
</Tooltip.Root>
|
|
59
65
|
<VisuallyHidden id={ resizableHandleHelpId }>
|
|
60
66
|
{ __( 'Use left and right arrow keys to resize the canvas.' ) }
|
|
61
67
|
</VisuallyHidden>
|
|
@@ -11,30 +11,22 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import { store as editorStore } from '../../store';
|
|
14
|
-
import { ATTACHMENT_POST_TYPE } from '../../store/constants';
|
|
15
14
|
import { unlock } from '../../lock-unlock';
|
|
16
15
|
import { sidebars } from './constants';
|
|
17
16
|
|
|
18
17
|
const { Tabs } = unlock( componentsPrivateApis );
|
|
19
18
|
|
|
20
19
|
const SidebarHeader = ( _, ref ) => {
|
|
21
|
-
const { postTypeLabel,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
getCurrentPostType() === ATTACHMENT_POST_TYPE &&
|
|
32
|
-
window?.__experimentalMediaEditor,
|
|
33
|
-
isRevisionsMode: _isRevisionsMode(),
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
[]
|
|
37
|
-
);
|
|
20
|
+
const { postTypeLabel, isRevisionsMode } = useSelect( ( select ) => {
|
|
21
|
+
const { getPostTypeLabel } = select( editorStore );
|
|
22
|
+
const { isRevisionsMode: _isRevisionsMode } = unlock(
|
|
23
|
+
select( editorStore )
|
|
24
|
+
);
|
|
25
|
+
return {
|
|
26
|
+
postTypeLabel: getPostTypeLabel(),
|
|
27
|
+
isRevisionsMode: _isRevisionsMode(),
|
|
28
|
+
};
|
|
29
|
+
}, [] );
|
|
38
30
|
|
|
39
31
|
let documentLabel;
|
|
40
32
|
if ( isRevisionsMode ) {
|
|
@@ -55,16 +47,14 @@ const SidebarHeader = ( _, ref ) => {
|
|
|
55
47
|
>
|
|
56
48
|
{ documentLabel }
|
|
57
49
|
</Tabs.Tab>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</Tabs.Tab>
|
|
67
|
-
) }
|
|
50
|
+
<Tabs.Tab
|
|
51
|
+
tabId={ sidebars.block }
|
|
52
|
+
// Used for focus management in the SettingsSidebar component.
|
|
53
|
+
data-tab-id={ sidebars.block }
|
|
54
|
+
>
|
|
55
|
+
{ /* translators: Text label for the Block Settings Sidebar tab. */ }
|
|
56
|
+
{ __( 'Block' ) }
|
|
57
|
+
</Tabs.Tab>
|
|
68
58
|
</Tabs.TabList>
|
|
69
59
|
);
|
|
70
60
|
};
|
|
@@ -33,7 +33,6 @@ import SidebarHeader from './header';
|
|
|
33
33
|
import TemplateActionsPanel from '../template-actions-panel';
|
|
34
34
|
import TemplateContentPanel from '../template-content-panel';
|
|
35
35
|
import TemplatePartContentPanel from '../template-part-content-panel';
|
|
36
|
-
import { MediaMetadataPanel } from '../media';
|
|
37
36
|
import PostRevisionsPanel from '../post-revisions-panel';
|
|
38
37
|
import RevisionBlockDiffPanel from '../revision-block-diff';
|
|
39
38
|
import useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';
|
|
@@ -41,7 +40,6 @@ import { sidebars } from './constants';
|
|
|
41
40
|
import { unlock } from '../../lock-unlock';
|
|
42
41
|
import { store as editorStore } from '../../store';
|
|
43
42
|
import {
|
|
44
|
-
ATTACHMENT_POST_TYPE,
|
|
45
43
|
NAVIGATION_POST_TYPE,
|
|
46
44
|
TEMPLATE_PART_POST_TYPE,
|
|
47
45
|
TEMPLATE_POST_TYPE,
|
|
@@ -66,7 +64,6 @@ const SidebarContent = ( {
|
|
|
66
64
|
// need to forward the `Tabs` context so it can be passed through the
|
|
67
65
|
// underlying slot/fill.
|
|
68
66
|
const tabsContextValue = useContext( Tabs.Context );
|
|
69
|
-
const isAttachment = postType === ATTACHMENT_POST_TYPE;
|
|
70
67
|
const isRevisionsMode = useSelect( ( select ) => {
|
|
71
68
|
return unlock( select( editorStore ) ).isRevisionsMode();
|
|
72
69
|
} );
|
|
@@ -99,11 +96,7 @@ const SidebarContent = ( {
|
|
|
99
96
|
}, [ tabName ] );
|
|
100
97
|
|
|
101
98
|
let tabContent;
|
|
102
|
-
if (
|
|
103
|
-
tabContent = (
|
|
104
|
-
<MediaMetadataPanel onActionPerformed={ onActionPerformed } />
|
|
105
|
-
);
|
|
106
|
-
} else if ( isRevisionsMode ) {
|
|
99
|
+
if ( isRevisionsMode ) {
|
|
107
100
|
tabContent = <PostRevisionSummary />;
|
|
108
101
|
} else {
|
|
109
102
|
tabContent = (
|
|
@@ -159,12 +152,10 @@ const SidebarContent = ( {
|
|
|
159
152
|
<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
|
|
160
153
|
{ tabContent }
|
|
161
154
|
</Tabs.TabPanel>
|
|
162
|
-
{
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
</Tabs.TabPanel>
|
|
167
|
-
) }
|
|
155
|
+
<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
|
|
156
|
+
<BlockInspector />
|
|
157
|
+
{ isRevisionsMode && <RevisionBlockDiffPanel /> }
|
|
158
|
+
</Tabs.TabPanel>
|
|
168
159
|
</Tabs.Context.Provider>
|
|
169
160
|
</PluginSidebar>
|
|
170
161
|
);
|