@wordpress/editor 14.7.0 → 14.7.1-next.1f6eadc42.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/README.md +4 -0
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/block-manager/index.js +2 -4
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/editor/index.js +2 -2
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -4
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -4
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +3 -4
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +6 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +2 -5
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +2 -5
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-featured-image/index.js +6 -12
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +2 -4
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +2 -4
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +4 -8
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +2 -4
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +153 -36
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +79 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -0
- package/build/components/post-trash/check.js +2 -1
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +22 -8
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +28 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +5 -57
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +34 -8
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +9 -4
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/post-summary.js +3 -0
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/start-page-options/index.js +16 -19
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +2 -4
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/table-of-contents/index.js +2 -4
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/text-editor/index.js +2 -4
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +38 -0
- package/build/components/zoom-out-toggle/index.js.map +1 -0
- package/build/dataviews/actions/reset-post.js +4 -8
- package/build/dataviews/actions/reset-post.js.map +1 -1
- package/build/dataviews/actions/trash-post.js +4 -8
- package/build/dataviews/actions/trash-post.js.map +1 -1
- package/build/dataviews/store/private-actions.js +4 -10
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +7 -3
- package/build/store/selectors.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/block-manager/index.js +2 -4
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -4
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -4
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +3 -4
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -5
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +2 -5
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +6 -12
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -4
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +2 -4
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +4 -8
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +2 -4
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -4
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +152 -35
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +72 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -0
- package/build-module/components/post-trash/check.js +2 -1
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +23 -11
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +28 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +5 -57
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +35 -9
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +9 -4
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +3 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/start-page-options/index.js +17 -21
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +2 -4
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +2 -4
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +2 -4
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +31 -0
- package/build-module/components/zoom-out-toggle/index.js.map +1 -0
- package/build-module/dataviews/actions/reset-post.js +4 -8
- package/build-module/dataviews/actions/reset-post.js.map +1 -1
- package/build-module/dataviews/actions/trash-post.js +4 -8
- package/build-module/dataviews/actions/trash-post.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +2 -8
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +6 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +3 -7
- package/build-style/style.css +3 -7
- package/build-types/components/editor-history/redo.d.ts.map +1 -1
- package/build-types/components/editor-history/undo.d.ts.map +1 -1
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
- package/build-types/components/post-format/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.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/media-util.d.ts +20 -0
- package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -0
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-trash/index.d.ts +4 -1
- package/build-types/components/post-trash/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/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/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts +1 -0
- 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/text-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
- package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
- package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +8 -8
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +37 -36
- package/src/bindings/post-meta.js +1 -1
- package/src/components/block-manager/index.js +1 -2
- package/src/components/editor/index.js +1 -1
- package/src/components/editor-history/redo.js +1 -2
- package/src/components/editor-history/undo.js +1 -2
- package/src/components/error-boundary/index.js +1 -6
- package/src/components/global-styles-provider/index.js +11 -7
- package/src/components/header/index.js +12 -3
- package/src/components/header/style.scss +1 -1
- package/src/components/inserter-sidebar/index.js +2 -5
- package/src/components/post-excerpt/panel.js +1 -3
- package/src/components/post-featured-image/index.js +3 -6
- package/src/components/post-featured-image/style.scss +1 -5
- package/src/components/post-format/index.js +1 -2
- package/src/components/post-last-revision/index.js +1 -2
- package/src/components/post-locked-modal/index.js +2 -4
- package/src/components/post-publish-panel/index.js +1 -2
- package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -2
- package/src/components/post-publish-panel/maybe-upload-media.js +150 -50
- package/src/components/post-publish-panel/media-util.js +87 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-publish-panel/test/media-util.js +118 -0
- package/src/components/post-trash/check.js +5 -2
- package/src/components/post-trash/index.js +23 -12
- package/src/components/preferences-modal/index.js +227 -172
- package/src/components/preview-dropdown/index.js +26 -84
- package/src/components/provider/index.js +42 -10
- package/src/components/provider/use-block-editor-settings.js +11 -6
- package/src/components/sidebar/post-summary.js +4 -0
- package/src/components/start-page-options/index.js +28 -26
- package/src/components/start-template-options/index.js +1 -2
- package/src/components/table-of-contents/index.js +1 -2
- package/src/components/text-editor/index.js +1 -2
- package/src/components/text-editor/style.scss +1 -1
- package/src/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/src/components/zoom-out-toggle/index.js +34 -0
- package/src/dataviews/actions/reset-post.tsx +2 -4
- package/src/dataviews/actions/trash-post.tsx +2 -4
- package/src/dataviews/store/private-actions.ts +10 -8
- package/src/store/selectors.js +9 -3
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/duplicate-pattern.js +0 -48
- package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.js +0 -146
- package/build/dataviews/actions/duplicate-post.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.native.js +0 -9
- package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build/dataviews/actions/export-pattern.js +0 -57
- package/build/dataviews/actions/export-pattern.js.map +0 -1
- package/build/dataviews/actions/export-pattern.native.js +0 -9
- package/build/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build/dataviews/actions/permanently-delete-post.js +0 -109
- package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build/dataviews/actions/reorder-page.js +0 -116
- package/build/dataviews/actions/reorder-page.js.map +0 -1
- package/build/dataviews/actions/reorder-page.native.js +0 -9
- package/build/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build/dataviews/actions/view-post-revisions.js +0 -49
- package/build/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build/dataviews/actions/view-post.js +0 -36
- package/build/dataviews/actions/view-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
- package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.js +0 -139
- package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
- package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.js +0 -51
- package/build-module/dataviews/actions/export-pattern.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.native.js +0 -3
- package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build-module/dataviews/actions/permanently-delete-post.js +0 -102
- package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.js +0 -111
- package/build-module/dataviews/actions/reorder-page.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.native.js +0 -3
- package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build-module/dataviews/actions/view-post-revisions.js +0 -43
- package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build-module/dataviews/actions/view-post.js +0 -30
- package/build-module/dataviews/actions/view-post.js.map +0 -1
- package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
- package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
- package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
- package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
- package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
- package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
- package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
- package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post.d.ts +0 -8
- package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
- package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
- package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
- package/src/dataviews/actions/duplicate-post.tsx +0 -174
- package/src/dataviews/actions/export-pattern.native.tsx +0 -3
- package/src/dataviews/actions/export-pattern.tsx +0 -76
- package/src/dataviews/actions/permanently-delete-post.tsx +0 -118
- package/src/dataviews/actions/reorder-page.native.tsx +0 -3
- package/src/dataviews/actions/reorder-page.tsx +0 -125
- package/src/dataviews/actions/view-post-revisions.tsx +0 -47
- package/src/dataviews/actions/view-post.tsx +0 -30
|
@@ -26,6 +26,7 @@ import PageAttributesCheck from '../page-attributes/check';
|
|
|
26
26
|
import PostTypeSupportCheck from '../post-type-support-check';
|
|
27
27
|
import { store as editorStore } from '../../store';
|
|
28
28
|
import { unlock } from '../../lock-unlock';
|
|
29
|
+
import { useStartPatterns } from '../start-page-options';
|
|
29
30
|
|
|
30
31
|
const {
|
|
31
32
|
PreferencesModal,
|
|
@@ -57,214 +58,267 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
57
58
|
const { setIsListViewOpened, setIsInserterOpened } =
|
|
58
59
|
useDispatch( editorStore );
|
|
59
60
|
const { set: setPreference } = useDispatch( preferencesStore );
|
|
61
|
+
const hasStarterPatterns = !! useStartPatterns().length;
|
|
60
62
|
|
|
61
63
|
const sections = useMemo(
|
|
62
|
-
() =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
help={ __(
|
|
73
|
-
'Opens the List View sidebar by default.'
|
|
74
|
-
) }
|
|
75
|
-
label={ __( 'Always open List View' ) }
|
|
76
|
-
/>
|
|
77
|
-
{ showBlockBreadcrumbsOption && (
|
|
64
|
+
() =>
|
|
65
|
+
[
|
|
66
|
+
{
|
|
67
|
+
name: 'general',
|
|
68
|
+
tabLabel: __( 'General' ),
|
|
69
|
+
content: (
|
|
70
|
+
<>
|
|
71
|
+
<PreferencesModalSection
|
|
72
|
+
title={ __( 'Interface' ) }
|
|
73
|
+
>
|
|
78
74
|
<PreferenceToggleControl
|
|
79
75
|
scope="core"
|
|
80
|
-
featureName="
|
|
76
|
+
featureName="showListViewByDefault"
|
|
81
77
|
help={ __(
|
|
82
|
-
'
|
|
78
|
+
'Opens the List View sidebar by default.'
|
|
83
79
|
) }
|
|
84
|
-
label={ __( '
|
|
80
|
+
label={ __( 'Always open List View' ) }
|
|
85
81
|
/>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'Allow right-click contextual menus'
|
|
95
|
-
) }
|
|
96
|
-
/>
|
|
97
|
-
</PreferencesModalSection>
|
|
98
|
-
<PreferencesModalSection
|
|
99
|
-
title={ __( 'Document settings' ) }
|
|
100
|
-
description={ __(
|
|
101
|
-
'Select what settings are shown in the document panel.'
|
|
102
|
-
) }
|
|
103
|
-
>
|
|
104
|
-
<EnablePluginDocumentSettingPanelOption.Slot />
|
|
105
|
-
<PostTaxonomies
|
|
106
|
-
taxonomyWrapper={ ( content, taxonomy ) => (
|
|
107
|
-
<EnablePanelOption
|
|
108
|
-
label={ taxonomy.labels.menu_name }
|
|
109
|
-
panelName={ `taxonomy-panel-${ taxonomy.slug }` }
|
|
82
|
+
{ showBlockBreadcrumbsOption && (
|
|
83
|
+
<PreferenceToggleControl
|
|
84
|
+
scope="core"
|
|
85
|
+
featureName="showBlockBreadcrumbs"
|
|
86
|
+
help={ __(
|
|
87
|
+
'Display the block hierarchy trail at the bottom of the editor.'
|
|
88
|
+
) }
|
|
89
|
+
label={ __( 'Show block breadcrumbs' ) }
|
|
110
90
|
/>
|
|
111
91
|
) }
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
label={ __( 'Excerpt' ) }
|
|
122
|
-
panelName="post-excerpt"
|
|
123
|
-
/>
|
|
124
|
-
</PostExcerptCheck>
|
|
125
|
-
<PostTypeSupportCheck
|
|
126
|
-
supportKeys={ [ 'comments', 'trackbacks' ] }
|
|
127
|
-
>
|
|
128
|
-
<EnablePanelOption
|
|
129
|
-
label={ __( 'Discussion' ) }
|
|
130
|
-
panelName="discussion-panel"
|
|
131
|
-
/>
|
|
132
|
-
</PostTypeSupportCheck>
|
|
133
|
-
<PageAttributesCheck>
|
|
134
|
-
<EnablePanelOption
|
|
135
|
-
label={ __( 'Page attributes' ) }
|
|
136
|
-
panelName="page-attributes"
|
|
92
|
+
<PreferenceToggleControl
|
|
93
|
+
scope="core"
|
|
94
|
+
featureName="allowRightClickOverrides"
|
|
95
|
+
help={ __(
|
|
96
|
+
'Allows contextual List View menus via right-click, overriding browser defaults.'
|
|
97
|
+
) }
|
|
98
|
+
label={ __(
|
|
99
|
+
'Allow right-click contextual menus'
|
|
100
|
+
) }
|
|
137
101
|
/>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
102
|
+
{ hasStarterPatterns && (
|
|
103
|
+
<PreferenceToggleControl
|
|
104
|
+
scope="core"
|
|
105
|
+
featureName="enableChoosePatternModal"
|
|
106
|
+
help={ __(
|
|
107
|
+
'Shows starter patterns when creating a new page.'
|
|
108
|
+
) }
|
|
109
|
+
label={ __( 'Show starter patterns' ) }
|
|
110
|
+
/>
|
|
111
|
+
) }
|
|
112
|
+
</PreferencesModalSection>
|
|
141
113
|
<PreferencesModalSection
|
|
142
|
-
title={ __( '
|
|
114
|
+
title={ __( 'Document settings' ) }
|
|
115
|
+
description={ __(
|
|
116
|
+
'Select what settings are shown in the document panel.'
|
|
117
|
+
) }
|
|
143
118
|
>
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
119
|
+
<EnablePluginDocumentSettingPanelOption.Slot />
|
|
120
|
+
<PostTaxonomies
|
|
121
|
+
taxonomyWrapper={ ( content, taxonomy ) => (
|
|
122
|
+
<EnablePanelOption
|
|
123
|
+
label={ taxonomy.labels.menu_name }
|
|
124
|
+
panelName={ `taxonomy-panel-${ taxonomy.slug }` }
|
|
125
|
+
/>
|
|
147
126
|
) }
|
|
148
|
-
label={ __( 'Enable pre-publish checks' ) }
|
|
149
127
|
/>
|
|
128
|
+
<PostFeaturedImageCheck>
|
|
129
|
+
<EnablePanelOption
|
|
130
|
+
label={ __( 'Featured image' ) }
|
|
131
|
+
panelName="featured-image"
|
|
132
|
+
/>
|
|
133
|
+
</PostFeaturedImageCheck>
|
|
134
|
+
<PostExcerptCheck>
|
|
135
|
+
<EnablePanelOption
|
|
136
|
+
label={ __( 'Excerpt' ) }
|
|
137
|
+
panelName="post-excerpt"
|
|
138
|
+
/>
|
|
139
|
+
</PostExcerptCheck>
|
|
140
|
+
<PostTypeSupportCheck
|
|
141
|
+
supportKeys={ [ 'comments', 'trackbacks' ] }
|
|
142
|
+
>
|
|
143
|
+
<EnablePanelOption
|
|
144
|
+
label={ __( 'Discussion' ) }
|
|
145
|
+
panelName="discussion-panel"
|
|
146
|
+
/>
|
|
147
|
+
</PostTypeSupportCheck>
|
|
148
|
+
<PageAttributesCheck>
|
|
149
|
+
<EnablePanelOption
|
|
150
|
+
label={ __( 'Page attributes' ) }
|
|
151
|
+
panelName="page-attributes"
|
|
152
|
+
/>
|
|
153
|
+
</PageAttributesCheck>
|
|
150
154
|
</PreferencesModalSection>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
) }
|
|
165
|
-
>
|
|
166
|
-
<PreferenceToggleControl
|
|
167
|
-
scope="core"
|
|
168
|
-
featureName="fixedToolbar"
|
|
169
|
-
onToggle={ () =>
|
|
170
|
-
setPreference(
|
|
171
|
-
'core',
|
|
172
|
-
'distractionFree',
|
|
173
|
-
false
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
help={ __(
|
|
177
|
-
'Access all block and document tools in a single place.'
|
|
178
|
-
) }
|
|
179
|
-
label={ __( 'Top toolbar' ) }
|
|
180
|
-
/>
|
|
181
|
-
<PreferenceToggleControl
|
|
182
|
-
scope="core"
|
|
183
|
-
featureName="distractionFree"
|
|
184
|
-
onToggle={ () => {
|
|
185
|
-
setPreference( 'core', 'fixedToolbar', true );
|
|
186
|
-
setIsInserterOpened( false );
|
|
187
|
-
setIsListViewOpened( false );
|
|
188
|
-
} }
|
|
189
|
-
help={ __(
|
|
190
|
-
'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'
|
|
191
|
-
) }
|
|
192
|
-
label={ __( 'Distraction free' ) }
|
|
193
|
-
/>
|
|
194
|
-
<PreferenceToggleControl
|
|
195
|
-
scope="core"
|
|
196
|
-
featureName="focusMode"
|
|
197
|
-
help={ __(
|
|
198
|
-
'Highlights the current block and fades other content.'
|
|
155
|
+
{ isLargeViewport && (
|
|
156
|
+
<PreferencesModalSection
|
|
157
|
+
title={ __( 'Publishing' ) }
|
|
158
|
+
>
|
|
159
|
+
<EnablePublishSidebarOption
|
|
160
|
+
help={ __(
|
|
161
|
+
'Review settings, such as visibility and tags.'
|
|
162
|
+
) }
|
|
163
|
+
label={ __(
|
|
164
|
+
'Enable pre-publish checks'
|
|
165
|
+
) }
|
|
166
|
+
/>
|
|
167
|
+
</PreferencesModalSection>
|
|
199
168
|
) }
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
tabLabel: __( 'Accessibility' ),
|
|
209
|
-
content: (
|
|
210
|
-
<>
|
|
169
|
+
{ extraSections?.general }
|
|
170
|
+
</>
|
|
171
|
+
),
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'appearance',
|
|
175
|
+
tabLabel: __( 'Appearance' ),
|
|
176
|
+
content: (
|
|
211
177
|
<PreferencesModalSection
|
|
212
|
-
title={ __( '
|
|
178
|
+
title={ __( 'Appearance' ) }
|
|
213
179
|
description={ __(
|
|
214
|
-
'
|
|
180
|
+
'Customize the editor interface to suit your needs.'
|
|
215
181
|
) }
|
|
216
182
|
>
|
|
217
183
|
<PreferenceToggleControl
|
|
218
184
|
scope="core"
|
|
219
|
-
featureName="
|
|
185
|
+
featureName="fixedToolbar"
|
|
186
|
+
onToggle={ () =>
|
|
187
|
+
setPreference(
|
|
188
|
+
'core',
|
|
189
|
+
'distractionFree',
|
|
190
|
+
false
|
|
191
|
+
)
|
|
192
|
+
}
|
|
220
193
|
help={ __(
|
|
221
|
-
'
|
|
222
|
-
) }
|
|
223
|
-
label={ __(
|
|
224
|
-
'Contain text cursor inside block'
|
|
194
|
+
'Access all block and document tools in a single place.'
|
|
225
195
|
) }
|
|
196
|
+
label={ __( 'Top toolbar' ) }
|
|
226
197
|
/>
|
|
227
|
-
</PreferencesModalSection>
|
|
228
|
-
<PreferencesModalSection title={ __( 'Interface' ) }>
|
|
229
198
|
<PreferenceToggleControl
|
|
230
199
|
scope="core"
|
|
231
|
-
featureName="
|
|
232
|
-
|
|
200
|
+
featureName="distractionFree"
|
|
201
|
+
onToggle={ () => {
|
|
202
|
+
setPreference(
|
|
203
|
+
'core',
|
|
204
|
+
'fixedToolbar',
|
|
205
|
+
true
|
|
206
|
+
);
|
|
207
|
+
setIsInserterOpened( false );
|
|
208
|
+
setIsListViewOpened( false );
|
|
209
|
+
} }
|
|
233
210
|
help={ __(
|
|
234
|
-
'
|
|
211
|
+
'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'
|
|
235
212
|
) }
|
|
213
|
+
label={ __( 'Distraction free' ) }
|
|
236
214
|
/>
|
|
237
|
-
</PreferencesModalSection>
|
|
238
|
-
</>
|
|
239
|
-
),
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
name: 'blocks',
|
|
243
|
-
tabLabel: __( 'Blocks' ),
|
|
244
|
-
content: (
|
|
245
|
-
<>
|
|
246
|
-
<PreferencesModalSection title={ __( 'Inserter' ) }>
|
|
247
215
|
<PreferenceToggleControl
|
|
248
216
|
scope="core"
|
|
249
|
-
featureName="
|
|
217
|
+
featureName="focusMode"
|
|
250
218
|
help={ __(
|
|
251
|
-
'
|
|
219
|
+
'Highlights the current block and fades other content.'
|
|
252
220
|
) }
|
|
253
|
-
label={ __( '
|
|
221
|
+
label={ __( 'Spotlight mode' ) }
|
|
254
222
|
/>
|
|
223
|
+
{ extraSections?.appearance }
|
|
255
224
|
</PreferencesModalSection>
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
225
|
+
),
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: 'accessibility',
|
|
229
|
+
tabLabel: __( 'Accessibility' ),
|
|
230
|
+
content: (
|
|
231
|
+
<>
|
|
232
|
+
<PreferencesModalSection
|
|
233
|
+
title={ __( 'Navigation' ) }
|
|
234
|
+
description={ __(
|
|
235
|
+
'Optimize the editing experience for enhanced control.'
|
|
236
|
+
) }
|
|
237
|
+
>
|
|
238
|
+
<PreferenceToggleControl
|
|
239
|
+
scope="core"
|
|
240
|
+
featureName="keepCaretInsideBlock"
|
|
241
|
+
help={ __(
|
|
242
|
+
'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'
|
|
243
|
+
) }
|
|
244
|
+
label={ __(
|
|
245
|
+
'Contain text cursor inside block'
|
|
246
|
+
) }
|
|
247
|
+
/>
|
|
248
|
+
</PreferencesModalSection>
|
|
249
|
+
<PreferencesModalSection
|
|
250
|
+
title={ __( 'Interface' ) }
|
|
251
|
+
>
|
|
252
|
+
<PreferenceToggleControl
|
|
253
|
+
scope="core"
|
|
254
|
+
featureName="showIconLabels"
|
|
255
|
+
label={ __( 'Show button text labels' ) }
|
|
256
|
+
help={ __(
|
|
257
|
+
'Show text instead of icons on buttons across the interface.'
|
|
258
|
+
) }
|
|
259
|
+
/>
|
|
260
|
+
</PreferencesModalSection>
|
|
261
|
+
</>
|
|
262
|
+
),
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: 'blocks',
|
|
266
|
+
tabLabel: __( 'Blocks' ),
|
|
267
|
+
content: (
|
|
268
|
+
<>
|
|
269
|
+
<PreferencesModalSection title={ __( 'Inserter' ) }>
|
|
270
|
+
<PreferenceToggleControl
|
|
271
|
+
scope="core"
|
|
272
|
+
featureName="mostUsedBlocks"
|
|
273
|
+
help={ __(
|
|
274
|
+
'Adds a category with the most frequently used blocks in the inserter.'
|
|
275
|
+
) }
|
|
276
|
+
label={ __( 'Show most used blocks' ) }
|
|
277
|
+
/>
|
|
278
|
+
</PreferencesModalSection>
|
|
279
|
+
<PreferencesModalSection
|
|
280
|
+
title={ __( 'Manage block visibility' ) }
|
|
281
|
+
description={ __(
|
|
282
|
+
"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
|
|
283
|
+
) }
|
|
284
|
+
>
|
|
285
|
+
<BlockManager />
|
|
286
|
+
</PreferencesModalSection>
|
|
287
|
+
</>
|
|
288
|
+
),
|
|
289
|
+
},
|
|
290
|
+
window.__experimentalMediaProcessing && {
|
|
291
|
+
name: 'media',
|
|
292
|
+
tabLabel: __( 'Media' ),
|
|
293
|
+
content: (
|
|
294
|
+
<>
|
|
295
|
+
<PreferencesModalSection
|
|
296
|
+
title={ __( 'General' ) }
|
|
297
|
+
description={ __(
|
|
298
|
+
'Customize options related to the media upload flow.'
|
|
299
|
+
) }
|
|
300
|
+
>
|
|
301
|
+
<PreferenceToggleControl
|
|
302
|
+
scope="core/media"
|
|
303
|
+
featureName="optimizeOnUpload"
|
|
304
|
+
help={ __(
|
|
305
|
+
'Compress media items before uploading to the server.'
|
|
306
|
+
) }
|
|
307
|
+
label={ __( 'Pre-upload compression' ) }
|
|
308
|
+
/>
|
|
309
|
+
<PreferenceToggleControl
|
|
310
|
+
scope="core/media"
|
|
311
|
+
featureName="requireApproval"
|
|
312
|
+
help={ __(
|
|
313
|
+
'Require approval step when optimizing existing media.'
|
|
314
|
+
) }
|
|
315
|
+
label={ __( 'Approval step' ) }
|
|
316
|
+
/>
|
|
317
|
+
</PreferencesModalSection>
|
|
318
|
+
</>
|
|
319
|
+
),
|
|
320
|
+
},
|
|
321
|
+
].filter( Boolean ),
|
|
268
322
|
[
|
|
269
323
|
showBlockBreadcrumbsOption,
|
|
270
324
|
extraSections,
|
|
@@ -272,6 +326,7 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
272
326
|
setIsListViewOpened,
|
|
273
327
|
setPreference,
|
|
274
328
|
isLargeViewport,
|
|
329
|
+
hasStarterPatterns,
|
|
275
330
|
]
|
|
276
331
|
);
|
|
277
332
|
|
|
@@ -19,9 +19,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
19
|
import { desktop, mobile, tablet, external } from '@wordpress/icons';
|
|
20
20
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
21
21
|
import { store as coreStore } from '@wordpress/core-data';
|
|
22
|
-
import { useEffect, useRef } from '@wordpress/element';
|
|
23
22
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
25
23
|
import { ActionItem } from '@wordpress/interface';
|
|
26
24
|
|
|
27
25
|
/**
|
|
@@ -31,49 +29,21 @@ import { store as editorStore } from '../../store';
|
|
|
31
29
|
import PostPreviewButton from '../post-preview-button';
|
|
32
30
|
|
|
33
31
|
export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
34
|
-
const {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
deviceType: getDeviceType(),
|
|
49
|
-
editorMode: __unstableGetEditorMode(),
|
|
50
|
-
homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
|
|
51
|
-
isTemplate: _currentPostType === 'wp_template',
|
|
52
|
-
isViewable: getPostType( _currentPostType )?.viewable ?? false,
|
|
53
|
-
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
54
|
-
};
|
|
55
|
-
}, [] );
|
|
32
|
+
const { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =
|
|
33
|
+
useSelect( ( select ) => {
|
|
34
|
+
const { getDeviceType, getCurrentPostType } = select( editorStore );
|
|
35
|
+
const { getEntityRecord, getPostType } = select( coreStore );
|
|
36
|
+
const { get } = select( preferencesStore );
|
|
37
|
+
const _currentPostType = getCurrentPostType();
|
|
38
|
+
return {
|
|
39
|
+
deviceType: getDeviceType(),
|
|
40
|
+
homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
|
|
41
|
+
isTemplate: _currentPostType === 'wp_template',
|
|
42
|
+
isViewable: getPostType( _currentPostType )?.viewable ?? false,
|
|
43
|
+
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
44
|
+
};
|
|
45
|
+
}, [] );
|
|
56
46
|
const { setDeviceType } = useDispatch( editorStore );
|
|
57
|
-
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Save the original editing mode in a ref to restore it when we exit zoom out.
|
|
61
|
-
*/
|
|
62
|
-
const originalEditingModeRef = useRef( editorMode );
|
|
63
|
-
useEffect( () => {
|
|
64
|
-
if ( editorMode !== 'zoom-out' ) {
|
|
65
|
-
originalEditingModeRef.current = editorMode;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return () => {
|
|
69
|
-
if (
|
|
70
|
-
editorMode === 'zoom-out' &&
|
|
71
|
-
editorMode !== originalEditingModeRef.current
|
|
72
|
-
) {
|
|
73
|
-
__unstableSetEditorMode( originalEditingModeRef.current );
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}, [ editorMode, __unstableSetEditorMode ] );
|
|
77
47
|
|
|
78
48
|
const isMobile = useViewportMatch( 'medium', '<' );
|
|
79
49
|
if ( isMobile ) {
|
|
@@ -112,44 +82,17 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
112
82
|
label: __( 'Desktop' ),
|
|
113
83
|
icon: desktop,
|
|
114
84
|
},
|
|
85
|
+
{
|
|
86
|
+
value: 'Tablet',
|
|
87
|
+
label: __( 'Tablet' ),
|
|
88
|
+
icon: tablet,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: 'Mobile',
|
|
92
|
+
label: __( 'Mobile' ),
|
|
93
|
+
icon: mobile,
|
|
94
|
+
},
|
|
115
95
|
];
|
|
116
|
-
if ( window.__experimentalEnableZoomOutExperiment ) {
|
|
117
|
-
choices.push( {
|
|
118
|
-
value: 'ZoomOut',
|
|
119
|
-
label: __( 'Desktop (50%)' ),
|
|
120
|
-
icon: desktop,
|
|
121
|
-
} );
|
|
122
|
-
}
|
|
123
|
-
choices.push( {
|
|
124
|
-
value: 'Tablet',
|
|
125
|
-
label: __( 'Tablet' ),
|
|
126
|
-
icon: tablet,
|
|
127
|
-
} );
|
|
128
|
-
choices.push( {
|
|
129
|
-
value: 'Mobile',
|
|
130
|
-
label: __( 'Mobile' ),
|
|
131
|
-
icon: mobile,
|
|
132
|
-
} );
|
|
133
|
-
|
|
134
|
-
const previewValue = editorMode === 'zoom-out' ? 'ZoomOut' : deviceType;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Handles the selection of a device type.
|
|
138
|
-
*
|
|
139
|
-
* @param {string} value The device type.
|
|
140
|
-
*/
|
|
141
|
-
const onSelect = ( value ) => {
|
|
142
|
-
let newEditorMode = originalEditingModeRef.current;
|
|
143
|
-
|
|
144
|
-
if ( value === 'ZoomOut' ) {
|
|
145
|
-
newEditorMode = 'zoom-out';
|
|
146
|
-
setDeviceType( 'Desktop' );
|
|
147
|
-
} else {
|
|
148
|
-
setDeviceType( value );
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
__unstableSetEditorMode( newEditorMode );
|
|
152
|
-
};
|
|
153
96
|
|
|
154
97
|
return (
|
|
155
98
|
<DropdownMenu
|
|
@@ -161,7 +104,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
161
104
|
toggleProps={ toggleProps }
|
|
162
105
|
menuProps={ menuProps }
|
|
163
106
|
icon={ deviceIcons[ deviceType.toLowerCase() ] }
|
|
164
|
-
text={ editorMode === 'zoom-out' ? __( '50%' ) : undefined }
|
|
165
107
|
label={ __( 'View' ) }
|
|
166
108
|
disableOpenOnArrowDown={ disabled }
|
|
167
109
|
>
|
|
@@ -170,8 +112,8 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
170
112
|
<MenuGroup>
|
|
171
113
|
<MenuItemsChoice
|
|
172
114
|
choices={ choices }
|
|
173
|
-
value={
|
|
174
|
-
onSelect={
|
|
115
|
+
value={ deviceType }
|
|
116
|
+
onSelect={ setDeviceType }
|
|
175
117
|
/>
|
|
176
118
|
</MenuGroup>
|
|
177
119
|
{ isTemplate && (
|