@wordpress/edit-site 3.0.13 → 3.0.17
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 +10 -10
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +2 -1
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +2 -1
- package/build/components/global-styles/screen-link-color.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/screen-text-color.js +2 -1
- package/build/components/global-styles/screen-text-color.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/actions/index.js +1 -1
- package/build/components/list/actions/index.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 +31 -27
- 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/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 +13 -11
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +28 -11
- 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 +61 -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 +10 -10
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +2 -1
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +2 -1
- package/build-module/components/global-styles/screen-link-color.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/screen-text-color.js +2 -1
- package/build-module/components/global-styles/screen-text-color.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/actions/index.js +1 -1
- package/build-module/components/list/actions/index.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 +31 -27
- 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/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 +11 -10
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +25 -10
- 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 +45 -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 +2 -9
- package/build-style/style.css +2 -9
- package/package.json +9 -8
- 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 +12 -12
- package/src/components/global-styles/screen-background-color.js +1 -0
- package/src/components/global-styles/screen-link-color.js +1 -0
- package/src/components/global-styles/screen-root.js +17 -7
- package/src/components/global-styles/screen-text-color.js +1 -0
- package/src/components/global-styles/style.scss +3 -5
- 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/actions/index.js +1 -1
- package/src/components/list/index.js +11 -12
- package/src/components/list/style.scss +6 -11
- package/src/components/list/table.js +7 -6
- package/src/components/navigation-sidebar/index.js +18 -17
- package/src/components/navigation-sidebar/navigation-panel/index.js +16 -22
- 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 +9 -7
- package/src/components/template-details/template-areas.js +32 -9
- 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 +48 -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
|
</>
|
|
@@ -53,18 +53,6 @@ export default function GradientPalettePanel( { name } ) {
|
|
|
53
53
|
className="edit-site-global-styles-gradient-palette-panel"
|
|
54
54
|
spacing={ 10 }
|
|
55
55
|
>
|
|
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
56
|
{ !! themeGradients && !! themeGradients.length && (
|
|
69
57
|
<PaletteEdit
|
|
70
58
|
canReset={ themeGradients !== baseThemeGradients }
|
|
@@ -94,6 +82,18 @@ export default function GradientPalettePanel( { name } ) {
|
|
|
94
82
|
) }
|
|
95
83
|
slugPrefix="custom-"
|
|
96
84
|
/>
|
|
85
|
+
<div>
|
|
86
|
+
<Heading className="edit-site-global-styles-gradient-palette-panel__duotone-heading">
|
|
87
|
+
{ __( 'Duotone' ) }
|
|
88
|
+
</Heading>
|
|
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>
|
|
@@ -49,12 +49,10 @@
|
|
|
49
49
|
height: 24px;
|
|
50
50
|
width: 24px;
|
|
51
51
|
padding: 0;
|
|
52
|
-
background-image:
|
|
53
|
-
repeating-linear-gradient(45deg, $gray-200 25%, transparent 25%, transparent 75%, $gray-200 75%, $gray-200),
|
|
54
|
-
repeating-linear-gradient(45deg, $gray-200 25%, transparent 25%, transparent 75%, $gray-200 75%, $gray-200);
|
|
55
|
-
background-position: 0 0, 25px 25px;
|
|
56
|
-
background-size: calc(2 * 5px) calc(2 * 5px);
|
|
57
52
|
border: $border-width solid $gray-300;
|
|
53
|
+
|
|
54
|
+
// Show a diagonal line (crossed out) for empty swatches.
|
|
55
|
+
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
|
|
@@ -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
|
|
|
@@ -79,7 +79,7 @@ export default function Actions( { template } ) {
|
|
|
79
79
|
) }
|
|
80
80
|
{ isRevertable && (
|
|
81
81
|
<MenuItem
|
|
82
|
-
info={ __( 'Restore template to
|
|
82
|
+
info={ __( 'Restore template to default state' ) }
|
|
83
83
|
onClick={ () => {
|
|
84
84
|
revertAndSaveTemplate();
|
|
85
85
|
onClose();
|
|
@@ -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,14 +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
|
-
{ template.title
|
|
102
|
-
|
|
101
|
+
{ template.title?.rendered ||
|
|
102
|
+
template.slug }
|
|
103
|
+
</Link>
|
|
103
104
|
</Heading>
|
|
104
105
|
{ template.description }
|
|
105
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;
|