@blocklet/pages-kit-inner-components 0.6.1 → 0.6.3
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/lib/cjs/add-component.js +1 -420
- package/lib/cjs/chunks/draft-data-CfIMszE7.js +1 -0
- package/lib/cjs/chunks/home-DUjl5PbP.js +6 -0
- package/lib/cjs/chunks/publish-button-C522nNv6.js +1 -0
- package/lib/cjs/chunks/site-state-BG2d2tBl.js +57 -0
- package/lib/cjs/chunks/state-CtNs8GrN.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +11 -4
- package/lib/cjs/resources.js +1 -1
- package/lib/es/add-component.js +2 -1089
- package/lib/es/chunks/{draft-data-CafrGKeh.js → draft-data-bRUHvvzp.js} +5 -4
- package/lib/es/chunks/home-VWWdvIPQ.js +69 -0
- package/lib/es/chunks/{publish-button-XSZrDaTQ.js → publish-button-Ceet-m88.js} +158 -140
- package/lib/es/chunks/site-state-BoVWlYLn.js +2096 -0
- package/lib/es/chunks/state-BdNIIXJP.js +502 -0
- package/lib/es/home.js +3 -28
- package/lib/es/project-html.js +114 -130
- package/lib/es/resources.js +93 -137
- package/package.json +11 -11
- package/lib/cjs/chunks/draft-data-D44_IEV2.js +0 -1
- package/lib/cjs/chunks/home-BYk01EUy.js +0 -39
- package/lib/cjs/chunks/index-BRgYwvuv.js +0 -475
- package/lib/cjs/chunks/publish-button-C8XPA4g_.js +0 -1
- package/lib/cjs/chunks/session-BRtsDvA-.js +0 -1
- package/lib/cjs/chunks/site-state-gSkcvhcV.js +0 -57
- package/lib/cjs/chunks/state-B6BF5wJ-.js +0 -1
- package/lib/cjs/chunks-map.json +0 -1
- package/lib/cjs/components.js +0 -1
- package/lib/cjs/locales.js +0 -3
- package/lib/cjs/setting.js +0 -11
- package/lib/cjs/site-state.js +0 -1
- package/lib/cjs/theme.js +0 -1
- package/lib/cjs/uploader.js +0 -1
- package/lib/es/chunks/home-DW8SdyfO.js +0 -594
- package/lib/es/chunks/index-D5gXPe_7.js +0 -2326
- package/lib/es/chunks/session-C72Dq8zg.js +0 -19
- package/lib/es/chunks/site-state-W2H7XCSQ.js +0 -2077
- package/lib/es/chunks/state-0gvZF3k2.js +0 -573
- package/lib/es/chunks-map.json +0 -1
- package/lib/es/components.js +0 -22
- package/lib/es/locales.js +0 -1032
- package/lib/es/setting.js +0 -2294
- package/lib/es/site-state.js +0 -48
- package/lib/es/theme.js +0 -484
- package/lib/es/uploader.js +0 -8
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as u, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import { g as ae, p as le, a as ce } from "./home-VWWdvIPQ.js";
|
|
3
3
|
import { useLocaleContext as G } from "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import q from "@arcblock/ux/lib/Toast";
|
|
5
|
-
import { generateParamCombinations as
|
|
6
|
-
import { Warning as
|
|
5
|
+
import { generateParamCombinations as de } from "@blocklet/pages-kit/utils/route";
|
|
6
|
+
import { Warning as ue, Sync as _, VisibilityOff as ee, KeyboardArrowDown as me, KeyboardArrowRight as pe } from "@mui/icons-material";
|
|
7
7
|
import { LoadingButton as te } from "@mui/lab";
|
|
8
|
-
import {
|
|
9
|
-
import { produce as
|
|
8
|
+
import { Box as f, CircularProgress as ge, createSvgIcon as he, Dialog as fe, DialogTitle as be, IconButton as xe, DialogContent as ye, DialogActions as we, Button as ke, Alert as Pe, List as Se, ListItem as M, ListItemButton as $, ListItemIcon as W, Checkbox as I, ListItemText as K, Tooltip as N, Collapse as De, Chip as Oe } from "@mui/material";
|
|
9
|
+
import { produce as Ae } from "immer";
|
|
10
10
|
import Z from "lodash/difference";
|
|
11
|
-
import { useState as D, useMemo as C, useCallback as O, useImperativeHandle as
|
|
12
|
-
import { useAsync as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
import { useState as D, useMemo as C, useCallback as O, useImperativeHandle as je, useEffect as L, useRef as ve } from "react";
|
|
12
|
+
import { useAsync as Ce } from "react-use";
|
|
13
|
+
import { u as ze } from "./state-BdNIIXJP.js";
|
|
14
|
+
function Re(r) {
|
|
15
|
+
return /* @__PURE__ */ t(
|
|
16
|
+
f,
|
|
17
|
+
{
|
|
18
|
+
...r,
|
|
19
|
+
sx: [
|
|
20
|
+
{
|
|
21
|
+
display: "flex",
|
|
22
|
+
flex: 1,
|
|
23
|
+
height: "100%",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center"
|
|
26
|
+
},
|
|
27
|
+
...Array.isArray(r.sx) ? r.sx : [r.sx]
|
|
28
|
+
],
|
|
29
|
+
children: /* @__PURE__ */ t(ge, { size: 30 })
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function Te(r) {
|
|
34
|
+
const [m, g] = D(!1);
|
|
17
35
|
return /* @__PURE__ */ t(
|
|
18
36
|
te,
|
|
19
37
|
{
|
|
20
|
-
...
|
|
21
|
-
loading:
|
|
38
|
+
...r,
|
|
39
|
+
loading: r.loading || m,
|
|
22
40
|
onClick: (a) => {
|
|
23
|
-
const d =
|
|
41
|
+
const d = r.onClick?.(a);
|
|
24
42
|
d instanceof Promise && (g(!0), d.finally(() => {
|
|
25
43
|
g(!1);
|
|
26
44
|
}));
|
|
@@ -28,8 +46,8 @@ function ze(s) {
|
|
|
28
46
|
}
|
|
29
47
|
);
|
|
30
48
|
}
|
|
31
|
-
const
|
|
32
|
-
/* @__PURE__ */
|
|
49
|
+
const Be = he(
|
|
50
|
+
/* @__PURE__ */ u("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
33
51
|
/* @__PURE__ */ t(
|
|
34
52
|
"path",
|
|
35
53
|
{
|
|
@@ -53,57 +71,57 @@ const Te = pe(
|
|
|
53
71
|
] }),
|
|
54
72
|
"Close"
|
|
55
73
|
);
|
|
56
|
-
function
|
|
57
|
-
const [
|
|
58
|
-
|
|
74
|
+
function Ee() {
|
|
75
|
+
const [r, m] = D(), g = C(() => r ? /* @__PURE__ */ t(fe, { ...r }) : null, [r]), a = O(() => {
|
|
76
|
+
m(void 0);
|
|
59
77
|
}, []), d = O(
|
|
60
78
|
({
|
|
61
79
|
title: y,
|
|
62
80
|
content: c,
|
|
63
81
|
cancelText: A = "Cancel",
|
|
64
|
-
okText:
|
|
82
|
+
okText: b = "Ok",
|
|
65
83
|
onOk: w,
|
|
66
84
|
onClose: l,
|
|
67
|
-
okIcon:
|
|
85
|
+
okIcon: z,
|
|
68
86
|
okColor: k = "primary",
|
|
69
87
|
cancelColor: h = "primary",
|
|
70
|
-
DialogContentProps:
|
|
88
|
+
DialogContentProps: E,
|
|
71
89
|
form: F,
|
|
72
90
|
...H
|
|
73
91
|
}) => {
|
|
74
|
-
|
|
92
|
+
m({
|
|
75
93
|
...H,
|
|
76
94
|
open: !0,
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
y && /* @__PURE__ */
|
|
79
|
-
|
|
95
|
+
children: /* @__PURE__ */ u("form", { onSubmit: (R) => R.preventDefault(), children: [
|
|
96
|
+
y && /* @__PURE__ */ u(
|
|
97
|
+
be,
|
|
80
98
|
{
|
|
81
99
|
className: "between",
|
|
82
100
|
zIndex: "appBar",
|
|
83
101
|
bgcolor: "background.paper",
|
|
84
|
-
sx: { borderBottom: (
|
|
102
|
+
sx: { borderBottom: (R) => `1px solid ${R.palette.divider}` },
|
|
85
103
|
children: [
|
|
86
|
-
/* @__PURE__ */ t(
|
|
104
|
+
/* @__PURE__ */ t(f, { children: y }),
|
|
87
105
|
/* @__PURE__ */ t(
|
|
88
|
-
|
|
106
|
+
xe,
|
|
89
107
|
{
|
|
90
108
|
size: "small",
|
|
91
109
|
onClick: async () => {
|
|
92
110
|
a(), l?.();
|
|
93
111
|
},
|
|
94
|
-
children: /* @__PURE__ */ t(
|
|
112
|
+
children: /* @__PURE__ */ t(Be, {})
|
|
95
113
|
}
|
|
96
114
|
)
|
|
97
115
|
]
|
|
98
116
|
}
|
|
99
117
|
),
|
|
100
118
|
c && /* @__PURE__ */ t(
|
|
101
|
-
|
|
119
|
+
ye,
|
|
102
120
|
{
|
|
103
|
-
...
|
|
104
|
-
sx: { mt: -3, ...
|
|
121
|
+
...E,
|
|
122
|
+
sx: { mt: -3, ...E?.sx, bgcolor: "background.paper" },
|
|
105
123
|
children: /* @__PURE__ */ t(
|
|
106
|
-
|
|
124
|
+
f,
|
|
107
125
|
{
|
|
108
126
|
sx: {
|
|
109
127
|
pt: 3
|
|
@@ -113,20 +131,20 @@ function Le() {
|
|
|
113
131
|
)
|
|
114
132
|
}
|
|
115
133
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */ t(
|
|
134
|
+
/* @__PURE__ */ u(we, { sx: { bgcolor: "background.paper" }, children: [
|
|
135
|
+
/* @__PURE__ */ t(ke, { variant: "outlined", color: h || "primary", onClick: l ?? a, children: A }),
|
|
118
136
|
/* @__PURE__ */ t(
|
|
119
|
-
|
|
137
|
+
Te,
|
|
120
138
|
{
|
|
121
139
|
variant: "contained",
|
|
122
140
|
color: k || "primary",
|
|
123
|
-
startIcon:
|
|
124
|
-
loadingPosition:
|
|
141
|
+
startIcon: z,
|
|
142
|
+
loadingPosition: z ? "start" : "center",
|
|
125
143
|
onClick: async () => {
|
|
126
144
|
await w?.(), a();
|
|
127
145
|
},
|
|
128
146
|
type: "submit",
|
|
129
|
-
children:
|
|
147
|
+
children: b
|
|
130
148
|
}
|
|
131
149
|
)
|
|
132
150
|
] })
|
|
@@ -139,19 +157,19 @@ function Le() {
|
|
|
139
157
|
return { dialog: g, showDialog: d, closeDialog: a };
|
|
140
158
|
}
|
|
141
159
|
const Xe = ({
|
|
142
|
-
ref:
|
|
143
|
-
mode:
|
|
160
|
+
ref: r,
|
|
161
|
+
mode: m,
|
|
144
162
|
state: g
|
|
145
163
|
}) => {
|
|
146
|
-
const { t: a } = G(), [d, y] = D(!1), { dialog: c, showDialog: A } =
|
|
147
|
-
(
|
|
164
|
+
const { t: a } = G(), [d, y] = D(!1), { dialog: c, showDialog: A } = Ee(), b = ze(), w = O(
|
|
165
|
+
(z) => {
|
|
148
166
|
let k = [];
|
|
149
167
|
A({
|
|
150
168
|
title: a("maker.publishToProduction"),
|
|
151
|
-
content: /* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */ t(
|
|
169
|
+
content: /* @__PURE__ */ u(f, { sx: { minWidth: 300 }, children: [
|
|
170
|
+
/* @__PURE__ */ t(Pe, { color: "warning", icon: /* @__PURE__ */ t(ue, {}), children: a("maker.publishToProductionTip") }),
|
|
153
171
|
/* @__PURE__ */ t(
|
|
154
|
-
|
|
172
|
+
f,
|
|
155
173
|
{
|
|
156
174
|
sx: {
|
|
157
175
|
maxHeight: "50vh",
|
|
@@ -159,12 +177,12 @@ const Xe = ({
|
|
|
159
177
|
mt: 2
|
|
160
178
|
},
|
|
161
179
|
children: /* @__PURE__ */ t(
|
|
162
|
-
|
|
180
|
+
Me,
|
|
163
181
|
{
|
|
164
182
|
state: g,
|
|
165
|
-
toMode:
|
|
183
|
+
toMode: m,
|
|
166
184
|
onChange: (h) => k = h,
|
|
167
|
-
defaultRouteIds:
|
|
185
|
+
defaultRouteIds: z
|
|
168
186
|
}
|
|
169
187
|
)
|
|
170
188
|
}
|
|
@@ -177,9 +195,9 @@ const Xe = ({
|
|
|
177
195
|
const h = a("maker.publishSelectPagesMessage");
|
|
178
196
|
throw q.error(h), new Error(h);
|
|
179
197
|
}
|
|
180
|
-
localStorage.setItem(
|
|
198
|
+
localStorage.setItem(ae(b ?? ""), String((/* @__PURE__ */ new Date()).getTime())), y(!0);
|
|
181
199
|
try {
|
|
182
|
-
await
|
|
200
|
+
await le({ mode: m, routes: k }), q.success(a("maker.publishSuccessMessage"));
|
|
183
201
|
} catch (h) {
|
|
184
202
|
throw q.error(h.message), h;
|
|
185
203
|
} finally {
|
|
@@ -188,15 +206,15 @@ const Xe = ({
|
|
|
188
206
|
}
|
|
189
207
|
});
|
|
190
208
|
},
|
|
191
|
-
[
|
|
209
|
+
[m, g, a, b, A]
|
|
192
210
|
);
|
|
193
|
-
|
|
211
|
+
je(r, () => ({
|
|
194
212
|
openPublishDialog: w
|
|
195
213
|
}));
|
|
196
214
|
const l = O(() => {
|
|
197
215
|
w();
|
|
198
216
|
}, [w]);
|
|
199
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ u(oe, { children: [
|
|
200
218
|
/* @__PURE__ */ t(
|
|
201
219
|
te,
|
|
202
220
|
{
|
|
@@ -213,20 +231,20 @@ const Xe = ({
|
|
|
213
231
|
c
|
|
214
232
|
] });
|
|
215
233
|
};
|
|
216
|
-
function
|
|
217
|
-
routePathInfo:
|
|
218
|
-
checked:
|
|
234
|
+
function Le({
|
|
235
|
+
routePathInfo: r,
|
|
236
|
+
checked: m,
|
|
219
237
|
onClick: g,
|
|
220
238
|
route: a
|
|
221
239
|
}) {
|
|
222
|
-
const { t: d } = G(), y = !
|
|
240
|
+
const { t: d } = G(), y = !r.routeMetaData?.publishedAt || r.routeMetaData?.updatedAt && new Date(r.routeMetaData?.updatedAt) > new Date(r.routeMetaData?.publishedAt);
|
|
223
241
|
return /* @__PURE__ */ t(
|
|
224
242
|
M,
|
|
225
243
|
{
|
|
226
244
|
sx: { pl: 4, pr: 3 },
|
|
227
245
|
disablePadding: !0,
|
|
228
|
-
secondaryAction: /* @__PURE__ */
|
|
229
|
-
|
|
246
|
+
secondaryAction: /* @__PURE__ */ u(
|
|
247
|
+
f,
|
|
230
248
|
{
|
|
231
249
|
sx: {
|
|
232
250
|
display: "flex",
|
|
@@ -235,7 +253,7 @@ function Be({
|
|
|
235
253
|
},
|
|
236
254
|
children: [
|
|
237
255
|
y && /* @__PURE__ */ t(
|
|
238
|
-
|
|
256
|
+
f,
|
|
239
257
|
{
|
|
240
258
|
className: "visible",
|
|
241
259
|
title: d("maker.pages.needPublish"),
|
|
@@ -245,28 +263,28 @@ function Be({
|
|
|
245
263
|
display: "flex",
|
|
246
264
|
alignItems: "center"
|
|
247
265
|
},
|
|
248
|
-
children: /* @__PURE__ */ t(
|
|
266
|
+
children: /* @__PURE__ */ t(N, { title: d("maker.pages.needPublish"), children: /* @__PURE__ */ t(_, { fontSize: "small", sx: { fontSize: "16px" } }) })
|
|
249
267
|
}
|
|
250
268
|
),
|
|
251
|
-
(!
|
|
252
|
-
|
|
269
|
+
(!r.routeMetaData?.isPublic || !a.isPublic) && /* @__PURE__ */ t(
|
|
270
|
+
f,
|
|
253
271
|
{
|
|
254
272
|
className: "visible",
|
|
255
273
|
sx: {
|
|
256
274
|
color: "warning.main"
|
|
257
275
|
},
|
|
258
|
-
children: /* @__PURE__ */ t(
|
|
276
|
+
children: /* @__PURE__ */ t(N, { title: d("maker.pages.notPublic"), children: /* @__PURE__ */ t(ee, { fontSize: "small", sx: { fontSize: "16px" } }) })
|
|
259
277
|
}
|
|
260
278
|
)
|
|
261
279
|
]
|
|
262
280
|
}
|
|
263
281
|
),
|
|
264
|
-
children: /* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
|
|
282
|
+
children: /* @__PURE__ */ u($, { onClick: g, dense: !0, children: [
|
|
283
|
+
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(I, { edge: "start", checked: m, tabIndex: -1 }) }),
|
|
266
284
|
/* @__PURE__ */ t(
|
|
267
|
-
|
|
285
|
+
K,
|
|
268
286
|
{
|
|
269
|
-
primary:
|
|
287
|
+
primary: r.path,
|
|
270
288
|
slotProps: {
|
|
271
289
|
primary: {
|
|
272
290
|
fontSize: "0.8rem",
|
|
@@ -283,23 +301,23 @@ function Be({
|
|
|
283
301
|
}
|
|
284
302
|
);
|
|
285
303
|
}
|
|
286
|
-
function
|
|
287
|
-
state:
|
|
288
|
-
toMode:
|
|
304
|
+
function Me({
|
|
305
|
+
state: r,
|
|
306
|
+
toMode: m,
|
|
289
307
|
onChange: g,
|
|
290
308
|
defaultRouteIds: a
|
|
291
309
|
}) {
|
|
292
|
-
const { t: d, locale: y } = G(), [c, A] = D(!1), [
|
|
310
|
+
const { t: d, locale: y } = G(), [c, A] = D(!1), [b, w] = D(
|
|
293
311
|
() => a ? Object.fromEntries(a.filter((e) => !e.includes("-")).map((e) => [e, !0])) : {}
|
|
294
|
-
), [l,
|
|
312
|
+
), [l, z] = D({}), [k, h] = D(
|
|
295
313
|
() => a ? Object.fromEntries(a.filter((e) => e.includes("-")).map((e) => [e, !0])) : {}
|
|
296
|
-
), [
|
|
297
|
-
if (
|
|
298
|
-
throw
|
|
299
|
-
const x = C(() =>
|
|
300
|
-
const
|
|
301
|
-
return
|
|
302
|
-
}), [
|
|
314
|
+
), [E, F] = D({}), { loading: H, error: R, value: P } = Ce(() => ce({ mode: m }), [m]);
|
|
315
|
+
if (R)
|
|
316
|
+
throw R;
|
|
317
|
+
const x = C(() => r.routeIds || [], [r]), J = C(() => P?.pageIds || [], [P]), j = C(() => !x || !r.routes ? [] : JSON.parse(JSON.stringify(x)).sort((n, i) => {
|
|
318
|
+
const s = r.routes?.[n], o = r.routes?.[i];
|
|
319
|
+
return s?.publishedAt && new Date(s.publishedAt).getTime() < new Date(s.updatedAt).getTime() ? -1 : o?.publishedAt && new Date(o.publishedAt).getTime() < new Date(o.updatedAt).getTime() ? 1 : new Date(s?.updatedAt ?? "").getTime() - new Date(o?.updatedAt ?? "").getTime();
|
|
320
|
+
}), [r, x]), V = C(() => {
|
|
303
321
|
if (!j) return [];
|
|
304
322
|
if (!l) return j;
|
|
305
323
|
const e = [...j].filter((n) => !l[n]);
|
|
@@ -309,17 +327,17 @@ function Ee({
|
|
|
309
327
|
});
|
|
310
328
|
}), e;
|
|
311
329
|
}, [j, l]), v = C(
|
|
312
|
-
() => !
|
|
313
|
-
[V,
|
|
314
|
-
),
|
|
330
|
+
() => !P || !J || !V ? [] : Z(J, V),
|
|
331
|
+
[V, P, J]
|
|
332
|
+
), B = C(
|
|
315
333
|
() => x ? [...x].concat(v) : v,
|
|
316
334
|
[x, v]
|
|
317
335
|
), Q = O(() => {
|
|
318
336
|
const e = {};
|
|
319
337
|
j?.forEach((n) => {
|
|
320
|
-
const i =
|
|
338
|
+
const i = r.routes?.[n];
|
|
321
339
|
if (i && i.params && i.params.length > 0 && i.paramsOptions && i.paramsOptions.length > 0) {
|
|
322
|
-
const
|
|
340
|
+
const s = de({
|
|
323
341
|
basePath: i.path,
|
|
324
342
|
params: i.params,
|
|
325
343
|
routeId: i.id,
|
|
@@ -329,13 +347,13 @@ function Ee({
|
|
|
329
347
|
currentOptionIds: [],
|
|
330
348
|
result: []
|
|
331
349
|
});
|
|
332
|
-
|
|
350
|
+
s.length > 0 && (e[i.id] = s);
|
|
333
351
|
}
|
|
334
|
-
}),
|
|
335
|
-
}, [j,
|
|
336
|
-
|
|
352
|
+
}), z(e);
|
|
353
|
+
}, [j, r.routes]);
|
|
354
|
+
L(() => {
|
|
337
355
|
Q();
|
|
338
|
-
}, [Q]),
|
|
356
|
+
}, [Q]), L(() => {
|
|
339
357
|
F((e) => {
|
|
340
358
|
const n = { ...e };
|
|
341
359
|
return Object.keys(l).forEach((i) => {
|
|
@@ -343,51 +361,51 @@ function Ee({
|
|
|
343
361
|
}), n;
|
|
344
362
|
});
|
|
345
363
|
}, [l]);
|
|
346
|
-
const U =
|
|
347
|
-
|
|
364
|
+
const U = ve(!0);
|
|
365
|
+
L(() => {
|
|
348
366
|
h((e) => {
|
|
349
367
|
const n = { ...e };
|
|
350
368
|
return Object.keys(l).length === 0 || (Object.keys(l).forEach((i) => {
|
|
351
|
-
const
|
|
352
|
-
|
|
369
|
+
const s = l[i] || [], o = c || !!b[i];
|
|
370
|
+
s.forEach((T) => {
|
|
353
371
|
const p = `${i}-${T.paramOptionIds.join("-")}`;
|
|
354
372
|
U.current ? n[p] = o || e[p] || !1 : n[p] = o;
|
|
355
373
|
});
|
|
356
374
|
}), U.current = !1), n;
|
|
357
375
|
});
|
|
358
|
-
}, [
|
|
376
|
+
}, [b, l, c]);
|
|
359
377
|
const ne = (e, n) => {
|
|
360
378
|
n.stopPropagation(), F((i) => {
|
|
361
|
-
const
|
|
362
|
-
return
|
|
379
|
+
const s = { ...i };
|
|
380
|
+
return s[e] = !s[e], s;
|
|
363
381
|
});
|
|
364
382
|
}, X = O(
|
|
365
383
|
(e) => {
|
|
366
384
|
w((n) => {
|
|
367
|
-
const i =
|
|
368
|
-
c ? (Object.assign(
|
|
369
|
-
delete
|
|
370
|
-
})) : (
|
|
371
|
-
|
|
385
|
+
const i = Ae(n, (s) => {
|
|
386
|
+
c ? (Object.assign(s, Object.fromEntries(B.map((o) => [o, !0]))), delete s[e]) : s[e] ? (delete s[e], v.includes(e) && (x || []).filter((o) => r.pages[o]?.slug === P?.pages[e]?.slug).forEach((o) => {
|
|
387
|
+
delete s[o];
|
|
388
|
+
})) : (s[e] = !0, x && x.includes(e) && v.filter((o) => P?.pages[o]?.slug === r.pages[e]?.slug).forEach((o) => {
|
|
389
|
+
s[o] = !0;
|
|
372
390
|
}));
|
|
373
391
|
});
|
|
374
|
-
return A(Z(
|
|
392
|
+
return A(Z(B, Object.keys(i)).length === 0), i;
|
|
375
393
|
});
|
|
376
394
|
},
|
|
377
|
-
[c,
|
|
395
|
+
[c, B, v, r, P, x]
|
|
378
396
|
), ie = O(
|
|
379
397
|
(e, n) => {
|
|
380
398
|
const i = `${e}-${n.paramOptionIds.join("-")}`;
|
|
381
|
-
h((
|
|
382
|
-
const o = { ...
|
|
399
|
+
h((s) => {
|
|
400
|
+
const o = { ...s };
|
|
383
401
|
o[i] = !o[i];
|
|
384
402
|
const T = l[e]?.every((p) => o[`${e}-${p.paramOptionIds.join("-")}`]) ?? !1;
|
|
385
403
|
return w((p) => {
|
|
386
404
|
if (T && !p[e])
|
|
387
405
|
return { ...p, [e]: !0 };
|
|
388
406
|
if (!T && p[e]) {
|
|
389
|
-
const
|
|
390
|
-
return delete
|
|
407
|
+
const S = { ...p };
|
|
408
|
+
return delete S[e], S;
|
|
391
409
|
}
|
|
392
410
|
return p;
|
|
393
411
|
}), o;
|
|
@@ -397,19 +415,19 @@ function Ee({
|
|
|
397
415
|
), re = O(() => {
|
|
398
416
|
A((e) => (e && w({}), !e));
|
|
399
417
|
}, []);
|
|
400
|
-
return
|
|
401
|
-
const e = c ?
|
|
418
|
+
return L(() => {
|
|
419
|
+
const e = c ? B : Object.keys(b), n = Object.entries(k).filter(([, s]) => s).map(([s]) => s).filter((s) => s !== void 0), i = Array.from(/* @__PURE__ */ new Set([...e, ...n]));
|
|
402
420
|
g(c ? null : i);
|
|
403
|
-
}, [c,
|
|
404
|
-
/* @__PURE__ */ t(M, { sx: { position: "sticky", top: 0, zIndex: 1 }, disablePadding: !0, children: /* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
|
|
406
|
-
/* @__PURE__ */ t(
|
|
421
|
+
}, [c, b, k, B, g]), H ? /* @__PURE__ */ t(Re, { sx: { my: 4 } }) : /* @__PURE__ */ u(Se, { disablePadding: !0, sx: { maxWidth: 700 }, children: [
|
|
422
|
+
/* @__PURE__ */ t(M, { sx: { position: "sticky", top: 0, zIndex: 1 }, disablePadding: !0, children: /* @__PURE__ */ u($, { onClick: re, dense: !0, children: [
|
|
423
|
+
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(I, { edge: "start", checked: c, tabIndex: -1 }) }),
|
|
424
|
+
/* @__PURE__ */ t(K, { primary: d("common.all") })
|
|
407
425
|
] }) }),
|
|
408
426
|
j.map((e) => {
|
|
409
|
-
const n =
|
|
427
|
+
const n = r.routes?.[e];
|
|
410
428
|
if (!n) return null;
|
|
411
|
-
const i = !1,
|
|
412
|
-
return /* @__PURE__ */
|
|
429
|
+
const i = !1, s = l && l[e] && l[e]?.length > 0, o = E[e] !== !1, T = l[e] || [], p = !n.publishedAt || n.updatedAt && new Date(n.updatedAt).getTime() > new Date(n.publishedAt).getTime();
|
|
430
|
+
return /* @__PURE__ */ u(f, { children: [
|
|
413
431
|
/* @__PURE__ */ t(
|
|
414
432
|
M,
|
|
415
433
|
{
|
|
@@ -417,14 +435,14 @@ function Ee({
|
|
|
417
435
|
pr: 4
|
|
418
436
|
},
|
|
419
437
|
disablePadding: !0,
|
|
420
|
-
secondaryAction: /* @__PURE__ */
|
|
421
|
-
p && /* @__PURE__ */ t(
|
|
422
|
-
!n.isPublic && /* @__PURE__ */ t(
|
|
438
|
+
secondaryAction: /* @__PURE__ */ u(f, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
439
|
+
p && /* @__PURE__ */ t(N, { title: d("maker.pages.needPublish"), children: /* @__PURE__ */ t(_, { fontSize: "small", sx: { color: "warning.main", fontSize: 16, mr: 0.35 } }) }),
|
|
440
|
+
!n.isPublic && /* @__PURE__ */ t(N, { title: d("maker.pages.notPublic"), children: /* @__PURE__ */ t(ee, { fontSize: "small", sx: { color: "warning.main", fontSize: 16, mr: 0.35 } }) }),
|
|
423
441
|
i,
|
|
424
|
-
|
|
425
|
-
|
|
442
|
+
s && /* @__PURE__ */ t(
|
|
443
|
+
f,
|
|
426
444
|
{
|
|
427
|
-
onClick: (
|
|
445
|
+
onClick: (S) => ne(e, S),
|
|
428
446
|
sx: {
|
|
429
447
|
display: "inline-flex",
|
|
430
448
|
alignItems: "center",
|
|
@@ -432,14 +450,14 @@ function Ee({
|
|
|
432
450
|
cursor: "pointer",
|
|
433
451
|
color: "info.main"
|
|
434
452
|
},
|
|
435
|
-
children: o ? /* @__PURE__ */ t(me, { fontSize: "small", sx: { fontSize: "18px" } }) : /* @__PURE__ */ t(
|
|
453
|
+
children: o ? /* @__PURE__ */ t(me, { fontSize: "small", sx: { fontSize: "18px" } }) : /* @__PURE__ */ t(pe, { fontSize: "small", sx: { fontSize: "18px" } })
|
|
436
454
|
}
|
|
437
455
|
)
|
|
438
456
|
] }),
|
|
439
|
-
children: /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
|
|
457
|
+
children: /* @__PURE__ */ u($, { onClick: () => X(e), dense: !0, children: [
|
|
458
|
+
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(I, { edge: "start", checked: c || !!b[e], tabIndex: -1 }) }),
|
|
441
459
|
/* @__PURE__ */ t(
|
|
442
|
-
|
|
460
|
+
K,
|
|
443
461
|
{
|
|
444
462
|
primary: n.path,
|
|
445
463
|
slotProps: {
|
|
@@ -451,14 +469,14 @@ function Ee({
|
|
|
451
469
|
] })
|
|
452
470
|
}
|
|
453
471
|
),
|
|
454
|
-
|
|
455
|
-
const Y = `${e}-${
|
|
472
|
+
s && /* @__PURE__ */ t(De, { in: o, children: /* @__PURE__ */ t(f, { children: T.map((S) => {
|
|
473
|
+
const Y = `${e}-${S.paramOptionIds.join("-")}`, se = k[Y] || !1;
|
|
456
474
|
return /* @__PURE__ */ t(
|
|
457
|
-
|
|
475
|
+
Le,
|
|
458
476
|
{
|
|
459
|
-
routePathInfo:
|
|
477
|
+
routePathInfo: S,
|
|
460
478
|
checked: c || se,
|
|
461
|
-
onClick: () => ie(e,
|
|
479
|
+
onClick: () => ie(e, S),
|
|
462
480
|
route: n
|
|
463
481
|
},
|
|
464
482
|
Y
|
|
@@ -467,16 +485,16 @@ function Ee({
|
|
|
467
485
|
] }, e);
|
|
468
486
|
}),
|
|
469
487
|
v.map((e) => {
|
|
470
|
-
const n =
|
|
488
|
+
const n = P?.pages[e];
|
|
471
489
|
return n ? /* @__PURE__ */ t(
|
|
472
490
|
M,
|
|
473
491
|
{
|
|
474
492
|
disablePadding: !0,
|
|
475
|
-
secondaryAction: /* @__PURE__ */ t(
|
|
476
|
-
children: /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
|
|
493
|
+
secondaryAction: /* @__PURE__ */ t(Oe, { color: "warning", label: "deleted", size: "small" }),
|
|
494
|
+
children: /* @__PURE__ */ u($, { onClick: () => X(e), dense: !0, children: [
|
|
495
|
+
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(I, { edge: "start", checked: c || !!b[e], tabIndex: -1 }) }),
|
|
478
496
|
/* @__PURE__ */ t(
|
|
479
|
-
|
|
497
|
+
K,
|
|
480
498
|
{
|
|
481
499
|
primary: n.slug,
|
|
482
500
|
secondary: n.locales?.[y]?.title,
|