@wordpress/edit-site 6.48.1 → 6.49.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 +2 -0
- package/build/components/add-new-post/index.cjs +0 -1
- package/build/components/add-new-post/index.cjs.map +2 -2
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs +0 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +0 -1
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +2 -2
- package/build/components/editor/use-editor-title.cjs +1 -1
- package/build/components/editor/use-editor-title.cjs.map +2 -2
- package/build/components/layout/index.cjs +30 -11
- package/build/components/layout/index.cjs.map +3 -3
- package/build/components/page-patterns/fields.cjs +2 -51
- package/build/components/page-patterns/fields.cjs.map +3 -3
- package/build/components/page-patterns/index.cjs +12 -23
- package/build/components/page-patterns/index.cjs.map +2 -2
- package/build/components/page-templates/index-legacy.cjs +8 -27
- package/build/components/page-templates/index-legacy.cjs.map +2 -2
- package/build/components/resizable-frame/index.cjs.map +2 -2
- package/build/components/routes/use-title.cjs +1 -1
- package/build/components/routes/use-title.cjs.map +2 -2
- package/build/components/save-button/index.cjs +2 -2
- package/build/components/save-button/index.cjs.map +1 -1
- package/build/components/save-hub/index.cjs +3 -3
- package/build/components/save-hub/index.cjs.map +3 -3
- package/build/components/sidebar-dataviews/index.cjs +3 -1
- package/build/components/sidebar-dataviews/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-item/index.cjs +17 -3
- package/build/components/sidebar-navigation-item/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs +2 -18
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-identity/index.cjs +0 -19
- package/build/components/sidebar-navigation-screen-identity/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-main/index.cjs +49 -56
- package/build/components/sidebar-navigation-screen-main/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +6 -3
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
- package/build/components/welcome-guide/editor.cjs +1 -1
- package/build/components/welcome-guide/editor.cjs.map +1 -1
- package/build/components/welcome-guide/page.cjs +1 -1
- package/build/components/welcome-guide/page.cjs.map +1 -1
- package/build/components/welcome-guide/template.cjs +1 -1
- package/build/components/welcome-guide/template.cjs.map +1 -1
- package/build-module/components/add-new-post/index.mjs +0 -1
- package/build-module/components/add-new-post/index.mjs.map +2 -2
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +0 -1
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs +1 -1
- package/build-module/components/editor/use-editor-title.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +26 -7
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/page-patterns/fields.mjs +2 -40
- package/build-module/components/page-patterns/fields.mjs.map +2 -2
- package/build-module/components/page-patterns/index.mjs +14 -29
- package/build-module/components/page-patterns/index.mjs.map +2 -2
- package/build-module/components/page-templates/index-legacy.mjs +9 -28
- package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
- package/build-module/components/resizable-frame/index.mjs.map +2 -2
- package/build-module/components/routes/use-title.mjs +1 -1
- package/build-module/components/routes/use-title.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs +2 -2
- package/build-module/components/save-button/index.mjs.map +1 -1
- package/build-module/components/save-hub/index.mjs +3 -3
- package/build-module/components/save-hub/index.mjs.map +2 -2
- package/build-module/components/sidebar-dataviews/index.mjs +3 -1
- package/build-module/components/sidebar-dataviews/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-item/index.mjs +18 -8
- package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs +2 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs +0 -15
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.mjs +50 -57
- package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +6 -3
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/welcome-guide/editor.mjs +1 -1
- package/build-module/components/welcome-guide/editor.mjs.map +1 -1
- package/build-module/components/welcome-guide/page.mjs +1 -1
- package/build-module/components/welcome-guide/page.mjs.map +1 -1
- package/build-module/components/welcome-guide/template.mjs +1 -1
- package/build-module/components/welcome-guide/template.mjs.map +1 -1
- package/build-style/{experimental-admin-bar-in-editor-rtl.css → experimental-omnibar-rtl.css} +46 -1
- package/build-style/{experimental-admin-bar-in-editor.css → experimental-omnibar.css} +46 -1
- package/build-style/style-rtl.css +250 -273
- package/build-style/style.css +250 -273
- package/package.json +48 -48
- package/src/components/add-new-post/index.js +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +0 -1
- package/src/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +0 -1
- package/src/components/layout/index.js +21 -11
- package/src/components/layout/style.scss +19 -12
- package/src/components/page-patterns/fields.js +1 -48
- package/src/components/page-patterns/index.js +17 -29
- package/src/components/page-patterns/style.scss +1 -1
- package/src/components/page-templates/index-legacy.js +9 -28
- package/src/components/page-templates/style.scss +0 -5
- package/src/components/resizable-frame/index.js +0 -1
- package/src/components/save-hub/index.js +4 -4
- package/src/components/save-hub/style.scss +3 -3
- package/src/components/sidebar-button/style.scss +2 -2
- package/src/components/sidebar-dataviews/index.js +3 -0
- package/src/components/sidebar-global-styles/style.scss +1 -1
- package/src/components/sidebar-navigation-item/index.js +22 -9
- package/src/components/sidebar-navigation-item/style.scss +6 -6
- package/src/components/sidebar-navigation-screen/style.scss +8 -8
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -15
- package/src/components/sidebar-navigation-screen-identity/index.js +0 -15
- package/src/components/sidebar-navigation-screen-main/index.js +49 -54
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +0 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +8 -8
- package/src/components/sidebar-navigation-screen-patterns/index.js +4 -0
- package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
- package/src/components/site-hub/style.scss +5 -5
- package/src/components/welcome-guide/page.js +1 -1
- package/src/{experimental-admin-bar-in-editor.scss → experimental-omnibar.scss} +3 -1
- package/src/style.scss +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.49.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -47,52 +47,52 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@react-spring/web": "^9.4.5",
|
|
50
|
-
"@wordpress/a11y": "^4.
|
|
51
|
-
"@wordpress/admin-ui": "^2.
|
|
52
|
-
"@wordpress/api-fetch": "^7.
|
|
53
|
-
"@wordpress/base-styles": "^10.0
|
|
54
|
-
"@wordpress/blob": "^4.
|
|
55
|
-
"@wordpress/block-editor": "^15.
|
|
56
|
-
"@wordpress/block-library": "^
|
|
57
|
-
"@wordpress/blocks": "^15.
|
|
58
|
-
"@wordpress/commands": "^1.
|
|
59
|
-
"@wordpress/components": "^
|
|
60
|
-
"@wordpress/compose": "^8.
|
|
61
|
-
"@wordpress/core-data": "^7.
|
|
62
|
-
"@wordpress/data": "^10.
|
|
63
|
-
"@wordpress/dataviews": "^
|
|
64
|
-
"@wordpress/date": "^5.
|
|
65
|
-
"@wordpress/deprecated": "^4.
|
|
66
|
-
"@wordpress/dom": "^4.
|
|
67
|
-
"@wordpress/editor": "^14.
|
|
68
|
-
"@wordpress/element": "^8.0
|
|
69
|
-
"@wordpress/escape-html": "^3.
|
|
70
|
-
"@wordpress/fields": "^0.
|
|
71
|
-
"@wordpress/global-styles-engine": "^1.
|
|
72
|
-
"@wordpress/global-styles-ui": "^1.
|
|
73
|
-
"@wordpress/hooks": "^4.
|
|
74
|
-
"@wordpress/html-entities": "^4.
|
|
75
|
-
"@wordpress/i18n": "^6.
|
|
76
|
-
"@wordpress/icons": "^
|
|
77
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
78
|
-
"@wordpress/keycodes": "^4.
|
|
79
|
-
"@wordpress/media-utils": "^5.
|
|
80
|
-
"@wordpress/notices": "^5.
|
|
81
|
-
"@wordpress/patterns": "^2.
|
|
82
|
-
"@wordpress/plugins": "^7.
|
|
83
|
-
"@wordpress/preferences": "^4.
|
|
84
|
-
"@wordpress/primitives": "^4.
|
|
85
|
-
"@wordpress/private-apis": "^1.
|
|
86
|
-
"@wordpress/reusable-blocks": "^5.
|
|
87
|
-
"@wordpress/router": "^1.
|
|
88
|
-
"@wordpress/style-engine": "^2.
|
|
89
|
-
"@wordpress/theme": "^0.
|
|
90
|
-
"@wordpress/ui": "^0.
|
|
91
|
-
"@wordpress/url": "^4.
|
|
92
|
-
"@wordpress/viewport": "^6.
|
|
93
|
-
"@wordpress/views": "^1.
|
|
94
|
-
"@wordpress/widgets": "^4.
|
|
95
|
-
"@wordpress/wordcount": "^4.
|
|
50
|
+
"@wordpress/a11y": "^4.49.0",
|
|
51
|
+
"@wordpress/admin-ui": "^2.4.0",
|
|
52
|
+
"@wordpress/api-fetch": "^7.49.0",
|
|
53
|
+
"@wordpress/base-styles": "^10.1.0",
|
|
54
|
+
"@wordpress/blob": "^4.49.0",
|
|
55
|
+
"@wordpress/block-editor": "^15.22.0",
|
|
56
|
+
"@wordpress/block-library": "^10.0.0",
|
|
57
|
+
"@wordpress/blocks": "^15.22.0",
|
|
58
|
+
"@wordpress/commands": "^1.49.0",
|
|
59
|
+
"@wordpress/components": "^36.0.0",
|
|
60
|
+
"@wordpress/compose": "^8.2.0",
|
|
61
|
+
"@wordpress/core-data": "^7.49.0",
|
|
62
|
+
"@wordpress/data": "^10.49.0",
|
|
63
|
+
"@wordpress/dataviews": "^17.0.0",
|
|
64
|
+
"@wordpress/date": "^5.49.0",
|
|
65
|
+
"@wordpress/deprecated": "^4.49.0",
|
|
66
|
+
"@wordpress/dom": "^4.49.0",
|
|
67
|
+
"@wordpress/editor": "^14.49.0",
|
|
68
|
+
"@wordpress/element": "^8.1.0",
|
|
69
|
+
"@wordpress/escape-html": "^3.49.0",
|
|
70
|
+
"@wordpress/fields": "^0.41.0",
|
|
71
|
+
"@wordpress/global-styles-engine": "^1.16.0",
|
|
72
|
+
"@wordpress/global-styles-ui": "^1.16.0",
|
|
73
|
+
"@wordpress/hooks": "^4.49.0",
|
|
74
|
+
"@wordpress/html-entities": "^4.49.0",
|
|
75
|
+
"@wordpress/i18n": "^6.22.0",
|
|
76
|
+
"@wordpress/icons": "^15.0.0",
|
|
77
|
+
"@wordpress/keyboard-shortcuts": "^5.49.0",
|
|
78
|
+
"@wordpress/keycodes": "^4.49.0",
|
|
79
|
+
"@wordpress/media-utils": "^5.49.0",
|
|
80
|
+
"@wordpress/notices": "^5.49.0",
|
|
81
|
+
"@wordpress/patterns": "^2.49.0",
|
|
82
|
+
"@wordpress/plugins": "^7.49.0",
|
|
83
|
+
"@wordpress/preferences": "^4.49.0",
|
|
84
|
+
"@wordpress/primitives": "^4.49.0",
|
|
85
|
+
"@wordpress/private-apis": "^1.49.0",
|
|
86
|
+
"@wordpress/reusable-blocks": "^5.49.0",
|
|
87
|
+
"@wordpress/router": "^1.49.0",
|
|
88
|
+
"@wordpress/style-engine": "^2.49.0",
|
|
89
|
+
"@wordpress/theme": "^0.16.0",
|
|
90
|
+
"@wordpress/ui": "^0.16.0",
|
|
91
|
+
"@wordpress/url": "^4.49.0",
|
|
92
|
+
"@wordpress/viewport": "^6.49.0",
|
|
93
|
+
"@wordpress/views": "^1.16.0",
|
|
94
|
+
"@wordpress/widgets": "^4.49.0",
|
|
95
|
+
"@wordpress/wordcount": "^4.49.0",
|
|
96
96
|
"change-case": "^4.1.2",
|
|
97
97
|
"clsx": "^2.1.1",
|
|
98
98
|
"colord": "^2.9.3",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"publishConfig": {
|
|
108
108
|
"access": "public"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "0e7112a4f4fde4ea15bd9060489b8f6fe11eb6ca"
|
|
111
111
|
}
|
|
@@ -98,7 +98,6 @@ export default function AddNewPostModal( { postType, onSave, onClose } ) {
|
|
|
98
98
|
<form onSubmit={ createPost }>
|
|
99
99
|
<VStack spacing={ 4 }>
|
|
100
100
|
<TextControl
|
|
101
|
-
__next40pxDefaultSize
|
|
102
101
|
label={ __( 'Title' ) }
|
|
103
102
|
onChange={ setTitle }
|
|
104
103
|
placeholder={ __( 'No title' ) }
|
|
@@ -27,12 +27,11 @@ import {
|
|
|
27
27
|
privateApis as editorPrivateApis,
|
|
28
28
|
} from '@wordpress/editor';
|
|
29
29
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
30
|
-
import {
|
|
30
|
+
import { ThemeProvider } from '@wordpress/theme';
|
|
31
31
|
import { PluginArea } from '@wordpress/plugins';
|
|
32
32
|
import { SnackbarNotices, store as noticesStore } from '@wordpress/notices';
|
|
33
33
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
34
34
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
35
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
36
35
|
import { Tooltip } from '@wordpress/ui';
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -50,7 +49,6 @@ import SavePanel from '../save-panel';
|
|
|
50
49
|
|
|
51
50
|
const { useLocation } = unlock( routerPrivateApis );
|
|
52
51
|
const { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );
|
|
53
|
-
const { ThemeProvider } = unlock( themePrivateApis );
|
|
54
52
|
|
|
55
53
|
const ANIMATION_DURATION = 0.3;
|
|
56
54
|
const CONTENT_COLOR = { background: '#ffffff' };
|
|
@@ -184,10 +182,18 @@ function Layout() {
|
|
|
184
182
|
}
|
|
185
183
|
/>
|
|
186
184
|
) }
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
{ areas.mobileContent ? (
|
|
186
|
+
/*
|
|
187
|
+
* ThemeProvider wraps SidebarContent (rather than
|
|
188
|
+
* just the content) so the scroll wrapper it renders
|
|
189
|
+
* inherits the content background tokens. See
|
|
190
|
+
* `.edit-site-sidebar__screen-wrapper` in style.scss.
|
|
191
|
+
*/
|
|
192
|
+
<ThemeProvider
|
|
193
|
+
color={ CONTENT_COLOR }
|
|
194
|
+
>
|
|
195
|
+
<SidebarContent
|
|
196
|
+
routeKey={ routeKey }
|
|
191
197
|
>
|
|
192
198
|
<div className="edit-site-layout__mobile-content">
|
|
193
199
|
<ErrorBoundary>
|
|
@@ -196,13 +202,17 @@ function Layout() {
|
|
|
196
202
|
}
|
|
197
203
|
</ErrorBoundary>
|
|
198
204
|
</div>
|
|
199
|
-
</
|
|
200
|
-
|
|
205
|
+
</SidebarContent>
|
|
206
|
+
</ThemeProvider>
|
|
207
|
+
) : (
|
|
208
|
+
<SidebarContent
|
|
209
|
+
routeKey={ routeKey }
|
|
210
|
+
>
|
|
201
211
|
<ErrorBoundary>
|
|
202
212
|
{ areas.mobileSidebar }
|
|
203
213
|
</ErrorBoundary>
|
|
204
|
-
|
|
205
|
-
|
|
214
|
+
</SidebarContent>
|
|
215
|
+
) }
|
|
206
216
|
<SaveHub />
|
|
207
217
|
<SavePanel />
|
|
208
218
|
</>
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
.edit-site-layout {
|
|
6
6
|
height: 100%;
|
|
7
|
-
background: var(--wpds-color-
|
|
8
|
-
color: var(--wpds-color-
|
|
7
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
8
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
|
|
12
12
|
// Show a dark background in "frame" mode to avoid edge artifacts.
|
|
13
13
|
&:not(.is-full-canvas) .editor-visual-editor {
|
|
14
|
-
background: var(--wpds-color-
|
|
14
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -84,7 +84,14 @@
|
|
|
84
84
|
display: flex;
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
flex-grow: 1;
|
|
87
|
-
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// On mobile, the content surface lives on the scroll wrapper
|
|
90
|
+
// (not the inner content element) so it also covers the wrapper's
|
|
91
|
+
// reserved scrollbar gutter, preventing the theme background color from
|
|
92
|
+
// bleeding through.
|
|
93
|
+
.edit-site-sidebar__screen-wrapper:has(.edit-site-layout__mobile-content) {
|
|
94
|
+
background: var(--wpds-color-background-surface-neutral);
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
.edit-site-layout__canvas-container {
|
|
@@ -110,7 +117,7 @@
|
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
.edit-site-resizable-frame__inner {
|
|
113
|
-
color: var(--wpds-color-
|
|
120
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
114
121
|
}
|
|
115
122
|
|
|
116
123
|
@include break-medium {
|
|
@@ -128,7 +135,7 @@
|
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
.edit-site-layout:not(.is-full-canvas) & {
|
|
131
|
-
border-radius:
|
|
138
|
+
border-radius: var(--wpds-border-radius-xl);
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
&:hover {
|
|
@@ -179,7 +186,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
179
186
|
view-transition-name: toggle;
|
|
180
187
|
/* stylelint-enable */
|
|
181
188
|
position: relative;
|
|
182
|
-
color: var(--wpds-color-
|
|
189
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
183
190
|
height: $header-height;
|
|
184
191
|
width: $header-height;
|
|
185
192
|
overflow: hidden;
|
|
@@ -187,12 +194,12 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
187
194
|
display: flex;
|
|
188
195
|
align-items: center;
|
|
189
196
|
justify-content: center;
|
|
190
|
-
background: var(--wpds-color-
|
|
197
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
191
198
|
border-radius: 0;
|
|
192
199
|
|
|
193
200
|
&:hover,
|
|
194
201
|
&:active {
|
|
195
|
-
color: var(--wpds-color-
|
|
202
|
+
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
196
203
|
}
|
|
197
204
|
|
|
198
205
|
&:focus-visible,
|
|
@@ -235,8 +242,8 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
235
242
|
left: auto;
|
|
236
243
|
right: 0;
|
|
237
244
|
width: $sidebar-width;
|
|
238
|
-
color: var(--wpds-color-
|
|
239
|
-
background: var(--wpds-color-
|
|
245
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
246
|
+
background: var(--wpds-color-background-surface-neutral-strong);
|
|
240
247
|
|
|
241
248
|
&:focus,
|
|
242
249
|
&:focus-within {
|
|
@@ -264,7 +271,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
264
271
|
overflow: hidden;
|
|
265
272
|
box-shadow: $elevation-x-small;
|
|
266
273
|
@include break-medium() {
|
|
267
|
-
border-radius:
|
|
274
|
+
border-radius: var(--wpds-border-radius-xl);
|
|
268
275
|
margin: $canvas-padding $canvas-padding $canvas-padding 0;
|
|
269
276
|
}
|
|
270
277
|
}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
|
-
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
10
4
|
import { __, _x } from '@wordpress/i18n';
|
|
11
|
-
import {
|
|
5
|
+
import { useMemo, useId } from '@wordpress/element';
|
|
12
6
|
import { BlockPreview } from '@wordpress/block-editor';
|
|
13
|
-
import { Icon } from '@wordpress/icons';
|
|
14
7
|
import { parse } from '@wordpress/blocks';
|
|
15
8
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
16
9
|
|
|
@@ -22,7 +15,6 @@ import {
|
|
|
22
15
|
PATTERN_SYNC_TYPES,
|
|
23
16
|
OPERATOR_IS,
|
|
24
17
|
} from '../../utils/constants';
|
|
25
|
-
import { useAddedBy } from '../page-templates/hooks';
|
|
26
18
|
import { unlock } from '../../lock-unlock';
|
|
27
19
|
|
|
28
20
|
const { useStyle } = unlock( editorPrivateApis );
|
|
@@ -117,42 +109,3 @@ export const patternStatusField = {
|
|
|
117
109
|
},
|
|
118
110
|
enableSorting: false,
|
|
119
111
|
};
|
|
120
|
-
|
|
121
|
-
function AuthorField( { item } ) {
|
|
122
|
-
const [ isImageLoaded, setIsImageLoaded ] = useState( false );
|
|
123
|
-
const { text, icon, imageUrl } = useAddedBy( item.type, item.id );
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<HStack alignment="left" spacing={ 0 }>
|
|
127
|
-
{ imageUrl && (
|
|
128
|
-
<div
|
|
129
|
-
className={ clsx( 'fields-controls__author-avatar', {
|
|
130
|
-
'is-loaded': isImageLoaded,
|
|
131
|
-
} ) }
|
|
132
|
-
>
|
|
133
|
-
<img
|
|
134
|
-
onLoad={ () => setIsImageLoaded( true ) }
|
|
135
|
-
alt=""
|
|
136
|
-
src={ imageUrl }
|
|
137
|
-
/>
|
|
138
|
-
</div>
|
|
139
|
-
) }
|
|
140
|
-
{ ! imageUrl && (
|
|
141
|
-
<div className="fields-controls__author-icon">
|
|
142
|
-
<Icon icon={ icon } />
|
|
143
|
-
</div>
|
|
144
|
-
) }
|
|
145
|
-
<span className="fields-controls__author-name">{ text }</span>
|
|
146
|
-
</HStack>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export const templatePartAuthorField = {
|
|
151
|
-
label: __( 'Author' ),
|
|
152
|
-
id: 'author',
|
|
153
|
-
getValue: ( { item } ) => item.author_text,
|
|
154
|
-
render: AuthorField,
|
|
155
|
-
filterBy: {
|
|
156
|
-
isPrimary: true,
|
|
157
|
-
},
|
|
158
|
-
};
|
|
@@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
import { useMemo } from '@wordpress/element';
|
|
7
7
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
8
|
import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
|
|
9
|
-
import {
|
|
9
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
10
10
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
11
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
12
|
import { useView, useViewConfig } from '@wordpress/views';
|
|
@@ -26,18 +26,16 @@ import { unlock } from '../../lock-unlock';
|
|
|
26
26
|
import usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';
|
|
27
27
|
import PatternsActions from './actions';
|
|
28
28
|
import { useEditPostAction } from '../dataviews-actions';
|
|
29
|
-
import {
|
|
30
|
-
patternStatusField,
|
|
31
|
-
previewField,
|
|
32
|
-
templatePartAuthorField,
|
|
33
|
-
} from './fields';
|
|
29
|
+
import { patternStatusField, previewField } from './fields';
|
|
34
30
|
import usePatternCategories from '../sidebar-navigation-screen-patterns/use-pattern-categories';
|
|
35
31
|
|
|
36
32
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
37
|
-
const { usePostActions, patternTitleField } =
|
|
33
|
+
const { usePostActions, usePostFields, patternTitleField } =
|
|
34
|
+
unlock( editorPrivateApis );
|
|
38
35
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
39
36
|
|
|
40
37
|
const EMPTY_ARRAY = [];
|
|
38
|
+
const VIEW_CONFIG_FIELDS = [ 'default_view', 'default_layouts' ];
|
|
41
39
|
|
|
42
40
|
function usePagePatternsHeader( type, categoryId ) {
|
|
43
41
|
const { patternCategories } = usePatternCategories();
|
|
@@ -76,6 +74,7 @@ export default function DataviewsPatterns() {
|
|
|
76
74
|
useViewConfig( {
|
|
77
75
|
kind: 'postType',
|
|
78
76
|
name: postType,
|
|
77
|
+
fields: VIEW_CONFIG_FIELDS,
|
|
79
78
|
} );
|
|
80
79
|
const { view, updateView, isModified, resetToDefault } = useView( {
|
|
81
80
|
kind: 'postType',
|
|
@@ -105,38 +104,27 @@ export default function DataviewsPatterns() {
|
|
|
105
104
|
syncStatus: viewSyncStatus,
|
|
106
105
|
} );
|
|
107
106
|
|
|
108
|
-
const
|
|
109
|
-
|
|
107
|
+
const templatePartFields = usePostFields( {
|
|
108
|
+
postType: TEMPLATE_PART_POST_TYPE,
|
|
110
109
|
} );
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return EMPTY_ARRAY;
|
|
115
|
-
}
|
|
116
|
-
const authorsSet = new Set();
|
|
117
|
-
records.forEach( ( template ) => {
|
|
118
|
-
authorsSet.add( template.author_text );
|
|
119
|
-
} );
|
|
120
|
-
return Array.from( authorsSet ).map( ( author ) => ( {
|
|
121
|
-
value: author,
|
|
122
|
-
label: author,
|
|
123
|
-
} ) );
|
|
124
|
-
}, [ records ] );
|
|
110
|
+
const templatePartAuthorField = templatePartFields.find(
|
|
111
|
+
( field ) => field.id === 'author'
|
|
112
|
+
);
|
|
125
113
|
|
|
126
114
|
const fields = useMemo( () => {
|
|
127
115
|
const _fields = [ previewField, patternTitleField ];
|
|
128
116
|
|
|
129
117
|
if ( postType === PATTERN_TYPES.user ) {
|
|
130
118
|
_fields.push( patternStatusField );
|
|
131
|
-
} else if (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
} else if (
|
|
120
|
+
postType === TEMPLATE_PART_POST_TYPE &&
|
|
121
|
+
templatePartAuthorField
|
|
122
|
+
) {
|
|
123
|
+
_fields.push( templatePartAuthorField );
|
|
136
124
|
}
|
|
137
125
|
|
|
138
126
|
return _fields;
|
|
139
|
-
}, [ postType,
|
|
127
|
+
}, [ postType, templatePartAuthorField ] );
|
|
140
128
|
|
|
141
129
|
const { data, paginationInfo } = useMemo( () => {
|
|
142
130
|
// Search is managed server-side as well as filters for patterns.
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
box-shadow: 0 0 0.5px 0.5px var(--wp-admin-theme-color);
|
|
93
93
|
box-sizing: border-box;
|
|
94
94
|
z-index: 1;
|
|
95
|
-
background-color: var(--wpds-color-
|
|
95
|
+
background-color: var(--wpds-color-background-surface-neutral-strong);
|
|
96
96
|
width: calc(100% + 2px); // Account for the border width of the token field.
|
|
97
97
|
left: -1px;
|
|
98
98
|
min-width: initial;
|
|
@@ -19,12 +19,14 @@ import AddNewTemplate from '../add-new-template-legacy';
|
|
|
19
19
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
20
20
|
import { unlock } from '../../lock-unlock';
|
|
21
21
|
import { useEditPostAction } from '../dataviews-actions';
|
|
22
|
-
import {
|
|
22
|
+
import { previewField } from './fields';
|
|
23
23
|
|
|
24
|
-
const { usePostActions,
|
|
24
|
+
const { usePostActions, usePostFields } = unlock( editorPrivateApis );
|
|
25
25
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
26
26
|
const { useEntityRecordsWithPermissions } = unlock( corePrivateApis );
|
|
27
27
|
|
|
28
|
+
const VIEW_CONFIG_FIELDS = [ 'default_view', 'default_layouts', 'view_list' ];
|
|
29
|
+
|
|
28
30
|
export default function PageTemplates() {
|
|
29
31
|
const { path, query } = useLocation();
|
|
30
32
|
const { activeView = 'all', postId } = query;
|
|
@@ -37,6 +39,7 @@ export default function PageTemplates() {
|
|
|
37
39
|
} = useViewConfig( {
|
|
38
40
|
kind: 'postType',
|
|
39
41
|
name: TEMPLATE_POST_TYPE,
|
|
42
|
+
fields: VIEW_CONFIG_FIELDS,
|
|
40
43
|
} );
|
|
41
44
|
const activeViewOverrides = useMemo(
|
|
42
45
|
() => viewList?.find( ( v ) => v.slug === activeView )?.view ?? {},
|
|
@@ -83,32 +86,10 @@ export default function PageTemplates() {
|
|
|
83
86
|
[ history, path, view?.type ]
|
|
84
87
|
);
|
|
85
88
|
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const authorsSet = new Set();
|
|
91
|
-
records.forEach( ( template ) => {
|
|
92
|
-
authorsSet.add( template.author_text );
|
|
93
|
-
} );
|
|
94
|
-
return Array.from( authorsSet ).map( ( author ) => ( {
|
|
95
|
-
value: author,
|
|
96
|
-
label: author,
|
|
97
|
-
} ) );
|
|
98
|
-
}, [ records ] );
|
|
99
|
-
|
|
100
|
-
const fields = useMemo(
|
|
101
|
-
() => [
|
|
102
|
-
previewField,
|
|
103
|
-
templateTitleField,
|
|
104
|
-
descriptionField,
|
|
105
|
-
{
|
|
106
|
-
...authorField,
|
|
107
|
-
elements: authors,
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
[ authors ]
|
|
111
|
-
);
|
|
89
|
+
const postFields = usePostFields( { postType: TEMPLATE_POST_TYPE } );
|
|
90
|
+
const fields = useMemo( () => {
|
|
91
|
+
return [ previewField, ...( postFields || [] ) ];
|
|
92
|
+
}, [ postFields ] );
|
|
112
93
|
|
|
113
94
|
const { data, paginationInfo } = useMemo( () => {
|
|
114
95
|
return filterSortAndPaginate( records, view, fields );
|
|
@@ -35,9 +35,4 @@
|
|
|
35
35
|
.edit-site-list__rename-modal {
|
|
36
36
|
// The rename dropdown popover is open at the same time as the rename modal. The latter has to be higher.
|
|
37
37
|
z-index: z-index(".edit-site-list__rename-modal");
|
|
38
|
-
.components-base-control {
|
|
39
|
-
@include break-medium() {
|
|
40
|
-
width: $grid-unit * 40;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
38
|
}
|
|
@@ -17,7 +17,6 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
17
17
|
import { useSelect } from '@wordpress/data';
|
|
18
18
|
import { store as coreStore } from '@wordpress/core-data';
|
|
19
19
|
import { addQueryArgs } from '@wordpress/url';
|
|
20
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
|
|
21
20
|
import { Tooltip } from '@wordpress/ui';
|
|
22
21
|
|
|
23
22
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import {
|
|
5
|
+
import { Stack } from '@wordpress/ui';
|
|
6
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
7
|
import { check } from '@wordpress/icons';
|
|
8
8
|
|
|
@@ -28,15 +28,15 @@ export default function SaveHub() {
|
|
|
28
28
|
};
|
|
29
29
|
}, [] );
|
|
30
30
|
return (
|
|
31
|
-
<
|
|
31
|
+
<Stack className="edit-site-save-hub" gap="lg">
|
|
32
32
|
<SaveButton
|
|
33
33
|
className="edit-site-save-hub__button"
|
|
34
|
-
variant={ isDisabled ? null : 'primary' }
|
|
34
|
+
variant={ isDisabled && ! isSaving ? null : 'primary' }
|
|
35
35
|
showTooltip={ false }
|
|
36
36
|
icon={ isDisabled && ! isSaving ? check : null }
|
|
37
37
|
showReviewMessage
|
|
38
38
|
__next40pxDefaultSize
|
|
39
39
|
/>
|
|
40
|
-
</
|
|
40
|
+
</Stack>
|
|
41
41
|
);
|
|
42
42
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@use "@wordpress/base-styles/variables" as *;
|
|
2
2
|
|
|
3
3
|
.edit-site-save-hub {
|
|
4
|
-
color: var(--wpds-color-
|
|
4
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
5
5
|
border-top: 1px solid var(--wpds-color-stroke-surface-neutral);
|
|
6
6
|
flex-shrink: 0;
|
|
7
7
|
margin: 0;
|
|
8
|
-
padding: $grid-unit-20
|
|
8
|
+
padding: $grid-unit-20;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.edit-site-save-hub__button {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
&:not(.is-primary) {
|
|
26
26
|
&.is-busy,
|
|
27
27
|
&.is-busy[aria-disabled="true"]:hover {
|
|
28
|
-
color: var(--wpds-color-
|
|
28
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.edit-site-sidebar-button {
|
|
2
|
-
color: var(--wpds-color-
|
|
2
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
3
3
|
flex-shrink: 0;
|
|
4
4
|
|
|
5
5
|
// Focus (resets default button focus and use focus-visible).
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
&:focus,
|
|
20
20
|
&:not(:disabled,[aria-disabled="true"]):active,
|
|
21
21
|
&[aria-expanded="true"] {
|
|
22
|
-
color: var(--wpds-color-
|
|
22
|
+
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -23,6 +23,8 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
|
23
23
|
|
|
24
24
|
const { useLocation } = unlock( routerPrivateApis );
|
|
25
25
|
|
|
26
|
+
const VIEW_CONFIG_FIELDS = [ 'view_list' ];
|
|
27
|
+
|
|
26
28
|
const SLUG_TO_ICON = {
|
|
27
29
|
all: pages,
|
|
28
30
|
published,
|
|
@@ -47,6 +49,7 @@ export default function DataViewsSidebarContent( {
|
|
|
47
49
|
const { view_list: viewList } = useViewConfig( {
|
|
48
50
|
kind: 'postType',
|
|
49
51
|
name: postType,
|
|
52
|
+
fields: VIEW_CONFIG_FIELDS,
|
|
50
53
|
} );
|
|
51
54
|
if ( ! postType ) {
|
|
52
55
|
return null;
|