typerighter 0.39.0 → 0.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/{app-N-phWAP_.js → app-GI_8rzn8.js} +69 -68
  2. package/dist/{cli-DVQB43sa.js → cli-CNSEVT0i.js} +5 -5
  3. package/dist/cli.js +1 -1
  4. package/dist/client/app/index.d.ts +8 -0
  5. package/dist/client/app/index.d.ts.map +1 -1
  6. package/dist/client/theme-default.js +174 -174
  7. package/dist/client.js +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/{init-pLTVuBAf.js → init-BplW2rUB.js} +7 -4
  10. package/dist/jsonld-Dxk0xvAr.js +84 -0
  11. package/dist/node/build/index.d.ts.map +1 -1
  12. package/dist/node/build/prerender.d.ts +9 -0
  13. package/dist/node/build/prerender.d.ts.map +1 -1
  14. package/dist/node/build/seo/feed.d.ts +3 -0
  15. package/dist/node/build/seo/feed.d.ts.map +1 -0
  16. package/dist/node/build/seo/index.d.ts +5 -0
  17. package/dist/node/build/seo/index.d.ts.map +1 -0
  18. package/dist/node/build/seo/jsonld.d.ts +10 -0
  19. package/dist/node/build/seo/jsonld.d.ts.map +1 -0
  20. package/dist/node/build/seo/page.d.ts +6 -0
  21. package/dist/node/build/seo/page.d.ts.map +1 -0
  22. package/dist/node/build/seo/sitemap.d.ts +3 -0
  23. package/dist/node/build/seo/sitemap.d.ts.map +1 -0
  24. package/dist/node/lib/htmlTemplate.d.ts +30 -0
  25. package/dist/node/lib/htmlTemplate.d.ts.map +1 -0
  26. package/dist/node/lib/render/vue.d.ts.map +1 -1
  27. package/dist/node/plugin/vite/virtual/app.d.ts +2 -0
  28. package/dist/node/plugin/vite/virtual/app.d.ts.map +1 -1
  29. package/dist/prerenderWorker.js +32 -20
  30. package/dist/shared/types/ssg.d.ts +6 -0
  31. package/dist/shared/types/ssg.d.ts.map +1 -1
  32. package/dist/shared/utils/time.d.ts +1 -0
  33. package/dist/shared/utils/time.d.ts.map +1 -1
  34. package/dist/shared/utils/url.d.ts +1 -0
  35. package/dist/shared/utils/url.d.ts.map +1 -1
  36. package/dist/{shared-Lh4FwI36.js → shared-LPNgvigl.js} +47 -41
  37. package/dist/shared.js +2 -2
  38. package/dist/{vite-XB1qqgp7.js → vite-D6x3T--t.js} +462 -391
  39. package/dist/vite.js +1 -1
  40. package/package.json +7 -7
  41. package/dist/html-template-S2xsTyW5.js +0 -42
  42. package/dist/node/lib/html-template.d.ts +0 -22
  43. package/dist/node/lib/html-template.d.ts.map +0 -1
@@ -74,7 +74,7 @@ function te(e) {
74
74
  return 0 <= t ? e.slice(t + 1) : "";
75
75
  }
76
76
  function ne(e) {
77
- return E(e) ? C(e) : e;
77
+ return T(e) ? C(e) : e;
78
78
  }
