@blocklet/pages-kit-inner-components 0.5.20 → 0.5.22

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.
@@ -1,47 +1,47 @@
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-j8jViBMV.js";
3
- import { useLocaleContext as K } from "@arcblock/ux/lib/Locale/context";
4
- import Q from "@arcblock/ux/lib/Result";
5
- import { useHeaderState as fe } from "@blocklet/pages-kit/builtin/page/header";
6
- import { useColorConvert as he } from "@blocklet/pages-kit/contexts/color";
7
- import { setPageDataSource as X } from "@blocklet/pages-kit/utils/data-source";
8
- import { generateParamCombinations as be } from "@blocklet/pages-kit/utils/route";
9
- import ye from "@blocklet/ui-react/lib/Header";
10
- import { cx as Y } from "@emotion/css";
11
- import { Global as J, css as Z } from "@emotion/react";
12
- import ee from "@emotion/styled";
13
- import { Box as L, CircularProgress as ve, useTheme as te, Button as we, Stack as Pe, alpha as G, useMediaQuery as xe } from "@mui/material";
14
- import { useReactive as oe, useScroll as ke } from "ahooks";
15
- import Se from "isomorphic-dompurify";
2
+ import { d as K, e as me, g as de, u as ge, c as fe } from "./state-j8jViBMV.js";
3
+ import { useLocaleContext as Q } from "@arcblock/ux/lib/Locale/context";
4
+ import X from "@arcblock/ux/lib/Result";
5
+ import { useHeaderState as he } from "@blocklet/pages-kit/builtin/page/header";
6
+ import { useColorConvert as be } from "@blocklet/pages-kit/contexts/color";
7
+ import { setPageDataSource as Y } from "@blocklet/pages-kit/utils/data-source";
8
+ import { generateParamCombinations as ye } from "@blocklet/pages-kit/utils/route";
9
+ import ve from "@blocklet/ui-react/lib/Header";
10
+ import { cx as J } from "@emotion/css";
11
+ import { Global as Z, css as ee } from "@emotion/react";
12
+ import te from "@emotion/styled";
13
+ import { Box as L, CircularProgress as we, useTheme as oe, Button as Pe, Stack as xe, alpha as G, useMediaQuery as ke } from "@mui/material";
14
+ import { useReactive as ne, useScroll as Se } from "ahooks";
15
+ import Ce from "isomorphic-dompurify";
16
16
  import $ from "lodash/cloneDeep";
17
- import Ce from "lodash/isEmpty";
18
- import ne from "lodash/isEqual";
19
- import { useEffect as F, lazy as re, useMemo as R, useRef as ae, Suspense as Ie, useState as je } from "react";
20
- import { Helmet as Re } from "react-helmet";
21
- import { useSearchParams as se, Routes as Ee, Route as I, Navigate as Te, ScrollRestoration as Me } from "react-router-dom";
22
- import { useAsync as ie } from "react-use";
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-B1QKSYbX.js";
25
- import { styled as le, useTheme as Ne } from "@arcblock/ux/lib/Theme";
17
+ import Ie from "lodash/isEmpty";
18
+ import re from "lodash/isEqual";
19
+ import { useEffect as F, lazy as ae, useMemo as R, useRef as se, Suspense as je, useState as Re } from "react";
20
+ import { Helmet as Ee } from "react-helmet";
21
+ import { useSearchParams as ie, Routes as Te, Route as j, Navigate as Me, ScrollRestoration as Be } from "react-router-dom";
22
+ import { useAsync as le } from "react-use";
23
+ import { joinURL as S } from "ufo";
24
+ import { S as Oe, n as W, P as Fe, a as Le, B as _e, g as De } from "./array-B1QKSYbX.js";
25
+ import { styled as ce, useTheme as Ne } from "@arcblock/ux/lib/Theme";
26
26
  import $e from "@blocklet/ui-react/lib/Footer";
27
27
  import "webfontloader";
28
28
  import { u as Ae, a as He } from "./session-CVblGhSp.js";
