@wordpress/edit-post 7.24.1 → 7.26.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 +8 -0
- package/LICENSE.md +1 -1
- package/build/components/browser-url/index.js +3 -2
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/header/index.js +35 -33
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +1 -1
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +2 -1
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +22 -18
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -20
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +45 -38
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +3 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +2 -6
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/preferences-modal/index.js +87 -54
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +23 -23
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js +3 -6
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +3 -3
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +2 -10
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +3 -5
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +17 -43
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +80 -26
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/start-page-options/index.js +3 -3
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/visual-editor/index.js +20 -257
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +6 -3
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/editor.js +20 -30
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +3 -11
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +16 -12
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/use-post-history.js +79 -0
- package/build/hooks/use-post-history.js.map +1 -0
- package/build/index.js +24 -20
- package/build/index.js.map +1 -1
- package/build/index.native.js +7 -1
- package/build/index.native.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js +2 -6
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +94 -112
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +1 -95
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +86 -48
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/browser-url/index.js +3 -2
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/header/index.js +37 -35
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +1 -1
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +2 -1
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +23 -19
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -20
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +46 -38
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +4 -2
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +2 -6
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +87 -54
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +22 -23
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js +3 -7
- package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +3 -3
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +2 -10
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +4 -6
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +20 -46
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +80 -27
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +3 -3
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +24 -261
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +6 -3
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/editor.js +20 -30
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +3 -11
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +16 -12
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/use-post-history.js +73 -0
- package/build-module/hooks/use-post-history.js.map +1 -0
- package/build-module/index.js +19 -12
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +7 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js +2 -6
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +86 -105
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +1 -92
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +76 -38
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +65 -473
- package/build-style/style.css +65 -473
- package/package.json +32 -32
- package/src/components/browser-url/index.js +4 -2
- package/src/components/header/index.js +45 -46
- package/src/components/header/mode-switcher/index.js +2 -1
- package/src/components/header/more-menu/index.js +1 -0
- package/src/components/header/style.scss +63 -37
- package/src/components/header/writing-menu/index.js +24 -24
- package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -15
- package/src/components/keyboard-shortcuts/index.js +1 -23
- package/src/components/layout/index.js +31 -39
- package/src/components/layout/index.native.js +9 -1
- package/src/components/meta-boxes/meta-box-visibility.js +2 -8
- package/src/components/preferences-modal/index.js +128 -97
- package/src/components/preferences-modal/options/enable-feature.js +26 -21
- package/src/components/preferences-modal/options/enable-panel.js +3 -7
- package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +187 -175
- package/src/components/preferences-modal/test/index.js +1 -52
- package/src/components/sidebar/plugin-document-setting-panel/index.js +3 -3
- package/src/components/sidebar/plugin-sidebar/index.js +1 -9
- package/src/components/sidebar/post-status/index.js +5 -5
- package/src/components/sidebar/settings-header/index.js +19 -71
- package/src/components/sidebar/settings-sidebar/index.js +125 -60
- package/src/components/sidebar/style.scss +4 -12
- package/src/components/start-page-options/index.js +3 -3
- package/src/components/text-editor/style.scss +0 -6
- package/src/components/visual-editor/index.js +26 -359
- package/src/components/visual-editor/style.scss +0 -15
- package/src/components/welcome-guide/index.js +4 -2
- package/src/editor.js +36 -35
- package/src/editor.native.js +2 -23
- package/src/hooks/commands/use-common-commands.js +14 -16
- package/src/hooks/use-post-history.js +73 -0
- package/src/index.js +24 -13
- package/src/index.native.js +8 -1
- package/src/plugins/welcome-guide-menu-item/index.js +3 -6
- package/src/store/actions.js +80 -131
- package/src/store/reducer.js +0 -93
- package/src/store/selectors.js +97 -55
- package/src/store/test/actions.js +10 -131
- package/src/store/test/reducer.js +1 -108
- package/src/store/test/selectors.js +0 -50
- package/src/style.scss +1 -8
- package/src/test/__snapshots__/editor.native.js.snap +21 -0
- package/src/test/editor.native.js +107 -56
- package/build/components/device-preview/index.js +0 -72
- package/build/components/device-preview/index.js.map +0 -1
- package/build/components/header/document-actions/index.js +0 -82
- package/build/components/header/document-actions/index.js.map +0 -1
- package/build/components/header/header-toolbar/index.js +0 -156
- package/build/components/header/header-toolbar/index.js.map +0 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +0 -73
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-outline.js +0 -112
- package/build/components/secondary-sidebar/list-view-outline.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -148
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build/components/sidebar/discussion-panel/index.js +0 -59
- package/build/components/sidebar/discussion-panel/index.js.map +0 -1
- package/build/components/sidebar/featured-image/index.js +0 -70
- package/build/components/sidebar/featured-image/index.js.map +0 -1
- package/build/components/sidebar/last-revision/index.js +0 -21
- package/build/components/sidebar/last-revision/index.js.map +0 -1
- package/build/components/sidebar/page-attributes/index.js +0 -65
- package/build/components/sidebar/page-attributes/index.js.map +0 -1
- package/build/components/sidebar/plugin-post-excerpt/index.js +0 -72
- package/build/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
- package/build/components/sidebar/post-excerpt/index.js +0 -54
- package/build/components/sidebar/post-excerpt/index.js.map +0 -1
- package/build/components/sidebar/post-taxonomies/index.js +0 -30
- package/build/components/sidebar/post-taxonomies/index.js.map +0 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -56
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
- package/build/components/sidebar/post-template/create-modal.js +0 -99
- package/build/components/sidebar/post-template/create-modal.js.map +0 -1
- package/build/components/sidebar/post-template/form.js +0 -110
- package/build/components/sidebar/post-template/form.js.map +0 -1
- package/build/components/sidebar/post-template/index.js +0 -106
- package/build/components/sidebar/post-template/index.js.map +0 -1
- package/build/components/view-link/index.js +0 -53
- package/build/components/view-link/index.js.map +0 -1
- package/build-module/components/device-preview/index.js +0 -65
- package/build-module/components/device-preview/index.js.map +0 -1
- package/build-module/components/header/document-actions/index.js +0 -74
- package/build-module/components/header/document-actions/index.js.map +0 -1
- package/build-module/components/header/header-toolbar/index.js +0 -148
- package/build-module/components/header/header-toolbar/index.js.map +0 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -66
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-outline.js +0 -105
- package/build-module/components/secondary-sidebar/list-view-outline.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -140
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build-module/components/sidebar/discussion-panel/index.js +0 -52
- package/build-module/components/sidebar/discussion-panel/index.js.map +0 -1
- package/build-module/components/sidebar/featured-image/index.js +0 -63
- package/build-module/components/sidebar/featured-image/index.js.map +0 -1
- package/build-module/components/sidebar/last-revision/index.js +0 -13
- package/build-module/components/sidebar/last-revision/index.js.map +0 -1
- package/build-module/components/sidebar/page-attributes/index.js +0 -57
- package/build-module/components/sidebar/page-attributes/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-excerpt/index.js +0 -64
- package/build-module/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
- package/build-module/components/sidebar/post-excerpt/index.js +0 -47
- package/build-module/components/sidebar/post-excerpt/index.js.map +0 -1
- package/build-module/components/sidebar/post-taxonomies/index.js +0 -21
- package/build-module/components/sidebar/post-taxonomies/index.js.map +0 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
- package/build-module/components/sidebar/post-template/create-modal.js +0 -92
- package/build-module/components/sidebar/post-template/create-modal.js.map +0 -1
- package/build-module/components/sidebar/post-template/form.js +0 -102
- package/build-module/components/sidebar/post-template/form.js.map +0 -1
- package/build-module/components/sidebar/post-template/index.js +0 -98
- package/build-module/components/sidebar/post-template/index.js.map +0 -1
- package/build-module/components/view-link/index.js +0 -46
- package/build-module/components/view-link/index.js.map +0 -1
- package/src/components/device-preview/index.js +0 -73
- package/src/components/header/document-actions/index.js +0 -82
- package/src/components/header/document-actions/style.scss +0 -64
- package/src/components/header/header-toolbar/index.js +0 -182
- package/src/components/header/header-toolbar/style.scss +0 -114
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +0 -929
- package/src/components/secondary-sidebar/inserter-sidebar.js +0 -71
- package/src/components/secondary-sidebar/list-view-outline.js +0 -98
- package/src/components/secondary-sidebar/list-view-sidebar.js +0 -170
- package/src/components/secondary-sidebar/style.scss +0 -120
- package/src/components/sidebar/discussion-panel/index.js +0 -62
- package/src/components/sidebar/featured-image/index.js +0 -67
- package/src/components/sidebar/last-revision/index.js +0 -17
- package/src/components/sidebar/last-revision/style.scss +0 -10
- package/src/components/sidebar/page-attributes/index.js +0 -65
- package/src/components/sidebar/plugin-post-excerpt/index.js +0 -61
- package/src/components/sidebar/plugin-post-excerpt/test/index.js +0 -36
- package/src/components/sidebar/post-excerpt/index.js +0 -59
- package/src/components/sidebar/post-taxonomies/index.js +0 -30
- package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
- package/src/components/sidebar/post-template/create-modal.js +0 -140
- package/src/components/sidebar/post-template/form.js +0 -141
- package/src/components/sidebar/post-template/index.js +0 -120
- package/src/components/sidebar/post-template/style.scss +0 -22
- package/src/components/sidebar/settings-header/style.scss +0 -74
- package/src/components/sidebar/template/style.scss +0 -35
- package/src/components/view-link/index.js +0 -48
|
@@ -38,91 +38,64 @@ function EditPostPreferencesModal() {
|
|
|
38
38
|
getEditorSettings
|
|
39
39
|
} = select(_editor.store);
|
|
40
40
|
const {
|
|
41
|
-
getEditorMode
|
|
42
|
-
isFeatureActive
|
|
41
|
+
getEditorMode
|
|
43
42
|
} = select(_store.store);
|
|
43
|
+
const {
|
|
44
|
+
get
|
|
45
|
+
} = select(_preferences.store);
|
|
44
46
|
const modalActive = select(_interface.store).isModalActive(PREFERENCES_MODAL_NAME);
|
|
45
47
|
const mode = getEditorMode();
|
|
46
48
|
const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
|
|
47
|
-
const isDistractionFreeEnabled =
|
|
49
|
+
const isDistractionFreeEnabled = get('core', 'distractionFree');
|
|
48
50
|
return [modalActive, !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled && mode === 'visual', isDistractionFreeEnabled];
|
|
49
51
|
}, [isLargeViewport]);
|
|
50
52
|
const {
|
|
51
|
-
closeGeneralSidebar
|
|
53
|
+
closeGeneralSidebar
|
|
54
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
55
|
+
const {
|
|
52
56
|
setIsListViewOpened,
|
|
53
57
|
setIsInserterOpened
|
|
54
|
-
} = (0, _data.useDispatch)(
|
|
58
|
+
} = (0, _data.useDispatch)(_editor.store);
|
|
55
59
|
const {
|
|
56
60
|
set: setPreference
|
|
57
61
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
58
62
|
const toggleDistractionFree = () => {
|
|
59
|
-
setPreference('core
|
|
63
|
+
setPreference('core', 'fixedToolbar', true);
|
|
60
64
|
setIsInserterOpened(false);
|
|
61
65
|
setIsListViewOpened(false);
|
|
62
66
|
closeGeneralSidebar();
|
|
63
67
|
};
|
|
68
|
+
const turnOffDistractionFree = () => {
|
|
69
|
+
setPreference('core', 'distractionFree', false);
|
|
70
|
+
};
|
|
64
71
|
const sections = (0, _element.useMemo)(() => [{
|
|
65
72
|
name: 'general',
|
|
66
73
|
tabLabel: (0, _i18n.__)('General'),
|
|
67
74
|
content: (0, _react.createElement)(_react.Fragment, null, isLargeViewport && (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
68
|
-
title: (0, _i18n.__)('Publishing')
|
|
69
|
-
description: (0, _i18n.__)('Change options related to publishing.')
|
|
75
|
+
title: (0, _i18n.__)('Publishing')
|
|
70
76
|
}, (0, _react.createElement)(_options.EnablePublishSidebarOption, {
|
|
71
77
|
help: (0, _i18n.__)('Review settings, such as visibility and tags.'),
|
|
72
|
-
label: (0, _i18n.__)('
|
|
78
|
+
label: (0, _i18n.__)('Enable pre-publish checks')
|
|
73
79
|
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
74
|
-
title: (0, _i18n.__)('
|
|
75
|
-
description: (0, _i18n.__)('Customize options related to the block editor interface and editing flow.')
|
|
80
|
+
title: (0, _i18n.__)('Interface')
|
|
76
81
|
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
77
|
-
|
|
78
|
-
onToggle: toggleDistractionFree,
|
|
79
|
-
help: (0, _i18n.__)('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
|
|
80
|
-
label: (0, _i18n.__)('Distraction free')
|
|
81
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
82
|
-
featureName: "focusMode",
|
|
83
|
-
help: (0, _i18n.__)('Highlights the current block and fades other content.'),
|
|
84
|
-
label: (0, _i18n.__)('Spotlight mode')
|
|
85
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
86
|
-
featureName: "showIconLabels",
|
|
87
|
-
label: (0, _i18n.__)('Show button text labels'),
|
|
88
|
-
help: (0, _i18n.__)('Show text instead of icons on buttons.')
|
|
89
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
82
|
+
scope: "core",
|
|
90
83
|
featureName: "showListViewByDefault",
|
|
91
84
|
help: (0, _i18n.__)('Opens the block list view sidebar by default.'),
|
|
92
85
|
label: (0, _i18n.__)('Always open list view')
|
|
93
|
-
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
94
|
-
featureName: "themeStyles",
|
|
95
|
-
help: (0, _i18n.__)('Make the editor look like your theme.'),
|
|
96
|
-
label: (0, _i18n.__)('Use theme styles')
|
|
97
86
|
}), showBlockBreadcrumbsOption && (0, _react.createElement)(_options.EnableFeature, {
|
|
87
|
+
scope: "core",
|
|
98
88
|
featureName: "showBlockBreadcrumbs",
|
|
99
|
-
help: (0, _i18n.__)('
|
|
100
|
-
label: (0, _i18n.__)('
|
|
101
|
-
})))
|
|
102
|
-
}, {
|
|
103
|
-
name: 'blocks',
|
|
104
|
-
tabLabel: (0, _i18n.__)('Blocks'),
|
|
105
|
-
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
106
|
-
title: (0, _i18n.__)('Block interactions'),
|
|
107
|
-
description: (0, _i18n.__)('Customize how you interact with blocks in the block library and editing canvas.')
|
|
108
|
-
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
109
|
-
featureName: "mostUsedBlocks",
|
|
110
|
-
help: (0, _i18n.__)('Places the most frequent blocks in the block library.'),
|
|
111
|
-
label: (0, _i18n.__)('Show most used blocks')
|
|
89
|
+
help: (0, _i18n.__)('Display the block hierarchy trail at the bottom of the editor.'),
|
|
90
|
+
label: (0, _i18n.__)('Show block breadcrumbs')
|
|
112
91
|
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
92
|
+
scope: "core",
|
|
93
|
+
featureName: "allowRightClickOverrides",
|
|
94
|
+
help: (0, _i18n.__)('Allows contextual list view menus via right-click, overriding browser defaults.'),
|
|
95
|
+
label: (0, _i18n.__)('Allow right-click contextual menus')
|
|
116
96
|
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
117
|
-
title: (0, _i18n.__)('Visible blocks'),
|
|
118
|
-
description: (0, _i18n.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
|
|
119
|
-
}, (0, _react.createElement)(_blockManager.default, null)))
|
|
120
|
-
}, {
|
|
121
|
-
name: 'panels',
|
|
122
|
-
tabLabel: (0, _i18n.__)('Panels'),
|
|
123
|
-
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
124
97
|
title: (0, _i18n.__)('Document settings'),
|
|
125
|
-
description: (0, _i18n.__)('
|
|
98
|
+
description: (0, _i18n.__)('Select what settings are shown in the document panel.')
|
|
126
99
|
}, (0, _react.createElement)(_options.EnablePluginDocumentSettingPanelOption.Slot, null), (0, _react.createElement)(_editor.PostTaxonomies, {
|
|
127
100
|
taxonomyWrapper: (content, taxonomy) => (0, _react.createElement)(_options.EnablePanelOption, {
|
|
128
101
|
label: taxonomy.labels.menu_name,
|
|
@@ -143,9 +116,69 @@ function EditPostPreferencesModal() {
|
|
|
143
116
|
label: (0, _i18n.__)('Page attributes'),
|
|
144
117
|
panelName: "page-attributes"
|
|
145
118
|
}))), (0, _react.createElement)(_metaBoxesSection.default, {
|
|
146
|
-
title: (0, _i18n.__)('
|
|
147
|
-
description: (0, _i18n.__)('Add extra areas to the editor.')
|
|
119
|
+
title: (0, _i18n.__)('Advanced')
|
|
148
120
|
}))
|
|
121
|
+
}, {
|
|
122
|
+
name: 'appearance',
|
|
123
|
+
tabLabel: (0, _i18n.__)('Appearance'),
|
|
124
|
+
content: (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
125
|
+
title: (0, _i18n.__)('Appearance'),
|
|
126
|
+
description: (0, _i18n.__)('Customize the editor interface to suit your needs.')
|
|
127
|
+
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
128
|
+
scope: "core",
|
|
129
|
+
featureName: "fixedToolbar",
|
|
130
|
+
onToggle: turnOffDistractionFree,
|
|
131
|
+
help: (0, _i18n.__)('Access all block and document tools in a single place.'),
|
|
132
|
+
label: (0, _i18n.__)('Top toolbar')
|
|
133
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
134
|
+
scope: "core",
|
|
135
|
+
featureName: "distractionFree",
|
|
136
|
+
onToggle: toggleDistractionFree,
|
|
137
|
+
help: (0, _i18n.__)('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
|
|
138
|
+
label: (0, _i18n.__)('Distraction free')
|
|
139
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
140
|
+
scope: "core",
|
|
141
|
+
featureName: "focusMode",
|
|
142
|
+
help: (0, _i18n.__)('Highlights the current block and fades other content.'),
|
|
143
|
+
label: (0, _i18n.__)('Spotlight mode')
|
|
144
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
145
|
+
featureName: "themeStyles",
|
|
146
|
+
help: (0, _i18n.__)('Make the editor look like your theme.'),
|
|
147
|
+
label: (0, _i18n.__)('Use theme styles')
|
|
148
|
+
}))
|
|
149
|
+
}, {
|
|
150
|
+
name: 'accessibility',
|
|
151
|
+
tabLabel: (0, _i18n.__)('Accessibility'),
|
|
152
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
153
|
+
title: (0, _i18n.__)('Navigation'),
|
|
154
|
+
description: (0, _i18n.__)('Optimize the editing experience for enhanced control.')
|
|
155
|
+
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
156
|
+
scope: "core",
|
|
157
|
+
featureName: "keepCaretInsideBlock",
|
|
158
|
+
help: (0, _i18n.__)('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
|
|
159
|
+
label: (0, _i18n.__)('Contain text cursor inside block')
|
|
160
|
+
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
161
|
+
title: (0, _i18n.__)('Interface')
|
|
162
|
+
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
163
|
+
scope: "core",
|
|
164
|
+
featureName: "showIconLabels",
|
|
165
|
+
label: (0, _i18n.__)('Show button text labels'),
|
|
166
|
+
help: (0, _i18n.__)('Show text instead of icons on buttons across the interface.')
|
|
167
|
+
})))
|
|
168
|
+
}, {
|
|
169
|
+
name: 'blocks',
|
|
170
|
+
tabLabel: (0, _i18n.__)('Blocks'),
|
|
171
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
172
|
+
title: (0, _i18n.__)('Inserter')
|
|
173
|
+
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
174
|
+
scope: "core",
|
|
175
|
+
featureName: "mostUsedBlocks",
|
|
176
|
+
help: (0, _i18n.__)('Adds a category with the most frequently used blocks in the inserter.'),
|
|
177
|
+
label: (0, _i18n.__)('Show most used blocks')
|
|
178
|
+
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
179
|
+
title: (0, _i18n.__)('Manage block visibility'),
|
|
180
|
+
description: (0, _i18n.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
|
|
181
|
+
}, (0, _react.createElement)(_blockManager.default, null)))
|
|
149
182
|
}], [isLargeViewport, showBlockBreadcrumbsOption]);
|
|
150
183
|
if (!isModalActive) {
|
|
151
184
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_data","_element","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","editPostStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","useMemo","name","tabLabel","__","content","_react","createElement","Fragment","PreferencesModalSection","title","description","EnablePublishSidebarOption","help","label","EnableFeature","featureName","onToggle","default","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAQA,IAAAK,UAAA,GAAAL,OAAA;AAMA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,QAAA,GAAAP,OAAA;AAMA,IAAAQ,iBAAA,GAAAC,sBAAA,CAAAT,OAAA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EAAG,IAAAP,QAAE,EACf,gCACD;IAAG,CACH,CACA;EAEJ,CAAC,CACD,EACD,CAAE9B,eAAe,EAAEM,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAA2B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAsE,gBAAgB;IAAC1D,UAAU,EAAGA;EAAY,GAC1C,IAAA8B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAuE,oBAAoB;IAACnC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_data","_element","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","editPostStore","get","preferencesStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","useMemo","name","tabLabel","__","content","_react","createElement","Fragment","PreferencesModalSection","title","EnablePublishSidebarOption","help","label","EnableFeature","scope","featureName","description","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","default","onToggle","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode } = select( editPostStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editPostStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAQA,IAAAK,UAAA,GAAAL,OAAA;AAMA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,QAAA,GAAAP,OAAA;AAMA,IAAAQ,iBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAF,sBAAA,CAAAT,OAAA;AApCA;AACA;AACA;;AAsBA;AACA;AACA;;AAYO,MAAMY,sBAAsB,GAAG,uBAAuB;AAACC,OAAA,CAAAD,sBAAA,GAAAA,sBAAA;AAE/C,SAASE,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EACpD,MAAM;IAAEC;EAAW,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACpD,MAAM,CAAEC,aAAa,EAAEC,0BAA0B,CAAE,GAAG,IAAAC,eAAS,EAC5DC,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3,34 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
7
|
-
var
|
|
6
|
+
exports.default = EnableFeature;
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _interface = require("@wordpress/interface");
|
|
10
|
-
var
|
|
10
|
+
var _preferences = require("@wordpress/preferences");
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
|
|
18
|
-
featureName
|
|
19
|
-
}) => {
|
|
14
|
+
|
|
15
|
+
function EnableFeature(props) {
|
|
20
16
|
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
onChange
|
|
17
|
+
scope = 'core/edit-post',
|
|
18
|
+
featureName,
|
|
19
|
+
onToggle = () => {},
|
|
20
|
+
...remainingProps
|
|
21
|
+
} = props;
|
|
22
|
+
const isChecked = (0, _data.useSelect)(select => !!select(_preferences.store).get(scope, featureName), [scope, featureName]);
|
|
23
|
+
const {
|
|
24
|
+
toggle
|
|
25
|
+
} = (0, _data.useDispatch)(_preferences.store);
|
|
26
|
+
const onChange = () => {
|
|
31
27
|
onToggle();
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
toggle(scope, featureName);
|
|
29
|
+
};
|
|
30
|
+
return (0, _react.createElement)(_interface.___unstablePreferencesModalBaseOption, {
|
|
31
|
+
onChange: onChange,
|
|
32
|
+
isChecked: isChecked,
|
|
33
|
+
...remainingProps
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
36
|
//# sourceMappingURL=enable-feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_interface","_preferences","EnableFeature","props","scope","featureName","onToggle","remainingProps","isChecked","useSelect","select","preferencesStore","get","toggle","useDispatch","onChange","_react","createElement","___unstablePreferencesModalBaseOption"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function EnableFeature( props ) {\n\tconst {\n\t\tscope = 'core/edit-post',\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\treturn (\n\t\t<BaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKe,SAASG,aAAaA,CAAEC,KAAK,EAAG;EAC9C,MAAM;IACLC,KAAK,GAAG,gBAAgB;IACxBC,WAAW;IACXC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;IACnB,GAAGC;EACJ,CAAC,GAAGJ,KAAK;EACT,MAAMK,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,GAAG,CAAER,KAAK,EAAEC,WAAY,CAAC,EACrE,CAAED,KAAK,EAAEC,WAAW,CACrB,CAAC;EACD,MAAM;IAAEQ;EAAO,CAAC,GAAG,IAAAC,iBAAW,EAAEH,kBAAiB,CAAC;EAClD,MAAMI,QAAQ,GAAGA,CAAA,KAAM;IACtBT,QAAQ,CAAC,CAAC;IACVO,MAAM,CAAET,KAAK,EAAEC,WAAY,CAAC;EAC7B,CAAC;EACD,OACC,IAAAW,MAAA,CAAAC,aAAA,EAACjB,UAAA,CAAAkB,qCAAU;IACVH,QAAQ,EAAGA,QAAU;IACrBP,SAAS,EAAGA,SAAW;IAAA,GAClBD;EAAc,CACnB,CAAC;AAEJ"}
|
|
@@ -7,20 +7,17 @@ exports.default = void 0;
|
|
|
7
7
|
var _compose = require("@wordpress/compose");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _interface = require("@wordpress/interface");
|
|
10
|
-
var
|
|
10
|
+
var _editor = require("@wordpress/editor");
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
14
|
var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
|
|
18
15
|
panelName
|
|
19
16
|
}) => {
|
|
20
17
|
const {
|
|
21
18
|
isEditorPanelEnabled,
|
|
22
19
|
isEditorPanelRemoved
|
|
23
|
-
} = select(
|
|
20
|
+
} = select(_editor.store);
|
|
24
21
|
return {
|
|
25
22
|
isRemoved: isEditorPanelRemoved(panelName),
|
|
26
23
|
isChecked: isEditorPanelEnabled(panelName)
|
|
@@ -30,7 +27,7 @@ var _default = (0, _compose.compose)((0, _data.withSelect)((select, {
|
|
|
30
27
|
}) => !isRemoved), (0, _data.withDispatch)((dispatch, {
|
|
31
28
|
panelName
|
|
32
29
|
}) => ({
|
|
33
|
-
onChange: () => dispatch(
|
|
30
|
+
onChange: () => dispatch(_editor.store).toggleEditorPanelEnabled(panelName)
|
|
34
31
|
})))(_interface.___unstablePreferencesModalBaseOption);
|
|
35
32
|
exports.default = _default;
|
|
36
33
|
//# sourceMappingURL=enable-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_interface","
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_interface","_editor","_default","compose","withSelect","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","editorStore","isRemoved","isChecked","ifCondition","withDispatch","dispatch","onChange","toggleEditorPanelEnabled","BaseOption","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;AAFA,IAAAI,QAAA,GAQe,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEI,aAAY,CAAC;EACtB,OAAO;IACNC,SAAS,EAAEF,oBAAoB,CAAEF,SAAU,CAAC;IAC5CK,SAAS,EAAEJ,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACH,IAAAM,oBAAW,EAAE,CAAE;EAAEF;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/C,IAAAG,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAER;AAAU,CAAC,MAAQ;EAC9CS,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEL,aAAY,CAAC,CAACO,wBAAwB,CAAEV,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEW,gDAAW,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAjB,QAAA"}
|
|
@@ -10,8 +10,8 @@ var _components = require("@wordpress/components");
|
|
|
10
10
|
var _plugins = require("@wordpress/plugins");
|
|
11
11
|
var _data = require("@wordpress/data");
|
|
12
12
|
var _warning = _interopRequireDefault(require("@wordpress/warning"));
|
|
13
|
+
var _editor = require("@wordpress/editor");
|
|
13
14
|
var _options = require("../../preferences-modal/options");
|
|
14
|
-
var _store = require("../../../store");
|
|
15
15
|
/**
|
|
16
16
|
* WordPress dependencies
|
|
17
17
|
*/
|
|
@@ -95,7 +95,7 @@ const PluginDocumentSettingPanel = ({
|
|
|
95
95
|
const {
|
|
96
96
|
isEditorPanelOpened,
|
|
97
97
|
isEditorPanelEnabled
|
|
98
|
-
} = select(
|
|
98
|
+
} = select(_editor.store);
|
|
99
99
|
return {
|
|
100
100
|
opened: isEditorPanelOpened(panelName),
|
|
101
101
|
isEnabled: isEditorPanelEnabled(panelName)
|
|
@@ -103,7 +103,7 @@ const PluginDocumentSettingPanel = ({
|
|
|
103
103
|
}, [panelName]);
|
|
104
104
|
const {
|
|
105
105
|
toggleEditorPanelOpened
|
|
106
|
-
} = (0, _data.useDispatch)(
|
|
106
|
+
} = (0, _data.useDispatch)(_editor.store);
|
|
107
107
|
if (undefined === name) {
|
|
108
108
|
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)('PluginDocumentSettingPanel requires a name property.') : void 0;
|
|
109
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_plugins","_data","_warning","_interopRequireDefault","
|
|
1
|
+
{"version":3,"names":["_components","require","_plugins","_data","_warning","_interopRequireDefault","_editor","_options","Fill","Slot","createSlotFill","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","usePluginContext","panelName","opened","isEnabled","useSelect","select","isEditorPanelOpened","isEditorPanelEnabled","editorStore","toggleEditorPanelOpened","useDispatch","undefined","SCRIPT_DEBUG","warning","_react","createElement","Fragment","EnablePluginDocumentSettingPanelOption","label","PanelBody","onToggle","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEO,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAG,IAAAC,yBAAgB,EAAC,CAAC;EAC/C,MAAMC,SAAS,GAAI,GAAGF,UAAY,IAAIL,IAAM,EAAC;EAC7C,MAAM;IAAEQ,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EACpCC,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEG,aAAY,CAAC;IAEtB,OAAO;MACNN,MAAM,EAAEI,mBAAmB,CAAEL,SAAU,CAAC;MACxCE,SAAS,EAAEI,oBAAoB,CAAEN,SAAU;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;EACD,MAAM;IAAEQ;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,aAAY,CAAC;EAE9D,IAAKG,SAAS,KAAKjB,IAAI,EAAG;IACzB,OAAAkB,YAAA,oBAAAA,YAAA,gBAAAC,gBAAO,EAAE,sDAAuD,CAAC;EAClE;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAC1B,QAAA,CAAA4B,sCAAsC;IACtCC,KAAK,EAAGtB,KAAO;IACfK,SAAS,EAAGA;EAAW,CACvB,CAAC,EACF,IAAAa,MAAA,CAAAC,aAAA,EAACzB,IAAI,QACFa,SAAS,IACV,IAAAW,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAAqC,SAAS;IACTxB,SAAS,EAAGA,SAAW;IACvBC,KAAK,EAAGA,KAAO;IACfC,IAAI,EAAGA,IAAM;IACbK,MAAM,EAAGA,MAAQ;IACjBkB,QAAQ,EAAGA,CAAA,KAAMX,uBAAuB,CAAER,SAAU;EAAG,GAErDH,QACQ,CAEP,CACL,CAAC;AAEL,CAAC;AAEDL,0BAA0B,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAA8B,QAAA,GAExB5B,0BAA0B;AAAA6B,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -10,15 +10,10 @@ var _data = require("@wordpress/data");
|
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
12
12
|
var _editor = require("@wordpress/editor");
|
|
13
|
-
var _store = require("../../../store");
|
|
14
13
|
/**
|
|
15
14
|
* WordPress dependencies
|
|
16
15
|
*/
|
|
17
16
|
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
17
|
/**
|
|
23
18
|
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
24
19
|
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
@@ -90,13 +85,11 @@ function PluginSidebarEditPost({
|
|
|
90
85
|
}) {
|
|
91
86
|
const {
|
|
92
87
|
postTitle,
|
|
93
|
-
shortcut
|
|
94
|
-
showIconLabels
|
|
88
|
+
shortcut
|
|
95
89
|
} = (0, _data.useSelect)(select => {
|
|
96
90
|
return {
|
|
97
91
|
postTitle: select(_editor.store).getEditedPostAttribute('title'),
|
|
98
|
-
shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-post/toggle-sidebar')
|
|
99
|
-
showIconLabels: select(_store.store).isFeatureActive('showIconLabels')
|
|
92
|
+
shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-post/toggle-sidebar')
|
|
100
93
|
};
|
|
101
94
|
}, []);
|
|
102
95
|
return (0, _react.createElement)(_interface.ComplementaryArea, {
|
|
@@ -105,7 +98,6 @@ function PluginSidebarEditPost({
|
|
|
105
98
|
smallScreenTitle: postTitle || (0, _i18n.__)('(no title)'),
|
|
106
99
|
scope: "core/edit-post",
|
|
107
100
|
toggleShortcut: shortcut,
|
|
108
|
-
showIconLabels: showIconLabels,
|
|
109
101
|
...props
|
|
110
102
|
});
|
|
111
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_interface","require","_data","_i18n","_keyboardShortcuts","_editor","
|
|
1
|
+
{"version":3,"names":["_interface","require","_data","_i18n","_keyboardShortcuts","_editor","PluginSidebarEditPost","className","props","postTitle","shortcut","useSelect","select","editorStore","getEditedPostAttribute","keyboardShortcutsStore","getShortcutRepresentation","_react","createElement","ComplementaryArea","panelClassName","smallScreenTitle","__","scope","toggleShortcut"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditPost( { className, ...props } ) {\n\tconst { postTitle, shortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-post-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core/edit-post\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASK,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxE,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,OAAO;MACNH,SAAS,EAAEG,MAAM,CAAEC,aAAY,CAAC,CAACC,sBAAsB,CAAE,OAAQ,CAAC;MAClEJ,QAAQ,EAAEE,MAAM,CACfG,wBACD,CAAC,CAACC,yBAAyB,CAAE,+BAAgC;IAC9D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAClB,UAAA,CAAAmB,iBAAiB;IACjBC,cAAc,EAAGb,SAAW;IAC5BA,SAAS,EAAC,mBAAmB;IAC7Bc,gBAAgB,EAAGZ,SAAS,IAAI,IAAAa,QAAE,EAAE,YAAa,CAAG;IACpDC,KAAK,EAAC,gBAAgB;IACtBC,cAAc,EAAGd,QAAU;IAAA,GACtBF;EAAK,CACV,CAAC;AAEJ"}
|
|
@@ -17,8 +17,6 @@ var _postSlug = _interopRequireDefault(require("../post-slug"));
|
|
|
17
17
|
var _postFormat = _interopRequireDefault(require("../post-format"));
|
|
18
18
|
var _postPendingStatus = _interopRequireDefault(require("../post-pending-status"));
|
|
19
19
|
var _pluginPostStatusInfo = _interopRequireDefault(require("../plugin-post-status-info"));
|
|
20
|
-
var _store = require("../../../store");
|
|
21
|
-
var _postTemplate = _interopRequireDefault(require("../post-template"));
|
|
22
20
|
/**
|
|
23
21
|
* WordPress dependencies
|
|
24
22
|
*/
|
|
@@ -41,7 +39,7 @@ function PostStatus() {
|
|
|
41
39
|
const {
|
|
42
40
|
isEditorPanelRemoved,
|
|
43
41
|
isEditorPanelOpened
|
|
44
|
-
} = select(
|
|
42
|
+
} = select(_editor.store);
|
|
45
43
|
return {
|
|
46
44
|
isRemoved: isEditorPanelRemoved(PANEL_NAME),
|
|
47
45
|
isOpened: isEditorPanelOpened(PANEL_NAME)
|
|
@@ -49,7 +47,7 @@ function PostStatus() {
|
|
|
49
47
|
}, []);
|
|
50
48
|
const {
|
|
51
49
|
toggleEditorPanelOpened
|
|
52
|
-
} = (0, _data.useDispatch)(
|
|
50
|
+
} = (0, _data.useDispatch)(_editor.store);
|
|
53
51
|
if (isRemoved) {
|
|
54
52
|
return null;
|
|
55
53
|
}
|
|
@@ -58,7 +56,7 @@ function PostStatus() {
|
|
|
58
56
|
title: (0, _i18n.__)('Summary'),
|
|
59
57
|
opened: isOpened,
|
|
60
58
|
onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
|
|
61
|
-
}, (0, _react.createElement)(_pluginPostStatusInfo.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_postVisibility.default, null), (0, _react.createElement)(_editor.PostSchedulePanel, null), (0, _react.createElement)(
|
|
59
|
+
}, (0, _react.createElement)(_pluginPostStatusInfo.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_postVisibility.default, null), (0, _react.createElement)(_editor.PostSchedulePanel, null), (0, _react.createElement)(_editor.PostTemplatePanel, null), (0, _react.createElement)(_editor.PostURLPanel, null), (0, _react.createElement)(_editor.PostSyncStatus, null), (0, _react.createElement)(_postSticky.default, null), (0, _react.createElement)(_postPendingStatus.default, null), (0, _react.createElement)(_postFormat.default, null), (0, _react.createElement)(_postSlug.default, null), (0, _react.createElement)(_editor.PostAuthorPanel, null), fills, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
62
60
|
style: {
|
|
63
61
|
marginTop: '16px'
|
|
64
62
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_editor","_postVisibility","_interopRequireDefault","_postTrash","_postSticky","_postSlug","_postFormat","_postPendingStatus","_pluginPostStatusInfo","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_editor","_postVisibility","_interopRequireDefault","_postTrash","_postSticky","_postSlug","_postFormat","_postPendingStatus","_pluginPostStatusInfo","PANEL_NAME","PostStatus","isOpened","isRemoved","useSelect","select","isEditorPanelRemoved","isEditorPanelOpened","editorStore","toggleEditorPanelOpened","useDispatch","_react","createElement","PanelBody","className","title","__","opened","onToggle","default","Slot","fills","Fragment","PostSchedulePanel","PostTemplatePanel","PostURLPanel","PostSyncStatus","PostAuthorPanel","__experimentalHStack","style","marginTop","spacing","wrap","PostSwitchToDraftButton"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSwitchToDraftButton,\n\tPostSyncStatus,\n\tPostURLPanel,\n\tPostTemplatePanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\twrap\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAaA,IAAAI,eAAA,GAAAC,sBAAA,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