@wordpress/edit-site 6.27.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 +89 -54
- package/build-style/posts.css +89 -54
- package/build-style/style-rtl.css +114 -102
- package/build-style/style.css +114 -102
- package/package.json +42 -42
- package/src/components/editor/style.scss +2 -2
- 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 -23
- package/src/components/post-list/index.js +1 -42
- package/src/components/sidebar-dataviews/default-views.js +63 -47
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
- package/src/components/style-book/index.js +2 -2
- package/src/store/selectors.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -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 ] );
|
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.edit-site-sidebar-navigation-screen-navigation-menus__content {
|
|
11
|
-
.block-editor-list-view-leaf .block-editor-list-view-block__contents-cell {
|
|
12
|
-
width: 100%;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
11
|
.block-editor-list-view-leaf .block-editor-list-view-block-contents {
|
|
16
12
|
white-space: normal;
|
|
17
13
|
}
|
|
@@ -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
|
|