29
- const Ue = le($e, { shouldForwardProp: (t) => !!t })`
29
+ const Ue = ce($e, { shouldForwardProp: (t) => !!t })`
30
30
  & > div > .MuiContainer-root {
31
31
  max-width: unset;
32
32
  }
33
33
  `;
34
34
  function Ve({ meta: t, ...n }) {
35
- const a = Ne();
36
- return /* @__PURE__ */ e(Ue, { ...n, meta: t, theme: a || {} });
35
+ const s = Ne();
36
+ return /* @__PURE__ */ e(Ue, { ...n, meta: t, theme: s || {} });
37
37
  }
38
38
  function ze(t) {
39
- return /* @__PURE__ */ e(L, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(ve, { size: 30 }) });
39
+ return /* @__PURE__ */ e(L, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(we, { size: 30 }) });
40
40
  }
41
41
  function Ge(t) {
42
42
  return /* @__PURE__ */ e(We, { ...t });
43
43
  }
44
- const We = le(L)`
44
+ const We = ce(L)`
45
45
  position: fixed;
46
46
  left: 0;
47
47
  top: 0;
@@ -59,14 +59,14 @@ function Ke({
59
59
  descriptionFontFamily: n
60
60
  }) {
61
61
  var o;
62
- const a = te(), r = (o = a == null ? void 0 : a.typography) == null ? void 0 : o.fontFamily;
62
+ const s = oe(), a = (o = s == null ? void 0 : s.typography) == null ? void 0 : o.fontFamily;
63
63
  F(() => {
64
64
  }, [t, n]);
65
- const l = `${r}, ${qe}`;
65
+ const l = `${a}, ${qe}`;
66
66
  return /* @__PURE__ */ e(
67
- J,
67
+ Z,
68
68
  {
69
- styles: Z`
69
+ styles: ee`
70
70
  #app {
71
71
  font-family: ${l};
72
72
 
@@ -83,96 +83,99 @@ function Ke({
83
83
  );
84
84
  }
85
85
  function Et() {
86
- const [t] = se(), { session: n } = Ae(), a = He("owner", "admin", "pagesEditor", "member"), r = R(() => {
86
+ const [t] = ie(), { session: n } = Ae(), s = He("owner", "admin", "pagesEditor", "member"), a = R(() => {
87
87
  const o = t.get("mode");
88
- return Be.includes(o) ? o : "production";
89
- }, [t]), l = r === "production" ? r : n.user ? a ? r : "production" : null;
88
+ return Oe.includes(o) ? o : "production";
89
+ }, [t]), l = a === "production" ? a : n.user ? s ? a : "production" : null;
90
90
  return l ? /* @__PURE__ */ e(Qe, { mode: l }) : null;
91
91
  }
92
92
  function Qe({ 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(Ye, { mode: t, children: ({ state: a }) => /* @__PURE__ */ e(H, { mode: t, state: a }) });
95
+ return n ? /* @__PURE__ */ e(H, { mode: t, state: n }) : /* @__PURE__ */ e(Ye, { mode: t, children: ({ state: s }) => /* @__PURE__ */ e(H, { mode: t, state: s }) });
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-DyeHwihR.js"));
99
+ const Xe = ae(() => import("./draft-data-DyeHwihR.js"));
100
100
  function Ye({
101
101
  mode: t,
102
102
  children: n
103
103
  }) {
104
- const a = document.querySelector('meta[property="pages:version"]'), r = a == null ? void 0 : a.content, l = de(), o = R(() => {
105
- if (r === "{{pagesPublishedAt}}") {
106
- const c = localStorage.getItem(ge(l ?? ""));
104
+ const s = document.querySelector('meta[property="pages:version"]'), a = s == null ? void 0 : s.content, l = ge(), o = R(() => {
105
+ if (a === "{{pagesPublishedAt}}") {
106
+ const c = localStorage.getItem(fe(l ?? ""));
107
107
  return Number(c) ? Number(c) : (/* @__PURE__ */ new Date()).getTime();
108
108
  }
109
- return Number(r);
110
- }, [r]), { loading: d, value: s } = ie(() => De({ mode: t, version: o }), [t, o]);
111
- return d ? /* @__PURE__ */ e(ze, {}) : s ? n({ state: s }) : null;
109
+ return Number(a);
110
+ }, [a]), { loading: d, value: i } = le(() => De({ mode: t, version: o }), [t, o]);
111
+ return d ? /* @__PURE__ */ e(ze, {}) : i ? n({ state: i }) : null;
112
112
  }
113
113
  function H({ mode: t, state: n }) {
114
- const { t: a, locale: r } = K(), [l] = se(), o = l.get("hiddenBadge") === "true", d = l.get("showPublish") === "true", {
115
- pageIds: s,
114
+ const { t: s, locale: a } = Q(), [l] = ie(), o = l.get("hiddenBadge") === "true", d = l.get("showPublish") === "true", {
115
+ pageIds: i,
116
116
  pages: c,
117
117
  routeIds: g,
118
118
  routes: p,
119
119
  supportedLocales: m,
120
120
  config: { defaultLocale: f },
121
121
  resources: v
122
- } = n, w = q(n), b = R(
123
- () => m != null && m.some((u) => u.locale === r) ? r : void 0,
124
- [r, m]
125
- ), E = Object.values(p || {}).find((u) => (u == null ? void 0 : u.path) === "/") || Object.values(c).find((u) => (u == null ? void 0 : u.slug) === "/") ? void 0 : Object.values(c)[0], _ = R(
126
- () => s.map((u) => {
127
- const i = c[u];
128
- return i && {
129
- id: i.id,
130
- path: j("/", b || "", i.slug, t !== "production" ? `?mode=${t}` : "")
131
- };
132
- }).filter(Oe),
133
- [s, c, b, t]
134
- ), k = ([...u]) => (t !== "production" && d && u.unshift(
135
- /* @__PURE__ */ e(Ie, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(Je, { mode: "production", state: n }) })
122
+ } = n, w = K(n), h = R(
123
+ () => m != null && m.some((u) => u.locale === a) ? a : void 0,
124
+ [a, m]
125
+ ), E = Object.values(p || {}).find((u) => (u == null ? void 0 : u.path) === "/") || Object.values(c).find((u) => (u == null ? void 0 : u.slug) === "/") ? void 0 : Object.values(c)[0], _ = R(() => t === "production" ? i.map((u) => {
126
+ const r = c[u];
127
+ return r && {
128
+ id: r.id,
129
+ path: S("/", h || "", r.slug)
130
+ };
131
+ }).filter(W) : g.map((u) => {
132
+ const r = p[u];
133
+ return r ? {
134
+ id: r.id,
135
+ path: S("/", h || "", r.path, `?mode=${t}`)
136
+ } : null;
137
+ }).filter(W), [i, c, h, t, p, g]), k = ([...u]) => (t !== "production" && d && u.unshift(
138
+ /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(Je, { mode: "production", state: n }) })
136
139
  ), u);
137
140
  return /* @__PURE__ */ N(Fe, { value: { pages: _ }, children: [
138
- /* @__PURE__ */ N(Ee, { children: [
139
- E && /* @__PURE__ */ e(I, { index: !0, element: /* @__PURE__ */ e(Te, { to: j("/", b || "", E.slug) }) }),
141
+ /* @__PURE__ */ N(Te, { children: [
142
+ E && /* @__PURE__ */ e(j, { index: !0, element: /* @__PURE__ */ e(Me, { to: S("/", h || "", E.slug) }) }),
140
143
  g == null ? void 0 : g.map((u) => {
141
- var T, M, P, h;
142
- const i = p == null ? void 0 : p[u];
143
- if (!i || !i.displayTemplateId) return null;
144
- const S = c[i.displayTemplateId];
145
- if (!S) return null;
146
- let C = [];
147
- if (i.params && i.params.length > 0) {
148
- const x = be({
149
- basePath: i.path,
150
- params: i.params,
151
- routeId: i.id,
152
- paramsOptions: i.paramsOptions,
144
+ var T, M, P, b;
145
+ const r = p == null ? void 0 : p[u];
146
+ if (!r || !r.displayTemplateId) return null;
147
+ const C = c[r.displayTemplateId];
148
+ if (!C) return null;
149
+ let I = [];
150
+ if (r.params && r.params.length > 0) {
151
+ const x = ye({
152
+ basePath: r.path,
153
+ params: r.params,
154
+ routeId: r.id,
155
+ paramsOptions: r.paramsOptions,
153
156
  currentIndex: 0,
154
157
  currentParams: [],
155
158
  currentOptionIds: [],
156
159
  result: []
157
160
  });
158
- C = x == null ? void 0 : x.map((D) => {
161
+ I = x == null ? void 0 : x.map((D) => {
159
162
  var O, U, V, z;
160
163
  const B = D.paramOptionIds.join("-");
161
164
  return /* @__PURE__ */ e(
162
- I,
165
+ j,
163
166
  {
164
- path: j(":projectIdOrSlug?", D.path),
167
+ path: S(":projectIdOrSlug?", D.path),
165
168
  element: /* @__PURE__ */ e(
166
- W,
169
+ q,
167
170
  {
168
171
  mode: t,
169
172
  components: w,
170
- page: S,
171
- locale: b,
173
+ page: C,
174
+ locale: h,
172
175
  defaultLocale: f,
173
176
  headerAddons: k,
174
177
  state: n,
175
- pageData: (z = (V = (U = (O = i.dataSource) == null ? void 0 : O.pathDataMappings) == null ? void 0 : U[B]) == null ? void 0 : V.dataCache) == null ? void 0 : z[b || f || "en"]
178
+ pageData: (z = (V = (U = (O = r.dataSource) == null ? void 0 : O.pathDataMappings) == null ? void 0 : U[B]) == null ? void 0 : V.dataCache) == null ? void 0 : z[h || f || "en"]
176
179
  }
177
180
  )
178
181
  },
@@ -180,73 +183,73 @@ function H({ mode: t, state: n }) {
180
183
  );
181
184
  });
182
185
  }
183
- return C.push(
186
+ return I.push(
184
187
  /* @__PURE__ */ e(
185
- I,
188
+ j,
186
189
  {
187
- path: j(":projectIdOrSlug?", i.path),
190
+ path: S(":projectIdOrSlug?", r.path),
188
191
  element: /* @__PURE__ */ e(
189
- W,
192
+ q,
190
193
  {
191
194
  mode: t,
192
195
  components: w,
193
- page: S,
194
- locale: b,
196
+ page: C,
197
+ locale: h,
195
198
  defaultLocale: f,
196
199
  headerAddons: k,
197
200
  state: n,
198
- pageData: (h = (P = (M = (T = i.dataSource) == null ? void 0 : T.pathDataMappings) == null ? void 0 : M[i.id]) == null ? void 0 : P.dataCache) == null ? void 0 : h[b || f || "en"]
201
+ pageData: (b = (P = (M = (T = r.dataSource) == null ? void 0 : T.pathDataMappings) == null ? void 0 : M[r.id]) == null ? void 0 : P.dataCache) == null ? void 0 : b[h || f || "en"]
199
202
  }
200
203
  )
201
204
  },
202
- i.id
205
+ r.id
203
206
  )
204
- ), C;
207
+ ), I;
205
208
  }),
206
- s.map((u) => {
207
- const i = c[u];
208
- return i ? /* @__PURE__ */ e(
209
- I,
209
+ i.map((u) => {
210
+ const r = c[u];
211
+ return r ? /* @__PURE__ */ e(
212
+ j,
210
213
  {
211
- path: j(":projectIdOrSlug?", i.slug),
214
+ path: S(":projectIdOrSlug?", r.slug),
212
215
  element: /* @__PURE__ */ e(
213
216
  A,
214
217
  {
215
218
  mode: t,
216
219
  components: w,
217
- page: i,
218
- locale: b,
220
+ page: r,
221
+ locale: h,
219
222
  defaultLocale: f,
220
223
  headerAddons: k
221
224
  }
222
225
  )
223
226
  },
224
- i.id
227
+ r.id
225
228
  ) : null;
226
229
  }),
227
- v.pages && Object.values(v.pages).map(({ blockletId: u, page: i }) => /* @__PURE__ */ e(
228
- I,
230
+ v.pages && Object.values(v.pages).map(({ blockletId: u, page: r }) => /* @__PURE__ */ e(
231
+ j,
229
232
  {
230
- path: j("/", `@${u}`, i.slug),
233
+ path: S("/", `@${u}`, r.slug),
231
234
  element: /* @__PURE__ */ e(
232
235
  A,
233
236
  {
234
237
  mode: t,
235
238
  components: w,
236
- page: i,
237
- locale: b,
239
+ page: r,
240
+ locale: h,
238
241
  defaultLocale: f,
239
242
  headerAddons: k
240
243
  }
241
244
  )
242
245
  },
243
- i.id
246
+ r.id
244
247
  )),
245
248
  /* @__PURE__ */ e(
246
- I,
249
+ j,
247
250
  {
248
251
  path: "*",
249
- element: /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Q, { status: 404, extra: /* @__PURE__ */ e(ue, { href: "/", children: a("common.back") }) }) })
252
+ element: /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(X, { status: 404, extra: /* @__PURE__ */ e(pe, { href: "/", children: s("common.back") }) }) })
250
253
  }
251
254
  )
252
255
  ] }),
@@ -254,31 +257,31 @@ function H({ mode: t, state: n }) {
254
257
  /* @__PURE__ */ e(Ke, {})
255
258
  ] });
256
259
  }
257
- function W({
260
+ function q({
258
261
  mode: t,
259
262
  pageData: n,
260
- components: a,
261
- page: r,
263
+ components: s,
264
+ page: a,
262
265
  locale: l,
263
266
  defaultLocale: o,
264
267
  headerAddons: d,
265
- state: s
268
+ state: i
266
269
  }) {
267
- const c = oe({
270
+ const c = ne({
268
271
  page: null
269
272
  });
270
273
  F(() => {
271
- const p = r || null;
274
+ const p = a || null;
272
275
  p ? c.page = $(p) : c.page = null;
273
- }, [r, c]);
274
- const g = ae();
276
+ }, [a, c]);
277
+ const g = se();
275
278
  return F(() => {
276
- ne(n, g.current) || n && c.page && (X(c.page, s, l, n), g.current = $(n));
277
- }, [c.page, n, l, s]), c.page ? /* @__PURE__ */ e(
279
+ re(n, g.current) || n && c.page && (Y(c.page, i, l, n), g.current = $(n));
280
+ }, [c.page, n, l, i]), c.page ? /* @__PURE__ */ e(
278
281
  A,
279
282
  {
280
283
  mode: t,
281
- components: a,
284
+ components: s,
282
285
  page: c.page,
283
286
  locale: l,
284
287
  defaultLocale: o,
@@ -289,35 +292,35 @@ function W({
289
292
  function Tt({
290
293
  mode: t,
291
294
  state: n,
292
- path: a,
293
- pageData: r
295
+ path: s,
296
+ pageData: a
294
297
  }) {
295
- const { t: l, locale: o } = K(), {
298
+ const { t: l, locale: o } = Q(), {
296
299
  pages: d,
297
- supportedLocales: s,
300
+ supportedLocales: i,
298
301
  config: { defaultLocale: c },
299
302
  resources: g
300
- } = n, p = Object.values(d).find((y) => (y == null ? void 0 : y.slug) === a), m = Object.values(g.pages || {}).find((y) => y.page.slug === a), f = R(
301
- () => s != null && s.some((y) => y.locale === o) ? o : void 0,
302
- [o, s]
303
- ), v = oe({
303
+ } = n, p = Object.values(d).find((y) => (y == null ? void 0 : y.slug) === s), m = Object.values(g.pages || {}).find((y) => y.page.slug === s), f = R(
304
+ () => i != null && i.some((y) => y.locale === o) ? o : void 0,
305
+ [o, i]
306
+ ), v = ne({
304
307
  page: null
305
308
  });
306
309
  F(() => {
307
310
  const y = p || (m == null ? void 0 : m.page) || null;
308
311
  y ? v.page = $(y) : v.page = null;
309
312
  }, [p, m]);
310
- const w = ae();
313
+ const w = se();
311
314
  if (F(() => {
312
- ne(r, w.current) || r && v.page && (X(v.page, n, f, r), w.current = $(r));
315
+ re(a, w.current) || a && v.page && (Y(v.page, n, f, a), w.current = $(a));
313
316
  }, [{}]), !p && !(m != null && m.page))
314
- return /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Q, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ue, { href: "/", children: l("common.back") }) }) });
315
- const b = q(n);
317
+ return /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(X, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(pe, { href: "/", children: l("common.back") }) }) });
318
+ const h = K(n);
316
319
  return v.page ? /* @__PURE__ */ e(
317
320
  A,
318
321
  {
319
322
  mode: t,
320
- components: b,
323
+ components: h,
321
324
  page: v.page,
322
325
  locale: f,
323
326
  defaultLocale: c
@@ -327,28 +330,28 @@ function Tt({
327
330
  function A({
328
331
  mode: t,
329
332
  components: n,
330
- page: a,
331
- locale: r,
333
+ page: s,
334
+ locale: a,
332
335
  defaultLocale: l,
333
336
  headerAddons: o
334
337
  }) {
335
- var E, _, k, u, i, S, C, T, M;
336
- const d = he(), s = ((E = a.locales) == null ? void 0 : E[r]) ?? ((_ = a.locales) == null ? void 0 : _[l]) ?? {}, c = s.title || ((k = window.blocklet) == null ? void 0 : k.appName), g = s.description || ((u = window.blocklet) == null ? void 0 : u.appDescription), p = pe(me(s.image), 540), { logo: m, brand: f, description: v, ...w } = fe(), b = R(
338
+ var E, _, k, u, r, C, I, T, M;
339
+ const d = be(), i = ((E = s.locales) == null ? void 0 : E[a]) ?? ((_ = s.locales) == null ? void 0 : _[l]) ?? {}, c = i.title || ((k = window.blocklet) == null ? void 0 : k.appName), g = i.description || ((u = window.blocklet) == null ? void 0 : u.appDescription), p = me(de(i.image), 540), { logo: m, brand: f, description: v, ...w } = he(), h = R(
337
340
  () => (P) => {
338
341
  var x;
339
- let h = (o == null ? void 0 : o(P)) ?? P;
340
- return h = ((x = w.addons) == null ? void 0 : x.call(w, h)) ?? h, h;
342
+ let b = (o == null ? void 0 : o(P)) ?? P;
343
+ return b = ((x = w.addons) == null ? void 0 : x.call(w, b)) ?? b, b;
341
344
  },
342
345
  [w.addons, o]
343
- ), y = (i = s.header) != null && i.translucent ? et : ce;
344
- return /* @__PURE__ */ N(Le, { page: a, defaultLocale: l, currentLocale: r, children: [
346
+ ), y = (r = i.header) != null && r.translucent ? et : ue;
347
+ return /* @__PURE__ */ N(Le, { page: s, defaultLocale: l, currentLocale: a, children: [
345
348
  /* @__PURE__ */ e(
346
- J,
349
+ Z,
347
350
  {
348
- styles: Z`
351
+ styles: ee`
349
352
  body {
350
353
  background-color: ${d(
351
- !s.backgroundColor || s.backgroundColor === "transparent" ? "background.default" : s.backgroundColor
354
+ !i.backgroundColor || i.backgroundColor === "transparent" ? "background.default" : i.backgroundColor
352
355
  )} !important;
353
356
  }
354
357
  `
