typerighter 0.57.4 → 0.57.6
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/dist/{app-BQYETY9F.js → app-DN_CSjCr.js} +21 -21
- package/dist/{cli-MA8-6Usn.js → cli-Cm8KzMli.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts +1 -1
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/theme-default.js +1 -1
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-BND13fc5.js → init-C_guo1iW.js} +1 -1
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/node/plugin/vite/virtual/pages.d.ts.map +1 -1
- package/dist/{vite-l2QQKyhl.js → vite-D5VPvBjJ.js} +189 -183
- package/dist/vite.js +1 -1
- package/package.json +7 -7
- package/dist/node/lib/image-dimensions.d.ts +0 -6
- package/dist/node/lib/image-dimensions.d.ts.map +0 -1
|
@@ -7749,15 +7749,15 @@ function df() {
|
|
|
7749
7749
|
// src/client/app/index.ts
|
|
7750
7750
|
var ff = Symbol("typedown-site-config"), pf = Symbol("typedown-site-data"), mf = Symbol("typedown-page-loader"), hf = Symbol("typedown-search-index");
|
|
7751
7751
|
async function gf(e, n) {
|
|
7752
|
-
let { theme: i } = e
|
|
7753
|
-
function
|
|
7752
|
+
let { theme: i } = e;
|
|
7753
|
+
function a(e) {
|
|
7754
7754
|
for (let t of h) {
|
|
7755
|
-
let r = e + t;
|
|
7756
|
-
|
|
7755
|
+
let r = n.value.pages[e + t];
|
|
7756
|
+
if (r) return r;
|
|
7757
7757
|
}
|
|
7758
7758
|
}
|
|
7759
|
-
async function
|
|
7760
|
-
let r =
|
|
7759
|
+
async function o(e) {
|
|
7760
|
+
let r = a(e);
|
|
7761
7761
|
if (r) return r();
|
|
7762
7762
|
if (y(e)) {
|
|
7763
7763
|
let r = t(e), i = n.value.directoryListings[r];
|
|
@@ -7779,35 +7779,35 @@ async function gf(e, n) {
|
|
|
7779
7779
|
}
|
|
7780
7780
|
}
|
|
7781
7781
|
typeof document < "u" && e.lang && (document.documentElement.lang = e.lang);
|
|
7782
|
-
let
|
|
7782
|
+
let s = ki(o, {
|
|
7783
7783
|
basePath: e.basePath,
|
|
7784
7784
|
fallbackComponent: i.NotFound
|
|
7785
7785
|
});
|
|
7786
7786
|
q(n, (e, t) => {
|
|
7787
7787
|
if (t.pages === e.pages) return;
|
|
7788
|
-
let n =
|
|
7789
|
-
!i &&
|
|
7788
|
+
let n = s.route.path, i = h.some((e) => t.pages[n + e] !== void 0), o = !!a(n);
|
|
7789
|
+
!i && o ? s.go(n) : i && !o && s.go(r(n));
|
|
7790
7790
|
});
|
|
7791
|
-
let
|
|
7791
|
+
let c = I({
|
|
7792
7792
|
name: "TypedownApp",
|
|
7793
7793
|
setup() {
|
|
7794
|
-
return uf(
|
|
7794
|
+
return uf(s.route), () => pe(i.Layout);
|
|
7795
7795
|
}
|
|
7796
|
-
}),
|
|
7797
|
-
|
|
7798
|
-
let
|
|
7799
|
-
return
|
|
7800
|
-
app:
|
|
7801
|
-
router:
|
|
7796
|
+
}), l = de(c);
|
|
7797
|
+
l.provide(Di, s), l.provide(ff, e), l.provide(pf, n), l.provide(mf, o);
|
|
7798
|
+
let u = ke(n.value.searchIndex);
|
|
7799
|
+
return l.provide(hf, u), l.component("TypedownContent", Fi), l.component("DirectoryIndex", Dd), l.component("GlossaryIndex", Yd), l.component("Flashcard", af), l.component("Grid", sf), l.component("GridCell", cf), l.component("LucideIcon", ws), i.enhanceApp && await i.enhanceApp({
|
|
7800
|
+
app: l,
|
|
7801
|
+
router: s,
|
|
7802
7802
|
siteConfig: e,
|
|
7803
7803
|
siteData: n
|
|
7804
|
-
}), typeof window < "u" && await
|
|
7804
|
+
}), typeof window < "u" && await s.go(location.href, {
|
|
7805
7805
|
replace: !0,
|
|
7806
7806
|
initialLoad: !0
|
|
7807
7807
|
}), {
|
|
7808
|
-
app:
|
|
7809
|
-
router:
|
|
7810
|
-
searchIndex:
|
|
7808
|
+
app: l,
|
|
7809
|
+
router: s,
|
|
7810
|
+
searchIndex: u
|
|
7811
7811
|
};
|
|
7812
7812
|
}
|
|
7813
7813
|
function _f() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as e, t } from "./vite-
|
|
1
|
+
import { s as e, t } from "./vite-D5VPvBjJ.js";
|
|
2
2
|
import { n } from "./context-CLKZYp4U.js";
|
|
3
3
|
import r from "node:path";
|
|
4
4
|
import i from "picocolors";
|
|
@@ -370,7 +370,7 @@ function A() {
|
|
|
370
370
|
}), process.on("unhandledRejection", (e) => {
|
|
371
371
|
j("runtime", e instanceof Error ? e : Error(String(e)));
|
|
372
372
|
}), i.command("[root]", "Start dev server").alias("dev").option("--port <port>", "Port to listen on").option("--host", "Expose to network").option("--fresh", "Start fresh, ignore cache from previous session").option("--verbose", "Print version and build info").action(async (e, n) => {
|
|
373
|
-
n.verbose && console.log(`${k} cli v0.57.
|
|
373
|
+
n.verbose && console.log(`${k} cli v0.57.6 (built 11/13/2026, 11:26:41 AM)\n`), n.fresh && (process.env.TYPEDOWN_NO_CACHE = "1");
|
|
374
374
|
let r = await a({
|
|
375
375
|
root: N(e),
|
|
376
376
|
configFile: !1,
|
|
@@ -396,7 +396,7 @@ function A() {
|
|
|
396
396
|
}
|
|
397
397
|
process.exit(0);
|
|
398
398
|
}), i.command("init [root]", "Scaffold a new project").option("--name <name>", "Project name").option("--title <title>", "Site title").option("--description <description>", "Site description").option("--yes", "Skip confirmation for existing projects").action(async (e, t) => {
|
|
399
|
-
let { initialize: n } = await import("./init-
|
|
399
|
+
let { initialize: n } = await import("./init-C_guo1iW.js");
|
|
400
400
|
await n(N(e), t);
|
|
401
401
|
}), i.command("preview [root]", "Preview production build").option("--port <port>", "Port to listen on").action(async (e, t) => {
|
|
402
402
|
let r = N(e), i = n(r);
|
|
@@ -435,7 +435,7 @@ function A() {
|
|
|
435
435
|
} finally {
|
|
436
436
|
i.dispose();
|
|
437
437
|
}
|
|
438
|
-
}), i.help(), i.version("0.57.
|
|
438
|
+
}), i.help(), i.version("0.57.6"), i.parse();
|
|
439
439
|
}
|
|
440
440
|
function j(e, t) {
|
|
441
441
|
let n = t instanceof Error ? t.message : String(t);
|
|
@@ -443,7 +443,7 @@ function j(e, t) {
|
|
|
443
443
|
}
|
|
444
444
|
async function M(e) {
|
|
445
445
|
let t = await (await e.getTdContext()).rpc.getVersion();
|
|
446
|
-
console.log(`${k} cli v0.57.
|
|
446
|
+
console.log(`${k} cli v0.57.6 (built 11/13/2026, 11:26:41 AM)`), console.log(`${k} rpc v${t}`), console.log("");
|
|
447
447
|
}
|
|
448
448
|
function N(e) {
|
|
449
449
|
return r.resolve(e ?? process.cwd());
|
package/dist/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as cli } from "./cli-
|
|
1
|
+
export { t as cli } from "./cli-Cm8KzMli.js";
|
|
@@ -39,7 +39,7 @@ export interface TypedownSiteConfig {
|
|
|
39
39
|
export interface TypedownSiteData {
|
|
40
40
|
/** Whether the data has been fetched from the server */
|
|
41
41
|
ready: boolean;
|
|
42
|
-
/** Page loaders keyed by
|
|
42
|
+
/** Page loaders keyed by route path (e.g. "/notes/intro.td") */
|
|
43
43
|
pages: Record<string, () => Promise<PageModule>>;
|
|
44
44
|
/** Content files as a recursive directory tree */
|
|
45
45
|
contentTree: ContentTree;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,GAAG,EACR,KAAK,SAAS,EAEd,KAAK,GAAG,EACR,KAAK,UAAU,EAChB,MAAM,KAAK,CAAC;AAcb,OAAO,EACuB,KAAK,MAAM,EACxC,MAAM,UAAU,CAAC;AAClB,OAAO,EAML,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,SAAS,EAAE,QAAQ,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,OAAO,GACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,KAAK,KAAK,GACX,MAAM,0DAA0D,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,mBAAmB;IACnB,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,KAAK,EAAE,OAAO,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,GAAG,EACR,KAAK,SAAS,EAEd,KAAK,GAAG,EACR,KAAK,UAAU,EAChB,MAAM,KAAK,CAAC;AAcb,OAAO,EACuB,KAAK,MAAM,EACxC,MAAM,UAAU,CAAC;AAClB,OAAO,EAML,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,SAAS,EAAE,QAAQ,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,OAAO,GACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,KAAK,KAAK,GACX,MAAM,0DAA0D,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,mBAAmB;IACnB,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,KAAK,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACjD,kDAAkD;IAClD,WAAW,EAAE,WAAW,CAAC;IACzB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,2CAA2C;IAC3C,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,MAAM,EAAE,SAAS,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE;QACrB,GAAG,EAAE,GAAG,CAAC;QACT,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,kBAAkB,CAAC;QAC/B,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;KACjC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;AAcpE,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,GAC9B,OAAO,CAAC;IACT,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC7C,CAAC,CA4HD;AAED,wBAAgB,aAAa,IAAK,UAAU,GAAG,SAAS,CAEvD;AAGD,wBAAgB,cAAc,IAAK,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAEhE;AAED,wBAAgB,aAAa;mBAWT,MAAM,GAAG,MAAM;IAnOjC,iBAAiB;WACV,MAAM;IACb,uBAAuB;iBACV,MAAM;IACnB,0CAA0C;cAChC,MAAM;IAChB,qDAAqD;aAC5C,MAAM;IACf,0BAA0B;WACnB,MAAM;IACb,wBAAwB;WACjB;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd;IACD,kBAAkB;aACT,MAAM;IACf,mBAAmB;cACT,MAAM;IAChB,qGAAqG;cAC3F,MAAM;IAChB,uBAAuB;UACjB;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE;IACH,mBAAmB;WACZ,aAAa;EA+MrB;AAYD,wBAAgB,WAAW,IAAK,GAAG,CAAC,gBAAgB,CAAC,CAEpD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as e, l as t, n, o as r, r as i, s as a, t as o } from "../useSidebarConfig-0kMemgUS.js";
|
|
2
|
-
import { S as s, _ as c, a as l, b as u, c as d, d as f, f as p, g as m, h, l as g, m as _, o as v, p as y, s as b, u as x, v as S, x as C, y as w } from "../app-
|
|
2
|
+
import { S as s, _ as c, a as l, b as u, c as d, d as f, f as p, g as m, h, l as g, m as _, o as v, p as y, s as b, u as x, v as S, x as C, y as w } from "../app-DN_CSjCr.js";
|
|
3
3
|
export { o as SIDEBAR_COLLAPSED_WIDTH, n as SIDEBAR_DEFAULT_WIDTH, i as SIDEBAR_MAX_WIDTH, e as SIDEBAR_MIN_WIDTH, s as TdBrandIcon, w as TdContentNav, b as TdDirectoryIndex, S as TdFooter, v as TdGlossaryIndex, u as TdKbdShortcut, C as TdKeyName, g as TdLayout, d as TdNotFound, _ as TdPreviousNext, p as TdRail, f as TdThemeToggle, y as TdToc, l as default, h as isTypingTarget, a as useClientPreferences, x as useCopyCode, m as useGlobalHotkey, c as useLocalHotkeys, r as useSidebarConfig, t as useTheme };
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { l as e } from "./useSidebarConfig-0kMemgUS.js";
|
|
2
|
-
import { C as t, T as n, i as r, n as i, r as a, t as o, w as s } from "./app-
|
|
2
|
+
import { C as t, T as n, i as r, n as i, r as a, t as o, w as s } from "./app-DN_CSjCr.js";
|
|
3
3
|
export { t as Content, o as createTypedownApp, s as useRoute, n as useRouter, i as useSiteConfig, a as useSiteData, r as useTdContent, e as useTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-
|
|
2
|
-
import { t as s } from "./cli-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-D5VPvBjJ.js";
|
|
2
|
+
import { t as s } from "./cli-Cm8KzMli.js";
|
|
3
3
|
export { n as PAGES_ID, i as PAGE_DATA_EVENT, t as SEARCH_INDEX_ID, e as SITE_DATA_ID, r as THEME_ID, a as buildSite, s as cli, o as typedown };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-entry.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/app-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"app-entry.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/app-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CA4EzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAKd,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAKrC,qBAAa,YAAa,YAAW,aAAa;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,GAAE,MAAW;IAE9C,IAAI,CAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAKd,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAKrC,qBAAa,YAAa,YAAW,aAAa;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,GAAE,MAAW;IAE9C,IAAI,CAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAmBtD,eAAe,CAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMhD,gBAAgB,CAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAIxC,YAAY,CAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAQlF,kBAAkB,CAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKlE,YAAY,CAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAmBtF,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
|
|
@@ -196,7 +196,7 @@ async function Ne(e) {
|
|
|
196
196
|
}
|
|
197
197
|
// src/node/lib/codegen/app-entry.ts
|
|
198
198
|
function Pe(e, t) {
|
|
199
|
-
let { rootDir: n = ".",
|
|
199
|
+
let { rootDir: n = ".", userComponents: r = [] } = e, i = r.map((e) => `import ${e.name} from ${JSON.stringify(e.absolutePath)};`).join("\n"), a = r.map((e) => `app.component(${JSON.stringify(e.name)}, ${e.name});`).join("\n"), o = JSON.stringify({
|
|
200
200
|
title: e.siteTitle,
|
|
201
201
|
description: e.siteDescription,
|
|
202
202
|
basePath: e.basePath ?? "/",
|
|
@@ -209,7 +209,7 @@ function Pe(e, t) {
|
|
|
209
209
|
nav: e.nav
|
|
210
210
|
});
|
|
211
211
|
return `
|
|
212
|
-
${[
|
|
212
|
+
${[i, "import 'typerighter/style.css';"].filter(Boolean).join("\n")}
|
|
213
213
|
import 'typerighter/fonts.css';
|
|
214
214
|
import('typerighter/math.css');
|
|
215
215
|
import { createTypedownApp } from 'typerighter/client';
|
|
@@ -220,8 +220,8 @@ import { pages as initialPages } from '${t.pages}';
|
|
|
220
220
|
import initialSiteData from '${t.siteData}';
|
|
221
221
|
|
|
222
222
|
const siteData = shallowRef({ ...initialSiteData, pages: initialPages });
|
|
223
|
-
const { app, router, searchIndex: searchIndexRef } = await createTypedownApp({ ...${
|
|
224
|
-
${
|
|
223
|
+
const { app, router, searchIndex: searchIndexRef } = await createTypedownApp({ ...${o}, theme }, siteData);
|
|
224
|
+
${a}
|
|
225
225
|
app.mount('#app');
|
|
226
226
|
|
|
227
227
|
// Load search index in the background after the app is mounted
|
|
@@ -243,9 +243,8 @@ if (import.meta.hot) {
|
|
|
243
243
|
|
|
244
244
|
// Update route.data directly when content changes - Vue SFC setup only re-runs on script block changes
|
|
245
245
|
import.meta.hot.on('${t.pageDataEvent}', ({ filepath, pageData }) => {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
if (eventBase === routeBase) {
|
|
246
|
+
const eventRoute = '/' + path.stripExtension(filepath);
|
|
247
|
+
if (eventRoute === router.route.path) {
|
|
249
248
|
router.route.data = pageData;
|
|
250
249
|
}
|
|
251
250
|
});
|
|
@@ -521,7 +520,8 @@ import { shallowRef } from 'vue';
|
|
|
521
520
|
import theme from ${JSON.stringify(e.themeModulePath)};
|
|
522
521
|
|
|
523
522
|
const rawPages = import.meta.glob('${t}', { eager: true });
|
|
524
|
-
const
|
|
523
|
+
const prefix = '/${e.rootDir}';
|
|
524
|
+
const pages = Object.fromEntries(Object.entries(rawPages).map(([k, v]) => [k.slice(prefix.length), () => Promise.resolve(v)]));
|
|
525
525
|
const siteData = shallowRef({ ...${o}, pages });
|
|
526
526
|
|
|
527
527
|
export async function createRenderer() {
|
|
@@ -552,14 +552,14 @@ function Ue(e, t, n = "") {
|
|
|
552
552
|
p(r.node) || t.push(c(e)), Ue(r.node.entries, t, e);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
// ../../node_modules/.pnpm/@shikijs+transformers@4.
|
|
556
|
-
var We = /(\s+\/\/)/, Ge = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/, Ke = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/, qe = [
|
|
555
|
+
// ../../node_modules/.pnpm/@shikijs+transformers@4.6.0/node_modules/@shikijs/transformers/dist/index.mjs
|
|
556
|
+
var We = /(\s+\/\/)/, Ge = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/, Ke = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/, qe = /^(?:\/\/|["'#]|;{1,2}|%{1,2}|--)$/, Je = [
|
|
557
557
|
[/^(<!--)(.+)(-->)$/, !1],
|
|
558
558
|
[/^(\/\*)(.+)(\*\/)$/, !1],
|
|
559
559
|
[/^(\/\/|["'#]|;{1,2}|%{1,2}|--)(.*)$/, !0],
|
|
560
560
|
[/^(\*)(.+)$/, !0]
|
|
561
561
|
];
|
|
562
|
-
function
|
|
562
|
+
function Ye(e, t, n) {
|
|
563
563
|
let r = [];
|
|
564
564
|
for (let i of e) {
|
|
565
565
|
if (n === "v3") {
|
|
@@ -595,7 +595,7 @@ function Je(e, t, n) {
|
|
|
595
595
|
let t = e[n - 1];
|
|
596
596
|
if (t?.type === "element") {
|
|
597
597
|
let n = t.children.at(0);
|
|
598
|
-
if (n?.type === "text" && n.value.includes("//")) {
|
|
598
|
+
if (n?.type === "text" && (n.value.includes("//") || qe.test(n.value.trim()))) {
|
|
599
599
|
let l = B(n.value + o.value, s);
|
|
600
600
|
if (l) {
|
|
601
601
|
c = l, r.push({
|
|
@@ -613,7 +613,7 @@ function Je(e, t, n) {
|
|
|
613
613
|
}
|
|
614
614
|
if (c) {
|
|
615
615
|
if (t && !s && n !== 0) {
|
|
616
|
-
let t =
|
|
616
|
+
let t = Xe(e[n - 1], "{") && Xe(e[n + 1], "}");
|
|
617
617
|
r.push({
|
|
618
618
|
info: c,
|
|
619
619
|
line: i,
|
|
@@ -635,7 +635,7 @@ function Je(e, t, n) {
|
|
|
635
635
|
}
|
|
636
636
|
return r;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Xe(e, t) {
|
|
639
639
|
if (e.type !== "element") return !1;
|
|
640
640
|
let n = e.children[0];
|
|
641
641
|
return n.type === "text" && n.value.trim() === t;
|
|
@@ -644,7 +644,7 @@ function B(e, t) {
|
|
|
644
644
|
let n = e.trimStart(), r = e.length - n.length;
|
|
645
645
|
n = n.trimEnd();
|
|
646
646
|
let i = e.length - n.length - r;
|
|
647
|
-
for (let [e, a] of
|
|
647
|
+
for (let [e, a] of Je) {
|
|
648
648
|
if (a && !t) continue;
|
|
649
649
|
let o = e.exec(n);
|
|
650
650
|
if (o) return [
|
|
@@ -654,34 +654,35 @@ function B(e, t) {
|
|
|
654
654
|
];
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Ze(e) {
|
|
658
658
|
let t = e.match(Ge);
|
|
659
659
|
return t && t[1].trim().length === 0 ? e.slice(0, t.index) : e;
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Qe(e) {
|
|
662
662
|
let t = e.match(Ke);
|
|
663
663
|
return t && t[1].trim().length === 0 ? e.slice(0, t.index).trimEnd() : e;
|
|
664
664
|
}
|
|
665
|
-
|
|
665
|
+
var $e = /#?\s*\[!code\b(?:\\.|[^\]])*\]/gi;
|
|
666
|
+
function et(e, t, n, r) {
|
|
666
667
|
return r ??= "v3", {
|
|
667
668
|
name: e,
|
|
668
669
|
code(e) {
|
|
669
670
|
let i = e.children.filter((e) => e.type === "element"), a = [];
|
|
670
671
|
e.data ??= {};
|
|
671
672
|
let o = e.data;
|
|
672
|
-
o._shiki_notation ??=
|
|
673
|
+
o._shiki_notation ??= Ye(i, ["jsx", "tsx"].includes(this.options.lang), r);
|
|
673
674
|
let s = o._shiki_notation;
|
|
674
675
|
for (let e of s) {
|
|
675
676
|
if (e.info[1].length === 0) continue;
|
|
676
|
-
let o = i.indexOf(e.line);
|
|
677
|
-
e.isLineCommentOnly && r !== "v1" && o++;
|
|
678
|
-
let
|
|
679
|
-
if (e.info[1] = e.info[1].replace(t, (...t) => n.call(this, t, e.line, e.token, i, o) ? (
|
|
680
|
-
r === "v1" ? e.info[1] =
|
|
681
|
-
let
|
|
682
|
-
if (
|
|
683
|
-
else if (
|
|
684
|
-
else if (
|
|
677
|
+
let o = i.indexOf(e.line), s = e.info[1].replace($e, "").replace(t, "").trim().length === 0;
|
|
678
|
+
e.isLineCommentOnly && s && r !== "v1" && o++;
|
|
679
|
+
let c = !1;
|
|
680
|
+
if (e.info[1] = e.info[1].replace(t, (...t) => n.call(this, t, e.line, e.token, i, o) ? (c = !0, "") : t[0]), !c) continue;
|
|
681
|
+
r === "v1" ? e.info[1] = Ze(e.info[1]) : r === "v3" && (e.info[1] = Qe(e.info[1]));
|
|
682
|
+
let l = e.info[1].trim().length === 0;
|
|
683
|
+
if (l && (e.info[1] = ""), l && e.isLineCommentOnly) a.push(e.line);
|
|
684
|
+
else if (l && e.isJsxStyle) e.line.children.splice(e.line.children.indexOf(e.token) - 1, 3);
|
|
685
|
+
else if (l) {
|
|
685
686
|
if (e.additionalTokens) for (let t = e.additionalTokens.length - 1; t >= 0; t--) {
|
|
686
687
|
let n = e.additionalTokens[t], r = e.line.children.indexOf(n);
|
|
687
688
|
r !== -1 && e.line.children.splice(r, 1);
|
|
@@ -702,42 +703,42 @@ function Qe(e, t, n, r) {
|
|
|
702
703
|
}
|
|
703
704
|
};
|
|
704
705
|
}
|
|
705
|
-
var
|
|
706
|
-
function
|
|
706
|
+
var tt = /\{([\d,-]+)\}/;
|
|
707
|
+
function nt(e) {
|
|
707
708
|
if (!e) return null;
|
|
708
|
-
let t = e.match(
|
|
709
|
+
let t = e.match(tt);
|
|
709
710
|
return t ? t[1].split(",").flatMap((e) => {
|
|
710
711
|
let t = e.split("-").map((e) => Number.parseInt(e, 10));
|
|
711
712
|
return t.length === 1 ? [t[0]] : Array.from({ length: t[1] - t[0] + 1 }, (e, n) => t[0] + n);
|
|
712
713
|
}) : null;
|
|
713
714
|
}
|
|
714
|
-
var
|
|
715
|
-
function
|
|
715
|
+
var rt = Symbol("highlighted-lines");
|
|
716
|
+
function it(e = {}) {
|
|
716
717
|
let { className: t = "highlighted", zeroIndexed: n = !1 } = e;
|
|
717
718
|
return {
|
|
718
719
|
name: "@shikijs/transformers:meta-highlight",
|
|
719
720
|
line(e, r) {
|
|
720
721
|
if (!this.options.meta?.__raw) return;
|
|
721
722
|
let i = this.meta;
|
|
722
|
-
i[
|
|
723
|
-
let a = i[
|
|
723
|
+
i[rt] ??= nt(this.options.meta.__raw);
|
|
724
|
+
let a = i[rt] ?? [], o = n ? r - 1 : r;
|
|
724
725
|
return a.includes(o) && this.addClassToHast(e, t), e;
|
|
725
726
|
}
|
|
726
727
|
};
|
|
727
728
|
}
|
|
728
|
-
var
|
|
729
|
-
function
|
|
730
|
-
return e.replace(
|
|
729
|
+
var at = /[.*+?^${}()|[\]\\]/g;
|
|
730
|
+
function ot(e) {
|
|
731
|
+
return e.replace(at, "\\$&");
|
|
731
732
|
}
|
|
732
733
|
function V(e = {}, t = "@shikijs/transformers:notation-map") {
|
|
733
734
|
let { classMap: n = {}, classActivePre: r = void 0, classActiveCode: i = void 0 } = e;
|
|
734
|
-
return
|
|
735
|
+
return et(t, RegExp(`#?\\s*\\[!code (${Object.keys(n).map(ot).join("|")})(:\\d+)?\\]`, "gi"), function([e, t, a = ":1"], o, s, c, l) {
|
|
735
736
|
let u = Number.parseInt(a.slice(1), 10);
|
|
736
737
|
for (let e = l; e < Math.min(l + u, c.length); e++) this.addClassToHast(c[e], n[t]);
|
|
737
738
|
return r && this.addClassToHast(this.pre, r), i && this.addClassToHast(this.code, i), !0;
|
|
738
739
|
}, e.matchAlgorithm);
|
|
739
740
|
}
|
|
740
|
-
function
|
|
741
|
+
function st(e = {}) {
|
|
741
742
|
let { classLineAdd: t = "diff add", classLineRemove: n = "diff remove", classActivePre: r = "has-diff", classActiveCode: i } = e;
|
|
742
743
|
return V({
|
|
743
744
|
classMap: {
|
|
@@ -749,7 +750,7 @@ function at(e = {}) {
|
|
|
749
750
|
matchAlgorithm: e.matchAlgorithm
|
|
750
751
|
}, "@shikijs/transformers:notation-diff");
|
|
751
752
|
}
|
|
752
|
-
function
|
|
753
|
+
function ct(e = {}) {
|
|
753
754
|
let { classMap: t = {
|
|
754
755
|
error: ["highlighted", "error"],
|
|
755
756
|
warning: ["highlighted", "warning"],
|
|
@@ -762,7 +763,7 @@ function ot(e = {}) {
|
|
|
762
763
|
matchAlgorithm: e.matchAlgorithm
|
|
763
764
|
}, "@shikijs/transformers:notation-error-level");
|
|
764
765
|
}
|
|
765
|
-
function
|
|
766
|
+
function lt(e = {}) {
|
|
766
767
|
let { classActiveLine: t = "focused", classActivePre: n = "has-focused", classActiveCode: r } = e;
|
|
767
768
|
return V({
|
|
768
769
|
classMap: { focus: t },
|
|
@@ -771,7 +772,7 @@ function st(e = {}) {
|
|
|
771
772
|
matchAlgorithm: e.matchAlgorithm
|
|
772
773
|
}, "@shikijs/transformers:notation-focus");
|
|
773
774
|
}
|
|
774
|
-
function
|
|
775
|
+
function ut(e = {}) {
|
|
775
776
|
let { classActiveLine: t = "highlighted", classActivePre: n = "has-highlighted", classActiveCode: r } = e;
|
|
776
777
|
return V({
|
|
777
778
|
classMap: {
|
|
@@ -784,41 +785,41 @@ function ct(e = {}) {
|
|
|
784
785
|
}, "@shikijs/transformers:notation-highlight");
|
|
785
786
|
}
|
|
786
787
|
// src/node/lib/render/highlight/language.ts
|
|
787
|
-
var
|
|
788
|
+
var dt = [
|
|
788
789
|
"shellscript",
|
|
789
790
|
"shell",
|
|
790
791
|
"bash",
|
|
791
792
|
"sh",
|
|
792
793
|
"zsh"
|
|
793
794
|
];
|
|
794
|
-
function ut(e) {
|
|
795
|
-
return lt.includes(e);
|
|
796
|
-
}
|
|
797
|
-
var dt = /^[a-zA-Z0-9-_]+/;
|
|
798
795
|
function ft(e) {
|
|
799
|
-
return dt.
|
|
796
|
+
return dt.includes(e);
|
|
797
|
+
}
|
|
798
|
+
var pt = /^[a-zA-Z0-9-_]+/;
|
|
799
|
+
function mt(e) {
|
|
800
|
+
return pt.exec(e)?.[0] || "";
|
|
800
801
|
}
|
|
801
802
|
// src/node/lib/render/highlight/index.ts
|
|
802
|
-
var
|
|
803
|
+
var ht = new FinalizationRegistry((e) => {
|
|
803
804
|
e();
|
|
804
805
|
}), H = {
|
|
805
806
|
light: "github-light",
|
|
806
807
|
dark: "github-dark"
|
|
807
808
|
};
|
|
808
|
-
async function
|
|
809
|
+
async function gt() {
|
|
809
810
|
let e = await be({
|
|
810
811
|
themes: [H.light, H.dark],
|
|
811
812
|
langs: []
|
|
812
813
|
}), t = [
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
814
|
+
it(),
|
|
815
|
+
st(),
|
|
816
|
+
lt({
|
|
816
817
|
classActiveLine: "has-focus",
|
|
817
818
|
classActivePre: "has-focused-lines"
|
|
818
819
|
}),
|
|
820
|
+
ut(),
|
|
819
821
|
ct(),
|
|
820
|
-
|
|
821
|
-
ht(),
|
|
822
|
+
_t(),
|
|
822
823
|
{
|
|
823
824
|
name: "typedown:add-dir",
|
|
824
825
|
pre(e) {
|
|
@@ -827,7 +828,7 @@ async function mt() {
|
|
|
827
828
|
}
|
|
828
829
|
], n = new Set(e.getLoadedLanguages());
|
|
829
830
|
async function r(r, i, a, o) {
|
|
830
|
-
let s =
|
|
831
|
+
let s = mt(i);
|
|
831
832
|
if (s) {
|
|
832
833
|
let e = i;
|
|
833
834
|
i = s.toLowerCase(), a = e.slice(i.length).replace(/(?<!=)\{/g, " {") + " " + a, a = a.trim().replace(/\s+/g, " ");
|
|
@@ -860,7 +861,7 @@ async function mt() {
|
|
|
860
861
|
});
|
|
861
862
|
}
|
|
862
863
|
},
|
|
863
|
-
...o === void 0 ? [] : [
|
|
864
|
+
...o === void 0 ? [] : [vt(o)]
|
|
864
865
|
],
|
|
865
866
|
meta: { __raw: a },
|
|
866
867
|
themes: H,
|
|
@@ -888,13 +889,13 @@ async function mt() {
|
|
|
888
889
|
}
|
|
889
890
|
});
|
|
890
891
|
}
|
|
891
|
-
return
|
|
892
|
+
return ht.register(r, () => e.dispose()), r;
|
|
892
893
|
}
|
|
893
|
-
function
|
|
894
|
+
function _t() {
|
|
894
895
|
return {
|
|
895
896
|
name: "typedown:disable-shell-symbol-select",
|
|
896
897
|
tokens(e) {
|
|
897
|
-
if (
|
|
898
|
+
if (ft(this.options.lang)) for (let t of e) {
|
|
898
899
|
if (t.length < 2) continue;
|
|
899
900
|
let e = t[0].content.trim();
|
|
900
901
|
(e === "$" || e === ">") && t[1].content[0] === " " && (t[0].content = e + " ", t[0].htmlStyle ??= {}, t[0].htmlStyle["user-select"] = "none", t[0].htmlStyle["-webkit-user-select"] = "none", t[1].content = t[1].content.slice(1));
|
|
@@ -902,7 +903,7 @@ function ht() {
|
|
|
902
903
|
}
|
|
903
904
|
};
|
|
904
905
|
}
|
|
905
|
-
function
|
|
906
|
+
function vt(e) {
|
|
906
907
|
return {
|
|
907
908
|
name: "typedown:line-numbers",
|
|
908
909
|
code(t) {
|
|
@@ -934,23 +935,23 @@ function gt(e) {
|
|
|
934
935
|
};
|
|
935
936
|
}
|
|
936
937
|
// src/node/lib/render/postprocess.ts
|
|
937
|
-
var
|
|
938
|
-
async function
|
|
939
|
-
return e = await
|
|
938
|
+
var yt;
|
|
939
|
+
async function bt(e) {
|
|
940
|
+
return e = await Ct(e), e = kt(e), e;
|
|
940
941
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
942
|
+
function xt() {
|
|
943
|
+
return yt ||= gt(), yt;
|
|
943
944
|
}
|
|
944
|
-
var
|
|
945
|
+
var St = /<pre class="td-code-placeholder"([^>]*)><code>([\s\S]*?)<\/code><\/pre>/g;
|
|
945
946
|
function U(e, t) {
|
|
946
947
|
return e.match(RegExp(`${t}="([^"]*)"`))?.[1];
|
|
947
948
|
}
|
|
948
|
-
async function
|
|
949
|
-
let t = await
|
|
949
|
+
async function Ct(e) {
|
|
950
|
+
let t = await xt(), n = [...e.matchAll(St)];
|
|
950
951
|
if (n.length === 0) return e;
|
|
951
952
|
let r = await Promise.all(n.map(async (e) => {
|
|
952
953
|
let n = e[1], r = U(n, "data-lang") ?? "", i = U(n, "data-meta") ?? "", a = U(n, "data-title"), o = U(n, "data-line-numbers"), s = g(e[2]);
|
|
953
|
-
return
|
|
954
|
+
return Et(await t(s, r, i, o === void 0 ? void 0 : parseInt(o) || 1), r, {
|
|
954
955
|
title: a,
|
|
955
956
|
lineNumbers: o
|
|
956
957
|
});
|
|
@@ -961,7 +962,7 @@ async function xt(e) {
|
|
|
961
962
|
}
|
|
962
963
|
return i;
|
|
963
964
|
}
|
|
964
|
-
var
|
|
965
|
+
var wt = {
|
|
965
966
|
typescript: "TypeScript",
|
|
966
967
|
javascript: "JavaScript",
|
|
967
968
|
tsx: "TSX",
|
|
@@ -1009,24 +1010,24 @@ var St = {
|
|
|
1009
1010
|
scala: "Scala",
|
|
1010
1011
|
txt: "Text"
|
|
1011
1012
|
};
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
1013
|
+
function Tt(e) {
|
|
1014
|
+
return wt[e.toLowerCase()] ?? e;
|
|
1014
1015
|
}
|
|
1015
|
-
function
|
|
1016
|
+
function Et(e, t, n) {
|
|
1016
1017
|
t ||= "txt";
|
|
1017
|
-
let r =
|
|
1018
|
+
let r = Tt(t), i = ["td-code-block", "language-" + t];
|
|
1018
1019
|
n.title && i.push("has-title"), n.lineNumbers !== void 0 && i.push("line-numbers-mode");
|
|
1019
1020
|
let a = `<figure class="${i.join(" ")}">`;
|
|
1020
1021
|
return a += "<figcaption class=\"td-code-header\">", a += "<span class=\"td-code-left\">", a += `<span class="td-code-lang">${h(r)}</span>`, n.title && (a += `<span class="td-code-label">${h(n.title)}</span>`), a += "</span>", a += "<span class=\"td-code-actions\">", a += "<button type=\"button\" aria-label=\"Copy code\" data-copied=\"Copied\" class=\"td-code-copy\">", a += "<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"></rect><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"></path></svg>", a += "<span class=\"td-code-copy-text\">Copy</span>", a += "</button>", a += "</span>", a += "</figcaption>", a += e, a += "</figure>", a;
|
|
1021
1022
|
}
|
|
1022
|
-
var
|
|
1023
|
-
function Dt(e) {
|
|
1024
|
-
return e = e.replace(Tt, (e, t) => At(t, !1)), e = e.replace(Et, (e, t) => At(t, !0)), e;
|
|
1025
|
-
}
|
|
1026
|
-
var Ot = /`([^`]+)`|\$([^$]+)\$/g;
|
|
1023
|
+
var Dt = /<span class="td-math-inline">([\s\S]*?)<\/span>/g, Ot = /<div class="td-math-block">([\s\S]*?)<\/div>/g;
|
|
1027
1024
|
function kt(e) {
|
|
1025
|
+
return e = e.replace(Dt, (e, t) => Mt(t, !1)), e = e.replace(Ot, (e, t) => Mt(t, !0)), e;
|
|
1026
|
+
}
|
|
1027
|
+
var At = /`([^`]+)`|\$([^$]+)\$/g;
|
|
1028
|
+
function jt(e) {
|
|
1028
1029
|
let t = 0, n = "";
|
|
1029
|
-
for (let r of e.matchAll(
|
|
1030
|
+
for (let r of e.matchAll(At)) {
|
|
1030
1031
|
if (n += h(e.slice(t, r.index)), r[1] !== void 0) n += `<code>${h(r[1])}</code>`;
|
|
1031
1032
|
else if (r[2] !== void 0) try {
|
|
1032
1033
|
n += k.renderToString(r[2], { throwOnError: !1 });
|
|
@@ -1037,7 +1038,7 @@ function kt(e) {
|
|
|
1037
1038
|
}
|
|
1038
1039
|
return n += h(e.slice(t)), n;
|
|
1039
1040
|
}
|
|
1040
|
-
function
|
|
1041
|
+
function Mt(e, t) {
|
|
1041
1042
|
let n = t ? "div" : "span";
|
|
1042
1043
|
try {
|
|
1043
1044
|
return k.renderToString(g(e), {
|
|
@@ -1057,17 +1058,17 @@ async function W(e, t, n) {
|
|
|
1057
1058
|
label: t.label,
|
|
1058
1059
|
icon: t.icon,
|
|
1059
1060
|
frontmatter: t.header ?? {},
|
|
1060
|
-
headings:
|
|
1061
|
+
headings: Pt(t.headings),
|
|
1061
1062
|
title: r,
|
|
1062
|
-
titleHtml:
|
|
1063
|
+
titleHtml: jt(r),
|
|
1063
1064
|
filepath: n,
|
|
1064
1065
|
fileMetadata: t.fileMetadata,
|
|
1065
1066
|
seoMetadata: t.seoMetadata,
|
|
1066
1067
|
excerpt: t.excerpt
|
|
1067
1068
|
};
|
|
1068
1069
|
}
|
|
1069
|
-
async function
|
|
1070
|
-
let r = await
|
|
1070
|
+
async function Nt(e, t, n) {
|
|
1071
|
+
let r = await bt(t.content), i = await W(e, t, n), a = JSON.stringify(`@typedown/pages?resource=${encodeURIComponent(n)}`);
|
|
1071
1072
|
return {
|
|
1072
1073
|
vueSrc: [
|
|
1073
1074
|
"<script>",
|
|
@@ -1079,12 +1080,12 @@ async function jt(e, t, n) {
|
|
|
1079
1080
|
`import { pageData } from ${a}`,
|
|
1080
1081
|
"useRouter().route.data = pageData",
|
|
1081
1082
|
"<\/script>",
|
|
1082
|
-
`<template><div class="typedown-content">\n${
|
|
1083
|
+
`<template><div class="typedown-content">\n${Ft(r)}\n</div></template>`
|
|
1083
1084
|
].join("\n"),
|
|
1084
1085
|
pageData: i
|
|
1085
1086
|
};
|
|
1086
1087
|
}
|
|
1087
|
-
function
|
|
1088
|
+
function Pt(e) {
|
|
1088
1089
|
let t = [], n = [];
|
|
1089
1090
|
for (let r of e) {
|
|
1090
1091
|
let e = {
|
|
@@ -1100,13 +1101,13 @@ function Mt(e) {
|
|
|
1100
1101
|
}
|
|
1101
1102
|
return t;
|
|
1102
1103
|
}
|
|
1103
|
-
function
|
|
1104
|
+
function Ft(e) {
|
|
1104
1105
|
return e.replaceAll("{{", "{{").replaceAll("}}", "}}");
|
|
1105
1106
|
}
|
|
1106
1107
|
// src/node/plugin/vite/constants.ts
|
|
1107
|
-
var
|
|
1108
|
+
var It = "@typedown/app", Lt = "\0@typedown/app", G = "@typedown/pages", Rt = "\0" + G;
|
|
1108
1109
|
G + "";
|
|
1109
|
-
var K = "\0@typedown/pages?resource=", q = "@typedown/site-data",
|
|
1110
|
+
var K = "\0@typedown/pages?resource=", q = "@typedown/site-data", zt = "\0@typedown/site-data", J = "@typedown/search-index", Bt = "\0@typedown/search-index", Y = "@typedown/theme", Vt = "\0@typedown/theme", X = "typedown:page-data";
|
|
1110
1111
|
// src/node/plugin/vite/virtual/utils.ts
|
|
1111
1112
|
function Z(e, t) {
|
|
1112
1113
|
let n = e.moduleGraph.getModuleById(t);
|
|
@@ -1124,7 +1125,7 @@ function Z(e, t) {
|
|
|
1124
1125
|
}
|
|
1125
1126
|
}
|
|
1126
1127
|
// src/node/plugin/vite/virtual/app.ts
|
|
1127
|
-
var
|
|
1128
|
+
var Ht = class {
|
|
1128
1129
|
mountPath;
|
|
1129
1130
|
constructor(e = "") {
|
|
1130
1131
|
this.mountPath = e;
|
|
@@ -1153,16 +1154,21 @@ var Bt = class {
|
|
|
1153
1154
|
});
|
|
1154
1155
|
}
|
|
1155
1156
|
invalidate(e) {
|
|
1156
|
-
Z(e,
|
|
1157
|
+
Z(e, Lt);
|
|
1157
1158
|
}
|
|
1158
|
-
},
|
|
1159
|
+
}, Ut = class {
|
|
1159
1160
|
mountPath;
|
|
1160
1161
|
constructor(e = "") {
|
|
1161
1162
|
this.mountPath = e;
|
|
1162
1163
|
}
|
|
1163
1164
|
async load(e) {
|
|
1164
|
-
let t = (await e.getConfig()).rootDir ?? ".", n = [this.mountPath, t === "." ? "" : t].filter(Boolean);
|
|
1165
|
-
return
|
|
1165
|
+
let t = (await e.getConfig()).rootDir ?? ".", n = [this.mountPath, t === "." ? "" : t].filter(Boolean), r = 0 < n.length ? "/" + n.join("/") : "";
|
|
1166
|
+
return [
|
|
1167
|
+
`const raw = import.meta.glob('${r ? `${r}/**/*.{td,md}` : "/**/*.{td,md}"}');`,
|
|
1168
|
+
"export const pages = Object.fromEntries(",
|
|
1169
|
+
` Object.entries(raw).map(([k, v]) => [k.slice(${r.length}), v])`,
|
|
1170
|
+
");"
|
|
1171
|
+
].join("\n");
|
|
1166
1172
|
}
|
|
1167
1173
|
resolvePageData(e) {
|
|
1168
1174
|
if (e.startsWith("@typedown/pages?resource=")) return "\0" + e;
|
|
@@ -1193,21 +1199,21 @@ var Bt = class {
|
|
|
1193
1199
|
});
|
|
1194
1200
|
}
|
|
1195
1201
|
invalidate(e) {
|
|
1196
|
-
Z(e,
|
|
1202
|
+
Z(e, Rt);
|
|
1197
1203
|
}
|
|
1198
|
-
},
|
|
1204
|
+
}, Wt = class {
|
|
1199
1205
|
async load(e) {
|
|
1200
1206
|
return Fe((await (await e.getTdContext()).getConfig()).layout ?? void 0, e.root);
|
|
1201
1207
|
}
|
|
1202
1208
|
invalidate(e) {
|
|
1203
|
-
Z(e,
|
|
1209
|
+
Z(e, Vt);
|
|
1204
1210
|
}
|
|
1205
|
-
},
|
|
1211
|
+
}, Gt = "\0@typedown/site-data", Kt = {
|
|
1206
1212
|
ready: !1,
|
|
1207
1213
|
contentTree: { entries: [] },
|
|
1208
1214
|
schemas: {},
|
|
1209
1215
|
directoryListings: {}
|
|
1210
|
-
},
|
|
1216
|
+
}, qt = class {
|
|
1211
1217
|
data;
|
|
1212
1218
|
scan(e) {
|
|
1213
1219
|
let t = me("**/*.td", {
|
|
@@ -1228,27 +1234,27 @@ var Bt = class {
|
|
|
1228
1234
|
let t = this.data ? {
|
|
1229
1235
|
ready: !0,
|
|
1230
1236
|
...this.data
|
|
1231
|
-
} :
|
|
1237
|
+
} : Kt;
|
|
1232
1238
|
return `export default ${JSON.stringify(t)}`;
|
|
1233
1239
|
}
|
|
1234
1240
|
clear() {
|
|
1235
1241
|
this.data = void 0;
|
|
1236
1242
|
}
|
|
1237
1243
|
fetch = x((e, t) => {
|
|
1238
|
-
|
|
1244
|
+
Jt(e).then((e) => {
|
|
1239
1245
|
this.data = e, t && this.invalidate(t);
|
|
1240
1246
|
}).catch((e) => {
|
|
1241
1247
|
console.error("[typedown] Failed to fetch site data:", e instanceof Error ? e.message : e);
|
|
1242
1248
|
});
|
|
1243
1249
|
}, 200);
|
|
1244
1250
|
async fetchSync(e) {
|
|
1245
|
-
this.data = await
|
|
1251
|
+
this.data = await Jt(e);
|
|
1246
1252
|
}
|
|
1247
1253
|
invalidate(e) {
|
|
1248
|
-
Z(e,
|
|
1254
|
+
Z(e, Gt);
|
|
1249
1255
|
}
|
|
1250
1256
|
};
|
|
1251
|
-
async function
|
|
1257
|
+
async function Jt(e) {
|
|
1252
1258
|
let [t, n, r] = await Promise.all([
|
|
1253
1259
|
e.getConfig(),
|
|
1254
1260
|
e.listSidebar(),
|
|
@@ -1264,7 +1270,7 @@ async function Kt(e) {
|
|
|
1264
1270
|
};
|
|
1265
1271
|
}
|
|
1266
1272
|
// src/node/lib/search-indexer/index.ts
|
|
1267
|
-
var
|
|
1273
|
+
var Yt = class {
|
|
1268
1274
|
index;
|
|
1269
1275
|
constructor() {
|
|
1270
1276
|
this.index = new ie({
|
|
@@ -1287,19 +1293,19 @@ var qt = class {
|
|
|
1287
1293
|
}
|
|
1288
1294
|
};
|
|
1289
1295
|
// src/node/lib/search-indexer/scan.ts
|
|
1290
|
-
function
|
|
1291
|
-
let n =
|
|
1296
|
+
function Xt(e, t) {
|
|
1297
|
+
let n = en(e), r = [];
|
|
1292
1298
|
for (let t of n) {
|
|
1293
|
-
let n =
|
|
1299
|
+
let n = $t(e, t);
|
|
1294
1300
|
n && r.push(n);
|
|
1295
1301
|
}
|
|
1296
1302
|
t.addAll(r);
|
|
1297
1303
|
}
|
|
1298
|
-
function
|
|
1299
|
-
let i =
|
|
1304
|
+
function Zt(e, n, r) {
|
|
1305
|
+
let i = $t(e, M(e, n));
|
|
1300
1306
|
i ? r.addPage(i) : r.discardPage(t(n));
|
|
1301
1307
|
}
|
|
1302
|
-
function
|
|
1308
|
+
function Qt(e, t) {
|
|
1303
1309
|
let n = T(e);
|
|
1304
1310
|
if (!t.startsWith("---")) return {
|
|
1305
1311
|
title: n,
|
|
@@ -1316,7 +1322,7 @@ function Xt(e, t) {
|
|
|
1316
1322
|
body: a
|
|
1317
1323
|
};
|
|
1318
1324
|
}
|
|
1319
|
-
function
|
|
1325
|
+
function $t(e, n) {
|
|
1320
1326
|
let r;
|
|
1321
1327
|
try {
|
|
1322
1328
|
r = he(n, "utf-8");
|
|
@@ -1324,46 +1330,46 @@ function Zt(e, n) {
|
|
|
1324
1330
|
return;
|
|
1325
1331
|
}
|
|
1326
1332
|
if (!r.trim()) return;
|
|
1327
|
-
let i = n.slice(e.length + 1), { title: a, body: o } =
|
|
1333
|
+
let i = n.slice(e.length + 1), { title: a, body: o } = Qt(i, r);
|
|
1328
1334
|
return {
|
|
1329
1335
|
id: t(i),
|
|
1330
1336
|
title: a,
|
|
1331
1337
|
text: `${a}\n${o}`
|
|
1332
1338
|
};
|
|
1333
1339
|
}
|
|
1334
|
-
function
|
|
1340
|
+
function en(e) {
|
|
1335
1341
|
return me("**/*.td", {
|
|
1336
1342
|
cwd: e,
|
|
1337
1343
|
exclude: (e) => e.startsWith("_")
|
|
1338
1344
|
}).map((t) => M(e, t));
|
|
1339
1345
|
}
|
|
1340
1346
|
// src/node/plugin/vite/virtual/search-index.ts
|
|
1341
|
-
var
|
|
1342
|
-
indexer = new
|
|
1347
|
+
var tn = "\0@typedown/search-index", nn = class {
|
|
1348
|
+
indexer = new Yt();
|
|
1343
1349
|
load(e) {
|
|
1344
1350
|
return `export default ${JSON.stringify(this.indexer.serialize())}`;
|
|
1345
1351
|
}
|
|
1346
1352
|
index(e) {
|
|
1347
|
-
|
|
1353
|
+
Xt(e, this.indexer);
|
|
1348
1354
|
}
|
|
1349
1355
|
reindex(e, t) {
|
|
1350
|
-
|
|
1356
|
+
Zt(e, t, this.indexer);
|
|
1351
1357
|
}
|
|
1352
1358
|
invalidate(e) {
|
|
1353
|
-
Z(e,
|
|
1359
|
+
Z(e, tn);
|
|
1354
1360
|
}
|
|
1355
|
-
},
|
|
1356
|
-
function
|
|
1361
|
+
}, rn = _e(import.meta.url);
|
|
1362
|
+
function an() {
|
|
1357
1363
|
return [{
|
|
1358
1364
|
find: "vue/server-renderer",
|
|
1359
|
-
replacement:
|
|
1365
|
+
replacement: rn.resolve("vue/server-renderer")
|
|
1360
1366
|
}, {
|
|
1361
1367
|
find: "vue",
|
|
1362
|
-
replacement:
|
|
1368
|
+
replacement: rn.resolve("vue/dist/vue.runtime.esm-bundler.js")
|
|
1363
1369
|
}];
|
|
1364
1370
|
}
|
|
1365
1371
|
// src/node/plugin/vite/middleware/vault-assets.ts
|
|
1366
|
-
var
|
|
1372
|
+
var on = {
|
|
1367
1373
|
jpg: "image/jpeg",
|
|
1368
1374
|
jpeg: "image/jpeg",
|
|
1369
1375
|
png: "image/png",
|
|
@@ -1381,7 +1387,7 @@ var rn = {
|
|
|
1381
1387
|
woff: "font/woff",
|
|
1382
1388
|
ttf: "font/ttf"
|
|
1383
1389
|
};
|
|
1384
|
-
function
|
|
1390
|
+
function sn(e, t) {
|
|
1385
1391
|
return (n, i, o) => {
|
|
1386
1392
|
if (!n.url || n.method !== "GET" || i.writableEnded) return o();
|
|
1387
1393
|
let c = a(n.url);
|
|
@@ -1390,7 +1396,7 @@ function an(e, t) {
|
|
|
1390
1396
|
if (pe(d)) try {
|
|
1391
1397
|
let e = ge(d);
|
|
1392
1398
|
if (e.isFile()) {
|
|
1393
|
-
let t =
|
|
1399
|
+
let t = on[s(d).slice(1).toLowerCase()] ?? "application/octet-stream";
|
|
1394
1400
|
i.setHeader("Content-Type", t), i.setHeader("Content-Length", e.size), fe(d).pipe(i);
|
|
1395
1401
|
return;
|
|
1396
1402
|
}
|
|
@@ -1399,7 +1405,7 @@ function an(e, t) {
|
|
|
1399
1405
|
};
|
|
1400
1406
|
}
|
|
1401
1407
|
// src/node/plugin/vite/middleware/virtual-html.ts
|
|
1402
|
-
function
|
|
1408
|
+
function cn(e, t, n) {
|
|
1403
1409
|
return (i, o, s) => {
|
|
1404
1410
|
if (!i.url) return s();
|
|
1405
1411
|
let c = r(a(i.url)), l = r(n.basePath);
|
|
@@ -1407,22 +1413,22 @@ function on(e, t, n) {
|
|
|
1407
1413
|
let u = c.slice(l.length);
|
|
1408
1414
|
if (u.startsWith("/@") || u.startsWith("/node_modules") || c.includes(".") && !c.endsWith("/index.html")) return s();
|
|
1409
1415
|
t.getConfig().then(async (t) => {
|
|
1410
|
-
let r = await e.transformIndexHtml(i.url ?? "",
|
|
1416
|
+
let r = await e.transformIndexHtml(i.url ?? "", ln(n, t));
|
|
1411
1417
|
o.setHeader("Content-Type", "text/html"), o.end(r);
|
|
1412
1418
|
}).catch(() => s());
|
|
1413
1419
|
};
|
|
1414
1420
|
}
|
|
1415
|
-
function
|
|
1421
|
+
function ln(e, t) {
|
|
1416
1422
|
return e.devHtml === void 0 && (e.devHtml = D({
|
|
1417
1423
|
title: t.siteTitle,
|
|
1418
1424
|
description: t.siteDescription,
|
|
1419
1425
|
base: "/",
|
|
1420
1426
|
ogType: "website",
|
|
1421
|
-
entryScript:
|
|
1427
|
+
entryScript: It
|
|
1422
1428
|
})), e.devHtml;
|
|
1423
1429
|
}
|
|
1424
1430
|
// src/node/lib/prop-schema.ts
|
|
1425
|
-
function
|
|
1431
|
+
function un(e, t, n) {
|
|
1426
1432
|
let r = {};
|
|
1427
1433
|
for (let i of e) {
|
|
1428
1434
|
let e = `./${j.relative(t, i.absolutePath)}`;
|
|
@@ -1448,7 +1454,7 @@ function cn(e, t, n) {
|
|
|
1448
1454
|
}
|
|
1449
1455
|
return r;
|
|
1450
1456
|
}
|
|
1451
|
-
function
|
|
1457
|
+
function dn(e) {
|
|
1452
1458
|
if (!e || e.length !== 1) return;
|
|
1453
1459
|
let t = Q(e[0]);
|
|
1454
1460
|
return t === void 0 ? void 0 : {
|
|
@@ -1456,17 +1462,17 @@ function ln(e) {
|
|
|
1456
1462
|
items: t
|
|
1457
1463
|
};
|
|
1458
1464
|
}
|
|
1459
|
-
function
|
|
1460
|
-
if (t && 0 < Object.keys(t).length) return
|
|
1465
|
+
function fn(e, t) {
|
|
1466
|
+
if (t && 0 < Object.keys(t).length) return mn(t);
|
|
1461
1467
|
let n = /^(?:Record<string,\s*(\w+)>|\{\s*\[key:\s*string\]:\s*(\w+);\s*\})$/.exec(e);
|
|
1462
1468
|
if (!n) return;
|
|
1463
|
-
let r =
|
|
1469
|
+
let r = pn(n[1] ?? n[2]);
|
|
1464
1470
|
return r === void 0 ? void 0 : {
|
|
1465
1471
|
type: "object",
|
|
1466
1472
|
additionalProperties: r
|
|
1467
1473
|
};
|
|
1468
1474
|
}
|
|
1469
|
-
function
|
|
1475
|
+
function pn(e) {
|
|
1470
1476
|
switch (e) {
|
|
1471
1477
|
case "string": return { type: "string" };
|
|
1472
1478
|
case "number": return { type: "number" };
|
|
@@ -1480,7 +1486,7 @@ function dn(e) {
|
|
|
1480
1486
|
let t = e.replace(/^["']|["']$/g, "");
|
|
1481
1487
|
i.push({ const: t });
|
|
1482
1488
|
} else {
|
|
1483
|
-
let t =
|
|
1489
|
+
let t = pn(e);
|
|
1484
1490
|
if (t === void 0) return;
|
|
1485
1491
|
i.push(t);
|
|
1486
1492
|
}
|
|
@@ -1490,7 +1496,7 @@ function dn(e) {
|
|
|
1490
1496
|
return;
|
|
1491
1497
|
}
|
|
1492
1498
|
}
|
|
1493
|
-
function
|
|
1499
|
+
function mn(e) {
|
|
1494
1500
|
let t = {}, n = [];
|
|
1495
1501
|
for (let [r, i] of Object.entries(e)) {
|
|
1496
1502
|
let e = Q(i.schema);
|
|
@@ -1505,16 +1511,16 @@ function fn(e) {
|
|
|
1505
1511
|
return 0 < n.length && (r.required = n), r;
|
|
1506
1512
|
}
|
|
1507
1513
|
function Q(e) {
|
|
1508
|
-
if (typeof e == "string") return
|
|
1514
|
+
if (typeof e == "string") return pn(e);
|
|
1509
1515
|
switch (e.kind) {
|
|
1510
|
-
case "enum": return
|
|
1511
|
-
case "array": return
|
|
1512
|
-
case "object": return
|
|
1516
|
+
case "enum": return hn(e.schema);
|
|
1517
|
+
case "array": return dn(e.schema);
|
|
1518
|
+
case "object": return fn(e.type, e.schema);
|
|
1513
1519
|
case "literal": return "value" in e ? { const: e.value } : void 0;
|
|
1514
1520
|
default: return;
|
|
1515
1521
|
}
|
|
1516
1522
|
}
|
|
1517
|
-
function
|
|
1523
|
+
function hn(e) {
|
|
1518
1524
|
let t = e ?? [], n = t.some((e) => e === "undefined" || e === "null"), r = t.filter((e) => e !== "undefined" && e !== "null");
|
|
1519
1525
|
if (r.length === 0) return;
|
|
1520
1526
|
if (r.length === 1) {
|
|
@@ -1541,41 +1547,41 @@ function pn(e) {
|
|
|
1541
1547
|
return n ? o(a) : a;
|
|
1542
1548
|
}
|
|
1543
1549
|
// src/node/plugin/vite/subplugins/component-contract.ts
|
|
1544
|
-
var
|
|
1545
|
-
function
|
|
1550
|
+
var gn = ".typedown/components.json";
|
|
1551
|
+
function _n(e) {
|
|
1546
1552
|
return {
|
|
1547
1553
|
name: "vite-plugin-typedown-component-contract",
|
|
1548
1554
|
async buildStart() {
|
|
1549
1555
|
let t = e();
|
|
1550
1556
|
if (!t) return;
|
|
1551
1557
|
let n = await R((await (await t.getTdContext()).getConfig()).components, t.root);
|
|
1552
|
-
|
|
1558
|
+
Sn(t.root, n);
|
|
1553
1559
|
},
|
|
1554
1560
|
configureServer(t) {
|
|
1555
1561
|
let n = e();
|
|
1556
1562
|
n && n.getTdContext().then(async (e) => {
|
|
1557
1563
|
let r = await e.getConfig(), i = await R(r.components, n.root);
|
|
1558
|
-
|
|
1564
|
+
Sn(n.root, i), vn(t, r.components, n.root);
|
|
1559
1565
|
}).catch(() => {});
|
|
1560
1566
|
}
|
|
1561
1567
|
};
|
|
1562
1568
|
}
|
|
1563
|
-
function
|
|
1569
|
+
function vn(e, t, n) {
|
|
1564
1570
|
let r = new Set(t.filter((e) => e.kind === "explicit").map((e) => P(j.resolve(n, e.source)))), i = new Set(t.filter((e) => e.kind === "dir").map((e) => P(j.resolve(n, e.path))));
|
|
1565
1571
|
for (let t of i) e.watcher.add(t);
|
|
1566
1572
|
let a = (a) => {
|
|
1567
|
-
|
|
1573
|
+
yn(a, r, i) && (e.config.logger.info("[typedown] component changed, rebuilding contract..."), R(t, n).then((e) => Sn(n, e)).catch(() => {}));
|
|
1568
1574
|
};
|
|
1569
1575
|
e.watcher.on("change", a), e.watcher.on("add", a), e.watcher.on("unlink", a);
|
|
1570
1576
|
}
|
|
1571
|
-
function
|
|
1577
|
+
function yn(e, t, n) {
|
|
1572
1578
|
if (!e.endsWith(".vue")) return !1;
|
|
1573
1579
|
let r = P(e);
|
|
1574
1580
|
if (t.has(r)) return !0;
|
|
1575
1581
|
for (let e of n) if (r.startsWith(e + "/")) return !0;
|
|
1576
1582
|
return !1;
|
|
1577
1583
|
}
|
|
1578
|
-
function
|
|
1584
|
+
function bn() {
|
|
1579
1585
|
try {
|
|
1580
1586
|
let e = j.dirname(le(import.meta.url)), t = j.resolve(e, "builtin-components.json"), n = JSON.parse(I.readFileSync(t, "utf-8"));
|
|
1581
1587
|
for (let e of Object.values(n)) if (typeof e == "object" && e && "source" in e) {
|
|
@@ -1587,18 +1593,18 @@ function vn() {
|
|
|
1587
1593
|
return {};
|
|
1588
1594
|
}
|
|
1589
1595
|
}
|
|
1590
|
-
var
|
|
1591
|
-
function
|
|
1592
|
-
if (!(0 < Object.keys(
|
|
1593
|
-
let n = 0 < t.length ?
|
|
1594
|
-
...
|
|
1596
|
+
var xn = bn();
|
|
1597
|
+
function Sn(e, t) {
|
|
1598
|
+
if (!(0 < Object.keys(xn).length) && t.length === 0) return;
|
|
1599
|
+
let n = 0 < t.length ? un(t, e, Ie(e)) : {}, r = {
|
|
1600
|
+
...xn,
|
|
1595
1601
|
...n
|
|
1596
|
-
}, i = j.join(e,
|
|
1602
|
+
}, i = j.join(e, gn);
|
|
1597
1603
|
I.mkdirSync(j.dirname(i), { recursive: !0 }), I.writeFileSync(i, JSON.stringify(r, null, 2));
|
|
1598
1604
|
}
|
|
1599
1605
|
// src/node/plugin/vite/index.ts
|
|
1600
1606
|
function $(t = {}) {
|
|
1601
|
-
let n = t.context, r, i, a, o = new
|
|
1607
|
+
let n = t.context, r, i, a, o = new Ht(t.root ?? ""), s = new Wt(), c = new Ut(t.root ?? ""), l = new qt(), f = new nn(), p = {
|
|
1602
1608
|
devHtml: void 0,
|
|
1603
1609
|
basePath: "/",
|
|
1604
1610
|
rootDirectory: "vault"
|
|
@@ -1624,7 +1630,7 @@ function $(t = {}) {
|
|
|
1624
1630
|
port: e.server?.port ?? 8686,
|
|
1625
1631
|
strictPort: e.server?.strictPort ?? !1
|
|
1626
1632
|
},
|
|
1627
|
-
resolve: { alias:
|
|
1633
|
+
resolve: { alias: an() },
|
|
1628
1634
|
ssr: { noExternal: ["typerighter"] }
|
|
1629
1635
|
};
|
|
1630
1636
|
},
|
|
@@ -1636,18 +1642,18 @@ function $(t = {}) {
|
|
|
1636
1642
|
let e = await m(), t = await e.getConfig(), n = M(t.rootDir);
|
|
1637
1643
|
f.index(n), await l.fetchSync(e);
|
|
1638
1644
|
let i = await e.checkVault();
|
|
1639
|
-
if (
|
|
1645
|
+
if (Dn(i.diagnostics), 0 < i.errorCount) {
|
|
1640
1646
|
let e = i.diagnostics.filter((e) => e.severity === "error").map((e) => ` ${e.filepath}:${e.line}:${e.column} - ${e.message} (${e.code})`);
|
|
1641
1647
|
this.error(`Vault check failed with ${i.errorCount} error(s):\n${e.join("\n")}`);
|
|
1642
1648
|
}
|
|
1643
1649
|
},
|
|
1644
1650
|
resolveId(e) {
|
|
1645
|
-
if (e === "/@typedown/app" || e === "@typedown/app") return
|
|
1646
|
-
if (e === "@typedown/pages") return
|
|
1651
|
+
if (e === "/@typedown/app" || e === "@typedown/app") return Lt;
|
|
1652
|
+
if (e === "@typedown/pages") return Rt;
|
|
1647
1653
|
if (e.startsWith("@typedown/pages?resource=")) return c.resolvePageData(e);
|
|
1648
|
-
if (e === "@typedown/site-data") return
|
|
1649
|
-
if (e === "@typedown/search-index") return
|
|
1650
|
-
if (e === "@typedown/theme") return
|
|
1654
|
+
if (e === "@typedown/site-data") return zt;
|
|
1655
|
+
if (e === "@typedown/search-index") return Bt;
|
|
1656
|
+
if (e === "@typedown/theme") return Vt;
|
|
1651
1657
|
},
|
|
1652
1658
|
async load(e) {
|
|
1653
1659
|
if (c.isPageDataModule(e)) return c.loadPageData(e, await m());
|
|
@@ -1664,11 +1670,11 @@ function $(t = {}) {
|
|
|
1664
1670
|
let t = await m(), n = await t.getConfig(), i = M(n.rootDir);
|
|
1665
1671
|
f.index(i), l.scan(i), l.fetch(t, r), e.httpServer?.once("listening", async () => {
|
|
1666
1672
|
let e = await t.checkVault();
|
|
1667
|
-
0 < e.diagnostics.length && (console.error(""),
|
|
1673
|
+
0 < e.diagnostics.length && (console.error(""), Dn(e.diagnostics));
|
|
1668
1674
|
}), t.rpc.onConfigChanged(() => {
|
|
1669
|
-
r && (p.devHtml = void 0, l.clear(), o.invalidate(r), s.invalidate(r), c.invalidate(r),
|
|
1675
|
+
r && (p.devHtml = void 0, l.clear(), o.invalidate(r), s.invalidate(r), c.invalidate(r), wn(r), l.fetch(t, r));
|
|
1670
1676
|
}), t.rpc.onComponentContractChanged(() => {
|
|
1671
|
-
r && (o.invalidate(r),
|
|
1677
|
+
r && (o.invalidate(r), wn(r));
|
|
1672
1678
|
});
|
|
1673
1679
|
function a(...e) {
|
|
1674
1680
|
r && t.getConfig().then((t) => {
|
|
@@ -1677,7 +1683,7 @@ function $(t = {}) {
|
|
|
1677
1683
|
for (let i of e) {
|
|
1678
1684
|
let e = P(M(r.config.root, t.rootDir, i)), a = r.moduleGraph.getModulesByFile(e);
|
|
1679
1685
|
if (a?.size) {
|
|
1680
|
-
for (let e of a) r.moduleGraph.invalidateModule(e), n.push(
|
|
1686
|
+
for (let e of a) r.moduleGraph.invalidateModule(e), n.push(En(e));
|
|
1681
1687
|
c.invalidatePageData(r, i);
|
|
1682
1688
|
}
|
|
1683
1689
|
}
|
|
@@ -1693,13 +1699,13 @@ function $(t = {}) {
|
|
|
1693
1699
|
r && (f.reindex(i, e), f.invalidate(r), c.invalidate(r), l.fetch(t, r), a(e));
|
|
1694
1700
|
});
|
|
1695
1701
|
function u() {
|
|
1696
|
-
r && (l.clear(),
|
|
1702
|
+
r && (l.clear(), Tn(r), l.fetch(t, r));
|
|
1697
1703
|
}
|
|
1698
1704
|
t.rpc.onSchemaUpdated(u), t.rpc.onSchemaDeleted(u);
|
|
1699
1705
|
let d = await t.getConfig();
|
|
1700
1706
|
p.basePath = d.basePath, p.rootDirectory = d.rootDir, t.rpc.onConfigChanged((e) => {
|
|
1701
1707
|
p.basePath = e.basePath, p.rootDirectory = e.rootDir, p.devHtml = void 0;
|
|
1702
|
-
}), e.middlewares.use(
|
|
1708
|
+
}), e.middlewares.use(sn(e, p)), e.middlewares.use(cn(e, t, p));
|
|
1703
1709
|
},
|
|
1704
1710
|
async transform(t, n) {
|
|
1705
1711
|
let r = n.split("?")[0];
|
|
@@ -1710,7 +1716,7 @@ function $(t = {}) {
|
|
|
1710
1716
|
};
|
|
1711
1717
|
let i = await m(), a = await i.getConfig(), o = d(r, a.rootDir);
|
|
1712
1718
|
try {
|
|
1713
|
-
let { vueSrc: e } = await
|
|
1719
|
+
let { vueSrc: e } = await Nt(i, await i.getFile(o), o);
|
|
1714
1720
|
return {
|
|
1715
1721
|
code: e,
|
|
1716
1722
|
map: null
|
|
@@ -1741,26 +1747,26 @@ function $(t = {}) {
|
|
|
1741
1747
|
});
|
|
1742
1748
|
return [
|
|
1743
1749
|
h,
|
|
1744
|
-
|
|
1750
|
+
_n(() => n),
|
|
1745
1751
|
g,
|
|
1746
1752
|
...ae()
|
|
1747
1753
|
];
|
|
1748
1754
|
}
|
|
1749
|
-
function
|
|
1755
|
+
function Cn(e) {
|
|
1750
1756
|
return [...e.moduleGraph.idToModuleMap.entries()].filter(([e]) => e.endsWith(".td")).map(([, e]) => e);
|
|
1751
1757
|
}
|
|
1752
|
-
function
|
|
1753
|
-
for (let t of
|
|
1758
|
+
function wn(e) {
|
|
1759
|
+
for (let t of Cn(e)) e.moduleGraph.invalidateModule(t);
|
|
1754
1760
|
e.hot.send({ type: "full-reload" });
|
|
1755
1761
|
}
|
|
1756
|
-
function
|
|
1757
|
-
let t =
|
|
1762
|
+
function Tn(e) {
|
|
1763
|
+
let t = Cn(e).map((t) => (e.moduleGraph.invalidateModule(t), En(t)));
|
|
1758
1764
|
0 < t.length && e.hot.send({
|
|
1759
1765
|
type: "update",
|
|
1760
1766
|
updates: t
|
|
1761
1767
|
});
|
|
1762
1768
|
}
|
|
1763
|
-
function
|
|
1769
|
+
function En(e) {
|
|
1764
1770
|
return {
|
|
1765
1771
|
type: "js-update",
|
|
1766
1772
|
path: e.url,
|
|
@@ -1768,7 +1774,7 @@ function wn(e) {
|
|
|
1768
1774
|
timestamp: Date.now()
|
|
1769
1775
|
};
|
|
1770
1776
|
}
|
|
1771
|
-
function
|
|
1777
|
+
function Dn(e) {
|
|
1772
1778
|
for (let t of e) {
|
|
1773
1779
|
let e = `${t.filepath}:${t.line}:${t.column}`, n = t.severity === "error" ? N.red("error") : N.yellow("warn");
|
|
1774
1780
|
console.error(` ${n} ${e} ${t.message} ${N.dim(`(${t.code})`)}`);
|
package/dist/vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PAGES_ID, r as PAGE_DATA_EVENT, i as SEARCH_INDEX_ID, a as SITE_DATA_ID, o as THEME_ID, t as typedown } from "./vite-
|
|
1
|
+
export { n as PAGES_ID, r as PAGE_DATA_EVENT, i as SEARCH_INDEX_ID, a as SITE_DATA_ID, o as THEME_ID, t as typedown } from "./vite-D5VPvBjJ.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "typerighter",
|
|
4
|
-
"version": "0.57.
|
|
4
|
+
"version": "0.57.6",
|
|
5
5
|
"description": "Typedown: A typed content framework.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"@fontsource-variable/inter": "^5.3.0",
|
|
60
60
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
61
61
|
"@lucide/vue": "^1.47.0",
|
|
62
|
-
"@shikijs/transformers": "^4.
|
|
62
|
+
"@shikijs/transformers": "^4.6.0",
|
|
63
63
|
"@tailwindcss/vite": "^4.3.3",
|
|
64
|
-
"@typerighter/rpc-client": "0.57.
|
|
65
|
-
"@typerighter/rpc-server": "0.57.
|
|
64
|
+
"@typerighter/rpc-client": "0.57.6",
|
|
65
|
+
"@typerighter/rpc-server": "0.57.6",
|
|
66
66
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
67
67
|
"cac": "^7.1.0",
|
|
68
68
|
"picocolors": "^1.1.1",
|
|
69
|
-
"shiki": "^4.
|
|
69
|
+
"shiki": "^4.6.0",
|
|
70
70
|
"striptags": "^3.2.0",
|
|
71
71
|
"tailwindcss": "^4.3.3",
|
|
72
72
|
"temml": "^0.13.5",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@hdnax/nuclint": "^0.17.5",
|
|
82
|
-
"@playwright/test": "^1.
|
|
82
|
+
"@playwright/test": "^1.65.0",
|
|
83
83
|
"@types/node": "^26.4.1",
|
|
84
84
|
"@unhead/vue": "^3.4.3",
|
|
85
85
|
"minisearch": "^7.2.0",
|
|
86
|
-
"playwright": "^1.
|
|
86
|
+
"playwright": "^1.65.0",
|
|
87
87
|
"vitest": "^5.0.1"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-dimensions.d.ts","sourceRoot":"","sources":["../../../src/node/lib/image-dimensions.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,SAAS,CAQ7B"}
|