typerighter 0.4.3 → 0.30.3
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-gH0dpuch.js +2382 -0
- package/dist/brand-CG1fQshq.js +5 -0
- package/dist/cli-BFgBPypP.js +440 -0
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts +43 -4
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/app/router.d.ts +6 -2
- package/dist/client/app/router.d.ts.map +1 -1
- package/dist/client/theme-default.js +2314 -593
- package/dist/client.js +1 -1
- package/dist/fonts.css +2 -0
- package/dist/index.js +3 -4
- package/dist/init-EKDV1L4U.js +821 -0
- package/dist/math.css +1 -0
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/build/prerender.d.ts +2 -0
- package/dist/node/build/prerender.d.ts.map +1 -1
- package/dist/node/cli/index.d.ts.map +1 -1
- package/dist/node/cli/init.d.ts +7 -1
- package/dist/node/cli/init.d.ts.map +1 -1
- package/dist/node/context.d.ts.map +1 -1
- package/dist/node/lib/html-template.d.ts +22 -0
- package/dist/node/lib/html-template.d.ts.map +1 -0
- package/dist/node/lib/image-dimensions.d.ts +6 -0
- package/dist/node/lib/image-dimensions.d.ts.map +1 -0
- package/dist/node/lib/index.d.ts +0 -1
- package/dist/node/lib/index.d.ts.map +1 -1
- package/dist/node/lib/progress.d.ts +2 -0
- package/dist/node/lib/progress.d.ts.map +1 -1
- package/dist/node/lib/render/highlight/index.d.ts.map +1 -0
- package/dist/node/lib/render/highlight/language.d.ts.map +1 -0
- package/dist/node/lib/render/postprocess.d.ts +2 -0
- package/dist/node/lib/render/postprocess.d.ts.map +1 -0
- package/dist/node/lib/render/vue.d.ts +1 -0
- package/dist/node/lib/render/vue.d.ts.map +1 -1
- package/dist/node/{plugin/vite/search.d.ts → lib/search-indexer/index.d.ts} +2 -3
- package/dist/node/lib/search-indexer/index.d.ts.map +1 -0
- package/dist/node/lib/search-indexer/scan.d.ts +4 -0
- package/dist/node/lib/search-indexer/scan.d.ts.map +1 -0
- package/dist/node/lib/typedown-context.d.ts +6 -10
- package/dist/node/lib/typedown-context.d.ts.map +1 -1
- package/dist/node/plugin/vite/constants.d.ts +6 -0
- package/dist/node/plugin/vite/constants.d.ts.map +1 -1
- package/dist/node/plugin/vite/index.d.ts +7 -13
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/node/plugin/vite/middleware/index.d.ts +3 -0
- package/dist/node/plugin/vite/middleware/index.d.ts.map +1 -0
- package/dist/node/plugin/vite/middleware/vault-assets.d.ts +5 -0
- package/dist/node/plugin/vite/middleware/vault-assets.d.ts.map +1 -0
- package/dist/node/plugin/vite/middleware/virtual-html.d.ts +6 -0
- package/dist/node/plugin/vite/middleware/virtual-html.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/app.d.ts +23 -0
- package/dist/node/plugin/vite/virtual/app.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/pages.d.ts +12 -0
- package/dist/node/plugin/vite/virtual/pages.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/search-index.d.ts +11 -0
- package/dist/node/plugin/vite/virtual/search-index.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/site-data.d.ts +13 -0
- package/dist/node/plugin/vite/virtual/site-data.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/utils.d.ts +8 -0
- package/dist/node/plugin/vite/virtual/utils.d.ts.map +1 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/types/content.d.ts +42 -11
- package/dist/shared/types/content.d.ts.map +1 -1
- package/dist/shared/types/index.d.ts +0 -1
- package/dist/shared/types/index.d.ts.map +1 -1
- package/dist/shared/types/ssg.d.ts +15 -3
- package/dist/shared/types/ssg.d.ts.map +1 -1
- package/dist/shared/utils/content.d.ts +5 -3
- package/dist/shared/utils/content.d.ts.map +1 -1
- package/dist/shared/utils/field.d.ts +2 -0
- package/dist/shared/utils/field.d.ts.map +1 -0
- package/dist/shared/utils/html.d.ts +1 -0
- package/dist/shared/utils/html.d.ts.map +1 -1
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/path.d.ts +1 -0
- package/dist/shared/utils/path.d.ts.map +1 -1
- package/dist/shared/utils/url.d.ts +9 -1
- package/dist/shared/utils/url.d.ts.map +1 -1
- package/dist/shared-BuA2cqMO.js +401 -0
- package/dist/shared.js +2 -0
- package/dist/temml-DZbhOfRE.js +8146 -0
- package/dist/typerighter.css +1 -1
- package/dist/vite-CYozrIIG.js +1468 -0
- package/dist/vite.js +2 -2
- package/package.json +26 -40
- package/dist/app-Bw90hv7G.js +0 -266
- package/dist/brand-CmL-6h9U.js +0 -203
- package/dist/cli-BbvLsY1i.js +0 -640
- package/dist/constants-7heqadyd.js +0 -32183
- package/dist/init-DCkztTxJ.js +0 -2356
- package/dist/node/lib/markdown/index.d.ts +0 -5
- package/dist/node/lib/markdown/index.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/callout-container.d.ts +0 -4
- package/dist/node/lib/markdown/plugins/callout-container.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/custom-container.d.ts +0 -3
- package/dist/node/lib/markdown/plugins/custom-container.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/highlight/index.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/highlight/language.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/image.d.ts +0 -3
- package/dist/node/lib/markdown/plugins/image.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/line-number.d.ts +0 -3
- package/dist/node/lib/markdown/plugins/line-number.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/link.d.ts +0 -3
- package/dist/node/lib/markdown/plugins/link.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/pre-wrapper.d.ts +0 -6
- package/dist/node/lib/markdown/plugins/pre-wrapper.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/restore-entities.d.ts +0 -3
- package/dist/node/lib/markdown/plugins/restore-entities.d.ts.map +0 -1
- package/dist/node/lib/markdown/plugins/table.d.ts +0 -3
- package/dist/node/lib/markdown/plugins/table.d.ts.map +0 -1
- package/dist/node/plugin/vite/search.d.ts.map +0 -1
- package/dist/shared/types/markdown.d.ts +0 -62
- package/dist/shared/types/markdown.d.ts.map +0 -1
- package/dist/vite-B-ktlRz9.js +0 -309
- /package/dist/node/lib/{markdown/plugins → render}/highlight/index.d.ts +0 -0
- /package/dist/node/lib/{markdown/plugins → render}/highlight/language.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/html.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED,wBAAgB,SAAS,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED,wBAAgB,YAAY,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
@@ -3,6 +3,7 @@ export declare function dirname(filepath: string): string;
|
|
|
3
3
|
export declare function extname(filepath: string): string;
|
|
4
4
|
export declare function filestem(filepath: string): string;
|
|
5
5
|
export declare function isContentFile(filepath: string): boolean;
|
|
6
|
+
export declare function isTypeFile(filepath: string): boolean;
|
|
6
7
|
export declare function join(...segments: string[]): string;
|
|
7
8
|
export declare function stripExtension(filepath: string): string;
|
|
8
9
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/path.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,wBAAgB,aAAa,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,IAAI,CAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAOnD;AAED,wBAAgB,cAAc,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/path.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,wBAAgB,aAAa,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAGD,wBAAgB,UAAU,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAgB,IAAI,CAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAOnD;AAED,wBAAgB,cAAc,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function getAnchor(url: string): string;
|
|
2
|
+
export declare function getDirectoryFromPageUrl(url: string): string;
|
|
2
3
|
export declare function getDirectoryUrl(urlPrefix: string, name: string): string;
|
|
4
|
+
export declare function getIndexUrl(directoryUrl: string): string;
|
|
3
5
|
export declare function getParentUrl(urlPath: string): string;
|
|
4
6
|
export declare function getTdContentUrl(filepath: string): string;
|
|
7
|
+
export declare function getUrlPath(url: string): string;
|
|
8
|
+
export declare function isIndexUrl(url: string): boolean;
|
|
5
9
|
export declare function isUrlAncestorOf(directoryUrl: string, path: string): boolean;
|
|
10
|
+
export declare function isUrlExternal(path: string): boolean;
|
|
6
11
|
export declare function isUrlToPage(filename: string): boolean;
|
|
12
|
+
export declare function resolveRootUrl(url: string): string;
|
|
13
|
+
export declare function stripAnchor(url: string): string;
|
|
14
|
+
export declare function stripTrailingSlash(url: string): string;
|
|
7
15
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/url.ts"],"names":[],"mappings":"AAqBA,wBAAgB,SAAS,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI9C;AAGD,wBAAgB,uBAAuB,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,eAAe,CAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE;AAGD,wBAAgB,WAAW,CAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,eAAe,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIzD;AAGD,wBAAgB,UAAU,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAGD,wBAAgB,UAAU,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,eAAe,CAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5E;AAGD,wBAAgB,aAAa,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAGD,wBAAgB,WAAW,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAItD;AAED,wBAAgB,cAAc,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAGD,wBAAgB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,wBAAgB,kBAAkB,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, l = (n, r, o) => (o = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : o, n)), u = "index", d = [".td", ".md"], f = "**/*.{td,md}", p = ["title", "text"], ee = ["title"], m = /^[a-z]+:/i;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/shared/utils/format.ts
|
|
21
|
+
function h(e) {
|
|
22
|
+
let t = e.match(/^(\d+)[-_](.+)$/);
|
|
23
|
+
return t ? {
|
|
24
|
+
order: Number(t[1]),
|
|
25
|
+
rest: t[2]
|
|
26
|
+
} : {
|
|
27
|
+
order: Infinity,
|
|
28
|
+
rest: e
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function g(e) {
|
|
32
|
+
let { rest: t } = h(e), n = t.replace(/[-_]/g, " ").split(" ");
|
|
33
|
+
return 0 < n.length && (n[0] = n[0].charAt(0).toUpperCase() + n[0].slice(1)), n.join(" ");
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/shared/utils/path.ts
|
|
37
|
+
var te = /* @__PURE__ */ s({
|
|
38
|
+
basename: () => _,
|
|
39
|
+
dirname: () => v,
|
|
40
|
+
extname: () => y,
|
|
41
|
+
filestem: () => b,
|
|
42
|
+
isContentFile: () => x,
|
|
43
|
+
isTypeFile: () => S,
|
|
44
|
+
join: () => C,
|
|
45
|
+
stripExtension: () => w
|
|
46
|
+
});
|
|
47
|
+
function _(e, t) {
|
|
48
|
+
let n = T(e).split("/").pop() ?? "";
|
|
49
|
+
return t !== void 0 && n.endsWith(t) ? n.slice(0, -t.length) : n;
|
|
50
|
+
}
|
|
51
|
+
function v(e) {
|
|
52
|
+
let t = T(e).split("/");
|
|
53
|
+
return t.pop(), t.join("/");
|
|
54
|
+
}
|
|
55
|
+
function y(e) {
|
|
56
|
+
let t = _(e), n = t.lastIndexOf(".");
|
|
57
|
+
return n <= 0 ? "" : t.slice(n);
|
|
58
|
+
}
|
|
59
|
+
function b(e) {
|
|
60
|
+
let t = _(e), n = t.lastIndexOf(".");
|
|
61
|
+
return n <= 0 ? t : t.slice(0, n);
|
|
62
|
+
}
|
|
63
|
+
function x(e) {
|
|
64
|
+
return d.includes(y(e));
|
|
65
|
+
}
|
|
66
|
+
function S(e) {
|
|
67
|
+
return x(e) && e.split("/").includes("_types");
|
|
68
|
+
}
|
|
69
|
+
function C(...e) {
|
|
70
|
+
return e.filter(Boolean).join("/").replace(/\\+/g, "/").replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
71
|
+
}
|
|
72
|
+
function w(e) {
|
|
73
|
+
let t = y(e);
|
|
74
|
+
return t ? e.slice(0, -t.length) : e;
|
|
75
|
+
}
|
|
76
|
+
function T(e) {
|
|
77
|
+
return e.replace(/\\/g, "/");
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/shared/utils/url.ts
|
|
81
|
+
var ne = new Set("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip".split(","));
|
|
82
|
+
function re(e) {
|
|
83
|
+
let t = e.indexOf("#");
|
|
84
|
+
return 0 <= t ? e.slice(t + 1) : "";
|
|
85
|
+
}
|
|
86
|
+
function E(e) {
|
|
87
|
+
return M(e) ? k(e) : e;
|
|
88
|
+
}
|
|
89
|
+
function D(e, t) {
|
|
90
|
+
return `${e}/${t}`;
|
|
91
|
+
}
|
|
92
|
+
function O(e) {
|
|
93
|
+
return e === "/" ? "/index" : e + "/index";
|
|
94
|
+
}
|
|
95
|
+
function k(e) {
|
|
96
|
+
return v(P(e)) || "/";
|
|
97
|
+
}
|
|
98
|
+
function A(e) {
|
|
99
|
+
let t = b(e);
|
|
100
|
+
return "/" + C(v(e), t);
|
|
101
|
+
}
|
|
102
|
+
function j(e) {
|
|
103
|
+
return e.split("?")[0].split("#")[0];
|
|
104
|
+
}
|
|
105
|
+
function M(e) {
|
|
106
|
+
return e === "/index" || e.endsWith("/index");
|
|
107
|
+
}
|
|
108
|
+
function N(e, t) {
|
|
109
|
+
return t.startsWith(e + "/") || t === e;
|
|
110
|
+
}
|
|
111
|
+
function ie(e) {
|
|
112
|
+
return m.test(e);
|
|
113
|
+
}
|
|
114
|
+
function ae(e) {
|
|
115
|
+
let t = y(e).slice(1);
|
|
116
|
+
return t === "" || !ne.has(t.toLowerCase());
|
|
117
|
+
}
|
|
118
|
+
function oe(e) {
|
|
119
|
+
return e === "/" ? "/index" : e;
|
|
120
|
+
}
|
|
121
|
+
function se(e) {
|
|
122
|
+
let t = e.indexOf("#");
|
|
123
|
+
return 0 <= t ? e.slice(0, t) : e;
|
|
124
|
+
}
|
|
125
|
+
function P(e) {
|
|
126
|
+
return e.replace(/\/$/, "") || "/";
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/shared/utils/content.ts
|
|
130
|
+
function ce(e) {
|
|
131
|
+
let t = {
|
|
132
|
+
name: "",
|
|
133
|
+
entries: []
|
|
134
|
+
};
|
|
135
|
+
for (let n of e) {
|
|
136
|
+
let e = n.filepath.split("/").slice(0, -1), r = t;
|
|
137
|
+
for (let t of e) {
|
|
138
|
+
let e = r.entries.find((e) => e.kind === "dir" && e.node.name === t);
|
|
139
|
+
e || (e = {
|
|
140
|
+
kind: "dir",
|
|
141
|
+
node: {
|
|
142
|
+
name: t,
|
|
143
|
+
entries: []
|
|
144
|
+
}
|
|
145
|
+
}, r.entries.push(e)), r = e.node;
|
|
146
|
+
}
|
|
147
|
+
r.entries.push({
|
|
148
|
+
kind: "file",
|
|
149
|
+
item: n
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return V(t), { entries: t.entries };
|
|
153
|
+
}
|
|
154
|
+
function le(e, t) {
|
|
155
|
+
let n = {};
|
|
156
|
+
function r(e) {
|
|
157
|
+
let t = 0;
|
|
158
|
+
for (let n of e.entries) n.kind === "file" ? R(n.item.filepath) || t++ : t += r(n.node);
|
|
159
|
+
return t;
|
|
160
|
+
}
|
|
161
|
+
function i(e, t) {
|
|
162
|
+
let n = F(e);
|
|
163
|
+
return n ? A(n.filepath) : O(`${t}/${e.name}`);
|
|
164
|
+
}
|
|
165
|
+
function a(e, t) {
|
|
166
|
+
let n = [];
|
|
167
|
+
for (let a of e) a.kind === "dir" ? n.push({
|
|
168
|
+
kind: "dir",
|
|
169
|
+
sub: {
|
|
170
|
+
name: g(a.node.name),
|
|
171
|
+
url: i(a.node, t),
|
|
172
|
+
count: r(a.node)
|
|
173
|
+
}
|
|
174
|
+
}) : R(a.item.filepath) || n.push({
|
|
175
|
+
kind: "file",
|
|
176
|
+
item: H(a.item)
|
|
177
|
+
});
|
|
178
|
+
return n;
|
|
179
|
+
}
|
|
180
|
+
function o(e, t) {
|
|
181
|
+
for (let r of e) {
|
|
182
|
+
if (r.kind !== "dir") continue;
|
|
183
|
+
let e = r.node, i = t ? `${t}/${e.name}` : `/${e.name}`;
|
|
184
|
+
n[i] = {
|
|
185
|
+
title: g(e.name),
|
|
186
|
+
url: i,
|
|
187
|
+
entries: a(e.entries, i)
|
|
188
|
+
}, o(e.entries, i);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return n["/"] = {
|
|
192
|
+
title: t,
|
|
193
|
+
url: "/",
|
|
194
|
+
entries: a(e, "")
|
|
195
|
+
}, o(e, ""), n;
|
|
196
|
+
}
|
|
197
|
+
function F(e) {
|
|
198
|
+
for (let t of e.entries) if (t.kind === "file" && R(t.item.filepath)) return t.item;
|
|
199
|
+
}
|
|
200
|
+
function I(e, t) {
|
|
201
|
+
let n = _(v(e));
|
|
202
|
+
return n ? g(n) : t;
|
|
203
|
+
}
|
|
204
|
+
function L(e, t) {
|
|
205
|
+
if (t !== void 0) return t;
|
|
206
|
+
let n = b(e);
|
|
207
|
+
if (R(e)) {
|
|
208
|
+
let t = _(v(e));
|
|
209
|
+
return t ? g(t) : n;
|
|
210
|
+
}
|
|
211
|
+
return g(n);
|
|
212
|
+
}
|
|
213
|
+
function R(e) {
|
|
214
|
+
return b(e) === u;
|
|
215
|
+
}
|
|
216
|
+
function z(e) {
|
|
217
|
+
return e.kind === "dir" ? e.node.name : b(e.item.filepath);
|
|
218
|
+
}
|
|
219
|
+
function B(e, ...t) {
|
|
220
|
+
for (let n of t) {
|
|
221
|
+
let t = e[n];
|
|
222
|
+
if (typeof t == "string" && 0 < t.length) return t;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function V(e) {
|
|
226
|
+
e.entries.sort((e, t) => {
|
|
227
|
+
let n = z(e), r = z(t), i = h(n), a = h(r);
|
|
228
|
+
return i.order === a.order ? i.order === Infinity && e.kind !== t.kind ? e.kind === "dir" ? -1 : 1 : i.rest.localeCompare(a.rest) : i.order - a.order;
|
|
229
|
+
});
|
|
230
|
+
for (let t of e.entries) t.kind === "dir" && V(t.node);
|
|
231
|
+
}
|
|
232
|
+
function H(e) {
|
|
233
|
+
let t = e.header.tags, n = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
234
|
+
return {
|
|
235
|
+
name: L(e.filepath, e.label),
|
|
236
|
+
url: A(e.filepath),
|
|
237
|
+
description: B(e.header, "description", "summary") ?? e.excerpt,
|
|
238
|
+
tags: 0 < n.length ? n : void 0,
|
|
239
|
+
mtime: e.metadata?.mtime,
|
|
240
|
+
schema: e.schema
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/shared/utils/debounce.ts
|
|
245
|
+
function U(e, t) {
|
|
246
|
+
let n;
|
|
247
|
+
return (...r) => {
|
|
248
|
+
clearTimeout(n), n = setTimeout(() => e(...r), t);
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/shared/utils/field.ts
|
|
253
|
+
function ue(e) {
|
|
254
|
+
return e.startsWith("_");
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/shared/utils/html.ts
|
|
258
|
+
var de = /* @__PURE__ */ l((/* @__PURE__ */ o(((e, t) => {
|
|
259
|
+
(function(e) {
|
|
260
|
+
if (typeof n != "function") {
|
|
261
|
+
var n = function(e) {
|
|
262
|
+
return e;
|
|
263
|
+
};
|
|
264
|
+
n.nonNative = !0;
|
|
265
|
+
}
|
|
266
|
+
let r = n("plaintext"), i = n("html"), a = n("comment"), o = /<(\w*)>/g, s = /<\/?([^\s\/>]+)/;
|
|
267
|
+
function c(e, t, n) {
|
|
268
|
+
e ||= "", t ||= [], n ||= "";
|
|
269
|
+
let r = u(t, n);
|
|
270
|
+
return d(e, r);
|
|
271
|
+
}
|
|
272
|
+
function l(e, t) {
|
|
273
|
+
e ||= [], t ||= "";
|
|
274
|
+
let n = u(e, t);
|
|
275
|
+
return function(e) {
|
|
276
|
+
return d(e || "", n);
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
c.init_streaming_mode = l;
|
|
280
|
+
function u(e, t) {
|
|
281
|
+
return e = f(e), {
|
|
282
|
+
allowable_tags: e,
|
|
283
|
+
tag_replacement: t,
|
|
284
|
+
state: r,
|
|
285
|
+
tag_buffer: "",
|
|
286
|
+
depth: 0,
|
|
287
|
+
in_quote_char: ""
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function d(e, t) {
|
|
291
|
+
if (typeof e != "string") throw TypeError("'html' parameter must be a string");
|
|
292
|
+
let n = t.allowable_tags, o = t.tag_replacement, s = t.state, c = t.tag_buffer, l = t.depth, u = t.in_quote_char, d = "";
|
|
293
|
+
for (let t = 0, f = e.length; t < f; t++) {
|
|
294
|
+
let f = e[t];
|
|
295
|
+
if (s === r) switch (f) {
|
|
296
|
+
case "<":
|
|
297
|
+
s = i, c += f;
|
|
298
|
+
break;
|
|
299
|
+
default: d += f;
|
|
300
|
+
}
|
|
301
|
+
else if (s === i) switch (f) {
|
|
302
|
+
case "<":
|
|
303
|
+
if (u) break;
|
|
304
|
+
l++;
|
|
305
|
+
break;
|
|
306
|
+
case ">":
|
|
307
|
+
if (u) break;
|
|
308
|
+
if (l) {
|
|
309
|
+
l--;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
u = "", s = r, c += ">", n.has(p(c)) ? d += c : d += o, c = "";
|
|
313
|
+
break;
|
|
314
|
+
case "\"":
|
|
315
|
+
case "'":
|
|
316
|
+
f === u ? u = "" : u ||= f, c += f;
|
|
317
|
+
break;
|
|
318
|
+
case "-":
|
|
319
|
+
c === "<!-" && (s = a), c += f;
|
|
320
|
+
break;
|
|
321
|
+
case " ":
|
|
322
|
+
case "\n":
|
|
323
|
+
if (c === "<") {
|
|
324
|
+
s = r, d += "< ", c = "";
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
c += f;
|
|
328
|
+
break;
|
|
329
|
+
default: c += f;
|
|
330
|
+
}
|
|
331
|
+
else if (s === a) switch (f) {
|
|
332
|
+
case ">":
|
|
333
|
+
c.slice(-2) == "--" && (s = r), c = "";
|
|
334
|
+
break;
|
|
335
|
+
default: c += f;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return t.state = s, t.tag_buffer = c, t.depth = l, t.in_quote_char = u, d;
|
|
339
|
+
}
|
|
340
|
+
function f(e) {
|
|
341
|
+
let t = /* @__PURE__ */ new Set();
|
|
342
|
+
if (typeof e == "string") {
|
|
343
|
+
let n;
|
|
344
|
+
for (; n = o.exec(e);) t.add(n[1]);
|
|
345
|
+
} else !n.nonNative && typeof e[n.iterator] == "function" ? t = new Set(e) : typeof e.forEach == "function" && e.forEach(t.add, t);
|
|
346
|
+
return t;
|
|
347
|
+
}
|
|
348
|
+
function p(e) {
|
|
349
|
+
let t = s.exec(e);
|
|
350
|
+
return t ? t[1].toLowerCase() : null;
|
|
351
|
+
}
|
|
352
|
+
typeof define == "function" && define.amd ? define(function() {
|
|
353
|
+
return c;
|
|
354
|
+
}) : typeof t == "object" && t.exports ? t.exports = c : e.striptags = c;
|
|
355
|
+
})(e);
|
|
356
|
+
})))(), 1);
|
|
357
|
+
function fe(e) {
|
|
358
|
+
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
359
|
+
}
|
|
360
|
+
function pe(e) {
|
|
361
|
+
return W((0, de.default)(e)).replace(/\s+/g, " ").trim();
|
|
362
|
+
}
|
|
363
|
+
function W(e) {
|
|
364
|
+
return e.replaceAll("<", "<").replaceAll(">", ">").replaceAll(""", "\"").replaceAll("'", "'").replaceAll("&", "&");
|
|
365
|
+
}
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/shared/utils/regex.ts
|
|
368
|
+
function me(e) {
|
|
369
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/shared/utils/time.ts
|
|
373
|
+
var G = 60, K = 3600, q = 24 * K, J = 7 * q, Y = 30 * q, X = 365 * q, Z = 2 * J;
|
|
374
|
+
function Q(e) {
|
|
375
|
+
return (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("en-US", {
|
|
376
|
+
year: "numeric",
|
|
377
|
+
month: "short",
|
|
378
|
+
day: "numeric"
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
function he(e, t) {
|
|
382
|
+
return Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
|
|
383
|
+
}
|
|
384
|
+
function $(e) {
|
|
385
|
+
let t = Math.floor(Date.now() / 1e3) - e;
|
|
386
|
+
return t < G ? "just now" : t < K ? `${Math.floor(t / G)}m ago` : t < q ? `${Math.floor(t / K)}h ago` : t < J ? `${Math.floor(t / q)}d ago` : t < Y ? `${Math.floor(t / J)}w ago` : t < X ? `${Math.floor(t / Y)}mo ago` : `${Math.floor(t / X)}y ago`;
|
|
387
|
+
}
|
|
388
|
+
var ge = new Intl.DateTimeFormat("en-US", {
|
|
389
|
+
year: "numeric",
|
|
390
|
+
month: "short",
|
|
391
|
+
day: "numeric"
|
|
392
|
+
});
|
|
393
|
+
function _e(e) {
|
|
394
|
+
let t = new Date(e);
|
|
395
|
+
return Number.isNaN(t.getTime()) ? e : ge.format(t);
|
|
396
|
+
}
|
|
397
|
+
function ve(e) {
|
|
398
|
+
return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
export { se as A, m as B, A as C, ie as D, N as E, S as F, ee as G, f as H, te as I, o as K, w as L, _ as M, y as N, ae as O, x as P, h as R, k as S, M as T, u as U, d as V, p as W, R as _, ve as a, D as b, pe as c, U as d, ce as f, L as g, I as h, $ as i, P as j, oe as k, W as l, F as m, _e as n, me as o, le as p, he as r, fe as s, Q as t, ue as u, re as v, j as w, O as x, E as y, g as z };
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, G as a, H as o, I as s, O as c, R as l, S as u, T as d, U as f, V as p, W as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as C, j as w, k as T, l as E, m as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P, v as F, w as I, x as L, y as R, z } from "./shared-BuA2cqMO.js";
|
|
2
|
+
export { p as CONTENT_EXTENSIONS, o as CONTENT_GLOB, t as EXTERNAL_URL_RE, f as INDEX_FILENAME, m as SEARCH_FIELDS, a as SEARCH_STORE_FIELDS, b as buildContentTree, A as buildDirectoryListingMap, y as debounce, M as escapeHtml, k as escapeRegex, N as formatAbsoluteTime, O as formatDateString, j as formatEditTime, C as formatRelativeTime, g as formatTime, F as getAnchor, R as getDirectoryFromPageUrl, _ as getDirectoryUrl, L as getIndexUrl, D as getNodeIndexItem, u as getParentUrl, n as getTdContentUrl, S as getTdIndexTitle, x as getTdResourceTitle, I as getUrlPath, P as isBuiltinField, h as isIndexFile, d as isIndexUrl, i as isUrlAncestorOf, r as isUrlExternal, c as isUrlToPage, l as parseNumericPrefix, s as path, T as resolveRootUrl, e as stripAnchor, v as stripHtml, w as stripTrailingSlash, E as unescapeHtml, z as unslugify };
|