@blocklet/pages-kit-inner-components 0.6.56 → 0.6.58
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 +1 -1
- package/lib/cjs/chunks/{components-D1oFQM3W.js → components-DLLpFRy5.js} +5 -5
- package/lib/cjs/chunks/{home-CxJudZ-U.js → home-2t0FjInN.js} +2 -2
- package/lib/cjs/chunks/{index-79qE0mDH.js → index-BwUYb5CK.js} +27 -27
- package/lib/cjs/chunks/{publish-button-DrD1Kp9x.js → publish-button-BFUtnsXK.js} +1 -1
- package/lib/cjs/chunks/{site-state-CD14QPqL.js → site-state-BfeN81ZD.js} +1 -1
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +2 -2
- 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/add-component.js +1 -1
- package/lib/es/chunks/{components-6zI6vrkL.js → components-DLwSTd_N.js} +87 -89
- package/lib/es/chunks/{home-wfZyBMVs.js → home-DUJ_lpjz.js} +2 -2
- package/lib/es/chunks/{index-D5PTMZdg.js → index-D06Hm7OJ.js} +401 -405
- package/lib/es/chunks/{publish-button-D7lFOwKk.js → publish-button-CDFjcpWg.js} +2 -2
- package/lib/es/chunks/{site-state-Dta8F9zq.js → site-state-CVKixevr.js} +1 -1
- package/lib/es/components.js +1 -1
- package/lib/es/home.js +2 -2
- package/lib/es/locales.js +24 -6
- package/lib/es/project-html.js +1 -1
- package/lib/es/resources.js +2 -2
- package/lib/es/site-state.js +2 -2
- package/package.json +14 -17
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { memoize as Q, BuiltinModules as
|
|
1
|
+
import { memoize as Q, BuiltinModules as v } from "@blocklet/quickjs";
|
|
2
2
|
import { createHash as z } from "crypto";
|
|
3
3
|
import { promises as g } from "fs";
|
|
4
|
-
import U, { join as
|
|
4
|
+
import U, { join as O } from "path";
|
|
5
5
|
import h from "@blocklet/sdk/lib/config";
|
|
6
6
|
import Z from "lodash/isNil";
|
|
7
7
|
import { getComponentMountPoint as X } from "@blocklet/pages-kit/builtin/utils";
|
|
8
8
|
import { PreloadComponentScriptModule as P } from "@blocklet/pages-kit/types";
|
|
9
|
-
import { BuiltinModules as
|
|
10
|
-
import { componentUMDName as Y, RenderNestedComponent as
|
|
9
|
+
import { BuiltinModules as I } from "@blocklet/pages-kit/utils/builtin";
|
|
10
|
+
import { componentUMDName as Y, RenderNestedComponent as D, mergeComponent as q } from "@blocklet/pages-kit/utils/property";
|
|
11
11
|
import ee from "lodash/isEmpty";
|
|
12
12
|
import { LRUCache as te } from "lru-cache";
|
|
13
13
|
import oe, { Headers as ne } from "node-fetch";
|
|
14
|
-
import { joinURL as
|
|
14
|
+
import { joinURL as _, getQuery as re, withQuery as se, parseURL as R, withHttps as ce } from "ufo";
|
|
15
15
|
import ae from "@blocklet/logger";
|
|
16
16
|
import { isRelativeModule as ie, createBuiltinModuleTransformer as pe } from "@blocklet/pages-kit/utils/typescript/builtin-module-transformer";
|
|
17
17
|
import "@blocklet/sdk/lib/component";
|
|
18
18
|
h.env.mode;
|
|
19
|
-
h.env.OPENAI_API_KEY || process.env.OPENAI_API_KEY;
|
|
20
|
-
h.env.OPENAI_BASE_URL || process.env.OPENAI_BASE_URL;
|
|
21
19
|
h.env.TRANSLATE_ADDITIONAL_PROMPT || process.env.TRANSLATE_ADDITIONAL_PROMPT;
|
|
22
20
|
h.env.PAGE_CONTENT_ADDITIONAL_PROMPT || process.env.PAGE_CONTENT_ADDITIONAL_PROMPT;
|
|
23
21
|
const qe = "image-bin";
|
|
24
22
|
h.env.INIT_TEMPLATE_PATH;
|
|
25
|
-
const et = process.env.DATABASE_URL || U.join(h.env.dataDir, "db/pages-kit.db"),
|
|
26
|
-
const t =
|
|
23
|
+
const et = process.env.DATABASE_URL || U.join(h.env.dataDir, "db/pages-kit.db"), $ = h, tt = () => h.env.tenantMode === "multiple", ot = () => (Z($.env.preferences.multiTenantAllProjectAccessPassports) ? [] : $.env.preferences.multiTenantAllProjectAccessPassports?.split(",")) || [], le = U.join(h.env.dataDir, "fs-memoize-cache"), ue = h.env.FS_MEMOIZE_CACHE_VERSION || "v1.0.0", w = ae("pages-kit"), de = le, me = ue, M = 30 * 24 * 60 * 60 * 1e3, fe = 24 * 60 * 60 * 1e3, H = async (e = "") => {
|
|
24
|
+
const t = O(de, e);
|
|
27
25
|
try {
|
|
28
26
|
if (!(await g.stat(t)).isDirectory())
|
|
29
27
|
throw new Error(`${t} is not a directory`);
|
|
@@ -31,23 +29,23 @@ const et = process.env.DATABASE_URL || U.join(h.env.dataDir, "db/pages-kit.db"),
|
|
|
31
29
|
await g.mkdir(t, { recursive: !0 });
|
|
32
30
|
}
|
|
33
31
|
return t;
|
|
34
|
-
},
|
|
32
|
+
}, k = (e, ...t) => e.keyGenerator ? e.keyGenerator(...t) : JSON.stringify([e.subdir || "", ...t]), he = (e, t) => {
|
|
35
33
|
const o = z("md5").update(t).digest("hex");
|
|
36
|
-
return
|
|
34
|
+
return O(e, `${me}-${o}.json`);
|
|
37
35
|
}, we = async (e = "") => {
|
|
38
|
-
const t = await
|
|
36
|
+
const t = await H(e), o = Date.now();
|
|
39
37
|
try {
|
|
40
38
|
const n = await g.readdir(t);
|
|
41
39
|
await Promise.all(
|
|
42
40
|
n.filter((c) => c.endsWith(".json")).map(async (c) => {
|
|
43
|
-
const r =
|
|
41
|
+
const r = O(t, c);
|
|
44
42
|
try {
|
|
45
43
|
const u = await g.readFile(r, "utf-8"), p = JSON.parse(u);
|
|
46
|
-
p.createdAt && o - p.createdAt >
|
|
44
|
+
p.createdAt && o - p.createdAt > M && await g.unlink(r);
|
|
47
45
|
} catch {
|
|
48
46
|
try {
|
|
49
47
|
const p = await g.stat(r);
|
|
50
|
-
o - p.mtimeMs >
|
|
48
|
+
o - p.mtimeMs > M && await g.unlink(r);
|
|
51
49
|
} catch {
|
|
52
50
|
}
|
|
53
51
|
}
|
|
@@ -64,13 +62,13 @@ const et = process.env.DATABASE_URL || U.join(h.env.dataDir, "db/pages-kit.db"),
|
|
|
64
62
|
e.add(n);
|
|
65
63
|
};
|
|
66
64
|
})();
|
|
67
|
-
function
|
|
65
|
+
function A(e, t) {
|
|
68
66
|
return t.subdir && ge(t.subdir), Q(
|
|
69
67
|
async (...n) => {
|
|
70
|
-
const c = await
|
|
68
|
+
const c = await H(t.subdir || ""), r = k(t, ...n), u = he(c, r);
|
|
71
69
|
try {
|
|
72
70
|
const p = await g.readFile(u, "utf-8"), { value: d, createdAt: l } = JSON.parse(p);
|
|
73
|
-
if (l && Date.now() - l >
|
|
71
|
+
if (l && Date.now() - l > M)
|
|
74
72
|
throw await g.unlink(u).catch(() => {
|
|
75
73
|
}), new Error("Cache expired");
|
|
76
74
|
return d;
|
|
@@ -82,18 +80,18 @@ function O(e, t) {
|
|
|
82
80
|
}
|
|
83
81
|
},
|
|
84
82
|
{
|
|
85
|
-
keyGenerator: (...n) =>
|
|
83
|
+
keyGenerator: (...n) => k(t, ...n),
|
|
86
84
|
lruOptions: t.lruOptions || {
|
|
87
85
|
max: 100,
|
|
88
|
-
ttl:
|
|
86
|
+
ttl: M
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
89
|
);
|
|
92
90
|
}
|
|
93
|
-
const
|
|
91
|
+
const B = async () => await import("typescript"), ye = async () => await import("esbuild"), xe = async () => (await import("postcss")).default, Se = async () => (await import("tailwindcss")).default, Ce = async () => (await import("autoprefixer")).default, Ee = !1, Pe = async (e, { componentId: t }) => {
|
|
94
92
|
const o = `@tailwind components;
|
|
95
93
|
@tailwind utilities;
|
|
96
|
-
`, n = `.CustomComponent_${t}`, c = await
|
|
94
|
+
`, n = `.CustomComponent_${t}`, c = await xe(), r = await Se(), u = await Ce();
|
|
97
95
|
return (await c([
|
|
98
96
|
r({ content: [{ raw: e, extension: "tsx" }] }),
|
|
99
97
|
u({
|
|
@@ -114,9 +112,9 @@ const H = async () => await import("typescript"), ye = async () => await import(
|
|
|
114
112
|
|
|
115
113
|
${e}
|
|
116
114
|
`;
|
|
117
|
-
},
|
|
115
|
+
}, L = A(
|
|
118
116
|
async (e, t) => {
|
|
119
|
-
let o = await
|
|
117
|
+
let o = await B();
|
|
120
118
|
try {
|
|
121
119
|
let n = o.transpileModule(e, {
|
|
122
120
|
compilerOptions: {
|
|
@@ -137,7 +135,7 @@ ${e}
|
|
|
137
135
|
moduleResolution: o.ModuleResolutionKind.Node16
|
|
138
136
|
}
|
|
139
137
|
}).outputText;
|
|
140
|
-
return t.module === P.CJS ? c :
|
|
138
|
+
return t.module === P.CJS ? c : K(t.moduleName, c);
|
|
141
139
|
} catch (n) {
|
|
142
140
|
throw new Error(n);
|
|
143
141
|
} finally {
|
|
@@ -147,12 +145,12 @@ ${e}
|
|
|
147
145
|
{
|
|
148
146
|
subdir: "transpileModule"
|
|
149
147
|
}
|
|
150
|
-
),
|
|
148
|
+
), Me = async (e, t) => {
|
|
151
149
|
let { build: o } = await ye(), n = null;
|
|
152
150
|
try {
|
|
153
151
|
const r = (await o({
|
|
154
152
|
entryPoints: ["index.tsx"],
|
|
155
|
-
external: Object.keys(
|
|
153
|
+
external: Object.keys(I),
|
|
156
154
|
format: "esm",
|
|
157
155
|
target: "esnext",
|
|
158
156
|
bundle: !0,
|
|
@@ -177,7 +175,7 @@ ${e}
|
|
|
177
175
|
})).outputFiles?.[0]?.contents;
|
|
178
176
|
if (!r) throw new Error("Failed to build server code");
|
|
179
177
|
const u = Buffer.from(r).toString();
|
|
180
|
-
return n = await
|
|
178
|
+
return n = await B(), n.transpileModule(u, {
|
|
181
179
|
compilerOptions: { module: n.ModuleKind.ESNext, target: n.ScriptTarget.ES2020 }
|
|
182
180
|
}).outputText;
|
|
183
181
|
} catch (c) {
|
|
@@ -185,18 +183,18 @@ ${e}
|
|
|
185
183
|
} finally {
|
|
186
184
|
o = null, n = null;
|
|
187
185
|
}
|
|
188
|
-
},
|
|
186
|
+
}, be = (e, t) => new RegExp(
|
|
189
187
|
`export\\s+\\{[^}]*(?:\\w+\\s+as\\s+${t}\\b|\\b${t}\\b)[^}]*\\}`,
|
|
190
188
|
"m"
|
|
191
|
-
).test(e) ? e : void 0,
|
|
189
|
+
).test(e) ? e : void 0, J = A(
|
|
192
190
|
async (e, t) => {
|
|
193
|
-
const o = await
|
|
194
|
-
return
|
|
191
|
+
const o = await Me(e, t);
|
|
192
|
+
return be(o, t);
|
|
195
193
|
},
|
|
196
194
|
{
|
|
197
195
|
subdir: "extractExportValueSchema"
|
|
198
196
|
}
|
|
199
|
-
),
|
|
197
|
+
), K = (e, t) => `// GENERATED FILE. DO NOT EDIT.
|
|
200
198
|
var ${e} = async function () {
|
|
201
199
|
|
|
202
200
|
const exports = {};
|
|
@@ -226,26 +224,26 @@ var ${e} = async function () {
|
|
|
226
224
|
const { Sandbox: e } = await import("@blocklet/quickjs");
|
|
227
225
|
return e;
|
|
228
226
|
};
|
|
229
|
-
function
|
|
227
|
+
function ve(e) {
|
|
230
228
|
return e?.type === "react-component";
|
|
231
229
|
}
|
|
232
|
-
const
|
|
230
|
+
const C = new te({
|
|
233
231
|
max: 100,
|
|
234
232
|
ttl: 1e3 * 60 * 60 * 24 * 7
|
|
235
233
|
// default ttl is 7 days
|
|
236
|
-
}),
|
|
234
|
+
}), _e = 60 * 60, F = 10;
|
|
237
235
|
function V(e) {
|
|
238
|
-
w.info("clear preload components cache", { cacheKey: e }),
|
|
236
|
+
w.info("clear preload components cache", { cacheKey: e }), C.delete(e);
|
|
239
237
|
}
|
|
240
238
|
function nt(e) {
|
|
241
|
-
for (const t of
|
|
239
|
+
for (const t of C.keys())
|
|
242
240
|
t.includes(e) && (w.info("clear preload components cache", { cacheKey: t }), V(t));
|
|
243
241
|
}
|
|
244
242
|
function rt(e) {
|
|
245
|
-
for (const t of
|
|
243
|
+
for (const t of C.keys())
|
|
246
244
|
t.includes(e) && (w.info("clear preload components cache", { cacheKey: t }), V(t));
|
|
247
245
|
}
|
|
248
|
-
function
|
|
246
|
+
function Ie({
|
|
249
247
|
mode: e,
|
|
250
248
|
instanceId: t,
|
|
251
249
|
componentId: o,
|
|
@@ -269,17 +267,17 @@ async function st({
|
|
|
269
267
|
const d = (await Promise.all(
|
|
270
268
|
c.map(async (s) => {
|
|
271
269
|
try {
|
|
272
|
-
const a =
|
|
270
|
+
const a = Ie({
|
|
273
271
|
mode: e,
|
|
274
272
|
instanceId: s.id,
|
|
275
273
|
componentId: s.componentId,
|
|
276
274
|
locale: n
|
|
277
275
|
});
|
|
278
|
-
if (e !== "draft" && s.useCache &&
|
|
279
|
-
return w.info(`get preload component from cache: ${a}`),
|
|
280
|
-
const f =
|
|
276
|
+
if (e !== "draft" && s.useCache && C.has(a))
|
|
277
|
+
return w.info(`get preload component from cache: ${a}`), C.get(a);
|
|
278
|
+
const f = b({ state: o, componentId: s.componentId });
|
|
281
279
|
if (!f) return null;
|
|
282
|
-
const S = await
|
|
280
|
+
const S = await Oe({
|
|
283
281
|
req: t,
|
|
284
282
|
state: o,
|
|
285
283
|
componentId: f.id,
|
|
@@ -288,14 +286,14 @@ async function st({
|
|
|
288
286
|
properties: s.properties
|
|
289
287
|
});
|
|
290
288
|
if (!S) return null;
|
|
291
|
-
const
|
|
289
|
+
const E = { instanceId: s.id, preload: S };
|
|
292
290
|
if (e !== "draft" && s.useCache) {
|
|
293
|
-
let
|
|
294
|
-
s.cacheDuration && (
|
|
295
|
-
ttl:
|
|
291
|
+
let x = _e;
|
|
292
|
+
s.cacheDuration && (x = s.cacheDuration), w.info(`set preload component to cache(${x}s): ${a}`), C.set(a, E, {
|
|
293
|
+
ttl: x * 1e3
|
|
296
294
|
});
|
|
297
295
|
}
|
|
298
|
-
return
|
|
296
|
+
return E;
|
|
299
297
|
} catch (a) {
|
|
300
298
|
return w.error(
|
|
301
299
|
"get preload component error",
|
|
@@ -310,22 +308,22 @@ async function st({
|
|
|
310
308
|
async function m() {
|
|
311
309
|
const s = await Promise.all(
|
|
312
310
|
l.map(async (a) => {
|
|
313
|
-
const f = r === P.ESM, S = r === P.UMD_FN,
|
|
311
|
+
const f = r === P.ESM, S = r === P.UMD_FN, E = r === P.CJS, x = f ? "" : Y({ componentId: a.component.id }), N = De(a.component);
|
|
314
312
|
let T = {
|
|
315
313
|
module: r,
|
|
316
314
|
script: "",
|
|
317
|
-
moduleName:
|
|
315
|
+
moduleName: x
|
|
318
316
|
};
|
|
319
317
|
if (N && a.component.renderer?.type === "react-component" && f && a.component.renderer?.script)
|
|
320
318
|
T.script = a.component.renderer?.script;
|
|
321
|
-
else if (N && a.component.renderer?.type === "react-component" && (
|
|
322
|
-
const
|
|
323
|
-
T.script =
|
|
319
|
+
else if (N && a.component.renderer?.type === "react-component" && (E || S) && a.component.renderer?.cjsScript) {
|
|
320
|
+
const j = a.component.renderer.cjsScript;
|
|
321
|
+
T.script = E ? j : K(x, j);
|
|
324
322
|
} else
|
|
325
323
|
T = f ? {
|
|
326
324
|
// ESM
|
|
327
325
|
module: r,
|
|
328
|
-
script: await
|
|
326
|
+
script: await L(a.script, {
|
|
329
327
|
componentId: a.component.id,
|
|
330
328
|
module: r,
|
|
331
329
|
tailwind: e !== "draft"
|
|
@@ -333,13 +331,13 @@ async function st({
|
|
|
333
331
|
} : {
|
|
334
332
|
// CJS OR UMD
|
|
335
333
|
module: r,
|
|
336
|
-
script: await
|
|
334
|
+
script: await L(a.script, {
|
|
337
335
|
componentId: a.component.id,
|
|
338
336
|
module: r,
|
|
339
|
-
moduleName:
|
|
337
|
+
moduleName: x,
|
|
340
338
|
tailwind: e !== "draft"
|
|
341
339
|
}),
|
|
342
|
-
moduleName:
|
|
340
|
+
moduleName: x
|
|
343
341
|
};
|
|
344
342
|
return [a.component.id, { component: a.component, script: T }];
|
|
345
343
|
})
|
|
@@ -357,7 +355,7 @@ async function st({
|
|
|
357
355
|
}))
|
|
358
356
|
};
|
|
359
357
|
}
|
|
360
|
-
async function
|
|
358
|
+
async function Oe({
|
|
361
359
|
req: e,
|
|
362
360
|
state: t,
|
|
363
361
|
componentId: o,
|
|
@@ -365,7 +363,7 @@ async function be({
|
|
|
365
363
|
defaultLocale: c,
|
|
366
364
|
properties: r
|
|
367
365
|
}) {
|
|
368
|
-
const { supportedLocales: u } = t, p =
|
|
366
|
+
const { supportedLocales: u } = t, p = b({ state: t, componentId: o });
|
|
369
367
|
if (!p) return null;
|
|
370
368
|
const d = u.some((m) => m.locale === n) ? n : c;
|
|
371
369
|
if (!d) return null;
|
|
@@ -375,7 +373,7 @@ async function be({
|
|
|
375
373
|
...l
|
|
376
374
|
} : null;
|
|
377
375
|
}
|
|
378
|
-
const
|
|
376
|
+
const Ae = 20;
|
|
379
377
|
async function W({
|
|
380
378
|
req: e,
|
|
381
379
|
depth: t = 0,
|
|
@@ -385,7 +383,7 @@ async function W({
|
|
|
385
383
|
defaultLocale: r,
|
|
386
384
|
properties: u
|
|
387
385
|
}) {
|
|
388
|
-
if (t >
|
|
386
|
+
if (t > Ae) throw new RangeError("max component depth exceeded");
|
|
389
387
|
const p = Ne({ state: o, componentId: n, properties: u, locale: c });
|
|
390
388
|
if (!p) return null;
|
|
391
389
|
const { props: d, component: l } = p, m = {
|
|
@@ -394,14 +392,14 @@ async function W({
|
|
|
394
392
|
props: { ...d }
|
|
395
393
|
};
|
|
396
394
|
try {
|
|
397
|
-
const y =
|
|
395
|
+
const y = ve(l.renderer) ? l.renderer.getServerSideProps : void 0, i = await je({ ...p, req: e, getServerSideProps: y });
|
|
398
396
|
i?.props && Object.assign(m.props, i.props);
|
|
399
397
|
} catch (y) {
|
|
400
398
|
w.error("preload data at server side error", { componentId: n, name: p.component.name }, { error: y });
|
|
401
399
|
}
|
|
402
400
|
return await Promise.all(
|
|
403
401
|
Object.entries(d).map(async ([y, i]) => {
|
|
404
|
-
if (i?.type ===
|
|
402
|
+
if (i?.type === D) {
|
|
405
403
|
const s = await W({
|
|
406
404
|
req: e,
|
|
407
405
|
depth: t + 1,
|
|
@@ -413,7 +411,7 @@ async function W({
|
|
|
413
411
|
});
|
|
414
412
|
s && (Object.assign(m.components, s.components), Object.assign(m.props, {
|
|
415
413
|
[y]: {
|
|
416
|
-
type:
|
|
414
|
+
type: D,
|
|
417
415
|
componentId: i.componentId,
|
|
418
416
|
props: s.props
|
|
419
417
|
}
|
|
@@ -428,25 +426,25 @@ function Ne({
|
|
|
428
426
|
locale: o,
|
|
429
427
|
properties: n
|
|
430
428
|
}) {
|
|
431
|
-
const c =
|
|
429
|
+
const c = b({ state: e, componentId: t });
|
|
432
430
|
if (!c) return null;
|
|
433
431
|
const r = q({
|
|
434
432
|
componentId: t,
|
|
435
|
-
getComponent: (u) =>
|
|
433
|
+
getComponent: (u) => b({ state: e, componentId: u }),
|
|
436
434
|
locale: o,
|
|
437
435
|
defaultLocale: e.config.defaultLocale,
|
|
438
436
|
properties: n
|
|
439
437
|
});
|
|
440
438
|
return r ? { component: c, script: r.script, props: { locale: o, ...r.props } } : null;
|
|
441
439
|
}
|
|
442
|
-
function
|
|
440
|
+
function b({ state: e, componentId: t }) {
|
|
443
441
|
return e.components[t]?.data ?? e.resources.components?.[t]?.component;
|
|
444
442
|
}
|
|
445
443
|
function ct({ state: e, name: t }) {
|
|
446
444
|
const o = t.toLowerCase();
|
|
447
445
|
return Object.values(e.components).find((n) => n.data.name?.toLowerCase() === o)?.data ?? (e.resources.components && Object.values(e.resources.components).find((n) => n.component.name?.toLowerCase() === o))?.component;
|
|
448
446
|
}
|
|
449
|
-
async function
|
|
447
|
+
async function je({
|
|
450
448
|
component: e,
|
|
451
449
|
script: t,
|
|
452
450
|
props: o,
|
|
@@ -455,7 +453,7 @@ async function Re({
|
|
|
455
453
|
}) {
|
|
456
454
|
if (!c && !t?.includes("getServerSideProps"))
|
|
457
455
|
return null;
|
|
458
|
-
const r = c ?? await
|
|
456
|
+
const r = c ?? await J(t, "getServerSideProps");
|
|
459
457
|
if (!r) return null;
|
|
460
458
|
const p = (r.match(/export\s*{\s*(\w+)\s+as\s+getServerSideProps\s*}/) || r.match(/export\s*{\s*getServerSideProps\s*}/))?.[1] || "getServerSideProps", d = new Promise((i) => {
|
|
461
459
|
setTimeout(() => {
|
|
@@ -494,11 +492,11 @@ try {
|
|
|
494
492
|
export { joinURL, withQuery, getQuery, getComponentMountPoint }
|
|
495
493
|
`;
|
|
496
494
|
if (i === "@blocklet/pages-kit/builtin/dayjs")
|
|
497
|
-
return
|
|
498
|
-
if (i in
|
|
499
|
-
return
|
|
500
|
-
if (i in
|
|
501
|
-
const s =
|
|
495
|
+
return v.dayjs;
|
|
496
|
+
if (i in v)
|
|
497
|
+
return v[i];
|
|
498
|
+
if (i in I) {
|
|
499
|
+
const s = I[i];
|
|
502
500
|
return ee(s) ? void 0 : s;
|
|
503
501
|
}
|
|
504
502
|
},
|
|
@@ -517,7 +515,7 @@ try {
|
|
|
517
515
|
}
|
|
518
516
|
},
|
|
519
517
|
getComponentMountPoint: X,
|
|
520
|
-
joinURL:
|
|
518
|
+
joinURL: _,
|
|
521
519
|
withQuery: se,
|
|
522
520
|
getQuery: re,
|
|
523
521
|
window: {
|
|
@@ -530,10 +528,10 @@ try {
|
|
|
530
528
|
{
|
|
531
529
|
// NOTE: IMPORTANT! place location and fetch (has side effect) at the args not global
|
|
532
530
|
// because the global is shared between all runtime and just init once
|
|
533
|
-
location: { href:
|
|
531
|
+
location: { href: _(ce(n.hostname), n.originalUrl) },
|
|
534
532
|
fetch: (i, { ...s } = {}) => {
|
|
535
|
-
const a = typeof i == "string" && i.startsWith("/") ?
|
|
536
|
-
if (typeof a == "string" &&
|
|
533
|
+
const a = typeof i == "string" && i.startsWith("/") ? _(h.env.appUrl, i) : i;
|
|
534
|
+
if (typeof a == "string" && R(a).host === R(h.env.appUrl).host) {
|
|
537
535
|
const f = n.get("cookie");
|
|
538
536
|
if (f) {
|
|
539
537
|
const S = new ne(s.headers);
|
|
@@ -559,11 +557,11 @@ try {
|
|
|
559
557
|
})
|
|
560
558
|
]);
|
|
561
559
|
}
|
|
562
|
-
const at =
|
|
560
|
+
const at = A(
|
|
563
561
|
async (e, t, o, n) => {
|
|
564
562
|
if (!e?.includes(t) && !n)
|
|
565
563
|
return null;
|
|
566
|
-
const c = n ?? await
|
|
564
|
+
const c = n ?? await J(e, t);
|
|
567
565
|
if (c)
|
|
568
566
|
try {
|
|
569
567
|
let r = await G();
|
|
@@ -589,9 +587,9 @@ const at = O(
|
|
|
589
587
|
{
|
|
590
588
|
subdir: "getExportSchemaValueFromCode"
|
|
591
589
|
}
|
|
592
|
-
),
|
|
590
|
+
), De = (e) => !!(e.renderer?.type === "react-component" && e.version && e.version >= 2);
|
|
593
591
|
export {
|
|
594
|
-
|
|
592
|
+
_e as C,
|
|
595
593
|
F as G,
|
|
596
594
|
qe as I,
|
|
597
595
|
ot as a,
|
|
@@ -601,12 +599,12 @@ export {
|
|
|
601
599
|
V as e,
|
|
602
600
|
rt as f,
|
|
603
601
|
st as g,
|
|
604
|
-
|
|
602
|
+
Ie as h,
|
|
605
603
|
tt as i,
|
|
606
|
-
|
|
607
|
-
|
|
604
|
+
Oe as j,
|
|
605
|
+
b as k,
|
|
608
606
|
w as l,
|
|
609
|
-
|
|
607
|
+
A as m,
|
|
610
608
|
ct as n,
|
|
611
|
-
|
|
609
|
+
De as s
|
|
612
610
|
};
|
|
@@ -21,7 +21,7 @@ import { Helmet as Se } from "react-helmet";
|
|
|
21
21
|
import { useSearchParams as Z, Routes as Ce, Route as S, Navigate as Ie, ScrollRestoration as Te } from "react-router-dom";
|
|
22
22
|
import { useAsync as ee } from "react-use";
|
|
23
23
|
import { joinURL as P } from "ufo";
|
|
24
|
-
import { u as Re, S as je, i as D, P as Me, a as Oe, R as Ee, B as Le, b as te, g as Ae } from "./index-
|
|
24
|
+
import { u as Re, S as je, i as D, P as Me, a as Oe, R as Ee, B as Le, b as te, g as Ae } from "./index-D06Hm7OJ.js";
|
|
25
25
|
import Be from "@blocklet/ui-react/lib/Footer";
|
|
26
26
|
import "webfontloader";
|
|
27
27
|
import { u as _e, a as Fe } from "./session-Dx5M-1r2.js";
|
|
@@ -149,7 +149,7 @@ function Ge({ mode: t }) {
|
|
|
149
149
|
}
|
|
150
150
|
return /* @__PURE__ */ e(Ke, { children: ({ state: o }) => /* @__PURE__ */ e(L, { mode: t, state: o }) });
|
|
151
151
|
}
|
|
152
|
-
const qe = X(() => import("./publish-button-
|
|
152
|
+
const qe = X(() => import("./publish-button-CDFjcpWg.js")), Ke = X(() => import("./draft-data-oEuh4Tps.js"));
|
|
153
153
|
function Ye({
|
|
154
154
|
mode: t,
|
|
155
155
|
children: o
|