@blocklet/pages-kit-inner-components 0.5.30 → 0.5.31

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.
Files changed (37) hide show
  1. package/lib/cjs/add-component.js +47 -23
  2. package/lib/cjs/chunks/array-BH41o7C6.js +475 -0
  3. package/lib/cjs/chunks/{config-string-C4Q0hgG0.js → config-string-B3JoYJVu.js} +1 -1
  4. package/lib/cjs/chunks/{draft-data-Cu9gua-P.js → draft-data-hZaTeHgL.js} +1 -1
  5. package/lib/cjs/chunks/home-B6E0yAU3.js +38 -0
  6. package/lib/cjs/chunks/{publish-button-DvwoFH1F.js → publish-button-CO_WU_f5.js} +1 -1
  7. package/lib/cjs/chunks/site-state-D5jk8eJT.js +57 -0
  8. package/lib/cjs/chunks/state-DxOb57hO.js +1 -0
  9. package/lib/cjs/components.js +1 -1
  10. package/lib/cjs/home.js +1 -1
  11. package/lib/cjs/locales.js +3 -1
  12. package/lib/cjs/project-html.js +2 -2
  13. package/lib/cjs/resources.js +1 -1
  14. package/lib/cjs/setting.js +1 -1
  15. package/lib/cjs/site-state.js +1 -1
  16. package/lib/es/add-component.js +795 -749
  17. package/lib/es/chunks/array-NLDZzhVt.js +2224 -0
  18. package/lib/es/chunks/{config-string-CNLg1EYu.js → config-string-DutyRoOh.js} +1 -1
  19. package/lib/es/chunks/{draft-data-hSHLdxKp.js → draft-data-DjX0kpDC.js} +1 -1
  20. package/lib/es/chunks/{home-CNk6U8FU.js → home-CxRa0eKd.js} +112 -96
  21. package/lib/es/chunks/{publish-button-BftBlabj.js → publish-button-1bl_Nuva.js} +3 -3
  22. package/lib/es/chunks/{site-state-DJ3JcBMm.js → site-state-DEduMTrY.js} +505 -473
  23. package/lib/es/chunks/state-C02ZI8vz.js +605 -0
  24. package/lib/es/components.js +1 -1
  25. package/lib/es/home.js +3 -3
  26. package/lib/es/locales.js +44 -6
  27. package/lib/es/project-html.js +43 -42
  28. package/lib/es/resources.js +1 -1
  29. package/lib/es/setting.js +2 -2
  30. package/lib/es/site-state.js +1 -1
  31. package/package.json +10 -10
  32. package/lib/cjs/chunks/array-CJC7ex3i.js +0 -467
  33. package/lib/cjs/chunks/home-CimGvyT9.js +0 -38
  34. package/lib/cjs/chunks/site-state-DvIWP0pO.js +0 -57
  35. package/lib/cjs/chunks/state-jCG5gSUJ.js +0 -1
  36. package/lib/es/chunks/array-9j8tOSbO.js +0 -1993
  37. package/lib/es/chunks/state-D5BnGunt.js +0 -483
@@ -4,7 +4,7 @@ import { Icon as P } from "@iconify-icon/react";
4
4
  import { TextField as A, Stack as w, FormControlLabel as F, Switch as L, Box as j, InputAdornment as k } from "@mui/material";
5
5
  import { forwardRef as B, useState as D, useEffect as E, useImperativeHandle as U } from "react";
6
6
  import { useDebounce as V } from "react-use";
