@blocklet/pages-kit-inner-components 0.5.56 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/add-component.js +21 -23
- package/lib/cjs/chunks/{draft-data-CuZfaQ4s.js → draft-data-D44_IEV2.js} +1 -1
- package/lib/cjs/chunks/home-BYk01EUy.js +39 -0
- package/lib/cjs/chunks/index-BRgYwvuv.js +475 -0
- package/lib/cjs/chunks/publish-button-C8XPA4g_.js +1 -0
- package/lib/cjs/chunks/session-BRtsDvA-.js +1 -0
- package/lib/cjs/chunks/site-state-gSkcvhcV.js +57 -0
- package/lib/cjs/chunks/state-B6BF5wJ-.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +7 -7
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/cjs/site-state.js +1 -1
- package/lib/cjs/theme.js +1 -1
- package/lib/es/add-component.js +385 -2356
- package/lib/es/chunks/{draft-data-CWM--ooz.js → draft-data-CafrGKeh.js} +1 -1
- package/lib/es/chunks/home-DW8SdyfO.js +594 -0
- package/lib/es/chunks/index-D5gXPe_7.js +2326 -0
- package/lib/es/chunks/publish-button-XSZrDaTQ.js +498 -0
- package/lib/es/chunks/session-C72Dq8zg.js +19 -0
- package/lib/es/chunks/site-state-W2H7XCSQ.js +2077 -0
- package/lib/es/chunks/state-0gvZF3k2.js +573 -0
- package/lib/es/components.js +1 -1
- package/lib/es/home.js +5 -5
- package/lib/es/project-html.js +131 -141
- package/lib/es/resources.js +106 -107
- package/lib/es/setting.js +1772 -1489
- package/lib/es/site-state.js +1 -1
- package/lib/es/theme.js +50 -51
- package/package.json +46 -47
- package/lib/cjs/chunks/array-BqHuYyfx.js +0 -475
- package/lib/cjs/chunks/config-string-4bVR9Vc8.js +0 -1
- package/lib/cjs/chunks/home-BMjMYgq3.js +0 -38
- package/lib/cjs/chunks/publish-button-CGfGqrov.js +0 -1
- package/lib/cjs/chunks/session-BA7Qrcia.js +0 -1
- package/lib/cjs/chunks/site-state-BtZ8o3J2.js +0 -57
- package/lib/cjs/chunks/state-BVdbNJCA.js +0 -1
- package/lib/es/chunks/array-c6HYTLze.js +0 -2224
- package/lib/es/chunks/config-string-WMpFf-7V.js +0 -88
- package/lib/es/chunks/home-PDsc59QG.js +0 -566
- package/lib/es/chunks/publish-button-Ds7OBvxV.js +0 -462
- package/lib/es/chunks/session-CVblGhSp.js +0 -21
- package/lib/es/chunks/site-state-D-moj9fA.js +0 -2125
- package/lib/es/chunks/state-l--dTdHq.js +0 -603
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsx as r, jsxs as p, Fragment as v } from "react/jsx-runtime";
|
|
2
|
-
import { getImageSize as b, getVideoSize as g, UploaderButton as y } from "@blocklet/pages-kit/builtin/uploader";
|
|
3
|
-
import { Icon as P } from "@iconify-icon/react";
|
|
4
|
-
import { TextField as A, Stack as w, FormControlLabel as F, Switch as L, Box as j, InputAdornment as k } from "@mui/material";
|
|
5
|
-
import { forwardRef as B, useState as D, useEffect as E, useImperativeHandle as U } from "react";
|
|
6
|
-
import { useDebounce as V } from "react-use";
|
|
7
|
-
import { g as x } from "./state-l--dTdHq.js";
|
|
8
|
-
const J = B(function({ showMarkdown: I, markdown: h, onMarkdownChange: n, showUploader: S, value: o, meta: H, onChange: l, ...a }, z) {
|
|
9
|
-
const [e, c] = D("");
|
|
10
|
-
E(() => {
|
|
11
|
-
c(o || "");
|
|
12
|
-
}, [o, c]);
|
|
13
|
-
const s = async () => {
|
|
14
|
-
if (e !== o) {
|
|
15
|
-
const t = x(e);
|
|
16
|
-
if (!t) {
|
|
17
|
-
l(e, void 0);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const i = await b(t).catch(() => g(t)).catch(() => {
|
|
21
|
-
});
|
|
22
|
-
l(e, { ...i, filename: e });
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
V(
|
|
26
|
-
() => {
|
|
27
|
-
e !== o && l(e);
|
|
28
|
-
},
|
|
29
|
-
300,
|
|
30
|
-
[e]
|
|
31
|
-
), U(z, () => ({
|
|
32
|
-
submit: s
|
|
33
|
-
}));
|
|
34
|
-
const f = {};
|
|
35
|
-
return S && (f.InputProps = {
|
|
36
|
-
sx: { pr: 0 },
|
|
37
|
-
endAdornment: /* @__PURE__ */ r(k, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ r(
|
|
38
|
-
y,
|
|
39
|
-
{
|
|
40
|
-
onChange: async ({ response: t }) => {
|
|
41
|
-
var d;
|
|
42
|
-
const i = (d = t == null ? void 0 : t.data) == null ? void 0 : d.filename, m = x(i) || "";
|
|
43
|
-
let u = {};
|
|
44
|
-
m && (u = await b(m).catch(() => g(m)).catch(() => {
|
|
45
|
-
})), l(i, {
|
|
46
|
-
...u,
|
|
47
|
-
filename: i
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
) })
|
|
52
|
-
}), /* @__PURE__ */ r(
|
|
53
|
-
A,
|
|
54
|
-
{
|
|
55
|
-
size: "small",
|
|
56
|
-
fullWidth: !0,
|
|
57
|
-
...a,
|
|
58
|
-
label: /* @__PURE__ */ p(w, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
59
|
-
a.label,
|
|
60
|
-
I && /* @__PURE__ */ p(v, { children: [
|
|
61
|
-
" (",
|
|
62
|
-
/* @__PURE__ */ r(
|
|
63
|
-
F,
|
|
64
|
-
{
|
|
65
|
-
checked: h,
|
|
66
|
-
label: /* @__PURE__ */ r(j, { component: P, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
|
|
67
|
-
labelPlacement: "start",
|
|
68
|
-
control: /* @__PURE__ */ r(L, { size: "small" }),
|
|
69
|
-
sx: { ml: 0.25, pr: 1 },
|
|
70
|
-
onChange: (t, i) => n == null ? void 0 : n(i)
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
")"
|
|
74
|
-
] })
|
|
75
|
-
] }),
|
|
76
|
-
InputLabelProps: { shrink: !0, ...a.InputLabelProps },
|
|
77
|
-
value: e,
|
|
78
|
-
onChange: (t) => c(t.target.value),
|
|
79
|
-
...f,
|
|
80
|
-
onKeyDown: (t) => {
|
|
81
|
-
t.keyCode !== 229 && t.key === "Enter" && s();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
export {
|
|
87
|
-
J as C
|
|
88
|
-
};
|
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { u as J, d as Q, e as gt, f as ft, g as ht, c as bt } from "./state-l--dTdHq.js";
|
|
3
|
-
import { useLocaleContext as X } from "@arcblock/ux/lib/Locale/context";
|
|
4
|
-
import Z from "@arcblock/ux/lib/Result";
|
|
5
|
-
import { useHeaderState as yt } from "@blocklet/pages-kit/builtin/page/header";
|
|
6
|
-
import { useColorConvert as vt } from "@blocklet/pages-kit/contexts/color";
|
|
7
|
-
import { setPageDataSource as tt } from "@blocklet/pages-kit/utils/data-source";
|
|
8
|
-
import { generateParamCombinations as wt } from "@blocklet/pages-kit/utils/route";
|
|
9
|
-
import xt from "@blocklet/ui-react/lib/Header";
|
|
10
|
-
import { cx as kt } from "@emotion/css";
|
|
11
|
-
import { Global as et, css as ot } from "@emotion/react";
|
|
12
|
-
import nt from "@emotion/styled";
|
|
13
|
-
import { Box as _, CircularProgress as Pt, useTheme as rt, Button as St, Stack as Ct, alpha as q, useMediaQuery as It } from "@mui/material";
|
|
14
|
-
import { useReactive as at, useScroll as jt } from "ahooks";
|
|
15
|
-
import Rt from "isomorphic-dompurify";
|
|
16
|
-
import A from "lodash/cloneDeep";
|
|
17
|
-
import Tt from "lodash/isEmpty";
|
|
18
|
-
import st from "lodash/isEqual";
|
|
19
|
-
import { useEffect as $, lazy as it, useMemo as P, useRef as lt, Suspense as Ot, useState as Et } from "react";
|
|
20
|
-
import { Helmet as Mt } from "react-helmet";
|
|
21
|
-
import { useSearchParams as ct, Routes as Bt, Route as O, Navigate as Ft, ScrollRestoration as $t } from "react-router-dom";
|
|
22
|
-
import { useAsync as ut } from "react-use";
|
|
23
|
-
import { joinURL as C } from "ufo";
|
|
24
|
-
import { S as _t, n as K, P as Dt, a as Lt, B as Nt, g as At } from "./array-c6HYTLze.js";
|
|
25
|
-
import { styled as pt, useTheme as Ht } from "@arcblock/ux/lib/Theme";
|
|
26
|
-
import zt from "@blocklet/ui-react/lib/Footer";
|
|
27
|
-
import "webfontloader";
|
|
28
|
-
import { u as Ut, a as Vt } from "./session-CVblGhSp.js";
|
|
29
|
-
const Gt = pt(zt, { shouldForwardProp: (e) => !!e })`
|
|
30
|
-
& > div > .MuiContainer-root {
|
|
31
|
-
max-width: unset;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
function Wt({ meta: e, ...n }) {
|
|
35
|
-
const a = Ht();
|
|
36
|
-
return /* @__PURE__ */ t(Gt, { ...n, meta: e, theme: a || {} });
|
|
37
|
-
}
|
|
38
|
-
function qt(e) {
|
|
39
|
-
return /* @__PURE__ */ t(_, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...e, children: /* @__PURE__ */ t(Pt, { size: 30 }) });
|
|
40
|
-
}
|
|
41
|
-
function Kt(e) {
|
|
42
|
-
return /* @__PURE__ */ t(Yt, { ...e });
|
|
43
|
-
}
|
|
44
|
-
const Yt = pt(_)`
|
|
45
|
-
position: fixed;
|
|
46
|
-
left: 0;
|
|
47
|
-
top: 0;
|
|
48
|
-
z-index: 999999999999;
|
|
49
|
-
width: 80px;
|
|
50
|
-
font-size: 12px;
|
|
51
|
-
text-align: center;
|
|
52
|
-
opacity: 0.7;
|
|
53
|
-
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
54
|
-
pointer-events: none;
|
|
55
|
-
`, Jt = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
56
|
-
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
|
|
57
|
-
function Qt({
|
|
58
|
-
titleFontFamily: e,
|
|
59
|
-
descriptionFontFamily: n
|
|
60
|
-
}) {
|
|
61
|
-
var o;
|
|
62
|
-
const a = rt(), s = (o = a == null ? void 0 : a.typography) == null ? void 0 : o.fontFamily;
|
|
63
|
-
$(() => {
|
|
64
|
-
}, [e, n]);
|
|
65
|
-
const i = `${s}, ${Jt}`;
|
|
66
|
-
return /* @__PURE__ */ t(
|
|
67
|
-
et,
|
|
68
|
-
{
|
|
69
|
-
styles: ot`
|
|
70
|
-
#app {
|
|
71
|
-
font-family: ${i};
|
|
72
|
-
|
|
73
|
-
.page-kit-section__title {
|
|
74
|
-
font-family: ${i};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.page-kit-section__description {
|
|
78
|
-
font-family: ${i};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
`
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
function Me() {
|
|
86
|
-
const [e] = ct(), { session: n } = Ut(), a = Vt("owner", "admin", "pagesEditor", "member"), s = P(() => {
|
|
87
|
-
const o = e.get("mode");
|
|
88
|
-
return _t.includes(o) ? o : "production";
|
|
89
|
-
}, [e]), i = s === "production" ? s : n.user ? a ? s : "production" : null;
|
|
90
|
-
return i ? /* @__PURE__ */ t(Xt, { mode: i }) : null;
|
|
91
|
-
}
|
|
92
|
-
function Xt({ mode: e }) {
|
|
93
|
-
if (e !== "draft") {
|
|
94
|
-
const n = window.__PAGE_STATE__;
|
|
95
|
-
return n ? /* @__PURE__ */ t(U, { mode: e, state: n }) : /* @__PURE__ */ t(te, { mode: e, children: ({ state: a }) => /* @__PURE__ */ t(U, { mode: e, state: a }) });
|
|
96
|
-
}
|
|
97
|
-
return /* @__PURE__ */ t(Zt, { children: ({ state: n }) => /* @__PURE__ */ t(U, { mode: e, state: n }) });
|
|
98
|
-
}
|
|
99
|
-
const Zt = it(() => import("./draft-data-CWM--ooz.js"));
|
|
100
|
-
function te({
|
|
101
|
-
mode: e,
|
|
102
|
-
children: n
|
|
103
|
-
}) {
|
|
104
|
-
const a = document.querySelector('meta[property="pages:version"]'), s = a == null ? void 0 : a.content, i = J(), o = P(() => {
|
|
105
|
-
if (s === "{{pagesPublishedAt}}") {
|
|
106
|
-
const u = localStorage.getItem(bt(i ?? ""));
|
|
107
|
-
return Number(u) ? Number(u) : (/* @__PURE__ */ new Date()).getTime();
|
|
108
|
-
}
|
|
109
|
-
return Number(s);
|
|
110
|
-
}, [s]), { loading: d, value: l } = ut(() => At({ mode: e, version: o }), [e, o]);
|
|
111
|
-
return d ? /* @__PURE__ */ t(qt, {}) : l ? n({ state: l }) : null;
|
|
112
|
-
}
|
|
113
|
-
function U({ mode: e, state: n }) {
|
|
114
|
-
const { t: a, locale: s } = X(), [i] = ct(), o = J(), d = gt(), l = i.get("hiddenBadge") === "true", u = i.get("showPublish") === "true", {
|
|
115
|
-
pageIds: g,
|
|
116
|
-
pages: m,
|
|
117
|
-
routeIds: c,
|
|
118
|
-
routes: f,
|
|
119
|
-
supportedLocales: b,
|
|
120
|
-
config: { defaultLocale: y },
|
|
121
|
-
resources: I
|
|
122
|
-
} = n, h = Q(n), x = P(
|
|
123
|
-
() => b != null && b.some((p) => p.locale === s) ? s : void 0,
|
|
124
|
-
[s, b]
|
|
125
|
-
), E = Object.values(f || {}).find((p) => (p == null ? void 0 : p.path) === "/") || Object.values(m).find((p) => (p == null ? void 0 : p.slug) === "/") ? void 0 : Object.values(m)[0], D = P(() => e === "production" ? g.map((p) => {
|
|
126
|
-
const r = m[p];
|
|
127
|
-
return r && {
|
|
128
|
-
id: r.id,
|
|
129
|
-
path: C("/", d || o || "", r.slug)
|
|
130
|
-
};
|
|
131
|
-
}).filter(K) : c.map((p) => {
|
|
132
|
-
const r = f[p];
|
|
133
|
-
return r ? {
|
|
134
|
-
id: r.id,
|
|
135
|
-
path: C("/", d || o || "", r.path, `?mode=${e}&showPublish=true`)
|
|
136
|
-
} : null;
|
|
137
|
-
}).filter(K), [g, m, e, f, c, o, d]), S = ([...p]) => (e !== "production" && u && p.unshift(
|
|
138
|
-
/* @__PURE__ */ t(Ot, { fallback: /* @__PURE__ */ t("div", {}), children: /* @__PURE__ */ t(ee, { mode: "production", state: n }) })
|
|
139
|
-
), p);
|
|
140
|
-
return /* @__PURE__ */ N(Dt, { value: { pages: D }, children: [
|
|
141
|
-
/* @__PURE__ */ N(Bt, { children: [
|
|
142
|
-
E && /* @__PURE__ */ t(O, { index: !0, element: /* @__PURE__ */ t(Ft, { to: C("/", x || "", E.slug) }) }),
|
|
143
|
-
c == null ? void 0 : c.map((p) => {
|
|
144
|
-
var v, w, k, L;
|
|
145
|
-
const r = f == null ? void 0 : f[p];
|
|
146
|
-
if (!r || !r.displayTemplateId) return null;
|
|
147
|
-
const j = m[r.displayTemplateId];
|
|
148
|
-
if (!j) return null;
|
|
149
|
-
let R = [];
|
|
150
|
-
if (r.params && r.params.length > 0) {
|
|
151
|
-
const T = wt({
|
|
152
|
-
basePath: r.path,
|
|
153
|
-
params: r.params,
|
|
154
|
-
routeId: r.id,
|
|
155
|
-
paramsOptions: r.paramsOptions,
|
|
156
|
-
currentIndex: 0,
|
|
157
|
-
currentParams: [],
|
|
158
|
-
currentOptionIds: [],
|
|
159
|
-
result: []
|
|
160
|
-
});
|
|
161
|
-
R = T == null ? void 0 : T.map((M) => {
|
|
162
|
-
var F, V, G, W;
|
|
163
|
-
const B = M.paramOptionIds.join("-");
|
|
164
|
-
return /* @__PURE__ */ t(
|
|
165
|
-
O,
|
|
166
|
-
{
|
|
167
|
-
path: C(":projectIdOrSlug?", M.path),
|
|
168
|
-
element: /* @__PURE__ */ t(
|
|
169
|
-
Y,
|
|
170
|
-
{
|
|
171
|
-
mode: e,
|
|
172
|
-
components: h,
|
|
173
|
-
page: j,
|
|
174
|
-
locale: x,
|
|
175
|
-
defaultLocale: y,
|
|
176
|
-
headerAddons: S,
|
|
177
|
-
state: n,
|
|
178
|
-
pageData: (W = (G = (V = (F = r.dataSource) == null ? void 0 : F.pathDataMappings) == null ? void 0 : V[B]) == null ? void 0 : G.dataCache) == null ? void 0 : W[x || y || "en"]
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
},
|
|
182
|
-
B
|
|
183
|
-
);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
return R.push(
|
|
187
|
-
/* @__PURE__ */ t(
|
|
188
|
-
O,
|
|
189
|
-
{
|
|
190
|
-
path: C(":projectIdOrSlug?", r.path),
|
|
191
|
-
element: /* @__PURE__ */ t(
|
|
192
|
-
Y,
|
|
193
|
-
{
|
|
194
|
-
mode: e,
|
|
195
|
-
components: h,
|
|
196
|
-
page: j,
|
|
197
|
-
locale: x,
|
|
198
|
-
defaultLocale: y,
|
|
199
|
-
headerAddons: S,
|
|
200
|
-
state: n,
|
|
201
|
-
pageData: (L = (k = (w = (v = r.dataSource) == null ? void 0 : v.pathDataMappings) == null ? void 0 : w[r.id]) == null ? void 0 : k.dataCache) == null ? void 0 : L[x || y || "en"]
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
},
|
|
205
|
-
r.id
|
|
206
|
-
)
|
|
207
|
-
), R;
|
|
208
|
-
}),
|
|
209
|
-
g.map((p) => {
|
|
210
|
-
const r = m[p];
|
|
211
|
-
return r ? /* @__PURE__ */ t(
|
|
212
|
-
O,
|
|
213
|
-
{
|
|
214
|
-
path: C(":projectIdOrSlug?", r.slug),
|
|
215
|
-
element: /* @__PURE__ */ t(
|
|
216
|
-
H,
|
|
217
|
-
{
|
|
218
|
-
mode: e,
|
|
219
|
-
components: h,
|
|
220
|
-
page: r,
|
|
221
|
-
locale: x,
|
|
222
|
-
defaultLocale: y,
|
|
223
|
-
headerAddons: S
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
},
|
|
227
|
-
r.id
|
|
228
|
-
) : null;
|
|
229
|
-
}),
|
|
230
|
-
I.pages && Object.values(I.pages).map(({ blockletId: p, page: r }) => /* @__PURE__ */ t(
|
|
231
|
-
O,
|
|
232
|
-
{
|
|
233
|
-
path: C("/", `@${p}`, r.slug),
|
|
234
|
-
element: /* @__PURE__ */ t(
|
|
235
|
-
H,
|
|
236
|
-
{
|
|
237
|
-
mode: e,
|
|
238
|
-
components: h,
|
|
239
|
-
page: r,
|
|
240
|
-
locale: x,
|
|
241
|
-
defaultLocale: y,
|
|
242
|
-
headerAddons: S
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
},
|
|
246
|
-
r.id
|
|
247
|
-
)),
|
|
248
|
-
/* @__PURE__ */ t(
|
|
249
|
-
O,
|
|
250
|
-
{
|
|
251
|
-
path: "*",
|
|
252
|
-
element: /* @__PURE__ */ t(_, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ t(
|
|
253
|
-
Z,
|
|
254
|
-
{
|
|
255
|
-
status: 404,
|
|
256
|
-
extra: /* @__PURE__ */ t(dt, { href: "/", children: a("common.back") }),
|
|
257
|
-
sx: {
|
|
258
|
-
bgcolor: "transparent",
|
|
259
|
-
width: "100%",
|
|
260
|
-
height: "100%"
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
) })
|
|
264
|
-
}
|
|
265
|
-
)
|
|
266
|
-
] }),
|
|
267
|
-
e !== "production" && !l && /* @__PURE__ */ t(Kt, { sx: { bgcolor: "info.light" }, children: e }),
|
|
268
|
-
/* @__PURE__ */ t(Qt, {})
|
|
269
|
-
] });
|
|
270
|
-
}
|
|
271
|
-
function Y({
|
|
272
|
-
mode: e,
|
|
273
|
-
pageData: n,
|
|
274
|
-
components: a,
|
|
275
|
-
page: s,
|
|
276
|
-
locale: i,
|
|
277
|
-
defaultLocale: o,
|
|
278
|
-
headerAddons: d,
|
|
279
|
-
state: l
|
|
280
|
-
}) {
|
|
281
|
-
const u = at({
|
|
282
|
-
page: null
|
|
283
|
-
});
|
|
284
|
-
$(() => {
|
|
285
|
-
const m = s || null;
|
|
286
|
-
m ? u.page = A(m) : u.page = null;
|
|
287
|
-
}, [s, JSON.stringify(s), u]);
|
|
288
|
-
const g = lt();
|
|
289
|
-
return $(() => {
|
|
290
|
-
st(n, g.current) || n && u.page && (tt(u.page, l, i, n), g.current = A(n));
|
|
291
|
-
}, [u.page, n, i, l]), u.page ? /* @__PURE__ */ t(
|
|
292
|
-
H,
|
|
293
|
-
{
|
|
294
|
-
mode: e,
|
|
295
|
-
components: a,
|
|
296
|
-
page: u.page,
|
|
297
|
-
locale: i,
|
|
298
|
-
defaultLocale: o,
|
|
299
|
-
headerAddons: d
|
|
300
|
-
}
|
|
301
|
-
) : null;
|
|
302
|
-
}
|
|
303
|
-
function Be({
|
|
304
|
-
mode: e,
|
|
305
|
-
state: n,
|
|
306
|
-
path: a,
|
|
307
|
-
pageData: s
|
|
308
|
-
}) {
|
|
309
|
-
const { t: i, locale: o } = X(), {
|
|
310
|
-
pages: d,
|
|
311
|
-
supportedLocales: l,
|
|
312
|
-
config: { defaultLocale: u },
|
|
313
|
-
resources: g
|
|
314
|
-
} = n, m = Object.values(d).find((h) => (h == null ? void 0 : h.slug) === a), c = Object.values(g.pages || {}).find((h) => h.page.slug === a), f = P(
|
|
315
|
-
() => l != null && l.some((h) => h.locale === o) ? o : void 0,
|
|
316
|
-
[o, l]
|
|
317
|
-
), b = at({
|
|
318
|
-
page: null
|
|
319
|
-
});
|
|
320
|
-
$(() => {
|
|
321
|
-
const h = m || (c == null ? void 0 : c.page) || null;
|
|
322
|
-
h ? b.page = A(h) : b.page = null;
|
|
323
|
-
}, [m, c]);
|
|
324
|
-
const y = lt();
|
|
325
|
-
if ($(() => {
|
|
326
|
-
st(s, y.current) || s && b.page && (tt(b.page, n, f, s), y.current = A(s));
|
|
327
|
-
}, [{}]), !m && !(c != null && c.page))
|
|
328
|
-
return /* @__PURE__ */ t(_, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ t(Z, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ t(dt, { href: "/", children: i("common.back") }) }) });
|
|
329
|
-
const I = Q(n);
|
|
330
|
-
return b.page ? /* @__PURE__ */ t(
|
|
331
|
-
H,
|
|
332
|
-
{
|
|
333
|
-
mode: e,
|
|
334
|
-
components: I,
|
|
335
|
-
page: b.page,
|
|
336
|
-
locale: f,
|
|
337
|
-
defaultLocale: u
|
|
338
|
-
}
|
|
339
|
-
) : null;
|
|
340
|
-
}
|
|
341
|
-
function H({
|
|
342
|
-
mode: e,
|
|
343
|
-
components: n,
|
|
344
|
-
page: a,
|
|
345
|
-
locale: s,
|
|
346
|
-
defaultLocale: i,
|
|
347
|
-
headerAddons: o
|
|
348
|
-
}) {
|
|
349
|
-
var x, z, E, D, S, p, r, j, R;
|
|
350
|
-
const d = vt(), l = ((x = a.locales) == null ? void 0 : x[s]) ?? ((z = a.locales) == null ? void 0 : z[i]) ?? {}, u = l.title || ((E = window.blocklet) == null ? void 0 : E.appName), g = l.description || ((D = window.blocklet) == null ? void 0 : D.appDescription), m = ft(ht(l.image), 540), { logo: c, brand: f, description: b, ...y } = yt(), I = P(
|
|
351
|
-
() => (v) => {
|
|
352
|
-
var k;
|
|
353
|
-
let w = (o == null ? void 0 : o(v)) ?? v;
|
|
354
|
-
return w = ((k = y.addons) == null ? void 0 : k.call(y, w)) ?? w, w;
|
|
355
|
-
},
|
|
356
|
-
[y.addons, o]
|
|
357
|
-
), h = P(
|
|
358
|
-
() => {
|
|
359
|
-
var v;
|
|
360
|
-
return (v = l.header) != null && v.translucent ? ne : mt;
|
|
361
|
-
},
|
|
362
|
-
[(S = l.header) == null ? void 0 : S.translucent]
|
|
363
|
-
);
|
|
364
|
-
return /* @__PURE__ */ N(Lt, { page: a, defaultLocale: i, currentLocale: s, children: [
|
|
365
|
-
/* @__PURE__ */ t(
|
|
366
|
-
et,
|
|
367
|
-
{
|
|
368
|
-
styles: ot`
|
|
369
|
-
body {
|
|
370
|
-
background-color: ${d(
|
|
371
|
-
!l.backgroundColor || l.backgroundColor === "transparent" ? "background.default" : l.backgroundColor
|
|
372
|
-
)} !important;
|
|
373
|
-
}
|
|
374
|
-
`
|
|
375
|
-
}
|
|
376
|
-
),
|
|
377
|
-
/* @__PURE__ */ t(
|
|
378
|
-
h,
|
|
379
|
-
{
|
|
380
|
-
hideNavMenu: !!((p = l.header) != null && p.hideNavMenus),
|
|
381
|
-
translucentTextColor: (r = l.header) == null ? void 0 : r.translucentTextColor,
|
|
382
|
-
...c ? { logo: c } : {},
|
|
383
|
-
...f ? { brand: f } : {},
|
|
384
|
-
...b ? { description: b } : {},
|
|
385
|
-
className: kt(((j = l.header) == null ? void 0 : j.sticky) && "sticky", "page-header"),
|
|
386
|
-
maxWidth: !1,
|
|
387
|
-
addons: I
|
|
388
|
-
}
|
|
389
|
-
),
|
|
390
|
-
/* @__PURE__ */ t($t, {}),
|
|
391
|
-
/* @__PURE__ */ N(Mt, { children: [
|
|
392
|
-
/* @__PURE__ */ t("title", { children: u }),
|
|
393
|
-
/* @__PURE__ */ t("meta", { name: "og:title", content: u }),
|
|
394
|
-
/* @__PURE__ */ t("meta", { name: "og:description", content: g }),
|
|
395
|
-
/* @__PURE__ */ t("meta", { name: "og:image", content: m }),
|
|
396
|
-
/* @__PURE__ */ t("meta", { name: "twitter:image:src", content: m }),
|
|
397
|
-
/* @__PURE__ */ t("meta", { name: "twitter:image", content: m }),
|
|
398
|
-
/* @__PURE__ */ t("meta", { property: "twitter:description", content: g }),
|
|
399
|
-
/* @__PURE__ */ t("meta", { property: "twitter:title", content: u }),
|
|
400
|
-
/* @__PURE__ */ t("meta", { name: "description", content: g })
|
|
401
|
-
] }),
|
|
402
|
-
/* @__PURE__ */ t(
|
|
403
|
-
Ct,
|
|
404
|
-
{
|
|
405
|
-
flexGrow: 1,
|
|
406
|
-
className: "PageView-root",
|
|
407
|
-
sx: {
|
|
408
|
-
// 第一个 .BlockBase-root 的 pt 为 0
|
|
409
|
-
"& .BlockBase-root:first-child": {
|
|
410
|
-
pt: "0 !important"
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
children: a.sectionIds.map((v) => {
|
|
414
|
-
var T, M, B, F;
|
|
415
|
-
const w = a.sections[v];
|
|
416
|
-
if (!w || w.visibility === "hidden") return null;
|
|
417
|
-
const k = (M = (T = a.dataSource) == null ? void 0 : T[v]) == null ? void 0 : M[s], L = ((F = (B = a.dataSource) == null ? void 0 : B[v]) == null ? void 0 : F[i]) ?? {};
|
|
418
|
-
return /* @__PURE__ */ t(
|
|
419
|
-
Nt,
|
|
420
|
-
{
|
|
421
|
-
id: v,
|
|
422
|
-
type: w.component,
|
|
423
|
-
mode: e,
|
|
424
|
-
section: w,
|
|
425
|
-
config: {
|
|
426
|
-
...Tt(k) ? L : k,
|
|
427
|
-
locale: s,
|
|
428
|
-
dev: e === "draft" ? {
|
|
429
|
-
mode: e,
|
|
430
|
-
components: n,
|
|
431
|
-
defaultLocale: i
|
|
432
|
-
} : {
|
|
433
|
-
mode: e,
|
|
434
|
-
defaultLocale: i
|
|
435
|
-
// 用于 fallback 的 locale
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
page: a
|
|
439
|
-
},
|
|
440
|
-
v
|
|
441
|
-
);
|
|
442
|
-
})
|
|
443
|
-
}
|
|
444
|
-
),
|
|
445
|
-
!((R = l.footer) != null && R.hidden) && /* @__PURE__ */ t(Wt, {})
|
|
446
|
-
] });
|
|
447
|
-
}
|
|
448
|
-
const ee = it(() => import("./publish-button-Ds7OBvxV.js")), mt = nt(xt)`
|
|
449
|
-
&.sticky {
|
|
450
|
-
position: sticky;
|
|
451
|
-
top: 0;
|
|
452
|
-
}
|
|
453
|
-
`;
|
|
454
|
-
function oe({ logo: e }) {
|
|
455
|
-
const [n, a] = Et(), s = It((o) => o.breakpoints.down("sm")), { value: i } = ut(() => {
|
|
456
|
-
var l, u;
|
|
457
|
-
const o = new URL(
|
|
458
|
-
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",
|
|
459
|
-
window.location.origin
|
|
460
|
-
);
|
|
461
|
-
o.searchParams.delete("imageFilter"), o.searchParams.delete("f");
|
|
462
|
-
const d = o.toString();
|
|
463
|
-
return new Promise((g) => {
|
|
464
|
-
fetch(d).then((m) => {
|
|
465
|
-
const c = m.headers.get("content-type");
|
|
466
|
-
c != null && c.includes("svg") && m.text().then((f) => {
|
|
467
|
-
a(f), g(null);
|
|
468
|
-
}), g(m.url);
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
}, [s]);
|
|
472
|
-
if (e)
|
|
473
|
-
return e;
|
|
474
|
-
if (n)
|
|
475
|
-
return /* @__PURE__ */ t(_, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Rt.sanitize(n) } });
|
|
476
|
-
if (i) {
|
|
477
|
-
const o = new URL(i);
|
|
478
|
-
o.searchParams.set("imageFilter", "convert"), o.searchParams.set("f", "png"), o.searchParams.set("h", "80");
|
|
479
|
-
const d = o.toString();
|
|
480
|
-
return /* @__PURE__ */ t("img", { src: d, alt: "logo" });
|
|
481
|
-
}
|
|
482
|
-
return null;
|
|
483
|
-
}
|
|
484
|
-
function ne({
|
|
485
|
-
logo: e,
|
|
486
|
-
translucentTextColor: n,
|
|
487
|
-
...a
|
|
488
|
-
}) {
|
|
489
|
-
const i = jt(document.getElementById("app"), (c) => c.top < 1200), o = rt(), d = Math.min((i == null ? void 0 : i.top) ?? 0, 800), l = P(() => {
|
|
490
|
-
let c = Math.min(d / 800, 1), f = "";
|
|
491
|
-
return c > 0.1 ? (c = Math.max(c, 0.6), f = q(o.palette.text.primary, c)) : f = n || "#EEEEEE", {
|
|
492
|
-
backgroundOpacity: c,
|
|
493
|
-
textColor: f,
|
|
494
|
-
isReversed: c < 0.7
|
|
495
|
-
};
|
|
496
|
-
}, [d, 800, o.palette.text.primary, n]), { backgroundOpacity: u, textColor: g, isReversed: m } = l;
|
|
497
|
-
return /* @__PURE__ */ t(
|
|
498
|
-
mt,
|
|
499
|
-
{
|
|
500
|
-
logo: /* @__PURE__ */ t(oe, { logo: e }),
|
|
501
|
-
...a,
|
|
502
|
-
sx: {
|
|
503
|
-
// 基础布局和定位
|
|
504
|
-
position: "fixed !important",
|
|
505
|
-
top: 0,
|
|
506
|
-
left: 0,
|
|
507
|
-
right: 0,
|
|
508
|
-
zIndex: o.zIndex.appBar,
|
|
509
|
-
// 确保在顶层
|
|
510
|
-
backgroundColor: "transparent !important",
|
|
511
|
-
// 主元素始终透明
|
|
512
|
-
// 使用伪元素作为背景层
|
|
513
|
-
"&::before": {
|
|
514
|
-
content: '""',
|
|
515
|
-
position: "absolute",
|
|
516
|
-
top: 0,
|
|
517
|
-
left: 0,
|
|
518
|
-
right: 0,
|
|
519
|
-
bottom: 0,
|
|
520
|
-
zIndex: -1,
|
|
521
|
-
// 置于内容下方
|
|
522
|
-
// 背景样式(颜色和模糊)是固定的
|
|
523
|
-
backgroundColor: q(o.palette.background.default, u),
|
|
524
|
-
backdropFilter: u >= 0.6 ? "blur(10px)" : "blur(0px)",
|
|
525
|
-
// **性能关键**: 只对 opacity 进行动画
|
|
526
|
-
// opacity: backgroundOpacity,
|
|
527
|
-
// 让 CSS 平滑地处理透明度变化
|
|
528
|
-
transition: "backgroundColor 0.3s ease-in-out"
|
|
529
|
-
},
|
|
530
|
-
// --- 文字和图标颜色过渡 ---
|
|
531
|
-
// 直接为 Header 内所有相关元素设置颜色和过渡
|
|
532
|
-
// color: textColor,
|
|
533
|
-
transition: "color 0.3s ease-in-out",
|
|
534
|
-
// 覆盖子组件的颜色,使其继承父级的 `color`
|
|
535
|
-
".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button": {
|
|
536
|
-
color: `${g} !important`
|
|
537
|
-
// 使用 inherit 来同步颜色
|
|
538
|
-
},
|
|
539
|
-
".header-logo": {
|
|
540
|
-
color: `${g} !important`
|
|
541
|
-
},
|
|
542
|
-
"& .navmenu--horizontal": {
|
|
543
|
-
bgcolor: "transparent !important"
|
|
544
|
-
},
|
|
545
|
-
// --- Logo 反色效果 ---
|
|
546
|
-
// filter 也是一个较昂贵的属性,但其影响远小于背景色的重绘
|
|
547
|
-
// 这里的逻辑保持不变,但可以考虑是否有更优的方案(如提供两个颜色的 Logo)
|
|
548
|
-
".header-logo > div": {
|
|
549
|
-
filter: `invert(${m ? 1 : 0})`,
|
|
550
|
-
transition: "filter 0.3s ease-in-out"
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
const dt = nt(St)``;
|
|
557
|
-
export {
|
|
558
|
-
Me as H,
|
|
559
|
-
qt as L,
|
|
560
|
-
U as P,
|
|
561
|
-
ne as T,
|
|
562
|
-
Xt as a,
|
|
563
|
-
Y as b,
|
|
564
|
-
Be as c,
|
|
565
|
-
H as d
|
|
566
|
-
};
|