@nimtech/nimpress 2.6.1 → 2.6.2
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/.claude/skills/nimpress/SKILL.md +1 -1
- package/dist/cli.es.js +493 -471
- package/dist/{plugin-NiTYQgLI.js → plugin-FqF3mcpj.js} +432 -428
- package/dist/plugin.es.js +11 -10
- package/dist/src/cli/view.d.ts +1 -0
- package/dist/src/cli/view.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { readdir as Ut, readFile as ie, writeFile as pe, copyFile as mn, cp as fn, mkdir as Ue } from "node:fs/promises";
|
|
2
|
-
import { existsSync as fe, readFileSync as Oe, statSync as gt, readdirSync as Le, createReadStream as
|
|
3
|
-
import { createRequire as
|
|
4
|
-
import { request as
|
|
5
|
-
import { execFileSync as
|
|
2
|
+
import { existsSync as fe, readFileSync as Oe, statSync as gt, readdirSync as Le, createReadStream as No } from "node:fs";
|
|
3
|
+
import { createRequire as Nn } from "node:module";
|
|
4
|
+
import { request as Io } from "node:http";
|
|
5
|
+
import { execFileSync as Fo } from "node:child_process";
|
|
6
6
|
import { resolve as G, dirname as Y, join as q, basename as Ce, relative as je, extname as Jt, isAbsolute as ke, sep as xe } from "node:path";
|
|
7
|
-
import { createHash as
|
|
7
|
+
import { createHash as In } from "node:crypto";
|
|
8
8
|
import _t from "gray-matter";
|
|
9
|
-
import
|
|
9
|
+
import Fn from "markdown-it";
|
|
10
10
|
import dn from "markdown-it-anchor";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
11
|
+
import Ro from "markdown-it-attrs";
|
|
12
|
+
import Bo from "markdown-it-container";
|
|
13
|
+
import Rn from "markdown-it-deflist";
|
|
14
|
+
import Wo from "markdown-it-footnote";
|
|
15
|
+
import Lo from "markdown-it-task-lists";
|
|
16
16
|
import { z as m } from "zod";
|
|
17
|
-
import { parse as
|
|
18
|
-
import { createHighlighter as
|
|
19
|
-
import { fileURLToPath as
|
|
20
|
-
import { exporter as
|
|
21
|
-
import { n as
|
|
22
|
-
import { loadConfigFromFile as
|
|
17
|
+
import { parse as Bn, stringify as Ho } from "yaml";
|
|
18
|
+
import { createHighlighter as zo } from "shiki";
|
|
19
|
+
import { fileURLToPath as qo, pathToFileURL as hn } from "node:url";
|
|
20
|
+
import { exporter as Uo } from "@dbml/core";
|
|
21
|
+
import { n as Jo, r as Qe, e as yt, b as Bt, p as Wn, c as Gt, d as Vt, g as bt, h as Go, k as Xt, o as Vo, s as Xo, l as Yo, q as Ko, t as Zo, j as we, m as Qo, a as es } from "./typeMembers-CNvE92EX.js";
|
|
22
|
+
import { loadConfigFromFile as ts } from "vite";
|
|
23
23
|
const gn = {
|
|
24
24
|
out: "dist",
|
|
25
25
|
cache: "node_modules/.nimpress",
|
|
@@ -52,7 +52,7 @@ const gn = {
|
|
|
52
52
|
route: `/${gn.modules}`,
|
|
53
53
|
systems: {}
|
|
54
54
|
}
|
|
55
|
-
}, ft = ["stock", "glass"],
|
|
55
|
+
}, ft = ["stock", "glass"], ns = [
|
|
56
56
|
"Header",
|
|
57
57
|
"Announce",
|
|
58
58
|
"Footer",
|
|
@@ -89,26 +89,26 @@ const gn = {
|
|
|
89
89
|
function wt(e) {
|
|
90
90
|
return ft.includes(e) ? e : e.replace(/^.*\//, "").replace(/\.css$/, "");
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const os = m.object({
|
|
93
93
|
primary: m.string().optional(),
|
|
94
94
|
primaryHover: m.string().optional()
|
|
95
|
-
}).passthrough(),
|
|
95
|
+
}).passthrough(), ss = m.object({
|
|
96
96
|
title: m.string(),
|
|
97
97
|
url: m.string().optional(),
|
|
98
98
|
description: m.string().optional(),
|
|
99
99
|
ogImage: m.string().optional(),
|
|
100
100
|
twitterSite: m.string().optional(),
|
|
101
101
|
locale: m.string().optional()
|
|
102
|
-
}).passthrough(),
|
|
102
|
+
}).passthrough(), rs = m.object({
|
|
103
103
|
text: m.string(),
|
|
104
104
|
link: m.string(),
|
|
105
105
|
gate: m.string().optional()
|
|
106
|
-
}),
|
|
106
|
+
}), as = m.object({
|
|
107
107
|
title: m.string().optional(),
|
|
108
108
|
tagline: m.string().optional(),
|
|
109
109
|
company: m.string().optional(),
|
|
110
110
|
version: m.string().optional()
|
|
111
|
-
}).passthrough(),
|
|
111
|
+
}).passthrough(), is = m.object({
|
|
112
112
|
name: m.string(),
|
|
113
113
|
framework: m.enum(["vue", "svelte"]),
|
|
114
114
|
source: m.string().optional(),
|
|
@@ -119,11 +119,11 @@ const ns = m.object({
|
|
|
119
119
|
harness: m.string().optional(),
|
|
120
120
|
port: m.number().optional(),
|
|
121
121
|
visibility: m.enum(["visible", "dev-only"]).optional()
|
|
122
|
-
}),
|
|
122
|
+
}), cs = m.object({
|
|
123
123
|
title: m.string().optional(),
|
|
124
124
|
logo: m.string().optional(),
|
|
125
125
|
github: m.string().optional(),
|
|
126
|
-
brand:
|
|
126
|
+
brand: os.optional(),
|
|
127
127
|
footer: m.object({
|
|
128
128
|
text: m.string().optional(),
|
|
129
129
|
copyright: m.string().optional(),
|
|
@@ -153,7 +153,7 @@ const ns = m.object({
|
|
|
153
153
|
icons: m.string().optional(),
|
|
154
154
|
math: m.boolean().optional(),
|
|
155
155
|
tags: m.object({ icons: m.record(m.string()).optional(), map: m.record(m.string()).optional() }).optional(),
|
|
156
|
-
navRoutes: m.array(
|
|
156
|
+
navRoutes: m.array(rs).optional(),
|
|
157
157
|
auth: m.object({
|
|
158
158
|
issuer: m.string(),
|
|
159
159
|
clientId: m.string(),
|
|
@@ -207,7 +207,7 @@ const ns = m.object({
|
|
|
207
207
|
expires: m.string().optional()
|
|
208
208
|
}).passthrough().optional()
|
|
209
209
|
}).passthrough().optional(),
|
|
210
|
-
site:
|
|
210
|
+
site: ss.optional(),
|
|
211
211
|
base: m.string().optional(),
|
|
212
212
|
contentDir: m.string().optional(),
|
|
213
213
|
assetsDir: m.string().optional(),
|
|
@@ -222,20 +222,20 @@ const ns = m.object({
|
|
|
222
222
|
exclude: m.array(m.string()).optional(),
|
|
223
223
|
defaultFrontmatter: m.record(m.unknown()).optional(),
|
|
224
224
|
defaultFrontmatterExclude: m.array(m.string()).optional(),
|
|
225
|
-
banner: m.union([
|
|
225
|
+
banner: m.union([as, m.literal(!1)]).optional(),
|
|
226
226
|
theme: m.string().optional(),
|
|
227
227
|
themes: m.array(m.string()).optional(),
|
|
228
|
-
components: m.record(m.enum(
|
|
228
|
+
components: m.record(m.enum(ns), m.string()).optional(),
|
|
229
229
|
css: m.union([m.string(), m.array(m.string())]).optional(),
|
|
230
230
|
vite: m.record(m.unknown()).optional(),
|
|
231
231
|
pageTypes: m.record(m.string()).optional(),
|
|
232
|
-
modules: m.array(
|
|
232
|
+
modules: m.array(is).optional()
|
|
233
233
|
}).passthrough();
|
|
234
234
|
function _n(e, t) {
|
|
235
|
-
const n =
|
|
235
|
+
const n = cs.safeParse(e);
|
|
236
236
|
return n.success ? n.data : (console.warn(`[nimpress] invalid config in ${t}: ${n.error.message}`), {});
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const ls = ["nimpress.config.ts", "nimpress.config.js", "nimpress.config.mjs", "nimpress.config.json"];
|
|
239
239
|
function yn(e) {
|
|
240
240
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
241
241
|
}
|
|
@@ -249,23 +249,23 @@ function Wt(e, t) {
|
|
|
249
249
|
}
|
|
250
250
|
return n;
|
|
251
251
|
}
|
|
252
|
-
async function
|
|
253
|
-
for (const t of
|
|
252
|
+
async function ps(e) {
|
|
253
|
+
for (const t of ls) {
|
|
254
254
|
const n = G(e, t);
|
|
255
255
|
if (!fe(n)) continue;
|
|
256
256
|
if (t.endsWith(".json")) {
|
|
257
257
|
const r = JSON.parse(Oe(n, "utf-8"));
|
|
258
258
|
return { config: _n(r, n), file: n };
|
|
259
259
|
}
|
|
260
|
-
const s = (await
|
|
260
|
+
const s = (await ts({ command: "serve", mode: "development" }, n, e))?.config ?? {};
|
|
261
261
|
return { config: _n(s, n), file: n };
|
|
262
262
|
}
|
|
263
263
|
return null;
|
|
264
264
|
}
|
|
265
|
-
async function
|
|
266
|
-
const n = await
|
|
265
|
+
async function us(e, t) {
|
|
266
|
+
const n = await ps(e), o = n?.config ? { ...n.config, modules: void 0 } : void 0, s = t ? { ...t, modules: void 0 } : void 0;
|
|
267
267
|
let r = Wt(Ye, o);
|
|
268
|
-
r = Wt(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base =
|
|
268
|
+
r = Wt(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Jo(r.base);
|
|
269
269
|
const i = t?.modules ?? n?.config?.modules;
|
|
270
270
|
return r.modules = {
|
|
271
271
|
dir: Ye.modules.dir,
|
|
@@ -273,7 +273,7 @@ async function ps(e, t) {
|
|
|
273
273
|
systems: i ? Object.fromEntries(i.map((c) => [c.name, c])) : {}
|
|
274
274
|
}, { resolved: r, configFile: n?.file ?? null };
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function ms(e) {
|
|
277
277
|
return {
|
|
278
278
|
title: e.title,
|
|
279
279
|
logo: e.logo,
|
|
@@ -301,7 +301,7 @@ function us(e) {
|
|
|
301
301
|
function vt(e) {
|
|
302
302
|
return Array.from(/* @__PURE__ */ new Set([...e.themes, e.theme]));
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function fs(e) {
|
|
305
305
|
function t(o, s) {
|
|
306
306
|
const r = o.pos, i = o.src.charCodeAt(r);
|
|
307
307
|
if (s || i !== 61)
|
|
@@ -360,8 +360,8 @@ function ms(e) {
|
|
|
360
360
|
r[s] && r[s].delimiters && n(o, r[s].delimiters);
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
363
|
+
const ds = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
|
|
364
|
+
function hs(e, t) {
|
|
365
365
|
const n = e.posMax, o = e.pos;
|
|
366
366
|
if (e.src.charCodeAt(o) !== 126 || t || o + 2 >= n)
|
|
367
367
|
return !1;
|
|
@@ -383,15 +383,15 @@ function ds(e, t) {
|
|
|
383
383
|
const i = e.push("sub_open", "sub", 1);
|
|
384
384
|
i.markup = "~";
|
|
385
385
|
const c = e.push("text", "", 0);
|
|
386
|
-
c.content = r.replace(
|
|
386
|
+
c.content = r.replace(ds, "$1");
|
|
387
387
|
const u = e.push("sub_close", "sub", -1);
|
|
388
388
|
return u.markup = "~", e.pos = e.posMax + 1, e.posMax = n, !0;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
e.inline.ruler.after("emphasis", "sub",
|
|
390
|
+
function gs(e) {
|
|
391
|
+
e.inline.ruler.after("emphasis", "sub", hs);
|
|
392
392
|
}
|
|
393
|
-
const
|
|
394
|
-
function
|
|
393
|
+
const _s = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
|
|
394
|
+
function ys(e, t) {
|
|
395
395
|
const n = e.posMax, o = e.pos;
|
|
396
396
|
if (e.src.charCodeAt(o) !== 94 || t || o + 2 >= n)
|
|
397
397
|
return !1;
|
|
@@ -413,17 +413,17 @@ function _s(e, t) {
|
|
|
413
413
|
const i = e.push("sup_open", "sup", 1);
|
|
414
414
|
i.markup = "^";
|
|
415
415
|
const c = e.push("text", "", 0);
|
|
416
|
-
c.content = r.replace(
|
|
416
|
+
c.content = r.replace(_s, "$1");
|
|
417
417
|
const u = e.push("sup_close", "sup", -1);
|
|
418
418
|
return u.markup = "^", e.pos = e.posMax + 1, e.posMax = n, !0;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
e.inline.ruler.after("emphasis", "sup",
|
|
420
|
+
function bs(e) {
|
|
421
|
+
e.inline.ruler.after("emphasis", "sup", ys);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function ws(e, t) {
|
|
424
424
|
return e[t].content;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function vs(e, t, n, o, s) {
|
|
427
427
|
const r = e.utils.arrayReplaceAt, i = e.utils.lib.ucmicro, c = new RegExp([i.Z.source, i.P.source, i.Cc.source].join("|"));
|
|
428
428
|
function u(h, g, w) {
|
|
429
429
|
let P = 0;
|
|
@@ -464,17 +464,17 @@ function ws(e, t, n, o, s) {
|
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function ks(e) {
|
|
468
468
|
return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function $s(e) {
|
|
471
471
|
let t = e.defs;
|
|
472
472
|
e.enabled.length && (t = Object.keys(t).reduce((c, u) => (e.enabled.indexOf(u) >= 0 && (c[u] = t[u]), c), {}));
|
|
473
473
|
const n = Object.keys(e.shortcuts).reduce((c, u) => t[u] ? Array.isArray(e.shortcuts[u]) ? (e.shortcuts[u].forEach((h) => {
|
|
474
474
|
c[h] = u;
|
|
475
475
|
}), c) : (c[e.shortcuts[u]] = u, c) : c, {}), o = Object.keys(t);
|
|
476
476
|
let s;
|
|
477
|
-
o.length === 0 ? s = "^$" : s = o.map((c) => `:${c}:`).concat(Object.keys(n)).sort().reverse().map((c) =>
|
|
477
|
+
o.length === 0 ? s = "^$" : s = o.map((c) => `:${c}:`).concat(Object.keys(n)).sort().reverse().map((c) => ks(c)).join("|");
|
|
478
478
|
const r = RegExp(s), i = RegExp(s, "g");
|
|
479
479
|
return {
|
|
480
480
|
defs: t,
|
|
@@ -483,19 +483,19 @@ function ks(e) {
|
|
|
483
483
|
replaceRE: i
|
|
484
484
|
};
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
const o =
|
|
486
|
+
function xs(e, t) {
|
|
487
|
+
const o = $s(Object.assign({}, {
|
|
488
488
|
defs: {},
|
|
489
489
|
shortcuts: {},
|
|
490
490
|
enabled: []
|
|
491
491
|
}, t || {}));
|
|
492
|
-
e.renderer.rules.emoji =
|
|
492
|
+
e.renderer.rules.emoji = ws, e.core.ruler.after(
|
|
493
493
|
"linkify",
|
|
494
494
|
"emoji",
|
|
495
|
-
|
|
495
|
+
vs(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
|
|
496
496
|
);
|
|
497
497
|
}
|
|
498
|
-
const
|
|
498
|
+
const Ss = {
|
|
499
499
|
angry: [">:(", ">:-("],
|
|
500
500
|
blush: [':")', ':-")'],
|
|
501
501
|
broken_heart: ["</3", "<\\3"],
|
|
@@ -523,7 +523,7 @@ const xs = {
|
|
|
523
523
|
sweat_smile: [",:)", ",:-)"],
|
|
524
524
|
unamused: [":s", ":-S", ":z", ":-Z", ":$", ":-$"],
|
|
525
525
|
wink: [";)", ";-)"]
|
|
526
|
-
},
|
|
526
|
+
}, js = {
|
|
527
527
|
100: "💯",
|
|
528
528
|
1234: "🔢",
|
|
529
529
|
grinning: "😀",
|
|
@@ -2428,15 +2428,15 @@ const xs = {
|
|
|
2428
2428
|
scotland: "🏴",
|
|
2429
2429
|
wales: "🏴"
|
|
2430
2430
|
};
|
|
2431
|
-
function
|
|
2431
|
+
function Ps(e, t) {
|
|
2432
2432
|
const o = Object.assign({}, {
|
|
2433
|
-
defs:
|
|
2434
|
-
shortcuts:
|
|
2433
|
+
defs: js,
|
|
2434
|
+
shortcuts: Ss,
|
|
2435
2435
|
enabled: []
|
|
2436
2436
|
}, t || {});
|
|
2437
|
-
|
|
2437
|
+
xs(e, o);
|
|
2438
2438
|
}
|
|
2439
|
-
const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m",
|
|
2439
|
+
const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m", Ln = "\x1B[38;2;204;120;92m", Ae = "\x1B[38;2;229;174;156m", Me = "\x1B[38;2;160;160;170m", at = [
|
|
2440
2440
|
" ███╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗ ███████╗ ███████╗",
|
|
2441
2441
|
" ████╗ ██║ ██║ ████╗ ████║ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔════╝ ██╔════╝",
|
|
2442
2442
|
" ██╔██╗ ██║ ██║ ██╔████╔██║ ██████╔╝ ██████╔╝ █████╗ ███████╗ ███████╗",
|
|
@@ -2444,19 +2444,19 @@ const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m", Hn = "\x1B[38;2;204;120;92
|
|
|
2444
2444
|
" ██║ ╚████║ ██║ ██║ ╚═╝ ██║ ██║ ██║ ██║ ███████╗ ███████║ ███████║",
|
|
2445
2445
|
" ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ ╚══════╝"
|
|
2446
2446
|
], Ve = 60;
|
|
2447
|
-
function
|
|
2447
|
+
function As(e, t) {
|
|
2448
2448
|
const n = e.replace(/\x1b\[[0-9;]*m/g, ""), o = Math.max(0, t - n.length);
|
|
2449
2449
|
return e + " ".repeat(o);
|
|
2450
2450
|
}
|
|
2451
|
-
function
|
|
2451
|
+
function Es(e) {
|
|
2452
2452
|
const t = "╔" + "═".repeat(Ve + 2) + "╗", n = "╠" + "═".repeat(Ve + 2) + "╣", o = "╚" + "═".repeat(Ve + 2) + "╝", s = [t];
|
|
2453
2453
|
for (let r = 0; r < e.length; r++)
|
|
2454
|
-
s.push("║ " +
|
|
2454
|
+
s.push("║ " + As(e[r], Ve) + " ║"), r < e.length - 1 && s.push(n);
|
|
2455
2455
|
return s.push(o), s;
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function Cs() {
|
|
2458
2458
|
try {
|
|
2459
|
-
const e = Y(
|
|
2459
|
+
const e = Y(qo(import.meta.url)), t = [
|
|
2460
2460
|
G(e, "package.json"),
|
|
2461
2461
|
G(e, "..", "package.json"),
|
|
2462
2462
|
G(e, "..", "..", "package.json")
|
|
@@ -2471,10 +2471,10 @@ function Es() {
|
|
|
2471
2471
|
}
|
|
2472
2472
|
return "";
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2475
|
-
const t = e.title ?? "Nimpress", n = e.tagline ?? "Docs framework on Svelte", o = e.company ?? `Samna® ${(/* @__PURE__ */ new Date()).getFullYear()}`, s = e.version ?? "dev", r = e.localUrl ?? "http://localhost:5173/", i = e.networkUrl ?? "use --host to expose", c = typeof e.duration == "number" ? `ready in ${e.duration} ms` : "ready", u = e.nimpressVersion ??
|
|
2474
|
+
function Os(e = {}) {
|
|
2475
|
+
const t = e.title ?? "Nimpress", n = e.tagline ?? "Docs framework on Svelte", o = e.company ?? `Samna® ${(/* @__PURE__ */ new Date()).getFullYear()}`, s = e.version ?? "dev", r = e.localUrl ?? "http://localhost:5173/", i = e.networkUrl ?? "use --host to expose", c = typeof e.duration == "number" ? `ready in ${e.duration} ms` : "ready", u = e.nimpressVersion ?? Cs(), h = [];
|
|
2476
2476
|
h.push("");
|
|
2477
|
-
for (const v of at) h.push(
|
|
2477
|
+
for (const v of at) h.push(Ln + v + ce);
|
|
2478
2478
|
h.push("");
|
|
2479
2479
|
const g = [
|
|
2480
2480
|
`${kt}${t}${ce}${Me} · ${o}${ce}`,
|
|
@@ -2482,12 +2482,12 @@ function Cs(e = {}) {
|
|
|
2482
2482
|
`${Ae}Version${ce} ${s} ${Ae}${c}${ce}`
|
|
2483
2483
|
];
|
|
2484
2484
|
u && g.push(`${Ae}Nimpress${ce} ${u}`), g.push(`${Ae}➜${ce} Local ${kt}${r}${ce}`), g.push(`${Ae}➜${ce} Network ${dt}${i}${ce}`);
|
|
2485
|
-
const w =
|
|
2485
|
+
const w = Es(g), P = at[0].length, A = at[0].length - at[0].trimStart().length, T = Ve + 4, d = " ".repeat(Math.max(0, Math.floor((P + A - T) / 2)));
|
|
2486
2486
|
for (const v of w) h.push(d + v);
|
|
2487
2487
|
return h.push(""), h.join(`
|
|
2488
2488
|
`);
|
|
2489
2489
|
}
|
|
2490
|
-
function
|
|
2490
|
+
function Ds() {
|
|
2491
2491
|
try {
|
|
2492
2492
|
const e = Oe(G(process.cwd(), "package.json"), "utf-8"), t = JSON.parse(e);
|
|
2493
2493
|
return { name: t.name, version: t.version };
|
|
@@ -2495,10 +2495,10 @@ function Os() {
|
|
|
2495
2495
|
return {};
|
|
2496
2496
|
}
|
|
2497
2497
|
}
|
|
2498
|
-
const
|
|
2498
|
+
const Ts = 27, Ms = 14, Ns = 16, Is = 20, Fs = 17, Rs = 14, Hn = 110, Bs = 60, Ws = 120, Ke = 40, Ls = 200, Hs = 420, zs = 24, qs = 7.6, Us = 6.6, zn = 7.4, Js = 5.4, Gs = 5.8, Vs = 6.2, Xs = 34, Ys = 48, bn = 8, Ks = 260, Zs = 18, Qs = 6.2, er = 30, wn = 24, vn = 24;
|
|
2499
2499
|
class Yt extends Error {
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function tr(e) {
|
|
2502
2502
|
const t = e?.diags;
|
|
2503
2503
|
return Array.isArray(t) && t.length ? t.map((n) => {
|
|
2504
2504
|
const o = n.location, s = o?.start?.line, r = o?.start?.column;
|
|
@@ -2506,23 +2506,23 @@ function er(e) {
|
|
|
2506
2506
|
}).join(`
|
|
2507
2507
|
`) : e instanceof Error ? e.message : String(e);
|
|
2508
2508
|
}
|
|
2509
|
-
function
|
|
2509
|
+
function nr(e) {
|
|
2510
2510
|
try {
|
|
2511
|
-
return JSON.parse(
|
|
2511
|
+
return JSON.parse(Uo.export(e, "json"));
|
|
2512
2512
|
} catch (t) {
|
|
2513
|
-
throw new Yt(
|
|
2513
|
+
throw new Yt(tr(t));
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function or(e) {
|
|
2517
2517
|
return (e.type?.type_name ?? "").trim();
|
|
2518
2518
|
}
|
|
2519
|
-
function
|
|
2519
|
+
function sr(e) {
|
|
2520
2520
|
const t = e.dbdefault;
|
|
2521
2521
|
return !t || t.value === void 0 || t.value === null ? "" : String(t.value);
|
|
2522
2522
|
}
|
|
2523
|
-
const
|
|
2524
|
-
function
|
|
2525
|
-
const t = String(e ?? "").trim(), n =
|
|
2523
|
+
const rr = /\[([^\]]+)\]\(([^)\s]+)\)/;
|
|
2524
|
+
function ar(e) {
|
|
2525
|
+
const t = String(e ?? "").trim(), n = rr.exec(t);
|
|
2526
2526
|
return n ? {
|
|
2527
2527
|
note: t.replace(n[0], "").replace(/\s{2,}/g, " ").trim(),
|
|
2528
2528
|
label: n[1].trim(),
|
|
@@ -2538,36 +2538,36 @@ function ht(e, t, n) {
|
|
|
2538
2538
|
function Et(e) {
|
|
2539
2539
|
return e.reduce((t, n) => Math.max(t, n.length), 0);
|
|
2540
2540
|
}
|
|
2541
|
-
function
|
|
2542
|
-
const n = Et(t.map((u) => u.name)) *
|
|
2543
|
-
return Math.min(
|
|
2541
|
+
function ir(e, t) {
|
|
2542
|
+
const n = Et(t.map((u) => u.name)) * qs, o = Et(t.map((u) => u.type)) * Us, s = Et(t.map((u) => u.linkLabel)) * Vs, r = t.some((u) => u.pk || u.fk) ? Xs : 0, i = Math.round(n + o + s + r + Ys), c = Math.round(e.length * zn + 32);
|
|
2543
|
+
return Math.min(Hs, Math.max(Ls, i, c));
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2546
|
-
const t = e.width -
|
|
2547
|
-
(u, h) => u + ht(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`,
|
|
2545
|
+
function cr(e) {
|
|
2546
|
+
const t = e.width - zs, n = Math.max(1, ht(e.name, zn, t)), o = ht(e.note, Js, t), s = Is + n * Fs + o * Rs, r = Math.max(e.columns.length, 1) * Ts, i = e.indexes.reduce(
|
|
2547
|
+
(u, h) => u + ht(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`, Gs, t),
|
|
2548
2548
|
0
|
|
2549
|
-
), c = e.indexes.length ?
|
|
2549
|
+
), c = e.indexes.length ? Ns + i * Ms : 0;
|
|
2550
2550
|
return Math.round(s + r + c + 2);
|
|
2551
2551
|
}
|
|
2552
|
-
function
|
|
2553
|
-
const t = e.width - wn, n = ht(e.body,
|
|
2554
|
-
return Math.round(wn + o + Math.max(1, n) *
|
|
2552
|
+
function lr(e) {
|
|
2553
|
+
const t = e.width - wn, n = ht(e.body, Qs, t), o = e.title ? er : 0;
|
|
2554
|
+
return Math.round(wn + o + Math.max(1, n) * Zs);
|
|
2555
2555
|
}
|
|
2556
|
-
function
|
|
2556
|
+
function pr(e, t, n) {
|
|
2557
2557
|
return e.x < t.x + t.width + n && t.x < e.x + e.width + n && e.y < t.y + t.height + n && t.y < e.y + e.height + n;
|
|
2558
2558
|
}
|
|
2559
|
-
function
|
|
2559
|
+
function ur(e, t) {
|
|
2560
2560
|
const n = [...e].sort((o, s) => o.y - s.y || o.x - s.x);
|
|
2561
2561
|
for (let o = 1; o < n.length; o++) {
|
|
2562
2562
|
let s = !0, r = 0;
|
|
2563
2563
|
for (; s && r < n.length; ) {
|
|
2564
2564
|
s = !1, r += 1;
|
|
2565
2565
|
for (let i = 0; i < o; i++)
|
|
2566
|
-
|
|
2566
|
+
pr(n[o], n[i], t) && (n[o].y = n[i].y + n[i].height + t, s = !0);
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
2569
|
}
|
|
2570
|
-
function
|
|
2570
|
+
function mr(e, t) {
|
|
2571
2571
|
const n = /* @__PURE__ */ new Map();
|
|
2572
2572
|
for (const c of e) n.set(c.id, /* @__PURE__ */ new Set());
|
|
2573
2573
|
for (const [c, u] of t)
|
|
@@ -2591,7 +2591,7 @@ function ur(e, t) {
|
|
|
2591
2591
|
}
|
|
2592
2592
|
return r;
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function fr(e, t) {
|
|
2595
2595
|
const n = new Set(e.map((h) => h.id)), o = /* @__PURE__ */ new Map();
|
|
2596
2596
|
for (const h of e) o.set(h.id, /* @__PURE__ */ new Set());
|
|
2597
2597
|
for (const [h, g] of t)
|
|
@@ -2617,24 +2617,24 @@ function mr(e, t) {
|
|
|
2617
2617
|
}
|
|
2618
2618
|
return u;
|
|
2619
2619
|
}
|
|
2620
|
-
function
|
|
2620
|
+
function dr(e, t) {
|
|
2621
2621
|
const n = [];
|
|
2622
2622
|
let o = Ke;
|
|
2623
|
-
for (const s of
|
|
2623
|
+
for (const s of mr(e, t)) {
|
|
2624
2624
|
let r = Ke, i = o;
|
|
2625
|
-
for (const c of
|
|
2625
|
+
for (const c of fr(s, t)) {
|
|
2626
2626
|
const u = Math.max(...c.map((g) => g.width));
|
|
2627
2627
|
let h = o;
|
|
2628
2628
|
for (const g of c)
|
|
2629
|
-
g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height +
|
|
2630
|
-
r += u +
|
|
2629
|
+
g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height + Bs, i = Math.max(i, g.y + g.height), n.push(g);
|
|
2630
|
+
r += u + Hn;
|
|
2631
2631
|
}
|
|
2632
|
-
o = i +
|
|
2632
|
+
o = i + Ws;
|
|
2633
2633
|
}
|
|
2634
2634
|
return n;
|
|
2635
2635
|
}
|
|
2636
|
-
function
|
|
2637
|
-
const t =
|
|
2636
|
+
function hr(e) {
|
|
2637
|
+
const t = nr(e), n = Object.values(t.database)[0], o = /* @__PURE__ */ new Map(), s = [];
|
|
2638
2638
|
for (const x of Object.values(t.schemas).sort((E, I) => E.id - I.id))
|
|
2639
2639
|
for (const E of x.tableIds)
|
|
2640
2640
|
s.push(E), o.set(E, x.name);
|
|
@@ -2658,12 +2658,12 @@ function dr(e) {
|
|
|
2658
2658
|
E.fieldIds.forEach((ge) => {
|
|
2659
2659
|
const oe = t.fields[String(ge)];
|
|
2660
2660
|
if (!oe) return;
|
|
2661
|
-
const de = !!oe.pk || r.has(oe.id), be =
|
|
2661
|
+
const de = !!oe.pk || r.has(oe.id), be = ar(oe.note ?? "");
|
|
2662
2662
|
h.set(oe.id, re.length), g.set(oe.id, K), re.push({
|
|
2663
2663
|
name: oe.name,
|
|
2664
|
-
type:
|
|
2664
|
+
type: or(oe),
|
|
2665
2665
|
note: be.note,
|
|
2666
|
-
default:
|
|
2666
|
+
default: sr(oe),
|
|
2667
2667
|
pk: de,
|
|
2668
2668
|
fk: !1,
|
|
2669
2669
|
unique: !!oe.unique,
|
|
@@ -2694,10 +2694,10 @@ function dr(e) {
|
|
|
2694
2694
|
indexes: he,
|
|
2695
2695
|
x: 0,
|
|
2696
2696
|
y: 0,
|
|
2697
|
-
width:
|
|
2697
|
+
width: ir(H, re),
|
|
2698
2698
|
height: 0
|
|
2699
2699
|
};
|
|
2700
|
-
te.height =
|
|
2700
|
+
te.height = cr(te), i.push(te), c.set(K, te), u.set(E.name, K), u.set(H, K);
|
|
2701
2701
|
}
|
|
2702
2702
|
for (const x of i)
|
|
2703
2703
|
for (const E of x.columns) {
|
|
@@ -2729,12 +2729,12 @@ function dr(e) {
|
|
|
2729
2729
|
});
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
2732
|
-
const P =
|
|
2732
|
+
const P = dr(
|
|
2733
2733
|
i,
|
|
2734
2734
|
w.map((x) => [x.parent, x.child])
|
|
2735
2735
|
), A = P.length ? P : i, T = [], d = A.reduce((x, E) => Math.max(x, E.x + E.width), Ke);
|
|
2736
2736
|
let v = Ke;
|
|
2737
|
-
const D = d + Ke +
|
|
2737
|
+
const D = d + Ke + Hn;
|
|
2738
2738
|
for (const x of Object.values(t.notes).sort((E, I) => E.id - I.id)) {
|
|
2739
2739
|
const E = String(x.content ?? "").trim();
|
|
2740
2740
|
if (!E) continue;
|
|
@@ -2744,12 +2744,12 @@ function dr(e) {
|
|
|
2744
2744
|
body: E,
|
|
2745
2745
|
x: D,
|
|
2746
2746
|
y: v,
|
|
2747
|
-
width:
|
|
2747
|
+
width: Ks,
|
|
2748
2748
|
height: 0
|
|
2749
2749
|
};
|
|
2750
|
-
I.height =
|
|
2750
|
+
I.height = lr(I), T.push(I), v += I.height + vn;
|
|
2751
2751
|
}
|
|
2752
|
-
|
|
2752
|
+
ur([...A, ...T], vn);
|
|
2753
2753
|
const R = [];
|
|
2754
2754
|
for (const x of w) {
|
|
2755
2755
|
const E = c.get(x.parent), I = c.get(x.child);
|
|
@@ -2771,10 +2771,10 @@ function dr(e) {
|
|
|
2771
2771
|
notes: T
|
|
2772
2772
|
};
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2775
|
-
return JSON.stringify(
|
|
2774
|
+
function qn(e) {
|
|
2775
|
+
return JSON.stringify(hr(e));
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2777
|
+
function gr(e, t, n = "") {
|
|
2778
2778
|
const o = e.match(/<script[^>]*\bsetup\b[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = e.match(/<template>([\s\S]*)<\/template>/)?.[1] ?? "", r = `${o}
|
|
2779
2779
|
${n}`;
|
|
2780
2780
|
let i = null;
|
|
@@ -2789,7 +2789,7 @@ ${n}`;
|
|
|
2789
2789
|
if (h)
|
|
2790
2790
|
for (const d of Bt(h[1])) {
|
|
2791
2791
|
const v = d.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
|
|
2792
|
-
v && u.set(v[1],
|
|
2792
|
+
v && u.set(v[1], Wn(v[2]));
|
|
2793
2793
|
}
|
|
2794
2794
|
const g = [];
|
|
2795
2795
|
if (i)
|
|
@@ -2807,7 +2807,7 @@ ${n}`;
|
|
|
2807
2807
|
D.bindable = !0;
|
|
2808
2808
|
const R = o.slice(0, d.index).match(/\/\*\*((?:[^*]|\*(?!\/))*)\*\/\s*(?:const|let)\s+[\w$]+\s*=\s*$/);
|
|
2809
2809
|
if (R) {
|
|
2810
|
-
const x =
|
|
2810
|
+
const x = Go(R[1].replace(/^\s*\*\s?/gm, "").trim());
|
|
2811
2811
|
x.description && (D.description = x.description), x.mock && !D.mock && (D.mock = x.mock);
|
|
2812
2812
|
}
|
|
2813
2813
|
g.push(D);
|
|
@@ -2835,7 +2835,7 @@ ${n}`;
|
|
|
2835
2835
|
(d.bindable || A.includes(`update:${d.name}`)) && (d.bindable = !0, A.includes(`update:${d.name}`) || A.push(`update:${d.name}`));
|
|
2836
2836
|
return { component: t, props: g, slots: w, emits: A };
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function _r(e, t, n = "") {
|
|
2839
2839
|
const o = e.match(/<script[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = `${o}
|
|
2840
2840
|
${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$props\(\)/), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
2841
2841
|
if (r)
|
|
@@ -2843,7 +2843,7 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
|
|
|
2843
2843
|
const T = A.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
|
|
2844
2844
|
if (!T) continue;
|
|
2845
2845
|
const d = T[2].trim().match(/^\$bindable\(([\s\S]*)\)$/);
|
|
2846
|
-
d && c.add(T[1]), i.set(T[1],
|
|
2846
|
+
d && c.add(T[1]), i.set(T[1], Wn(d ? d[1] : T[2]));
|
|
2847
2847
|
}
|
|
2848
2848
|
let u = null;
|
|
2849
2849
|
const h = r?.[2]?.trim();
|
|
@@ -2882,7 +2882,7 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
|
|
|
2882
2882
|
}
|
|
2883
2883
|
return { component: t, props: g, slots: w, emits: P };
|
|
2884
2884
|
}
|
|
2885
|
-
function
|
|
2885
|
+
function Un(e, t = []) {
|
|
2886
2886
|
let n;
|
|
2887
2887
|
try {
|
|
2888
2888
|
n = Le(e, { withFileTypes: !0 });
|
|
@@ -2893,12 +2893,12 @@ function Jn(e, t = []) {
|
|
|
2893
2893
|
const s = q(e, o.name);
|
|
2894
2894
|
if (o.isDirectory()) {
|
|
2895
2895
|
if (o.name === "node_modules") continue;
|
|
2896
|
-
|
|
2896
|
+
Un(s, t);
|
|
2897
2897
|
} else o.isFile() && o.name.endsWith(".d.ts") && t.push(s);
|
|
2898
2898
|
}
|
|
2899
2899
|
return t;
|
|
2900
2900
|
}
|
|
2901
|
-
function
|
|
2901
|
+
function yr(e, t, n) {
|
|
2902
2902
|
const o = q(e, "node_modules", t);
|
|
2903
2903
|
if (!fe(o) || !gt(o).isDirectory()) return null;
|
|
2904
2904
|
const s = [
|
|
@@ -2906,14 +2906,14 @@ function _r(e, t, n) {
|
|
|
2906
2906
|
`${n}.svelte.d.ts`,
|
|
2907
2907
|
`${n}.d.ts`,
|
|
2908
2908
|
`${n.toLowerCase()}/index.d.ts`
|
|
2909
|
-
], r =
|
|
2909
|
+
], r = Un(o);
|
|
2910
2910
|
for (const i of s) {
|
|
2911
2911
|
const c = r.find((u) => u.endsWith(`/${i}`));
|
|
2912
2912
|
if (c) return c;
|
|
2913
2913
|
}
|
|
2914
2914
|
return null;
|
|
2915
2915
|
}
|
|
2916
|
-
function
|
|
2916
|
+
function di(e, t) {
|
|
2917
2917
|
const n = yt(e, `${t}Props`) ?? yt(e, "Props");
|
|
2918
2918
|
if (!n) return;
|
|
2919
2919
|
const o = [], s = [], r = [];
|
|
@@ -2950,7 +2950,7 @@ function Ot(e, t) {
|
|
|
2950
2950
|
const s = Qe(e, o + 1);
|
|
2951
2951
|
return e.slice(0, n) + e.slice(o + 1 + s.length + 1);
|
|
2952
2952
|
}
|
|
2953
|
-
function
|
|
2953
|
+
function br(e, t) {
|
|
2954
2954
|
const n = e.match(/^\s*\/\/\s*story:\s*(.+)$/m)?.[1]?.trim(), o = Ot(Ot(e, "props"), "slots"), s = Ct(o, "sidebar"), r = Ot(o, "sidebar"), i = r.match(/\bname\s*:\s*['"]([^'"]+)['"]/)?.[1], c = r.match(/\bdescription\s*:\s*['"]([^'"]+)['"]/)?.[1], u = Ct(e, "props"), h = Ct(e, "slots");
|
|
2955
2955
|
return {
|
|
2956
2956
|
name: n ?? i ?? Ce(t).replace(/\.story\.tsx?$/, "").replace(/_/g, " "),
|
|
@@ -2961,7 +2961,7 @@ function yr(e, t) {
|
|
|
2961
2961
|
sidebar: s
|
|
2962
2962
|
};
|
|
2963
2963
|
}
|
|
2964
|
-
async function
|
|
2964
|
+
async function wr(e) {
|
|
2965
2965
|
let t;
|
|
2966
2966
|
try {
|
|
2967
2967
|
t = await Ut(e, { withFileTypes: !0 });
|
|
@@ -2977,7 +2977,7 @@ async function br(e) {
|
|
|
2977
2977
|
} catch {
|
|
2978
2978
|
continue;
|
|
2979
2979
|
}
|
|
2980
|
-
n.push(
|
|
2980
|
+
n.push(br(s, o.name));
|
|
2981
2981
|
}
|
|
2982
2982
|
return n.sort((o, s) => o.name.localeCompare(s.name)), n;
|
|
2983
2983
|
}
|
|
@@ -2997,7 +2997,7 @@ function $t(e, t, n, o, s) {
|
|
|
2997
2997
|
}
|
|
2998
2998
|
return null;
|
|
2999
2999
|
}
|
|
3000
|
-
async function
|
|
3000
|
+
async function Jn(e, t = []) {
|
|
3001
3001
|
let n;
|
|
3002
3002
|
try {
|
|
3003
3003
|
n = await Ut(e, { withFileTypes: !0 });
|
|
@@ -3008,13 +3008,13 @@ async function Gn(e, t = []) {
|
|
|
3008
3008
|
const s = q(e, o.name);
|
|
3009
3009
|
if (o.isDirectory()) {
|
|
3010
3010
|
if (o.name.startsWith(".") || o.name === "node_modules") continue;
|
|
3011
|
-
await
|
|
3011
|
+
await Jn(s, t);
|
|
3012
3012
|
} else o.isFile() && o.name.endsWith(".md") && t.push(s);
|
|
3013
3013
|
}
|
|
3014
3014
|
return t;
|
|
3015
3015
|
}
|
|
3016
3016
|
async function Kt(e, t) {
|
|
3017
|
-
const n = G(e, t), o = await
|
|
3017
|
+
const n = G(e, t), o = await Jn(n), s = [];
|
|
3018
3018
|
for (const r of o) {
|
|
3019
3019
|
let i;
|
|
3020
3020
|
try {
|
|
@@ -3043,27 +3043,27 @@ function nt(e) {
|
|
|
3043
3043
|
return fe(n) ? { path: n, form: "json" } : null;
|
|
3044
3044
|
}
|
|
3045
3045
|
function ot(e, t) {
|
|
3046
|
-
return t === "yml" ?
|
|
3046
|
+
return t === "yml" ? Bn(e) : JSON.parse(e);
|
|
3047
3047
|
}
|
|
3048
3048
|
function et(e, t) {
|
|
3049
|
-
return t === "yml" ?
|
|
3049
|
+
return t === "yml" ? Ho(e) : JSON.stringify(e, null, 2) + `
|
|
3050
3050
|
`;
|
|
3051
3051
|
}
|
|
3052
3052
|
async function Zt(e, t, n) {
|
|
3053
3053
|
try {
|
|
3054
|
-
return await
|
|
3054
|
+
return await Mr(Y(e), e, t, n);
|
|
3055
3055
|
} catch (o) {
|
|
3056
3056
|
console.warn(`nimpress modules: schema parse failed for ${n}: ${String(o)}`);
|
|
3057
3057
|
return;
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
|
-
const
|
|
3060
|
+
const vr = ["description", "default", "enum", "mock", "format", "minimum", "maximum", "title"], kr = ["type", "tsType", "bindable"];
|
|
3061
3061
|
function Ze(e, t) {
|
|
3062
3062
|
const n = { ...e }, o = n, s = t;
|
|
3063
|
-
for (const r of
|
|
3063
|
+
for (const r of kr)
|
|
3064
3064
|
s[r] !== void 0 && (o[r] = s[r]);
|
|
3065
3065
|
t.type !== void 0 && t.tsType === void 0 && delete n.tsType, t.required !== void 0 && (n.required = t.required);
|
|
3066
|
-
for (const r of
|
|
3066
|
+
for (const r of vr)
|
|
3067
3067
|
o[r] === void 0 && s[r] !== void 0 && (o[r] = s[r]);
|
|
3068
3068
|
if (t.properties) {
|
|
3069
3069
|
const r = {};
|
|
@@ -3098,21 +3098,21 @@ function Qt(e, t) {
|
|
|
3098
3098
|
return { merged: { ...e, ...t, properties: s, slots: r, emits: i }, report: o };
|
|
3099
3099
|
}
|
|
3100
3100
|
const Xe = [], kn = /* @__PURE__ */ new Set();
|
|
3101
|
-
function
|
|
3101
|
+
function $r(e) {
|
|
3102
3102
|
return `${e.component}|${e.kind}|${e.path}`;
|
|
3103
3103
|
}
|
|
3104
3104
|
function $n(e) {
|
|
3105
3105
|
for (const t of e) {
|
|
3106
|
-
const n =
|
|
3106
|
+
const n = $r(t);
|
|
3107
3107
|
kn.has(n) || (kn.add(n), Xe.push(t));
|
|
3108
3108
|
}
|
|
3109
3109
|
}
|
|
3110
|
-
const
|
|
3110
|
+
const xr = {
|
|
3111
3111
|
opaque: "author opaque members in the schema with enum or properties, or type them in the source",
|
|
3112
3112
|
undocumented: "describe them in the schema or above the type member in the source",
|
|
3113
3113
|
orphan: "remove the schema member or restore it in the source"
|
|
3114
3114
|
};
|
|
3115
|
-
function
|
|
3115
|
+
function Sr(e) {
|
|
3116
3116
|
const t = e.match(/^type (.+) is opaque$/);
|
|
3117
3117
|
return t ? `${Me}type${ce} ${t[1]} ${Me}is opaque${ce}` : `${Me}${e}${ce}`;
|
|
3118
3118
|
}
|
|
@@ -3129,14 +3129,14 @@ function Je(e = process.cwd()) {
|
|
|
3129
3129
|
r.push(` ${Ae}${kt}nimpress modules${ce} ${Me}${n} ${o} in ${t.size} ${s}${ce}`), r.push("");
|
|
3130
3130
|
for (const [i, c] of t) {
|
|
3131
3131
|
const u = c.find((w) => w.sourceFile)?.sourceFile;
|
|
3132
|
-
r.push(` ${
|
|
3132
|
+
r.push(` ${Ln}${kt}${i}${ce}${u ? ` ${dt}${je(e, u)}${ce}` : ""}`);
|
|
3133
3133
|
const h = Math.max(...c.map((w) => (w.line ? `L${w.line}` : "·").length)), g = Math.max(...c.map((w) => (w.path || "(component)").length));
|
|
3134
3134
|
for (const w of c) {
|
|
3135
3135
|
const P = (w.line ? `L${w.line}` : "·").padStart(h), A = (w.path || "(component)").padEnd(g);
|
|
3136
|
-
r.push(` ${Me}${P}${ce} ${Ae}${A}${ce} ${
|
|
3136
|
+
r.push(` ${Me}${P}${ce} ${Ae}${A}${ce} ${Sr(w.detail)}`);
|
|
3137
3137
|
}
|
|
3138
3138
|
for (const w of new Set(c.map((P) => P.kind)))
|
|
3139
|
-
r.push(` ${Ae}→${ce} ${dt}${
|
|
3139
|
+
r.push(` ${Ae}→${ce} ${dt}${xr[w]}${ce}`);
|
|
3140
3140
|
r.push(` ${Ae}→${ce} ${dt}then run${ce} nimpress modules update ${i}`), r.push("");
|
|
3141
3141
|
}
|
|
3142
3142
|
console.warn(r.join(`
|
|
@@ -3158,7 +3158,7 @@ function Sn(e, t, n = {}) {
|
|
|
3158
3158
|
const o = [], s = Xt(e, t);
|
|
3159
3159
|
for (const r of s.props.filter((i) => !i.description))
|
|
3160
3160
|
o.push({ component: e, sourceFile: n.sourceFile, line: xn(n.sourceText, r.name), path: r.name, detail: "has no description", kind: "undocumented" });
|
|
3161
|
-
for (const r of
|
|
3161
|
+
for (const r of Vo(s.props))
|
|
3162
3162
|
o.push({ component: e, sourceFile: n.sourceFile, line: xn(n.sourceText, r.path), path: r.path, detail: `type ${r.type} is opaque`, kind: "opaque" });
|
|
3163
3163
|
for (const r of n.report?.missing ?? [])
|
|
3164
3164
|
o.push({ component: e, sourceFile: n.sourceFile, path: r, detail: "has no counterpart in the component source", kind: "orphan" });
|
|
@@ -3166,7 +3166,7 @@ function Sn(e, t, n = {}) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
async function en(e, t, n, o) {
|
|
3168
3168
|
if (!n) return;
|
|
3169
|
-
const s =
|
|
3169
|
+
const s = Xo(t, n.props, n.slots, n.emits), r = o ? await ie(o, "utf-8").catch(() => {
|
|
3170
3170
|
}) : void 0, i = nt(e);
|
|
3171
3171
|
if (!i) {
|
|
3172
3172
|
const P = q(e, "schema.json");
|
|
@@ -3190,20 +3190,20 @@ async function en(e, t, n, o) {
|
|
|
3190
3190
|
$n(Sn(t, h, { sourceFile: o, sourceText: r, report: g }));
|
|
3191
3191
|
}
|
|
3192
3192
|
const jn = /* @__PURE__ */ new Map();
|
|
3193
|
-
async function
|
|
3193
|
+
async function jr(e, t, n, o) {
|
|
3194
3194
|
let s;
|
|
3195
3195
|
try {
|
|
3196
3196
|
s = await ie(n, "utf-8");
|
|
3197
3197
|
} catch {
|
|
3198
3198
|
return;
|
|
3199
3199
|
}
|
|
3200
|
-
const r =
|
|
3200
|
+
const r = In("sha1").update(s).digest("hex");
|
|
3201
3201
|
if (jn.get(n) === r) return;
|
|
3202
3202
|
jn.set(n, r);
|
|
3203
3203
|
const i = await Zt(n, o, t);
|
|
3204
3204
|
i && await en(e, t, i, n);
|
|
3205
3205
|
}
|
|
3206
|
-
async function
|
|
3206
|
+
async function hi(e, t) {
|
|
3207
3207
|
const n = nt(e);
|
|
3208
3208
|
if (!n) {
|
|
3209
3209
|
await pe(q(e, "schema.json"), et(t, "json"));
|
|
@@ -3216,7 +3216,7 @@ function Lt(e) {
|
|
|
3216
3216
|
const t = Jt(e);
|
|
3217
3217
|
return t === ".vue" ? "vue" : t === ".svelte" ? "svelte" : null;
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3219
|
+
function Pr(e, t, n) {
|
|
3220
3220
|
for (const [o, s] of Object.entries(t.modules.systems)) {
|
|
3221
3221
|
if (!s.source) continue;
|
|
3222
3222
|
const r = G(e, s.source);
|
|
@@ -3224,19 +3224,19 @@ function jr(e, t, n) {
|
|
|
3224
3224
|
}
|
|
3225
3225
|
return null;
|
|
3226
3226
|
}
|
|
3227
|
-
function
|
|
3227
|
+
function Ar(e, t, n) {
|
|
3228
3228
|
return e.find((o) => o.system === t && o.component === n);
|
|
3229
3229
|
}
|
|
3230
|
-
async function
|
|
3230
|
+
async function Er(e, t, n) {
|
|
3231
3231
|
const o = await Kt(e, t.contentDir), s = G(e, n);
|
|
3232
3232
|
if ((n.includes("/") || n.includes("\\")) && fe(s)) {
|
|
3233
3233
|
const h = Lt(s);
|
|
3234
3234
|
if (!h)
|
|
3235
3235
|
throw new Error(`[nimpress] modules: ${n} is not a .vue or .svelte component file`);
|
|
3236
|
-
const g = Ce(s, Jt(s)), w =
|
|
3236
|
+
const g = Ce(s, Jt(s)), w = Pr(e, t, s);
|
|
3237
3237
|
if (!w)
|
|
3238
3238
|
throw new Error(`[nimpress] modules: ${n} sits under no configured system source`);
|
|
3239
|
-
const P =
|
|
3239
|
+
const P = Ar(o, w, g);
|
|
3240
3240
|
if (!P)
|
|
3241
3241
|
throw new Error(
|
|
3242
3242
|
`[nimpress] modules: no component page found for ${w}/${g}, run nimpress modules create ${w} ${g} first`
|
|
@@ -3264,17 +3264,17 @@ async function Ar(e, t, n) {
|
|
|
3264
3264
|
pageDir: Y(i.pageFile)
|
|
3265
3265
|
};
|
|
3266
3266
|
}
|
|
3267
|
-
async function
|
|
3268
|
-
const o = await
|
|
3267
|
+
async function Cr(e, t, n) {
|
|
3268
|
+
const o = await Er(e, t, n), s = await Zt(o.componentFile, o.framework, o.component);
|
|
3269
3269
|
if (!s)
|
|
3270
3270
|
throw new Error(`[nimpress] modules: schema parse produced nothing for ${o.component}`);
|
|
3271
3271
|
await en(o.pageDir, o.component, s);
|
|
3272
3272
|
const r = nt(o.pageDir);
|
|
3273
3273
|
return je(e, r?.path ?? q(o.pageDir, "schema.json"));
|
|
3274
3274
|
}
|
|
3275
|
-
async function
|
|
3275
|
+
async function gi(e, t, n = {}) {
|
|
3276
3276
|
if (n.ref)
|
|
3277
|
-
return await
|
|
3277
|
+
return await Cr(e, t, n.ref), 1;
|
|
3278
3278
|
const o = await Kt(e, t.contentDir);
|
|
3279
3279
|
let s = 0;
|
|
3280
3280
|
for (const r of o) {
|
|
@@ -3289,7 +3289,7 @@ async function hi(e, t, n = {}) {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
return s;
|
|
3291
3291
|
}
|
|
3292
|
-
function
|
|
3292
|
+
function Or(e) {
|
|
3293
3293
|
let t = e;
|
|
3294
3294
|
for (let n = 0; n < 8; n++) {
|
|
3295
3295
|
if (t.endsWith("/src")) return t;
|
|
@@ -3303,8 +3303,8 @@ function Pn(e, t) {
|
|
|
3303
3303
|
return !e.endsWith(".vue") && !e.endsWith(".svelte") ? t : [...t.matchAll(/<script[^>]*>([\s\S]*?)<\/script>/g)].map((n) => n[1]).join(`
|
|
3304
3304
|
`);
|
|
3305
3305
|
}
|
|
3306
|
-
async function
|
|
3307
|
-
const o =
|
|
3306
|
+
async function Dr(e, t, n) {
|
|
3307
|
+
const o = Or(e), s = /* @__PURE__ */ new Set([G(t)]), r = [{ file: t, text: n, depth: 0 }];
|
|
3308
3308
|
let i = "";
|
|
3309
3309
|
for (; r.length; ) {
|
|
3310
3310
|
const c = r.shift();
|
|
@@ -3314,7 +3314,7 @@ async function Or(e, t, n) {
|
|
|
3314
3314
|
const g = h[1];
|
|
3315
3315
|
let w = null;
|
|
3316
3316
|
if (g.startsWith(".") ? w = G(Y(c.file), g) : g.startsWith("@/") && o && (w = G(o, g.slice(2))), !w || !ke(w)) continue;
|
|
3317
|
-
const A = [w, `${w}.ts`, `${w}.vue`, q(w, "index.ts")].find((v) =>
|
|
3317
|
+
const A = [w, `${w}.ts`, `${w}.vue`, q(w, "index.ts")].find((v) => Tr(v));
|
|
3318
3318
|
if (!A) continue;
|
|
3319
3319
|
const T = G(A);
|
|
3320
3320
|
if (s.has(T) || s.size > 50) continue;
|
|
@@ -3326,36 +3326,36 @@ async function Or(e, t, n) {
|
|
|
3326
3326
|
}
|
|
3327
3327
|
return i;
|
|
3328
3328
|
}
|
|
3329
|
-
function
|
|
3329
|
+
function Tr(e) {
|
|
3330
3330
|
try {
|
|
3331
3331
|
return gt(e).isFile();
|
|
3332
3332
|
} catch {
|
|
3333
3333
|
return !1;
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
|
-
async function
|
|
3336
|
+
async function Mr(e, t, n, o) {
|
|
3337
3337
|
const s = await ie(t, "utf-8");
|
|
3338
3338
|
let r = "";
|
|
3339
3339
|
for (const c of Le(e))
|
|
3340
3340
|
c.endsWith(".ts") && (c.endsWith(".stories.ts") || c.endsWith(".story.ts") || (r += await ie(q(e, c), "utf-8"), r += `
|
|
3341
3341
|
`));
|
|
3342
|
-
r += await
|
|
3343
|
-
const i = n === "vue" ?
|
|
3342
|
+
r += await Dr(e, t, s);
|
|
3343
|
+
const i = n === "vue" ? gr(s, o, r) : _r(s, o, r);
|
|
3344
3344
|
for (const c of i.props) {
|
|
3345
3345
|
if (!c.format) {
|
|
3346
|
-
const u =
|
|
3346
|
+
const u = Yo(c);
|
|
3347
3347
|
u && (c.format = u);
|
|
3348
3348
|
}
|
|
3349
|
-
c.mock || (c.mock =
|
|
3349
|
+
c.mock || (c.mock = Ko(c.name, Zo(c)));
|
|
3350
3350
|
}
|
|
3351
3351
|
return i;
|
|
3352
3352
|
}
|
|
3353
|
-
async function
|
|
3354
|
-
const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), u = typeof s.file == "string" ? s.file : void 0, h = await
|
|
3353
|
+
async function Nr(e) {
|
|
3354
|
+
const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), u = typeof s.file == "string" ? s.file : void 0, h = await wr(Y(o)), g = $t(t, n, i, c, u), w = [];
|
|
3355
3355
|
if (r && g) {
|
|
3356
3356
|
const x = g.componentFile.endsWith(".svelte") ? "svelte" : "vue";
|
|
3357
3357
|
try {
|
|
3358
|
-
await
|
|
3358
|
+
await jr(Y(o), c, g.componentFile, x);
|
|
3359
3359
|
} catch (E) {
|
|
3360
3360
|
console.warn(`nimpress modules: ${i}/${c} schema upsert failed: ${String(E)}`);
|
|
3361
3361
|
}
|
|
@@ -3379,7 +3379,7 @@ async function Mr(e) {
|
|
|
3379
3379
|
else {
|
|
3380
3380
|
const x = typeof s.package == "string" ? s.package : n.systems[i]?.package;
|
|
3381
3381
|
if (x) {
|
|
3382
|
-
const E =
|
|
3382
|
+
const E = yr(t, x, c);
|
|
3383
3383
|
if (E) {
|
|
3384
3384
|
const I = E.replace(/[^/]+$/, "CLAUDE.md");
|
|
3385
3385
|
fe(I) && (T = await ie(I, "utf-8"));
|
|
@@ -3406,16 +3406,16 @@ async function Mr(e) {
|
|
|
3406
3406
|
watchFiles: w
|
|
3407
3407
|
};
|
|
3408
3408
|
}
|
|
3409
|
-
function
|
|
3409
|
+
function Gn(e, t) {
|
|
3410
3410
|
return G(e, t.paths.out);
|
|
3411
3411
|
}
|
|
3412
|
-
function
|
|
3412
|
+
function Vn(e, t, ...n) {
|
|
3413
3413
|
return G(e, t.paths.cache, ...n);
|
|
3414
3414
|
}
|
|
3415
|
-
function
|
|
3415
|
+
function _i(e, t) {
|
|
3416
3416
|
return q(e, t.paths.guarded);
|
|
3417
3417
|
}
|
|
3418
|
-
function
|
|
3418
|
+
function Ir(e) {
|
|
3419
3419
|
const t = /* @__PURE__ */ new Map();
|
|
3420
3420
|
for (const c of Object.values(e))
|
|
3421
3421
|
c.type === "chunk" && t.set(c.fileName, c);
|
|
@@ -3438,12 +3438,12 @@ function Nr(e) {
|
|
|
3438
3438
|
n.get(c) || i(c);
|
|
3439
3439
|
return s;
|
|
3440
3440
|
}
|
|
3441
|
-
function
|
|
3441
|
+
function Xn() {
|
|
3442
3442
|
return {
|
|
3443
3443
|
name: "nimpress:chunk-cycle-guard",
|
|
3444
3444
|
apply: "build",
|
|
3445
3445
|
generateBundle(e, t) {
|
|
3446
|
-
const n =
|
|
3446
|
+
const n = Ir(t);
|
|
3447
3447
|
if (!n.length) return;
|
|
3448
3448
|
const o = n.map((s) => {
|
|
3449
3449
|
const r = s.chunks.join(" -> "), i = s.modules.map((c) => ` ${c}`).join(`
|
|
@@ -3470,7 +3470,7 @@ function tn(e, t) {
|
|
|
3470
3470
|
}
|
|
3471
3471
|
return n;
|
|
3472
3472
|
}
|
|
3473
|
-
async function
|
|
3473
|
+
async function yi(e) {
|
|
3474
3474
|
const { cwd: t, command: n, resolved: o, htmlInput: s } = e, { svelte: r } = await import("@sveltejs/vite-plugin-svelte"), { default: i } = await import("@tailwindcss/vite"), c = {
|
|
3475
3475
|
root: t,
|
|
3476
3476
|
base: o.base,
|
|
@@ -3480,12 +3480,12 @@ async function _i(e) {
|
|
|
3480
3480
|
plugins: [
|
|
3481
3481
|
r({ compilerOptions: { runes: !0, dev: n === "serve" } }),
|
|
3482
3482
|
i(),
|
|
3483
|
-
|
|
3484
|
-
|
|
3483
|
+
Ua({ ...o, modules: Object.values(o.modules.systems) }),
|
|
3484
|
+
Xn()
|
|
3485
3485
|
],
|
|
3486
|
-
cacheDir:
|
|
3486
|
+
cacheDir: Vn(t, o, "site"),
|
|
3487
3487
|
build: {
|
|
3488
|
-
outDir:
|
|
3488
|
+
outDir: Gn(t, o),
|
|
3489
3489
|
emptyOutDir: !0,
|
|
3490
3490
|
target: "es2022",
|
|
3491
3491
|
...s ? { rollupOptions: { input: s } } : {}
|
|
@@ -3493,17 +3493,17 @@ async function _i(e) {
|
|
|
3493
3493
|
};
|
|
3494
3494
|
return tn(c, o.vite);
|
|
3495
3495
|
}
|
|
3496
|
-
const
|
|
3496
|
+
const Fr = 6161, Ht = "virtual:nimpress-harness/";
|
|
3497
3497
|
function zt(e, t) {
|
|
3498
3498
|
const n = e.systems[t]?.port;
|
|
3499
3499
|
if (n) return n;
|
|
3500
3500
|
const o = Object.keys(e.systems).sort();
|
|
3501
|
-
return
|
|
3501
|
+
return Fr + Math.max(0, o.indexOf(t));
|
|
3502
3502
|
}
|
|
3503
|
-
function
|
|
3503
|
+
function Yn(e, t) {
|
|
3504
3504
|
return `${Ht}${e}/${t}/entry`;
|
|
3505
3505
|
}
|
|
3506
|
-
function
|
|
3506
|
+
function Kn() {
|
|
3507
3507
|
return `const params = new URLSearchParams(location.search)
|
|
3508
3508
|
function parseParam(name) {
|
|
3509
3509
|
const raw = params.get(name)
|
|
@@ -3675,7 +3675,7 @@ window.addEventListener('dblclick', (event) => {
|
|
|
3675
3675
|
applyPan()
|
|
3676
3676
|
})`;
|
|
3677
3677
|
}
|
|
3678
|
-
function
|
|
3678
|
+
function Zn(e) {
|
|
3679
3679
|
const t = e.named ? `mod[${JSON.stringify(e.component)}]` : "mod.default ?? mod";
|
|
3680
3680
|
return `let ComponentRef = null
|
|
3681
3681
|
async function ensureComponent() {
|
|
@@ -3686,7 +3686,7 @@ async function ensureComponent() {
|
|
|
3686
3686
|
return ComponentRef
|
|
3687
3687
|
}`;
|
|
3688
3688
|
}
|
|
3689
|
-
function
|
|
3689
|
+
function Qn(e) {
|
|
3690
3690
|
return `const storyLoaders = {
|
|
3691
3691
|
${(e.storyFiles ?? []).map((n) => ` ${JSON.stringify(n.base)}: () => import(${JSON.stringify(n.path)})`).join(`,
|
|
3692
3692
|
`)}
|
|
@@ -3694,21 +3694,21 @@ ${(e.storyFiles ?? []).map((n) => ` ${JSON.stringify(n.base)}: () => import(${J
|
|
|
3694
3694
|
const activeLoader = storyLoaders[params.get('story') ?? '']
|
|
3695
3695
|
const activeStoryDef = activeLoader ? (await activeLoader()).default : null`;
|
|
3696
3696
|
}
|
|
3697
|
-
function
|
|
3697
|
+
function eo(e) {
|
|
3698
3698
|
return e ? `import harnessSetup from ${JSON.stringify(e)}` : "const harnessSetup = null";
|
|
3699
3699
|
}
|
|
3700
|
-
function
|
|
3700
|
+
function Rr(e, t, n, o, s) {
|
|
3701
3701
|
const r = t.map((c) => `import ${JSON.stringify(c)}`).join(`
|
|
3702
3702
|
`), i = o ? `import HarnessOverride from ${JSON.stringify(o)}` : "const HarnessOverride = null";
|
|
3703
3703
|
return `import { createApp, h } from 'vue'
|
|
3704
3704
|
import { DefaultHarness, ComponentStory, createHarnessContext, HARNESS_KEY } from '@nimtech/nimpress/harness/vue'
|
|
3705
3705
|
${r}
|
|
3706
|
-
${
|
|
3706
|
+
${eo(n)}
|
|
3707
3707
|
${i}
|
|
3708
3708
|
|
|
3709
|
-
${
|
|
3710
|
-
${eo(e)}
|
|
3709
|
+
${Kn()}
|
|
3711
3710
|
${Qn(e)}
|
|
3711
|
+
${Zn(e)}
|
|
3712
3712
|
|
|
3713
3713
|
const setupDef = typeof harnessSetup === 'function' ? await harnessSetup() : harnessSetup
|
|
3714
3714
|
const Overlay = setupDef ? (setupDef.companion ?? null) : null
|
|
@@ -3791,18 +3791,18 @@ try {
|
|
|
3791
3791
|
parent.postMessage({ type: 'nimpress:ready' }, '*')
|
|
3792
3792
|
`;
|
|
3793
3793
|
}
|
|
3794
|
-
function
|
|
3794
|
+
function Br(e, t, n, o, s) {
|
|
3795
3795
|
const r = t.map((c) => `import ${JSON.stringify(c)}`).join(`
|
|
3796
3796
|
`), i = o ? `import HarnessOverride from ${JSON.stringify(o)}` : "const HarnessOverride = null";
|
|
3797
3797
|
return `import { mount, createRawSnippet } from 'svelte'
|
|
3798
3798
|
import { DefaultHarness, HarnessRoot, createHarnessContext } from '@nimtech/nimpress/harness/svelte'
|
|
3799
3799
|
${r}
|
|
3800
|
-
${
|
|
3800
|
+
${eo(n)}
|
|
3801
3801
|
${i}
|
|
3802
3802
|
|
|
3803
|
-
${
|
|
3804
|
-
${eo(e)}
|
|
3803
|
+
${Kn()}
|
|
3805
3804
|
${Qn(e)}
|
|
3805
|
+
${Zn(e)}
|
|
3806
3806
|
|
|
3807
3807
|
if (typeof harnessSetup === 'function') await harnessSetup()
|
|
3808
3808
|
|
|
@@ -3858,7 +3858,7 @@ try {
|
|
|
3858
3858
|
parent.postMessage({ type: 'nimpress:ready' }, '*')
|
|
3859
3859
|
`;
|
|
3860
3860
|
}
|
|
3861
|
-
function
|
|
3861
|
+
function Wr(e) {
|
|
3862
3862
|
if (!e.schemaFile || !fe(e.schemaFile)) return {};
|
|
3863
3863
|
let t;
|
|
3864
3864
|
try {
|
|
@@ -3869,14 +3869,14 @@ function Br(e) {
|
|
|
3869
3869
|
const n = Xt(e.component, t), o = {};
|
|
3870
3870
|
for (const s of n.props) {
|
|
3871
3871
|
if (!s.required) continue;
|
|
3872
|
-
const r = s.default !== void 0 ? s.default :
|
|
3872
|
+
const r = s.default !== void 0 ? s.default : Qo(s, 0);
|
|
3873
3873
|
r !== void 0 && (o[s.name] = r);
|
|
3874
3874
|
}
|
|
3875
3875
|
return o;
|
|
3876
3876
|
}
|
|
3877
|
-
function
|
|
3878
|
-
const r =
|
|
3879
|
-
return e === "vue" ?
|
|
3877
|
+
function Lr(e, t, n, o, s) {
|
|
3878
|
+
const r = Wr(t);
|
|
3879
|
+
return e === "vue" ? Rr(t, n, o, s, r) : Br(t, n, o, s, r);
|
|
3880
3880
|
}
|
|
3881
3881
|
function An(e, t, n) {
|
|
3882
3882
|
const o = n.map((s) => ` <link rel="stylesheet" href="${s}" />`).join(`
|
|
@@ -3906,12 +3906,12 @@ ${o ? o + `
|
|
|
3906
3906
|
</html>
|
|
3907
3907
|
`;
|
|
3908
3908
|
}
|
|
3909
|
-
async function
|
|
3909
|
+
async function Hr(e, t) {
|
|
3910
3910
|
if (t === "svelte") {
|
|
3911
3911
|
const { svelte: c } = await import("@sveltejs/vite-plugin-svelte");
|
|
3912
3912
|
return c();
|
|
3913
3913
|
}
|
|
3914
|
-
const n =
|
|
3914
|
+
const n = Nn(q(e, "package.json"));
|
|
3915
3915
|
let o;
|
|
3916
3916
|
try {
|
|
3917
3917
|
o = n.resolve("@vitejs/plugin-vue");
|
|
@@ -3926,13 +3926,13 @@ async function Lr(e, t) {
|
|
|
3926
3926
|
}
|
|
3927
3927
|
return i;
|
|
3928
3928
|
}
|
|
3929
|
-
function
|
|
3929
|
+
function zr(e, t, n, o) {
|
|
3930
3930
|
const s = t.systems[n];
|
|
3931
3931
|
if (!s) return [];
|
|
3932
3932
|
const r = [];
|
|
3933
3933
|
for (const i of o) {
|
|
3934
3934
|
if (i.system !== n) continue;
|
|
3935
|
-
const c =
|
|
3935
|
+
const c = qr(i.pageFile), u = nt(Y(i.pageFile))?.path ?? q(Y(i.pageFile), "schema.json"), h = s.source ? $t(e, t, n, i.component, i.file) : null;
|
|
3936
3936
|
if (h) {
|
|
3937
3937
|
r.push({ component: i.component, importSpec: h.componentFile, storyFiles: c, schemaFile: u });
|
|
3938
3938
|
continue;
|
|
@@ -3946,7 +3946,7 @@ function Hr(e, t, n, o) {
|
|
|
3946
3946
|
}
|
|
3947
3947
|
return r;
|
|
3948
3948
|
}
|
|
3949
|
-
function
|
|
3949
|
+
function qr(e) {
|
|
3950
3950
|
const t = Y(e);
|
|
3951
3951
|
let n;
|
|
3952
3952
|
try {
|
|
@@ -3959,22 +3959,22 @@ function zr(e) {
|
|
|
3959
3959
|
path: q(t, o)
|
|
3960
3960
|
}));
|
|
3961
3961
|
}
|
|
3962
|
-
function
|
|
3962
|
+
function Ur(e, t) {
|
|
3963
3963
|
if (t.setup)
|
|
3964
3964
|
return t.setup.startsWith(".") || ke(t.setup) ? G(e, t.setup) : t.setup;
|
|
3965
3965
|
}
|
|
3966
|
-
function
|
|
3966
|
+
function Jr(e, t) {
|
|
3967
3967
|
if (t.harness)
|
|
3968
3968
|
return t.harness.startsWith(".") || ke(t.harness) ? G(e, t.harness) : t.harness;
|
|
3969
3969
|
}
|
|
3970
|
-
function
|
|
3970
|
+
function Gr(e, t, n, o, s) {
|
|
3971
3971
|
const r = (t.css ?? []).map(
|
|
3972
3972
|
(P) => P.startsWith(".") || ke(P) ? G(e, P) : P
|
|
3973
|
-
), i =
|
|
3973
|
+
), i = Ur(e, t), c = Jr(e, t), u = new Map(o.map((P) => [P.component, P])), h = "\0" + Ht, g = (P) => {
|
|
3974
3974
|
if (!P.startsWith(h)) return null;
|
|
3975
3975
|
const A = P.slice(h.length).split("/");
|
|
3976
3976
|
return A[0] === n && A[1] ? A[1] : null;
|
|
3977
|
-
}, w = (P) =>
|
|
3977
|
+
}, w = (P) => Lr(t.framework, P, r, i, c);
|
|
3978
3978
|
return {
|
|
3979
3979
|
name: "nimpress:harness",
|
|
3980
3980
|
resolveId(P) {
|
|
@@ -4002,7 +4002,7 @@ function Jr(e, t, n, o, s) {
|
|
|
4002
4002
|
return;
|
|
4003
4003
|
}
|
|
4004
4004
|
if (E === "entry.js") {
|
|
4005
|
-
const I = await P.transformRequest(
|
|
4005
|
+
const I = await P.transformRequest(Yn(n, x));
|
|
4006
4006
|
if (!I) return d();
|
|
4007
4007
|
T.statusCode = 200, T.setHeader("Content-Type", "application/javascript"), T.end(I.code);
|
|
4008
4008
|
return;
|
|
@@ -4036,18 +4036,18 @@ function Jr(e, t, n, o, s) {
|
|
|
4036
4036
|
}
|
|
4037
4037
|
};
|
|
4038
4038
|
}
|
|
4039
|
-
async function
|
|
4039
|
+
async function bi(e, t, n, o) {
|
|
4040
4040
|
const s = t.modules, r = s.systems[n];
|
|
4041
4041
|
if (!r) throw new Error(`[nimpress] unknown module system: ${n}`);
|
|
4042
|
-
const i = await Kt(e, t.contentDir), c =
|
|
4042
|
+
const i = await Kt(e, t.contentDir), c = zr(e, s, n, i);
|
|
4043
4043
|
c.length || console.warn(`[nimpress] modules: no component pages found for system ${n}`);
|
|
4044
|
-
const u = await
|
|
4044
|
+
const u = await Hr(e, r.framework), h = r.source ? G(e, r.source) : e, g = s.route.replace(/\/$/, ""), w = `${g}/${n}/`, P = o === "build" ? we(t.base, w) : w, A = c.filter((d) => ke(d.importSpec)).map((d) => d.importSpec).concat(c.flatMap((d) => (d.storyFiles ?? []).map((v) => v.path))), T = {
|
|
4045
4045
|
root: e,
|
|
4046
4046
|
configFile: !1,
|
|
4047
4047
|
publicDir: !1,
|
|
4048
4048
|
appType: "mpa",
|
|
4049
|
-
cacheDir:
|
|
4050
|
-
plugins: [
|
|
4049
|
+
cacheDir: Vn(e, t, "modules", n),
|
|
4050
|
+
plugins: [Gr(e, r, n, c, P), u, Xn()],
|
|
4051
4051
|
resolve: r.framework === "vue" ? { alias: { vue: "vue/dist/vue.esm-bundler.js" } } : void 0,
|
|
4052
4052
|
optimizeDeps: {
|
|
4053
4053
|
entries: A,
|
|
@@ -4065,18 +4065,18 @@ async function yi(e, t, n, o) {
|
|
|
4065
4065
|
}
|
|
4066
4066
|
},
|
|
4067
4067
|
build: {
|
|
4068
|
-
outDir: q(
|
|
4068
|
+
outDir: q(Gn(e, t), g.replace(/^\//, ""), n),
|
|
4069
4069
|
emptyOutDir: !0,
|
|
4070
4070
|
target: "es2022",
|
|
4071
4071
|
rollupOptions: {
|
|
4072
|
-
input: Object.fromEntries(c.map((d) => [d.component,
|
|
4072
|
+
input: Object.fromEntries(c.map((d) => [d.component, Yn(n, d.component)]))
|
|
4073
4073
|
}
|
|
4074
4074
|
},
|
|
4075
4075
|
base: P
|
|
4076
4076
|
};
|
|
4077
4077
|
return tn(T, t.vite);
|
|
4078
4078
|
}
|
|
4079
|
-
function
|
|
4079
|
+
function Vr(e, t = "virtual:nimpress/main") {
|
|
4080
4080
|
const n = e.logo ? `
|
|
4081
4081
|
<link rel="icon" href="${e.logo}" />` : "", o = JSON.stringify(vt(e).map(wt)), s = JSON.stringify(wt(e.theme));
|
|
4082
4082
|
return `<!doctype html>
|
|
@@ -4106,11 +4106,11 @@ function Gr(e, t = "virtual:nimpress/main") {
|
|
|
4106
4106
|
</html>
|
|
4107
4107
|
`;
|
|
4108
4108
|
}
|
|
4109
|
-
const it = "virtual:nimpress/manifest", ct = "virtual:nimpress/search", lt = "virtual:nimpress/pages", pt = "virtual:nimpress/bodies", Dt = "virtual:nimpress/config", Tt = "virtual:nimpress/main", Ge = "virtual:nimpress/page-component/", We = "virtual:nimpress/page-body/", Mt = 20,
|
|
4109
|
+
const it = "virtual:nimpress/manifest", ct = "virtual:nimpress/search", lt = "virtual:nimpress/pages", pt = "virtual:nimpress/bodies", Dt = "virtual:nimpress/config", Tt = "virtual:nimpress/main", Ge = "virtual:nimpress/page-component/", We = "virtual:nimpress/page-body/", Mt = 20, Xr = "https://github.com/nimling/nimpress";
|
|
4110
4110
|
function ye(e) {
|
|
4111
4111
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
4112
4112
|
}
|
|
4113
|
-
function
|
|
4113
|
+
function Yr(e) {
|
|
4114
4114
|
return `<![CDATA[${e.replace(/\]\]>/g, "]]]]><![CDATA[>")}]]>`;
|
|
4115
4115
|
}
|
|
4116
4116
|
function En(e) {
|
|
@@ -4154,15 +4154,15 @@ const Nt = [
|
|
|
4154
4154
|
"DotBot",
|
|
4155
4155
|
"MJ12bot"
|
|
4156
4156
|
];
|
|
4157
|
-
function
|
|
4157
|
+
function Kr(e) {
|
|
4158
4158
|
return `<script type="application/ld+json">${(typeof e == "string" ? e : JSON.stringify(e)).replace(/</g, "\\u003c")}<\/script>`;
|
|
4159
4159
|
}
|
|
4160
|
-
const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidden" || e.visibility === "dev-only", ut = (e) => e.visibility === "dev-only",
|
|
4160
|
+
const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidden" || e.visibility === "dev-only", ut = (e) => e.visibility === "dev-only", Zr = {
|
|
4161
4161
|
milestone: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" x2="4" y1="22" y2="15"/></svg>',
|
|
4162
4162
|
epic: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>',
|
|
4163
4163
|
feature: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></svg>',
|
|
4164
4164
|
bug: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>'
|
|
4165
|
-
},
|
|
4165
|
+
}, Qr = m.object({
|
|
4166
4166
|
title: m.string().optional(),
|
|
4167
4167
|
description: m.string().optional(),
|
|
4168
4168
|
type: m.string().optional(),
|
|
@@ -4171,7 +4171,7 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
|
|
|
4171
4171
|
url: m.string().optional(),
|
|
4172
4172
|
siteName: m.string().optional(),
|
|
4173
4173
|
locale: m.string().optional()
|
|
4174
|
-
}).passthrough(),
|
|
4174
|
+
}).passthrough(), ea = m.object({
|
|
4175
4175
|
card: m.string().optional(),
|
|
4176
4176
|
site: m.string().optional(),
|
|
4177
4177
|
creator: m.string().optional(),
|
|
@@ -4179,7 +4179,7 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
|
|
|
4179
4179
|
description: m.string().optional(),
|
|
4180
4180
|
image: m.string().optional(),
|
|
4181
4181
|
imageAlt: m.string().optional()
|
|
4182
|
-
}).passthrough(),
|
|
4182
|
+
}).passthrough(), ta = m.object({
|
|
4183
4183
|
override: m.boolean().optional(),
|
|
4184
4184
|
ai: m.boolean().optional(),
|
|
4185
4185
|
description: m.string().optional(),
|
|
@@ -4188,10 +4188,10 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
|
|
|
4188
4188
|
keywords: m.union([m.string(), m.array(m.string())]).optional(),
|
|
4189
4189
|
author: m.string().optional(),
|
|
4190
4190
|
themeColor: m.string().optional(),
|
|
4191
|
-
og:
|
|
4192
|
-
twitter:
|
|
4191
|
+
og: Qr.optional(),
|
|
4192
|
+
twitter: ea.optional(),
|
|
4193
4193
|
jsonLd: m.unknown().optional()
|
|
4194
|
-
}).passthrough(),
|
|
4194
|
+
}).passthrough(), to = m.object({
|
|
4195
4195
|
title: m.string().optional(),
|
|
4196
4196
|
slug: m.string().optional(),
|
|
4197
4197
|
type: m.string().optional(),
|
|
@@ -4221,10 +4221,10 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
|
|
|
4221
4221
|
subscribe: m.boolean().optional(),
|
|
4222
4222
|
feedback: m.boolean().optional(),
|
|
4223
4223
|
styles: m.array(m.string()).optional(),
|
|
4224
|
-
meta:
|
|
4224
|
+
meta: ta.optional(),
|
|
4225
4225
|
data: m.record(m.unknown()).optional()
|
|
4226
|
-
}).passthrough(),
|
|
4227
|
-
function
|
|
4226
|
+
}).passthrough(), no = /* @__PURE__ */ new Set(["doc", "openapi", "changelog", "hero", "fullpage", "404", "section", "tags", "glossary", "team", "pricing", "roadmap", "dbml", "milestone", "epic", "feature", "bug", "component"]), Ne = /* @__PURE__ */ new Map();
|
|
4227
|
+
function na(e, t) {
|
|
4228
4228
|
Ne.clear();
|
|
4229
4229
|
for (const [n, o] of Object.entries(t)) {
|
|
4230
4230
|
const s = G(e, o), r = s.replace(/\.svelte$/, ".schema.json");
|
|
@@ -4238,30 +4238,30 @@ function ta(e, t) {
|
|
|
4238
4238
|
Ne.set(n, { file: o, schema: i });
|
|
4239
4239
|
}
|
|
4240
4240
|
}
|
|
4241
|
-
function
|
|
4241
|
+
function oa(e) {
|
|
4242
4242
|
return Array.isArray(e) ? "array" : e === null ? "null" : typeof e;
|
|
4243
4243
|
}
|
|
4244
|
-
function
|
|
4244
|
+
function sa(e, t) {
|
|
4245
4245
|
const n = Ne.get(e)?.schema;
|
|
4246
4246
|
if (!n) return [];
|
|
4247
4247
|
const o = [];
|
|
4248
4248
|
for (const s of n.required ?? [])
|
|
4249
4249
|
t[s] === void 0 && o.push(`type ${e} requires data.${s}`);
|
|
4250
4250
|
for (const [s, r] of Object.entries(n.properties ?? {}))
|
|
4251
|
-
t[s] !== void 0 && r.type &&
|
|
4251
|
+
t[s] !== void 0 && r.type && oa(t[s]) !== r.type && o.push(`type ${e} expects data.${s} to be ${r.type}`);
|
|
4252
4252
|
return o;
|
|
4253
4253
|
}
|
|
4254
|
-
function
|
|
4254
|
+
function oo(e, t = "x") {
|
|
4255
4255
|
const n = [], s = (typeof e == "object" && e !== null ? Object.keys(e) : []).find((h) => h.toLowerCase() === "notoc");
|
|
4256
4256
|
s && n.push(`${s}: write hide: [toc], the hide list carries every element a page drops`);
|
|
4257
|
-
const r =
|
|
4257
|
+
const r = to.safeParse(e);
|
|
4258
4258
|
if (!r.success) {
|
|
4259
4259
|
for (const h of r.error.errors)
|
|
4260
4260
|
n.push(`${h.path.join(".") || "frontmatter"}: ${h.message}`);
|
|
4261
4261
|
return n;
|
|
4262
4262
|
}
|
|
4263
4263
|
const i = r.data;
|
|
4264
|
-
i.type && !
|
|
4264
|
+
i.type && !no.has(i.type) && !Ne.has(i.type) && n.push(`type: ${i.type} is not a page type; add it under pageTypes in the config`);
|
|
4265
4265
|
const c = i.data ?? {};
|
|
4266
4266
|
if (i.link)
|
|
4267
4267
|
return !i.title && !i.sidebar?.name && n.push("a link page needs a title or a sidebar.name for its label"), /^[a-z][a-z0-9+.-]*:\/\/|^mailto:|^tel:/i.test(i.link) || n.push("link: must be an absolute url"), t.trim() !== "" && n.push("a link page carries no body, the entry opens link instead of a page"), n;
|
|
@@ -4272,7 +4272,7 @@ function so(e, t = "x") {
|
|
|
4272
4272
|
const h = c.title === void 0 ? "" : String(c.title);
|
|
4273
4273
|
h.trim() || n.push("changelog requires data.title"), h.length > 48 && n.push("changelog data.title exceeds 48 characters"), h.includes(",") && n.push("changelog data.title must not contain a comma"), c.description !== void 0 && String(c.description).length > 160 && n.push("changelog data.description exceeds 160 characters");
|
|
4274
4274
|
}
|
|
4275
|
-
if ((i.type === "milestone" || i.type === "epic" || i.type === "feature" || i.type === "bug") && (i.description || n.push(`type ${i.type} requires a description`), (c.date === void 0 || Number.isNaN(new Date(String(c.date)).getTime())) && n.push(`type ${i.type} requires a valid data.date`)), i.type && Ne.has(i.type) && n.push(...
|
|
4275
|
+
if ((i.type === "milestone" || i.type === "epic" || i.type === "feature" || i.type === "bug") && (i.description || n.push(`type ${i.type} requires a description`), (c.date === void 0 || Number.isNaN(new Date(String(c.date)).getTime())) && n.push(`type ${i.type} requires a valid data.date`)), i.type && Ne.has(i.type) && n.push(...sa(i.type, c)), i.type === "team") {
|
|
4276
4276
|
const h = Array.isArray(c.members) ? c.members : [];
|
|
4277
4277
|
h.length === 0 && n.push("type team requires data.members with at least one member"), h.forEach((g, w) => {
|
|
4278
4278
|
(typeof g?.name != "string" || !g.name.trim()) && n.push(`type team member ${w + 1} needs a name`);
|
|
@@ -4286,7 +4286,7 @@ function so(e, t = "x") {
|
|
|
4286
4286
|
}
|
|
4287
4287
|
return i.type === "component" && ((c.system === void 0 || String(c.system).trim() === "") && n.push("type component requires data.system"), (c.component === void 0 || String(c.component).trim() === "") && n.push("type component requires data.component")), n;
|
|
4288
4288
|
}
|
|
4289
|
-
function
|
|
4289
|
+
function ra(e, t) {
|
|
4290
4290
|
const n = (u) => {
|
|
4291
4291
|
const h = String(u ?? "").replace(/^v/i, "").replace(/\+.*$/, ""), g = h.indexOf("-");
|
|
4292
4292
|
return {
|
|
@@ -4324,12 +4324,12 @@ function sa(e, t) {
|
|
|
4324
4324
|
}
|
|
4325
4325
|
return 0;
|
|
4326
4326
|
}
|
|
4327
|
-
function
|
|
4327
|
+
function aa(e, t) {
|
|
4328
4328
|
const n = je(e, t).split(xe).join("/");
|
|
4329
4329
|
if (!(!n || n.startsWith("..") || ke(n)))
|
|
4330
4330
|
return `/${n}`;
|
|
4331
4331
|
}
|
|
4332
|
-
function
|
|
4332
|
+
function so(e, t) {
|
|
4333
4333
|
const n = je(e, t).split(xe).join("/");
|
|
4334
4334
|
if (n.startsWith("..") || ke(n))
|
|
4335
4335
|
throw new Error(
|
|
@@ -4347,11 +4347,14 @@ function ia(e) {
|
|
|
4347
4347
|
function ca(e) {
|
|
4348
4348
|
return e ? "/" + e : "/";
|
|
4349
4349
|
}
|
|
4350
|
-
function
|
|
4350
|
+
function ro(e) {
|
|
4351
4351
|
if (!e) return "/";
|
|
4352
4352
|
let t = e.startsWith("/") ? e : "/" + e;
|
|
4353
4353
|
return t.length > 1 && t.endsWith("/") && (t = t.slice(0, -1)), t;
|
|
4354
4354
|
}
|
|
4355
|
+
function la(e, t, n) {
|
|
4356
|
+
return ro(n ?? ca(so(e, t)));
|
|
4357
|
+
}
|
|
4355
4358
|
async function nn(e, t = []) {
|
|
4356
4359
|
let n;
|
|
4357
4360
|
try {
|
|
@@ -4374,7 +4377,7 @@ function Ie(e) {
|
|
|
4374
4377
|
function Ft(e) {
|
|
4375
4378
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
4376
4379
|
}
|
|
4377
|
-
const
|
|
4380
|
+
const Cn = {
|
|
4378
4381
|
ctrl: "Ctrl",
|
|
4379
4382
|
control: "Ctrl",
|
|
4380
4383
|
alt: "Alt",
|
|
@@ -4407,11 +4410,11 @@ const On = {
|
|
|
4407
4410
|
plus: "+",
|
|
4408
4411
|
minus: "−"
|
|
4409
4412
|
};
|
|
4410
|
-
function
|
|
4413
|
+
function pa(e) {
|
|
4411
4414
|
const t = e.trim().toLowerCase();
|
|
4412
|
-
return
|
|
4415
|
+
return Cn[t] ? Cn[t] : t.length === 1 ? t.toUpperCase() : t.charAt(0).toUpperCase() + t.slice(1);
|
|
4413
4416
|
}
|
|
4414
|
-
const
|
|
4417
|
+
const ua = (e, t) => {
|
|
4415
4418
|
const n = e.src, o = e.pos;
|
|
4416
4419
|
if (n.charCodeAt(o) !== 94 || n.charCodeAt(o + 1) !== 94) return !1;
|
|
4417
4420
|
const s = n.indexOf("^^", o + 2);
|
|
@@ -4424,7 +4427,7 @@ const pa = (e, t) => {
|
|
|
4424
4427
|
i.content = r, e.push("ins_close", "ins", -1);
|
|
4425
4428
|
}
|
|
4426
4429
|
return e.pos = s + 2, !0;
|
|
4427
|
-
},
|
|
4430
|
+
}, ma = (e, t) => {
|
|
4428
4431
|
const n = e.src, o = e.pos;
|
|
4429
4432
|
if (n.charCodeAt(o) !== 43 || n.charCodeAt(o + 1) !== 43) return !1;
|
|
4430
4433
|
const s = n.indexOf("++", o + 2);
|
|
@@ -4435,34 +4438,34 @@ const pa = (e, t) => {
|
|
|
4435
4438
|
if (i.length === 0) return !1;
|
|
4436
4439
|
if (!t) {
|
|
4437
4440
|
const c = e.push("html_inline", "", 0);
|
|
4438
|
-
c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(
|
|
4441
|
+
c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(pa(u))}</kbd>`).join('<span class="np-key-join">+</span>')}</span>`;
|
|
4439
4442
|
}
|
|
4440
4443
|
return e.pos = s + 2, !0;
|
|
4441
|
-
},
|
|
4444
|
+
}, fa = (e) => {
|
|
4442
4445
|
const t = e.tokens;
|
|
4443
4446
|
for (let n = 0; n + 2 < t.length; n++) {
|
|
4444
4447
|
if (t[n].type !== "paragraph_open" || t[n + 1].type !== "inline" || t[n + 2].type !== "paragraph_close") continue;
|
|
4445
4448
|
const s = (t[n + 1].children ?? []).filter((r) => !(r.type === "text" && r.content.trim() === ""));
|
|
4446
4449
|
s.length !== 1 || s[0].type !== "image" || !s[0].attrGet("title") || (s[0].meta = { ...s[0].meta ?? {}, figure: !0 }, t[n].tag = "figure", t[n + 2].tag = "figure", t[n].attrJoin("class", "np-figure"));
|
|
4447
4450
|
}
|
|
4448
|
-
},
|
|
4449
|
-
function
|
|
4451
|
+
}, da = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, ha = Nn(import.meta.url);
|
|
4452
|
+
function ga() {
|
|
4450
4453
|
try {
|
|
4451
|
-
return Y(
|
|
4454
|
+
return Y(ha.resolve("lucide-static/icons/a-arrow-down.svg"));
|
|
4452
4455
|
} catch {
|
|
4453
4456
|
return G(process.cwd(), "node_modules", "lucide-static", "icons");
|
|
4454
4457
|
}
|
|
4455
4458
|
}
|
|
4456
|
-
const
|
|
4457
|
-
function
|
|
4458
|
-
const n = `${t ?? ""}:${e}`, o =
|
|
4459
|
+
const On = /* @__PURE__ */ new Map();
|
|
4460
|
+
function ao(e, t) {
|
|
4461
|
+
const n = `${t ?? ""}:${e}`, o = On.get(n);
|
|
4459
4462
|
if (o !== void 0) return o;
|
|
4460
4463
|
let s = null;
|
|
4461
|
-
e.startsWith("lucide-") ? s = q(
|
|
4464
|
+
e.startsWith("lucide-") ? s = q(ga(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
|
|
4462
4465
|
let r = null;
|
|
4463
|
-
return s && fe(s) && (r = Oe(s, "utf8").replace(/<\?xml[^>]*>/g, "").replace(/<!--[\s\S]*?-->/g, "").replace(/\s+(width|height)="[^"]*"/g, "").replace(/<svg/, '<svg aria-hidden="true" focusable="false"').trim()),
|
|
4466
|
+
return s && fe(s) && (r = Oe(s, "utf8").replace(/<\?xml[^>]*>/g, "").replace(/<!--[\s\S]*?-->/g, "").replace(/\s+(width|height)="[^"]*"/g, "").replace(/<svg/, '<svg aria-hidden="true" focusable="false"').trim()), On.set(n, r), r;
|
|
4464
4467
|
}
|
|
4465
|
-
function
|
|
4468
|
+
function _a(e) {
|
|
4466
4469
|
const t = [], n = [];
|
|
4467
4470
|
for (const o of e.trim().split(/\s+/).filter(Boolean))
|
|
4468
4471
|
if (o.startsWith(".")) n.push(o.slice(1));
|
|
@@ -4473,17 +4476,17 @@ function ga(e) {
|
|
|
4473
4476
|
}
|
|
4474
4477
|
return n.length && t.push(["class", n.join(" ")]), t;
|
|
4475
4478
|
}
|
|
4476
|
-
function
|
|
4479
|
+
function ya(e) {
|
|
4477
4480
|
return (t, n) => {
|
|
4478
4481
|
if (t.src.charCodeAt(t.pos) !== 58) return !1;
|
|
4479
|
-
const o =
|
|
4482
|
+
const o = da.exec(t.src.slice(t.pos));
|
|
4480
4483
|
if (!o) return !1;
|
|
4481
|
-
const s = o[1], r =
|
|
4484
|
+
const s = o[1], r = ao(s, e);
|
|
4482
4485
|
if (!r)
|
|
4483
4486
|
return s.startsWith("lucide-") && console.warn(`[nimpress] icon :${s}: is not a lucide icon; the shortcode stays as text`), !1;
|
|
4484
4487
|
let i = t.pos + o[0].length, c = [];
|
|
4485
4488
|
const u = t.src.slice(i), h = /^\{([^}\n]*)\}/.exec(u);
|
|
4486
|
-
if (h && (c =
|
|
4489
|
+
if (h && (c = _a(h[1]), i += h[0].length), !n) {
|
|
4487
4490
|
const g = t.push("np_icon", "span", 0);
|
|
4488
4491
|
g.content = r, g.attrSet("data-icon", s), g.attrJoin("class", "np-icon");
|
|
4489
4492
|
for (const [w, P] of c)
|
|
@@ -4492,10 +4495,10 @@ function _a(e) {
|
|
|
4492
4495
|
return t.pos = i, !0;
|
|
4493
4496
|
};
|
|
4494
4497
|
}
|
|
4495
|
-
function
|
|
4498
|
+
function Dn(e) {
|
|
4496
4499
|
return Buffer.from(e, "utf-8").toString("base64");
|
|
4497
4500
|
}
|
|
4498
|
-
const
|
|
4501
|
+
const ba = (e, t, n, o) => {
|
|
4499
4502
|
const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
|
|
4500
4503
|
if (e.src.slice(s, s + 2) !== "$$") return !1;
|
|
4501
4504
|
const i = e.src.slice(s + 2, r);
|
|
@@ -4525,7 +4528,7 @@ const ya = (e, t, n, o) => {
|
|
|
4525
4528
|
const g = e.push("np_math_block", "div", 0);
|
|
4526
4529
|
return g.content = u.join(`
|
|
4527
4530
|
`).trim(), g.map = [t, c + 1], e.line = c + 1, !0;
|
|
4528
|
-
},
|
|
4531
|
+
}, wa = (e, t) => {
|
|
4529
4532
|
const n = e.src, o = e.pos;
|
|
4530
4533
|
if (n.charCodeAt(o) !== 36 || n.charCodeAt(o + 1) === 36 || o > 0 && n.charCodeAt(o - 1) === 92) return !1;
|
|
4531
4534
|
const s = n.charCodeAt(o + 1);
|
|
@@ -4550,25 +4553,25 @@ const ya = (e, t, n, o) => {
|
|
|
4550
4553
|
u.content = i;
|
|
4551
4554
|
}
|
|
4552
4555
|
return e.pos = r + 1, !0;
|
|
4553
|
-
},
|
|
4556
|
+
}, va = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, ka = (e, t, n, o) => {
|
|
4554
4557
|
const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
|
|
4555
4558
|
if (e.src.charCodeAt(s) !== 42 || e.src.charCodeAt(s + 1) !== 91) return !1;
|
|
4556
|
-
const i =
|
|
4559
|
+
const i = va.exec(e.src.slice(s, r));
|
|
4557
4560
|
if (!i) return !1;
|
|
4558
4561
|
if (o) return !0;
|
|
4559
4562
|
const c = e.env;
|
|
4560
4563
|
return c.abbr = { ...c.abbr ?? {}, [i[1].trim()]: i[2].trim() }, e.line = t + 1, !0;
|
|
4561
4564
|
};
|
|
4562
|
-
function
|
|
4565
|
+
function $a(e) {
|
|
4563
4566
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4564
4567
|
}
|
|
4565
|
-
function
|
|
4568
|
+
function xa(e) {
|
|
4566
4569
|
return (t) => {
|
|
4567
4570
|
const n = t.env, o = /* @__PURE__ */ new Map();
|
|
4568
4571
|
if (!n.glossaryPage) for (const u of e) o.set(u.term, u.description);
|
|
4569
4572
|
for (const [u, h] of Object.entries(n.abbr ?? {})) o.set(u, h);
|
|
4570
4573
|
if (o.size === 0) return;
|
|
4571
|
-
const s = Array.from(o.entries()).sort((u, h) => h[0].length - u[0].length), r = new Map(s.map(([u]) => [u.toLowerCase(), u])), i = new RegExp(`(^|[^\\p{L}\\p{N}_])(${s.map(([u]) =>
|
|
4574
|
+
const s = Array.from(o.entries()).sort((u, h) => h[0].length - u[0].length), r = new Map(s.map(([u]) => [u.toLowerCase(), u])), i = new RegExp(`(^|[^\\p{L}\\p{N}_])(${s.map(([u]) => $a(u)).join("|")})(?![\\p{L}\\p{N}_])`, "iu"), c = t.tokens;
|
|
4572
4575
|
for (let u = 0; u < c.length; u++) {
|
|
4573
4576
|
const h = c[u];
|
|
4574
4577
|
if (h.type !== "inline" || !h.children || c[u - 1]?.type === "heading_open") continue;
|
|
@@ -4614,12 +4617,12 @@ function $a(e) {
|
|
|
4614
4617
|
}
|
|
4615
4618
|
};
|
|
4616
4619
|
}
|
|
4617
|
-
const
|
|
4620
|
+
const Sa = (e) => {
|
|
4618
4621
|
if (!e.env.glossaryPage) return;
|
|
4619
4622
|
const n = e.tokens;
|
|
4620
4623
|
for (let o = 0; o + 1 < n.length; o++)
|
|
4621
4624
|
n[o].type !== "dt_open" || n[o + 1].type !== "inline" || (n[o].attrSet("id", `term-${Ie(n[o + 1].content)}`), n[o].attrJoin("class", "np-glossary-term"));
|
|
4622
|
-
},
|
|
4625
|
+
}, ja = (e) => {
|
|
4623
4626
|
const t = e.tokens, n = /* @__PURE__ */ new Map();
|
|
4624
4627
|
for (let o = 0; o < t.length; o++) {
|
|
4625
4628
|
if (t[o].type !== "footnote_open") continue;
|
|
@@ -4636,7 +4639,7 @@ const xa = (e) => {
|
|
|
4636
4639
|
r && (s.meta = { ...s.meta, tip: r });
|
|
4637
4640
|
}
|
|
4638
4641
|
};
|
|
4639
|
-
function
|
|
4642
|
+
function Pa(e, t) {
|
|
4640
4643
|
const n = e.parse(t, {}), o = [];
|
|
4641
4644
|
let s = "";
|
|
4642
4645
|
for (let r = 0; r + 1 < n.length; r++) {
|
|
@@ -4653,21 +4656,21 @@ function ja(e, t) {
|
|
|
4653
4656
|
}
|
|
4654
4657
|
return o;
|
|
4655
4658
|
}
|
|
4656
|
-
const
|
|
4657
|
-
function
|
|
4659
|
+
const wi = ["prose", "page", "callout", "code", "code-group", "tabs", "cards", "card", "features", "feature", "actions", "action", "hero", "fullpage", "section", "tags", "tag", "footer", "announce", "feedback", "header", "sidebar", "toc", "crumbs", "search", "mermaid", "dbml", "op", "changelog", "roadmap", "team", "pricing", "glossary", "notfound", "math", "icon", "figure", "keys", "lightbox", "abbr", "img", "page-actions"];
|
|
4660
|
+
function Tn(e, t) {
|
|
4658
4661
|
return `@scope (.np-${e}) {
|
|
4659
4662
|
${t}
|
|
4660
4663
|
}`;
|
|
4661
4664
|
}
|
|
4662
|
-
function
|
|
4665
|
+
function Aa(e, t) {
|
|
4663
4666
|
const n = new RegExp(`^${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\.([a-z0-9-]+)\\.css$`).exec(e);
|
|
4664
4667
|
return n ? n[1] : null;
|
|
4665
4668
|
}
|
|
4666
|
-
const
|
|
4669
|
+
const Ea = new Set("a an the and or but if then else of to in on at by for with from as is are was were be been being it its this that these those there here which who whom what when where why how not no yes you your we our they their he she his her them us me my i so do does did done can could should would will shall may might must into over under again more most some any each every all both few own same than too very just also only such other another one two three first last new use used using page pages file files field fields set sets value values see".split(" "));
|
|
4667
4670
|
function Rt(e) {
|
|
4668
|
-
return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !
|
|
4671
|
+
return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !Ea.has(t) && !/^\d+$/.test(t));
|
|
4669
4672
|
}
|
|
4670
|
-
function
|
|
4673
|
+
function Ca(e) {
|
|
4671
4674
|
const t = e.replace(/```[\s\S]*?```/g, "").replace(/^:{3,}.*$/gm, "").replace(/^\s*[#>|-].*$/gm, "").split(/\n\s*\n/).map((s) => s.replace(/\s+/g, " ").trim()).find((s) => s.length > 40 && !s.startsWith("!") && !s.startsWith("<"));
|
|
4672
4675
|
if (!t) return "";
|
|
4673
4676
|
const n = t.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/[*_`~^=]+/g, "");
|
|
@@ -4675,7 +4678,7 @@ function Ea(e) {
|
|
|
4675
4678
|
const o = n.slice(0, 157);
|
|
4676
4679
|
return `${o.slice(0, Math.max(o.lastIndexOf(" "), 100))}…`;
|
|
4677
4680
|
}
|
|
4678
|
-
function
|
|
4681
|
+
function Oa(e) {
|
|
4679
4682
|
const t = /* @__PURE__ */ new Map(), n = e.map((r) => {
|
|
4680
4683
|
const i = /* @__PURE__ */ new Map(), c = (u, h) => {
|
|
4681
4684
|
for (const g of u) i.set(g, (i.get(g) ?? 0) + h);
|
|
@@ -4691,15 +4694,15 @@ function Ca(e) {
|
|
|
4691
4694
|
if (u.length >= 8) break;
|
|
4692
4695
|
u.some((g) => g.toLowerCase() === h.word) || u.push(h.word);
|
|
4693
4696
|
}
|
|
4694
|
-
s.set(r.slug, { keywords: u, description:
|
|
4697
|
+
s.set(r.slug, { keywords: u, description: Ca(r.body) });
|
|
4695
4698
|
}
|
|
4696
4699
|
return s;
|
|
4697
4700
|
}
|
|
4698
|
-
function
|
|
4701
|
+
function Da(e, t, n) {
|
|
4699
4702
|
return n === !1 || t === !1 && n !== !0 ? `${e}, noai, noimageai` : e;
|
|
4700
4703
|
}
|
|
4701
|
-
function
|
|
4702
|
-
const s = new
|
|
4704
|
+
function Mn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
|
|
4705
|
+
const s = new Fn({
|
|
4703
4706
|
html: !0,
|
|
4704
4707
|
linkify: !0,
|
|
4705
4708
|
typographer: !1,
|
|
@@ -4710,13 +4713,13 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
|
|
|
4710
4713
|
zsh: "bash",
|
|
4711
4714
|
console: "bash",
|
|
4712
4715
|
hurl: "http"
|
|
4713
|
-
}, E = ((D ? D.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K =
|
|
4716
|
+
}, E = ((D ? D.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K = Ma(D ?? ""), re = Na(E, K), he = io.test(d) ? { includeExplanation: "scopeName" } : {};
|
|
4714
4717
|
try {
|
|
4715
4718
|
return e.codeToHtml(d, {
|
|
4716
4719
|
...he,
|
|
4717
4720
|
lang: H,
|
|
4718
4721
|
theme: "github-dark",
|
|
4719
|
-
transformers: [
|
|
4722
|
+
transformers: [Ra(re, K)]
|
|
4720
4723
|
});
|
|
4721
4724
|
} catch {
|
|
4722
4725
|
return `<pre ${Object.entries(re).map(([ge, oe]) => `${ge}="${s.utils.escapeHtml(oe)}"`).join(" ")}><code>${s.utils.escapeHtml(d)}</code></pre>`;
|
|
@@ -4766,15 +4769,15 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
|
|
|
4766
4769
|
}, s.use(dn, {
|
|
4767
4770
|
slugify: Ie,
|
|
4768
4771
|
permalink: dn.permalink.headerLink({ safariReaderFix: !0 })
|
|
4769
|
-
}), s.use(
|
|
4772
|
+
}), s.use(Ro), s.use(Rn), s.use(Wo), s.use(Lo, { enabled: !0 }), s.use(fs), s.inline.ruler.before("emphasis", "np_ins", ua), s.renderer.rules.s_open = () => "<del>", s.renderer.rules.s_close = () => "</del>", s.use(gs), s.use(bs), s.inline.ruler.before("emphasis", "np_keys", ma), s.core.ruler.push("np_figures", fa), s.block.ruler.before("reference", "np_abbr_definition", ka, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.core.ruler.after("inline", "np_abbr", xa(o.glossary ?? [])), s.core.ruler.push("np_glossary_anchors", Sa), s.core.ruler.after("footnote_tail", "np_footnote_tips", ja);
|
|
4770
4773
|
const h = s.renderer.rules.footnote_ref ?? r;
|
|
4771
4774
|
s.renderer.rules.footnote_ref = (d, v, D, R, x) => {
|
|
4772
4775
|
const E = String(d[v].meta?.tip ?? ""), I = h(d, v, D, R, x);
|
|
4773
4776
|
return E ? I.replace('<sup class="footnote-ref">', `<sup class="footnote-ref np-tip" aria-label="${s.utils.escapeHtml(E)}">`) : I;
|
|
4774
|
-
}, s.inline.ruler.before("emphasis", "np_icon",
|
|
4775
|
-
`, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${
|
|
4777
|
+
}, s.inline.ruler.before("emphasis", "np_icon", ya(o.icons)), s.use(Ps), s.renderer.rules.np_icon = (d, v, D, R, x) => `<span${x.renderAttrs(d[v])}>${d[v].content}</span>`, o.math !== !1 && (s.block.ruler.before("fence", "np_math_block", ba, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.inline.ruler.before("emphasis", "np_math_inline", wa), s.renderer.rules.np_math_block = (d, v) => `<div class="np-math np-math-display" data-math="${Dn(d[v].content)}"></div>
|
|
4778
|
+
`, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${Dn(d[v].content)}"></span>`);
|
|
4776
4779
|
const g = (d, v) => {
|
|
4777
|
-
s.use(
|
|
4780
|
+
s.use(Bo, d, v);
|
|
4778
4781
|
}, w = [
|
|
4779
4782
|
"tip",
|
|
4780
4783
|
"note",
|
|
@@ -4905,8 +4908,8 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
|
|
|
4905
4908
|
}
|
|
4906
4909
|
}), s;
|
|
4907
4910
|
}
|
|
4908
|
-
const
|
|
4909
|
-
function
|
|
4911
|
+
const io = /\((\d+)\)(!?)[ \t]*$/m;
|
|
4912
|
+
function Ta(e) {
|
|
4910
4913
|
const t = /* @__PURE__ */ new Set(), n = Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : typeof e == "number" ? [e] : [];
|
|
4911
4914
|
for (const o of n) {
|
|
4912
4915
|
const s = String(o).trim(), r = /^(\d+)(?:-(\d+))?$/.exec(s);
|
|
@@ -4916,28 +4919,28 @@ function Da(e) {
|
|
|
4916
4919
|
}
|
|
4917
4920
|
return t;
|
|
4918
4921
|
}
|
|
4919
|
-
function
|
|
4922
|
+
function Ma(e) {
|
|
4920
4923
|
const t = e.indexOf("{"), n = t >= 0 ? Ee(e.slice(t), e) : {}, o = typeof n.start == "number" && Number.isInteger(n.start) ? n.start : 1;
|
|
4921
4924
|
return {
|
|
4922
4925
|
title: typeof n.title == "string" ? n.title.trim() : "",
|
|
4923
4926
|
lines: n.lines === !0 || typeof n.start == "number",
|
|
4924
4927
|
start: o,
|
|
4925
|
-
highlight:
|
|
4928
|
+
highlight: Ta(n.highlight)
|
|
4926
4929
|
};
|
|
4927
4930
|
}
|
|
4928
|
-
function
|
|
4931
|
+
function Na(e, t) {
|
|
4929
4932
|
const n = { "data-lang": e };
|
|
4930
4933
|
return t.title && (n["data-title"] = t.title), t.lines && (n["data-lines"] = "true", n["data-start"] = String(t.start)), n;
|
|
4931
4934
|
}
|
|
4932
|
-
function
|
|
4935
|
+
function Ia(e) {
|
|
4933
4936
|
const t = e.explanation ?? [];
|
|
4934
4937
|
return t.length > 0 && t.every(
|
|
4935
4938
|
(n) => n.scopes.some((o) => /(^|\.)comment(\.|$)/.test(o.scopeName)) && !n.scopes.some((o) => o.scopeName.startsWith("markup.fenced_code") || o.scopeName.startsWith("markup.raw"))
|
|
4936
4939
|
);
|
|
4937
4940
|
}
|
|
4938
|
-
function
|
|
4941
|
+
function Fa(e) {
|
|
4939
4942
|
let t = e.length;
|
|
4940
|
-
for (; t > 0 &&
|
|
4943
|
+
for (; t > 0 && Ia(e[t - 1]); ) t -= 1;
|
|
4941
4944
|
if (t === e.length) return e;
|
|
4942
4945
|
const n = e.slice(t).flatMap(
|
|
4943
4946
|
(w) => (w.explanation ?? []).map((P) => ({
|
|
@@ -4950,7 +4953,7 @@ function Ia(e) {
|
|
|
4950
4953
|
let o = n.length - 1;
|
|
4951
4954
|
for (; o >= 0 && (n[o].punctuation || !n[o].text.trim()); ) o -= 1;
|
|
4952
4955
|
if (o < 0) return e;
|
|
4953
|
-
const s =
|
|
4956
|
+
const s = io.exec(n[o].text);
|
|
4954
4957
|
if (!s) return e;
|
|
4955
4958
|
const r = s[2] === "!";
|
|
4956
4959
|
n[o].text = n[o].text.slice(0, s.index);
|
|
@@ -4966,11 +4969,11 @@ function Ia(e) {
|
|
|
4966
4969
|
});
|
|
4967
4970
|
return [...e.slice(0, t), ...u.map(g), i, ...h.map(g)];
|
|
4968
4971
|
}
|
|
4969
|
-
function
|
|
4972
|
+
function Ra(e, t) {
|
|
4970
4973
|
return {
|
|
4971
4974
|
name: "nimpress:code-fence",
|
|
4972
4975
|
tokens(n) {
|
|
4973
|
-
return n.map(
|
|
4976
|
+
return n.map(Fa);
|
|
4974
4977
|
},
|
|
4975
4978
|
pre(n) {
|
|
4976
4979
|
n.properties.style = String(n.properties.style ?? "").replace(/background-color:[^;]*;?/, "");
|
|
@@ -4995,14 +4998,14 @@ function Ee(e, t) {
|
|
|
4995
4998
|
function tt(e) {
|
|
4996
4999
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
4997
5000
|
}
|
|
4998
|
-
function
|
|
5001
|
+
function Ba(e) {
|
|
4999
5002
|
return `<div class="np-mermaid" data-graph="${Buffer.from(e, "utf-8").toString("base64")}"></div>`;
|
|
5000
5003
|
}
|
|
5001
|
-
function
|
|
5004
|
+
function Wa(e, t, n) {
|
|
5002
5005
|
const o = t.startsWith("{") ? Ee(t, t) : {};
|
|
5003
5006
|
let s = "", r = "";
|
|
5004
5007
|
try {
|
|
5005
|
-
s =
|
|
5008
|
+
s = qn(e);
|
|
5006
5009
|
} catch (h) {
|
|
5007
5010
|
r = h instanceof Yt ? h.message : String(h), console.warn(`[nimpress] invalid dbml in ${n}:
|
|
5008
5011
|
${r}`);
|
|
@@ -5014,7 +5017,7 @@ ${r}`);
|
|
|
5014
5017
|
c ? `data-height="${tt(c)}"` : ""
|
|
5015
5018
|
].filter(Boolean).join(" ")}></div>`;
|
|
5016
5019
|
}
|
|
5017
|
-
function
|
|
5020
|
+
function La(e, t) {
|
|
5018
5021
|
const n = e.split(`
|
|
5019
5022
|
`), o = [];
|
|
5020
5023
|
let s = 0;
|
|
@@ -5029,13 +5032,13 @@ function Wa(e, t) {
|
|
|
5029
5032
|
for (; g < n.length && !h.test(n[g]); ) g += 1;
|
|
5030
5033
|
const w = u.trim(), P = w.split(/\s+/)[0].toLowerCase(), A = n.slice(s + 1, g).join(`
|
|
5031
5034
|
`);
|
|
5032
|
-
P === "mermaid" ? o.push(`${i}${
|
|
5033
|
-
`)}`) : P === "dbml" ? o.push(`${i}${
|
|
5035
|
+
P === "mermaid" ? o.push(`${i}${Ba(A && `${A}
|
|
5036
|
+
`)}`) : P === "dbml" ? o.push(`${i}${Wa(A, w.slice(P.length).trim(), t)}`) : o.push(...n.slice(s, Math.min(g + 1, n.length))), s = g + 1;
|
|
5034
5037
|
}
|
|
5035
5038
|
return o.join(`
|
|
5036
5039
|
`);
|
|
5037
5040
|
}
|
|
5038
|
-
function
|
|
5041
|
+
function Ha(e) {
|
|
5039
5042
|
if (!e) return "";
|
|
5040
5043
|
const t = [], n = (s) => {
|
|
5041
5044
|
if (s)
|
|
@@ -5046,14 +5049,14 @@ function La(e) {
|
|
|
5046
5049
|
const o = t.join("").trim();
|
|
5047
5050
|
return o || (e.content ?? "").trim();
|
|
5048
5051
|
}
|
|
5049
|
-
function
|
|
5052
|
+
function za(e, t) {
|
|
5050
5053
|
const n = e.parse(t, {}), o = [];
|
|
5051
5054
|
let s = 0;
|
|
5052
5055
|
const r = /* @__PURE__ */ new Map();
|
|
5053
5056
|
for (let i = 0; i < n.length; i++) {
|
|
5054
5057
|
const c = n[i];
|
|
5055
5058
|
if (c.type === "heading_open") {
|
|
5056
|
-
const u = parseInt(c.tag.slice(1)), h = n[i + 1], g =
|
|
5059
|
+
const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = Ha(h) || `heading-${s++}`;
|
|
5057
5060
|
let w = Ie(g);
|
|
5058
5061
|
w || (w = `heading-${s++}`);
|
|
5059
5062
|
const P = r.get(w);
|
|
@@ -5067,7 +5070,7 @@ function Ha(e, t) {
|
|
|
5067
5070
|
}
|
|
5068
5071
|
return o;
|
|
5069
5072
|
}
|
|
5070
|
-
function
|
|
5073
|
+
function qa(e) {
|
|
5071
5074
|
return e.frontmatter.slug ?? e.frontmatter.title;
|
|
5072
5075
|
}
|
|
5073
5076
|
function mt(e) {
|
|
@@ -5081,16 +5084,16 @@ function qt(e) {
|
|
|
5081
5084
|
for (const t of e)
|
|
5082
5085
|
t.items && qt(t.items);
|
|
5083
5086
|
}
|
|
5084
|
-
function
|
|
5087
|
+
function Ua(e) {
|
|
5085
5088
|
let t = Ye, n = G(process.cwd(), Ye.contentDir), o = G(process.cwd(), Ye.assetsDir), s = /* @__PURE__ */ new Map(), r = null, i = G(process.cwd(), "dist"), c = !1, u = null;
|
|
5086
5089
|
const h = /* @__PURE__ */ new Map();
|
|
5087
5090
|
let g = [], w = "";
|
|
5088
5091
|
const P = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
|
|
5089
5092
|
function v(a) {
|
|
5090
|
-
return
|
|
5093
|
+
return In("sha1").update(a).digest("hex");
|
|
5091
5094
|
}
|
|
5092
5095
|
async function D() {
|
|
5093
|
-
return r || (r = await
|
|
5096
|
+
return r || (r = await zo({
|
|
5094
5097
|
themes: ["github-dark"],
|
|
5095
5098
|
langs: [
|
|
5096
5099
|
"ts",
|
|
@@ -5117,7 +5120,7 @@ function qa(e) {
|
|
|
5117
5120
|
}), r);
|
|
5118
5121
|
}
|
|
5119
5122
|
function R(a, l) {
|
|
5120
|
-
return /\.ya?ml$/i.test(l) ?
|
|
5123
|
+
return /\.ya?ml$/i.test(l) ? Bn(a) : JSON.parse(a);
|
|
5121
5124
|
}
|
|
5122
5125
|
async function x(a, l) {
|
|
5123
5126
|
try {
|
|
@@ -5271,7 +5274,7 @@ function qa(e) {
|
|
|
5271
5274
|
async function he(a) {
|
|
5272
5275
|
const l = await ie(a, "utf-8"), { data: p, content: b } = _t(l);
|
|
5273
5276
|
typeof p.type == "number" && (p.type = String(p.type));
|
|
5274
|
-
const k =
|
|
5277
|
+
const k = oo(p, b);
|
|
5275
5278
|
if (k.length) {
|
|
5276
5279
|
const X = `${a}
|
|
5277
5280
|
${k.join(`
|
|
@@ -5279,7 +5282,7 @@ function qa(e) {
|
|
|
5279
5282
|
if (c) throw new Error(`[nimpress] invalid frontmatter in ${X}`);
|
|
5280
5283
|
console.warn(`[nimpress] invalid frontmatter in ${X}`);
|
|
5281
5284
|
}
|
|
5282
|
-
const y =
|
|
5285
|
+
const y = to.safeParse(p), f = y.success ? y.data : { title: a }, _ = so(n, a), C = f.type ?? "doc", $ = la(n, a, f.path), S = typeof f.link == "string" && f.link.trim() !== "" ? f.link.trim() : void 0, U = !!S || p.type === void 0 && b.trim() === "", j = t.defaultFrontmatter ?? {};
|
|
5283
5286
|
if (!(t.defaultFrontmatterExclude ?? []).some((X) => {
|
|
5284
5287
|
const le = X.startsWith("/") ? X : "/" + X;
|
|
5285
5288
|
return $ === le || $.startsWith(le + "/");
|
|
@@ -5288,7 +5291,7 @@ function qa(e) {
|
|
|
5288
5291
|
const Te = X;
|
|
5289
5292
|
Te === "hide" ? f.hide = Array.from(/* @__PURE__ */ new Set([...le ?? [], ...f.hide ?? []])) : (f[Te] === void 0 || f[Te] === null || f[Te] === "") && (f[Te] = le);
|
|
5290
5293
|
}
|
|
5291
|
-
const B = await D(), M =
|
|
5294
|
+
const B = await D(), M = Mn(B, be(), t.base, { math: t.math, icons: t.icons, glossary: g }), W = La(b, a), L = za(M, W), J = M.render(W, { glossaryPage: C === "glossary" });
|
|
5292
5295
|
if (C === "team" || C === "pricing") {
|
|
5293
5296
|
const X = { ...f.data ?? {} };
|
|
5294
5297
|
Array.isArray(X.members) && (X.members = X.members.map((le) => ({ ...le, bioHtml: typeof le.bio == "string" ? M.renderInline(le.bio) : "" }))), Array.isArray(X.tiers) && (X.tiers = X.tiers.map((le) => ({ ...le, benefitsHtml: Array.isArray(le.benefits) ? le.benefits.map((Te) => M.renderInline(String(Te))) : [] }))), typeof X.footnote == "string" && (X.footnoteHtml = M.renderInline(X.footnote)), f.data = X;
|
|
@@ -5298,7 +5301,7 @@ function qa(e) {
|
|
|
5298
5301
|
if (!f.spec)
|
|
5299
5302
|
console.warn(`[nimpress] page ${a} has type openapi but no spec field`);
|
|
5300
5303
|
else {
|
|
5301
|
-
z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N =
|
|
5304
|
+
z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = aa(n, z);
|
|
5302
5305
|
const X = await x(a, f.spec);
|
|
5303
5306
|
Z = X ? re(X, M) ?? void 0 : void 0;
|
|
5304
5307
|
}
|
|
@@ -5309,7 +5312,7 @@ function qa(e) {
|
|
|
5309
5312
|
else {
|
|
5310
5313
|
z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ne = Ce(z);
|
|
5311
5314
|
try {
|
|
5312
|
-
se = await ie(z, "utf-8"), V =
|
|
5315
|
+
se = await ie(z, "utf-8"), V = qn(se);
|
|
5313
5316
|
} catch (X) {
|
|
5314
5317
|
Q = X instanceof Yt ? X.message : String(X);
|
|
5315
5318
|
const le = `${a} -> ${f.spec}
|
|
@@ -5321,7 +5324,7 @@ function qa(e) {
|
|
|
5321
5324
|
te(a, z);
|
|
5322
5325
|
let ue, me = [];
|
|
5323
5326
|
if (C === "component") {
|
|
5324
|
-
const X = await
|
|
5327
|
+
const X = await Nr({
|
|
5325
5328
|
cwd: process.cwd(),
|
|
5326
5329
|
modules: t.modules,
|
|
5327
5330
|
pageFile: a,
|
|
@@ -5337,8 +5340,8 @@ function qa(e) {
|
|
|
5337
5340
|
_e !== a && fe(_e) && $e.push(await ie(_e, "utf-8"));
|
|
5338
5341
|
const Be = Ce(a, ".md");
|
|
5339
5342
|
for (const X of Le(Y(a)).sort()) {
|
|
5340
|
-
const le =
|
|
5341
|
-
le && $e.push(
|
|
5343
|
+
const le = Aa(X, Be);
|
|
5344
|
+
le && $e.push(Tn(le, await ie(q(Y(a), X), "utf-8")));
|
|
5342
5345
|
}
|
|
5343
5346
|
for (const X of f.styles ?? []) {
|
|
5344
5347
|
const le = G(Y(a), X);
|
|
@@ -5422,7 +5425,7 @@ function qa(e) {
|
|
|
5422
5425
|
continue;
|
|
5423
5426
|
}
|
|
5424
5427
|
const { data: F, content: B } = _t(O);
|
|
5425
|
-
String(F.type) === "glossary" && ($.push(j), S =
|
|
5428
|
+
String(F.type) === "glossary" && ($.push(j), S = Pa(new Fn().use(Rn), B));
|
|
5426
5429
|
}
|
|
5427
5430
|
if ($.length > 1) throw new Error(`[nimpress] one type glossary page per site: ${$.join(" and ")}`);
|
|
5428
5431
|
g = S, w = JSON.stringify(S);
|
|
@@ -5478,7 +5481,7 @@ function qa(e) {
|
|
|
5478
5481
|
}
|
|
5479
5482
|
xt.clear();
|
|
5480
5483
|
for (const [j, O] of b) {
|
|
5481
|
-
const F = j.split("\0", 1)[0], B =
|
|
5484
|
+
const F = j.split("\0", 1)[0], B = ro(F ? "/" + F : "/");
|
|
5482
5485
|
if (p.has(B))
|
|
5483
5486
|
throw new Error(
|
|
5484
5487
|
`[nimpress] path ${B} is occupied by both a changelog collection and a regular page`
|
|
@@ -5487,7 +5490,7 @@ function qa(e) {
|
|
|
5487
5490
|
if (M.length === 0) continue;
|
|
5488
5491
|
M.sort((N, z) => {
|
|
5489
5492
|
const V = String(N.frontmatter.data?.version ?? ""), se = String(z.frontmatter.data?.version ?? "");
|
|
5490
|
-
return
|
|
5493
|
+
return ra(se, V);
|
|
5491
5494
|
});
|
|
5492
5495
|
const W = M[0], L = `__changelog__${(F || "root").replace(/\//g, "__")}`, J = M.map((N) => {
|
|
5493
5496
|
const z = N.frontmatter.data, V = String(z?.version ?? ""), se = String(z?.title ?? ""), ne = z?.description !== void 0 ? String(z.description) : void 0, Q = z?.release_date;
|
|
@@ -5537,8 +5540,8 @@ function qa(e) {
|
|
|
5537
5540
|
};
|
|
5538
5541
|
p.set(B, ee.filePath), l.set(ee.slug, ee);
|
|
5539
5542
|
}
|
|
5540
|
-
if (
|
|
5541
|
-
const j =
|
|
5543
|
+
if (vo(k, C), lo(l), co(l), t.seo?.auto) {
|
|
5544
|
+
const j = Oa(C.map((O) => ({
|
|
5542
5545
|
slug: O.slug,
|
|
5543
5546
|
title: O.frontmatter.title,
|
|
5544
5547
|
headings: O.headings.map((F) => F.text),
|
|
@@ -5557,7 +5560,7 @@ function qa(e) {
|
|
|
5557
5560
|
const ze = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map();
|
|
5558
5561
|
let St = JSON.stringify({ pages: [] }, null, 2) + `
|
|
5559
5562
|
`;
|
|
5560
|
-
function
|
|
5563
|
+
function co(a) {
|
|
5561
5564
|
const l = [];
|
|
5562
5565
|
for (const p of a.values()) {
|
|
5563
5566
|
if (p.frontmatter.subscribe !== !0 || It(p.frontmatter)) continue;
|
|
@@ -5581,7 +5584,7 @@ function qa(e) {
|
|
|
5581
5584
|
l.sort((p, b) => p.path.localeCompare(b.path)), St = JSON.stringify({ pages: l }, null, 2) + `
|
|
5582
5585
|
`;
|
|
5583
5586
|
}
|
|
5584
|
-
function
|
|
5587
|
+
function lo(a) {
|
|
5585
5588
|
ze.clear();
|
|
5586
5589
|
const l = t.site?.url?.replace(/\/$/, "");
|
|
5587
5590
|
for (const p of a.values()) {
|
|
@@ -5614,7 +5617,7 @@ function qa(e) {
|
|
|
5614
5617
|
`<link>${ye(se)}</link>`,
|
|
5615
5618
|
`<guid isPermaLink="true">${ye(se)}</guid>`
|
|
5616
5619
|
];
|
|
5617
|
-
return V.releaseDate && ne.push(`<pubDate>${new Date(V.releaseDate).toUTCString()}</pubDate>`), V.description && ne.push(`<description>${ye(V.description)}</description>`), V.html && ne.push(`<content:encoded>${
|
|
5620
|
+
return V.releaseDate && ne.push(`<pubDate>${new Date(V.releaseDate).toUTCString()}</pubDate>`), V.description && ne.push(`<description>${ye(V.description)}</description>`), V.html && ne.push(`<content:encoded>${Yr(V.html)}</content:encoded>`), ` <item>
|
|
5618
5621
|
${ne.join(`
|
|
5619
5622
|
`)}
|
|
5620
5623
|
</item>`;
|
|
@@ -5627,7 +5630,7 @@ function qa(e) {
|
|
|
5627
5630
|
M && N.push(`<language>${ye(M)}</language>`), O && N.push(`<lastBuildDate>${O}</lastBuildDate>`), N.push(`<ttl>${U}</ttl>`), N.push(`<sy:updatePeriod>${j}</sy:updatePeriod>`), N.push("<sy:updateFrequency>1</sy:updateFrequency>"), S !== void 0 && N.push(`<nimpress:releaseCadence>${S}</nimpress:releaseCadence>`), N.push(`<nimpress:latestVersion>${ye(b[0].version)}</nimpress:latestVersion>`), N.push(`<nimpress:releaseCount>${b.length}</nimpress:releaseCount>`), L > 0 && N.push("<fh:archive/>");
|
|
5628
5631
|
const z = [
|
|
5629
5632
|
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
5630
|
-
`<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${
|
|
5633
|
+
`<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${Xr}">`,
|
|
5631
5634
|
" <channel>",
|
|
5632
5635
|
` ${N.join(`
|
|
5633
5636
|
`)}`,
|
|
@@ -5645,7 +5648,7 @@ function qa(e) {
|
|
|
5645
5648
|
function ve(a) {
|
|
5646
5649
|
return a.frontmatter.gate !== void 0;
|
|
5647
5650
|
}
|
|
5648
|
-
function
|
|
5651
|
+
function po(a) {
|
|
5649
5652
|
const l = Y(a.filePath);
|
|
5650
5653
|
let p = [];
|
|
5651
5654
|
try {
|
|
@@ -5657,9 +5660,9 @@ function qa(e) {
|
|
|
5657
5660
|
}
|
|
5658
5661
|
function st(a) {
|
|
5659
5662
|
const l = t.auth?.guard;
|
|
5660
|
-
return typeof l == "function" ? l(a.frontmatter, je(process.cwd(), a.filePath),
|
|
5663
|
+
return typeof l == "function" ? l(a.frontmatter, je(process.cwd(), a.filePath), po(a)) : a.frontmatter.gate ?? "default";
|
|
5661
5664
|
}
|
|
5662
|
-
function
|
|
5665
|
+
function uo() {
|
|
5663
5666
|
const a = [];
|
|
5664
5667
|
for (const l of s.values())
|
|
5665
5668
|
l.sidebarOnly || It(l.frontmatter) || ve(l) || a.push(l);
|
|
@@ -5674,7 +5677,7 @@ function qa(e) {
|
|
|
5674
5677
|
if (jt.has(a)) return jt.get(a);
|
|
5675
5678
|
let l;
|
|
5676
5679
|
try {
|
|
5677
|
-
l =
|
|
5680
|
+
l = Fo("git", ["log", "-1", "--format=%cI", "--", a], {
|
|
5678
5681
|
cwd: process.cwd(),
|
|
5679
5682
|
encoding: "utf-8",
|
|
5680
5683
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -5684,15 +5687,15 @@ function qa(e) {
|
|
|
5684
5687
|
}
|
|
5685
5688
|
return jt.set(a, l), l;
|
|
5686
5689
|
}
|
|
5687
|
-
function
|
|
5690
|
+
function mo(a) {
|
|
5688
5691
|
return a === "changelog" || a === "roadmap" ? "CollectionPage" : a === "openapi" ? "APIReference" : a === "hero" || a === "fullpage" || a === "404" ? "WebPage" : a === "section" || a === "tags" ? "CollectionPage" : a === "glossary" ? "DefinedTermSet" : a === "team" ? "AboutPage" : "TechArticle";
|
|
5689
5692
|
}
|
|
5690
|
-
function
|
|
5693
|
+
function fo(a) {
|
|
5691
5694
|
const l = t.meta ?? {}, p = t.site, b = a.frontmatter, k = b.meta ?? {}, y = k.og ?? {}, f = k.twitter ?? {}, _ = b.title, C = p?.title && p.title !== _ ? `${_} · ${p.title}` : _, $ = k.description ?? b.description ?? p?.description, S = k.canonical ?? Pe(a.effectivePath), U = (() => {
|
|
5692
5695
|
if (k.keywords) return Array.isArray(k.keywords) ? k.keywords : [k.keywords];
|
|
5693
5696
|
const ne = Re(b.tags);
|
|
5694
5697
|
return ne.length ? ne : l.keywords ?? [];
|
|
5695
|
-
})(), j =
|
|
5698
|
+
})(), j = Da(k.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, k.ai), O = y.title ?? _, F = y.description ?? $, B = y.image ?? p?.ogImage, M = B ? Pe(B) ?? B : void 0, W = y.type ?? (b.type === "hero" || b.type === "fullpage" || a.effectivePath === "/" ? "website" : "article"), L = l.og?.width ?? 1200, J = l.og?.height ?? 600, Z = f.card ?? (M ? "summary_large_image" : "summary"), ee = f.site ?? p?.twitterSite, N = tt, z = [];
|
|
5696
5699
|
if (z.push(`<title>${N(C)}</title>`), $ && z.push(`<meta name="description" content="${N($)}">`), U.length && z.push(`<meta name="keywords" content="${N(U.join(", "))}">`), z.push(`<meta name="robots" content="${N(j)}">`), z.push(`<meta name="googlebot" content="${N(j)}">`), S) {
|
|
5697
5700
|
z.push(`<link rel="canonical" href="${N(S)}">`);
|
|
5698
5701
|
const ne = l.localeAlternates ?? [];
|
|
@@ -5735,7 +5738,7 @@ function qa(e) {
|
|
|
5735
5738
|
}
|
|
5736
5739
|
se.push({
|
|
5737
5740
|
"@context": "https://schema.org",
|
|
5738
|
-
"@type":
|
|
5741
|
+
"@type": mo(a.type),
|
|
5739
5742
|
name: C,
|
|
5740
5743
|
headline: _,
|
|
5741
5744
|
description: $,
|
|
@@ -5743,13 +5746,13 @@ function qa(e) {
|
|
|
5743
5746
|
isPartOf: V ? `${V}${we(t.base, "/")}#website` : void 0,
|
|
5744
5747
|
dateModified: on(a.filePath)
|
|
5745
5748
|
}), k.jsonLd && se.push(k.jsonLd);
|
|
5746
|
-
for (const ne of se) z.push(
|
|
5749
|
+
for (const ne of se) z.push(Kr(ne));
|
|
5747
5750
|
return `
|
|
5748
5751
|
${z.join(`
|
|
5749
5752
|
`)}
|
|
5750
5753
|
`;
|
|
5751
5754
|
}
|
|
5752
|
-
function
|
|
5755
|
+
function ho() {
|
|
5753
5756
|
const a = t.meta ?? {};
|
|
5754
5757
|
if (a.robots?.custom) return a.robots.custom;
|
|
5755
5758
|
const l = /* @__PURE__ */ new Set([...a.robots?.block ?? [], ...t.seo?.ai?.index === !1 ? Nt : []]), p = ["User-agent: *", "Allow: /", ""];
|
|
@@ -5765,7 +5768,7 @@ function qa(e) {
|
|
|
5765
5768
|
`).trim() + `
|
|
5766
5769
|
`;
|
|
5767
5770
|
}
|
|
5768
|
-
function
|
|
5771
|
+
function go(a) {
|
|
5769
5772
|
const l = t.site?.url?.replace(/\/$/, "");
|
|
5770
5773
|
if (!l) return;
|
|
5771
5774
|
const p = t.meta?.localeAlternates ?? [];
|
|
@@ -5788,7 +5791,7 @@ ${S.join(`
|
|
|
5788
5791
|
].join(`
|
|
5789
5792
|
`);
|
|
5790
5793
|
}
|
|
5791
|
-
function
|
|
5794
|
+
function _o(a) {
|
|
5792
5795
|
const l = t.meta ?? {}, p = t.site, b = [`# ${p?.title ?? t.title}`, ""], k = l.llms?.summary ?? p?.description;
|
|
5793
5796
|
k && b.push(`> ${k}`, "");
|
|
5794
5797
|
const y = /* @__PURE__ */ new Map(), f = [];
|
|
@@ -5822,7 +5825,7 @@ ${S.join(`
|
|
|
5822
5825
|
|
|
5823
5826
|
`);
|
|
5824
5827
|
}
|
|
5825
|
-
function
|
|
5828
|
+
function yo(a) {
|
|
5826
5829
|
const p = [`# ${t.site?.title ?? t.title}`, ""];
|
|
5827
5830
|
for (const b of a) {
|
|
5828
5831
|
p.push(`## ${b.frontmatter.title}`, "");
|
|
@@ -5834,15 +5837,15 @@ ${S.join(`
|
|
|
5834
5837
|
|
|
5835
5838
|
`);
|
|
5836
5839
|
}
|
|
5837
|
-
async function
|
|
5838
|
-
const a = t.meta ?? {}, l =
|
|
5840
|
+
async function bo() {
|
|
5841
|
+
const a = t.meta ?? {}, l = uo().sort((f, _) => f.effectivePath.localeCompare(_.effectivePath)), p = q(i, "index.html"), b = await ie(p, "utf-8");
|
|
5839
5842
|
for (const f of l) {
|
|
5840
|
-
const _ =
|
|
5843
|
+
const _ = fo(f), C = b.replace("</head>", `${_}</head>`), $ = f.effectivePath === "/" ? p : q(i, f.effectivePath.replace(/^\//, ""), "index.html");
|
|
5841
5844
|
await Ue(Y($), { recursive: !0 }), await pe($, C);
|
|
5842
5845
|
}
|
|
5843
|
-
await pe(q(i, "robots.txt"),
|
|
5844
|
-
const k = l.filter((f) => f.type !== "404"), y =
|
|
5845
|
-
if (y && await pe(q(i, "sitemap.xml"), y), await pe(q(i, "llms.txt"),
|
|
5846
|
+
await pe(q(i, "robots.txt"), ho());
|
|
5847
|
+
const k = l.filter((f) => f.type !== "404"), y = go(k);
|
|
5848
|
+
if (y && await pe(q(i, "sitemap.xml"), y), await pe(q(i, "llms.txt"), _o(k)), a.llms?.full && await pe(q(i, "llms-full.txt"), yo(k)), a.webmanifest && await pe(q(i, "site.webmanifest"), JSON.stringify(a.webmanifest, null, 2) + `
|
|
5846
5849
|
`), a.humans && await pe(q(i, "humans.txt"), a.humans.trim() + `
|
|
5847
5850
|
`), a.security) {
|
|
5848
5851
|
const f = a.security, _ = [];
|
|
@@ -5851,7 +5854,7 @@ ${S.join(`
|
|
|
5851
5854
|
`));
|
|
5852
5855
|
}
|
|
5853
5856
|
}
|
|
5854
|
-
async function
|
|
5857
|
+
async function wo() {
|
|
5855
5858
|
const a = [...s.values()].filter((f) => !It(f.frontmatter) && ve(f)), l = {}, p = /* @__PURE__ */ new Map();
|
|
5856
5859
|
for (const f of a) {
|
|
5857
5860
|
const _ = st(f);
|
|
@@ -5909,9 +5912,9 @@ ${S.join(`
|
|
|
5909
5912
|
`
|
|
5910
5913
|
);
|
|
5911
5914
|
}
|
|
5912
|
-
function
|
|
5915
|
+
function vo(a, l) {
|
|
5913
5916
|
if (a.size === 0) return;
|
|
5914
|
-
const p = l.filter((k) =>
|
|
5917
|
+
const p = l.filter((k) => ko(k.type)), b = /* @__PURE__ */ new Map();
|
|
5915
5918
|
for (const k of p) b.set(k.filePath, k);
|
|
5916
5919
|
for (const [, k] of a) {
|
|
5917
5920
|
const y = k[0], f = Y(y.filePath), _ = y.frontmatter.data, C = _?.issues ?? _?.entries, $ = [];
|
|
@@ -6002,7 +6005,7 @@ ${S.join(`
|
|
|
6002
6005
|
}));
|
|
6003
6006
|
}
|
|
6004
6007
|
}
|
|
6005
|
-
function
|
|
6008
|
+
function ko(a) {
|
|
6006
6009
|
return a === "milestone" || a === "epic" || a === "feature" || a === "bug";
|
|
6007
6010
|
}
|
|
6008
6011
|
function sn(a, l) {
|
|
@@ -6021,7 +6024,7 @@ ${S.join(`
|
|
|
6021
6024
|
function qe(a, l) {
|
|
6022
6025
|
const p = a ? /^:([a-z0-9]+(?:-[a-z0-9]+)*):$/.exec(a.trim()) : null;
|
|
6023
6026
|
if (p) {
|
|
6024
|
-
const y =
|
|
6027
|
+
const y = ao(p[1], t.icons);
|
|
6025
6028
|
return y || console.warn(`[nimpress] icon ${a} referenced from ${l} is not a known shortcode`), y ?? void 0;
|
|
6026
6029
|
}
|
|
6027
6030
|
if (!a || !/\.svg$/i.test(a.trim())) return a;
|
|
@@ -6071,7 +6074,7 @@ ${S.join(`
|
|
|
6071
6074
|
for (const $ of y.children.values()) f.push(b($));
|
|
6072
6075
|
if (qt(f), y.page) {
|
|
6073
6076
|
const $ = {
|
|
6074
|
-
text:
|
|
6077
|
+
text: qa(y.page),
|
|
6075
6078
|
link: y.page.linkTo ?? y.page.effectivePath,
|
|
6076
6079
|
external: y.page.linkTo ? !0 : void 0,
|
|
6077
6080
|
slug: y.page.slug,
|
|
@@ -6114,7 +6117,7 @@ ${S.join(`
|
|
|
6114
6117
|
text: J.title,
|
|
6115
6118
|
link: J.href,
|
|
6116
6119
|
slug: J.slug,
|
|
6117
|
-
icon:
|
|
6120
|
+
icon: Zr[J.kind],
|
|
6118
6121
|
hidden: J.hidden,
|
|
6119
6122
|
order: Z
|
|
6120
6123
|
};
|
|
@@ -6156,10 +6159,10 @@ ${S.join(`
|
|
|
6156
6159
|
for (const y of l.children.values()) k.push(b(y));
|
|
6157
6160
|
return qt(k), k;
|
|
6158
6161
|
}
|
|
6159
|
-
function
|
|
6162
|
+
function $o(a) {
|
|
6160
6163
|
return `tag-${Ie(a)}`;
|
|
6161
6164
|
}
|
|
6162
|
-
function
|
|
6165
|
+
function xo(a) {
|
|
6163
6166
|
const l = t.tags?.icons;
|
|
6164
6167
|
if (!l) return;
|
|
6165
6168
|
const p = l[t.tags?.map?.[a] ?? a] ?? l.default;
|
|
@@ -6170,17 +6173,17 @@ ${S.join(`
|
|
|
6170
6173
|
for (const l of s.values())
|
|
6171
6174
|
if (!(l.sidebarOnly || l.type === "404" || l.type === "tags") && !(c && (Se(l.frontmatter) || ve(l))))
|
|
6172
6175
|
for (const p of Re(l.frontmatter.tags)) {
|
|
6173
|
-
const b = a.get(p) ?? { name: p, slug:
|
|
6176
|
+
const b = a.get(p) ?? { name: p, slug: $o(p), icon: xo(p), pages: [] };
|
|
6174
6177
|
b.pages.push({ slug: l.slug, title: l.frontmatter.title, path: l.effectivePath, description: l.frontmatter.description }), a.set(p, b);
|
|
6175
6178
|
}
|
|
6176
6179
|
return Array.from(a.values()).sort((l, p) => l.name.localeCompare(p.name)).map((l) => ({ ...l, pages: l.pages.sort((p, b) => p.title.localeCompare(b.title)) }));
|
|
6177
6180
|
}
|
|
6178
|
-
function
|
|
6181
|
+
function So() {
|
|
6179
6182
|
const a = q(n, "styles");
|
|
6180
|
-
return fe(a) ? Le(a).filter((l) => l.endsWith(".css")).sort().map((l) =>
|
|
6183
|
+
return fe(a) ? Le(a).filter((l) => l.endsWith(".css")).sort().map((l) => Tn(l.replace(/\.css$/, ""), Oe(q(a, l), "utf-8"))).join(`
|
|
6181
6184
|
`) : "";
|
|
6182
6185
|
}
|
|
6183
|
-
function
|
|
6186
|
+
function jo() {
|
|
6184
6187
|
const a = {}, l = {};
|
|
6185
6188
|
for (const [k, y] of s) {
|
|
6186
6189
|
if (c && (Se(y.frontmatter) || ve(y)) || y.sidebarOnly) continue;
|
|
@@ -6204,7 +6207,7 @@ ${S.join(`
|
|
|
6204
6207
|
for (const _ of y.componentData?.stories ?? [])
|
|
6205
6208
|
l[`${y.effectivePath}/${Ft(_.name)}`] = k;
|
|
6206
6209
|
}
|
|
6207
|
-
const p = {}, b =
|
|
6210
|
+
const p = {}, b = So();
|
|
6208
6211
|
b && (p["/"] = b);
|
|
6209
6212
|
for (const k of s.values())
|
|
6210
6213
|
k.sidebarOnly || c && (Se(k.frontmatter) || ve(k)) || k.pageCss && (p[k.effectivePath] = [p[k.effectivePath], k.pageCss].filter(Boolean).join(`
|
|
@@ -6218,7 +6221,7 @@ ${S.join(`
|
|
|
6218
6221
|
if (a) {
|
|
6219
6222
|
if (Se(y.frontmatter) || !ve(y)) continue;
|
|
6220
6223
|
} else if (c && (Se(y.frontmatter) || ve(y))) continue;
|
|
6221
|
-
const f = y.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), _ = y.type === "openapi" ?
|
|
6224
|
+
const f = y.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), _ = y.type === "openapi" ? Po(y.openApiSpec) : "", C = y.type === "roadmap" ? Ao(y.roadmapEntries ?? []) : "", $ = y.componentData ? [
|
|
6222
6225
|
y.componentData.component,
|
|
6223
6226
|
y.componentData.system,
|
|
6224
6227
|
...(y.componentData.stories ?? []).flatMap((j) => [j.name, j.file])
|
|
@@ -6243,7 +6246,7 @@ ${S.join(`
|
|
|
6243
6246
|
function pn(a) {
|
|
6244
6247
|
return a ? a.replace(/<[^>]+>/g, " ").replace(/&[a-z]+;/gi, " ") : "";
|
|
6245
6248
|
}
|
|
6246
|
-
function
|
|
6249
|
+
function Po(a) {
|
|
6247
6250
|
if (!a || typeof a != "object") return "";
|
|
6248
6251
|
const l = a, p = [], b = /* @__PURE__ */ new WeakSet(), k = 12, y = (f, _) => {
|
|
6249
6252
|
if (f == null || _ > k) return;
|
|
@@ -6288,7 +6291,7 @@ ${S.join(`
|
|
|
6288
6291
|
return p.join(`
|
|
6289
6292
|
`);
|
|
6290
6293
|
}
|
|
6291
|
-
function
|
|
6294
|
+
function Ao(a) {
|
|
6292
6295
|
const l = [];
|
|
6293
6296
|
for (const p of a) {
|
|
6294
6297
|
l.push(p.slug, p.kind, p.title), p.description && l.push(p.description), p.targetDate && l.push(p.targetDate), p.html && l.push(pn(p.html));
|
|
@@ -6325,7 +6328,7 @@ ${S.join(`
|
|
|
6325
6328
|
k && a.moduleGraph.invalidateModule(k), y && a.moduleGraph.invalidateModule(y);
|
|
6326
6329
|
}
|
|
6327
6330
|
}
|
|
6328
|
-
function
|
|
6331
|
+
function Eo() {
|
|
6329
6332
|
const a = [];
|
|
6330
6333
|
for (const [l, p] of s) {
|
|
6331
6334
|
if (p.sidebarOnly || c && (Se(p.frontmatter) || ve(p))) continue;
|
|
@@ -6339,7 +6342,7 @@ ${a.join(`,
|
|
|
6339
6342
|
export default pages
|
|
6340
6343
|
`;
|
|
6341
6344
|
}
|
|
6342
|
-
function
|
|
6345
|
+
function Co() {
|
|
6343
6346
|
const a = [];
|
|
6344
6347
|
for (const [l, p] of s) {
|
|
6345
6348
|
if (p.sidebarOnly || c && (Se(p.frontmatter) || ve(p))) continue;
|
|
@@ -6353,7 +6356,7 @@ ${a.join(`,
|
|
|
6353
6356
|
export default bodies
|
|
6354
6357
|
`;
|
|
6355
6358
|
}
|
|
6356
|
-
function
|
|
6359
|
+
function Oo(a) {
|
|
6357
6360
|
if (a.type === "tags") return [...a.headings, ...cn().map((l) => ({ level: 2, text: l.name, slug: l.slug }))];
|
|
6358
6361
|
if (a.type === "glossary") return [...a.headings, ...g.map((l) => ({ level: 2, text: l.term, slug: l.slug }))];
|
|
6359
6362
|
if (a.type === "team") {
|
|
@@ -6362,12 +6365,12 @@ export default bodies
|
|
|
6362
6365
|
}
|
|
6363
6366
|
return a.headings;
|
|
6364
6367
|
}
|
|
6365
|
-
function
|
|
6368
|
+
function Do(a) {
|
|
6366
6369
|
const l = s.get(a);
|
|
6367
6370
|
if (!l) return null;
|
|
6368
6371
|
const p = {
|
|
6369
6372
|
html: l.html,
|
|
6370
|
-
headings:
|
|
6373
|
+
headings: Oo(l),
|
|
6371
6374
|
openApiSpec: l.openApiSpec,
|
|
6372
6375
|
openApiFile: l.openApiFile,
|
|
6373
6376
|
openApiUrl: l.openApiUrl,
|
|
@@ -6385,10 +6388,10 @@ export default bodies
|
|
|
6385
6388
|
function At(a) {
|
|
6386
6389
|
return `Custom_${a.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
6387
6390
|
}
|
|
6388
|
-
function
|
|
6391
|
+
function To(a) {
|
|
6389
6392
|
return a.startsWith("/") ? a : "/" + a.replace(/^\.\//, "");
|
|
6390
6393
|
}
|
|
6391
|
-
function
|
|
6394
|
+
function Mo(a) {
|
|
6392
6395
|
const l = s.get(a);
|
|
6393
6396
|
if (!l) return null;
|
|
6394
6397
|
const p = {
|
|
@@ -6396,7 +6399,7 @@ export default bodies
|
|
|
6396
6399
|
path: l.effectivePath,
|
|
6397
6400
|
type: l.type,
|
|
6398
6401
|
frontmatter: l.frontmatter
|
|
6399
|
-
}, b = `${We}${De(a)}.js`, k = JSON.stringify(p).replace(/<\/script>/g, "<\\/script>"), y = Array.from(Ne.entries()), f = y.map(([$, S]) => ` import ${At($)} from ${JSON.stringify(
|
|
6402
|
+
}, b = `${We}${De(a)}.js`, k = JSON.stringify(p).replace(/<\/script>/g, "<\\/script>"), y = Array.from(Ne.entries()), f = y.map(([$, S]) => ` import ${At($)} from ${JSON.stringify(To(S.file))}`).join(`
|
|
6400
6403
|
`), _ = ($, S) => Ne.has($) ? At($) : S, C = [
|
|
6401
6404
|
["team", "TeamPage"],
|
|
6402
6405
|
["pricing", "PricingPage"],
|
|
@@ -6410,7 +6413,7 @@ export default bodies
|
|
|
6410
6413
|
["dbml", "DbmlPage"]
|
|
6411
6414
|
].map(([$, S]) => ` {:else if shell.type === ${JSON.stringify($)}}
|
|
6412
6415
|
<${_($, S)} page={{ ...shell, ...mod.default }} />`).concat(
|
|
6413
|
-
y.filter(([$]) => !
|
|
6416
|
+
y.filter(([$]) => !no.has($)).map(([$]) => ` {:else if shell.type === ${JSON.stringify($)}}
|
|
6414
6417
|
<${At($)} page={{ ...shell, ...mod.default }} />`)
|
|
6415
6418
|
).join(`
|
|
6416
6419
|
`);
|
|
@@ -6462,7 +6465,7 @@ ${C}
|
|
|
6462
6465
|
return {
|
|
6463
6466
|
name: "@nimtech/nimpress:markdown",
|
|
6464
6467
|
async config() {
|
|
6465
|
-
t = (await
|
|
6468
|
+
t = (await us(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), na(process.cwd(), t.pageTypes ?? {});
|
|
6466
6469
|
for (const l of vt(t))
|
|
6467
6470
|
ft.includes(l) || fe(G(process.cwd(), l)) || console.warn(`[nimpress] theme ${l} is neither a built in theme, ${ft.join(" or ")}, nor a stylesheet`);
|
|
6468
6471
|
return o = G(process.cwd(), t.assetsDir), {};
|
|
@@ -6493,9 +6496,9 @@ ${C}
|
|
|
6493
6496
|
const f = q(i, k.replace(/^\//, ""));
|
|
6494
6497
|
await Ue(Y(f), { recursive: !0 }), await pe(f, y);
|
|
6495
6498
|
}
|
|
6496
|
-
await pe(q(i, "subscribe.map.json"), St), await
|
|
6499
|
+
await pe(q(i, "subscribe.map.json"), St), await bo();
|
|
6497
6500
|
const b = Array.from(s.values()).find((k) => k.type === "404" && !Se(k.frontmatter) && !ve(k));
|
|
6498
|
-
b && await mn(q(i, b.effectivePath.replace(/^\//, ""), "index.html"), q(i, "404.html")), await
|
|
6501
|
+
b && await mn(q(i, b.effectivePath.replace(/^\//, ""), "index.html"), q(i, "404.html")), await wo();
|
|
6499
6502
|
},
|
|
6500
6503
|
configureServer(a) {
|
|
6501
6504
|
u = a, a.watcher.add(n), a.watcher.add(o);
|
|
@@ -6531,9 +6534,9 @@ ${C}
|
|
|
6531
6534
|
T.has(f) && de(T.get(f));
|
|
6532
6535
|
};
|
|
6533
6536
|
if (a.watcher.on("add", l), a.watcher.on("unlink", p), t.banner !== !1) {
|
|
6534
|
-
const f =
|
|
6537
|
+
const f = Ds(), _ = t.banner, C = Date.now();
|
|
6535
6538
|
a.printUrls = function() {
|
|
6536
|
-
const $ = a.resolvedUrls, S = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", j =
|
|
6539
|
+
const $ = a.resolvedUrls, S = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", j = Os({
|
|
6537
6540
|
title: _.title ?? t.title ?? f.name ?? "Nimpress",
|
|
6538
6541
|
tagline: _.tagline,
|
|
6539
6542
|
company: _.company,
|
|
@@ -6565,10 +6568,10 @@ ${C}
|
|
|
6565
6568
|
}, k = t.assetUrlBase, y = (f, _, C) => {
|
|
6566
6569
|
if (!_ || _.endsWith(".md")) return !1;
|
|
6567
6570
|
const $ = q(f, decodeURIComponent(_));
|
|
6568
|
-
return !$.startsWith(f) || !fe($) || !gt($).isFile() ? !1 : (C.setHeader("Content-Type", b[Jt($).toLowerCase()] ?? "application/octet-stream"),
|
|
6571
|
+
return !$.startsWith(f) || !fe($) || !gt($).isFile() ? !1 : (C.setHeader("Content-Type", b[Jt($).toLowerCase()] ?? "application/octet-stream"), No($).pipe(C), !0);
|
|
6569
6572
|
};
|
|
6570
6573
|
return a.middlewares.use((f, _, C) => {
|
|
6571
|
-
const $ = (f.url ?? "").split("?")[0], S =
|
|
6574
|
+
const $ = (f.url ?? "").split("?")[0], S = es(t.base, $);
|
|
6572
6575
|
if (S.startsWith("/@") || S.startsWith("/node_modules/")) return C();
|
|
6573
6576
|
if (S === "/__nimpress/claude-md" && f.method === "PUT") {
|
|
6574
6577
|
const F = [];
|
|
@@ -6623,7 +6626,7 @@ ${C}
|
|
|
6623
6626
|
_.statusCode = 404, _.end(`unknown module system: ${B}`);
|
|
6624
6627
|
return;
|
|
6625
6628
|
}
|
|
6626
|
-
const W =
|
|
6629
|
+
const W = Io(
|
|
6627
6630
|
{
|
|
6628
6631
|
host: "127.0.0.1",
|
|
6629
6632
|
port: zt(t.modules, B),
|
|
@@ -6653,7 +6656,7 @@ ${C}
|
|
|
6653
6656
|
try {
|
|
6654
6657
|
const $ = await a.transformIndexHtml(
|
|
6655
6658
|
f.url ?? "/",
|
|
6656
|
-
|
|
6659
|
+
Vr(t, "/@id/__x00__virtual:nimpress/main")
|
|
6657
6660
|
);
|
|
6658
6661
|
_.statusCode = 200, _.setHeader("Content-Type", "text/html"), _.end($);
|
|
6659
6662
|
} catch ($) {
|
|
@@ -6690,9 +6693,9 @@ ${C}
|
|
|
6690
6693
|
},
|
|
6691
6694
|
async load(a) {
|
|
6692
6695
|
if (a === "\0" + it)
|
|
6693
|
-
return `export default ${JSON.stringify(
|
|
6696
|
+
return `export default ${JSON.stringify(jo())}`;
|
|
6694
6697
|
if (a === "\0" + Dt) {
|
|
6695
|
-
const l =
|
|
6698
|
+
const l = ms(t), p = l.announce || l.feedback ? Mn(await D(), be(), t.base, { math: t.math, icons: t.icons }) : null;
|
|
6696
6699
|
if (l.feedback && p && (l.feedback = {
|
|
6697
6700
|
...l.feedback,
|
|
6698
6701
|
ratings: l.feedback.ratings.map((b) => ({ ...b, html: p.renderInline(b.note) }))
|
|
@@ -6727,25 +6730,25 @@ app.mount(target)
|
|
|
6727
6730
|
if (a === "\0" + ct)
|
|
6728
6731
|
return `export default ${JSON.stringify(ln())}`;
|
|
6729
6732
|
if (a === "\0" + lt)
|
|
6730
|
-
return Ao();
|
|
6731
|
-
if (a === "\0" + pt)
|
|
6732
6733
|
return Eo();
|
|
6734
|
+
if (a === "\0" + pt)
|
|
6735
|
+
return Co();
|
|
6733
6736
|
if (a.startsWith(Ge) && a.endsWith(".svelte")) {
|
|
6734
6737
|
const l = a.slice(Ge.length, -7);
|
|
6735
|
-
return
|
|
6738
|
+
return Mo(un(l));
|
|
6736
6739
|
}
|
|
6737
6740
|
if (a.startsWith(We) && a.endsWith(".js")) {
|
|
6738
6741
|
const l = a.slice(We.length, -3);
|
|
6739
|
-
return
|
|
6742
|
+
return Do(un(l));
|
|
6740
6743
|
}
|
|
6741
6744
|
return null;
|
|
6742
6745
|
}
|
|
6743
6746
|
};
|
|
6744
6747
|
}
|
|
6745
|
-
function
|
|
6748
|
+
function vi(e) {
|
|
6746
6749
|
return e;
|
|
6747
6750
|
}
|
|
6748
|
-
async function
|
|
6751
|
+
async function ki(e, t) {
|
|
6749
6752
|
const n = G(e, t), o = await nn(n), s = [];
|
|
6750
6753
|
for (const r of o) {
|
|
6751
6754
|
let i;
|
|
@@ -6756,44 +6759,45 @@ async function vi(e, t) {
|
|
|
6756
6759
|
}
|
|
6757
6760
|
const { data: c, content: u } = _t(i);
|
|
6758
6761
|
typeof c.type == "number" && (c.type = String(c.type));
|
|
6759
|
-
for (const h of
|
|
6762
|
+
for (const h of oo(c, u))
|
|
6760
6763
|
s.push(`${je(n, r).split(xe).join("/")}: ${h}`);
|
|
6761
6764
|
}
|
|
6762
6765
|
return s;
|
|
6763
6766
|
}
|
|
6764
6767
|
export {
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6768
|
+
Da as A,
|
|
6769
|
+
us as B,
|
|
6770
|
+
wi as C,
|
|
6771
|
+
la as D,
|
|
6772
|
+
ra as E,
|
|
6773
|
+
Ua as F,
|
|
6774
|
+
vi as G,
|
|
6775
|
+
Tn as H,
|
|
6776
|
+
Ca as I,
|
|
6777
|
+
wr as a,
|
|
6774
6778
|
Zt as b,
|
|
6775
6779
|
Kt as c,
|
|
6776
6780
|
Ye as d,
|
|
6777
6781
|
$n as e,
|
|
6778
6782
|
Sn as f,
|
|
6779
6783
|
Je as g,
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6784
|
+
yi as h,
|
|
6785
|
+
Vr as i,
|
|
6786
|
+
bi as j,
|
|
6783
6787
|
zt as k,
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
+
na as l,
|
|
6789
|
+
ki as m,
|
|
6790
|
+
Aa as n,
|
|
6791
|
+
Vn as o,
|
|
6788
6792
|
ot as p,
|
|
6789
|
-
|
|
6793
|
+
_i as q,
|
|
6790
6794
|
$t as r,
|
|
6791
6795
|
nt as s,
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6796
|
+
hi as t,
|
|
6797
|
+
yr as u,
|
|
6798
|
+
di as v,
|
|
6795
6799
|
en as w,
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6800
|
+
gi as x,
|
|
6801
|
+
Cr as y,
|
|
6802
|
+
Oa as z
|
|
6799
6803
|
};
|