@wordpress/edit-post 7.24.1 → 7.25.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 +2 -0
- package/build/components/header/header-toolbar/index.js +8 -4
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/index.js +13 -11
- 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 +13 -12
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/layout/index.js +12 -12
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +65 -49
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +1 -2
- 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 -20
- 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 +5 -6
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +1 -2
- package/build/editor.native.js.map +1 -1
- package/build/index.js +5 -4
- package/build/index.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 +35 -39
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +1 -34
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +22 -12
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +8 -4
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/index.js +15 -13
- 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 +14 -13
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/layout/index.js +13 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +65 -49
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +2 -3
- 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 -21
- 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 +5 -6
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +1 -2
- package/build-module/editor.native.js.map +1 -1
- package/build-module/index.js +3 -2
- package/build-module/index.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 +31 -36
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +1 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +18 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +63 -200
- package/build-style/style.css +63 -200
- package/package.json +32 -32
- package/src/components/header/header-toolbar/index.js +4 -0
- package/src/components/header/header-toolbar/style.scss +15 -13
- package/src/components/header/index.js +28 -13
- 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 +60 -34
- package/src/components/header/writing-menu/index.js +16 -18
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +1 -1
- package/src/components/layout/index.js +13 -12
- package/src/components/preferences-modal/index.js +109 -96
- package/src/components/preferences-modal/test/index.js +1 -52
- package/src/components/sidebar/post-status/index.js +2 -2
- package/src/components/sidebar/settings-header/index.js +19 -71
- package/src/components/sidebar/settings-sidebar/index.js +117 -54
- package/src/components/sidebar/style.scss +4 -12
- package/src/components/start-page-options/index.js +3 -3
- 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 +7 -7
- package/src/editor.native.js +3 -9
- package/src/index.js +3 -2
- package/src/plugins/welcome-guide-menu-item/index.js +3 -6
- package/src/store/actions.js +32 -46
- package/src/store/reducer.js +0 -33
- package/src/store/selectors.js +23 -9
- package/src/store/test/actions.js +0 -28
- package/src/style.scss +0 -3
- package/src/test/__snapshots__/editor.native.js.snap +21 -0
- package/src/test/editor.native.js +90 -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/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-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/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/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/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
|
@@ -1,92 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { __, _x
|
|
6
|
-
import {
|
|
4
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
5
|
+
import { __, _x } from '@wordpress/i18n';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
7
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { unlock } from '../../../lock-unlock';
|
|
13
|
+
import { sidebars } from '../settings-sidebar';
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
const { openGeneralSidebar } = useDispatch( editPostStore );
|
|
16
|
-
const openDocumentSettings = () =>
|
|
17
|
-
openGeneralSidebar( 'edit-post/document' );
|
|
18
|
-
const openBlockSettings = () => openGeneralSidebar( 'edit-post/block' );
|
|
15
|
+
const { Tabs } = unlock( componentsPrivateApis );
|
|
19
16
|
|
|
17
|
+
const SettingsHeader = () => {
|
|
20
18
|
const { documentLabel, isTemplateMode } = useSelect( ( select ) => {
|
|
21
|
-
const
|
|
19
|
+
const { getPostTypeLabel, getRenderingMode } = select( editorStore );
|
|
22
20
|
|
|
23
21
|
return {
|
|
24
22
|
// translators: Default label for the Document sidebar tab, not selected.
|
|
25
|
-
documentLabel:
|
|
26
|
-
isTemplateMode:
|
|
23
|
+
documentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),
|
|
24
|
+
isTemplateMode: getRenderingMode() === 'template-only',
|
|
27
25
|
};
|
|
28
26
|
}, [] );
|
|
29
27
|
|
|
30
|
-
const [ documentAriaLabel, documentActiveClass ] =
|
|
31
|
-
sidebarName === 'edit-post/document'
|
|
32
|
-
? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.
|
|
33
|
-
[ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]
|
|
34
|
-
: [ documentLabel, '' ];
|
|
35
|
-
|
|
36
|
-
const [ blockAriaLabel, blockActiveClass ] =
|
|
37
|
-
sidebarName === 'edit-post/block'
|
|
38
|
-
? // translators: ARIA label for the Block Settings Sidebar tab, selected.
|
|
39
|
-
[ __( 'Block (selected)' ), 'is-active' ]
|
|
40
|
-
: // translators: ARIA label for the Block Settings Sidebar tab, not selected.
|
|
41
|
-
[ __( 'Block' ), '' ];
|
|
42
|
-
|
|
43
|
-
const [ templateAriaLabel, templateActiveClass ] =
|
|
44
|
-
sidebarName === 'edit-post/document'
|
|
45
|
-
? [ __( 'Template (selected)' ), 'is-active' ]
|
|
46
|
-
: [ __( 'Template' ), '' ];
|
|
47
|
-
|
|
48
|
-
/* Use a list so screen readers will announce how many tabs there are. */
|
|
49
28
|
return (
|
|
50
|
-
<
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{ documentLabel }
|
|
60
|
-
</Button>
|
|
61
|
-
</li>
|
|
62
|
-
) }
|
|
63
|
-
{ isTemplateMode && (
|
|
64
|
-
<li>
|
|
65
|
-
<Button
|
|
66
|
-
onClick={ openDocumentSettings }
|
|
67
|
-
className={ `edit-post-sidebar__panel-tab ${ templateActiveClass }` }
|
|
68
|
-
aria-label={ templateAriaLabel }
|
|
69
|
-
data-label={ __( 'Template' ) }
|
|
70
|
-
>
|
|
71
|
-
{ __( 'Template' ) }
|
|
72
|
-
</Button>
|
|
73
|
-
</li>
|
|
74
|
-
) }
|
|
75
|
-
<li>
|
|
76
|
-
<Button
|
|
77
|
-
onClick={ openBlockSettings }
|
|
78
|
-
className={ `edit-post-sidebar__panel-tab ${ blockActiveClass }` }
|
|
79
|
-
aria-label={ blockAriaLabel }
|
|
80
|
-
// translators: Data label for the Block Settings Sidebar tab.
|
|
81
|
-
data-label={ __( 'Block' ) }
|
|
82
|
-
>
|
|
83
|
-
{
|
|
84
|
-
// translators: Text label for the Block Settings Sidebar tab.
|
|
85
|
-
__( 'Block' )
|
|
86
|
-
}
|
|
87
|
-
</Button>
|
|
88
|
-
</li>
|
|
89
|
-
</ul>
|
|
29
|
+
<Tabs.TabList>
|
|
30
|
+
<Tabs.Tab tabId={ sidebars.document }>
|
|
31
|
+
{ isTemplateMode ? __( 'Template' ) : documentLabel }
|
|
32
|
+
</Tabs.Tab>
|
|
33
|
+
<Tabs.Tab tabId={ sidebars.block }>
|
|
34
|
+
{ /* translators: Text label for the Block Settings Sidebar tab. */ }
|
|
35
|
+
{ __( 'Block' ) }
|
|
36
|
+
</Tabs.Tab>
|
|
37
|
+
</Tabs.TabList>
|
|
90
38
|
);
|
|
91
39
|
};
|
|
92
40
|
|
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
BlockInspector,
|
|
6
6
|
store as blockEditorStore,
|
|
7
7
|
} from '@wordpress/block-editor';
|
|
8
|
-
import { useSelect } from '@wordpress/data';
|
|
9
|
-
import { Platform } from '@wordpress/element';
|
|
8
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
+
import { Platform, useCallback, useContext } from '@wordpress/element';
|
|
10
10
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
11
11
|
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
12
12
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
13
13
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
14
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
@@ -28,52 +29,43 @@ import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
|
|
|
28
29
|
import PluginSidebarEditPost from '../plugin-sidebar';
|
|
29
30
|
import TemplateSummary from '../template-summary';
|
|
30
31
|
import { store as editPostStore } from '../../../store';
|
|
32
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
33
|
+
import { unlock } from '../../../lock-unlock';
|
|
34
|
+
|
|
35
|
+
const { Tabs } = unlock( componentsPrivateApis );
|
|
31
36
|
|
|
32
37
|
const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {
|
|
33
38
|
web: true,
|
|
34
39
|
native: false,
|
|
35
40
|
} );
|
|
41
|
+
export const sidebars = {
|
|
42
|
+
document: 'edit-post/document',
|
|
43
|
+
block: 'edit-post/block',
|
|
44
|
+
};
|
|
36
45
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// is selected, that should be edit-post/block otherwise it's edit-post/document.
|
|
47
|
-
let sidebar = select( interfaceStore ).getActiveComplementaryArea(
|
|
48
|
-
editPostStore.name
|
|
49
|
-
);
|
|
50
|
-
if (
|
|
51
|
-
! [ 'edit-post/document', 'edit-post/block' ].includes(
|
|
52
|
-
sidebar
|
|
53
|
-
)
|
|
54
|
-
) {
|
|
55
|
-
if ( select( blockEditorStore ).getBlockSelectionStart() ) {
|
|
56
|
-
sidebar = 'edit-post/block';
|
|
57
|
-
}
|
|
58
|
-
sidebar = 'edit-post/document';
|
|
59
|
-
}
|
|
60
|
-
const shortcut = select(
|
|
61
|
-
keyboardShortcutsStore
|
|
62
|
-
).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );
|
|
63
|
-
return {
|
|
64
|
-
sidebarName: sidebar,
|
|
65
|
-
keyboardShortcut: shortcut,
|
|
66
|
-
isTemplateMode: select( editPostStore ).isEditingTemplate(),
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
[]
|
|
70
|
-
);
|
|
46
|
+
const SidebarContent = ( {
|
|
47
|
+
sidebarName,
|
|
48
|
+
keyboardShortcut,
|
|
49
|
+
isTemplateMode,
|
|
50
|
+
} ) => {
|
|
51
|
+
// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we
|
|
52
|
+
// need to forward the `Tabs` context so it can be passed through the
|
|
53
|
+
// underlying slot/fill.
|
|
54
|
+
const tabsContextValue = useContext( Tabs.Context );
|
|
71
55
|
|
|
72
56
|
return (
|
|
73
57
|
<PluginSidebarEditPost
|
|
74
58
|
identifier={ sidebarName }
|
|
75
|
-
header={
|
|
59
|
+
header={
|
|
60
|
+
<Tabs.Context.Provider value={ tabsContextValue }>
|
|
61
|
+
<SettingsHeader />
|
|
62
|
+
</Tabs.Context.Provider>
|
|
63
|
+
}
|
|
76
64
|
closeLabel={ __( 'Close Settings' ) }
|
|
65
|
+
// This classname is added so we can apply a corrective negative
|
|
66
|
+
// margin to the panel.
|
|
67
|
+
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
|
|
68
|
+
className="edit-post-sidebar__panel"
|
|
77
69
|
headerClassName="edit-post-sidebar__panel-tabs"
|
|
78
70
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
79
71
|
title={ __( 'Settings' ) }
|
|
@@ -81,25 +73,96 @@ const SettingsSidebar = () => {
|
|
|
81
73
|
icon={ isRTL() ? drawerLeft : drawerRight }
|
|
82
74
|
isActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }
|
|
83
75
|
>
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
76
|
+
<Tabs.Context.Provider value={ tabsContextValue }>
|
|
77
|
+
<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
|
|
78
|
+
{ ! isTemplateMode && (
|
|
79
|
+
<>
|
|
80
|
+
<PostStatus />
|
|
81
|
+
<PluginDocumentSettingPanel.Slot />
|
|
82
|
+
<LastRevision />
|
|
83
|
+
<PostTaxonomies />
|
|
84
|
+
<FeaturedImage />
|
|
85
|
+
<PostExcerpt />
|
|
86
|
+
<DiscussionPanel />
|
|
87
|
+
<PageAttributes />
|
|
88
|
+
<MetaBoxes location="side" />
|
|
89
|
+
</>
|
|
90
|
+
) }
|
|
91
|
+
{ isTemplateMode && <TemplateSummary /> }
|
|
92
|
+
</Tabs.TabPanel>
|
|
93
|
+
<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
|
|
94
|
+
<BlockInspector />
|
|
95
|
+
</Tabs.TabPanel>
|
|
96
|
+
</Tabs.Context.Provider>
|
|
101
97
|
</PluginSidebarEditPost>
|
|
102
98
|
);
|
|
103
99
|
};
|
|
104
100
|
|
|
101
|
+
const SettingsSidebar = () => {
|
|
102
|
+
const {
|
|
103
|
+
sidebarName,
|
|
104
|
+
isSettingsSidebarActive,
|
|
105
|
+
keyboardShortcut,
|
|
106
|
+
isTemplateMode,
|
|
107
|
+
} = useSelect( ( select ) => {
|
|
108
|
+
// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.
|
|
109
|
+
// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.
|
|
110
|
+
// If one of the two sidebars is active the component will contain the content of that sidebar.
|
|
111
|
+
// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost
|
|
112
|
+
// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName
|
|
113
|
+
// should contain the sidebar that will be active when the toggle button is pressed. If a block
|
|
114
|
+
// is selected, that should be edit-post/block otherwise it's edit-post/document.
|
|
115
|
+
let sidebar = select( interfaceStore ).getActiveComplementaryArea(
|
|
116
|
+
editPostStore.name
|
|
117
|
+
);
|
|
118
|
+
let isSettingsSidebar = true;
|
|
119
|
+
if ( ! [ sidebars.document, sidebars.block ].includes( sidebar ) ) {
|
|
120
|
+
isSettingsSidebar = false;
|
|
121
|
+
if ( select( blockEditorStore ).getBlockSelectionStart() ) {
|
|
122
|
+
sidebar = sidebars.block;
|
|
123
|
+
}
|
|
124
|
+
sidebar = sidebars.document;
|
|
125
|
+
}
|
|
126
|
+
const shortcut = select(
|
|
127
|
+
keyboardShortcutsStore
|
|
128
|
+
).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );
|
|
129
|
+
return {
|
|
130
|
+
sidebarName: sidebar,
|
|
131
|
+
isSettingsSidebarActive: isSettingsSidebar,
|
|
132
|
+
keyboardShortcut: shortcut,
|
|
133
|
+
isTemplateMode:
|
|
134
|
+
select( editorStore ).getRenderingMode() === 'template-only',
|
|
135
|
+
};
|
|
136
|
+
}, [] );
|
|
137
|
+
|
|
138
|
+
const { openGeneralSidebar } = useDispatch( editPostStore );
|
|
139
|
+
|
|
140
|
+
const onTabSelect = useCallback(
|
|
141
|
+
( newSelectedTabId ) => {
|
|
142
|
+
if ( !! newSelectedTabId ) {
|
|
143
|
+
openGeneralSidebar( newSelectedTabId );
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
[ openGeneralSidebar ]
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<Tabs
|
|
151
|
+
// Due to how this component is controlled (via a value from the
|
|
152
|
+
// `interfaceStore`), when the sidebar closes the currently selected
|
|
153
|
+
// tab can't be found. This causes the component to continuously reset
|
|
154
|
+
// the selection to `null` in an infinite loop.Proactively setting
|
|
155
|
+
// the selected tab to `null` avoids that.
|
|
156
|
+
selectedTabId={ isSettingsSidebarActive ? sidebarName : null }
|
|
157
|
+
onSelect={ onTabSelect }
|
|
158
|
+
>
|
|
159
|
+
<SidebarContent
|
|
160
|
+
sidebarName={ sidebarName }
|
|
161
|
+
keyboardShortcut={ keyboardShortcut }
|
|
162
|
+
isTemplateMode={ isTemplateMode }
|
|
163
|
+
/>
|
|
164
|
+
</Tabs>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
105
168
|
export default SettingsSidebar;
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
.components-panel__header.edit-post-sidebar__panel-tabs {
|
|
2
|
-
justify-content: flex-start;
|
|
3
2
|
padding-left: 0;
|
|
4
3
|
padding-right: $grid-unit-20;
|
|
5
|
-
border-top: 0;
|
|
6
|
-
margin-top: 0;
|
|
7
|
-
|
|
8
|
-
ul {
|
|
9
|
-
display: flex;
|
|
10
|
-
}
|
|
11
|
-
li {
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
4
|
|
|
15
5
|
.components-button.has-icon {
|
|
16
|
-
display: none;
|
|
17
|
-
margin: 0 0 0 auto;
|
|
18
6
|
padding: 0;
|
|
19
7
|
min-width: $icon-size;
|
|
20
8
|
height: $icon-size;
|
|
@@ -24,3 +12,7 @@
|
|
|
24
12
|
}
|
|
25
13
|
}
|
|
26
14
|
}
|
|
15
|
+
|
|
16
|
+
.edit-post-sidebar__panel {
|
|
17
|
+
margin-top: -1px;
|
|
18
|
+
}
|
|
@@ -90,11 +90,11 @@ function StartPageOptionsModal( { onClose } ) {
|
|
|
90
90
|
export default function StartPageOptions() {
|
|
91
91
|
const [ isClosed, setIsClosed ] = useState( false );
|
|
92
92
|
const shouldEnableModal = useSelect( ( select ) => {
|
|
93
|
-
const { isCleanNewPost } = select( editorStore );
|
|
94
|
-
const {
|
|
93
|
+
const { isCleanNewPost, getRenderingMode } = select( editorStore );
|
|
94
|
+
const { isFeatureActive } = select( editPostStore );
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
|
-
|
|
97
|
+
getRenderingMode() === 'post-only' &&
|
|
98
98
|
! isFeatureActive( 'welcomeGuide' ) &&
|
|
99
99
|
isCleanNewPost()
|
|
100
100
|
);
|