@wordpress/edit-site 6.27.1-next.46f643fa0.0 → 6.28.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/media/index.js +1 -1
- package/build/components/media/index.js.map +1 -1
- package/build/components/page-templates/fields.js +1 -4
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/hooks.js +1 -2
- package/build/components/page-templates/hooks.js.map +1 -1
- package/build/components/page-templates/index.js +1 -8
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-list/index.js +1 -30
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +53 -37
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/style-book/index.js +2 -2
- package/build/components/style-book/index.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/media/index.js +1 -1
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -4
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/hooks.js +1 -2
- package/build-module/components/page-templates/hooks.js.map +1 -1
- package/build-module/components/page-templates/index.js +1 -8
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-list/index.js +1 -30
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +53 -37
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/style-book/index.js +2 -2
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/posts-rtl.css +29 -8
- package/build-style/posts.css +29 -8
- package/build-style/style-rtl.css +29 -35
- package/build-style/style.css +29 -35
- package/package.json +42 -42
- package/src/components/global-styles-sidebar/style.scss +0 -19
- package/src/components/media/index.js +1 -1
- package/src/components/page-templates/fields.js +1 -7
- package/src/components/page-templates/hooks.js +7 -7
- package/src/components/page-templates/index.js +0 -7
- package/src/components/page-templates/style.scss +0 -12
- package/src/components/post-list/index.js +1 -42
- package/src/components/sidebar-dataviews/default-views.js +63 -47
- package/src/components/style-book/index.js +2 -2
- package/src/store/selectors.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.28.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,46 +30,46 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
32
|
"@react-spring/web": "^9.4.5",
|
|
33
|
-
"@wordpress/a11y": "^4.
|
|
34
|
-
"@wordpress/api-fetch": "^7.
|
|
35
|
-
"@wordpress/blob": "^4.
|
|
36
|
-
"@wordpress/block-editor": "^15.
|
|
37
|
-
"@wordpress/block-library": "^9.
|
|
38
|
-
"@wordpress/blocks": "^15.
|
|
39
|
-
"@wordpress/commands": "^1.
|
|
40
|
-
"@wordpress/components": "^30.1.
|
|
41
|
-
"@wordpress/compose": "^7.
|
|
42
|
-
"@wordpress/core-commands": "^1.
|
|
43
|
-
"@wordpress/core-data": "^7.
|
|
44
|
-
"@wordpress/data": "^10.
|
|
45
|
-
"@wordpress/dataviews": "^6.0.
|
|
46
|
-
"@wordpress/date": "^5.
|
|
47
|
-
"@wordpress/deprecated": "^4.
|
|
48
|
-
"@wordpress/dom": "^4.
|
|
49
|
-
"@wordpress/editor": "^14.
|
|
50
|
-
"@wordpress/element": "^6.
|
|
51
|
-
"@wordpress/escape-html": "^3.
|
|
52
|
-
"@wordpress/fields": "^0.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/html-entities": "^4.
|
|
55
|
-
"@wordpress/i18n": "^6.
|
|
56
|
-
"@wordpress/icons": "^10.
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/media-utils": "^5.
|
|
60
|
-
"@wordpress/notices": "^5.
|
|
61
|
-
"@wordpress/patterns": "^2.
|
|
62
|
-
"@wordpress/plugins": "^7.
|
|
63
|
-
"@wordpress/preferences": "^4.
|
|
64
|
-
"@wordpress/primitives": "^4.
|
|
65
|
-
"@wordpress/private-apis": "^1.
|
|
66
|
-
"@wordpress/reusable-blocks": "^5.
|
|
67
|
-
"@wordpress/router": "^1.
|
|
68
|
-
"@wordpress/style-engine": "^2.
|
|
69
|
-
"@wordpress/url": "^4.
|
|
70
|
-
"@wordpress/viewport": "^6.
|
|
71
|
-
"@wordpress/widgets": "^4.
|
|
72
|
-
"@wordpress/wordcount": "^4.
|
|
33
|
+
"@wordpress/a11y": "^4.28.0",
|
|
34
|
+
"@wordpress/api-fetch": "^7.28.0",
|
|
35
|
+
"@wordpress/blob": "^4.28.0",
|
|
36
|
+
"@wordpress/block-editor": "^15.1.0",
|
|
37
|
+
"@wordpress/block-library": "^9.28.0",
|
|
38
|
+
"@wordpress/blocks": "^15.1.0",
|
|
39
|
+
"@wordpress/commands": "^1.28.0",
|
|
40
|
+
"@wordpress/components": "^30.1.0",
|
|
41
|
+
"@wordpress/compose": "^7.28.0",
|
|
42
|
+
"@wordpress/core-commands": "^1.28.0",
|
|
43
|
+
"@wordpress/core-data": "^7.28.0",
|
|
44
|
+
"@wordpress/data": "^10.28.0",
|
|
45
|
+
"@wordpress/dataviews": "^6.0.0",
|
|
46
|
+
"@wordpress/date": "^5.28.0",
|
|
47
|
+
"@wordpress/deprecated": "^4.28.0",
|
|
48
|
+
"@wordpress/dom": "^4.28.0",
|
|
49
|
+
"@wordpress/editor": "^14.28.0",
|
|
50
|
+
"@wordpress/element": "^6.28.0",
|
|
51
|
+
"@wordpress/escape-html": "^3.28.0",
|
|
52
|
+
"@wordpress/fields": "^0.20.0",
|
|
53
|
+
"@wordpress/hooks": "^4.28.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.28.0",
|
|
55
|
+
"@wordpress/i18n": "^6.1.0",
|
|
56
|
+
"@wordpress/icons": "^10.28.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.28.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.28.0",
|
|
59
|
+
"@wordpress/media-utils": "^5.28.0",
|
|
60
|
+
"@wordpress/notices": "^5.28.0",
|
|
61
|
+
"@wordpress/patterns": "^2.28.0",
|
|
62
|
+
"@wordpress/plugins": "^7.28.0",
|
|
63
|
+
"@wordpress/preferences": "^4.28.0",
|
|
64
|
+
"@wordpress/primitives": "^4.28.0",
|
|
65
|
+
"@wordpress/private-apis": "^1.28.0",
|
|
66
|
+
"@wordpress/reusable-blocks": "^5.28.0",
|
|
67
|
+
"@wordpress/router": "^1.28.0",
|
|
68
|
+
"@wordpress/style-engine": "^2.28.0",
|
|
69
|
+
"@wordpress/url": "^4.28.0",
|
|
70
|
+
"@wordpress/viewport": "^6.28.0",
|
|
71
|
+
"@wordpress/widgets": "^4.28.0",
|
|
72
|
+
"@wordpress/wordcount": "^4.28.0",
|
|
73
73
|
"change-case": "^4.1.2",
|
|
74
74
|
"clsx": "^2.1.1",
|
|
75
75
|
"colord": "^2.9.2",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "28cc2098f5ee28f89096b638533796538f495f72"
|
|
88
88
|
}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
.editor-sidebar {
|
|
2
|
-
width: $sidebar-width;
|
|
3
|
-
|
|
4
|
-
> .components-panel {
|
|
5
|
-
border-left: 0;
|
|
6
|
-
border-right: 0;
|
|
7
|
-
margin-bottom: -1px;
|
|
8
|
-
margin-top: -1px;
|
|
9
|
-
|
|
10
|
-
> .components-panel__header {
|
|
11
|
-
background: $gray-100;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.block-editor-block-inspector__card {
|
|
16
|
-
margin: 0;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
1
|
.edit-site-global-styles-sidebar {
|
|
21
2
|
display: flex;
|
|
22
3
|
flex-direction: column;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { useEntityRecord } from '@wordpress/core-data';
|
|
5
5
|
|
|
6
6
|
function Media( { id, size = [ 'large', 'medium', 'thumbnail' ], ...props } ) {
|
|
7
|
-
const { record: media } = useEntityRecord( '
|
|
7
|
+
const { record: media } = useEntityRecord( 'postType', 'attachment', id );
|
|
8
8
|
const currentSize = size.find(
|
|
9
9
|
( s ) => !! media?.media_details?.sizes?.[ s ]
|
|
10
10
|
);
|
|
@@ -69,13 +69,7 @@ export const descriptionField = {
|
|
|
69
69
|
label: __( 'Description' ),
|
|
70
70
|
id: 'description',
|
|
71
71
|
render: ( { item } ) => {
|
|
72
|
-
return (
|
|
73
|
-
item.description && (
|
|
74
|
-
<span className="page-templates-description">
|
|
75
|
-
{ decodeEntities( item.description ) }
|
|
76
|
-
</span>
|
|
77
|
-
)
|
|
78
|
-
);
|
|
72
|
+
return item.description && decodeEntities( item.description );
|
|
79
73
|
},
|
|
80
74
|
enableSorting: false,
|
|
81
75
|
enableGlobalSearch: true,
|
|
@@ -35,12 +35,8 @@ import { TEMPLATE_ORIGINS } from '../../utils/constants';
|
|
|
35
35
|
export function useAddedBy( postType, postId ) {
|
|
36
36
|
return useSelect(
|
|
37
37
|
( select ) => {
|
|
38
|
-
const {
|
|
39
|
-
|
|
40
|
-
getMedia,
|
|
41
|
-
getUser,
|
|
42
|
-
getEditedEntityRecord,
|
|
43
|
-
} = select( coreStore );
|
|
38
|
+
const { getEntityRecord, getUser, getEditedEntityRecord } =
|
|
39
|
+
select( coreStore );
|
|
44
40
|
const template = getEditedEntityRecord(
|
|
45
41
|
'postType',
|
|
46
42
|
postType,
|
|
@@ -77,7 +73,11 @@ export function useAddedBy( postType, postId ) {
|
|
|
77
73
|
type: originalSource,
|
|
78
74
|
icon: globeIcon,
|
|
79
75
|
imageUrl: siteData?.site_logo
|
|
80
|
-
?
|
|
76
|
+
? getEntityRecord(
|
|
77
|
+
'postType',
|
|
78
|
+
'attachment',
|
|
79
|
+
siteData.site_logo
|
|
80
|
+
)?.source_url
|
|
81
81
|
: undefined,
|
|
82
82
|
text: authorText,
|
|
83
83
|
isCustomized: false,
|
|
@@ -28,24 +28,12 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.page-templates-description {
|
|
32
|
-
max-width: 50em;
|
|
33
|
-
text-wrap: balance; // Fallback for Safari
|
|
34
|
-
text-wrap: pretty;
|
|
35
|
-
|
|
36
|
-
.dataviews-view-table & {
|
|
37
|
-
margin-bottom: $grid-unit-10;
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
31
|
.edit-site-page-templates {
|
|
43
32
|
.dataviews-pagination {
|
|
44
33
|
z-index: z-index(".edit-site-templates__dataviews-list-pagination");
|
|
45
34
|
}
|
|
46
35
|
}
|
|
47
36
|
|
|
48
|
-
|
|
49
37
|
.page-templates-author-field__avatar {
|
|
50
38
|
flex-shrink: 0;
|
|
51
39
|
overflow: hidden;
|
|
@@ -223,26 +223,10 @@ export default function PostList( { postType } ) {
|
|
|
223
223
|
},
|
|
224
224
|
[ location.path, location.query.isCustom, history ]
|
|
225
225
|
);
|
|
226
|
-
const getActiveViewFilters = ( views, match ) => {
|
|
227
|
-
const found = views.find( ( { slug } ) => slug === match );
|
|
228
|
-
return found?.filters ?? [];
|
|
229
|
-
};
|
|
230
226
|
|
|
231
|
-
const { isLoading: isLoadingFields, fields:
|
|
227
|
+
const { isLoading: isLoadingFields, fields: fields } = usePostFields( {
|
|
232
228
|
postType,
|
|
233
229
|
} );
|
|
234
|
-
const fields = useMemo( () => {
|
|
235
|
-
const activeViewFilters = getActiveViewFilters(
|
|
236
|
-
defaultViews,
|
|
237
|
-
activeView
|
|
238
|
-
).map( ( { field } ) => field );
|
|
239
|
-
return _fields.map( ( field ) => ( {
|
|
240
|
-
...field,
|
|
241
|
-
elements: activeViewFilters.includes( field.id )
|
|
242
|
-
? []
|
|
243
|
-
: field.elements,
|
|
244
|
-
} ) );
|
|
245
|
-
}, [ _fields, defaultViews, activeView ] );
|
|
246
230
|
|
|
247
231
|
const queryArgs = useMemo( () => {
|
|
248
232
|
const filters = {};
|
|
@@ -266,31 +250,6 @@ export default function PostList( { postType } ) {
|
|
|
266
250
|
}
|
|
267
251
|
} );
|
|
268
252
|
|
|
269
|
-
// The bundled views want data filtered without displaying the filter.
|
|
270
|
-
const activeViewFilters = getActiveViewFilters(
|
|
271
|
-
defaultViews,
|
|
272
|
-
activeView
|
|
273
|
-
);
|
|
274
|
-
activeViewFilters.forEach( ( filter ) => {
|
|
275
|
-
if (
|
|
276
|
-
filter.field === 'status' &&
|
|
277
|
-
filter.operator === OPERATOR_IS_ANY
|
|
278
|
-
) {
|
|
279
|
-
filters.status = filter.value;
|
|
280
|
-
}
|
|
281
|
-
if (
|
|
282
|
-
filter.field === 'author' &&
|
|
283
|
-
filter.operator === OPERATOR_IS_ANY
|
|
284
|
-
) {
|
|
285
|
-
filters.author = filter.value;
|
|
286
|
-
} else if (
|
|
287
|
-
filter.field === 'author' &&
|
|
288
|
-
filter.operator === OPERATOR_IS_NONE
|
|
289
|
-
) {
|
|
290
|
-
filters.author_exclude = filter.value;
|
|
291
|
-
}
|
|
292
|
-
} );
|
|
293
|
-
|
|
294
253
|
// We want to provide a different default item for the status filter
|
|
295
254
|
// than the REST API provides.
|
|
296
255
|
if ( ! filters.status || filters.status === '' ) {
|
|
@@ -69,66 +69,81 @@ export function useDefaultViews( { postType } ) {
|
|
|
69
69
|
title: __( 'Published' ),
|
|
70
70
|
slug: 'published',
|
|
71
71
|
icon: published,
|
|
72
|
-
view:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
view: {
|
|
73
|
+
...DEFAULT_POST_BASE,
|
|
74
|
+
filters: [
|
|
75
|
+
{
|
|
76
|
+
field: 'status',
|
|
77
|
+
operator: OPERATOR_IS_ANY,
|
|
78
|
+
value: 'publish',
|
|
79
|
+
isLocked: true,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
80
83
|
},
|
|
81
84
|
{
|
|
82
85
|
title: __( 'Scheduled' ),
|
|
83
86
|
slug: 'future',
|
|
84
87
|
icon: scheduled,
|
|
85
|
-
view:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
view: {
|
|
89
|
+
...DEFAULT_POST_BASE,
|
|
90
|
+
filters: [
|
|
91
|
+
{
|
|
92
|
+
field: 'status',
|
|
93
|
+
operator: OPERATOR_IS_ANY,
|
|
94
|
+
value: 'future',
|
|
95
|
+
isLocked: true,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
93
99
|
},
|
|
94
100
|
{
|
|
95
101
|
title: __( 'Drafts' ),
|
|
96
102
|
slug: 'drafts',
|
|
97
103
|
icon: drafts,
|
|
98
|
-
view:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
view: {
|
|
105
|
+
...DEFAULT_POST_BASE,
|
|
106
|
+
filters: [
|
|
107
|
+
{
|
|
108
|
+
field: 'status',
|
|
109
|
+
operator: OPERATOR_IS_ANY,
|
|
110
|
+
value: 'draft',
|
|
111
|
+
isLocked: true,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
106
115
|
},
|
|
107
116
|
{
|
|
108
117
|
title: __( 'Pending' ),
|
|
109
118
|
slug: 'pending',
|
|
110
119
|
icon: pending,
|
|
111
|
-
view:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
view: {
|
|
121
|
+
...DEFAULT_POST_BASE,
|
|
122
|
+
filters: [
|
|
123
|
+
{
|
|
124
|
+
field: 'status',
|
|
125
|
+
operator: OPERATOR_IS_ANY,
|
|
126
|
+
value: 'pending',
|
|
127
|
+
isLocked: true,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
119
131
|
},
|
|
120
132
|
{
|
|
121
133
|
title: __( 'Private' ),
|
|
122
134
|
slug: 'private',
|
|
123
135
|
icon: notAllowed,
|
|
124
|
-
view:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
view: {
|
|
137
|
+
...DEFAULT_POST_BASE,
|
|
138
|
+
filters: [
|
|
139
|
+
{
|
|
140
|
+
field: 'status',
|
|
141
|
+
operator: OPERATOR_IS_ANY,
|
|
142
|
+
value: 'private',
|
|
143
|
+
isLocked: true,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
132
147
|
},
|
|
133
148
|
{
|
|
134
149
|
title: __( 'Trash' ),
|
|
@@ -138,14 +153,15 @@ export function useDefaultViews( { postType } ) {
|
|
|
138
153
|
...DEFAULT_POST_BASE,
|
|
139
154
|
type: LAYOUT_TABLE,
|
|
140
155
|
layout: defaultLayouts[ LAYOUT_TABLE ].layout,
|
|
156
|
+
filters: [
|
|
157
|
+
{
|
|
158
|
+
field: 'status',
|
|
159
|
+
operator: OPERATOR_IS_ANY,
|
|
160
|
+
value: 'trash',
|
|
161
|
+
isLocked: true,
|
|
162
|
+
},
|
|
163
|
+
],
|
|
141
164
|
},
|
|
142
|
-
filters: [
|
|
143
|
-
{
|
|
144
|
-
field: 'status',
|
|
145
|
-
operator: OPERATOR_IS_ANY,
|
|
146
|
-
value: 'trash',
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
165
|
},
|
|
150
166
|
];
|
|
151
167
|
}, [ labels ] );
|
|
@@ -393,8 +393,8 @@ export const StyleBookPreview = ( { userConfig = {}, isStatic = false } ) => {
|
|
|
393
393
|
const canUserUploadMedia = useSelect(
|
|
394
394
|
( select ) =>
|
|
395
395
|
select( coreStore ).canUser( 'create', {
|
|
396
|
-
kind: '
|
|
397
|
-
name: '
|
|
396
|
+
kind: 'postType',
|
|
397
|
+
name: 'attachment',
|
|
398
398
|
} ),
|
|
399
399
|
[]
|
|
400
400
|
);
|
package/src/store/selectors.js
CHANGED
|
@@ -79,7 +79,7 @@ export const getCanUserCreateMedia = createRegistrySelector(
|
|
|
79
79
|
`wp.data.select( 'core/edit-site' ).getCanUserCreateMedia()`,
|
|
80
80
|
{
|
|
81
81
|
since: '6.7',
|
|
82
|
-
alternative: `wp.data.select( 'core' ).canUser( 'create', { kind: '
|
|
82
|
+
alternative: `wp.data.select( 'core' ).canUser( 'create', { kind: 'postType', type: 'attachment' } )`,
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
|