@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
|
@@ -2,65 +2,39 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { __, _x
|
|
7
|
-
import {
|
|
5
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
6
|
+
import { __, _x } from '@wordpress/i18n';
|
|
7
|
+
import { useSelect } from '@wordpress/data';
|
|
8
8
|
import { store as editorStore } from '@wordpress/editor';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = useDispatch(editPostStore);
|
|
20
|
-
const openDocumentSettings = () => openGeneralSidebar('edit-post/document');
|
|
21
|
-
const openBlockSettings = () => openGeneralSidebar('edit-post/block');
|
|
13
|
+
import { unlock } from '../../../lock-unlock';
|
|
14
|
+
import { sidebars } from '../settings-sidebar';
|
|
15
|
+
const {
|
|
16
|
+
Tabs
|
|
17
|
+
} = unlock(componentsPrivateApis);
|
|
18
|
+
const SettingsHeader = () => {
|
|
22
19
|
const {
|
|
23
20
|
documentLabel,
|
|
24
21
|
isTemplateMode
|
|
25
22
|
} = useSelect(select => {
|
|
26
|
-
const
|
|
23
|
+
const {
|
|
24
|
+
getPostTypeLabel,
|
|
25
|
+
getRenderingMode
|
|
26
|
+
} = select(editorStore);
|
|
27
27
|
return {
|
|
28
28
|
// translators: Default label for the Document sidebar tab, not selected.
|
|
29
|
-
documentLabel:
|
|
30
|
-
isTemplateMode:
|
|
29
|
+
documentLabel: getPostTypeLabel() || _x('Document', 'noun'),
|
|
30
|
+
isTemplateMode: getRenderingMode() === 'template-only'
|
|
31
31
|
};
|
|
32
32
|
}, []);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[__('Block (selected)'), 'is-active'] :
|
|
39
|
-
// translators: ARIA label for the Block Settings Sidebar tab, not selected.
|
|
40
|
-
[__('Block'), ''];
|
|
41
|
-
const [templateAriaLabel, templateActiveClass] = sidebarName === 'edit-post/document' ? [__('Template (selected)'), 'is-active'] : [__('Template'), ''];
|
|
42
|
-
|
|
43
|
-
/* Use a list so screen readers will announce how many tabs there are. */
|
|
44
|
-
return createElement("ul", null, !isTemplateMode && createElement("li", null, createElement(Button, {
|
|
45
|
-
onClick: openDocumentSettings,
|
|
46
|
-
className: `edit-post-sidebar__panel-tab ${documentActiveClass}`,
|
|
47
|
-
"aria-label": documentAriaLabel,
|
|
48
|
-
"data-label": documentLabel
|
|
49
|
-
}, documentLabel)), isTemplateMode && createElement("li", null, createElement(Button, {
|
|
50
|
-
onClick: openDocumentSettings,
|
|
51
|
-
className: `edit-post-sidebar__panel-tab ${templateActiveClass}`,
|
|
52
|
-
"aria-label": templateAriaLabel,
|
|
53
|
-
"data-label": __('Template')
|
|
54
|
-
}, __('Template'))), createElement("li", null, createElement(Button, {
|
|
55
|
-
onClick: openBlockSettings,
|
|
56
|
-
className: `edit-post-sidebar__panel-tab ${blockActiveClass}`,
|
|
57
|
-
"aria-label": blockAriaLabel
|
|
58
|
-
// translators: Data label for the Block Settings Sidebar tab.
|
|
59
|
-
,
|
|
60
|
-
"data-label": __('Block')
|
|
61
|
-
},
|
|
62
|
-
// translators: Text label for the Block Settings Sidebar tab.
|
|
63
|
-
__('Block'))));
|
|
33
|
+
return createElement(Tabs.TabList, null, createElement(Tabs.Tab, {
|
|
34
|
+
tabId: sidebars.document
|
|
35
|
+
}, isTemplateMode ? __('Template') : documentLabel), createElement(Tabs.Tab, {
|
|
36
|
+
tabId: sidebars.block
|
|
37
|
+
}, __('Block')));
|
|
64
38
|
};
|
|
65
39
|
export default SettingsHeader;
|
|
66
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","store","editorStore","unlock","sidebars","Tabs","SettingsHeader","documentLabel","isTemplateMode","select","getPostTypeLabel","getRenderingMode","createElement","TabList","Tab","tabId","document","block"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = () => {\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel, getRenderingMode } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: getRenderingMode() === 'template-only',\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList>\n\t\t\t<Tabs.Tab tabId={ sidebars.document }>\n\t\t\t\t{ isTemplateMode ? __( 'Template' ) : documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab tabId={ sidebars.block }>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default SettingsHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,MAAM;EAAEC;AAAK,CAAC,GAAGF,MAAM,CAAEN,qBAAsB,CAAC;AAEhD,MAAMS,cAAc,GAAGA,CAAA,KAAM;EAC5B,MAAM;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAClE,MAAM;MAAEC,gBAAgB;MAAEC;IAAiB,CAAC,GAAGF,MAAM,CAAEP,WAAY,CAAC;IAEpE,OAAO;MACN;MACAK,aAAa,EAAEG,gBAAgB,CAAC,CAAC,IAAIX,EAAE,CAAE,UAAU,EAAE,MAAO,CAAC;MAC7DS,cAAc,EAAEG,gBAAgB,CAAC,CAAC,KAAK;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACP,IAAI,CAACQ,OAAO,QACZD,aAAA,CAACP,IAAI,CAACS,GAAG;IAACC,KAAK,EAAGX,QAAQ,CAACY;EAAU,GAClCR,cAAc,GAAGV,EAAE,CAAE,UAAW,CAAC,GAAGS,aAC7B,CAAC,EACXK,aAAA,CAACP,IAAI,CAACS,GAAG;IAACC,KAAK,EAAGX,QAAQ,CAACa;EAAO,GAE/BnB,EAAE,CAAE,OAAQ,CACL,CACG,CAAC;AAEjB,CAAC;AAED,eAAeQ,cAAc"}
|
|
@@ -3,36 +3,79 @@ import { createElement, Fragment } from "react";
|
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { BlockInspector, store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
-
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import { Platform } from '@wordpress/element';
|
|
6
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
+
import { Platform, useCallback, useContext } from '@wordpress/element';
|
|
8
8
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
9
9
|
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
10
10
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
11
11
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
12
|
+
import { store as editorStore, PageAttributesPanel, PostDiscussionPanel, PostExcerptPanel, PostFeaturedImagePanel, PostLastRevisionPanel, PostTaxonomiesPanel } from '@wordpress/editor';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
15
16
|
*/
|
|
16
17
|
import SettingsHeader from '../settings-header';
|
|
17
18
|
import PostStatus from '../post-status';
|
|
18
|
-
import LastRevision from '../last-revision';
|
|
19
|
-
import PostTaxonomies from '../post-taxonomies';
|
|
20
|
-
import FeaturedImage from '../featured-image';
|
|
21
|
-
import PostExcerpt from '../post-excerpt';
|
|
22
|
-
import DiscussionPanel from '../discussion-panel';
|
|
23
|
-
import PageAttributes from '../page-attributes';
|
|
24
19
|
import MetaBoxes from '../../meta-boxes';
|
|
25
20
|
import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
|
|
26
21
|
import PluginSidebarEditPost from '../plugin-sidebar';
|
|
27
22
|
import TemplateSummary from '../template-summary';
|
|
28
23
|
import { store as editPostStore } from '../../../store';
|
|
24
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
25
|
+
import { unlock } from '../../../lock-unlock';
|
|
26
|
+
const {
|
|
27
|
+
Tabs
|
|
28
|
+
} = unlock(componentsPrivateApis);
|
|
29
29
|
const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select({
|
|
30
30
|
web: true,
|
|
31
31
|
native: false
|
|
32
32
|
});
|
|
33
|
+
export const sidebars = {
|
|
34
|
+
document: 'edit-post/document',
|
|
35
|
+
block: 'edit-post/block'
|
|
36
|
+
};
|
|
37
|
+
const SidebarContent = ({
|
|
38
|
+
sidebarName,
|
|
39
|
+
keyboardShortcut,
|
|
40
|
+
isTemplateMode
|
|
41
|
+
}) => {
|
|
42
|
+
// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we
|
|
43
|
+
// need to forward the `Tabs` context so it can be passed through the
|
|
44
|
+
// underlying slot/fill.
|
|
45
|
+
const tabsContextValue = useContext(Tabs.Context);
|
|
46
|
+
return createElement(PluginSidebarEditPost, {
|
|
47
|
+
identifier: sidebarName,
|
|
48
|
+
header: createElement(Tabs.Context.Provider, {
|
|
49
|
+
value: tabsContextValue
|
|
50
|
+
}, createElement(SettingsHeader, null)),
|
|
51
|
+
closeLabel: __('Close Settings')
|
|
52
|
+
// This classname is added so we can apply a corrective negative
|
|
53
|
+
// margin to the panel.
|
|
54
|
+
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
|
|
55
|
+
,
|
|
56
|
+
className: "edit-post-sidebar__panel",
|
|
57
|
+
headerClassName: "edit-post-sidebar__panel-tabs"
|
|
58
|
+
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
59
|
+
title: __('Settings'),
|
|
60
|
+
toggleShortcut: keyboardShortcut,
|
|
61
|
+
icon: isRTL() ? drawerLeft : drawerRight,
|
|
62
|
+
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
|
|
63
|
+
}, createElement(Tabs.Context.Provider, {
|
|
64
|
+
value: tabsContextValue
|
|
65
|
+
}, createElement(Tabs.TabPanel, {
|
|
66
|
+
tabId: sidebars.document,
|
|
67
|
+
focusable: false
|
|
68
|
+
}, !isTemplateMode && createElement(Fragment, null, createElement(PostStatus, null), createElement(PluginDocumentSettingPanel.Slot, null), createElement(PostLastRevisionPanel, null), createElement(PostTaxonomiesPanel, null), createElement(PostFeaturedImagePanel, null), createElement(PostExcerptPanel, null), createElement(PostDiscussionPanel, null), createElement(PageAttributesPanel, null), createElement(MetaBoxes, {
|
|
69
|
+
location: "side"
|
|
70
|
+
})), isTemplateMode && createElement(TemplateSummary, null)), createElement(Tabs.TabPanel, {
|
|
71
|
+
tabId: sidebars.block,
|
|
72
|
+
focusable: false
|
|
73
|
+
}, createElement(BlockInspector, null))));
|
|
74
|
+
};
|
|
33
75
|
const SettingsSidebar = () => {
|
|
34
76
|
const {
|
|
35
77
|
sidebarName,
|
|
78
|
+
isSettingsSidebarActive,
|
|
36
79
|
keyboardShortcut,
|
|
37
80
|
isTemplateMode
|
|
38
81
|
} = useSelect(select => {
|
|
@@ -44,34 +87,44 @@ const SettingsSidebar = () => {
|
|
|
44
87
|
// should contain the sidebar that will be active when the toggle button is pressed. If a block
|
|
45
88
|
// is selected, that should be edit-post/block otherwise it's edit-post/document.
|
|
46
89
|
let sidebar = select(interfaceStore).getActiveComplementaryArea(editPostStore.name);
|
|
47
|
-
|
|
90
|
+
let isSettingsSidebar = true;
|
|
91
|
+
if (![sidebars.document, sidebars.block].includes(sidebar)) {
|
|
92
|
+
isSettingsSidebar = false;
|
|
48
93
|
if (select(blockEditorStore).getBlockSelectionStart()) {
|
|
49
|
-
sidebar =
|
|
94
|
+
sidebar = sidebars.block;
|
|
50
95
|
}
|
|
51
|
-
sidebar =
|
|
96
|
+
sidebar = sidebars.document;
|
|
52
97
|
}
|
|
53
98
|
const shortcut = select(keyboardShortcutsStore).getShortcutRepresentation('core/edit-post/toggle-sidebar');
|
|
54
99
|
return {
|
|
55
100
|
sidebarName: sidebar,
|
|
101
|
+
isSettingsSidebarActive: isSettingsSidebar,
|
|
56
102
|
keyboardShortcut: shortcut,
|
|
57
|
-
isTemplateMode: select(
|
|
103
|
+
isTemplateMode: select(editorStore).getRenderingMode() === 'template-only'
|
|
58
104
|
};
|
|
59
105
|
}, []);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
106
|
+
const {
|
|
107
|
+
openGeneralSidebar
|
|
108
|
+
} = useDispatch(editPostStore);
|
|
109
|
+
const onTabSelect = useCallback(newSelectedTabId => {
|
|
110
|
+
if (!!newSelectedTabId) {
|
|
111
|
+
openGeneralSidebar(newSelectedTabId);
|
|
112
|
+
}
|
|
113
|
+
}, [openGeneralSidebar]);
|
|
114
|
+
return createElement(Tabs
|
|
115
|
+
// Due to how this component is controlled (via a value from the
|
|
116
|
+
// `interfaceStore`), when the sidebar closes the currently selected
|
|
117
|
+
// tab can't be found. This causes the component to continuously reset
|
|
118
|
+
// the selection to `null` in an infinite loop.Proactively setting
|
|
119
|
+
// the selected tab to `null` avoids that.
|
|
120
|
+
, {
|
|
121
|
+
selectedTabId: isSettingsSidebarActive ? sidebarName : null,
|
|
122
|
+
onSelect: onTabSelect
|
|
123
|
+
}, createElement(SidebarContent, {
|
|
124
|
+
sidebarName: sidebarName,
|
|
125
|
+
keyboardShortcut: keyboardShortcut,
|
|
126
|
+
isTemplateMode: isTemplateMode
|
|
127
|
+
}));
|
|
75
128
|
};
|
|
76
129
|
export default SettingsSidebar;
|
|
77
130
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","Platform","isRTL","__","drawerLeft","drawerRight","interfaceStore","keyboardShortcutsStore","SettingsHeader","PostStatus","LastRevision","PostTaxonomies","FeaturedImage","PostExcerpt","DiscussionPanel","PageAttributes","MetaBoxes","PluginDocumentSettingPanel","PluginSidebarEditPost","TemplateSummary","editPostStore","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","SettingsSidebar","sidebarName","keyboardShortcut","isTemplateMode","sidebar","getActiveComplementaryArea","name","includes","getBlockSelectionStart","shortcut","getShortcutRepresentation","isEditingTemplate","createElement","identifier","header","closeLabel","headerClassName","title","toggleShortcut","icon","isActiveByDefault","Fragment","Slot","location"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { Platform } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport LastRevision from '../last-revision';\nimport PostTaxonomies from '../post-taxonomies';\nimport FeaturedImage from '../featured-image';\nimport PostExcerpt from '../post-excerpt';\nimport DiscussionPanel from '../discussion-panel';\nimport PageAttributes from '../page-attributes';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport TemplateSummary from '../template-summary';\nimport { store as editPostStore } from '../../../store';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SettingsSidebar = () => {\n\tconst { sidebarName, keyboardShortcut, isTemplateMode } = useSelect(\n\t\t( select ) => {\n\t\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditPostStore.name\n\t\t\t);\n\t\t\tif (\n\t\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\t\tsidebar\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\t\tsidebar = 'edit-post/block';\n\t\t\t\t}\n\t\t\t\tsidebar = 'edit-post/document';\n\t\t\t}\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\t\treturn {\n\t\t\t\tsidebarName: sidebar,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ ! isTemplateMode && sidebarName === 'edit-post/document' && (\n\t\t\t\t<>\n\t\t\t\t\t<PostStatus />\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<LastRevision />\n\t\t\t\t\t<PostTaxonomies />\n\t\t\t\t\t<FeaturedImage />\n\t\t\t\t\t<PostExcerpt />\n\t\t\t\t\t<DiscussionPanel />\n\t\t\t\t\t<PageAttributes />\n\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ isTemplateMode && sidebarName === 'edit-post/document' && (\n\t\t\t\t<TemplateSummary />\n\t\t\t) }\n\t\t\t{ sidebarName === 'edit-post/block' && <BlockInspector /> }\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,E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BAAiB,IAAIW,aAAA,CAACxC,cAAc,MAAE,CAClC,CAAC;AAE1B,CAAC;AAED,eAAe4B,eAAe"}
|
|
1
|
+
{"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","isRTL","__","drawerLeft","drawerRight","interfaceStore","keyboardShortcutsStore","editorStore","PageAttributesPanel","PostDiscussionPanel","PostExcerptPanel","PostFeaturedImagePanel","PostLastRevisionPanel","PostTaxonomiesPanel","SettingsHeader","PostStatus","MetaBoxes","PluginDocumentSettingPanel","PluginSidebarEditPost","TemplateSummary","editPostStore","privateApis","componentsPrivateApis","unlock","Tabs","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","sidebars","document","block","SidebarContent","sidebarName","keyboardShortcut","isTemplateMode","tabsContextValue","Context","createElement","identifier","header","Provider","value","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","focusable","Fragment","Slot","location","SettingsSidebar","isSettingsSidebarActive","sidebar","getActiveComplementaryArea","name","isSettingsSidebar","includes","getBlockSelectionStart","shortcut","getShortcutRepresentation","getRenderingMode","openGeneralSidebar","onTabSelect","newSelectedTabId","selectedTabId","onSelect"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Platform, useCallback, useContext } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport TemplateSummary from '../template-summary';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( {\n\tsidebarName,\n\tkeyboardShortcut,\n\tisTemplateMode,\n} ) => {\n\t// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ ! isTemplateMode && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t<PostFeaturedImagePanel />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isTemplateMode && <TemplateSummary /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tconst {\n\t\tsidebarName,\n\t\tisSettingsSidebarActive,\n\t\tkeyboardShortcut,\n\t\tisTemplateMode,\n\t} = useSelect( ( select ) => {\n\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditPostStore.name\n\t\t);\n\t\tlet isSettingsSidebar = true;\n\t\tif ( ! [ sidebars.document, sidebars.block ].includes( sidebar ) ) {\n\t\t\tisSettingsSidebar = false;\n\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\tsidebar = sidebars.block;\n\t\t\t}\n\t\t\tsidebar = sidebars.document;\n\t\t}\n\t\tconst shortcut = select(\n\t\t\tkeyboardShortcutsStore\n\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\treturn {\n\t\t\tsidebarName: sidebar,\n\t\t\tisSettingsSidebarActive: isSettingsSidebar,\n\t\t\tkeyboardShortcut: shortcut,\n\t\t\tisTemplateMode:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t};\n\t}, [] );\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\t// Due to how this component is controlled (via a value from the\n\t\t\t// `interfaceStore`), when the sidebar closes the currently selected\n\t\t\t// tab can't be found. This causes the component to continuously reset\n\t\t\t// the selection to `null` in an infinite loop.Proactively setting\n\t\t\t// the selected tab to `null` avoids that.\n\t\t\tselectedTabId={ isSettingsSidebarActive ? sidebarName : null }\n\t\t\tonSelect={ onTabSelect }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\tsidebarName={ sidebarName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisTemplateMode={ isTemplateMode }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,EAAEC,WAAW,EAAEC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BAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEF,kBAAkB,CACrB,CAAC;EAED,OACC7B,aAAA,CAACd;EACA;EACA;EACA;EACA;EACA;EAAA;IACA8C,aAAa,EAAGb,uBAAuB,GAAGxB,WAAW,GAAG,IAAM;IAC9DsC,QAAQ,EAAGH;EAAa,GAExB9B,aAAA,CAACN,cAAc;IACdC,WAAW,EAAGA,WAAa;IAC3BC,gBAAgB,EAAGA,gBAAkB;IACrCC,cAAc,EAAGA;EAAgB,CACjC,CACI,CAAC;AAET,CAAC;AAED,eAAeqB,eAAe"}
|
|
@@ -82,13 +82,13 @@ export default function StartPageOptions() {
|
|
|
82
82
|
const [isClosed, setIsClosed] = useState(false);
|
|
83
83
|
const shouldEnableModal = useSelect(select => {
|
|
84
84
|
const {
|
|
85
|
-
isCleanNewPost
|
|
85
|
+
isCleanNewPost,
|
|
86
|
+
getRenderingMode
|
|
86
87
|
} = select(editorStore);
|
|
87
88
|
const {
|
|
88
|
-
isEditingTemplate,
|
|
89
89
|
isFeatureActive
|
|
90
90
|
} = select(editPostStore);
|
|
91
|
-
return
|
|
91
|
+
return getRenderingMode() === 'post-only' && !isFeatureActive('welcomeGuide') && isCleanNewPost();
|
|
92
92
|
}, []);
|
|
93
93
|
if (!shouldEnableModal || isClosed) {
|
|
94
94
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Modal","__","useState","useMemo","store","blockEditorStore","__experimentalBlockPatternsList","BlockPatternsList","useSelect","useDispatch","useAsyncList","editorStore","editPostStore","useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","getCurrentPostType","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","resetEditorBlocks","createElement","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","className","title","isFullScreen","onRequestClose","StartPageOptions","isClosed","setIsClosed","shouldEnableModal","isCleanNewPost","
|
|
1
|
+
{"version":3,"names":["Modal","__","useState","useMemo","store","blockEditorStore","__experimentalBlockPatternsList","BlockPatternsList","useSelect","useDispatch","useAsyncList","editorStore","editPostStore","useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","getCurrentPostType","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","resetEditorBlocks","createElement","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","className","title","isFullScreen","onRequestClose","StartPageOptions","isClosed","setIsClosed","shouldEnableModal","isCleanNewPost","getRenderingMode","isFeatureActive"],"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ onClose }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ onClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst shouldEnableModal = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost, getRenderingMode } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn (\n\t\t\tgetRenderingMode() === 'post-only' &&\n\t\t\t! isFeatureActive( 'welcomeGuide' ) &&\n\t\t\tisCleanNewPost()\n\t\t);\n\t}, [] );\n\n\tif ( ! shouldEnableModal || isClosed ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsClosed( true ) } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,+BAA+B,IAAIC,iBAAiB,QAC9C,yBAAyB;AAChC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASN,KAAK,IAAIO,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,aAAa;AAEpD,SAASC,gBAAgBA,CAAA,EAAG;EAC3B;EACA;EACA;EACA,MAAM;IAAEC,qCAAqC;IAAEC;EAAS,CAAC,GAAGP,SAAS,CAClEQ,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEX,gBAAiB,CAAC;IAC9D,MAAM;MAAEa;IAAmB,CAAC,GAAGF,MAAM,CAAEL,WAAY,CAAC;IACpD,OAAO;MACNG,qCAAqC,EACpCG,uBAAuB,CAAE,mBAAoB,CAAC;MAC/CF,QAAQ,EAAEG,kBAAkB,CAAC;IAC9B,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,OAAOf,OAAO,CAAE,MAAM;IACrB;IACA;IACA,OAAOW,qCAAqC,CAACK,MAAM,CAAIC,OAAO,IAAM;MACnE,OACGL,QAAQ,KAAK,MAAM,IAAI,CAAEK,OAAO,CAACC,SAAS,IAC1CC,KAAK,CAACC,OAAO,CAAEH,OAAO,CAACC,SAAU,CAAC,IACnCD,OAAO,CAACC,SAAS,CAACG,QAAQ,CAAET,QAAS,CAAG;IAE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