@wordpress/edit-site 6.50.1-next.v.202607070741.0 → 7.0.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 +11 -0
- package/build/components/add-new-template/add-custom-template-modal-content.cjs +3 -3
- package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template/index.cjs +1 -1
- package/build/components/add-new-template/index.cjs.map +2 -2
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs +3 -3
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template-legacy/index.cjs +1 -1
- package/build/components/add-new-template-legacy/index.cjs.map +2 -2
- package/build/components/editor/index.cjs +23 -30
- package/build/components/editor/index.cjs.map +2 -2
- package/build/components/layout/index.cjs +1 -2
- package/build/components/layout/index.cjs.map +2 -2
- package/build/components/site-editor-routes/styles.cjs +4 -3
- package/build/components/site-editor-routes/styles.cjs.map +2 -2
- package/build/components/site-hub/index.cjs +9 -41
- package/build/components/site-hub/index.cjs.map +3 -3
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs +3 -3
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template/index.mjs +1 -1
- package/build-module/components/add-new-template/index.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs +3 -3
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/index.mjs +1 -1
- package/build-module/components/add-new-template-legacy/index.mjs.map +2 -2
- package/build-module/components/editor/index.mjs +24 -31
- package/build-module/components/editor/index.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +1 -2
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/styles.mjs +4 -3
- package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
- package/build-module/components/site-hub/index.mjs +11 -33
- package/build-module/components/site-hub/index.mjs.map +2 -2
- package/build-style/style-rtl.css +47 -149
- package/build-style/style.css +47 -149
- package/package.json +52 -52
- package/src/components/add-new-template/add-custom-template-modal-content.js +3 -3
- package/src/components/add-new-template/index.js +1 -1
- package/src/components/add-new-template-legacy/add-custom-template-modal-content.js +3 -3
- package/src/components/add-new-template-legacy/index.js +1 -1
- package/src/components/editor/index.js +25 -33
- package/src/components/editor/style.scss +0 -51
- package/src/components/layout/index.js +1 -3
- package/src/components/layout/style.scss +0 -55
- package/src/components/sidebar-button/style.scss +1 -9
- package/src/components/sidebar-navigation-item/style.scss +8 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
- package/src/components/site-editor-routes/styles.js +5 -2
- package/src/components/site-hub/index.js +10 -34
- package/src/components/site-hub/style.scss +5 -10
- package/src/style.scss +2 -0
|
@@ -16,7 +16,7 @@ import { useCallback } from '@wordpress/element';
|
|
|
16
16
|
import { store as noticesStore } from '@wordpress/notices';
|
|
17
17
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
18
18
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
19
|
-
import {
|
|
19
|
+
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
20
20
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
21
21
|
import { addQueryArgs } from '@wordpress/url';
|
|
22
22
|
|
|
@@ -205,39 +205,31 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
205
205
|
<BackButton>
|
|
206
206
|
{ ( { length } ) =>
|
|
207
207
|
length <= 1 && (
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
transition
|
|
226
|
-
'canvas-mode-view-transition',
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
} }
|
|
230
|
-
/>
|
|
231
|
-
<div className="edit-site-editor__back-icon">
|
|
232
|
-
<Icon
|
|
233
|
-
icon={
|
|
234
|
-
isRTL()
|
|
235
|
-
? chevronRight
|
|
236
|
-
: chevronLeft
|
|
208
|
+
<Button
|
|
209
|
+
size="compact"
|
|
210
|
+
label={ __( 'Open Navigation' ) }
|
|
211
|
+
showTooltip
|
|
212
|
+
tooltipPosition="middle right"
|
|
213
|
+
onClick={ () => {
|
|
214
|
+
resetZoomLevel();
|
|
215
|
+
setCurrentRevisionId( null );
|
|
216
|
+
history.navigate(
|
|
217
|
+
getNavigationPath(
|
|
218
|
+
location,
|
|
219
|
+
postWithTemplate
|
|
220
|
+
? context.postType
|
|
221
|
+
: postType
|
|
222
|
+
),
|
|
223
|
+
{
|
|
224
|
+
transition:
|
|
225
|
+
'canvas-mode-view-transition',
|
|
237
226
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
227
|
+
);
|
|
228
|
+
} }
|
|
229
|
+
icon={
|
|
230
|
+
isRTL() ? chevronRight : chevronLeft
|
|
231
|
+
}
|
|
232
|
+
/>
|
|
241
233
|
)
|
|
242
234
|
}
|
|
243
235
|
</BackButton>
|
|
@@ -22,54 +22,3 @@
|
|
|
22
22
|
display: flex;
|
|
23
23
|
justify-content: center;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
.edit-site-editor__view-mode-toggle {
|
|
27
|
-
view-transition-name: toggle;
|
|
28
|
-
position: relative;
|
|
29
|
-
top: 0;
|
|
30
|
-
left: 0;
|
|
31
|
-
height: $button-size-compact;
|
|
32
|
-
width: $button-size-compact;
|
|
33
|
-
z-index: 100;
|
|
34
|
-
|
|
35
|
-
.components-button {
|
|
36
|
-
color: $white;
|
|
37
|
-
height: 100%;
|
|
38
|
-
width: 100%;
|
|
39
|
-
border-radius: 0;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
padding: 0;
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
&:hover,
|
|
46
|
-
&:active {
|
|
47
|
-
color: $white;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:focus {
|
|
51
|
-
box-shadow: none;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&:hover .edit-site-editor__back-icon {
|
|
56
|
-
color: var(--wp-admin-theme-color);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.edit-site-editor__back-icon {
|
|
61
|
-
position: absolute;
|
|
62
|
-
top: 0;
|
|
63
|
-
left: 0;
|
|
64
|
-
width: $button-size-compact;
|
|
65
|
-
height: $button-size-compact;
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
background-color: transparent;
|
|
70
|
-
pointer-events: none;
|
|
71
|
-
|
|
72
|
-
svg {
|
|
73
|
-
fill: currentColor;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -95,6 +95,7 @@ function Layout() {
|
|
|
95
95
|
( desktopToggle ?? mobileToggleRef.current )?.focus();
|
|
96
96
|
}
|
|
97
97
|
// Should not depend on the previous canvas mode value but the next.
|
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
99
|
}, [ canvas ] );
|
|
99
100
|
|
|
100
101
|
return (
|
|
@@ -174,9 +175,6 @@ function Layout() {
|
|
|
174
175
|
{ showMobileSiteHub && (
|
|
175
176
|
<SiteHubMobile
|
|
176
177
|
ref={ mobileToggleRef }
|
|
177
|
-
isTransparent={
|
|
178
|
-
isResizableFrameOversized
|
|
179
|
-
}
|
|
180
178
|
/>
|
|
181
179
|
) }
|
|
182
180
|
{ areas.mobileContent ? (
|
|
@@ -177,61 +177,6 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
.edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region .edit-site-layout__view-mode-toggle {
|
|
181
|
-
display: none;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.edit-site-layout__view-mode-toggle.components-button {
|
|
185
|
-
view-transition-name: toggle;
|
|
186
|
-
position: relative;
|
|
187
|
-
color: var(--wpds-color-foreground-interactive-neutral);
|
|
188
|
-
height: $header-height;
|
|
189
|
-
width: $header-height;
|
|
190
|
-
overflow: hidden;
|
|
191
|
-
padding: 0;
|
|
192
|
-
display: flex;
|
|
193
|
-
align-items: center;
|
|
194
|
-
justify-content: center;
|
|
195
|
-
background: var(--wpds-color-background-surface-neutral-weak);
|
|
196
|
-
border-radius: 0;
|
|
197
|
-
|
|
198
|
-
&:hover,
|
|
199
|
-
&:active {
|
|
200
|
-
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
&:focus-visible,
|
|
204
|
-
&:focus {
|
|
205
|
-
box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color);
|
|
206
|
-
outline: 4px solid #0000;
|
|
207
|
-
outline-offset: 4px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
&::before {
|
|
211
|
-
content: "";
|
|
212
|
-
display: block;
|
|
213
|
-
position: absolute;
|
|
214
|
-
top: $grid-unit-10 + $border-width;
|
|
215
|
-
right: $grid-unit-10 + $border-width;
|
|
216
|
-
bottom: $grid-unit-10 + $border-width;
|
|
217
|
-
left: $grid-unit-20 + $border-width;
|
|
218
|
-
border-radius: $radius-medium;
|
|
219
|
-
box-shadow: none;
|
|
220
|
-
|
|
221
|
-
@media not (prefers-reduced-motion) {
|
|
222
|
-
transition: box-shadow 0.1s ease;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.edit-site-layout__view-mode-toggle-icon {
|
|
227
|
-
display: flex;
|
|
228
|
-
height: $header-height;
|
|
229
|
-
width: $header-height;
|
|
230
|
-
justify-content: center;
|
|
231
|
-
align-items: center;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
180
|
.edit-site-layout__actions {
|
|
236
181
|
z-index: z-index(".edit-site-layout__actions");
|
|
237
182
|
position: fixed !important; // Need to override the default relative positioning
|
|
@@ -2,17 +2,9 @@
|
|
|
2
2
|
color: var(--wpds-color-foreground-interactive-neutral);
|
|
3
3
|
flex-shrink: 0;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
&:focus:not(:disabled) {
|
|
7
|
-
box-shadow: none;
|
|
5
|
+
&:focus:not(:focus-visible) {
|
|
8
6
|
outline: none;
|
|
9
7
|
}
|
|
10
|
-
&:focus-visible:not(:disabled) {
|
|
11
|
-
box-shadow:
|
|
12
|
-
0 0 0 var(--wp-admin-border-width-focus)
|
|
13
|
-
var(--wp-admin-theme-color);
|
|
14
|
-
outline: 3px solid transparent;
|
|
15
|
-
}
|
|
16
8
|
|
|
17
9
|
&:hover:not(:disabled,[aria-disabled="true"]),
|
|
18
10
|
&:focus-visible,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/mixins";
|
|
1
2
|
@use "@wordpress/base-styles/variables" as *;
|
|
2
3
|
|
|
3
4
|
.edit-site-sidebar-navigation-item.components-item {
|
|
@@ -10,21 +11,24 @@
|
|
|
10
11
|
&:hover,
|
|
11
12
|
&:focus,
|
|
12
13
|
&[aria-current="true"] {
|
|
13
|
-
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
14
|
+
color: var(--wpds-color-foreground-interactive-neutral-weak-active);
|
|
14
15
|
|
|
15
16
|
.edit-site-sidebar-navigation-item__drilldown-indicator {
|
|
16
|
-
fill: var(--wpds-color-foreground-interactive-neutral-active);
|
|
17
|
+
fill: var(--wpds-color-foreground-interactive-neutral-weak-active);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
&[aria-current="true"] {
|
|
21
22
|
background: var(--wpds-color-background-interactive-neutral-weak-active);
|
|
22
|
-
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
23
|
-
font-weight:
|
|
23
|
+
color: var(--wpds-color-foreground-interactive-neutral-weak-active);
|
|
24
|
+
font-weight: var(--wpds-typography-font-weight-emphasis);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
// Make sure the focus style is drawn on top of the current item background.
|
|
27
28
|
&:focus-visible {
|
|
29
|
+
// TODO: remove once the <Item> component has migrated to the WPDS focus color token.
|
|
30
|
+
--wp-components-color-accent: var(--wpds-color-stroke-focus);
|
|
31
|
+
|
|
28
32
|
transform: translateZ(0);
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
&:hover,
|
|
28
28
|
&:focus,
|
|
29
29
|
&[aria-current] {
|
|
30
|
-
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
30
|
+
color: var(--wpds-color-foreground-interactive-neutral-weak-active);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
color: var(--wpds-color-foreground-interactive-neutral-weak);
|
|
36
36
|
&:hover,
|
|
37
37
|
&:focus {
|
|
38
|
-
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
38
|
+
color: var(--wpds-color-foreground-interactive-neutral-weak-active);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -16,7 +16,7 @@ import SidebarGlobalStyles from '../sidebar-global-styles';
|
|
|
16
16
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
17
17
|
const { StyleBookPreview } = unlock( editorPrivateApis );
|
|
18
18
|
|
|
19
|
-
function StylesPreviewArea() {
|
|
19
|
+
function StylesPreviewArea( { siteData } ) {
|
|
20
20
|
const { path, query } = useLocation();
|
|
21
21
|
const history = useHistory();
|
|
22
22
|
const isStylebook = query.preview === 'stylebook';
|
|
@@ -36,6 +36,7 @@ function StylesPreviewArea() {
|
|
|
36
36
|
<StyleBookPreview
|
|
37
37
|
path={ section }
|
|
38
38
|
onPathChange={ onChangeSection }
|
|
39
|
+
settings={ siteData.editorSettings }
|
|
39
40
|
/>
|
|
40
41
|
);
|
|
41
42
|
}
|
|
@@ -49,7 +50,9 @@ export const stylesRoute = {
|
|
|
49
50
|
areas: {
|
|
50
51
|
content: <SidebarGlobalStyles />,
|
|
51
52
|
sidebar: <SidebarNavigationScreenGlobalStyles backPath="/" />,
|
|
52
|
-
preview:
|
|
53
|
+
preview: ( { siteData } ) => (
|
|
54
|
+
<StylesPreviewArea siteData={ siteData } />
|
|
55
|
+
),
|
|
53
56
|
mobileContent: <SidebarGlobalStyles />,
|
|
54
57
|
},
|
|
55
58
|
widths: {
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
4
|
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import { Button
|
|
5
|
+
import { Button } from '@wordpress/components';
|
|
11
6
|
import { __, isRTL } from '@wordpress/i18n';
|
|
12
7
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
8
|
import { memo, forwardRef, useContext } from '@wordpress/element';
|
|
14
|
-
import {
|
|
9
|
+
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
15
10
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
16
11
|
|
|
17
12
|
/**
|
|
@@ -23,7 +18,7 @@ import { SidebarNavigationContext } from '../sidebar';
|
|
|
23
18
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
24
19
|
|
|
25
20
|
export const SiteHubMobile = memo(
|
|
26
|
-
forwardRef( (
|
|
21
|
+
forwardRef( ( props, ref ) => {
|
|
27
22
|
const { path } = useLocation();
|
|
28
23
|
const history = useHistory();
|
|
29
24
|
const { navigate } = useContext( SidebarNavigationContext );
|
|
@@ -81,32 +76,13 @@ export const SiteHubMobile = memo(
|
|
|
81
76
|
|
|
82
77
|
return (
|
|
83
78
|
<div className="edit-site-site-hub">
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
) }
|
|
92
|
-
>
|
|
93
|
-
<Button
|
|
94
|
-
__next40pxDefaultSize
|
|
95
|
-
ref={ ref }
|
|
96
|
-
className="edit-site-layout__view-mode-toggle"
|
|
97
|
-
style={ {
|
|
98
|
-
transform: 'scale(0.5)',
|
|
99
|
-
borderRadius: 4,
|
|
100
|
-
} }
|
|
101
|
-
{ ...backButtonProps }
|
|
102
|
-
>
|
|
103
|
-
<Icon
|
|
104
|
-
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
105
|
-
size={ 48 }
|
|
106
|
-
/>
|
|
107
|
-
</Button>
|
|
108
|
-
</div>
|
|
109
|
-
</HStack>
|
|
79
|
+
<Button
|
|
80
|
+
size="compact"
|
|
81
|
+
ref={ ref }
|
|
82
|
+
className="edit-site-site-hub__back-button"
|
|
83
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
84
|
+
{ ...backButtonProps }
|
|
85
|
+
/>
|
|
110
86
|
</div>
|
|
111
87
|
);
|
|
112
88
|
} )
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
.edit-site-site-hub {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
|
-
|
|
7
|
-
gap: $grid-unit-10;
|
|
8
|
-
margin-right: $grid-unit-15;
|
|
6
|
+
padding-left: $grid-unit-20;
|
|
9
7
|
height: $header-height;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
.edit-site-site-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
&.has-transparent-background .edit-site-layout__view-mode-toggle-icon {
|
|
18
|
-
background: transparent;
|
|
10
|
+
.edit-site-site-hub__back-button {
|
|
11
|
+
&:hover:not(:disabled, [aria-disabled="true"]),
|
|
12
|
+
&:active:not(:disabled, [aria-disabled="true"]) {
|
|
13
|
+
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
19
14
|
}
|
|
20
15
|
}
|
package/src/style.scss
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
display: block;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// stylelint-disable selector-class-pattern -- WordPress admin body classes use underscores by convention.
|
|
45
46
|
body.js #wpbody {
|
|
46
47
|
padding-top: 0;
|
|
47
48
|
}
|
|
@@ -64,6 +65,7 @@ body.js.site-editor-php {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
}
|
|
68
|
+
// stylelint-enable selector-class-pattern
|
|
67
69
|
|
|
68
70
|
.edit-site {
|
|
69
71
|
@include reset;
|