typerighter 0.40.2 → 0.40.4

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/client.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, r as i, s as a, t as o } from "./app-GI_8rzn8.js";
1
+ import { a as e, c as t, i as n, l as r, r as i, s as a, t as o } from "./app-C8QUAQm4.js";
2
2
  export { a as Content, o as createTypedownApp, t as useRoute, r as useRouter, i as useSiteConfig, n as useSiteData, e as useTdContent };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as e, r as t, t as n } from "./vite-D6x3T--t.js";
2
- import { t as r } from "./cli-CNSEVT0i.js";
1
+ import { n as e, r as t, t as n } from "./vite-SLq36-Ev.js";
2
+ import { t as r } from "./cli-CWEPACEO.js";
3
3
  export { t as buildSite, r as cli, e as generateClientAppEntry, n as typedown };
@@ -750,7 +750,7 @@ function He(e) {
750
750
  build: "typerighter build",
751
751
  preview: "typerighter preview"
752
752
  },
753
- devDependencies: { typerighter: "^0.40.2" }
753
+ devDependencies: { typerighter: "^0.40.4" }
754
754
  }, void 0, 2) + "\n";
755
755
  }
756
756
  function Ue() {
@@ -1,4 +1,4 @@
1
- import { U as e, c as t, i as n } from "./shared-LPNgvigl.js";
1
+ import { W as e, c as t, i as n } from "./shared-D_kuT4zK.js";
2
2
  //#region src/node/lib/htmlTemplate.ts
3
3
  function r(e) {
4
4
  let n = t(e.title), r = t(e.description), i = e.siteTitle !== void 0 && e.title !== e.siteTitle ? `${n} - ${t(e.siteTitle)}` : n, a = e.origin ?? "", o = e.canonicalUrl === void 0 ? void 0 : a + e.canonicalUrl, s = o === void 0 ? "" : `\n <link rel="canonical" href="${t(o)}">`, c = o === void 0 ? "" : `\n <meta property="og:url" content="${t(o)}">`, l = e.ogImagePath === void 0 ? `${a}${e.base}og-image.png` : `${a}${e.ogImagePath}`, u = e.author === void 0 ? "" : `\n <meta name="author" content="${t(e.author)}">`, d = e.siteTitle === void 0 ? "" : `\n <meta property="og:site_name" content="${t(e.siteTitle)}">`, f = a === "" ? "" : `\n <link rel="alternate" type="application/rss+xml" title="${e.siteTitle === void 0 ? "RSS Feed" : t(e.siteTitle)}" href="${a}${e.base}feed.xml">`, p = (e.jsonLdBlocks ?? []).map((e) => `\n <script type="application/ld+json">${e}<\/script>`).join(""), m = e.headExtra === void 0 ? "" : e.headExtra + "\n";
@@ -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;AAOd,OAAO,EACiC,KAAK,UAAU,EACtD,MAAM,eAAe,CAAC;AAiCvB,OAAO,EACL,QAAQ,IAAI,sBAAsB,EAClC,KAAK,eAAe,IAAI,qBAAqB,GAC9C,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IAEpC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,QAAQ,CAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,EAAE,CAgUvE"}
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;AAOd,OAAO,EACiC,KAAK,UAAU,EACtD,MAAM,eAAe,CAAC;AAiCvB,OAAO,EACL,QAAQ,IAAI,sBAAsB,EAClC,KAAK,eAAe,IAAI,qBAAqB,GAC9C,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IAEpC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,QAAQ,CAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,EAAE,CA8TvE"}
@@ -6,7 +6,7 @@ export declare class VirtualSiteData implements VirtualModule {
6
6
  scan(rootDirectory: string): void;
7
7
  load(_context: TypedownContext): string;
8
8
  clear(): void;
9
- fetch(context: TypedownContext, server?: ViteDevServer): void;
9
+ fetch: (context: TypedownContext, server?: ViteDevServer | undefined) => void;
10
10
  fetchSync(context: TypedownContext): Promise<void>;
11
11
  invalidate(server: ViteDevServer): void;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"site-data.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/site-data.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AACd,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAC;AA0BrC,qBAAa,eAAgB,YAAW,aAAa;IACnD,OAAO,CAAC,IAAI,CAAuB;IAGnC,IAAI,CAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAmBlC,IAAI,CAAE,QAAQ,EAAE,eAAe,GAAG,MAAM;IAWxC,KAAK,IAAK,IAAI;IAKd,KAAK,CAAE,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI;IAYxD,SAAS,CAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
1
+ {"version":3,"file":"site-data.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/site-data.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AACd,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAC;AA2BrC,qBAAa,eAAgB,YAAW,aAAa;IACnD,OAAO,CAAC,IAAI,CAAuB;IAGnC,IAAI,CAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAmBlC,IAAI,CAAE,QAAQ,EAAE,eAAe,GAAG,MAAM;IAWxC,KAAK,IAAK,IAAI;IAMd,KAAK,yEASG;IAGF,SAAS,CAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
@@ -1,5 +1,5 @@
1
- import { N as e } from "./shared-LPNgvigl.js";
2
- import { a as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./jsonld-Dxk0xvAr.js";
1
+ import { P as e } from "./shared-D_kuT4zK.js";
2
+ import { a as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./jsonld-CjCAKIGY.js";
3
3
  import { pathToFileURL as c } from "node:url";
4
4
  import { parentPort as l, workerData as u } from "node:worker_threads";
5
5
  //#region src/node/build/prerenderWorker.ts
@@ -1,2 +1,3 @@
1
1
  export declare function debounce<T extends (...args: any[]) => any>(fn: T, ms: number): (...args: Parameters<T>) => void;
2
+ export declare function throttle<T extends (...args: any[]) => any>(fn: T, ms: number): (...args: Parameters<T>) => void;
2
3
  //# sourceMappingURL=debounce.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/debounce.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,GACT,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAOlC"}
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/debounce.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,GACT,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAOlC;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,GACT,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAmBlC"}
@@ -241,14 +241,23 @@ function R(e, t) {
241
241
  clearTimeout(n), n = setTimeout(() => e(...r), t);
242
242
  };
243
243
  }
244
+ function z(e, t) {
245
+ let n = 0, r;
246
+ return (...i) => {
247
+ let a = Date.now();
248
+ a - n >= t ? (n = a, e(...i)) : (clearTimeout(r), r = setTimeout(() => {
249
+ n = Date.now(), e(...i);
250
+ }, t - (a - n)));
251
+ };
252
+ }
244
253
  //#endregion
245
254
  //#region src/shared/utils/field.ts
246
- function z(e) {
255
+ function B(e) {
247
256
  return e.startsWith("_");
248
257
  }
249
258
  //#endregion
250
259
  //#region src/shared/utils/html.ts
251
- var B = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
260
+ var V = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
252
261
  (function(e) {
253
262
  if (typeof n != "function") {
254
263
  var n = function(e) {
@@ -347,22 +356,22 @@ var B = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
347
356
  }) : typeof t == "object" && t.exports ? t.exports = c : e.striptags = c;
348
357
  })(e);
349
358
  })))(), 1);
350
- function V(e) {
359
+ function H(e) {
351
360
  return e.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
352
361
  }
353
- function H(e) {
354
- return W((0, B.default)(e)).replace(/\s+/g, " ").trim();
362
+ function U(e) {
363
+ return W((0, V.default)(e)).replace(/\s+/g, " ").trim();
355
364
  }
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);
365
+ var ue = /* @__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(".");
366
+ function de(e) {
367
+ return e === void 0 ? "" : (0, V.default)(e, ue);
359
368
  }
360
369
  function W(e) {
361
370
  return e.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\"").replaceAll("&#39;", "'").replaceAll("&amp;", "&");
362
371
  }
363
372
  //#endregion
364
373
  //#region src/shared/utils/regex.ts
365
- function de(e) {
374
+ function fe(e) {
366
375
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
367
376
  }
368
377
  //#endregion
@@ -375,7 +384,7 @@ function Q(e) {
375
384
  day: "numeric"
376
385
  });
377
386
  }
378
- function fe(e, t) {
387
+ function pe(e, t) {
379
388
  return typeof window > "u" ? "" : Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
380
389
  }
381
390
  function $(e) {
@@ -383,20 +392,20 @@ function $(e) {
383
392
  let t = Math.floor(Date.now() / 1e3) - e;
384
393
  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`;
385
394
  }
386
- var pe = new Intl.DateTimeFormat("en-US", {
395
+ var me = new Intl.DateTimeFormat("en-US", {
387
396
  year: "numeric",
388
397
  month: "short",
389
398
  day: "numeric"
390
399
  });
391
- function me(e) {
400
+ function he(e) {
392
401
  let t = new Date(e);
393
- return Number.isNaN(t.getTime()) ? e : pe.format(t);
402
+ return Number.isNaN(t.getTime()) ? e : me.format(t);
394
403
  }
395
- function he(e) {
404
+ function ge(e) {
396
405
  return new Date(e).toISOString().slice(0, 10);
397
406
  }
398
- function ge(e) {
407
+ function _e(e) {
399
408
  return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
400
409
  }
401
410
  //#endregion
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 };
411
+ export { oe as A, d as B, re as C, ie as D, w as E, A as F, c as G, b as H, f as I, r as J, i as K, m as L, D as M, O as N, T as O, k as P, g as R, ne as S, C as T, l as U, y as V, u as W, s as X, o as Y, j as _, $ as a, N as b, H as c, W as d, B as f, ce as g, se as h, ge as i, E as j, ae as k, de as l, z as m, he as n, _e as o, R as p, a as q, pe as r, fe as s, Q as t, U as u, le as v, S as w, te as x, M as y, _ as z };
package/dist/shared.js CHANGED
@@ -1,2 +1,2 @@
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 };
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, J as s, K as c, M as l, N as u, O as d, P as f, S as p, T as m, U as h, W as g, X as _, Y as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, q as F, r as I, s as L, t as R, u as z, v as B, w as V, x as H, y as U } from "./shared-D_kuT4zK.js";
2
+ export { c as CONTENT_EXTENSIONS, F as CONTENT_GLOB, o as EXTERNAL_URL_RE, s as INDEX_FILENAME, v as SEARCH_FIELDS, _ as SEARCH_STORE_FIELDS, E as buildContentTree, T as buildDirectoryListingMap, P as debounce, S as escapeHtml, L as escapeRegex, R as formatAbsoluteTime, M as formatDateString, I as formatEditTime, D as formatIsoDate, b as formatRelativeTime, N as formatTime, H as getAnchor, p as getDirectoryFromPageUrl, n as getDirectoryUrl, V as getIndexUrl, y as getNodeIndexItem, m as getParentUrl, i as getTdContentUrl, B as getTdIndexTitle, U as getTdResourceTitle, r as getUrlPath, w as isBuiltinField, x as isIndexFile, d as isIndexUrl, k as isUrlAncestorOf, e as isUrlExternal, O as isUrlToPage, h as parseNumericPrefix, t as path, l as resolveRootUrl, A as sanitizeInlineHtml, u as stripAnchor, z as stripHtml, f as stripLeadingSlash, a as stripTrailingSlash, j as throttle, C as unescapeHtml, g as unslugify };