@wordpress/edit-site 4.4.0 → 4.7.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 +6 -0
- package/build/components/add-new-template/new-template.js +24 -22
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/index.js +29 -23
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/code-editor/code-editor-text-area.js +11 -9
- package/build/components/code-editor/code-editor-text-area.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -7
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +3 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/header.js +15 -11
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +2 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +4 -4
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +13 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +3 -3
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-root.js +13 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +1 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -7
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/list/table.js +1 -1
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +2 -2
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build/components/preferences-modal/index.js +5 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/routes/use-title.js +3 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +2 -4
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build/components/template-details/index.js +4 -2
- package/build/components/template-details/index.js.map +1 -1
- package/build/index.js +11 -3
- package/build/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +24 -23
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/index.js +29 -24
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/code-editor/code-editor-text-area.js +12 -10
- package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +2 -7
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +4 -4
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/header.js +16 -11
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +2 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +3 -3
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -2
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +14 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +2 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +4 -4
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +15 -5
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +2 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -7
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/list/table.js +1 -1
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +2 -2
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +5 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/routes/use-title.js +2 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +2 -4
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build-module/components/template-details/index.js +4 -2
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/index.js +10 -3
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +22 -71
- package/build-style/style.css +22 -71
- package/package.json +30 -30
- package/src/components/add-new-template/new-template.js +22 -17
- package/src/components/block-editor/index.js +59 -38
- package/src/components/code-editor/code-editor-text-area.js +12 -7
- package/src/components/global-styles/border-panel.js +2 -12
- package/src/components/global-styles/context-menu.js +7 -7
- package/src/components/global-styles/header.js +20 -17
- package/src/components/global-styles/hooks.js +1 -1
- package/src/components/global-styles/navigation-button.js +3 -3
- package/src/components/global-styles/palette.js +3 -3
- package/src/components/global-styles/preview.js +17 -2
- package/src/components/global-styles/screen-block-list.js +3 -3
- package/src/components/global-styles/screen-colors.js +7 -7
- package/src/components/global-styles/screen-root.js +34 -24
- package/src/components/global-styles/screen-typography.js +3 -3
- package/src/components/global-styles/use-global-styles-output.js +1 -4
- package/src/components/header/document-actions/style.scss +1 -1
- package/src/components/header/style.scss +14 -29
- package/src/components/list/style.scss +1 -0
- package/src/components/list/table.js +1 -4
- package/src/components/navigation-sidebar/navigation-panel/constants.js +2 -2
- package/src/components/preferences-modal/index.js +8 -1
- package/src/components/routes/use-title.js +3 -2
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/src/components/sidebar/global-styles-sidebar.js +1 -1
- package/src/components/sidebar/index.js +4 -2
- package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -7
- package/src/components/sidebar/navigation-menu-sidebar/style.scss +0 -1
- package/src/components/sidebar/style.scss +4 -47
- package/src/components/template-details/index.js +4 -1
- package/src/index.js +17 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
|
-
__experimentalItem as Item,
|
|
7
6
|
__experimentalHStack as HStack,
|
|
7
|
+
__experimentalSpacer as Spacer,
|
|
8
8
|
__experimentalVStack as VStack,
|
|
9
9
|
FlexItem,
|
|
10
10
|
CardBody,
|
|
@@ -21,7 +21,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
23
|
import { IconWithCurrentColor } from './icon-with-current-color';
|
|
24
|
-
import {
|
|
24
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
25
25
|
import ContextMenu from './context-menu';
|
|
26
26
|
import StylesPreview from './preview';
|
|
27
27
|
|
|
@@ -37,48 +37,58 @@ function ScreenRoot() {
|
|
|
37
37
|
return (
|
|
38
38
|
<Card size="small">
|
|
39
39
|
<CardBody>
|
|
40
|
-
<VStack spacing={
|
|
40
|
+
<VStack spacing={ 4 }>
|
|
41
41
|
<Card>
|
|
42
42
|
<CardMedia>
|
|
43
43
|
<StylesPreview />
|
|
44
44
|
</CardMedia>
|
|
45
45
|
</Card>
|
|
46
46
|
{ !! variations?.length && (
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
<ItemGroup>
|
|
48
|
+
<NavigationButtonAsItem path="/variations">
|
|
49
|
+
<HStack justify="space-between">
|
|
50
|
+
<FlexItem>
|
|
51
|
+
{ __( 'Browse styles' ) }
|
|
52
|
+
</FlexItem>
|
|
53
|
+
<IconWithCurrentColor
|
|
54
|
+
icon={
|
|
55
|
+
isRTL() ? chevronLeft : chevronRight
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
</HStack>
|
|
59
|
+
</NavigationButtonAsItem>
|
|
60
|
+
</ItemGroup>
|
|
57
61
|
) }
|
|
62
|
+
<ContextMenu />
|
|
58
63
|
</VStack>
|
|
59
64
|
</CardBody>
|
|
60
65
|
|
|
61
|
-
<CardBody>
|
|
62
|
-
<ContextMenu />
|
|
63
|
-
</CardBody>
|
|
64
|
-
|
|
65
66
|
<CardDivider />
|
|
66
67
|
|
|
67
68
|
<CardBody>
|
|
69
|
+
<Spacer
|
|
70
|
+
as="p"
|
|
71
|
+
paddingTop={ 2 }
|
|
72
|
+
/*
|
|
73
|
+
* 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).
|
|
74
|
+
* This is an ad hoc override for this particular instance only and should be reconsidered before making into a pattern.
|
|
75
|
+
*/
|
|
76
|
+
paddingX="13px"
|
|
77
|
+
marginBottom={ 4 }
|
|
78
|
+
>
|
|
79
|
+
{ __(
|
|
80
|
+
'Customize the appearance of specific blocks for the whole site.'
|
|
81
|
+
) }
|
|
82
|
+
</Spacer>
|
|
68
83
|
<ItemGroup>
|
|
69
|
-
<
|
|
70
|
-
{ __(
|
|
71
|
-
'Customize the appearance of specific blocks for the whole site.'
|
|
72
|
-
) }
|
|
73
|
-
</Item>
|
|
74
|
-
<NavigationButton path="/blocks">
|
|
84
|
+
<NavigationButtonAsItem path="/blocks">
|
|
75
85
|
<HStack justify="space-between">
|
|
76
86
|
<FlexItem>{ __( 'Blocks' ) }</FlexItem>
|
|
77
87
|
<IconWithCurrentColor
|
|
78
88
|
icon={ isRTL() ? chevronLeft : chevronRight }
|
|
79
89
|
/>
|
|
80
90
|
</HStack>
|
|
81
|
-
</
|
|
91
|
+
</NavigationButtonAsItem>
|
|
82
92
|
</ItemGroup>
|
|
83
93
|
</CardBody>
|
|
84
94
|
</Card>
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import ScreenHeader from './header';
|
|
16
|
-
import {
|
|
16
|
+
import { NavigationButtonAsItem } from './navigation-button';
|
|
17
17
|
import { useStyle } from './hooks';
|
|
18
18
|
import Subtitle from './subtitle';
|
|
19
19
|
import TypographyPanel from './typography-panel';
|
|
@@ -44,7 +44,7 @@ function Item( { name, parentMenu, element, label } ) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<
|
|
47
|
+
<NavigationButtonAsItem path={ parentMenu + '/typography/' + element }>
|
|
48
48
|
<HStack justify="flex-start">
|
|
49
49
|
<FlexItem
|
|
50
50
|
className="edit-site-global-styles-screen-typography__indicator"
|
|
@@ -62,7 +62,7 @@ function Item( { name, parentMenu, element, label } ) {
|
|
|
62
62
|
</FlexItem>
|
|
63
63
|
<FlexItem>{ label }</FlexItem>
|
|
64
64
|
</HStack>
|
|
65
|
-
</
|
|
65
|
+
</NavigationButtonAsItem>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -220,11 +220,8 @@ function getStylesDeclarations( blockStyles = {} ) {
|
|
|
220
220
|
|
|
221
221
|
// The goal is to move everything to server side generated engine styles
|
|
222
222
|
// This is temporary as we absorb more and more styles into the engine.
|
|
223
|
-
const extraRules = getCSSRules( blockStyles
|
|
223
|
+
const extraRules = getCSSRules( blockStyles );
|
|
224
224
|
extraRules.forEach( ( rule ) => {
|
|
225
|
-
if ( rule.selector !== 'self' ) {
|
|
226
|
-
throw "This style can't be added as inline style";
|
|
227
|
-
}
|
|
228
225
|
const cssProperty = rule.key.startsWith( '--' )
|
|
229
226
|
? rule.key
|
|
230
227
|
: kebabCase( rule.key );
|
|
@@ -104,8 +104,9 @@ body.is-navigation-sidebar-open {
|
|
|
104
104
|
margin: 0 -6px 0;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
|
|
107
108
|
/**
|
|
108
|
-
* Buttons
|
|
109
|
+
* Buttons on the right side
|
|
109
110
|
*/
|
|
110
111
|
|
|
111
112
|
.edit-site-header__actions {
|
|
@@ -113,36 +114,23 @@ body.is-navigation-sidebar-open {
|
|
|
113
114
|
align-items: center;
|
|
114
115
|
padding-right: $grid-unit-05;
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
@include break-medium() {
|
|
120
|
-
display: inline-flex;
|
|
121
|
-
}
|
|
117
|
+
@include break-small () {
|
|
118
|
+
padding-right: $grid-unit-20 - ($grid-unit-15 * 0.5);
|
|
122
119
|
}
|
|
123
120
|
|
|
124
|
-
|
|
125
|
-
.editor-post-saved-state,
|
|
126
|
-
.components-button.components-button {
|
|
127
|
-
margin-right: $grid-unit-05;
|
|
128
|
-
|
|
129
|
-
@include break-small() {
|
|
130
|
-
margin-right: $grid-unit-15;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
121
|
+
gap: $grid-unit-05;
|
|
133
122
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
padding: 0 #{$grid-unit-15 * 0.5};
|
|
123
|
+
@include break-small() {
|
|
124
|
+
gap: $grid-unit-10;
|
|
137
125
|
}
|
|
138
126
|
|
|
139
|
-
|
|
140
|
-
.interface-pinned-items
|
|
141
|
-
|
|
142
|
-
}
|
|
127
|
+
// Pinned items.
|
|
128
|
+
.interface-pinned-items {
|
|
129
|
+
display: none;
|
|
143
130
|
|
|
144
|
-
|
|
145
|
-
|
|
131
|
+
@include break-medium() {
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
}
|
|
146
134
|
}
|
|
147
135
|
}
|
|
148
136
|
|
|
@@ -192,11 +180,8 @@ body.is-navigation-sidebar-open {
|
|
|
192
180
|
.edit-site-save-button__button {
|
|
193
181
|
padding-left: 6px;
|
|
194
182
|
padding-right: 6px;
|
|
195
|
-
margin-right: $grid-unit-05;
|
|
196
|
-
}
|
|
197
|
-
.block-editor-post-preview__button-toggle {
|
|
198
|
-
margin-right: $grid-unit-05;
|
|
199
183
|
}
|
|
184
|
+
|
|
200
185
|
// The inserter and the template details toggle have custom labels, different from their aria-label, so we don't want to display both.
|
|
201
186
|
.edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle,
|
|
202
187
|
.edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import {
|
|
6
|
-
store as coreStore,
|
|
7
|
-
__experimentalUseEntityRecords as useEntityRecords,
|
|
8
|
-
} from '@wordpress/core-data';
|
|
5
|
+
import { store as coreStore, useEntityRecords } from '@wordpress/core-data';
|
|
9
6
|
import { __, sprintf } from '@wordpress/i18n';
|
|
10
7
|
import {
|
|
11
8
|
VisuallyHidden,
|
|
@@ -31,7 +31,7 @@ export const TEMPLATES_SECONDARY = [
|
|
|
31
31
|
'date',
|
|
32
32
|
'tag',
|
|
33
33
|
'attachment',
|
|
34
|
-
'single
|
|
34
|
+
'single',
|
|
35
35
|
'front-page',
|
|
36
36
|
];
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ export const TEMPLATES_GENERAL = [ 'page-home' ];
|
|
|
45
45
|
export const TEMPLATES_POSTS_PREFIXES = [
|
|
46
46
|
'post-',
|
|
47
47
|
'author-',
|
|
48
|
-
'single-
|
|
48
|
+
'single-',
|
|
49
49
|
'tag-',
|
|
50
50
|
];
|
|
51
51
|
|
|
@@ -39,7 +39,14 @@ export default function EditSitePreferencesModal( {
|
|
|
39
39
|
<EnableFeature
|
|
40
40
|
featureName="showIconLabels"
|
|
41
41
|
label={ __( 'Show button text labels' ) }
|
|
42
|
-
help={ __( 'Show text instead of icons on buttons' ) }
|
|
42
|
+
help={ __( 'Show text instead of icons on buttons.' ) }
|
|
43
|
+
/>
|
|
44
|
+
<EnableFeature
|
|
45
|
+
featureName="showListViewByDefault"
|
|
46
|
+
help={ __(
|
|
47
|
+
'Opens the block list view sidebar by default.'
|
|
48
|
+
) }
|
|
49
|
+
label={ __( 'Always open list view' ) }
|
|
43
50
|
/>
|
|
44
51
|
</PreferencesModalSection>
|
|
45
52
|
),
|
|
@@ -6,6 +6,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
6
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
8
8
|
import { speak } from '@wordpress/a11y';
|
|
9
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Internal dependencies
|
|
@@ -36,8 +37,8 @@ export default function useTitle( title ) {
|
|
|
36
37
|
const formattedTitle = sprintf(
|
|
37
38
|
/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */
|
|
38
39
|
__( '%1$s ‹ %2$s — WordPress' ),
|
|
39
|
-
title,
|
|
40
|
-
siteTitle
|
|
40
|
+
decodeEntities( title ),
|
|
41
|
+
decodeEntities( siteTitle )
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
document.title = formattedTitle;
|
|
@@ -37,11 +37,11 @@ export default function GlobalStylesSidebar() {
|
|
|
37
37
|
<DropdownMenu
|
|
38
38
|
icon={ moreVertical }
|
|
39
39
|
label={ __( 'More Global Styles Actions' ) }
|
|
40
|
-
toggleProps={ { disabled: ! canReset } }
|
|
41
40
|
controls={ [
|
|
42
41
|
{
|
|
43
42
|
title: __( 'Reset to defaults' ),
|
|
44
43
|
onClick: onReset,
|
|
44
|
+
isDisabled: ! canReset,
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
title: __( 'Welcome Guide' ),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { cog } from '@wordpress/icons';
|
|
7
|
-
import { useEffect } from '@wordpress/element';
|
|
7
|
+
import { useEffect, Fragment } from '@wordpress/element';
|
|
8
8
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
9
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
10
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -46,6 +46,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
46
46
|
[]
|
|
47
47
|
);
|
|
48
48
|
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
|
49
|
+
|
|
49
50
|
useEffect( () => {
|
|
50
51
|
if ( ! isEditorSidebarOpened ) return;
|
|
51
52
|
if ( hasBlockSelection ) {
|
|
@@ -54,6 +55,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
54
55
|
enableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );
|
|
55
56
|
}
|
|
56
57
|
}, [ hasBlockSelection, isEditorSidebarOpened ] );
|
|
58
|
+
|
|
57
59
|
let sidebarName = sidebar;
|
|
58
60
|
if ( ! isEditorSidebarOpened ) {
|
|
59
61
|
sidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;
|
|
@@ -62,7 +64,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
62
64
|
// Conditionally include NavMenu sidebar in Plugin only.
|
|
63
65
|
// Optimise for dead code elimination.
|
|
64
66
|
// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
|
|
65
|
-
let MaybeNavigationMenuSidebar =
|
|
67
|
+
let MaybeNavigationMenuSidebar = Fragment;
|
|
66
68
|
|
|
67
69
|
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
68
70
|
MaybeNavigationMenuSidebar = NavigationMenuSidebar;
|
|
@@ -50,13 +50,7 @@ export default function NavigationMenu( { innerBlocks, id } ) {
|
|
|
50
50
|
}, [ updateBlockListSettings, innerBlocks ] );
|
|
51
51
|
return (
|
|
52
52
|
<>
|
|
53
|
-
<ListView
|
|
54
|
-
id={ id }
|
|
55
|
-
showNestedBlocks
|
|
56
|
-
expandNested={ false }
|
|
57
|
-
__experimentalFeatures
|
|
58
|
-
__experimentalPersistentListViewFeatures
|
|
59
|
-
/>
|
|
53
|
+
<ListView id={ id } />
|
|
60
54
|
</>
|
|
61
55
|
);
|
|
62
56
|
}
|
|
@@ -88,51 +88,8 @@
|
|
|
88
88
|
line-height: 1;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
.
|
|
93
|
-
.edit-site-global-styles-
|
|
94
|
-
|
|
95
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-bottom,
|
|
96
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-left {
|
|
97
|
-
.components-popover__content {
|
|
98
|
-
width: 282px;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
$split-border-control-offset: 55px;
|
|
103
|
-
|
|
104
|
-
@include break-medium() {
|
|
105
|
-
.edit-site-global-styles-sidebar__border-box-control__popover,
|
|
106
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-left {
|
|
107
|
-
.components-popover__content {
|
|
108
|
-
margin-right: #{ $grid-unit-50 + $grid-unit-15 } !important;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-top,
|
|
113
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-bottom {
|
|
114
|
-
.components-popover__content {
|
|
115
|
-
margin-right: #{ $grid-unit-50 + $grid-unit-15 + $split-border-control-offset } !important;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-right {
|
|
120
|
-
.components-popover__content {
|
|
121
|
-
margin-right: #{ $grid-unit-50 + $grid-unit-15 + ( $split-border-control-offset * 2 )} !important;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.edit-site-global-styles-sidebar__border-box-control__popover,
|
|
126
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-top,
|
|
127
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-right,
|
|
128
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-bottom,
|
|
129
|
-
.edit-site-global-styles-sidebar__border-box-control__popover-left {
|
|
130
|
-
&.is-from-top .components-popover__content {
|
|
131
|
-
margin-top: #{ -($grid-unit-50 + $grid-unit-15) } !important;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&.is-from-bottom .components-popover__content {
|
|
135
|
-
margin-bottom: #{ -($grid-unit-50 + $grid-unit-15) } !important;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
91
|
+
// Override the `hr` styles defined in the `ComplementaryArea` component
|
|
92
|
+
// from the `@wordpress/interface` package.
|
|
93
|
+
.edit-site-global-styles-sidebar hr {
|
|
94
|
+
margin: 0;
|
|
138
95
|
}
|
|
@@ -50,6 +50,9 @@ export default function TemplateDetails( { template, onClose } ) {
|
|
|
50
50
|
postId: undefined,
|
|
51
51
|
} );
|
|
52
52
|
|
|
53
|
+
// Only user-created and non-default templates can change the name.
|
|
54
|
+
const canEditTitle = template.is_custom && ! template.has_theme_file;
|
|
55
|
+
|
|
53
56
|
if ( ! template ) {
|
|
54
57
|
return null;
|
|
55
58
|
}
|
|
@@ -62,7 +65,7 @@ export default function TemplateDetails( { template, onClose } ) {
|
|
|
62
65
|
return (
|
|
63
66
|
<div className="edit-site-template-details">
|
|
64
67
|
<div className="edit-site-template-details__group">
|
|
65
|
-
{
|
|
68
|
+
{ canEditTitle ? (
|
|
66
69
|
<EditTemplateTitle template={ template } />
|
|
67
70
|
) : (
|
|
68
71
|
<Heading
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
__experimentalFetchUrlData as fetchUrlData,
|
|
14
14
|
} from '@wordpress/core-data';
|
|
15
15
|
import { store as editorStore } from '@wordpress/editor';
|
|
16
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
16
17
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
17
18
|
import { __ } from '@wordpress/i18n';
|
|
18
19
|
import { store as viewportStore } from '@wordpress/viewport';
|
|
@@ -64,8 +65,24 @@ export function reinitializeEditor( target, settings ) {
|
|
|
64
65
|
keepCaretInsideBlock: false,
|
|
65
66
|
welcomeGuide: true,
|
|
66
67
|
welcomeGuideStyles: true,
|
|
68
|
+
shouldListViewOpenByDefault: false,
|
|
67
69
|
} );
|
|
68
70
|
|
|
71
|
+
// Check if the block list view should be open by default.
|
|
72
|
+
if (
|
|
73
|
+
select( preferencesStore ).get(
|
|
74
|
+
'core/edit-site',
|
|
75
|
+
'showListViewByDefault'
|
|
76
|
+
)
|
|
77
|
+
) {
|
|
78
|
+
dispatch( editSiteStore ).setIsListViewOpened( true );
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
dispatch( interfaceStore ).setDefaultComplementaryArea(
|
|
82
|
+
'core/edit-site',
|
|
83
|
+
'edit-site/template'
|
|
84
|
+
);
|
|
85
|
+
|
|
69
86
|
dispatch( editSiteStore ).updateSettings( settings );
|
|
70
87
|
|
|
71
88
|
// Keep the defaultTemplateTypes in the core/editor settings too,
|
|
@@ -103,7 +120,6 @@ export function initializeEditor( id, settings ) {
|
|
|
103
120
|
settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>
|
|
104
121
|
fetchLinkSuggestions( search, searchOptions, settings );
|
|
105
122
|
settings.__experimentalFetchRichUrlData = fetchUrlData;
|
|
106
|
-
settings.__experimentalSpotlightEntityBlocks = [ 'core/template-part' ];
|
|
107
123
|
|
|
108
124
|
const target = document.getElementById( id );
|
|
109
125
|
|