7
- import { g as x } from "./state-D5BnGunt.js";
7
+ import { g as x } from "./state-C02ZI8vz.js";
8
8
  const J = B(function({ showMarkdown: I, markdown: h, onMarkdownChange: n, showUploader: S, value: o, meta: H, onChange: l, ...a }, z) {
9
9
  const [e, c] = D("");
10
10
  E(() => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { u as a, S as o, a as s, b as n } from "./state-D5BnGunt.js";
2
+ import { u as a, S as o, a as s, b as n } from "./state-C02ZI8vz.js";
3
3
  function d({ children: t }) {
4
4
  const r = a();
5
5
  return /* @__PURE__ */ e(o, { url: s(r ?? ""), name: "root", waitingSynced: !0, children: /* @__PURE__ */ e(i, { children: t }) });
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as D } from "react/jsx-runtime";
2
- import { u as X, d as Y, e as fe, f as he, g as be, c as ye } from "./state-D5BnGunt.js";
1
+ import { jsx as e, jsxs as $ } from "react/jsx-runtime";
2
+ import { u as X, d as Y, e as fe, f as he, g as be, c as ye } from "./state-C02ZI8vz.js";
3
3
  import { useLocaleContext as J } from "@arcblock/ux/lib/Locale/context";
4
4
  import Z from "@arcblock/ux/lib/Result";
5
5
  import { useHeaderState as ve } from "@blocklet/pages-kit/builtin/page/header";
@@ -10,18 +10,18 @@ import xe from "@blocklet/ui-react/lib/Header";
10
10
  import { cx as te } from "@emotion/css";
11
11
  import { Global as oe, css as ne } from "@emotion/react";
12
12
  import re from "@emotion/styled";
13
- import { Box as F, CircularProgress as ke, useTheme as ae, Button as Se, Stack as Ce, alpha as q, useMediaQuery as je } from "@mui/material";
13
+ import { Box as D, CircularProgress as ke, useTheme as ae, Button as Se, Stack as Ce, alpha as q, useMediaQuery as je } from "@mui/material";
14
14
  import { useReactive as se, useScroll as Ie } from "ahooks";
15
15
  import Re from "isomorphic-dompurify";
16
- import N from "lodash/cloneDeep";
16
+ import A from "lodash/cloneDeep";
17
17
  import Ee from "lodash/isEmpty";
18
18
  import ie from "lodash/isEqual";
19
- import { useEffect as O, lazy as le, useMemo as T, useRef as ce, Suspense as Te, useState as Me } from "react";
19
+ import { useEffect as _, lazy as le, useMemo as T, useRef as ce, Suspense as Te, useState as Me } from "react";
20
20
  import { Helmet as Be } from "react-helmet";
21
- import { useSearchParams as ue, Routes as Oe, Route as E, Navigate as Fe, ScrollRestoration as Le } from "react-router-dom";
21
+ import { useSearchParams as ue, Routes as Oe, Route as E, Navigate as Fe, ScrollRestoration as _e } from "react-router-dom";
22
22
  import { useAsync as pe } from "react-use";
23
23
  import { joinURL as S } from "ufo";
24
- import { S as _e, n as K, P as De, a as Ne, B as $e, g as Ae } from "./array-9j8tOSbO.js";
24
+ import { S as De, n as K, P as Le, a as Ne, B as $e, g as Ae } from "./array-NLDZzhVt.js";
25
25
  import { styled as me, useTheme as He } from "@arcblock/ux/lib/Theme";
26
26
  import Ue from "@blocklet/ui-react/lib/Footer";
27
27
  import "webfontloader";
@@ -32,16 +32,16 @@ const Ge = me(Ue, { shouldForwardProp: (t) => !!t })`
32
32
  }
33
33
  `;
34
34
  function We({ meta: t, ...n }) {
35
- const s = He();
36
- return /* @__PURE__ */ e(Ge, { ...n, meta: t, theme: s || {} });
35
+ const a = He();
36
+ return /* @__PURE__ */ e(Ge, { ...n, meta: t, theme: a || {} });
37
37
  }
38
38
  function qe(t) {
39
- return /* @__PURE__ */ e(F, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(ke, { size: 30 }) });
39
+ return /* @__PURE__ */ e(D, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(ke, { size: 30 }) });
40
40
  }
41
41
  function Ke(t) {
42
42
  return /* @__PURE__ */ e(Qe, { ...t });
43
43
  }
44
- const Qe = me(F)`
44
+ const Qe = me(D)`
45
45
  position: fixed;
46
46
  left: 0;
47
47
  top: 0;
@@ -59,10 +59,10 @@ function Ye({
59
59
  descriptionFontFamily: n
60
60
  }) {
61
61
  var o;
62
- const s = ae(), a = (o = s == null ? void 0 : s.typography) == null ? void 0 : o.fontFamily;
63
- O(() => {
62
+ const a = ae(), s = (o = a == null ? void 0 : a.typography) == null ? void 0 : o.fontFamily;
63
+ _(() => {
64
64
  }, [t, n]);
65
- const i = `${a}, ${Xe}`;
65
+ const i = `${s}, ${Xe}`;
66
66
  return /* @__PURE__ */ e(
67
67
  oe,
68
68
  {
@@ -83,35 +83,35 @@ function Ye({
83
83
  );
84
84
  }
85
85
  function Bt() {
86
- const [t] = ue(), { session: n } = Ve(), s = ze("owner", "admin", "pagesEditor", "member"), a = T(() => {
86
+ const [t] = ue(), { session: n } = Ve(), a = ze("owner", "admin", "pagesEditor", "member"), s = T(() => {
87
87
  const o = t.get("mode");
88
- return _e.includes(o) ? o : "production";
89
- }, [t]), i = a === "production" ? a : n.user ? s ? a : "production" : null;
88
+ return De.includes(o) ? o : "production";
89
+ }, [t]), i = s === "production" ? s : n.user ? a ? s : "production" : null;
90
90
  return i ? /* @__PURE__ */ e(Je, { mode: i }) : null;
91
91
  }
92
92
  function Je({ mode: t }) {
93
93
  if (t !== "draft") {
94
94
  const n = window.__PAGE_STATE__;
95
- return n ? /* @__PURE__ */ e(H, { mode: t, state: n }) : /* @__PURE__ */ e(et, { mode: t, children: ({ state: s }) => /* @__PURE__ */ e(H, { mode: t, state: s }) });
95
+ return n ? /* @__PURE__ */ e(V, { mode: t, state: n }) : /* @__PURE__ */ e(et, { mode: t, children: ({ state: a }) => /* @__PURE__ */ e(V, { mode: t, state: a }) });
96
96
  }
97
- return /* @__PURE__ */ e(Ze, { children: ({ state: n }) => /* @__PURE__ */ e(H, { mode: t, state: n }) });
97
+ return /* @__PURE__ */ e(Ze, { children: ({ state: n }) => /* @__PURE__ */ e(V, { mode: t, state: n }) });
98
98
  }
99
- const Ze = le(() => import("./draft-data-hSHLdxKp.js"));
99
+ const Ze = le(() => import("./draft-data-DjX0kpDC.js"));
100
100
  function et({
101
101
  mode: t,
102
102
  children: n
103
103
  }) {
104
- const s = document.querySelector('meta[property="pages:version"]'), a = s == null ? void 0 : s.content, i = X(), o = T(() => {
105
- if (a === "{{pagesPublishedAt}}") {
104
+ const a = document.querySelector('meta[property="pages:version"]'), s = a == null ? void 0 : a.content, i = X(), o = T(() => {
105
+ if (s === "{{pagesPublishedAt}}") {
106
106
  const u = localStorage.getItem(ye(i ?? ""));
107
107
  return Number(u) ? Number(u) : (/* @__PURE__ */ new Date()).getTime();
108
108
  }
109
- return Number(a);
110
- }, [a]), { loading: m, value: l } = pe(() => Ae({ mode: t, version: o }), [t, o]);
109
+ return Number(s);
110
+ }, [s]), { loading: m, value: l } = pe(() => Ae({ mode: t, version: o }), [t, o]);
111
111
  return m ? /* @__PURE__ */ e(qe, {}) : l ? n({ state: l }) : null;
112
112
  }
113
- function H({ mode: t, state: n }) {
114
- const { t: s, locale: a } = J(), [i] = ue(), o = X(), m = fe(), l = i.get("hiddenBadge") === "true", u = i.get("showPublish") === "true", {
113
+ function V({ mode: t, state: n }) {
114
+ const { t: a, locale: s } = J(), [i] = ue(), o = X(), m = fe(), l = i.get("hiddenBadge") === "true", u = i.get("showPublish") === "true", {
115
115
  pageIds: f,
116
116
  pages: p,
117
117
  routeIds: d,
@@ -119,9 +119,9 @@ function H({ mode: t, state: n }) {
119
119
  supportedLocales: b,
120
120
  config: { defaultLocale: y },
121
121
  resources: C
122
- } = n, g = Y(n), w = T(
123
- () => b != null && b.some((c) => c.locale === a) ? a : void 0,
124
- [a, b]
122
+ } = n, g = Y(n), P = T(
123
+ () => b != null && b.some((c) => c.locale === s) ? s : void 0,
124
+ [s, b]
125
125
  ), M = Object.values(h || {}).find((c) => (c == null ? void 0 : c.path) === "/") || Object.values(p).find((c) => (c == null ? void 0 : c.slug) === "/") ? void 0 : Object.values(p)[0], L = T(() => t === "production" ? f.map((c) => {
126
126
  const r = p[c];
127
127
  return r && {
@@ -137,11 +137,11 @@ function H({ mode: t, state: n }) {
137
137
  }).filter(K), [f, p, t, h, d, o, m]), k = ([...c]) => (t !== "production" && u && c.unshift(
138
138
  /* @__PURE__ */ e(Te, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(tt, { mode: "production", state: n }) })
139
139
  ), c);
140
- return /* @__PURE__ */ D(De, { value: { pages: L }, children: [
141
- /* @__PURE__ */ D(Oe, { children: [
142
- M && /* @__PURE__ */ e(E, { index: !0, element: /* @__PURE__ */ e(Fe, { to: S("/", w || "", M.slug) }) }),
140
+ return /* @__PURE__ */ $(Le, { value: { pages: L }, children: [
141
+ /* @__PURE__ */ $(Oe, { children: [
142
+ M && /* @__PURE__ */ e(E, { index: !0, element: /* @__PURE__ */ e(Fe, { to: S("/", P || "", M.slug) }) }),
143
143
  d == null ? void 0 : d.map((c) => {
144
- var P, v, x, _;
144
+ var w, v, x, N;
145
145
  const r = h == null ? void 0 : h[c];
146
146
  if (!r || !r.displayTemplateId) return null;
147
147
  const j = p[r.displayTemplateId];
@@ -159,8 +159,8 @@ function H({ mode: t, state: n }) {
159
159
  result: []
160
160
  });
161
161
  I = R == null ? void 0 : R.map((B) => {
162
- var V, z, G, W;
163
- const U = B.paramOptionIds.join("-");
162
+ var F, z, G, W;
163
+ const O = B.paramOptionIds.join("-");
164
164
  return /* @__PURE__ */ e(
165
165
  E,
166
166
  {
@@ -171,15 +171,15 @@ function H({ mode: t, state: n }) {
171
171
  mode: t,
172
172
  components: g,
173
173
  page: j,
174
- locale: w,
174
+ locale: P,
175
175
  defaultLocale: y,
176
176
  headerAddons: k,
177
177
  state: n,
178
- pageData: (W = (G = (z = (V = r.dataSource) == null ? void 0 : V.pathDataMappings) == null ? void 0 : z[U]) == null ? void 0 : G.dataCache) == null ? void 0 : W[w || y || "en"]
178
+ pageData: (W = (G = (z = (F = r.dataSource) == null ? void 0 : F.pathDataMappings) == null ? void 0 : z[O]) == null ? void 0 : G.dataCache) == null ? void 0 : W[P || y || "en"]
179
179
  }
180
180
  )
181
181
  },
182
- U
182
+ O
183
183
  );
184
184
  });
185
185
  }
@@ -194,11 +194,11 @@ function H({ mode: t, state: n }) {
194
194
  mode: t,
195
195
  components: g,
196
196
  page: j,
197
- locale: w,
197
+ locale: P,
198
198
  defaultLocale: y,
199
199
  headerAddons: k,
200
200
  state: n,
201
- pageData: (_ = (x = (v = (P = r.dataSource) == null ? void 0 : P.pathDataMappings) == null ? void 0 : v[r.id]) == null ? void 0 : x.dataCache) == null ? void 0 : _[w || y || "en"]
201
+ pageData: (N = (x = (v = (w = r.dataSource) == null ? void 0 : w.pathDataMappings) == null ? void 0 : v[r.id]) == null ? void 0 : x.dataCache) == null ? void 0 : N[P || y || "en"]
202
202
  }
203
203
  )
204
204
  },
@@ -213,12 +213,12 @@ function H({ mode: t, state: n }) {
213
213
  {
214
214
  path: S(":projectIdOrSlug?", r.slug),
215
215
  element: /* @__PURE__ */ e(
216
- $,
216
+ H,
217
217
  {
218
218
  mode: t,
219
219
  components: g,
220
220
  page: r,
221
- locale: w,
221
+ locale: P,
222
222
  defaultLocale: y,
223
223
  headerAddons: k
224
224
  }
@@ -232,12 +232,12 @@ function H({ mode: t, state: n }) {
232
232
  {
233
233
  path: S("/", `@${c}`, r.slug),
234
234
  element: /* @__PURE__ */ e(
235
- $,
235
+ H,
236
236
  {
237
237
  mode: t,
238
238
  components: g,
239
239
  page: r,
240
- locale: w,
240
+ locale: P,
241
241
  defaultLocale: y,
242
242
  headerAddons: k
243
243
  }
@@ -249,7 +249,18 @@ function H({ mode: t, state: n }) {
249
249
  E,
250
250
  {
251
251
  path: "*",
252
- element: /* @__PURE__ */ e(F, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Z, { status: 404, extra: /* @__PURE__ */ e(ge, { href: "/", children: s("common.back") }) }) })
252
+ element: /* @__PURE__ */ e(D, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(
253
+ Z,
254
+ {
255
+ status: 404,
256
+ extra: /* @__PURE__ */ e(ge, { href: "/", children: a("common.back") }),
257
+ sx: {
258
+ bgcolor: "transparent",
259
+ width: "100%",
260
+ height: "100%"
261
+ }
262
+ }
263
+ ) })
253
264
  }
254
265
  )
255
266
  ] }),
@@ -260,8 +271,8 @@ function H({ mode: t, state: n }) {
260
271
  function Q({
261
272
  mode: t,
262
273
  pageData: n,
263
- components: s,
264
- page: a,
274
+ components: a,
275
+ page: s,
265
276
  locale: i,
266
277
  defaultLocale: o,
267
278
  headerAddons: m,
@@ -270,18 +281,18 @@ function Q({
270
281
  const u = se({
271
282
  page: null
272
283
  });
273
- O(() => {
274
- const p = a || null;
275
- p ? u.page = N(p) : u.page = null;
276
- }, [a, u]);
284
+ _(() => {
285
+ const p = s || null;
286
+ p ? u.page = A(p) : u.page = null;
287
+ }, [s, u]);
277
288
  const f = ce();
278
- return O(() => {
279
- ie(n, f.current) || n && u.page && (ee(u.page, l, i, n), f.current = N(n));
289
+ return _(() => {
290
+ ie(n, f.current) || n && u.page && (ee(u.page, l, i, n), f.current = A(n));
280
291
  }, [u.page, n, i, l]), u.page ? /* @__PURE__ */ e(
281
- $,
292
+ H,
282
293
  {
283
294
  mode: t,
284
- components: s,
295
+ components: a,
285
296
  page: u.page,
286
297
  locale: i,
287
298
  defaultLocale: o,
@@ -292,32 +303,32 @@ function Q({
292
303
  function Ot({
293
304
  mode: t,
294
305
  state: n,
295
- path: s,
296
- pageData: a
306
+ path: a,
307
+ pageData: s
297
308
  }) {
298
309
  const { t: i, locale: o } = J(), {
299
310
  pages: m,
300
311
  supportedLocales: l,
301
312
  config: { defaultLocale: u },
302
313
  resources: f
303
- } = n, p = Object.values(m).find((g) => (g == null ? void 0 : g.slug) === s), d = Object.values(f.pages || {}).find((g) => g.page.slug === s), h = T(
314
+ } = n, p = Object.values(m).find((g) => (g == null ? void 0 : g.slug) === a), d = Object.values(f.pages || {}).find((g) => g.page.slug === a), h = T(
304
315
  () => l != null && l.some((g) => g.locale === o) ? o : void 0,
305
316
  [o, l]
306
317
  ), b = se({
307
318
  page: null
308
319
  });
309
- O(() => {
320
+ _(() => {
310
321
  const g = p || (d == null ? void 0 : d.page) || null;
311
- g ? b.page = N(g) : b.page = null;
322
+ g ? b.page = A(g) : b.page = null;
312
323
  }, [p, d]);
313
324
  const y = ce();
314
- if (O(() => {
315
- ie(a, y.current) || a && b.page && (ee(b.page, n, h, a), y.current = N(a));
325
+ if (_(() => {
326
+ ie(s, y.current) || s && b.page && (ee(b.page, n, h, s), y.current = A(s));
316
327
  }, [{}]), !p && !(d != null && d.page))
317
- return /* @__PURE__ */ e(F, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Z, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ge, { href: "/", children: i("common.back") }) }) });
328
+ return /* @__PURE__ */ e(D, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Z, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ge, { href: "/", children: i("common.back") }) }) });
318
329
  const C = Y(n);
319
330
  return b.page ? /* @__PURE__ */ e(
320
- $,
331
+ H,
321
332
  {
322
333
  mode: t,
323
334
  components: C,
@@ -327,24 +338,24 @@ function Ot({
327
338
  }
328
339
  ) : null;
329
340
  }
330
- function $({
341
+ function H({
331
342
  mode: t,
332
343
  components: n,
333
- page: s,
334
- locale: a,
344
+ page: a,
345
+ locale: s,
335
346
  defaultLocale: i,
336
347
  headerAddons: o
337
348
  }) {
338
- var w, A, M, L, k, c, r, j, I;
339
- const m = we(), l = ((w = s.locales) == null ? void 0 : w[a]) ?? ((A = s.locales) == null ? void 0 : A[i]) ?? {}, u = l.title || ((M = window.blocklet) == null ? void 0 : M.appName), f = l.description || ((L = window.blocklet) == null ? void 0 : L.appDescription), p = he(be(l.image), 540), { logo: d, brand: h, description: b, ...y } = ve(), C = T(
340
- () => (P) => {
349
+ var P, U, M, L, k, c, r, j, I;
350
+ const m = we(), l = ((P = a.locales) == null ? void 0 : P[s]) ?? ((U = a.locales) == null ? void 0 : U[i]) ?? {}, u = l.title || ((M = window.blocklet) == null ? void 0 : M.appName), f = l.description || ((L = window.blocklet) == null ? void 0 : L.appDescription), p = he(be(l.image), 540), { logo: d, brand: h, description: b, ...y } = ve(), C = T(
351
+ () => (w) => {
341
352
  var x;
342
- let v = (o == null ? void 0 : o(P)) ?? P;
353
+ let v = (o == null ? void 0 : o(w)) ?? w;
343
354
  return v = ((x = y.addons) == null ? void 0 : x.call(y, v)) ?? v, v;
344
355
  },
345
356
  [y.addons, o]
346
357
  ), g = (k = l.header) != null && k.translucent ? nt : de;
347
- return /* @__PURE__ */ D(Ne, { page: s, defaultLocale: i, currentLocale: a, children: [
358
+ return /* @__PURE__ */ $(Ne, { page: a, defaultLocale: i, currentLocale: s, children: [
348
359
  /* @__PURE__ */ e(
349
360
  oe,
350
361
  {
@@ -370,8 +381,8 @@ function $({
370
381
  addons: C
371
382
  }
372
383
  ),
373
- /* @__PURE__ */ e(Le, {}),
374
- /* @__PURE__ */ D(Be, { children: [
384
+ /* @__PURE__ */ e(_e, {}),
385
+ /* @__PURE__ */ $(Be, { children: [
375
386
  /* @__PURE__ */ e("title", { children: u }),
376
387
  /* @__PURE__ */ e("meta", { name: "og:title", content: u }),
377
388
  /* @__PURE__ */ e("meta", { name: "og:description", content: f }),
@@ -393,29 +404,34 @@ function $({
393
404
  pt: "0 !important"
394
405
  }
395
406
  },
396
- children: s.sectionIds.map((P) => {
397
- var R, B;
398
- const v = s.sections[P];
407
+ children: a.sectionIds.map((w) => {
408
+ var R, B, O, F;
409
+ const v = a.sections[w];
399
410
  if (!v || v.visibility === "hidden") return null;
400
- const x = (R = v.locales) == null ? void 0 : R[a], _ = ((B = v.locales) == null ? void 0 : B[i]) ?? {};
411
+ const x = (B = (R = a.dataSource) == null ? void 0 : R[w]) == null ? void 0 : B[s], N = ((F = (O = a.dataSource) == null ? void 0 : O[w]) == null ? void 0 : F[i]) ?? {};
401
412
  return /* @__PURE__ */ e(
402
413
  $e,
403
414
  {
404
- id: P,
415
+ id: w,
405
416
  type: v.component,
406
417
  mode: t,
407
418
  section: v,
408
419
  config: {
409
- ...Ee(x) ? _ : x,
410
- locale: a,
420
+ ...Ee(x) ? N : x,
421
+ locale: s,
411
422
  dev: t === "draft" ? {
412
423
  mode: t,
413
424
  components: n,
414
425
  defaultLocale: i
415
- } : { mode: t }
416
- }
426
+ } : {
427
+ mode: t,
428
+ defaultLocale: i
429
+ // 用于 fallback 的 locale
430
+ }
431
+ },
432
+ page: a
417
433
  },
418
- P
434
+ w
419
435
  );
420
436
  })
421
437
  }
@@ -423,17 +439,17 @@ function $({
423
439
  !((I = l.footer) != null && I.hidden) && /* @__PURE__ */ e(We, {})
424
440
  ] });
425
441
  }
426
- const tt = le(() => import("./publish-button-BftBlabj.js")), de = re(xe)`
442
+ const tt = le(() => import("./publish-button-1bl_Nuva.js")), de = re(xe)`
427
443
  &.sticky {
428
444
  position: sticky;
429
445
  top: 0;
430
446
  }
431
447
  `;
432
448
  function ot({ logo: t }) {
433
- const [n, s] = Me(), a = je((o) => o.breakpoints.down("sm")), { value: i } = pe(() => {
449
+ const [n, a] = Me(), s = je((o) => o.breakpoints.down("sm")), { value: i } = pe(() => {
434
450
  var l, u;
435
451
  const o = new URL(
436
- a ? ((l = window == null ? void 0 : window.blocklet) == null ? void 0 : l.appLogo) || "/.well-known/service/blocklet/logo" : ((u = window == null ? void 0 : window.blocklet) == null ? void 0 : u.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
452
+ s ? ((l = window == null ? void 0 : window.blocklet) == null ? void 0 : l.appLogo) || "/.well-known/service/blocklet/logo" : ((u = window == null ? void 0 : window.blocklet) == null ? void 0 : u.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
437
453
  window.location.origin
438
454
  );
439
455
  o.searchParams.delete("imageFilter"), o.searchParams.delete("f");
@@ -442,15 +458,15 @@ function ot({ logo: t }) {
442
458
  fetch(m).then((p) => {
443
459
  const d = p.headers.get("content-type");
444
460
  d != null && d.includes("svg") && p.text().then((h) => {
445
- s(h), f(null);
461
+ a(h), f(null);
446
462
  }), f(p.url);
447
463
  });
448
464
  });
449
- }, [a]);
465
+ }, [s]);
450
466
  if (t)
451
467
  return t;
452
468
  if (n)
453
- return /* @__PURE__ */ e(F, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Re.sanitize(n) } });
469
+ return /* @__PURE__ */ e(D, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Re.sanitize(n) } });
454
470
  if (i) {
455
471
  const o = new URL(i);
456
472
  o.searchParams.set("imageFilter", "convert"), o.searchParams.set("f", "png"), o.searchParams.set("h", "80");
@@ -462,15 +478,15 @@ function ot({ logo: t }) {
462
478
  function nt({
463
479
  logo: t,
464
480
  translucentTextColor: n,
465
- ...s
481
+ ...a
466
482
  }) {
467
- const { top: a = 0 } = Ie(() => document.getElementById("app")) || {}, i = ae();
468
- let o = Math.min(a / 800, 1), m = "";
483
+ const { top: s = 0 } = Ie(() => document.getElementById("app")) || {}, i = ae();
484
+ let o = Math.min(s / 800, 1), m = "";
469
485
  return o > 0.1 ? (o = Math.max(o, 0.6), m = q(i.palette.text.primary, o)) : m = n || "#EEEEEE", /* @__PURE__ */ e(
470
486
  de,
471
487
  {
472
488
  logo: /* @__PURE__ */ e(ot, { logo: t }),
473
- ...s,
489
+ ...a,
474
490
  className: te(o <= 0.7 && "reverse-color"),
475
491
  style: {
476
492
  backgroundColor: q(i.palette.background.default, o),
@@ -507,10 +523,10 @@ const ge = re(Se)``;
507
523
  export {
508
524
  Bt as H,
509
525
  qe as L,
510
- H as P,
526
+ V as P,
511
527
  nt as T,
512
528
  Je as a,
513
529
  Q as b,
514
530
  Ot as c,
515
- $ as d
531
+ H as d
516
532
  };
@@ -1,5 +1,5 @@
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-D5BnGunt.js";
2
+ import { u as ce, c as de } from "./state-C02ZI8vz.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";
@@ -10,8 +10,8 @@ import { produce as Oe } from "immer";
10
10
  import ee from "lodash/difference";
11
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
12
  import { useAsync as Re } from "react-use";
13
- import { L as ze } from "./home-CNk6U8FU.js";
14
- import { p as Le, g as Be } from "./array-9j8tOSbO.js";
13
+ import { L as ze } from "./home-CxRa0eKd.js";
14
+ import { p as Le, g as Be } from "./array-NLDZzhVt.js";
15
15
  function Ee(s) {
16
16
  const [y, w] = j(!1);
17
17
  return /* @__PURE__ */ t(