typerighter 0.56.2 → 0.57.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.
- package/dist/{app-Dh1RgRtN.js → app-C7F5xTZI.js} +293 -244
- package/dist/{cli-DtmuEnwt.js → cli-tCqB1T4m.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/useSidebarConfig.d.ts +9 -5
- package/dist/client/theme-default/composables/client-preferences/useSidebarConfig.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/useTheme.d.ts +7 -1
- package/dist/client/theme-default/composables/client-preferences/useTheme.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/utils/buildHeadScript.d.ts +2 -2
- package/dist/client/theme-default/composables/client-preferences/utils/buildHeadScript.d.ts.map +1 -1
- package/dist/client/theme-default.js +893 -881
- package/dist/client.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{init-Drks9yZs.js → init-BVj3BWS6.js} +126 -109
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/{page-RL9qA6-j.js → page-BreMA8X5.js} +3 -3
- package/dist/prerenderWorker.js +2 -2
- package/dist/{renderMath-CJKXI63h.js → renderMath-e3scuxfY.js} +1 -1
- package/dist/shared/utils/time.d.ts.map +1 -1
- package/dist/{shared-BK7uzYmy.js → shared-dB08amQA.js} +88 -88
- package/dist/shared.js +1 -1
- package/dist/typerighter.css +1 -1
- package/dist/{useSidebarConfig-n149FAq4.js → useSidebarConfig-DUcdHn0W.js} +13 -11
- package/dist/useTheme-BF8TNao6.js +65 -0
- package/dist/{vite-C2ruOX7H.js → vite-DKLVYuLb.js} +10 -9
- package/dist/vite.js +1 -1
- package/package.json +4 -3
- package/dist/useTheme-B-j0bXCL.js +0 -62
|
@@ -39,71 +39,71 @@ function p(e) {
|
|
|
39
39
|
function ee(e) {
|
|
40
40
|
return e.replace(/_/g, "-");
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function m(e, t) {
|
|
43
43
|
return e.length <= t ? e : e.slice(0, t - 1).trimEnd() + "…";
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function h(e) {
|
|
46
46
|
let { rest: t } = f(e), n = t.replace(/[-_]/g, " ").split(" ");
|
|
47
47
|
return 0 < n.length && (n[0] = n[0].charAt(0).toUpperCase() + n[0].slice(1)), n.join(" ");
|
|
48
48
|
}
|
|
49
49
|
// src/shared/utils/path.ts
|
|
50
|
-
var
|
|
51
|
-
basename: () =>
|
|
52
|
-
dirname: () =>
|
|
53
|
-
extname: () =>
|
|
54
|
-
filestem: () =>
|
|
55
|
-
isContentFile: () =>
|
|
56
|
-
isTypeFile: () =>
|
|
57
|
-
join: () =>
|
|
58
|
-
stripExtension: () =>
|
|
59
|
-
stripPrefix: () =>
|
|
50
|
+
var g = /* @__PURE__ */ e({
|
|
51
|
+
basename: () => _,
|
|
52
|
+
dirname: () => v,
|
|
53
|
+
extname: () => y,
|
|
54
|
+
filestem: () => b,
|
|
55
|
+
isContentFile: () => x,
|
|
56
|
+
isTypeFile: () => S,
|
|
57
|
+
join: () => C,
|
|
58
|
+
stripExtension: () => w,
|
|
59
|
+
stripPrefix: () => T
|
|
60
60
|
});
|
|
61
|
-
function
|
|
62
|
-
let n =
|
|
61
|
+
function _(e, t) {
|
|
62
|
+
let n = E(e).split("/").pop() ?? "";
|
|
63
63
|
return t !== void 0 && n.endsWith(t) ? n.slice(0, -t.length) : n;
|
|
64
64
|
}
|
|
65
|
-
function _(e) {
|
|
66
|
-
let t = T(e).split("/");
|
|
67
|
-
return t.pop(), t.join("/");
|
|
68
|
-
}
|
|
69
65
|
function v(e) {
|
|
70
|
-
let t =
|
|
71
|
-
return
|
|
66
|
+
let t = E(e).split("/");
|
|
67
|
+
return t.pop(), t.join("/");
|
|
72
68
|
}
|
|
73
69
|
function y(e) {
|
|
74
|
-
let t =
|
|
75
|
-
return n <= 0 ?
|
|
70
|
+
let t = _(e), n = t.lastIndexOf(".");
|
|
71
|
+
return n <= 0 ? "" : t.slice(n);
|
|
76
72
|
}
|
|
77
73
|
function b(e) {
|
|
78
|
-
|
|
74
|
+
let t = _(e), n = t.lastIndexOf(".");
|
|
75
|
+
return n <= 0 ? t : t.slice(0, n);
|
|
79
76
|
}
|
|
80
77
|
function x(e) {
|
|
81
|
-
return
|
|
78
|
+
return i.includes(y(e));
|
|
82
79
|
}
|
|
83
|
-
function S(
|
|
80
|
+
function S(e) {
|
|
81
|
+
return x(e) && e.split("/").includes("_types");
|
|
82
|
+
}
|
|
83
|
+
function C(...e) {
|
|
84
84
|
return e.filter(Boolean).join("/").replace(/\\+/g, "/").replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
let t =
|
|
86
|
+
function w(e) {
|
|
87
|
+
let t = y(e);
|
|
88
88
|
return t ? e.slice(0, -t.length) : e;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
let n =
|
|
90
|
+
function T(e, t) {
|
|
91
|
+
let n = E(e), r = `/${t}/`, i = n.lastIndexOf(r);
|
|
92
92
|
return i === -1 ? n : n.slice(i + r.length);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function E(e) {
|
|
95
95
|
return e.replace(/\\/g, "/");
|
|
96
96
|
}
|
|
97
97
|
// src/shared/utils/url.ts
|
|
98
|
-
var
|
|
99
|
-
function
|
|
98
|
+
var te = 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(","));
|
|
99
|
+
function ne(e) {
|
|
100
100
|
return e.endsWith("/") ? e : e + "/";
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function D(e) {
|
|
103
103
|
let t = e.indexOf("#");
|
|
104
104
|
return 0 <= t ? e.slice(t + 1) : "";
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function O(e) {
|
|
107
107
|
return N(e) ? A(e) : e;
|
|
108
108
|
}
|
|
109
109
|
function re(e, t) {
|
|
@@ -113,11 +113,11 @@ function k(e) {
|
|
|
113
113
|
return e === "/" ? "/index" : e + "/index";
|
|
114
114
|
}
|
|
115
115
|
function A(e) {
|
|
116
|
-
return
|
|
116
|
+
return v(P(e)) || "/";
|
|
117
117
|
}
|
|
118
118
|
function j(e) {
|
|
119
|
-
let t =
|
|
120
|
-
return "/" +
|
|
119
|
+
let t = b(e);
|
|
120
|
+
return "/" + C(v(e), t);
|
|
121
121
|
}
|
|
122
122
|
function M(e) {
|
|
123
123
|
return e.split("?")[0].split("#")[0];
|
|
@@ -125,31 +125,31 @@ function M(e) {
|
|
|
125
125
|
function N(e) {
|
|
126
126
|
return e === "/index" || e.endsWith("/index");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function ie(e, t) {
|
|
129
129
|
return t.startsWith(e + "/") || t === e;
|
|
130
130
|
}
|
|
131
|
-
function ie(e) {
|
|
132
|
-
return c.test(e);
|
|
133
|
-
}
|
|
134
131
|
function ae(e) {
|
|
135
|
-
|
|
136
|
-
return t === "" || !E.has(t.toLowerCase());
|
|
132
|
+
return c.test(e);
|
|
137
133
|
}
|
|
138
134
|
function oe(e) {
|
|
139
|
-
|
|
135
|
+
let t = y(e).slice(1);
|
|
136
|
+
return t === "" || !te.has(t.toLowerCase());
|
|
140
137
|
}
|
|
141
138
|
function se(e) {
|
|
139
|
+
return e === "/" ? "/index" : e;
|
|
140
|
+
}
|
|
141
|
+
function ce(e) {
|
|
142
142
|
let t = e.indexOf("#");
|
|
143
143
|
return 0 <= t ? e.slice(0, t) : e;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function le(e) {
|
|
146
146
|
return e.replace(/^\//, "");
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function P(e) {
|
|
149
149
|
return e.replace(/\/$/, "") || "/";
|
|
150
150
|
}
|
|
151
151
|
// src/shared/utils/content.ts
|
|
152
|
-
function
|
|
152
|
+
function ue(e) {
|
|
153
153
|
let t = {
|
|
154
154
|
name: "",
|
|
155
155
|
entries: []
|
|
@@ -171,17 +171,17 @@ function le(e) {
|
|
|
171
171
|
item: n
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
return
|
|
174
|
+
return V(t), { entries: t.entries };
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function de(e, t) {
|
|
177
177
|
let n = {};
|
|
178
178
|
function r(e) {
|
|
179
179
|
let t = 0;
|
|
180
|
-
for (let n of e.entries) n.kind === "file" ?
|
|
180
|
+
for (let n of e.entries) n.kind === "file" ? R(n.item.filepath) || t++ : t += r(n.node);
|
|
181
181
|
return t;
|
|
182
182
|
}
|
|
183
183
|
function i(e, t) {
|
|
184
|
-
let n =
|
|
184
|
+
let n = F(e);
|
|
185
185
|
return n ? j(n.filepath) : k(`${t}/${e.name}`);
|
|
186
186
|
}
|
|
187
187
|
function a(e, t) {
|
|
@@ -189,13 +189,13 @@ function ue(e, t) {
|
|
|
189
189
|
for (let a of e) a.kind === "dir" ? n.push({
|
|
190
190
|
kind: "dir",
|
|
191
191
|
sub: {
|
|
192
|
-
name:
|
|
192
|
+
name: h(a.node.name),
|
|
193
193
|
url: i(a.node, t),
|
|
194
194
|
count: r(a.node)
|
|
195
195
|
}
|
|
196
|
-
}) :
|
|
196
|
+
}) : R(a.item.filepath) || n.push({
|
|
197
197
|
kind: "file",
|
|
198
|
-
item:
|
|
198
|
+
item: H(a.item)
|
|
199
199
|
});
|
|
200
200
|
return n;
|
|
201
201
|
}
|
|
@@ -204,7 +204,7 @@ function ue(e, t) {
|
|
|
204
204
|
if (r.kind !== "dir") continue;
|
|
205
205
|
let e = r.node, i = t ? `${t}/${e.name}` : `/${e.name}`;
|
|
206
206
|
n[i] = {
|
|
207
|
-
title:
|
|
207
|
+
title: h(e.name),
|
|
208
208
|
url: i,
|
|
209
209
|
entries: a(e.entries, i)
|
|
210
210
|
}, o(e.entries, i);
|
|
@@ -216,47 +216,47 @@ function ue(e, t) {
|
|
|
216
216
|
entries: a(e, "")
|
|
217
217
|
}, o(e, ""), n;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
for (let t of e.entries) if (t.kind === "file" &&
|
|
219
|
+
function F(e) {
|
|
220
|
+
for (let t of e.entries) if (t.kind === "file" && R(t.item.filepath)) return t.item;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
let n =
|
|
224
|
-
return n ?
|
|
222
|
+
function I(e, t) {
|
|
223
|
+
let n = _(v(e));
|
|
224
|
+
return n ? h(n) : t;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function L(e, t) {
|
|
227
227
|
if (t !== void 0) return t;
|
|
228
|
-
let n =
|
|
229
|
-
if (
|
|
230
|
-
let t =
|
|
231
|
-
return t ?
|
|
228
|
+
let n = b(e);
|
|
229
|
+
if (R(e)) {
|
|
230
|
+
let t = _(v(e));
|
|
231
|
+
return t ? h(t) : n;
|
|
232
232
|
}
|
|
233
|
-
return
|
|
233
|
+
return h(n);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
235
|
+
function R(e) {
|
|
236
|
+
return b(e) === r;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
return e.kind === "dir" ? e.node.name :
|
|
238
|
+
function z(e) {
|
|
239
|
+
return e.kind === "dir" ? e.node.name : b(e.item.filepath);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function B(e, ...t) {
|
|
242
242
|
for (let n of t) {
|
|
243
243
|
let t = e[n];
|
|
244
244
|
if (typeof t == "string" && 0 < t.length) return t;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function V(e) {
|
|
248
248
|
e.entries.sort((e, t) => {
|
|
249
|
-
let n =
|
|
249
|
+
let n = z(e), r = z(t), i = f(n), a = f(r);
|
|
250
250
|
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;
|
|
251
251
|
});
|
|
252
|
-
for (let t of e.entries) t.kind === "dir" &&
|
|
252
|
+
for (let t of e.entries) t.kind === "dir" && V(t.node);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function H(e) {
|
|
255
255
|
let t = e.header.tags, n = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
256
256
|
return {
|
|
257
|
-
name:
|
|
257
|
+
name: L(e.filepath, e.label),
|
|
258
258
|
url: j(e.filepath),
|
|
259
|
-
description:
|
|
259
|
+
description: B(e.header, "description", "summary") ?? e.excerpt,
|
|
260
260
|
tags: 0 < n.length ? n : void 0,
|
|
261
261
|
mtimeSecs: e.fileMetadata?.mtimeSecs,
|
|
262
262
|
schema: e.schema
|
|
@@ -386,21 +386,21 @@ function he(e) {
|
|
|
386
386
|
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
387
387
|
}
|
|
388
388
|
function ge(e) {
|
|
389
|
-
return
|
|
389
|
+
return G((0, U.default)(e)).replace(/\s+/g, " ").trim();
|
|
390
390
|
}
|
|
391
|
-
var
|
|
392
|
-
function
|
|
393
|
-
return e === void 0 ? "" : (0, U.default)(e,
|
|
391
|
+
var W = /* @__PURE__ */ "code.em.strong.s.span.sub.sup.math.mrow.mi.mn.mo.mfrac.msup.msub.msubsup.msqrt.mroot.mtext.mspace.merror.semantics.annotation.mover.munder.munderover.mtable.mtr.mtd".split(".");
|
|
392
|
+
function _e(e) {
|
|
393
|
+
return e === void 0 ? "" : (0, U.default)(e, W);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function G(e) {
|
|
396
396
|
return e.replaceAll("<", "<").replaceAll(">", ">").replaceAll(""", "\"").replaceAll("'", "'").replaceAll("&", "&");
|
|
397
397
|
}
|
|
398
398
|
// src/shared/utils/regex.ts
|
|
399
|
-
function
|
|
399
|
+
function ve(e) {
|
|
400
400
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
401
401
|
}
|
|
402
402
|
// src/shared/utils/time.ts
|
|
403
|
-
var
|
|
403
|
+
var K = 60, q = 3600, J = 24 * q, Y = 7 * J, X = 30 * J, Z = 365 * J, ye = 2 * Y;
|
|
404
404
|
function Q(e) {
|
|
405
405
|
return (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("en-US", {
|
|
406
406
|
year: "numeric",
|
|
@@ -409,12 +409,12 @@ function Q(e) {
|
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
function be(e, t) {
|
|
412
|
-
return
|
|
412
|
+
return `${t} at ${Q(e)}`;
|
|
413
413
|
}
|
|
414
414
|
function $(e) {
|
|
415
415
|
if (typeof window > "u") return "";
|
|
416
416
|
let t = Math.floor(Date.now() / 1e3) - e;
|
|
417
|
-
return t <
|
|
417
|
+
return t < K ? "just now" : t < q ? `${Math.floor(t / K)}m ago` : t < J ? `${Math.floor(t / q)}h ago` : t < Y ? `${Math.floor(t / J)}d ago` : t < X ? `${Math.floor(t / Y)}w ago` : t < Z ? `${Math.floor(t / X)}mo ago` : `${Math.floor(t / Z)}y ago`;
|
|
418
418
|
}
|
|
419
419
|
var xe = new Intl.DateTimeFormat("en-US", {
|
|
420
420
|
year: "numeric",
|
|
@@ -429,6 +429,6 @@ function Ce(e) {
|
|
|
429
429
|
return new Date(e).toISOString().slice(0, 10);
|
|
430
430
|
}
|
|
431
431
|
function we(e) {
|
|
432
|
-
return Math.floor(Date.now() / 1e3) - e <
|
|
432
|
+
return Math.floor(Date.now() / 1e3) - e < ye ? $(e) : Q(e);
|
|
433
433
|
}
|
|
434
|
-
export { i as $,
|
|
434
|
+
export { i as $, ie as A, S as B, O as C, j as D, A as E, le as F, f as G, w as H, P as I, m as J, p as K, _ as L, oe as M, se as N, M as O, ce as P, c as Q, y as R, D as S, k as T, T as U, g as V, d as W, l as X, h as Y, u as Z, F as _, $ as a, R as b, he as c, G as d, a as et, me as f, de as g, ue as h, Ce as i, ae as j, N as k, _e as l, pe as m, Se as n, o as nt, we as o, fe as p, ee as q, be as r, s as rt, ve as s, Q as t, r as tt, ge as u, I as v, re as w, ne as x, L as y, x as z };
|
package/dist/shared.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { $ as CONTENT_EXTENSIONS, et as CONTENT_GLOB, Q as EXTERNAL_URL_RE, tt as INDEX_FILENAME, nt as SEARCH_FIELDS, rt as SEARCH_STORE_FIELDS, h as buildContentTree, g as buildDirectoryListingMap, p as debounce, x as ensureTrailingSlash, c as escapeHtml, s as escapeRegex, t as formatAbsoluteTime, n as formatDateString, r as formatEditTime, i as formatIsoDate, a as formatRelativeTime, o as formatTime, S as getAnchor, C as getDirectoryFromPageUrl, w as getDirectoryUrl, T as getIndexUrl, _ as getNodeIndexItem, E as getParentUrl, D as getTdContentUrl, v as getTdIndexTitle, y as getTdResourceTitle, O as getUrlPath, f as isBuiltinField, b as isIndexFile, k as isIndexUrl, X as isOptional, A as isUrlAncestorOf, j as isUrlExternal, M as isUrlToPage, W as kebabToPascal, Z as makeOptional, G as parseNumericPrefix, K as pascalToKebab, V as path, N as resolveRootUrl, l as sanitizeInlineHtml, q as snakeToKebab, P as stripAnchor, u as stripHtml, F as stripLeadingSlash, I as stripTrailingSlash, m as throttle, J as truncate, d as unescapeHtml, Y as unslugify } from "./shared-
|
|
1
|
+
export { $ as CONTENT_EXTENSIONS, et as CONTENT_GLOB, Q as EXTERNAL_URL_RE, tt as INDEX_FILENAME, nt as SEARCH_FIELDS, rt as SEARCH_STORE_FIELDS, h as buildContentTree, g as buildDirectoryListingMap, p as debounce, x as ensureTrailingSlash, c as escapeHtml, s as escapeRegex, t as formatAbsoluteTime, n as formatDateString, r as formatEditTime, i as formatIsoDate, a as formatRelativeTime, o as formatTime, S as getAnchor, C as getDirectoryFromPageUrl, w as getDirectoryUrl, T as getIndexUrl, _ as getNodeIndexItem, E as getParentUrl, D as getTdContentUrl, v as getTdIndexTitle, y as getTdResourceTitle, O as getUrlPath, f as isBuiltinField, b as isIndexFile, k as isIndexUrl, X as isOptional, A as isUrlAncestorOf, j as isUrlExternal, M as isUrlToPage, W as kebabToPascal, Z as makeOptional, G as parseNumericPrefix, K as pascalToKebab, V as path, N as resolveRootUrl, l as sanitizeInlineHtml, q as snakeToKebab, P as stripAnchor, u as stripHtml, F as stripLeadingSlash, I as stripTrailingSlash, m as throttle, J as truncate, d as unescapeHtml, Y as unslugify } from "./shared-dB08amQA.js";
|