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