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