@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,202 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/edit-site/src/components/post-list/view-utils.js
|
|
21
|
-
var view_utils_exports = {};
|
|
22
|
-
__export(view_utils_exports, {
|
|
23
|
-
DEFAULT_VIEW: () => DEFAULT_VIEW,
|
|
24
|
-
defaultLayouts: () => defaultLayouts,
|
|
25
|
-
getActiveViewOverridesForTab: () => getActiveViewOverridesForTab,
|
|
26
|
-
getDefaultViews: () => getDefaultViews
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(view_utils_exports);
|
|
29
|
-
var import_i18n = require("@wordpress/i18n");
|
|
30
|
-
var import_icons = require("@wordpress/icons");
|
|
31
|
-
var import_constants = require("../../utils/constants.cjs");
|
|
32
|
-
var defaultLayouts = {
|
|
33
|
-
table: {
|
|
34
|
-
layout: {
|
|
35
|
-
styles: {
|
|
36
|
-
author: {
|
|
37
|
-
align: "start"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
grid: {},
|
|
43
|
-
list: {}
|
|
44
|
-
};
|
|
45
|
-
var DEFAULT_VIEW = {
|
|
46
|
-
type: "list",
|
|
47
|
-
filters: [],
|
|
48
|
-
perPage: 20,
|
|
49
|
-
sort: {
|
|
50
|
-
field: "title",
|
|
51
|
-
direction: "asc"
|
|
52
|
-
},
|
|
53
|
-
showLevels: true,
|
|
54
|
-
titleField: "title",
|
|
55
|
-
mediaField: "featured_media",
|
|
56
|
-
fields: ["author", "status"],
|
|
57
|
-
...defaultLayouts.list
|
|
58
|
-
};
|
|
59
|
-
function getDefaultViews(postType) {
|
|
60
|
-
return [
|
|
61
|
-
{
|
|
62
|
-
title: postType?.labels?.all_items || (0, import_i18n.__)("All items"),
|
|
63
|
-
slug: "all",
|
|
64
|
-
icon: import_icons.pages,
|
|
65
|
-
view: DEFAULT_VIEW
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
title: (0, import_i18n.__)("Published"),
|
|
69
|
-
slug: "published",
|
|
70
|
-
icon: import_icons.published,
|
|
71
|
-
view: {
|
|
72
|
-
...DEFAULT_VIEW,
|
|
73
|
-
filters: [
|
|
74
|
-
{
|
|
75
|
-
field: "status",
|
|
76
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
77
|
-
value: "publish",
|
|
78
|
-
isLocked: true
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
title: (0, import_i18n.__)("Scheduled"),
|
|
85
|
-
slug: "future",
|
|
86
|
-
icon: import_icons.scheduled,
|
|
87
|
-
view: {
|
|
88
|
-
...DEFAULT_VIEW,
|
|
89
|
-
filters: [
|
|
90
|
-
{
|
|
91
|
-
field: "status",
|
|
92
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
93
|
-
value: "future",
|
|
94
|
-
isLocked: true
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
title: (0, import_i18n.__)("Drafts"),
|
|
101
|
-
slug: "drafts",
|
|
102
|
-
icon: import_icons.drafts,
|
|
103
|
-
view: {
|
|
104
|
-
...DEFAULT_VIEW,
|
|
105
|
-
filters: [
|
|
106
|
-
{
|
|
107
|
-
field: "status",
|
|
108
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
109
|
-
value: "draft",
|
|
110
|
-
isLocked: true
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
title: (0, import_i18n.__)("Pending"),
|
|
117
|
-
slug: "pending",
|
|
118
|
-
icon: import_icons.pending,
|
|
119
|
-
view: {
|
|
120
|
-
...DEFAULT_VIEW,
|
|
121
|
-
filters: [
|
|
122
|
-
{
|
|
123
|
-
field: "status",
|
|
124
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
125
|
-
value: "pending",
|
|
126
|
-
isLocked: true
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
title: (0, import_i18n.__)("Private"),
|
|
133
|
-
slug: "private",
|
|
134
|
-
icon: import_icons.notAllowed,
|
|
135
|
-
view: {
|
|
136
|
-
...DEFAULT_VIEW,
|
|
137
|
-
filters: [
|
|
138
|
-
{
|
|
139
|
-
field: "status",
|
|
140
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
141
|
-
value: "private",
|
|
142
|
-
isLocked: true
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
title: (0, import_i18n.__)("Trash"),
|
|
149
|
-
slug: "trash",
|
|
150
|
-
icon: import_icons.trash,
|
|
151
|
-
view: {
|
|
152
|
-
...DEFAULT_VIEW,
|
|
153
|
-
type: "table",
|
|
154
|
-
layout: defaultLayouts.table.layout,
|
|
155
|
-
filters: [
|
|
156
|
-
{
|
|
157
|
-
field: "status",
|
|
158
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
159
|
-
value: "trash",
|
|
160
|
-
isLocked: true
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
];
|
|
166
|
-
}
|
|
167
|
-
var SLUG_TO_STATUS = {
|
|
168
|
-
published: "publish",
|
|
169
|
-
future: "future",
|
|
170
|
-
drafts: "draft",
|
|
171
|
-
pending: "pending",
|
|
172
|
-
private: "private",
|
|
173
|
-
trash: "trash"
|
|
174
|
-
};
|
|
175
|
-
function getActiveViewOverridesForTab(activeView) {
|
|
176
|
-
const base = {
|
|
177
|
-
...defaultLayouts.table
|
|
178
|
-
};
|
|
179
|
-
const status = SLUG_TO_STATUS[activeView];
|
|
180
|
-
if (!status) {
|
|
181
|
-
return base;
|
|
182
|
-
}
|
|
183
|
-
return {
|
|
184
|
-
...base,
|
|
185
|
-
filters: [
|
|
186
|
-
{
|
|
187
|
-
field: "status",
|
|
188
|
-
operator: import_constants.OPERATOR_IS_ANY,
|
|
189
|
-
value: status,
|
|
190
|
-
isLocked: true
|
|
191
|
-
}
|
|
192
|
-
]
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
-
0 && (module.exports = {
|
|
197
|
-
DEFAULT_VIEW,
|
|
198
|
-
defaultLayouts,
|
|
199
|
-
getActiveViewOverridesForTab,
|
|
200
|
-
getDefaultViews
|
|
201
|
-
});
|
|
202
|
-
//# sourceMappingURL=view-utils.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/post-list/view-utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { OPERATOR_IS_ANY } from '../../utils/constants';\n\nexport const defaultLayouts = {\n\ttable: {\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\talign: 'start',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\tgrid: {},\n\tlist: {},\n};\n\nexport const DEFAULT_VIEW = {\n\ttype: 'list',\n\tfilters: [],\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\tshowLevels: true,\n\ttitleField: 'title',\n\tmediaField: 'featured_media',\n\tfields: [ 'author', 'status' ],\n\t...defaultLayouts.list,\n};\n\nexport function getDefaultViews( postType ) {\n\treturn [\n\t\t{\n\t\t\ttitle: postType?.labels?.all_items || __( 'All items' ),\n\t\t\tslug: 'all',\n\t\t\ticon: pages,\n\t\t\tview: DEFAULT_VIEW,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Published' ),\n\t\t\tslug: 'published',\n\t\t\ticon: published,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Scheduled' ),\n\t\t\tslug: 'future',\n\t\t\ticon: scheduled,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\ticon: drafts,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Pending' ),\n\t\t\tslug: 'pending',\n\t\t\ticon: pending,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Private' ),\n\t\t\tslug: 'private',\n\t\t\ticon: notAllowed,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Trash' ),\n\t\t\tslug: 'trash',\n\t\t\ticon: trash,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\ttype: 'table',\n\t\t\t\tlayout: defaultLayouts.table.layout,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t];\n}\n\nconst SLUG_TO_STATUS = {\n\tpublished: 'publish',\n\tfuture: 'future',\n\tdrafts: 'draft',\n\tpending: 'pending',\n\tprivate: 'private',\n\ttrash: 'trash',\n};\n\nexport function getActiveViewOverridesForTab( activeView ) {\n\tconst base = {\n\t\t...defaultLayouts.table,\n\t};\n\tconst status = SLUG_TO_STATUS[ activeView ];\n\tif ( ! status ) {\n\t\treturn base;\n\t}\n\treturn {\n\t\t...base,\n\t\tfilters: [\n\t\t\t{\n\t\t\t\tfield: 'status',\n\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\tvalue: status,\n\t\t\t\tisLocked: true,\n\t\t\t},\n\t\t],\n\t};\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAEnB,mBAQO;AAKP,uBAAgC;AAEzB,IAAM,iBAAiB;AAAA,EAC7B,OAAO;AAAA,IACN,QAAQ;AAAA,MACP,QAAQ;AAAA,QACP,QAAQ;AAAA,UACP,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AACR;AAEO,IAAM,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,SAAS,CAAC;AAAA,EACV,SAAS;AAAA,EACT,MAAM;AAAA,IACL,OAAO;AAAA,IACP,WAAW;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ,CAAE,UAAU,QAAS;AAAA,EAC7B,GAAG,eAAe;AACnB;AAEO,SAAS,gBAAiB,UAAW;AAC3C,SAAO;AAAA,IACN;AAAA,MACC,OAAO,UAAU,QAAQ,iBAAa,gBAAI,WAAY;AAAA,MACtD,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,WAAO,gBAAI,WAAY;AAAA,MACvB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,QACL,GAAG;AAAA,QACH,SAAS;AAAA,UACR;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,OAAO;AAAA,YACP,UAAU;AAAA,UACX;AAAA,Q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UAAU;AAAA,YACV,OAAO;AAAA,YACP,UAAU;AAAA,UACX;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEA,IAAM,iBAAiB;AAAA,EACtB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACR;AAEO,SAAS,6BAA8B,YAAa;AAC1D,QAAM,OAAO;AAAA,IACZ,GAAG,eAAe;AAAA,EACnB;AACA,QAAM,SAAS,eAAgB,UAAW;AAC1C,MAAK,CAAE,QAAS;AACf,WAAO;AAAA,EACR;AACA,SAAO;AAAA,IACN,GAAG;AAAA,IACH,SAAS;AAAA,MACR;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV,OAAO;AAAA,QACP,UAAU;AAAA,MACX;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/edit-site/src/components/sidebar-dataviews/dataview-item.js
|
|
31
|
-
var dataview_item_exports = {};
|
|
32
|
-
__export(dataview_item_exports, {
|
|
33
|
-
default: () => DataViewItem
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(dataview_item_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
|
-
var import_router = require("@wordpress/router");
|
|
38
|
-
var import_components = require("@wordpress/components");
|
|
39
|
-
var import_dataviews = require("@wordpress/dataviews");
|
|
40
|
-
var import_url = require("@wordpress/url");
|
|
41
|
-
var import_sidebar_navigation_item = __toESM(require("../sidebar-navigation-item/index.cjs"));
|
|
42
|
-
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
43
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
45
|
-
function DataViewItem({
|
|
46
|
-
title,
|
|
47
|
-
slug,
|
|
48
|
-
type,
|
|
49
|
-
icon,
|
|
50
|
-
isActive,
|
|
51
|
-
suffix
|
|
52
|
-
}) {
|
|
53
|
-
const { path } = useLocation();
|
|
54
|
-
const iconToUse = icon || import_dataviews.VIEW_LAYOUTS.find((v) => v.type === type).icon;
|
|
55
|
-
if (slug === "all") {
|
|
56
|
-
slug = void 0;
|
|
57
|
-
}
|
|
58
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
59
|
-
import_components.__experimentalHStack,
|
|
60
|
-
{
|
|
61
|
-
justify: "flex-start",
|
|
62
|
-
className: (0, import_clsx.default)("edit-site-sidebar-dataviews-dataview-item", {
|
|
63
|
-
"is-selected": isActive
|
|
64
|
-
}),
|
|
65
|
-
children: [
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
-
import_sidebar_navigation_item.default,
|
|
68
|
-
{
|
|
69
|
-
icon: iconToUse,
|
|
70
|
-
to: (0, import_url.addQueryArgs)(path, {
|
|
71
|
-
activeView: slug
|
|
72
|
-
}),
|
|
73
|
-
"aria-current": isActive ? "true" : void 0,
|
|
74
|
-
children: title
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
suffix
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=dataview-item.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-dataviews/dataview-item.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\ttype,\n\ticon,\n\tisActive,\n\tsuffix,\n} ) {\n\tconst { path } = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tif ( slug === 'all' ) {\n\t\tslug = undefined;\n\t}\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\tto={ addQueryArgs( path, {\n\t\t\t\t\tactiveView: slug,\n\t\t\t\t} ) }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,oBAAiD;AACjD,wBAA+C;AAC/C,uBAA6B;AAC7B,iBAA6B;AAK7B,qCAAkC;AAClC,yBAAuB;AAoBrB;AAnBF,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAEnC,SAAR,aAA+B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,KAAK,IAAI,YAAY;AAE7B,QAAM,YACL,QAAQ,8BAAa,KAAM,CAAE,MAAO,EAAE,SAAS,IAAK,EAAE;AAEvD,MAAK,SAAS,OAAQ;AACrB,WAAO;AAAA,EACR;AACA,SACC;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACA,SAAQ;AAAA,MACR,eAAY,YAAAC,SAAM,6CAA6C;AAAA,QAC9D,eAAe;AAAA,MAChB,CAAE;AAAA,MAEF;AAAA;AAAA,UAAC,+BAAAC;AAAA,UAAA;AAAA,YACA,MAAO;AAAA,YACP,QAAK,yBAAc,MAAM;AAAA,cACxB,YAAY;AAAA,YACb,CAAE;AAAA,YACF,gBAAe,WAAW,SAAS;AAAA,YAEjC;AAAA;AAAA,QACH;AAAA,QACE;AAAA;AAAA;AAAA,EACH;AAEF;",
|
|
6
|
-
"names": ["routerPrivateApis", "HStack", "clsx", "SidebarNavigationItem"]
|
|
7
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
// packages/edit-site/src/components/post-list/view-utils.js
|
|
2
|
-
import { __ } from "@wordpress/i18n";
|
|
3
|
-
import {
|
|
4
|
-
trash,
|
|
5
|
-
pages,
|
|
6
|
-
drafts,
|
|
7
|
-
published,
|
|
8
|
-
scheduled,
|
|
9
|
-
pending,
|
|
10
|
-
notAllowed
|
|
11
|
-
} from "@wordpress/icons";
|
|
12
|
-
import { OPERATOR_IS_ANY } from "../../utils/constants.mjs";
|
|
13
|
-
var defaultLayouts = {
|
|
14
|
-
table: {
|
|
15
|
-
layout: {
|
|
16
|
-
styles: {
|
|
17
|
-
author: {
|
|
18
|
-
align: "start"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
grid: {},
|
|
24
|
-
list: {}
|
|
25
|
-
};
|
|
26
|
-
var DEFAULT_VIEW = {
|
|
27
|
-
type: "list",
|
|
28
|
-
filters: [],
|
|
29
|
-
perPage: 20,
|
|
30
|
-
sort: {
|
|
31
|
-
field: "title",
|
|
32
|
-
direction: "asc"
|
|
33
|
-
},
|
|
34
|
-
showLevels: true,
|
|
35
|
-
titleField: "title",
|
|
36
|
-
mediaField: "featured_media",
|
|
37
|
-
fields: ["author", "status"],
|
|
38
|
-
...defaultLayouts.list
|
|
39
|
-
};
|
|
40
|
-
function getDefaultViews(postType) {
|
|
41
|
-
return [
|
|
42
|
-
{
|
|
43
|
-
title: postType?.labels?.all_items || __("All items"),
|
|
44
|
-
slug: "all",
|
|
45
|
-
icon: pages,
|
|
46
|
-
view: DEFAULT_VIEW
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
title: __("Published"),
|
|
50
|
-
slug: "published",
|
|
51
|
-
icon: published,
|
|
52
|
-
view: {
|
|
53
|
-
...DEFAULT_VIEW,
|
|
54
|
-
filters: [
|
|
55
|
-
{
|
|
56
|
-
field: "status",
|
|
57
|
-
operator: OPERATOR_IS_ANY,
|
|
58
|
-
value: "publish",
|
|
59
|
-
isLocked: true
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
title: __("Scheduled"),
|
|
66
|
-
slug: "future",
|
|
67
|
-
icon: scheduled,
|
|
68
|
-
view: {
|
|
69
|
-
...DEFAULT_VIEW,
|
|
70
|
-
filters: [
|
|
71
|
-
{
|
|
72
|
-
field: "status",
|
|
73
|
-
operator: OPERATOR_IS_ANY,
|
|
74
|
-
value: "future",
|
|
75
|
-
isLocked: true
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
title: __("Drafts"),
|
|
82
|
-
slug: "drafts",
|
|
83
|
-
icon: drafts,
|
|
84
|
-
view: {
|
|
85
|
-
...DEFAULT_VIEW,
|
|
86
|
-
filters: [
|
|
87
|
-
{
|
|
88
|
-
field: "status",
|
|
89
|
-
operator: OPERATOR_IS_ANY,
|
|
90
|
-
value: "draft",
|
|
91
|
-
isLocked: true
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
title: __("Pending"),
|
|
98
|
-
slug: "pending",
|
|
99
|
-
icon: pending,
|
|
100
|
-
view: {
|
|
101
|
-
...DEFAULT_VIEW,
|
|
102
|
-
filters: [
|
|
103
|
-
{
|
|
104
|
-
field: "status",
|
|
105
|
-
operator: OPERATOR_IS_ANY,
|
|
106
|
-
value: "pending",
|
|
107
|
-
isLocked: true
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
title: __("Private"),
|
|
114
|
-
slug: "private",
|
|
115
|
-
icon: notAllowed,
|
|
116
|
-
view: {
|
|
117
|
-
...DEFAULT_VIEW,
|
|
118
|
-
filters: [
|
|
119
|
-
{
|
|
120
|
-
field: "status",
|
|
121
|
-
operator: OPERATOR_IS_ANY,
|
|
122
|
-
value: "private",
|
|
123
|
-
isLocked: true
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
title: __("Trash"),
|
|
130
|
-
slug: "trash",
|
|
131
|
-
icon: trash,
|
|
132
|
-
view: {
|
|
133
|
-
...DEFAULT_VIEW,
|
|
134
|
-
type: "table",
|
|
135
|
-
layout: defaultLayouts.table.layout,
|
|
136
|
-
filters: [
|
|
137
|
-
{
|
|
138
|
-
field: "status",
|
|
139
|
-
operator: OPERATOR_IS_ANY,
|
|
140
|
-
value: "trash",
|
|
141
|
-
isLocked: true
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
];
|
|
147
|
-
}
|
|
148
|
-
var SLUG_TO_STATUS = {
|
|
149
|
-
published: "publish",
|
|
150
|
-
future: "future",
|
|
151
|
-
drafts: "draft",
|
|
152
|
-
pending: "pending",
|
|
153
|
-
private: "private",
|
|
154
|
-
trash: "trash"
|
|
155
|
-
};
|
|
156
|
-
function getActiveViewOverridesForTab(activeView) {
|
|
157
|
-
const base = {
|
|
158
|
-
...defaultLayouts.table
|
|
159
|
-
};
|
|
160
|
-
const status = SLUG_TO_STATUS[activeView];
|
|
161
|
-
if (!status) {
|
|
162
|
-
return base;
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
...base,
|
|
166
|
-
filters: [
|
|
167
|
-
{
|
|
168
|
-
field: "status",
|
|
169
|
-
operator: OPERATOR_IS_ANY,
|
|
170
|
-
value: status,
|
|
171
|
-
isLocked: true
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
export {
|
|
177
|
-
DEFAULT_VIEW,
|
|
178
|
-
defaultLayouts,
|
|
179
|
-
getActiveViewOverridesForTab,
|
|
180
|
-
getDefaultViews
|
|
181
|
-
};
|
|
182
|
-
//# sourceMappingURL=view-utils.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/post-list/view-utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { OPERATOR_IS_ANY } from '../../utils/constants';\n\nexport const defaultLayouts = {\n\ttable: {\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\talign: 'start',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\tgrid: {},\n\tlist: {},\n};\n\nexport const DEFAULT_VIEW = {\n\ttype: 'list',\n\tfilters: [],\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\tshowLevels: true,\n\ttitleField: 'title',\n\tmediaField: 'featured_media',\n\tfields: [ 'author', 'status' ],\n\t...defaultLayouts.list,\n};\n\nexport function getDefaultViews( postType ) {\n\treturn [\n\t\t{\n\t\t\ttitle: postType?.labels?.all_items || __( 'All items' ),\n\t\t\tslug: 'all',\n\t\t\ticon: pages,\n\t\t\tview: DEFAULT_VIEW,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Published' ),\n\t\t\tslug: 'published',\n\t\t\ticon: published,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Scheduled' ),\n\t\t\tslug: 'future',\n\t\t\ticon: scheduled,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\ticon: drafts,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Pending' ),\n\t\t\tslug: 'pending',\n\t\t\ticon: pending,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Private' ),\n\t\t\tslug: 'private',\n\t\t\ticon: notAllowed,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Trash' ),\n\t\t\tslug: 'trash',\n\t\t\ticon: trash,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_VIEW,\n\t\t\t\ttype: 'table',\n\t\t\t\tlayout: defaultLayouts.table.layout,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t\tisLocked: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t];\n}\n\nconst SLUG_TO_STATUS = {\n\tpublished: 'publish',\n\tfuture: 'future',\n\tdrafts: 'draft',\n\tpending: 'pending',\n\tprivate: 'private',\n\ttrash: 'trash',\n};\n\nexport function getActiveViewOverridesForTab( activeView ) {\n\tconst base = {\n\t\t...defaultLayouts.table,\n\t};\n\tconst status = SLUG_TO_STATUS[ activeView ];\n\tif ( ! status ) {\n\t\treturn base;\n\t}\n\treturn {\n\t\t...base,\n\t\tfilters: [\n\t\t\t{\n\t\t\t\tfield: 'status',\n\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\tvalue: status,\n\t\t\t\tisLocked: true,\n\t\t\t},\n\t\t],\n\t};\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AAEnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,uBAAuB;AAEzB,IAAM,iBAAiB;AAAA,EAC7B,OAAO;AAAA,IACN,QAAQ;AAAA,MACP,QAAQ;AAAA,QACP,QAAQ;AAAA,UACP,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA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
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-dataviews/dataview-item.js
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
4
|
-
import { __experimentalHStack as HStack } from "@wordpress/components";
|
|
5
|
-
import { VIEW_LAYOUTS } from "@wordpress/dataviews";
|
|
6
|
-
import { addQueryArgs } from "@wordpress/url";
|
|
7
|
-
import SidebarNavigationItem from "../sidebar-navigation-item/index.mjs";
|
|
8
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
var { useLocation } = unlock(routerPrivateApis);
|
|
11
|
-
function DataViewItem({
|
|
12
|
-
title,
|
|
13
|
-
slug,
|
|
14
|
-
type,
|
|
15
|
-
icon,
|
|
16
|
-
isActive,
|
|
17
|
-
suffix
|
|
18
|
-
}) {
|
|
19
|
-
const { path } = useLocation();
|
|
20
|
-
const iconToUse = icon || VIEW_LAYOUTS.find((v) => v.type === type).icon;
|
|
21
|
-
if (slug === "all") {
|
|
22
|
-
slug = void 0;
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ jsxs(
|
|
25
|
-
HStack,
|
|
26
|
-
{
|
|
27
|
-
justify: "flex-start",
|
|
28
|
-
className: clsx("edit-site-sidebar-dataviews-dataview-item", {
|
|
29
|
-
"is-selected": isActive
|
|
30
|
-
}),
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
SidebarNavigationItem,
|
|
34
|
-
{
|
|
35
|
-
icon: iconToUse,
|
|
36
|
-
to: addQueryArgs(path, {
|
|
37
|
-
activeView: slug
|
|
38
|
-
}),
|
|
39
|
-
"aria-current": isActive ? "true" : void 0,
|
|
40
|
-
children: title
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
suffix
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
DataViewItem as default
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=dataview-item.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-dataviews/dataview-item.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\ttype,\n\ticon,\n\tisActive,\n\tsuffix,\n} ) {\n\tconst { path } = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tif ( slug === 'all' ) {\n\t\tslug = undefined;\n\t}\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\tto={ addQueryArgs( path, {\n\t\t\t\t\tactiveView: slug,\n\t\t\t\t} ) }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,eAAe,yBAAyB;AACjD,SAAS,wBAAwB,cAAc;AAC/C,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAK7B,OAAO,2BAA2B;AAClC,SAAS,cAAc;AAoBrB,SAMC,KAND;AAnBF,IAAM,EAAE,YAAY,IAAI,OAAQ,iBAAkB;AAEnC,SAAR,aAA+B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,KAAK,IAAI,YAAY;AAE7B,QAAM,YACL,QAAQ,aAAa,KAAM,CAAE,MAAO,EAAE,SAAS,IAAK,EAAE;AAEvD,MAAK,SAAS,OAAQ;AACrB,WAAO;AAAA,EACR;AACA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAQ;AAAA,MACR,WAAY,KAAM,6CAA6C;AAAA,QAC9D,eAAe;AAAA,MAChB,CAAE;AAAA,MAEF;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,MAAO;AAAA,YACP,IAAK,aAAc,MAAM;AAAA,cACxB,YAAY;AAAA,YACb,CAAE;AAAA,YACF,gBAAe,WAAW,SAAS;AAAA,YAEjC;AAAA;AAAA,QACH;AAAA,QACE;AAAA;AAAA;AAAA,EACH;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|