79
79
  function re(e, t) {
80
80
  return `${e}/${t}`;
@@ -83,25 +83,25 @@ function S(e) {
83
83
  return e === "/" ? "/index" : e + "/index";
84
84
  }
85
85
  function C(e) {
86
- return p(k(e)) || "/";
86
+ return p(A(e)) || "/";
87
87
  }
88
88
  function w(e) {
89
89
  let t = h(e);
90
90
  return "/" + v(p(e), t);
91
91
  }
92
- function T(e) {
92
+ function ie(e) {
93
93
  return e.split("?")[0].split("#")[0];
94
94
  }
95
- function E(e) {
95
+ function T(e) {
96
96
  return e === "/index" || e.endsWith("/index");
97
97
  }
98
- function ie(e, t) {
98
+ function ae(e, t) {
99
99
  return t.startsWith(e + "/") || t === e;
100
100
  }
101
- function ae(e) {
101
+ function oe(e) {
102
102
  return c.test(e);
103
103
  }
104
- function oe(e) {
104
+ function E(e) {
105
105
  let t = m(e).slice(1);
106
106
  return t === "" || !ee.has(t.toLowerCase());
107
107
  }
@@ -113,6 +113,9 @@ function O(e) {
113
113
  return 0 <= t ? e.slice(0, t) : e;
114
114
  }
115
115
  function k(e) {
116
+ return e.replace(/^\//, "");
117
+ }
118
+ function A(e) {
116
119
  return e.replace(/\/$/, "") || "/";
117
120
  }
118
121
  //#endregion
@@ -139,17 +142,17 @@ function se(e) {
139
142
  item: n
140
143
  });
141
144
  }
142
- return F(t), { entries: t.entries };
145
+ return I(t), { entries: t.entries };
143
146
  }
144
147
  function ce(e, t) {
145
148
  let n = {};
146
149
  function r(e) {
147
150
  let t = 0;
148
- for (let n of e.entries) n.kind === "file" ? M(n.item.filepath) || t++ : t += r(n.node);
151
+ for (let n of e.entries) n.kind === "file" ? N(n.item.filepath) || t++ : t += r(n.node);
149
152
  return t;
150
153
  }
151
154
  function i(e, t) {
152
- let n = A(e);
155
+ let n = j(e);
153
156
  return n ? w(n.filepath) : S(`${t}/${e.name}`);
154
157
  }
155
158
  function a(e, t) {
@@ -161,9 +164,9 @@ function ce(e, t) {
161
164
  url: i(a.node, t),
162
165
  count: r(a.node)
163
166
  }
164
- }) : M(a.item.filepath) || n.push({
167
+ }) : N(a.item.filepath) || n.push({
165
168
  kind: "file",
166
- item: I(a.item)
169
+ item: L(a.item)
167
170
  });
168
171
  return n;
169
172
  }
@@ -184,47 +187,47 @@ function ce(e, t) {
184
187
  entries: a(e, "")
185
188
  }, o(e, ""), n;
186
189
  }
187
- function A(e) {
188
- for (let t of e.entries) if (t.kind === "file" && M(t.item.filepath)) return t.item;
190
+ function j(e) {
191
+ for (let t of e.entries) if (t.kind === "file" && N(t.item.filepath)) return t.item;
189
192
  }
190
193
  function le(e, t) {
191
194
  let n = f(p(e));
192
195
  return n ? u(n) : t;
193
196
  }
194
- function j(e, t) {
197
+ function M(e, t) {
195
198
  if (t !== void 0) return t;
196
199
  let n = h(e);
197
- if (M(e)) {
200
+ if (N(e)) {
198
201
  let t = f(p(e));
199
202
  return t ? u(t) : n;
200
203
  }
201
204
  return u(n);
202
205
  }
203
- function M(e) {
206
+ function N(e) {
204
207
  return h(e) === r;
205
208
  }
206
- function N(e) {
209
+ function P(e) {
207
210
  return e.kind === "dir" ? e.node.name : h(e.item.filepath);
208
211
  }
209
- function P(e, ...t) {
212
+ function F(e, ...t) {
210
213
  for (let n of t) {
211
214
  let t = e[n];
212
215
  if (typeof t == "string" && 0 < t.length) return t;
213
216
  }
214
217
  }
215
- function F(e) {
218
+ function I(e) {
216
219
  e.entries.sort((e, t) => {
217
- let n = N(e), r = N(t), i = l(n), a = l(r);
220
+ let n = P(e), r = P(t), i = l(n), a = l(r);
218
221
  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;
219
222
  });
220
- for (let t of e.entries) t.kind === "dir" && F(t.node);
223
+ for (let t of e.entries) t.kind === "dir" && I(t.node);
221
224
  }
222
- function I(e) {
225
+ function L(e) {
223
226
  let t = e.header.tags, n = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
224
227
  return {
225
- name: j(e.filepath, e.label),
228
+ name: M(e.filepath, e.label),
226
229
  url: w(e.filepath),
227
- description: P(e.header, "description", "summary") ?? e.excerpt,
230
+ description: F(e.header, "description", "summary") ?? e.excerpt,
228
231
  tags: 0 < n.length ? n : void 0,
229
232
  mtime: e.metadata?.mtime,
230
233
  schema: e.schema
@@ -232,7 +235,7 @@ function I(e) {
232
235
  }
233
236
  //#endregion
234
237
  //#region src/shared/utils/debounce.ts
235
- function L(e, t) {
238
+ function R(e, t) {
236
239
  let n;
237
240
  return (...r) => {
238
241
  clearTimeout(n), n = setTimeout(() => e(...r), t);
@@ -240,12 +243,12 @@ function L(e, t) {
240
243
  }
241
244
  //#endregion
242
245
  //#region src/shared/utils/field.ts
243
- function R(e) {
246
+ function z(e) {
244
247
  return e.startsWith("_");
245
248
  }
246
249
  //#endregion
247
250
  //#region src/shared/utils/html.ts
248
- var z = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
251
+ var B = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
249
252
  (function(e) {
250
253
  if (typeof n != "function") {
251
254
  var n = function(e) {
@@ -344,22 +347,22 @@ var z = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
344
347
  }) : typeof t == "object" && t.exports ? t.exports = c : e.striptags = c;
345
348
  })(e);
346
349
  })))(), 1);
347
- function B(e) {
350
+ function V(e) {
348
351
  return e.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
349
352
  }
350
- function V(e) {
351
- return W((0, z.default)(e)).replace(/\s+/g, " ").trim();
353
+ function H(e) {
354
+ return W((0, B.default)(e)).replace(/\s+/g, " ").trim();
352
355
  }
353
- var H = /* @__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(".");
354
- function U(e) {
355
- return e === void 0 ? "" : (0, z.default)(e, H);
356
+ var U = /* @__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(".");
357
+ function ue(e) {
358
+ return e === void 0 ? "" : (0, B.default)(e, U);
356
359
  }
357
360
  function W(e) {
358
361
  return e.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\"").replaceAll("&#39;", "'").replaceAll("&amp;", "&");
359
362
  }
360
363
  //#endregion
361
364
  //#region src/shared/utils/regex.ts
362
- function ue(e) {
365
+ function de(e) {
363
366
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
364
367
  }
365
368
  //#endregion
@@ -372,7 +375,7 @@ function Q(e) {
372
375
  day: "numeric"
373
376
  });
374
377
  }
375
- function de(e, t) {
378
+ function fe(e, t) {
376
379
  return typeof window > "u" ? "" : Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
377
380
  }
378
381
  function $(e) {
@@ -380,17 +383,20 @@ function $(e) {
380
383
  let t = Math.floor(Date.now() / 1e3) - e;
381
384
  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`;
382
385
  }
383
- var fe = new Intl.DateTimeFormat("en-US", {
386
+ var pe = new Intl.DateTimeFormat("en-US", {
384
387
  year: "numeric",
385
388
  month: "short",
386
389
  day: "numeric"
387
390
  });
388
- function pe(e) {
391
+ function me(e) {
389
392
  let t = new Date(e);
390
- return Number.isNaN(t.getTime()) ? e : fe.format(t);
393
+ return Number.isNaN(t.getTime()) ? e : pe.format(t);
391
394
  }
392
- function me(e) {
395
+ function he(e) {
396
+ return new Date(e).toISOString().slice(0, 10);
397
+ }
398
+ function ge(e) {
393
399
  return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
394
400
  }
395
401
  //#endregion
396
- export { D as A, l as B, C, ie as D, E, g as F, r as G, c as H, _ as I, o as K, d as L, k as M, f as N, ae as O, m as P, y as R, S, T, i as U, u as V, a as W, j as _, me as a, ne as b, U as c, R as d, L as f, le as g, A as h, $ as i, O as j, oe as k, V as l, ce as m, pe as n, ue as o, se as p, s as q, de as r, B as s, Q as t, W as u, M as v, w, re as x, te as y, b as z };
402
+ export { E as A, y as B, S as C, T as D, ie as E, f as F, i as G, l as H, m as I, o as J, a as K, g as L, O as M, k as N, ae as O, A as P, _ as R, re as S, w as T, u as U, b as V, c as W, s as Y, le as _, $ as a, te as b, V as c, W as d, z as f, j as g, ce as h, he as i, D as j, oe as k, ue as l, se as m, me as n, ge as o, R as p, r as q, fe as r, de as s, Q as t, H as u, M as v, C as w, ne as x, N as y, d as z };
package/dist/shared.js CHANGED
@@ -1,2 +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, K as s, L as c, M as l, O as u, S as d, T as f, U as p, V as m, W as h, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as w, j as T, k as E, l as D, m as O, n as k, o as A, p as j, q as M, r as N, s as P, t as F, u as I, v as L, w as R, x as z, y as B } from "./shared-Lh4FwI36.js";
2
- export { p as CONTENT_EXTENSIONS, h as CONTENT_GLOB, o as EXTERNAL_URL_RE, a as INDEX_FILENAME, s as SEARCH_FIELDS, M as SEARCH_STORE_FIELDS, j as buildContentTree, O as buildDirectoryListingMap, x as debounce, P as escapeHtml, A as escapeRegex, F as formatAbsoluteTime, k as formatDateString, N as formatEditTime, w as formatRelativeTime, _ as formatTime, B as getAnchor, v as getDirectoryFromPageUrl, z as getDirectoryUrl, d as getIndexUrl, C as getNodeIndexItem, n as getParentUrl, R as getTdContentUrl, S as getTdIndexTitle, g as getTdResourceTitle, f as getUrlPath, b as isBuiltinField, L as isIndexFile, i as isIndexUrl, r as isUrlAncestorOf, u as isUrlExternal, E as isUrlToPage, t as parseNumericPrefix, c as path, e as resolveRootUrl, y as sanitizeInlineHtml, T as stripAnchor, D as stripHtml, l as stripTrailingSlash, I as unescapeHtml, m as unslugify };
1
+ import { A as e, C as t, D as n, E as r, G as i, H as a, J as o, K as s, M as c, N as l, O as u, P as d, S as f, T as p, U as m, W as h, Y as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, q as N, r as P, s as F, t as I, u as L, v as R, w as z, x as B, y as V, z as H } from "./shared-LPNgvigl.js";
2
+ export { i as CONTENT_EXTENSIONS, s as CONTENT_GLOB, h as EXTERNAL_URL_RE, N as INDEX_FILENAME, o as SEARCH_FIELDS, g as SEARCH_STORE_FIELDS, k as buildContentTree, w as buildDirectoryListingMap, M as debounce, b as escapeHtml, F as escapeRegex, I as formatAbsoluteTime, A as formatDateString, P as formatEditTime, T as formatIsoDate, v as formatRelativeTime, j as formatTime, y as getAnchor, B as getDirectoryFromPageUrl, f as getDirectoryUrl, t as getIndexUrl, C as getNodeIndexItem, z as getParentUrl, p as getTdContentUrl, _ as getTdIndexTitle, R as getTdResourceTitle, r as getUrlPath, S as isBuiltinField, V as isIndexFile, n as isIndexUrl, u as isUrlAncestorOf, D as isUrlExternal, e as isUrlToPage, a as parseNumericPrefix, H as path, E as resolveRootUrl, O as sanitizeInlineHtml, c as stripAnchor, L as stripHtml, l as stripLeadingSlash, d as stripTrailingSlash, x as unescapeHtml, m as unslugify };