@wordpress/edit-site 6.42.0 → 6.43.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/page-patterns/index.cjs +7 -27
- package/build/components/page-patterns/index.cjs.map +2 -2
- package/build/components/page-templates/index-legacy.cjs +13 -6
- package/build/components/page-templates/index-legacy.cjs.map +2 -2
- package/build/components/post-list/index.cjs +15 -6
- package/build/components/post-list/index.cjs.map +2 -2
- package/build/components/post-list/quick-edit-modal.cjs +16 -48
- package/build/components/post-list/quick-edit-modal.cjs.map +2 -2
- package/build/components/sidebar-dataviews/index.cjs +37 -25
- package/build/components/sidebar-dataviews/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +55 -47
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs +33 -56
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs.map +3 -3
- package/build/components/site-editor-routes/home.cjs +8 -4
- package/build/components/site-editor-routes/home.cjs.map +2 -2
- package/build/components/site-editor-routes/navigation-item.cjs +13 -6
- package/build/components/site-editor-routes/navigation-item.cjs.map +2 -2
- package/build/components/site-editor-routes/navigation.cjs +9 -4
- package/build/components/site-editor-routes/navigation.cjs.map +2 -2
- package/build/components/site-editor-routes/page-item.cjs +13 -6
- package/build/components/site-editor-routes/page-item.cjs.map +2 -2
- package/build/components/site-editor-routes/pages.cjs +21 -7
- package/build/components/site-editor-routes/pages.cjs.map +3 -3
- package/build/components/site-editor-routes/stylebook.cjs +17 -2
- package/build/components/site-editor-routes/stylebook.cjs.map +2 -2
- package/build/components/site-editor-routes/template-item.cjs +13 -6
- package/build/components/site-editor-routes/template-item.cjs.map +2 -2
- package/build/components/site-editor-routes/templates.cjs +20 -7
- package/build/components/site-editor-routes/templates.cjs.map +3 -3
- package/build/components/site-editor-routes/utils.cjs +7 -2
- package/build/components/site-editor-routes/utils.cjs.map +2 -2
- package/build-module/components/page-patterns/index.mjs +8 -30
- package/build-module/components/page-patterns/index.mjs.map +2 -2
- package/build-module/components/page-templates/index-legacy.mjs +14 -11
- package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
- package/build-module/components/post-list/index.mjs +16 -11
- package/build-module/components/post-list/index.mjs.map +2 -2
- package/build-module/components/post-list/quick-edit-modal.mjs +16 -48
- package/build-module/components/post-list/quick-edit-modal.mjs.map +2 -2
- package/build-module/components/sidebar-dataviews/index.mjs +45 -25
- package/build-module/components/sidebar-dataviews/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +55 -47
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs +41 -59
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs.map +2 -2
- package/build-module/components/site-editor-routes/home.mjs +10 -6
- package/build-module/components/site-editor-routes/home.mjs.map +2 -2
- package/build-module/components/site-editor-routes/navigation-item.mjs +14 -7
- package/build-module/components/site-editor-routes/navigation-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/navigation.mjs +10 -5
- package/build-module/components/site-editor-routes/navigation.mjs.map +2 -2
- package/build-module/components/site-editor-routes/page-item.mjs +14 -7
- package/build-module/components/site-editor-routes/page-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/pages.mjs +22 -11
- package/build-module/components/site-editor-routes/pages.mjs.map +2 -2
- package/build-module/components/site-editor-routes/stylebook.mjs +18 -3
- package/build-module/components/site-editor-routes/stylebook.mjs.map +2 -2
- package/build-module/components/site-editor-routes/template-item.mjs +14 -7
- package/build-module/components/site-editor-routes/template-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/templates.mjs +21 -11
- package/build-module/components/site-editor-routes/templates.mjs.map +2 -2
- package/build-module/components/site-editor-routes/utils.mjs +5 -1
- package/build-module/components/site-editor-routes/utils.mjs.map +2 -2
- package/build-style/style-rtl.css +60 -49
- package/build-style/style.css +60 -49
- package/package.json +46 -46
- package/src/components/page-patterns/index.js +9 -30
- package/src/components/page-templates/index-legacy.js +14 -11
- package/src/components/post-list/index.js +16 -10
- package/src/components/post-list/quick-edit-modal.js +19 -54
- package/src/components/post-list/style.scss +2 -0
- package/src/components/sidebar-dataviews/index.js +48 -26
- package/src/components/sidebar-dataviews/style.scss +0 -16
- package/src/components/sidebar-navigation-screen-patterns/index.js +62 -55
- package/src/components/sidebar-navigation-screen-templates-browse/content-legacy.js +44 -64
- package/src/components/site-editor-routes/home.js +9 -5
- package/src/components/site-editor-routes/navigation-item.js +13 -6
- package/src/components/site-editor-routes/navigation.js +9 -4
- package/src/components/site-editor-routes/page-item.js +13 -6
- package/src/components/site-editor-routes/pages.js +21 -10
- package/src/components/site-editor-routes/stylebook.js +12 -3
- package/src/components/site-editor-routes/template-item.js +13 -6
- package/src/components/site-editor-routes/templates.js +21 -10
- package/src/components/site-editor-routes/utils.js +12 -0
- package/build/components/post-list/view-utils.cjs +0 -202
- package/build/components/post-list/view-utils.cjs.map +0 -7
- package/build/components/sidebar-dataviews/dataview-item.cjs +0 -82
- package/build/components/sidebar-dataviews/dataview-item.cjs.map +0 -7
- package/build-module/components/post-list/view-utils.mjs +0 -182
- package/build-module/components/post-list/view-utils.mjs.map +0 -7
- package/build-module/components/sidebar-dataviews/dataview-item.mjs +0 -51
- package/build-module/components/sidebar-dataviews/dataview-item.mjs.map +0 -7
- package/src/components/post-list/view-utils.js +0 -187
- package/src/components/sidebar-dataviews/dataview-item.js +0 -56
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
trash,
|
|
8
|
-
pages,
|
|
9
|
-
drafts,
|
|
10
|
-
published,
|
|
11
|
-
scheduled,
|
|
12
|
-
pending,
|
|
13
|
-
notAllowed,
|
|
14
|
-
} from '@wordpress/icons';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { OPERATOR_IS_ANY } from '../../utils/constants';
|
|
20
|
-
|
|
21
|
-
export const defaultLayouts = {
|
|
22
|
-
table: {
|
|
23
|
-
layout: {
|
|
24
|
-
styles: {
|
|
25
|
-
author: {
|
|
26
|
-
align: 'start',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
grid: {},
|
|
32
|
-
list: {},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const DEFAULT_VIEW = {
|
|
36
|
-
type: 'list',
|
|
37
|
-
filters: [],
|
|
38
|
-
perPage: 20,
|
|
39
|
-
sort: {
|
|
40
|
-
field: 'title',
|
|
41
|
-
direction: 'asc',
|
|
42
|
-
},
|
|
43
|
-
showLevels: true,
|
|
44
|
-
titleField: 'title',
|
|
45
|
-
mediaField: 'featured_media',
|
|
46
|
-
fields: [ 'author', 'status' ],
|
|
47
|
-
...defaultLayouts.list,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export function getDefaultViews( postType ) {
|
|
51
|
-
return [
|
|
52
|
-
{
|
|
53
|
-
title: postType?.labels?.all_items || __( 'All items' ),
|
|
54
|
-
slug: 'all',
|
|
55
|
-
icon: pages,
|
|
56
|
-
view: DEFAULT_VIEW,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
title: __( 'Published' ),
|
|
60
|
-
slug: 'published',
|
|
61
|
-
icon: published,
|
|
62
|
-
view: {
|
|
63
|
-
...DEFAULT_VIEW,
|
|
64
|
-
filters: [
|
|
65
|
-
{
|
|
66
|
-
field: 'status',
|
|
67
|
-
operator: OPERATOR_IS_ANY,
|
|
68
|
-
value: 'publish',
|
|
69
|
-
isLocked: true,
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
title: __( 'Scheduled' ),
|
|
76
|
-
slug: 'future',
|
|
77
|
-
icon: scheduled,
|
|
78
|
-
view: {
|
|
79
|
-
...DEFAULT_VIEW,
|
|
80
|
-
filters: [
|
|
81
|
-
{
|
|
82
|
-
field: 'status',
|
|
83
|
-
operator: OPERATOR_IS_ANY,
|
|
84
|
-
value: 'future',
|
|
85
|
-
isLocked: true,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
title: __( 'Drafts' ),
|
|
92
|
-
slug: 'drafts',
|
|
93
|
-
icon: drafts,
|
|
94
|
-
view: {
|
|
95
|
-
...DEFAULT_VIEW,
|
|
96
|
-
filters: [
|
|
97
|
-
{
|
|
98
|
-
field: 'status',
|
|
99
|
-
operator: OPERATOR_IS_ANY,
|
|
100
|
-
value: 'draft',
|
|
101
|
-
isLocked: true,
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
title: __( 'Pending' ),
|
|
108
|
-
slug: 'pending',
|
|
109
|
-
icon: pending,
|
|
110
|
-
view: {
|
|
111
|
-
...DEFAULT_VIEW,
|
|
112
|
-
filters: [
|
|
113
|
-
{
|
|
114
|
-
field: 'status',
|
|
115
|
-
operator: OPERATOR_IS_ANY,
|
|
116
|
-
value: 'pending',
|
|
117
|
-
isLocked: true,
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
title: __( 'Private' ),
|
|
124
|
-
slug: 'private',
|
|
125
|
-
icon: notAllowed,
|
|
126
|
-
view: {
|
|
127
|
-
...DEFAULT_VIEW,
|
|
128
|
-
filters: [
|
|
129
|
-
{
|
|
130
|
-
field: 'status',
|
|
131
|
-
operator: OPERATOR_IS_ANY,
|
|
132
|
-
value: 'private',
|
|
133
|
-
isLocked: true,
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
title: __( 'Trash' ),
|
|
140
|
-
slug: 'trash',
|
|
141
|
-
icon: trash,
|
|
142
|
-
view: {
|
|
143
|
-
...DEFAULT_VIEW,
|
|
144
|
-
type: 'table',
|
|
145
|
-
layout: defaultLayouts.table.layout,
|
|
146
|
-
filters: [
|
|
147
|
-
{
|
|
148
|
-
field: 'status',
|
|
149
|
-
operator: OPERATOR_IS_ANY,
|
|
150
|
-
value: 'trash',
|
|
151
|
-
isLocked: true,
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const SLUG_TO_STATUS = {
|
|
160
|
-
published: 'publish',
|
|
161
|
-
future: 'future',
|
|
162
|
-
drafts: 'draft',
|
|
163
|
-
pending: 'pending',
|
|
164
|
-
private: 'private',
|
|
165
|
-
trash: 'trash',
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export function getActiveViewOverridesForTab( activeView ) {
|
|
169
|
-
const base = {
|
|
170
|
-
...defaultLayouts.table,
|
|
171
|
-
};
|
|
172
|
-
const status = SLUG_TO_STATUS[ activeView ];
|
|
173
|
-
if ( ! status ) {
|
|
174
|
-
return base;
|
|
175
|
-
}
|
|
176
|
-
return {
|
|
177
|
-
...base,
|
|
178
|
-
filters: [
|
|
179
|
-
{
|
|
180
|
-
field: 'status',
|
|
181
|
-
operator: OPERATOR_IS_ANY,
|
|
182
|
-
value: status,
|
|
183
|
-
isLocked: true,
|
|
184
|
-
},
|
|
185
|
-
],
|
|
186
|
-
};
|
|
187
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
|
-
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
11
|
-
import { VIEW_LAYOUTS } from '@wordpress/dataviews';
|
|
12
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
18
|
-
import { unlock } from '../../lock-unlock';
|
|
19
|
-
const { useLocation } = unlock( routerPrivateApis );
|
|
20
|
-
|
|
21
|
-
export default function DataViewItem( {
|
|
22
|
-
title,
|
|
23
|
-
slug,
|
|
24
|
-
type,
|
|
25
|
-
icon,
|
|
26
|
-
isActive,
|
|
27
|
-
suffix,
|
|
28
|
-
} ) {
|
|
29
|
-
const { path } = useLocation();
|
|
30
|
-
|
|
31
|
-
const iconToUse =
|
|
32
|
-
icon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;
|
|
33
|
-
|
|
34
|
-
if ( slug === 'all' ) {
|
|
35
|
-
slug = undefined;
|
|
36
|
-
}
|
|
37
|
-
return (
|
|
38
|
-
<HStack
|
|
39
|
-
justify="flex-start"
|
|
40
|
-
className={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {
|
|
41
|
-
'is-selected': isActive,
|
|
42
|
-
} ) }
|
|
43
|
-
>
|
|
44
|
-
<SidebarNavigationItem
|
|
45
|
-
icon={ iconToUse }
|
|
46
|
-
to={ addQueryArgs( path, {
|
|
47
|
-
activeView: slug,
|
|
48
|
-
} ) }
|
|
49
|
-
aria-current={ isActive ? 'true' : undefined }
|
|
50
|
-
>
|
|
51
|
-
{ title }
|
|
52
|
-
</SidebarNavigationItem>
|
|
53
|
-
{ suffix }
|
|
54
|
-
</HStack>
|
|
55
|
-
);
|
|
56
|
-
}
|