@blocklet/pages-kit-inner-components 0.5.17 → 0.5.19
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 +2 -2
- package/lib/cjs/chunks/{array-BChVGKFh.js → array-C0IVbCmb.js} +1 -1
- package/lib/cjs/chunks/{config-string-DnwpUGUo.js → config-string-CqKhhXBA.js} +1 -1
- package/lib/cjs/chunks/{draft-data-DPZIakr4.js → draft-data-BLL0M7MI.js} +1 -1
- package/lib/cjs/chunks/{home-BkGblT4S.js → home-DH9Z8Tuv.js} +3 -3
- package/lib/cjs/chunks/publish-button-Cw_MfRfv.js +1 -0
- package/lib/cjs/chunks/state-CA6q2h83.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/setting.js +1 -1
- package/lib/es/add-component.js +5 -6
- package/lib/es/chunks/{array-DcMaqKTM.js → array-B1QKSYbX.js} +1 -1
- package/lib/es/chunks/{config-string-CNgatAMw.js → config-string-D8tamRZ1.js} +1 -1
- package/lib/es/chunks/{draft-data-DB1pDB18.js → draft-data-DyeHwihR.js} +1 -1
- package/lib/es/chunks/{home-CYM8qSuo.js → home-BjT8iYTg.js} +4 -4
- package/lib/es/chunks/{publish-button-BxpOFbAK.js → publish-button-eIyM_BsP.js} +49 -49
- package/lib/es/chunks/{state-BcZbsEn6.js → state-j8jViBMV.js} +62 -63
- package/lib/es/home.js +3 -3
- package/lib/es/setting.js +2 -2
- package/package.json +15 -15
- package/lib/cjs/chunks/publish-button-DvXGUgra.js +0 -1
- package/lib/cjs/chunks/state-D4MG-uJB.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { d as q, e as pe, g as me, u as de, c as ge } from "./state-
|
|
2
|
+
import { d as q, e as pe, g as me, u as de, c as ge } from "./state-j8jViBMV.js";
|
|
3
3
|
import { useLocaleContext as K } from "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import Q from "@arcblock/ux/lib/Result";
|
|
5
5
|
import { useHeaderState as fe } from "@blocklet/pages-kit/builtin/page/header";
|
|
@@ -21,7 +21,7 @@ import { Helmet as Re } from "react-helmet";
|
|
|
21
21
|
import { useSearchParams as se, Routes as Ee, Route as I, Navigate as Te, ScrollRestoration as Me } from "react-router-dom";
|
|
22
22
|
import { useAsync as ie } from "react-use";
|
|
23
23
|
import { joinURL as j } from "ufo";
|
|
24
|
-
import { S as Be, n as Oe, P as Fe, a as Le, B as _e, g as De } from "./array-
|
|
24
|
+
import { S as Be, n as Oe, P as Fe, a as Le, B as _e, g as De } from "./array-B1QKSYbX.js";
|
|
25
25
|
import { styled as le, useTheme as Ne } from "@arcblock/ux/lib/Theme";
|
|
26
26
|
import $e from "@blocklet/ui-react/lib/Footer";
|
|
27
27
|
import "webfontloader";
|
|
@@ -96,7 +96,7 @@ function Qe({ mode: t }) {
|
|
|
96
96
|
}
|
|
97
97
|
return /* @__PURE__ */ e(Xe, { children: ({ state: n }) => /* @__PURE__ */ e(H, { mode: t, state: n }) });
|
|
98
98
|
}
|
|
99
|
-
const Xe = re(() => import("./draft-data-
|
|
99
|
+
const Xe = re(() => import("./draft-data-DyeHwihR.js"));
|
|
100
100
|
function Ye({
|
|
101
101
|
mode: t,
|
|
102
102
|
children: n
|
|
@@ -420,7 +420,7 @@ function A({
|
|
|
420
420
|
!((M = s.footer) != null && M.hidden) && /* @__PURE__ */ e(Ve, {})
|
|
421
421
|
] });
|
|
422
422
|
}
|
|
423
|
-
const Je = re(() => import("./publish-button-
|
|
423
|
+
const Je = re(() => import("./publish-button-eIyM_BsP.js")), ce = ee(ye)`
|
|
424
424
|
&.sticky {
|
|
425
425
|
position: sticky;
|
|
426
426
|
top: 0;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
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-
|
|
2
|
+
import { u as ce, c as de } from "./state-j8jViBMV.js";
|
|
3
3
|
import { useLocaleContext as U } from "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import Q from "@arcblock/ux/lib/Toast";
|
|
5
5
|
import { generateParamCombinations as me } from "@blocklet/pages-kit/utils/route";
|
|
6
6
|
import { Warning as ue, Sync as te, VisibilityOff as ne, KeyboardArrowDown as pe, KeyboardArrowRight as he } from "@mui/icons-material";
|
|
7
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
|
|
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 Pe, Chip as Ae } from "@mui/material";
|
|
9
9
|
import { produce as Oe } from "immer";
|
|
10
10
|
import ee from "lodash/difference";
|
|
11
|
-
import { useState as T, useMemo as R, useCallback as j, forwardRef as Te, useImperativeHandle as je, useEffect as
|
|
11
|
+
import { useState as T, useMemo as R, useCallback as j, forwardRef as Te, useImperativeHandle as je, useEffect as $, useRef as ve } from "react";
|
|
12
12
|
import { useAsync as Re } from "react-use";
|
|
13
|
-
import { L as
|
|
14
|
-
import { p as
|
|
15
|
-
function
|
|
13
|
+
import { L as ze } from "./home-BjT8iYTg.js";
|
|
14
|
+
import { p as Le, g as Be } from "./array-B1QKSYbX.js";
|
|
15
|
+
function Ee(s) {
|
|
16
16
|
const [y, w] = T(!1);
|
|
17
17
|
return /* @__PURE__ */ t(
|
|
18
18
|
ie,
|
|
@@ -65,24 +65,24 @@ function Me() {
|
|
|
65
65
|
okText: h = "Ok",
|
|
66
66
|
onOk: g,
|
|
67
67
|
onClose: a,
|
|
68
|
-
okIcon:
|
|
68
|
+
okIcon: z,
|
|
69
69
|
okColor: k = "primary",
|
|
70
70
|
cancelColor: x = "primary",
|
|
71
|
-
DialogContentProps:
|
|
71
|
+
DialogContentProps: L,
|
|
72
72
|
form: J,
|
|
73
73
|
...V
|
|
74
74
|
}) => {
|
|
75
75
|
y({
|
|
76
76
|
...V,
|
|
77
77
|
open: !0,
|
|
78
|
-
children: /* @__PURE__ */ f("form", { onSubmit: (
|
|
78
|
+
children: /* @__PURE__ */ f("form", { onSubmit: (B) => B.preventDefault(), children: [
|
|
79
79
|
b && /* @__PURE__ */ f(
|
|
80
80
|
ye,
|
|
81
81
|
{
|
|
82
82
|
className: "between",
|
|
83
83
|
zIndex: "appBar",
|
|
84
84
|
bgcolor: "background.paper",
|
|
85
|
-
sx: { borderBottom:
|
|
85
|
+
sx: { borderBottom: (B) => `1px solid ${B.palette.divider}` },
|
|
86
86
|
children: [
|
|
87
87
|
/* @__PURE__ */ t(S, { children: b }),
|
|
88
88
|
/* @__PURE__ */ t(
|
|
@@ -98,16 +98,16 @@ function Me() {
|
|
|
98
98
|
]
|
|
99
99
|
}
|
|
100
100
|
),
|
|
101
|
-
c && /* @__PURE__ */ t(xe, { ...
|
|
101
|
+
c && /* @__PURE__ */ t(xe, { ...L, sx: { mt: -3, ...L == null ? void 0 : L.sx }, children: /* @__PURE__ */ t(S, { pt: 3, children: c }) }),
|
|
102
102
|
/* @__PURE__ */ f(we, { children: [
|
|
103
103
|
/* @__PURE__ */ t(ke, { variant: "outlined", color: x || "primary", onClick: a ?? l, children: D }),
|
|
104
104
|
/* @__PURE__ */ t(
|
|
105
|
-
|
|
105
|
+
Ee,
|
|
106
106
|
{
|
|
107
107
|
variant: "contained",
|
|
108
108
|
color: k || "primary",
|
|
109
|
-
startIcon:
|
|
110
|
-
loadingPosition:
|
|
109
|
+
startIcon: z,
|
|
110
|
+
loadingPosition: z ? "start" : "center",
|
|
111
111
|
onClick: async () => {
|
|
112
112
|
await (g == null ? void 0 : g()), l();
|
|
113
113
|
},
|
|
@@ -126,19 +126,19 @@ function Me() {
|
|
|
126
126
|
}
|
|
127
127
|
const _e = Te(({ mode: s, state: y }, w) => {
|
|
128
128
|
const { t: l } = U(), [u, b] = T(!1), { dialog: c, showDialog: D } = Me(), h = ce(), g = j(
|
|
129
|
-
(
|
|
129
|
+
(z) => {
|
|
130
130
|
let k = [];
|
|
131
131
|
D({
|
|
132
132
|
title: l("maker.publishToProduction"),
|
|
133
133
|
content: /* @__PURE__ */ f(S, { sx: { minWidth: 300 }, children: [
|
|
134
134
|
/* @__PURE__ */ t(Se, { color: "warning", icon: /* @__PURE__ */ t(ue, {}), children: l("maker.publishToProductionTip") }),
|
|
135
135
|
/* @__PURE__ */ t(S, { maxHeight: "50vh", overflow: "auto", mt: 2, children: /* @__PURE__ */ t(
|
|
136
|
-
|
|
136
|
+
We,
|
|
137
137
|
{
|
|
138
138
|
state: y,
|
|
139
139
|
toMode: s,
|
|
140
140
|
onChange: (x) => k = x,
|
|
141
|
-
defaultRouteIds:
|
|
141
|
+
defaultRouteIds: z
|
|
142
142
|
}
|
|
143
143
|
) })
|
|
144
144
|
] }),
|
|
@@ -151,7 +151,7 @@ const _e = Te(({ mode: s, state: y }, w) => {
|
|
|
151
151
|
}
|
|
152
152
|
localStorage.setItem(de(h ?? ""), String((/* @__PURE__ */ new Date()).getTime())), b(!0);
|
|
153
153
|
try {
|
|
154
|
-
await
|
|
154
|
+
await Le({ mode: s, routes: k }), Q.success(l("maker.publishSuccessMessage"));
|
|
155
155
|
} catch (x) {
|
|
156
156
|
throw Q.error(x.message), x;
|
|
157
157
|
} finally {
|
|
@@ -185,7 +185,7 @@ const _e = Te(({ mode: s, state: y }, w) => {
|
|
|
185
185
|
c
|
|
186
186
|
] });
|
|
187
187
|
});
|
|
188
|
-
function
|
|
188
|
+
function $e({
|
|
189
189
|
routePathInfo: s,
|
|
190
190
|
checked: y,
|
|
191
191
|
onClick: w,
|
|
@@ -194,7 +194,7 @@ function We({
|
|
|
194
194
|
var c, D, h, g, a;
|
|
195
195
|
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);
|
|
196
196
|
return /* @__PURE__ */ t(
|
|
197
|
-
|
|
197
|
+
W,
|
|
198
198
|
{
|
|
199
199
|
sx: { pl: 4, pr: 3 },
|
|
200
200
|
disablePadding: !0,
|
|
@@ -232,7 +232,7 @@ function We({
|
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function We({
|
|
236
236
|
state: s,
|
|
237
237
|
toMode: y,
|
|
238
238
|
onChange: w,
|
|
@@ -240,11 +240,11 @@ function $e({
|
|
|
240
240
|
}) {
|
|
241
241
|
const { t: u, locale: b } = U(), [c, D] = T(!1), [h, g] = T(
|
|
242
242
|
() => l ? Object.fromEntries(l.filter((e) => !e.includes("-")).map((e) => [e, !0])) : {}
|
|
243
|
-
), [a,
|
|
243
|
+
), [a, z] = T({}), [k, x] = T(
|
|
244
244
|
() => l ? Object.fromEntries(l.filter((e) => e.includes("-")).map((e) => [e, !0])) : {}
|
|
245
|
-
), [
|
|
246
|
-
if (
|
|
247
|
-
throw
|
|
245
|
+
), [L, J] = T({}), { loading: V, error: B, value: m } = Re(() => Be({ mode: y }), [y]);
|
|
246
|
+
if (B)
|
|
247
|
+
throw B;
|
|
248
248
|
const P = R(() => s.routeIds || [], [s]), q = R(() => (m == null ? void 0 : m.pageIds) || [], [m]), O = R(() => !P || !s.routes ? [] : JSON.parse(JSON.stringify(P)).sort((r, i) => {
|
|
249
249
|
var p, d;
|
|
250
250
|
const n = (p = s.routes) == null ? void 0 : p[r], o = (d = s.routes) == null ? void 0 : d[i];
|
|
@@ -261,7 +261,7 @@ function $e({
|
|
|
261
261
|
}, [O, a]), v = R(
|
|
262
262
|
() => !m || !q || !G ? [] : ee(q, G),
|
|
263
263
|
[G, m, q]
|
|
264
|
-
),
|
|
264
|
+
), E = R(
|
|
265
265
|
() => P ? [...P].concat(v) : v,
|
|
266
266
|
[P, v]
|
|
267
267
|
), X = j(() => {
|
|
@@ -282,11 +282,11 @@ function $e({
|
|
|
282
282
|
});
|
|
283
283
|
o.length > 0 && (e[i.id] = o);
|
|
284
284
|
}
|
|
285
|
-
}),
|
|
285
|
+
}), z(e);
|
|
286
286
|
}, [O, s.routes]);
|
|
287
|
-
|
|
287
|
+
$(() => {
|
|
288
288
|
X();
|
|
289
|
-
}, [X]),
|
|
289
|
+
}, [X]), $(() => {
|
|
290
290
|
J((e) => {
|
|
291
291
|
const r = { ...e };
|
|
292
292
|
return Object.keys(a).forEach((i) => {
|
|
@@ -296,7 +296,7 @@ function $e({
|
|
|
296
296
|
});
|
|
297
297
|
}, [a]);
|
|
298
298
|
const Y = ve(!0);
|
|
299
|
-
|
|
299
|
+
$(() => {
|
|
300
300
|
x((e) => {
|
|
301
301
|
const r = { ...e };
|
|
302
302
|
return Object.keys(a).length === 0 || (Object.keys(a).forEach((i) => {
|
|
@@ -317,7 +317,7 @@ function $e({
|
|
|
317
317
|
(e) => {
|
|
318
318
|
g((r) => {
|
|
319
319
|
const i = Oe(r, (n) => {
|
|
320
|
-
c ? (Object.assign(n, Object.fromEntries(
|
|
320
|
+
c ? (Object.assign(n, Object.fromEntries(E.map((o) => [o, !0]))), delete n[e]) : n[e] ? (delete n[e], v.includes(e) && (P || []).filter((o) => {
|
|
321
321
|
var p, d;
|
|
322
322
|
return ((p = s.pages[o]) == null ? void 0 : p.slug) === ((d = m == null ? void 0 : m.pages[e]) == null ? void 0 : d.slug);
|
|
323
323
|
}).forEach((o) => {
|
|
@@ -329,10 +329,10 @@ function $e({
|
|
|
329
329
|
n[o] = !0;
|
|
330
330
|
}));
|
|
331
331
|
});
|
|
332
|
-
return D(ee(
|
|
332
|
+
return D(ee(E, Object.keys(i)).length === 0), i;
|
|
333
333
|
});
|
|
334
334
|
},
|
|
335
|
-
[c,
|
|
335
|
+
[c, E, v, s, m, P]
|
|
336
336
|
), se = j(
|
|
337
337
|
(e, r) => {
|
|
338
338
|
const i = `${e}-${r.paramOptionIds.join("-")}`;
|
|
@@ -345,8 +345,8 @@ function $e({
|
|
|
345
345
|
if (p && !A[e])
|
|
346
346
|
return { ...A, [e]: !0 };
|
|
347
347
|
if (!p && A[e]) {
|
|
348
|
-
const
|
|
349
|
-
return delete
|
|
348
|
+
const C = { ...A };
|
|
349
|
+
return delete C[e], C;
|
|
350
350
|
}
|
|
351
351
|
return A;
|
|
352
352
|
}), o;
|
|
@@ -356,22 +356,22 @@ function $e({
|
|
|
356
356
|
), oe = j(() => {
|
|
357
357
|
D((e) => (e && g({}), !e));
|
|
358
358
|
}, []);
|
|
359
|
-
return
|
|
360
|
-
const e = c ?
|
|
359
|
+
return $(() => {
|
|
360
|
+
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]));
|
|
361
361
|
w(c ? null : i);
|
|
362
|
-
}, [c, h, k,
|
|
363
|
-
/* @__PURE__ */ t(
|
|
362
|
+
}, [c, h, k, E, w]), V ? /* @__PURE__ */ t(ze, { sx: { my: 4 } }) : /* @__PURE__ */ f(De, { disablePadding: !0, sx: { maxWidth: 700 }, children: [
|
|
363
|
+
/* @__PURE__ */ t(W, { sx: { position: "sticky", top: 0, bgcolor: "background.paper", zIndex: 1 }, disablePadding: !0, children: /* @__PURE__ */ f(K, { onClick: oe, dense: !0, children: [
|
|
364
364
|
/* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(I, { edge: "start", checked: c, tabIndex: -1 }) }),
|
|
365
365
|
/* @__PURE__ */ t(F, { primary: u("common.all") })
|
|
366
366
|
] }) }),
|
|
367
367
|
O.map((e) => {
|
|
368
|
-
var A,
|
|
368
|
+
var A, C;
|
|
369
369
|
const r = (A = s.routes) == null ? void 0 : A[e];
|
|
370
370
|
if (!r) return null;
|
|
371
|
-
const i = !1, n = a && a[e] && ((
|
|
371
|
+
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();
|
|
372
372
|
return /* @__PURE__ */ f(S, { children: [
|
|
373
373
|
/* @__PURE__ */ t(
|
|
374
|
-
|
|
374
|
+
W,
|
|
375
375
|
{
|
|
376
376
|
sx: {
|
|
377
377
|
pr: 4
|
|
@@ -384,7 +384,7 @@ function $e({
|
|
|
384
384
|
n && /* @__PURE__ */ t(
|
|
385
385
|
S,
|
|
386
386
|
{
|
|
387
|
-
onClick: (
|
|
387
|
+
onClick: (M) => re(e, M),
|
|
388
388
|
sx: {
|
|
389
389
|
display: "inline-flex",
|
|
390
390
|
alignItems: "center",
|
|
@@ -409,14 +409,14 @@ function $e({
|
|
|
409
409
|
] })
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
n && /* @__PURE__ */ t(Pe, { in: o, children: /* @__PURE__ */ t(S, { children: p.map((
|
|
413
|
-
const _ = `${e}-${
|
|
412
|
+
n && /* @__PURE__ */ t(Pe, { in: o, children: /* @__PURE__ */ t(S, { children: p.map((M) => {
|
|
413
|
+
const _ = `${e}-${M.paramOptionIds.join("-")}`, ae = k[_] || !1;
|
|
414
414
|
return /* @__PURE__ */ t(
|
|
415
|
-
|
|
415
|
+
$e,
|
|
416
416
|
{
|
|
417
|
-
routePathInfo:
|
|
417
|
+
routePathInfo: M,
|
|
418
418
|
checked: c || ae,
|
|
419
|
-
onClick: () => se(e,
|
|
419
|
+
onClick: () => se(e, M),
|
|
420
420
|
route: r
|
|
421
421
|
},
|
|
422
422
|
_
|
|
@@ -428,7 +428,7 @@ function $e({
|
|
|
428
428
|
var i, n;
|
|
429
429
|
const r = m == null ? void 0 : m.pages[e];
|
|
430
430
|
return r ? /* @__PURE__ */ t(
|
|
431
|
-
|
|
431
|
+
W,
|
|
432
432
|
{
|
|
433
433
|
disablePadding: !0,
|
|
434
434
|
secondaryAction: /* @__PURE__ */ t(Ae, { color: "warning", label: "deleted", size: "small" }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as k } from "react/jsx-runtime";
|
|
2
2
|
import { Box as z, Alert as K } from "@mui/material";
|
|
3
3
|
import { joinURL as b, withQuery as q } from "ufo";
|
|
4
4
|
import { createAxios as Q } from "@blocklet/js-sdk";
|
|
@@ -9,60 +9,59 @@ import H, { getYjsDoc as ee } from "@syncedstore/core";
|
|
|
9
9
|
import { useSyncedStore as te } from "@syncedstore/react";
|
|
10
10
|
import { useLocalStorageState as ne } from "ahooks";
|
|
11
11
|
import { produce as C } from "immer";
|
|
12
|
-
import oe from "js-cookie";
|
|
13
12
|
import N from "lodash/debounce";
|
|
14
|
-
import { customAlphabet as
|
|
15
|
-
import { createContext as
|
|
16
|
-
import { useParams as
|
|
17
|
-
import { IndexeddbPersistence as
|
|
18
|
-
import { WebsocketProvider as
|
|
19
|
-
import { UndoManager as
|
|
13
|
+
import { customAlphabet as oe } from "nanoid";
|
|
14
|
+
import { createContext as re, useState as E, useRef as se, useMemo as v, useCallback as L, useEffect as O, useContext as ce } from "react";
|
|
15
|
+
import { useParams as ie, useNavigate as ae } from "react-router-dom";
|
|
16
|
+
import { IndexeddbPersistence as de } from "y-indexeddb";
|
|
17
|
+
import { WebsocketProvider as le } from "y-websocket";
|
|
18
|
+
import { UndoManager as ue } from "yjs";
|
|
20
19
|
import "@blocklet/pages-kit/types";
|
|
21
|
-
const
|
|
20
|
+
const Je = (n) => {
|
|
22
21
|
const t = blocklet == null ? void 0 : blocklet.componentMountPoints.find((a) => a.name === n);
|
|
23
22
|
return t ? t.mountPoint : "/";
|
|
24
23
|
};
|
|
25
|
-
function
|
|
24
|
+
function me() {
|
|
26
25
|
const { pathname: n } = window.location, t = n.match(/\/admin\/(maker|previewer)\/([^/]+)/), a = t == null ? void 0 : t[2], f = window.__PROJECT_ID__;
|
|
27
26
|
if (!a && !f)
|
|
28
27
|
throw new Error("Unable to get projectId from pathname");
|
|
29
28
|
return a || f;
|
|
30
29
|
}
|
|
31
|
-
function
|
|
30
|
+
function Be(n) {
|
|
32
31
|
return `${n}:pages:version`;
|
|
33
32
|
}
|
|
34
|
-
function
|
|
33
|
+
function Ve(n, t) {
|
|
35
34
|
return t === "yaml" ? X(n) ? "" : Y.stringify(n, { indent: 2 }) : t === "json" ? JSON.parse(JSON.stringify(n || {})) : t === "array" ? JSON.parse(JSON.stringify(n || [])) : n;
|
|
36
35
|
}
|
|
37
|
-
function
|
|
38
|
-
return /* @__PURE__ */
|
|
36
|
+
function We({ error: n }) {
|
|
37
|
+
return /* @__PURE__ */ k(z, { children: /* @__PURE__ */ k(K, { severity: "error", children: n.message }) });
|
|
39
38
|
}
|
|
40
39
|
var U;
|
|
41
40
|
const D = ((U = window.blocklet) == null ? void 0 : U.prefix) || "/", J = Q({
|
|
42
41
|
timeout: 200 * 1e3
|
|
43
|
-
}),
|
|
42
|
+
}), fe = window.location.protocol === "https:" ? "wss" : "ws", ze = (n) => b(`${fe}://${window.location.hostname}`, D, `api/${n}/ws/pages`), Se = "z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9";
|
|
44
43
|
var F;
|
|
45
|
-
(F = blocklet == null ? void 0 : blocklet.componentMountPoints.find((n) => n.did ===
|
|
46
|
-
function
|
|
44
|
+
(F = blocklet == null ? void 0 : blocklet.componentMountPoints.find((n) => n.did === Se)) != null && F.mountPoint || b(D, "/image-bin");
|
|
45
|
+
function Ke(n) {
|
|
47
46
|
return n && !/^(https?:\/\/|\/)/.test(n) ? window.location.origin + b(D, "uploads", n) : n;
|
|
48
47
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
48
|
+
const pe = window.innerWidth <= 750;
|
|
49
|
+
function qe(n, t, a) {
|
|
51
50
|
if (!n || /\.gif/.test(n)) return n;
|
|
52
|
-
const f = (
|
|
53
|
-
return
|
|
51
|
+
const f = (pe ? t / 1.5 : t) * (a === "quality" ? 1.5 : 1);
|
|
52
|
+
return we(n, { imageFilter: "resize", w: f, f: "webp" });
|
|
54
53
|
}
|
|
55
|
-
function
|
|
54
|
+
function we(n, t) {
|
|
56
55
|
return !n || !t ? n : q(n, t);
|
|
57
56
|
}
|
|
58
|
-
async function
|
|
57
|
+
async function Pe(n) {
|
|
59
58
|
return J.get(`/api/projects/${n}`).then((t) => t.data);
|
|
60
59
|
}
|
|
61
|
-
async function
|
|
60
|
+
async function Ie(n) {
|
|
62
61
|
return J.post(`/api/projects/${n.id}/update`, n).then((t) => t.data);
|
|
63
62
|
}
|
|
64
|
-
const
|
|
65
|
-
function
|
|
63
|
+
const he = 500, A = oe("abcdefghijklmnopqrstuvwxyz0123456789", 16), B = re(null);
|
|
64
|
+
function Qe({
|
|
66
65
|
url: n,
|
|
67
66
|
name: t,
|
|
68
67
|
children: a,
|
|
@@ -71,7 +70,7 @@ function Ye({
|
|
|
71
70
|
const [I, w] = E(!1), { locale: h } = Z(), S = V(), e = `${S}:MakerLocalState`, o = `${S}:${t}`, [s, r] = ne(e, {
|
|
72
71
|
defaultValue: {},
|
|
73
72
|
listenStorageChange: !0
|
|
74
|
-
}), c =
|
|
73
|
+
}), c = se(s);
|
|
75
74
|
c.current = s;
|
|
76
75
|
const i = v(
|
|
77
76
|
() => H({
|
|
@@ -88,26 +87,26 @@ function Ye({
|
|
|
88
87
|
}),
|
|
89
88
|
[]
|
|
90
89
|
), d = v(() => ee(i), [i]);
|
|
91
|
-
v(() => new
|
|
90
|
+
v(() => new de(o, d), [o, d]);
|
|
92
91
|
const p = v(
|
|
93
|
-
() => new
|
|
94
|
-
params: {
|
|
92
|
+
() => new le(n, o, d, {
|
|
93
|
+
params: {},
|
|
95
94
|
resyncInterval: 5 * 60 * 1e3
|
|
96
95
|
}),
|
|
97
96
|
[n, o, d]
|
|
98
|
-
), g =
|
|
97
|
+
), g = L(() => {
|
|
99
98
|
p && (p.disconnect(), p.connect());
|
|
100
99
|
}, [p]), y = v(
|
|
101
|
-
() => new
|
|
100
|
+
() => new ue(
|
|
102
101
|
[d.getArray("pageIds"), d.getMap("pages"), d.getArray("supportedLocales"), d.getMap("config")],
|
|
103
102
|
{ doc: d }
|
|
104
103
|
),
|
|
105
104
|
[d]
|
|
106
|
-
), [j, x] = E(null), [R, $] = E(!1), [T, _] = E(void 0), G =
|
|
105
|
+
), [j, x] = E(null), [R, $] = E(!1), [T, _] = E(void 0), G = L(async () => {
|
|
107
106
|
if (S) {
|
|
108
107
|
$(!0);
|
|
109
108
|
try {
|
|
110
|
-
const l = await
|
|
109
|
+
const l = await Pe(S);
|
|
111
110
|
x(l);
|
|
112
111
|
} catch (l) {
|
|
113
112
|
console.error("Failed to fetch project:", l);
|
|
@@ -115,7 +114,7 @@ function Ye({
|
|
|
115
114
|
$(!1);
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
|
-
}, [S]), M =
|
|
117
|
+
}, [S]), M = L(
|
|
119
118
|
async (l, u) => {
|
|
120
119
|
var P;
|
|
121
120
|
if (_(void 0), !!S) {
|
|
@@ -124,7 +123,7 @@ function Ye({
|
|
|
124
123
|
...l
|
|
125
124
|
}));
|
|
126
125
|
try {
|
|
127
|
-
const m = await
|
|
126
|
+
const m = await Ie({
|
|
128
127
|
...l
|
|
129
128
|
});
|
|
130
129
|
x(m);
|
|
@@ -197,17 +196,17 @@ function Ye({
|
|
|
197
196
|
}));
|
|
198
197
|
}, P = N(({ status: m }) => {
|
|
199
198
|
m === "connected" ? l() : m === "disconnected" && u();
|
|
200
|
-
},
|
|
199
|
+
}, he);
|
|
201
200
|
return p.on("status", P), window.addEventListener("online", l), window.addEventListener("offline", u), () => {
|
|
202
201
|
p.off("status", P), window.removeEventListener("online", l), window.removeEventListener("offline", u);
|
|
203
202
|
};
|
|
204
|
-
}, [p, r]), f && !I ? null : /* @__PURE__ */
|
|
203
|
+
}, [p, r]), f && !I ? null : /* @__PURE__ */ k(B.Provider, { value: W, children: a });
|
|
205
204
|
}
|
|
206
|
-
const
|
|
207
|
-
const n =
|
|
205
|
+
const ye = () => {
|
|
206
|
+
const n = ce(B);
|
|
208
207
|
if (!n)
|
|
209
208
|
throw new Error("Context is null");
|
|
210
|
-
const t = te(n.state), { setLocalState: a, localState: f } = n, I =
|
|
209
|
+
const t = te(n.state), { setLocalState: a, localState: f } = n, I = ae(), w = V(), h = v(
|
|
211
210
|
() => ({
|
|
212
211
|
setCurrentSectionId: (e, o) => {
|
|
213
212
|
var s, r;
|
|
@@ -421,10 +420,10 @@ const ve = () => {
|
|
|
421
420
|
}
|
|
422
421
|
};
|
|
423
422
|
}, V = () => {
|
|
424
|
-
const { projectId: n } =
|
|
425
|
-
return n ??
|
|
423
|
+
const { projectId: n } = ie();
|
|
424
|
+
return n ?? me() ?? "";
|
|
426
425
|
};
|
|
427
|
-
function
|
|
426
|
+
function ve(n) {
|
|
428
427
|
var f, I;
|
|
429
428
|
const { resources: t } = n;
|
|
430
429
|
if (!t.components)
|
|
@@ -442,33 +441,33 @@ function Ce(n) {
|
|
|
442
441
|
})
|
|
443
442
|
);
|
|
444
443
|
}
|
|
445
|
-
function
|
|
444
|
+
function Ce(n) {
|
|
446
445
|
const { components: t } = n;
|
|
447
446
|
return t || {};
|
|
448
447
|
}
|
|
449
|
-
function
|
|
448
|
+
function ge(n) {
|
|
450
449
|
return {
|
|
451
|
-
...
|
|
452
|
-
...
|
|
450
|
+
...ve(n),
|
|
451
|
+
...Ce(n)
|
|
453
452
|
};
|
|
454
453
|
}
|
|
455
|
-
const
|
|
454
|
+
const Xe = () => ge(ye().state);
|
|
456
455
|
export {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
456
|
+
We as E,
|
|
457
|
+
Qe as S,
|
|
458
|
+
ze as a,
|
|
459
|
+
ye as b,
|
|
460
|
+
Be as c,
|
|
461
|
+
ge as d,
|
|
462
|
+
qe as e,
|
|
463
|
+
Xe as f,
|
|
464
|
+
Ke as g,
|
|
466
465
|
J as h,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
466
|
+
Je as i,
|
|
467
|
+
Ce as j,
|
|
468
|
+
ve as k,
|
|
469
|
+
me as l,
|
|
471
470
|
A as n,
|
|
472
|
-
|
|
471
|
+
Ve as t,
|
|
473
472
|
V as u
|
|
474
473
|
};
|
package/lib/es/home.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "./chunks/state-
|
|
2
|
+
import "./chunks/state-j8jViBMV.js";
|
|
3
3
|
import "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import "@arcblock/ux/lib/Result";
|
|
5
5
|
import "@blocklet/pages-kit/builtin/page/header";
|
|
@@ -21,8 +21,8 @@ import "react-helmet";
|
|
|
21
21
|
import "react-router-dom";
|
|
22
22
|
import "react-use";
|
|
23
23
|
import "ufo";
|
|
24
|
-
import "./chunks/array-
|
|
25
|
-
import { a as R, P as S, d as W, c as j, b as k, T as q, H as v } from "./chunks/home-
|
|
24
|
+
import "./chunks/array-B1QKSYbX.js";
|
|
25
|
+
import { a as R, P as S, d as W, c as j, b as k, T as q, H as v } from "./chunks/home-BjT8iYTg.js";
|
|
26
26
|
import "./chunks/session-CVblGhSp.js";
|
|
27
27
|
export {
|
|
28
28
|
R as HomeView,
|
package/lib/es/setting.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, jsxs as O, Fragment as X } from "react/jsx-runtime";
|
|
2
|
-
import { t as ye, g as Te, b as ce, E as ot, n as Ke, f as ve } from "./chunks/state-
|
|
2
|
+
import { t as ye, g as Te, b as ce, E as ot, n as Ke, f as ve } from "./chunks/state-j8jViBMV.js";
|
|
3
3
|
import de from "@arcblock/ux/lib/Empty";
|
|
4
4
|
import { useLocaleContext as C } from "@arcblock/ux/lib/Locale/context";
|
|
5
5
|
import { CodeEditor as xe } from "@blocklet/code-editor";
|
|
@@ -12,7 +12,7 @@ import A from "lodash/sortBy";
|
|
|
12
12
|
import { useCallback as D, useMemo as ne, useRef as J, useId as gt, useEffect as $, useState as Q } from "react";
|
|
13
13
|
import { useUpdate as _e } from "react-use";
|
|
14
14
|
import { ColorItem as Pt, ConfigColorDialog as wt } from "@blocklet/pages-kit/builtin/color-picker";
|
|
15
|
-
import { C as kt } from "./chunks/config-string-
|
|
15
|
+
import { C as kt } from "./chunks/config-string-D8tamRZ1.js";
|
|
16
16
|
import Pe from "lodash/isEmpty";
|
|
17
17
|
import He from "lodash/set";
|
|
18
18
|
import * as me from "yaml";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit-inner-components",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.19",
|
|
4
4
|
"description": "Pages Kit inner components library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -71,23 +71,23 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@arcblock/did-auth": "^1.20.11",
|
|
73
73
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
74
|
-
"@arcblock/did-connect": "^2.13.
|
|
75
|
-
"@arcblock/react-hooks": "^2.13.
|
|
76
|
-
"@arcblock/ux": "^2.13.
|
|
77
|
-
"@blocklet/ai-kit": "^0.1.
|
|
78
|
-
"@blocklet/ai-runtime": "^0.4.
|
|
79
|
-
"@blocklet/code-editor": "^0.4.
|
|
80
|
-
"@blocklet/crawler": "^2.3.
|
|
74
|
+
"@arcblock/did-connect": "^2.13.47",
|
|
75
|
+
"@arcblock/react-hooks": "^2.13.47",
|
|
76
|
+
"@arcblock/ux": "^2.13.47",
|
|
77
|
+
"@blocklet/ai-kit": "^0.1.78",
|
|
78
|
+
"@blocklet/ai-runtime": "^0.4.271",
|
|
79
|
+
"@blocklet/code-editor": "^0.4.271",
|
|
80
|
+
"@blocklet/crawler": "^2.3.46",
|
|
81
81
|
"@blocklet/embed": "^0.2.4",
|
|
82
82
|
"@blocklet/js-sdk": "^1.16.43",
|
|
83
83
|
"@blocklet/logger": "1.16.36",
|
|
84
|
-
"@blocklet/quickjs": "^0.4.
|
|
84
|
+
"@blocklet/quickjs": "^0.4.271",
|
|
85
85
|
"@blocklet/sdk": "^1.16.43",
|
|
86
|
-
"@blocklet/studio-ui": "^0.4.
|
|
86
|
+
"@blocklet/studio-ui": "^0.4.271",
|
|
87
87
|
"@blocklet/tracker": "^1.16.43",
|
|
88
|
-
"@blocklet/ui-react": "^2.13.
|
|
89
|
-
"@blocklet/uploader": "^0.1.
|
|
90
|
-
"@blocklet/uploader-server": "^0.1.
|
|
88
|
+
"@blocklet/ui-react": "^2.13.47",
|
|
89
|
+
"@blocklet/uploader": "^0.1.93",
|
|
90
|
+
"@blocklet/uploader-server": "^0.1.99",
|
|
91
91
|
"@emotion/cache": "^11.13.1",
|
|
92
92
|
"@emotion/css": "^11.13.0",
|
|
93
93
|
"@emotion/react": "^11.13.0",
|
|
@@ -205,8 +205,8 @@
|
|
|
205
205
|
"yaml": "^2.5.0",
|
|
206
206
|
"yjs": "^13.6.18",
|
|
207
207
|
"zustand": "^4.5.5",
|
|
208
|
-
"@blocklet/pages-kit": "^0.5.
|
|
209
|
-
"@blocklet/pages-kit-block-studio": "^0.5.
|
|
208
|
+
"@blocklet/pages-kit": "^0.5.19",
|
|
209
|
+
"@blocklet/pages-kit-block-studio": "^0.5.19"
|
|
210
210
|
},
|
|
211
211
|
"devDependencies": {
|
|
212
212
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|