@wordpress/edit-site 3.0.15 → 3.0.18
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/build/components/add-new-template/new-template-part.js +29 -18
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +30 -23
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +51 -0
- package/build/components/app/index.js.map +1 -0
- package/build/components/block-editor/back-button.js +8 -20
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/index.js +2 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +0 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +20 -8
- package/build/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build/components/editor/index.js +11 -30
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -10
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/screen-root.js +8 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/header/document-actions/index.js +3 -6
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/list/added-by.js +9 -3
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/index.js +17 -15
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +4 -4
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +12 -13
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +26 -24
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +11 -0
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build/components/routes/index.js +60 -0
- package/build/components/routes/index.js.map +1 -0
- package/build/components/routes/link.js +65 -0
- package/build/components/routes/link.js.map +1 -0
- package/build/components/routes/use-title.js +57 -0
- package/build/components/routes/use-title.js.map +1 -0
- package/build/components/sidebar/global-styles-sidebar.js +10 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/template-card/template-areas.js +7 -4
- package/build/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build/components/template-details/index.js +12 -10
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +27 -10
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +7 -12
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/url-query-controller/index.js +41 -50
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +6 -0
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -28
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/styles.js +18 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/index.js +29 -35
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +3 -23
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/site-export.js +67 -0
- package/build/plugins/site-export.js.map +1 -0
- package/build/plugins/welcome-guide-menu-item.js +1 -7
- package/build/plugins/welcome-guide-menu-item.js.map +1 -1
- package/build/store/actions.js +0 -27
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -14
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +7 -16
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -31
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +23 -0
- package/build/utils/get-is-list-page.js.map +1 -0
- package/build/utils/history.js +35 -0
- package/build/utils/history.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +27 -16
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +28 -18
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +35 -0
- package/build-module/components/app/index.js.map +1 -0
- package/build-module/components/block-editor/back-button.js +8 -19
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/index.js +2 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +0 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +17 -9
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build-module/components/editor/index.js +13 -33
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +12 -11
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +9 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +3 -6
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/list/added-by.js +10 -4
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/index.js +15 -15
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +4 -4
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +13 -13
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +24 -24
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +12 -0
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build-module/components/routes/index.js +47 -0
- package/build-module/components/routes/index.js.map +1 -0
- package/build-module/components/routes/link.js +51 -0
- package/build-module/components/routes/link.js.map +1 -0
- package/build-module/components/routes/use-title.js +44 -0
- package/build-module/components/routes/use-title.js.map +1 -0
- package/build-module/components/sidebar/global-styles-sidebar.js +8 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-areas.js +8 -4
- package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build-module/components/template-details/index.js +10 -9
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +24 -9
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +7 -12
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +40 -49
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +7 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -26
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +18 -2
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/index.js +28 -33
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +2 -18
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/site-export.js +51 -0
- package/build-module/plugins/site-export.js.map +1 -0
- package/build-module/plugins/welcome-guide-menu-item.js +2 -7
- package/build-module/plugins/welcome-guide-menu-item.js.map +1 -1
- package/build-module/store/actions.js +0 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -11
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +7 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +1 -27
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +16 -0
- package/build-module/utils/get-is-list-page.js.map +1 -0
- package/build-module/utils/history.js +25 -0
- package/build-module/utils/history.js.map +1 -0
- package/build-style/style-rtl.css +7 -6
- package/build-style/style.css +7 -6
- package/package.json +18 -17
- package/src/components/add-new-template/new-template-part.js +29 -11
- package/src/components/add-new-template/new-template.js +26 -12
- package/src/components/app/index.js +47 -0
- package/src/components/block-editor/back-button.js +6 -14
- package/src/components/block-editor/index.js +1 -0
- package/src/components/create-template-part-modal/index.js +0 -2
- package/src/components/edit-template-part-menu-button/index.js +16 -5
- package/src/components/editor/index.js +105 -131
- package/src/components/global-styles/gradients-palette-panel.js +13 -13
- package/src/components/global-styles/screen-root.js +17 -7
- package/src/components/global-styles/style.scss +6 -0
- package/src/components/global-styles/test/use-global-styles-output.js +7 -1
- package/src/components/global-styles/use-global-styles-output.js +0 -1
- package/src/components/header/document-actions/index.js +3 -9
- package/src/components/list/added-by.js +25 -9
- package/src/components/list/index.js +11 -12
- package/src/components/list/style.scss +6 -11
- package/src/components/list/table.js +5 -5
- package/src/components/navigation-sidebar/index.js +18 -17
- package/src/components/navigation-sidebar/navigation-panel/index.js +16 -22
- package/src/components/navigation-sidebar/navigation-toggle/index.js +14 -0
- package/src/components/routes/index.js +53 -0
- package/src/components/routes/link.js +44 -0
- package/src/components/routes/use-title.js +56 -0
- package/src/components/sidebar/global-styles-sidebar.js +8 -0
- package/src/components/sidebar/template-card/template-areas.js +16 -4
- package/src/components/template-details/index.js +8 -6
- package/src/components/template-details/template-areas.js +31 -8
- package/src/components/template-part-converter/convert-to-template-part.js +4 -2
- package/src/components/url-query-controller/index.js +34 -45
- package/src/components/welcome-guide/editor.js +10 -1
- package/src/components/welcome-guide/index.js +6 -25
- package/src/components/welcome-guide/styles.js +20 -2
- package/src/index.js +33 -36
- package/src/plugins/index.js +2 -32
- package/src/plugins/site-export.js +52 -0
- package/src/plugins/welcome-guide-menu-item.js +2 -16
- package/src/store/actions.js +0 -23
- package/src/store/constants.js +0 -12
- package/src/store/reducer.js +12 -26
- package/src/store/selectors.js +1 -27
- package/src/store/test/reducer.js +22 -39
- package/src/store/test/selectors.js +3 -34
- package/src/utils/get-is-list-page.js +11 -0
- package/src/utils/history.js +35 -0
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect, useState, useMemo, useCallback } from '@wordpress/element';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import {
|
|
7
|
-
SlotFillProvider,
|
|
8
|
-
Popover,
|
|
9
|
-
Button,
|
|
10
|
-
Notice,
|
|
11
|
-
} from '@wordpress/components';
|
|
6
|
+
import { Popover, Button, Notice } from '@wordpress/components';
|
|
12
7
|
import { EntityProvider, store as coreStore } from '@wordpress/core-data';
|
|
13
8
|
import { BlockContextProvider, BlockBreadcrumb } from '@wordpress/block-editor';
|
|
14
9
|
import {
|
|
15
|
-
FullscreenMode,
|
|
16
10
|
InterfaceSkeleton,
|
|
17
11
|
ComplementaryArea,
|
|
18
12
|
store as interfaceStore,
|
|
@@ -21,8 +15,6 @@ import {
|
|
|
21
15
|
EditorNotices,
|
|
22
16
|
EditorSnackbars,
|
|
23
17
|
EntitiesSavedStates,
|
|
24
|
-
UnsavedChangesWarning,
|
|
25
|
-
store as editorStore,
|
|
26
18
|
} from '@wordpress/editor';
|
|
27
19
|
import { __ } from '@wordpress/i18n';
|
|
28
20
|
import { PluginArea } from '@wordpress/plugins';
|
|
@@ -47,13 +39,14 @@ import WelcomeGuide from '../welcome-guide';
|
|
|
47
39
|
import { store as editSiteStore } from '../../store';
|
|
48
40
|
import { GlobalStylesRenderer } from './global-styles-renderer';
|
|
49
41
|
import { GlobalStylesProvider } from '../global-styles/global-styles-provider';
|
|
42
|
+
import useTitle from '../routes/use-title';
|
|
50
43
|
|
|
51
44
|
const interfaceLabels = {
|
|
52
45
|
secondarySidebar: __( 'Block Library' ),
|
|
53
46
|
drawer: __( 'Navigation Sidebar' ),
|
|
54
47
|
};
|
|
55
48
|
|
|
56
|
-
function Editor( {
|
|
49
|
+
function Editor( { onError } ) {
|
|
57
50
|
const {
|
|
58
51
|
isInserterOpen,
|
|
59
52
|
isListViewOpen,
|
|
@@ -111,26 +104,7 @@ function Editor( { initialSettings, onError } ) {
|
|
|
111
104
|
).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),
|
|
112
105
|
};
|
|
113
106
|
}, [] );
|
|
114
|
-
const {
|
|
115
|
-
const { setPage, setIsInserterOpened, updateSettings } = useDispatch(
|
|
116
|
-
editSiteStore
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
useEffect( () => {
|
|
120
|
-
updateSettings( initialSettings );
|
|
121
|
-
}, [] );
|
|
122
|
-
|
|
123
|
-
// Keep the defaultTemplateTypes in the core/editor settings too,
|
|
124
|
-
// so that they can be selected with core/editor selectors in any editor.
|
|
125
|
-
// This is needed because edit-site doesn't initialize with EditorProvider,
|
|
126
|
-
// which internally uses updateEditorSettings as well.
|
|
127
|
-
const { defaultTemplateTypes, defaultTemplatePartAreas } = settings;
|
|
128
|
-
useEffect( () => {
|
|
129
|
-
updateEditorSettings( {
|
|
130
|
-
defaultTemplateTypes,
|
|
131
|
-
defaultTemplatePartAreas,
|
|
132
|
-
} );
|
|
133
|
-
}, [ defaultTemplateTypes, defaultTemplatePartAreas ] );
|
|
107
|
+
const { setPage, setIsInserterOpened } = useDispatch( editSiteStore );
|
|
134
108
|
|
|
135
109
|
const [
|
|
136
110
|
isEntitiesSavedStatesOpen,
|
|
@@ -189,120 +163,120 @@ function Editor( { initialSettings, onError } ) {
|
|
|
189
163
|
return null;
|
|
190
164
|
};
|
|
191
165
|
|
|
166
|
+
// Only announce the title once the editor is ready to prevent "Replace"
|
|
167
|
+
// action in <URlQueryController> from double-announcing.
|
|
168
|
+
useTitle( isReady && __( 'Editor (beta)' ) );
|
|
169
|
+
|
|
192
170
|
return (
|
|
193
171
|
<>
|
|
194
172
|
<URLQueryController />
|
|
195
173
|
{ isReady && (
|
|
196
174
|
<ShortcutProvider>
|
|
197
|
-
<
|
|
198
|
-
<EntityProvider
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
>
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
175
|
+
<EntityProvider kind="root" type="site">
|
|
176
|
+
<EntityProvider
|
|
177
|
+
kind="postType"
|
|
178
|
+
type={ templateType }
|
|
179
|
+
id={ entityId }
|
|
180
|
+
>
|
|
181
|
+
<GlobalStylesProvider>
|
|
182
|
+
<BlockContextProvider value={ blockContext }>
|
|
183
|
+
<GlobalStylesRenderer />
|
|
184
|
+
<ErrorBoundary onError={ onError }>
|
|
185
|
+
<KeyboardShortcuts.Register />
|
|
186
|
+
<SidebarComplementaryAreaFills />
|
|
187
|
+
<InterfaceSkeleton
|
|
188
|
+
labels={ interfaceLabels }
|
|
189
|
+
secondarySidebar={ secondarySidebar() }
|
|
190
|
+
sidebar={
|
|
191
|
+
sidebarIsOpened && (
|
|
192
|
+
<ComplementaryArea.Slot scope="core/edit-site" />
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
drawer={
|
|
196
|
+
<NavigationSidebar.Slot />
|
|
197
|
+
}
|
|
198
|
+
header={
|
|
199
|
+
<Header
|
|
200
|
+
openEntitiesSavedStates={
|
|
201
|
+
openEntitiesSavedStates
|
|
202
|
+
}
|
|
203
|
+
/>
|
|
204
|
+
}
|
|
205
|
+
notices={ <EditorSnackbars /> }
|
|
206
|
+
content={
|
|
207
|
+
<>
|
|
208
|
+
<EditorNotices />
|
|
209
|
+
{ template && (
|
|
210
|
+
<BlockEditor
|
|
211
|
+
setIsInserterOpen={
|
|
212
|
+
setIsInserterOpened
|
|
213
|
+
}
|
|
214
|
+
/>
|
|
215
|
+
) }
|
|
216
|
+
{ templateResolved &&
|
|
217
|
+
! template &&
|
|
218
|
+
settings?.siteUrl &&
|
|
219
|
+
entityId && (
|
|
220
|
+
<Notice
|
|
221
|
+
status="warning"
|
|
222
|
+
isDismissible={
|
|
223
|
+
false
|
|
224
|
+
}
|
|
225
|
+
>
|
|
226
|
+
{ __(
|
|
227
|
+
"You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
|
|
228
|
+
) }
|
|
229
|
+
</Notice>
|
|
230
|
+
) }
|
|
231
|
+
<KeyboardShortcuts
|
|
225
232
|
openEntitiesSavedStates={
|
|
226
233
|
openEntitiesSavedStates
|
|
227
234
|
}
|
|
228
235
|
/>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
setIsInserterOpened
|
|
238
|
-
}
|
|
239
|
-
/>
|
|
240
|
-
) }
|
|
241
|
-
{ templateResolved &&
|
|
242
|
-
! template &&
|
|
243
|
-
settings?.siteUrl &&
|
|
244
|
-
entityId && (
|
|
245
|
-
<Notice
|
|
246
|
-
status="warning"
|
|
247
|
-
isDismissible={
|
|
248
|
-
false
|
|
249
|
-
}
|
|
250
|
-
>
|
|
251
|
-
{ __(
|
|
252
|
-
"You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
|
|
253
|
-
) }
|
|
254
|
-
</Notice>
|
|
255
|
-
) }
|
|
256
|
-
<KeyboardShortcuts
|
|
257
|
-
openEntitiesSavedStates={
|
|
258
|
-
openEntitiesSavedStates
|
|
236
|
+
</>
|
|
237
|
+
}
|
|
238
|
+
actions={
|
|
239
|
+
<>
|
|
240
|
+
{ isEntitiesSavedStatesOpen ? (
|
|
241
|
+
<EntitiesSavedStates
|
|
242
|
+
close={
|
|
243
|
+
closeEntitiesSavedStates
|
|
259
244
|
}
|
|
260
245
|
/>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
closeEntitiesSavedStates
|
|
246
|
+
) : (
|
|
247
|
+
<div className="edit-site-editor__toggle-save-panel">
|
|
248
|
+
<Button
|
|
249
|
+
variant="secondary"
|
|
250
|
+
className="edit-site-editor__toggle-save-panel-button"
|
|
251
|
+
onClick={
|
|
252
|
+
openEntitiesSavedStates
|
|
269
253
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
next: nextShortcut,
|
|
295
|
-
} }
|
|
296
|
-
/>
|
|
297
|
-
<WelcomeGuide />
|
|
298
|
-
<Popover.Slot />
|
|
299
|
-
<PluginArea />
|
|
300
|
-
</ErrorBoundary>
|
|
301
|
-
</BlockContextProvider>
|
|
302
|
-
</GlobalStylesProvider>
|
|
303
|
-
</EntityProvider>
|
|
254
|
+
aria-expanded={
|
|
255
|
+
false
|
|
256
|
+
}
|
|
257
|
+
>
|
|
258
|
+
{ __(
|
|
259
|
+
'Open save panel'
|
|
260
|
+
) }
|
|
261
|
+
</Button>
|
|
262
|
+
</div>
|
|
263
|
+
) }
|
|
264
|
+
</>
|
|
265
|
+
}
|
|
266
|
+
footer={ <BlockBreadcrumb /> }
|
|
267
|
+
shortcuts={ {
|
|
268
|
+
previous: previousShortcut,
|
|
269
|
+
next: nextShortcut,
|
|
270
|
+
} }
|
|
271
|
+
/>
|
|
272
|
+
<WelcomeGuide />
|
|
273
|
+
<Popover.Slot />
|
|
274
|
+
<PluginArea />
|
|
275
|
+
</ErrorBoundary>
|
|
276
|
+
</BlockContextProvider>
|
|
277
|
+
</GlobalStylesProvider>
|
|
304
278
|
</EntityProvider>
|
|
305
|
-
</
|
|
279
|
+
</EntityProvider>
|
|
306
280
|
</ShortcutProvider>
|
|
307
281
|
) }
|
|
308
282
|
</>
|
|
@@ -9,8 +9,8 @@ import { noop } from 'lodash';
|
|
|
9
9
|
import {
|
|
10
10
|
__experimentalVStack as VStack,
|
|
11
11
|
__experimentalPaletteEdit as PaletteEdit,
|
|
12
|
+
__experimentalSpacer as Spacer,
|
|
12
13
|
DuotonePicker,
|
|
13
|
-
__experimentalHeading as Heading,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { __ } from '@wordpress/i18n';
|
|
16
16
|
|
|
@@ -18,6 +18,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
import { useSetting } from './hooks';
|
|
21
|
+
import Subtitle from './subtitle';
|
|
21
22
|
|
|
22
23
|
export default function GradientPalettePanel( { name } ) {
|
|
23
24
|
const [ themeGradients, setThemeGradients ] = useSetting(
|
|
@@ -53,18 +54,6 @@ export default function GradientPalettePanel( { name } ) {
|
|
|
53
54
|
className="edit-site-global-styles-gradient-palette-panel"
|
|
54
55
|
spacing={ 10 }
|
|
55
56
|
>
|
|
56
|
-
<div>
|
|
57
|
-
<Heading className="edit-site-global-styles-gradient-palette-panel__duotone-heading">
|
|
58
|
-
{ __( 'Duotone' ) }
|
|
59
|
-
</Heading>
|
|
60
|
-
<DuotonePicker
|
|
61
|
-
duotonePalette={ duotonePalette }
|
|
62
|
-
disableCustomDuotone={ true }
|
|
63
|
-
disableCustomColors={ true }
|
|
64
|
-
clearable={ false }
|
|
65
|
-
onChange={ noop }
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
57
|
{ !! themeGradients && !! themeGradients.length && (
|
|
69
58
|
<PaletteEdit
|
|
70
59
|
canReset={ themeGradients !== baseThemeGradients }
|
|
@@ -94,6 +83,17 @@ export default function GradientPalettePanel( { name } ) {
|
|
|
94
83
|
) }
|
|
95
84
|
slugPrefix="custom-"
|
|
96
85
|
/>
|
|
86
|
+
<div>
|
|
87
|
+
<Subtitle>{ __( 'Duotone' ) }</Subtitle>
|
|
88
|
+
<Spacer margin={ 3 } />
|
|
89
|
+
<DuotonePicker
|
|
90
|
+
duotonePalette={ duotonePalette }
|
|
91
|
+
disableCustomDuotone={ true }
|
|
92
|
+
disableCustomColors={ true }
|
|
93
|
+
clearable={ false }
|
|
94
|
+
onChange={ noop }
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
97
|
</VStack>
|
|
98
98
|
);
|
|
99
99
|
}
|
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
import {
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
6
|
__experimentalItem as Item,
|
|
7
|
+
__experimentalHStack as HStack,
|
|
8
|
+
FlexItem,
|
|
7
9
|
CardBody,
|
|
8
10
|
Card,
|
|
9
11
|
CardDivider,
|
|
10
12
|
} from '@wordpress/components';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
13
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
14
|
+
import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* Internal dependencies
|
|
@@ -33,14 +36,21 @@ function ScreenRoot() {
|
|
|
33
36
|
<CardBody>
|
|
34
37
|
<ItemGroup>
|
|
35
38
|
<Item>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
) }
|
|
40
|
-
</p>
|
|
39
|
+
{ __(
|
|
40
|
+
'Customize the appearance of specific blocks for the whole site.'
|
|
41
|
+
) }
|
|
41
42
|
</Item>
|
|
42
43
|
<NavigationButton path="/blocks">
|
|
43
|
-
|
|
44
|
+
<HStack justify="space-between">
|
|
45
|
+
<FlexItem>{ __( 'Blocks' ) }</FlexItem>
|
|
46
|
+
<FlexItem>
|
|
47
|
+
<Icon
|
|
48
|
+
icon={
|
|
49
|
+
isRTL() ? chevronLeft : chevronRight
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
</FlexItem>
|
|
53
|
+
</HStack>
|
|
44
54
|
</NavigationButton>
|
|
45
55
|
</ItemGroup>
|
|
46
56
|
</CardBody>
|
|
@@ -83,3 +83,9 @@ h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-he
|
|
|
83
83
|
font-size: 11px;
|
|
84
84
|
margin-bottom: $grid-unit-10;
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
.edit-site-screen-text-color__control,
|
|
88
|
+
.edit-site-screen-link-color__control,
|
|
89
|
+
.edit-site-screen-background-color__control {
|
|
90
|
+
padding: $grid-unit-20;
|
|
91
|
+
}
|
|
@@ -217,10 +217,16 @@ describe( 'global styles renderer', () => {
|
|
|
217
217
|
slug: 'black',
|
|
218
218
|
color: 'black',
|
|
219
219
|
},
|
|
220
|
+
{
|
|
221
|
+
name: 'White to Black',
|
|
222
|
+
slug: 'white2black',
|
|
223
|
+
color: 'value',
|
|
224
|
+
},
|
|
220
225
|
],
|
|
221
226
|
},
|
|
222
227
|
},
|
|
223
228
|
custom: {
|
|
229
|
+
white2black: 'value',
|
|
224
230
|
'font-primary': 'value',
|
|
225
231
|
'line-height': {
|
|
226
232
|
body: 1.7,
|
|
@@ -257,7 +263,7 @@ describe( 'global styles renderer', () => {
|
|
|
257
263
|
};
|
|
258
264
|
|
|
259
265
|
expect( toCustomProperties( tree, blockSelectors ) ).toEqual(
|
|
260
|
-
'body{--wp--preset--color--white: white;--wp--preset--color--black: black;--wp--custom--font-primary: value;--wp--custom--line-height--body: 1.7;--wp--custom--line-height--heading: 1.3;}h1,h2,h3,h4,h5,h6{--wp--preset--font-size--small: 12px;--wp--preset--font-size--medium: 23px;}'
|
|
266
|
+
'body{--wp--preset--color--white: white;--wp--preset--color--black: black;--wp--preset--color--white-2-black: value;--wp--custom--white-2-black: value;--wp--custom--font-primary: value;--wp--custom--line-height--body: 1.7;--wp--custom--line-height--heading: 1.3;}h1,h2,h3,h4,h5,h6{--wp--preset--font-size--small: 12px;--wp--preset--font-size--medium: 23px;}'
|
|
261
267
|
);
|
|
262
268
|
} );
|
|
263
269
|
} );
|
|
@@ -106,22 +106,16 @@ export default function DocumentActions( {
|
|
|
106
106
|
>
|
|
107
107
|
<Text
|
|
108
108
|
size="body"
|
|
109
|
-
className="edit-site-document-actions__title
|
|
109
|
+
className="edit-site-document-actions__title"
|
|
110
|
+
as="h1"
|
|
110
111
|
>
|
|
111
112
|
<VisuallyHidden as="span">
|
|
112
113
|
{ sprintf(
|
|
113
114
|
/* translators: %s: the entity being edited, like "template"*/
|
|
114
|
-
__( 'Editing %s:' ),
|
|
115
|
+
__( 'Editing %s: ' ),
|
|
115
116
|
entityLabel
|
|
116
117
|
) }
|
|
117
118
|
</VisuallyHidden>
|
|
118
|
-
</Text>
|
|
119
|
-
|
|
120
|
-
<Text
|
|
121
|
-
size="body"
|
|
122
|
-
className="edit-site-document-actions__title"
|
|
123
|
-
as="h1"
|
|
124
|
-
>
|
|
125
119
|
{ entityTitle }
|
|
126
120
|
</Text>
|
|
127
121
|
|
|
@@ -14,7 +14,11 @@ import {
|
|
|
14
14
|
import { store as coreStore } from '@wordpress/core-data';
|
|
15
15
|
import { useSelect } from '@wordpress/data';
|
|
16
16
|
import { useState } from '@wordpress/element';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
commentAuthorAvatar as authorIcon,
|
|
19
|
+
layout as themeIcon,
|
|
20
|
+
plugins as pluginIcon,
|
|
21
|
+
} from '@wordpress/icons';
|
|
18
22
|
import { __ } from '@wordpress/i18n';
|
|
19
23
|
|
|
20
24
|
const TEMPLATE_POST_TYPE_NAMES = [ 'wp_template', 'wp_template_part' ];
|
|
@@ -77,18 +81,30 @@ function AddedByAuthor( { id } ) {
|
|
|
77
81
|
] );
|
|
78
82
|
const [ isImageLoaded, setIsImageLoaded ] = useState( false );
|
|
79
83
|
|
|
84
|
+
const avatarURL = user?.avatar_urls?.[ 48 ];
|
|
85
|
+
const hasAvatar = !! avatarURL;
|
|
86
|
+
|
|
80
87
|
return (
|
|
81
88
|
<HStack alignment="left">
|
|
82
89
|
<div
|
|
83
|
-
className={ classnames(
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
className={ classnames(
|
|
91
|
+
hasAvatar
|
|
92
|
+
? 'edit-site-list-added-by__avatar'
|
|
93
|
+
: 'edit-site-list-added-by__icon',
|
|
94
|
+
{
|
|
95
|
+
'is-loaded': isImageLoaded,
|
|
96
|
+
}
|
|
97
|
+
) }
|
|
86
98
|
>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
{ hasAvatar ? (
|
|
100
|
+
<img
|
|
101
|
+
onLoad={ () => setIsImageLoaded( true ) }
|
|
102
|
+
alt=""
|
|
103
|
+
src={ avatarURL }
|
|
104
|
+
/>
|
|
105
|
+
) : (
|
|
106
|
+
<Icon icon={ authorIcon } />
|
|
107
|
+
) }
|
|
92
108
|
</div>
|
|
93
109
|
<span>{ user?.nickname }</span>
|
|
94
110
|
</HStack>
|
|
@@ -21,8 +21,14 @@ import Header from './header';
|
|
|
21
21
|
import NavigationSidebar from '../navigation-sidebar';
|
|
22
22
|
import Table from './table';
|
|
23
23
|
import { store as editSiteStore } from '../../store';
|
|
24
|
+
import { useLocation } from '../routes';
|
|
25
|
+
import useTitle from '../routes/use-title';
|
|
26
|
+
|
|
27
|
+
export default function List() {
|
|
28
|
+
const {
|
|
29
|
+
params: { postType: templateType },
|
|
30
|
+
} = useLocation();
|
|
24
31
|
|
|
25
|
-
export default function List( { templateType } ) {
|
|
26
32
|
useRegisterShortcuts();
|
|
27
33
|
|
|
28
34
|
const { previousShortcut, nextShortcut, isNavigationOpen } = useSelect(
|
|
@@ -47,6 +53,8 @@ export default function List( { templateType } ) {
|
|
|
47
53
|
[ templateType ]
|
|
48
54
|
);
|
|
49
55
|
|
|
56
|
+
useTitle( postType?.labels?.name );
|
|
57
|
+
|
|
50
58
|
// `postType` could load in asynchronously. Only provide the detailed region labels if
|
|
51
59
|
// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.
|
|
52
60
|
const itemsListLabel = postType?.labels?.items_list;
|
|
@@ -75,18 +83,9 @@ export default function List( { templateType } ) {
|
|
|
75
83
|
...detailedRegionLabels,
|
|
76
84
|
} }
|
|
77
85
|
header={ <Header templateType={ templateType } /> }
|
|
78
|
-
drawer={
|
|
79
|
-
<NavigationSidebar
|
|
80
|
-
activeTemplateType={ templateType }
|
|
81
|
-
isDefaultOpen
|
|
82
|
-
/>
|
|
83
|
-
}
|
|
86
|
+
drawer={ <NavigationSidebar.Slot /> }
|
|
84
87
|
notices={ <EditorSnackbars /> }
|
|
85
|
-
content={
|
|
86
|
-
<main className="edit-site-list-main">
|
|
87
|
-
<Table templateType={ templateType } />
|
|
88
|
-
</main>
|
|
89
|
-
}
|
|
88
|
+
content={ <Table templateType={ templateType } /> }
|
|
90
89
|
shortcuts={ {
|
|
91
90
|
previous: previousShortcut,
|
|
92
91
|
next: nextShortcut,
|
|
@@ -44,18 +44,13 @@
|
|
|
44
44
|
|
|
45
45
|
.interface-interface-skeleton__content {
|
|
46
46
|
background: $white;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: $grid-unit-20;
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
padding: $grid-unit-20;
|
|
56
|
-
|
|
57
|
-
@include break-medium() {
|
|
58
|
-
padding: $grid-unit * 9;
|
|
50
|
+
@include break-medium() {
|
|
51
|
+
padding: $grid-unit * 9;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
56
|
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
VisuallyHidden,
|
|
9
9
|
__experimentalHeading as Heading,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Internal dependencies
|
|
15
14
|
*/
|
|
15
|
+
import Link from '../routes/link';
|
|
16
16
|
import Actions from './actions';
|
|
17
17
|
import AddedBy from './added-by';
|
|
18
18
|
|
|
@@ -92,15 +92,15 @@ export default function Table( { templateType } ) {
|
|
|
92
92
|
>
|
|
93
93
|
<td className="edit-site-list-table-column" role="cell">
|
|
94
94
|
<Heading level={ 4 }>
|
|
95
|
-
<
|
|
96
|
-
|
|
95
|
+
<Link
|
|
96
|
+
params={ {
|
|
97
97
|
postId: template.id,
|
|
98
98
|
postType: template.type,
|
|
99
|
-
}
|
|
99
|
+
} }
|
|
100
100
|
>
|
|
101
101
|
{ template.title?.rendered ||
|
|
102
102
|
template.slug }
|
|
103
|
-
</
|
|
103
|
+
</Link>
|
|
104
104
|
</Heading>
|
|
105
105
|
{ template.description }
|
|
106
106
|
</td>
|
|
@@ -18,30 +18,31 @@ export const {
|
|
|
18
18
|
Slot: NavigationPanelPreviewSlot,
|
|
19
19
|
} = createSlotFill( 'EditSiteNavigationPanelPreview' );
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} )
|
|
21
|
+
const {
|
|
22
|
+
Fill: NavigationSidebarFill,
|
|
23
|
+
Slot: NavigationSidebarSlot,
|
|
24
|
+
} = createSlotFill( 'EditSiteNavigationSidebar' );
|
|
25
|
+
|
|
26
|
+
function NavigationSidebar( { isDefaultOpen = false, activeTemplateType } ) {
|
|
25
27
|
const isDesktopViewport = useViewportMatch( 'medium' );
|
|
26
28
|
const { setIsNavigationPanelOpened } = useDispatch( editSiteStore );
|
|
27
29
|
|
|
28
|
-
useEffect(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// When transitioning to mobile/tablet, close the navigation.
|
|
35
|
-
if ( ! isDesktopViewport ) {
|
|
36
|
-
setIsNavigationPanelOpened( false );
|
|
37
|
-
}
|
|
38
|
-
}, [ isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened ] );
|
|
30
|
+
useEffect(
|
|
31
|
+
function autoOpenNavigationPanelOnViewportChange() {
|
|
32
|
+
setIsNavigationPanelOpened( isDefaultOpen && isDesktopViewport );
|
|
33
|
+
},
|
|
34
|
+
[ isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened ]
|
|
35
|
+
);
|
|
39
36
|
|
|
40
37
|
return (
|
|
41
|
-
|
|
38
|
+
<NavigationSidebarFill>
|
|
42
39
|
<NavigationToggle />
|
|
43
40
|
<NavigationPanel activeItem={ activeTemplateType } />
|
|
44
41
|
<NavigationPanelPreviewSlot />
|
|
45
|
-
|
|
42
|
+
</NavigationSidebarFill>
|
|
46
43
|
);
|
|
47
44
|
}
|
|
45
|
+
|
|
46
|
+
NavigationSidebar.Slot = NavigationSidebarSlot;
|
|
47
|
+
|
|
48
|
+
export default NavigationSidebar;
|