@wordpress/edit-site 6.50.1-next.v.202607070741.0 → 7.1.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 +13 -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/canvas-loader/index.cjs +8 -3
- package/build/components/canvas-loader/index.cjs.map +3 -3
- package/build/components/editor/index.cjs +23 -30
- package/build/components/editor/index.cjs.map +2 -2
- package/build/components/editor/use-editor-title.cjs +1 -2
- package/build/components/editor/use-editor-title.cjs.map +3 -3
- package/build/components/layout/index.cjs +1 -2
- package/build/components/layout/index.cjs.map +2 -2
- package/build/components/save-button/index.cjs +3 -3
- package/build/components/save-button/index.cjs.map +3 -3
- package/build/components/save-panel/index.cjs +7 -4
- package/build/components/save-panel/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +3 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +3 -3
- package/build/components/site-editor-routes/styles.cjs +18 -12
- 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/canvas-loader/index.mjs +9 -7
- package/build-module/components/canvas-loader/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/editor/use-editor-title.mjs +5 -3
- package/build-module/components/editor/use-editor-title.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/save-button/index.mjs +6 -6
- package/build-module/components/save-button/index.mjs.map +2 -2
- package/build-module/components/save-panel/index.mjs +9 -7
- package/build-module/components/save-panel/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +2 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/styles.mjs +18 -12
- 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 +66 -157
- package/build-style/style.css +66 -157
- package/package.json +52 -53
- 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/canvas-loader/index.js +6 -10
- package/src/components/canvas-loader/style.scss +3 -4
- package/src/components/editor/index.js +25 -33
- package/src/components/editor/style.scss +0 -51
- package/src/components/editor/use-editor-title.js +5 -3
- package/src/components/layout/index.js +1 -3
- package/src/components/layout/style.scss +0 -55
- package/src/components/save-button/index.js +6 -6
- package/src/components/save-panel/index.js +9 -7
- 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/index.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
- package/src/components/site-editor-routes/styles.js +22 -11
- package/src/components/site-hub/index.js +10 -34
- package/src/components/site-hub/style.scss +5 -10
- package/src/style.scss +2 -0
|
@@ -54,7 +54,7 @@ function SuggestionListItem( {
|
|
|
54
54
|
<WCText
|
|
55
55
|
size="body"
|
|
56
56
|
lineHeight={ 1.53846153846 } // 20px
|
|
57
|
-
weight=
|
|
57
|
+
weight="var(--wpds-typography-font-weight-emphasis)"
|
|
58
58
|
className={ `${ baseCssClass }__title` }
|
|
59
59
|
>
|
|
60
60
|
<TextHighlight
|
|
@@ -223,7 +223,7 @@ function AddCustomTemplateModalContent( {
|
|
|
223
223
|
>
|
|
224
224
|
<WCText
|
|
225
225
|
as="span"
|
|
226
|
-
weight=
|
|
226
|
+
weight="var(--wpds-typography-font-weight-emphasis)"
|
|
227
227
|
lineHeight={ 1.53846153846 } // 20px
|
|
228
228
|
>
|
|
229
229
|
{ entityForSuggestions.labels.all_items }
|
|
@@ -247,7 +247,7 @@ function AddCustomTemplateModalContent( {
|
|
|
247
247
|
>
|
|
248
248
|
<WCText
|
|
249
249
|
as="span"
|
|
250
|
-
weight=
|
|
250
|
+
weight="var(--wpds-typography-font-weight-emphasis)"
|
|
251
251
|
lineHeight={ 1.53846153846 } // 20px
|
|
252
252
|
>
|
|
253
253
|
{ entityForSuggestions.labels.singular_name }
|
|
@@ -54,7 +54,7 @@ function SuggestionListItem( {
|
|
|
54
54
|
<WCText
|
|
55
55
|
size="body"
|
|
56
56
|
lineHeight={ 1.53846153846 } // 20px
|
|
57
|
-
weight=
|
|
57
|
+
weight="var(--wpds-typography-font-weight-emphasis)"
|
|
58
58
|
className={ `${ baseCssClass }__title` }
|
|
59
59
|
>
|
|
60
60
|
<TextHighlight
|
|
@@ -225,7 +225,7 @@ function AddCustomTemplateModalContent( {
|
|
|
225
225
|
>
|
|
226
226
|
<WCText
|
|
227
227
|
as="span"
|
|
228
|
-
weight=
|
|
228
|
+
weight="var(--wpds-typography-font-weight-emphasis)"
|
|
229
229
|
lineHeight={ 1.53846153846 } // 20px
|
|
230
230
|
>
|
|
231
231
|
{ entityForSuggestions.labels.all_items }
|
|
@@ -249,7 +249,7 @@ function AddCustomTemplateModalContent( {
|
|
|
249
249
|
>
|
|
250
250
|
<WCText
|
|
251
251
|
as="span"
|
|
252
|
-
weight=
|
|
252
|
+
weight="var(--wpds-typography-font-weight-emphasis)"
|
|
253
253
|
lineHeight={ 1.53846153846 } // 20px
|
|
254
254
|
>
|
|
255
255
|
{ entityForSuggestions.labels.singular_name }
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
privateApis as componentsPrivateApis,
|
|
6
|
-
ProgressBar,
|
|
7
|
-
} from '@wordpress/components';
|
|
4
|
+
import { ProgressBar } from '@wordpress/components';
|
|
8
5
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
6
|
import { useSelect } from '@wordpress/data';
|
|
10
7
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
@@ -14,12 +11,10 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
|
14
11
|
*/
|
|
15
12
|
import { unlock } from '../../lock-unlock';
|
|
16
13
|
|
|
17
|
-
const { Theme } = unlock( componentsPrivateApis );
|
|
18
14
|
const { useStyle } = unlock( editorPrivateApis );
|
|
19
15
|
|
|
20
16
|
export default function CanvasLoader( { id } ) {
|
|
21
17
|
const textColor = useStyle( 'color.text' );
|
|
22
|
-
const backgroundColor = useStyle( 'color.background' );
|
|
23
18
|
const { elapsed, total } = useSelect( ( select ) => {
|
|
24
19
|
const selectorsByStatus = select( coreStore ).countSelectorsByStatus();
|
|
25
20
|
const resolving = selectorsByStatus.resolving ?? 0;
|
|
@@ -31,10 +26,11 @@ export default function CanvasLoader( { id } ) {
|
|
|
31
26
|
}, [] );
|
|
32
27
|
|
|
33
28
|
return (
|
|
34
|
-
<div
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
<div
|
|
30
|
+
className="edit-site-canvas-loader"
|
|
31
|
+
style={ textColor ? { '--color': textColor } : undefined }
|
|
32
|
+
>
|
|
33
|
+
<ProgressBar id={ id } max={ total } value={ elapsed } />
|
|
38
34
|
</div>
|
|
39
35
|
);
|
|
40
36
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
.edit-site-canvas-loader {
|
|
2
|
+
// TODO: Use design tokens with ThemeProvider.
|
|
3
|
+
--wp-components-color-foreground: var(--color);
|
|
4
|
+
|
|
2
5
|
width: 100%;
|
|
3
6
|
height: 100%;
|
|
4
7
|
display: flex;
|
|
@@ -13,10 +16,6 @@
|
|
|
13
16
|
animation: 0.5s ease 0.2s edit-site-canvas-loader__fade-in-animation;
|
|
14
17
|
animation-fill-mode: forwards;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
& > div {
|
|
18
|
-
width: 160px;
|
|
19
|
-
}
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
@keyframes edit-site-canvas-loader__fade-in-animation {
|
|
@@ -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
|
-
}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { _x, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
store as coreStore,
|
|
8
|
+
privateApis as coreDataPrivateApis,
|
|
9
|
+
} from '@wordpress/core-data';
|
|
7
10
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
|
-
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Internal dependencies
|
|
@@ -14,7 +16,7 @@ import useTitle from '../routes/use-title';
|
|
|
14
16
|
import { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
15
17
|
import { unlock } from '../../lock-unlock';
|
|
16
18
|
|
|
17
|
-
const { getTemplateInfo } = unlock(
|
|
19
|
+
const { getTemplateInfo } = unlock( coreDataPrivateApis );
|
|
18
20
|
|
|
19
21
|
function useEditorTitle( postType, postId ) {
|
|
20
22
|
const { title, isLoaded } = useSelect(
|
|
@@ -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
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { Button } from '@wordpress/components';
|
|
6
6
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
store as coreStore,
|
|
9
|
+
privateApis as coreDataPrivateApis,
|
|
10
|
+
} from '@wordpress/core-data';
|
|
8
11
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
9
12
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
|
-
import {
|
|
11
|
-
useEntitiesSavedStatesIsDirty,
|
|
12
|
-
store as editorStore,
|
|
13
|
-
} from '@wordpress/editor';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Internal dependencies
|
|
@@ -23,6 +22,7 @@ import {
|
|
|
23
22
|
import { unlock } from '../../lock-unlock';
|
|
24
23
|
|
|
25
24
|
const { useLocation } = unlock( routerPrivateApis );
|
|
25
|
+
const { useEntitiesSavedStatesIsDirty } = unlock( coreDataPrivateApis );
|
|
26
26
|
|
|
27
27
|
export default function SaveButton( {
|
|
28
28
|
className = 'edit-site-save-button__button',
|
|
@@ -35,7 +35,7 @@ export default function SaveButton( {
|
|
|
35
35
|
} ) {
|
|
36
36
|
const { params } = useLocation();
|
|
37
37
|
const { setIsSaveViewOpened } = useDispatch( editSiteStore );
|
|
38
|
-
const { saveDirtyEntities } = unlock( useDispatch(
|
|
38
|
+
const { saveDirtyEntities } = unlock( useDispatch( coreStore ) );
|
|
39
39
|
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
|
|
40
40
|
const { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(
|
|
41
41
|
( select ) => {
|
|
@@ -8,14 +8,12 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { NavigableRegion } from '@wordpress/admin-ui';
|
|
10
10
|
import { Button, Modal } from '@wordpress/components';
|
|
11
|
-
import {
|
|
12
|
-
EntitiesSavedStates,
|
|
13
|
-
useEntitiesSavedStatesIsDirty,
|
|
14
|
-
privateApis,
|
|
15
|
-
} from '@wordpress/editor';
|
|
16
11
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
12
|
import { __, sprintf } from '@wordpress/i18n';
|
|
18
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
store as coreStore,
|
|
15
|
+
privateApis as coreDataPrivateApis,
|
|
16
|
+
} from '@wordpress/core-data';
|
|
19
17
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
20
18
|
import { useEffect } from '@wordpress/element';
|
|
21
19
|
|
|
@@ -28,8 +26,12 @@ import { useActivateTheme } from '../../utils/use-activate-theme';
|
|
|
28
26
|
import { useActualCurrentTheme } from '../../utils/use-actual-current-theme';
|
|
29
27
|
import { isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
30
28
|
|
|
31
|
-
const { EntitiesSavedStatesExtensible } = unlock( privateApis );
|
|
32
29
|
const { useLocation } = unlock( routerPrivateApis );
|
|
30
|
+
const {
|
|
31
|
+
EntitiesSavedStatesExtensible,
|
|
32
|
+
EntitiesSavedStates,
|
|
33
|
+
useEntitiesSavedStatesIsDirty,
|
|
34
|
+
} = unlock( coreDataPrivateApis );
|
|
33
35
|
|
|
34
36
|
const EntitiesSavedStatesForPreview = ( {
|
|
35
37
|
onClose,
|
|
@@ -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
|
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
6
|
__experimentalItem as Item,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
|
-
import { getTemplatePartIcon } from '@wordpress/editor';
|
|
9
8
|
import { useMemo } from '@wordpress/element';
|
|
10
9
|
import { __ } from '@wordpress/i18n';
|
|
11
10
|
import { file } from '@wordpress/icons';
|
|
12
11
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
|
+
import { privateApis as coreDataPrivateApis } from '@wordpress/core-data';
|
|
13
13
|
import { useViewConfig } from '@wordpress/views';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -30,6 +30,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
30
30
|
const VIEW_CONFIG_FIELDS = [ 'view_list' ];
|
|
31
31
|
|
|
32
32
|
const { useLocation } = unlock( routerPrivateApis );
|
|
33
|
+
const { getTemplatePartIcon } = unlock( coreDataPrivateApis );
|
|
33
34
|
|
|
34
35
|
function CategoriesGroup( {
|
|
35
36
|
templatePartViews,
|
|
@@ -14,12 +14,12 @@ import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-gl
|
|
|
14
14
|
import SidebarGlobalStyles from '../sidebar-global-styles';
|
|
15
15
|
|
|
16
16
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
17
|
-
const { StyleBookPreview } = unlock( editorPrivateApis );
|
|
17
|
+
const { StyleBookPreview, useGlobalStyles } = unlock( editorPrivateApis );
|
|
18
18
|
|
|
19
|
-
function
|
|
19
|
+
function StyleBookPreviewArea( { siteData } ) {
|
|
20
20
|
const { path, query } = useLocation();
|
|
21
21
|
const history = useHistory();
|
|
22
|
-
const
|
|
22
|
+
const { user: userConfig } = useGlobalStyles();
|
|
23
23
|
|
|
24
24
|
// Get section from URL query params
|
|
25
25
|
const section = query.section ?? '/';
|
|
@@ -31,13 +31,22 @@ function StylesPreviewArea() {
|
|
|
31
31
|
);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
return (
|
|
35
|
+
<StyleBookPreview
|
|
36
|
+
path={ section }
|
|
37
|
+
onPathChange={ onChangeSection }
|
|
38
|
+
settings={ siteData.editorSettings }
|
|
39
|
+
// Without userConfig the preview falls back to the static `settings` styles and unsaved global styles edits are not shown.
|
|
40
|
+
userConfig={ userConfig }
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function StylesPreviewArea( { siteData } ) {
|
|
46
|
+
const { query } = useLocation();
|
|
47
|
+
|
|
48
|
+
if ( query.preview === 'stylebook' ) {
|
|
49
|
+
return <StyleBookPreviewArea siteData={ siteData } />;
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
return <Editor />;
|
|
@@ -49,7 +58,9 @@ export const stylesRoute = {
|
|
|
49
58
|
areas: {
|
|
50
59
|
content: <SidebarGlobalStyles />,
|
|
51
60
|
sidebar: <SidebarNavigationScreenGlobalStyles backPath="/" />,
|
|
52
|
-
preview:
|
|
61
|
+
preview: ( { siteData } ) => (
|
|
62
|
+
<StylesPreviewArea siteData={ siteData } />
|
|
63
|
+
),
|
|
53
64
|
mobileContent: <SidebarGlobalStyles />,
|
|
54
65
|
},
|
|
55
66
|
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
|
} )
|