@@ -357,18 +360,18 @@ function A({
357
360
  /* @__PURE__ */ e(
358
361
  y,
359
362
  {
360
- hideNavMenu: !!((S = s.header) != null && S.hideNavMenus),
361
- translucentTextColor: (C = s.header) == null ? void 0 : C.translucentTextColor,
363
+ hideNavMenu: !!((C = i.header) != null && C.hideNavMenus),
364
+ translucentTextColor: (I = i.header) == null ? void 0 : I.translucentTextColor,
362
365
  ...m ? { logo: m } : {},
363
366
  ...f ? { brand: f } : {},
364
367
  ...v ? { description: v } : {},
365
- className: Y(((T = s.header) == null ? void 0 : T.sticky) && "sticky", "page-header"),
368
+ className: J(((T = i.header) == null ? void 0 : T.sticky) && "sticky", "page-header"),
366
369
  maxWidth: !1,
367
- addons: b
370
+ addons: h
368
371
  }
369
372
  ),
370
- /* @__PURE__ */ e(Me, {}),
371
- /* @__PURE__ */ N(Re, { children: [
373
+ /* @__PURE__ */ e(Be, {}),
374
+ /* @__PURE__ */ N(Ee, { children: [
372
375
  /* @__PURE__ */ e("title", { children: c }),
373
376
  /* @__PURE__ */ e("meta", { name: "og:title", content: c }),
374
377
  /* @__PURE__ */ e("meta", { name: "og:description", content: g }),
@@ -380,7 +383,7 @@ function A({
380
383
  /* @__PURE__ */ e("meta", { name: "description", content: g })
381
384
  ] }),
382
385
  /* @__PURE__ */ e(
383
- Pe,
386
+ xe,
384
387
  {
385
388
  flexGrow: 1,
386
389
  className: "PageView-root",
@@ -390,21 +393,21 @@ function A({
390
393
  pt: "0 !important"
391
394
  }
392
395
  },
393
- children: a.sectionIds.map((P) => {
396
+ children: s.sectionIds.map((P) => {
394
397
  var B, O;
395
- const h = a.sections[P];
396
- if (!h || h.visibility === "hidden") return null;
397
- const x = (B = h.locales) == null ? void 0 : B[r], D = ((O = h.locales) == null ? void 0 : O[l]) ?? {};
398
+ const b = s.sections[P];
399
+ if (!b || b.visibility === "hidden") return null;
400
+ const x = (B = b.locales) == null ? void 0 : B[a], D = ((O = b.locales) == null ? void 0 : O[l]) ?? {};
398
401
  return /* @__PURE__ */ e(
399
402
  _e,
400
403
  {
401
404
  id: P,
402
- type: h.component,
405
+ type: b.component,
403
406
  mode: t,
404
- section: h,
407
+ section: b,
405
408
  config: {
406
- ...Ce(x) ? D : x,
407
- locale: r,
409
+ ...Ie(x) ? D : x,
410
+ locale: a,
408
411
  dev: t === "draft" ? {
409
412
  mode: t,
410
413
  components: n,
@@ -417,20 +420,20 @@ function A({
417
420
  })
418
421
  }
419
422
  ),
420
- !((M = s.footer) != null && M.hidden) && /* @__PURE__ */ e(Ve, {})
423
+ !((M = i.footer) != null && M.hidden) && /* @__PURE__ */ e(Ve, {})
421
424
  ] });
422
425
  }
423
- const Je = re(() => import("./publish-button-eIyM_BsP.js")), ce = ee(ye)`
426
+ const Je = ae(() => import("./publish-button-BJSEYd0m.js")), ue = te(ve)`
424
427
  &.sticky {
425
428
  position: sticky;
426
429
  top: 0;
427
430
  }
428
431
  `;
429
432
  function Ze({ logo: t }) {
430
- const [n, a] = je(), r = xe((o) => o.breakpoints.down("sm")), { value: l } = ie(() => {
431
- var s, c;
433
+ const [n, s] = Re(), a = ke((o) => o.breakpoints.down("sm")), { value: l } = le(() => {
434
+ var i, c;
432
435
  const o = new URL(
433
- r ? ((s = window == null ? void 0 : window.blocklet) == null ? void 0 : s.appLogo) || "/.well-known/service/blocklet/logo" : ((c = window == null ? void 0 : window.blocklet) == null ? void 0 : c.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
436
+ a ? ((i = window == null ? void 0 : window.blocklet) == null ? void 0 : i.appLogo) || "/.well-known/service/blocklet/logo" : ((c = window == null ? void 0 : window.blocklet) == null ? void 0 : c.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
434
437
  window.location.origin
435
438
  );
436
439
  o.searchParams.delete("imageFilter"), o.searchParams.delete("f");
@@ -439,15 +442,15 @@ function Ze({ logo: t }) {
439
442
  fetch(d).then((p) => {
440
443
  const m = p.headers.get("content-type");
441
444
  m != null && m.includes("svg") && p.text().then((f) => {
442
- a(f), g(null);
445
+ s(f), g(null);
443
446
  }), g(p.url);
444
447
  });
445
448
  });
446
- }, [r]);
449
+ }, [a]);
447
450
  if (t)
448
451
  return t;
449
452
  if (n)
450
- return /* @__PURE__ */ e(L, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Se.sanitize(n) } });
453
+ return /* @__PURE__ */ e(L, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Ce.sanitize(n) } });
451
454
  if (l) {
452
455
  const o = new URL(l);
453
456
  o.searchParams.set("imageFilter", "convert"), o.searchParams.set("f", "png"), o.searchParams.set("h", "80");
@@ -459,16 +462,16 @@ function Ze({ logo: t }) {
459
462
  function et({
460
463
  logo: t,
461
464
  translucentTextColor: n,
462
- ...a
465
+ ...s
463
466
  }) {
464
- const { top: r = 0 } = ke(() => document.getElementById("app")) || {}, l = te();
465
- let o = Math.min(r / 800, 1), d = "";
467
+ const { top: a = 0 } = Se(() => document.getElementById("app")) || {}, l = oe();
468
+ let o = Math.min(a / 800, 1), d = "";
466
469
  return o > 0.1 ? (o = Math.max(o, 0.6), d = G(l.palette.text.primary, o)) : d = n || "#EEEEEE", /* @__PURE__ */ e(
467
- ce,
470
+ ue,
468
471
  {
469
472
  logo: /* @__PURE__ */ e(Ze, { logo: t }),
470
- ...a,
471
- className: Y(o <= 0.7 && "reverse-color"),
473
+ ...s,
474
+ className: J(o <= 0.7 && "reverse-color"),
472
475
  style: {
473
476
  backgroundColor: G(l.palette.background.default, o),
474
477
  // @ts-ignore
@@ -500,14 +503,14 @@ function et({
500
503
  }
501
504
  );
502
505
  }
503
- const ue = ee(we)``;
506
+ const pe = te(Pe)``;
504
507
  export {
505
508
  Et as H,
506
509
  ze as L,
507
510
  H as P,
508
511
  et as T,
509
512
  Qe as a,
510
- W as b,
513
+ q as b,
511
514
  Tt as c,
512
515
  A as d
513
516
  };
@@ -10,7 +10,7 @@ import { produce as Oe } from "immer";
10
10
  import ee from "lodash/difference";
11
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 ze } from "./home-BjT8iYTg.js";
13
+ import { L as ze } from "./home-BB778Odl.js";
14
14
  import { p as Le, g as Be } from "./array-B1QKSYbX.js";
15
15
  function Ee(s) {
16
16
  const [y, w] = T(!1);
package/lib/es/home.js CHANGED
@@ -22,7 +22,7 @@ import "react-router-dom";
22
22
  import "react-use";
23
23
  import "ufo";
24
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";
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-BB778Odl.js";
26
26
  import "./chunks/session-CVblGhSp.js";
27
27
  export {
28
28
  R as HomeView,