typerighter 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of typerighter might be problematic. Click here for more details.
- package/dist/app-C-qfoH4a.js +373 -0
- package/dist/brand-CG1fQshq.js +5 -0
- package/dist/{cli-CDd4TNg1.js → cli-mg9QpUrf.js} +159 -132
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts +12 -3
- 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 +541 -417
- package/dist/client.js +1 -1
- package/dist/es-CG8rP6j5.js +22524 -0
- package/dist/index.js +2 -2
- package/dist/{init-Bfnl0t1B.js → init-BSgCv7vy.js} +664 -654
- 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/plugin/vite/index.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/index.d.ts +1 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/url.d.ts +5 -0
- package/dist/shared/utils/url.d.ts.map +1 -1
- package/dist/shared-BIdsxcZ2.js +265 -0
- package/dist/shared.js +2 -0
- package/dist/typerighter.css +1 -1
- package/dist/vite-8CV23ALg.js +10704 -0
- package/dist/vite.js +1 -1
- package/package.json +7 -3
- package/dist/app-Bf0aLzaG.js +0 -370
- package/dist/brand-BfamszbH.js +0 -12
- package/dist/client/app/composables/useUrl.d.ts +0 -6
- package/dist/client/app/composables/useUrl.d.ts.map +0 -1
- package/dist/constants-DJbUAb1-.js +0 -32189
- package/dist/es-ClqUVRJn.js +0 -705
- package/dist/shared-CpPZZ8IH.js +0 -196
- package/dist/vite-DnP-_NzR.js +0 -326
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,CAAC;AAcd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAGD,wBAAsB,SAAS,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,CAAC;AAcd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAGD,wBAAsB,SAAS,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsK3F"}
|
|
@@ -10,6 +10,8 @@ export interface PrerenderContext {
|
|
|
10
10
|
base: string;
|
|
11
11
|
/** List of page paths to render (e.g. ["/", "/posts/hello"]) */
|
|
12
12
|
pagePaths: string[];
|
|
13
|
+
/** Site title for SEO title suffix */
|
|
14
|
+
siteTitle: string;
|
|
13
15
|
/** Progress logger for reporting render progress */
|
|
14
16
|
progress?: ProgressLogger;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../../src/node/build/prerender.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAID,wBAAsB,kBAAkB,CAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../../src/node/build/prerender.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAID,wBAAsB,kBAAkB,CAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqClF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,MAAM,EACZ,MAAM,MAAM,CAAC;AAId,OAAO,EACiC,KAAK,UAAU,EACtD,MAAM,eAAe,CAAC;AAuBvB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,MAAM,EACZ,MAAM,MAAM,CAAC;AAId,OAAO,EACiC,KAAK,UAAU,EACtD,MAAM,eAAe,CAAC;AAuBvB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,EAAE,WAAW,CAAC;IACzB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAGD,MAAM,WAAW,qBAAqB;IAEpC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAoE9E;AAED,wBAAgB,QAAQ,CAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,EAAE,CAwRvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/field.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
|
@@ -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"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
export declare function getDirectoryFromPageUrl(url: string): string;
|
|
1
2
|
export declare function getDirectoryUrl(urlPrefix: string, name: string): string;
|
|
3
|
+
export declare function getIndexUrl(directoryUrl: string): string;
|
|
2
4
|
export declare function getParentUrl(urlPath: string): string;
|
|
3
5
|
export declare function getTdContentUrl(filepath: string): string;
|
|
6
|
+
export declare function isIndexUrl(url: string): boolean;
|
|
4
7
|
export declare function isUrlAncestorOf(directoryUrl: string, path: string): boolean;
|
|
5
8
|
export declare function isUrlExternal(path: string): boolean;
|
|
6
9
|
export declare function isUrlToPage(filename: string): boolean;
|
|
10
|
+
export declare function resolveRootUrl(url: string): string;
|
|
7
11
|
export declare function stripAnchor(url: string): string;
|
|
12
|
+
export declare function stripTrailingSlash(url: string): string;
|
|
8
13
|
//# 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,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,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,265 @@
|
|
|
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, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), u = "index", d = [".td", ".md"], f = "**/*.{td,md}", p = [
|
|
19
|
+
"title",
|
|
20
|
+
"titles",
|
|
21
|
+
"text"
|
|
22
|
+
], m = ["title", "titles"], h = /^[a-z]+:/i;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/shared/utils/format.ts
|
|
25
|
+
function g(e) {
|
|
26
|
+
let t = e.match(/^(\d+)[-_](.+)$/);
|
|
27
|
+
return t ? {
|
|
28
|
+
order: Number(t[1]),
|
|
29
|
+
rest: t[2]
|
|
30
|
+
} : {
|
|
31
|
+
order: Infinity,
|
|
32
|
+
rest: e
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function _(e) {
|
|
36
|
+
let { rest: t } = g(e), n = t.replace(/[-_]/g, " ").split(" ");
|
|
37
|
+
return 0 < n.length && (n[0] = n[0].charAt(0).toUpperCase() + n[0].slice(1)), n.join(" ");
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/shared/utils/path.ts
|
|
41
|
+
var v = /* @__PURE__ */ s({
|
|
42
|
+
basename: () => y,
|
|
43
|
+
dirname: () => b,
|
|
44
|
+
extname: () => x,
|
|
45
|
+
filestem: () => S,
|
|
46
|
+
isContentFile: () => C,
|
|
47
|
+
join: () => w,
|
|
48
|
+
stripExtension: () => T
|
|
49
|
+
});
|
|
50
|
+
function y(e, t) {
|
|
51
|
+
let n = E(e).split("/").pop() ?? "";
|
|
52
|
+
return t !== void 0 && n.endsWith(t) ? n.slice(0, -t.length) : n;
|
|
53
|
+
}
|
|
54
|
+
function b(e) {
|
|
55
|
+
let t = E(e).split("/");
|
|
56
|
+
return t.pop(), t.join("/");
|
|
57
|
+
}
|
|
58
|
+
function x(e) {
|
|
59
|
+
let t = y(e), n = t.lastIndexOf(".");
|
|
60
|
+
return n <= 0 ? "" : t.slice(n);
|
|
61
|
+
}
|
|
62
|
+
function S(e) {
|
|
63
|
+
let t = y(e), n = t.lastIndexOf(".");
|
|
64
|
+
return n <= 0 ? t : t.slice(0, n);
|
|
65
|
+
}
|
|
66
|
+
function C(e) {
|
|
67
|
+
return d.includes(x(e));
|
|
68
|
+
}
|
|
69
|
+
function w(...e) {
|
|
70
|
+
return e.filter(Boolean).join("/").replace(/\\+/g, "/").replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
71
|
+
}
|
|
72
|
+
function T(e) {
|
|
73
|
+
let t = x(e);
|
|
74
|
+
return t ? e.slice(0, -t.length) : e;
|
|
75
|
+
}
|
|
76
|
+
function E(e) {
|
|
77
|
+
return e.replace(/\\/g, "/");
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/shared/utils/url.ts
|
|
81
|
+
var ee = 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 D(e) {
|
|
83
|
+
return M(e) ? A(e) : e;
|
|
84
|
+
}
|
|
85
|
+
function O(e, t) {
|
|
86
|
+
return `${e}/${t}`;
|
|
87
|
+
}
|
|
88
|
+
function k(e) {
|
|
89
|
+
return e === "/" ? "/index" : e + "/index";
|
|
90
|
+
}
|
|
91
|
+
function A(e) {
|
|
92
|
+
return b(P(e)) || "/";
|
|
93
|
+
}
|
|
94
|
+
function j(e) {
|
|
95
|
+
let t = S(e);
|
|
96
|
+
return "/" + w(b(e), t);
|
|
97
|
+
}
|
|
98
|
+
function M(e) {
|
|
99
|
+
return e === "/index" || e.endsWith("/index");
|
|
100
|
+
}
|
|
101
|
+
function N(e, t) {
|
|
102
|
+
return t.startsWith(e + "/") || t === e;
|
|
103
|
+
}
|
|
104
|
+
function te(e) {
|
|
105
|
+
return h.test(e);
|
|
106
|
+
}
|
|
107
|
+
function ne(e) {
|
|
108
|
+
let t = x(e).slice(1);
|
|
109
|
+
return t === "" || !ee.has(t.toLowerCase());
|
|
110
|
+
}
|
|
111
|
+
function re(e) {
|
|
112
|
+
return e === "/" ? "/index" : e;
|
|
113
|
+
}
|
|
114
|
+
function ie(e) {
|
|
115
|
+
let t = e.indexOf("#");
|
|
116
|
+
return 0 <= t ? e.slice(0, t) : e;
|
|
117
|
+
}
|
|
118
|
+
function P(e) {
|
|
119
|
+
return e.replace(/\/$/, "") || "/";
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/shared/utils/content.ts
|
|
123
|
+
function F(e) {
|
|
124
|
+
let t = {
|
|
125
|
+
name: "",
|
|
126
|
+
children: [],
|
|
127
|
+
items: []
|
|
128
|
+
};
|
|
129
|
+
for (let n of e) {
|
|
130
|
+
let e = n.filepath.split("/").slice(0, -1), r = t;
|
|
131
|
+
for (let t of e) {
|
|
132
|
+
let e = r.children.find((e) => e.name === t);
|
|
133
|
+
e || (e = {
|
|
134
|
+
name: t,
|
|
135
|
+
children: [],
|
|
136
|
+
items: []
|
|
137
|
+
}, r.children.push(e)), r = e;
|
|
138
|
+
}
|
|
139
|
+
r.items.push(n);
|
|
140
|
+
}
|
|
141
|
+
return z(t), {
|
|
142
|
+
rootItems: t.items,
|
|
143
|
+
children: t.children
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function I(e, t) {
|
|
147
|
+
let n = {};
|
|
148
|
+
function r(e) {
|
|
149
|
+
let t = e.items.length;
|
|
150
|
+
for (let n of e.children) t += r(n);
|
|
151
|
+
return t;
|
|
152
|
+
}
|
|
153
|
+
function i(e, t) {
|
|
154
|
+
let n = e.items.find((e) => S(e.filepath) === u);
|
|
155
|
+
return n ? j(n.filepath) : k(`${t}/${e.name}`);
|
|
156
|
+
}
|
|
157
|
+
function a(e, t) {
|
|
158
|
+
for (let o of e) {
|
|
159
|
+
let e = t ? `${t}/${o.name}` : `/${o.name}`;
|
|
160
|
+
n[e] = {
|
|
161
|
+
title: _(o.name),
|
|
162
|
+
url: e,
|
|
163
|
+
subdirectories: o.children.map((t) => ({
|
|
164
|
+
name: _(t.name),
|
|
165
|
+
url: i(t, e),
|
|
166
|
+
count: r(t)
|
|
167
|
+
})),
|
|
168
|
+
items: o.items.map((e) => ({
|
|
169
|
+
name: R(e.header, e.filepath),
|
|
170
|
+
url: j(e.filepath)
|
|
171
|
+
}))
|
|
172
|
+
}, a(o.children, e);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return n["/"] = {
|
|
176
|
+
title: t,
|
|
177
|
+
url: "/",
|
|
178
|
+
subdirectories: e.map((e) => ({
|
|
179
|
+
name: _(e.name),
|
|
180
|
+
url: i(e, ""),
|
|
181
|
+
count: r(e)
|
|
182
|
+
})),
|
|
183
|
+
items: []
|
|
184
|
+
}, a(e, ""), n;
|
|
185
|
+
}
|
|
186
|
+
function L(e, t) {
|
|
187
|
+
let n = y(b(e));
|
|
188
|
+
return n ? _(n) : t;
|
|
189
|
+
}
|
|
190
|
+
function R(e, t) {
|
|
191
|
+
if (e._label !== void 0) return String(e._label);
|
|
192
|
+
let n = S(t);
|
|
193
|
+
if (n === "index") {
|
|
194
|
+
let e = y(b(t));
|
|
195
|
+
return e ? _(e) : n;
|
|
196
|
+
}
|
|
197
|
+
return _(n);
|
|
198
|
+
}
|
|
199
|
+
function z(e) {
|
|
200
|
+
e.children.sort((e, t) => {
|
|
201
|
+
let n = g(e.name), r = g(t.name);
|
|
202
|
+
return n.order === r.order ? n.rest.localeCompare(r.rest) : n.order - r.order;
|
|
203
|
+
}), e.items.sort((e, t) => {
|
|
204
|
+
let n = g(S(e.filepath)), r = g(S(t.filepath));
|
|
205
|
+
return n.order === r.order ? R(e.header, e.filepath).localeCompare(R(t.header, t.filepath)) : n.order - r.order;
|
|
206
|
+
});
|
|
207
|
+
for (let t of e.children) z(t);
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/shared/utils/debounce.ts
|
|
211
|
+
function B(e, t) {
|
|
212
|
+
let n;
|
|
213
|
+
return (...r) => {
|
|
214
|
+
clearTimeout(n), n = setTimeout(() => e(...r), t);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/shared/utils/field.ts
|
|
219
|
+
function V(e) {
|
|
220
|
+
return e.startsWith("_");
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/shared/utils/html.ts
|
|
224
|
+
function H(e) {
|
|
225
|
+
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
226
|
+
}
|
|
227
|
+
function U(e) {
|
|
228
|
+
return e.replace(/<(style|script)[^>]*>[\s\S]*?<\/\1>/gi, "").replace(/<[^>]*>/g, "").replace(/\s+/g, " ").trim();
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/shared/utils/regex.ts
|
|
232
|
+
function W(e) {
|
|
233
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/shared/utils/time.ts
|
|
237
|
+
var G = 60, K = 60 * G, q = 24 * K, J = 7 * q, Y = 30 * q, X = 365 * q, Z = 2 * J;
|
|
238
|
+
function Q(e) {
|
|
239
|
+
return (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("en-US", {
|
|
240
|
+
year: "numeric",
|
|
241
|
+
month: "short",
|
|
242
|
+
day: "numeric"
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function ae(e, t) {
|
|
246
|
+
return Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
|
|
247
|
+
}
|
|
248
|
+
function $(e) {
|
|
249
|
+
let t = Math.floor(Date.now() / 1e3) - e;
|
|
250
|
+
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`;
|
|
251
|
+
}
|
|
252
|
+
var oe = new Intl.DateTimeFormat("en-US", {
|
|
253
|
+
year: "numeric",
|
|
254
|
+
month: "short",
|
|
255
|
+
day: "numeric"
|
|
256
|
+
});
|
|
257
|
+
function se(e) {
|
|
258
|
+
let t = new Date(e);
|
|
259
|
+
return Number.isNaN(t.getTime()) ? e : oe.format(t);
|
|
260
|
+
}
|
|
261
|
+
function ce(e) {
|
|
262
|
+
return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
export { T as A, l as B, ne as C, S as D, P as E, f as F, u as I, p as L, _ as M, h as N, C as O, d as P, m as R, te as S, ie as T, k as _, ce as a, M as b, U as c, F as d, I as f, O as g, D as h, $ as i, g as j, v as k, V as l, R as m, se as n, W as o, L as p, ae as r, H as s, Q as t, B as u, A as v, re as w, N as x, j as y, o as z };
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as e, E as t, F as n, I as r, L as i, M as a, N as o, P as s, R as c, S as l, T as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, j as b, k as x, l as S, m as C, n as w, o as T, p as E, r as D, s as O, t as k, u as A, v as j, w as M, x as N, y as P } from "./shared-BIdsxcZ2.js";
|
|
2
|
+
export { s as CONTENT_EXTENSIONS, n as CONTENT_GLOB, o as EXTERNAL_URL_RE, r as INDEX_FILENAME, i as SEARCH_FIELDS, c as SEARCH_STORE_FIELDS, h as buildContentTree, g as buildDirectoryListingMap, A as debounce, O as escapeHtml, T as escapeRegex, k as formatAbsoluteTime, w as formatDateString, D as formatEditTime, y as formatRelativeTime, f as formatTime, v as getDirectoryFromPageUrl, _ as getDirectoryUrl, d as getIndexUrl, j as getParentUrl, P as getTdContentUrl, E as getTdIndexTitle, C as getTdResourceTitle, S as isBuiltinField, p as isIndexUrl, N as isUrlAncestorOf, l as isUrlExternal, e as isUrlToPage, b as parseNumericPrefix, x as path, M as resolveRootUrl, u as stripAnchor, m as stripHtml, t as stripTrailingSlash, a as unslugify };
|