typerighter 0.44.0 → 0.44.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 (32) hide show
  1. package/dist/{app-Cs3OppHS.js → app-D0bX_TJ8.js} +334 -334
  2. package/dist/builtin-components.json +95 -0
  3. package/dist/{cli-BcvGlMzh.js → cli-DBv4APAX.js} +5 -5
  4. package/dist/cli.js +1 -1
  5. package/dist/client/theme-default.js +814 -788
  6. package/dist/client.js +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/{init-DCe3DWKz.js → init-DKr1vEJD.js} +204 -190
  9. package/dist/{jsonld-DZsAYYxx.js → jsonld-CRHOaFMj.js} +15 -15
  10. package/dist/node/build/builtin-contract.d.ts +3 -0
  11. package/dist/node/build/builtin-contract.d.ts.map +1 -0
  12. package/dist/node/cli/init.d.ts.map +1 -1
  13. package/dist/node/lib/components.d.ts +9 -7
  14. package/dist/node/lib/components.d.ts.map +1 -1
  15. package/dist/node/lib/prop-schema.d.ts +17 -0
  16. package/dist/node/lib/prop-schema.d.ts.map +1 -0
  17. package/dist/node/plugin/vite/subplugins/component-contract.d.ts.map +1 -1
  18. package/dist/prerenderWorker.js +2 -2
  19. package/dist/{renderMath-BAZXLnOu.js → renderMath-C59kPnxc.js} +1 -1
  20. package/dist/rolldown-runtime-B0aSnxlc.js +20 -0
  21. package/dist/shared/types/json-schema.d.ts +12 -3
  22. package/dist/shared/types/json-schema.d.ts.map +1 -1
  23. package/dist/shared/utils/format.d.ts +1 -0
  24. package/dist/shared/utils/format.d.ts.map +1 -1
  25. package/dist/{shared-kjMIXu1H.js → shared-C5ERr4vS.js} +66 -56
  26. package/dist/shared.js +1 -1
  27. package/dist/typerighter.css +1 -1
  28. package/dist/vite-KKwvSM8g.js +1718 -0
  29. package/dist/vite.js +1 -1
  30. package/package.json +3 -3
  31. package/dist/rolldown-runtime-CEFd7nDs.js +0 -30
  32. package/dist/vite-DrX11EH5.js +0 -127331
@@ -1,9 +1,9 @@
1
- import { K as e, c as t, i as n } from "./shared-kjMIXu1H.js";
1
+ import { c as e, i as t, q as n } from "./shared-C5ERr4vS.js";
2
2
  //#region src/node/lib/html-template.ts
3
- function r(e) {
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";
3
+ function r(t) {
4
+ let n = e(t.title), r = e(t.description), i = t.siteTitle !== void 0 && t.title !== t.siteTitle ? `${n} - ${e(t.siteTitle)}` : n, a = t.origin ?? "", o = t.canonicalUrl === void 0 ? void 0 : a + t.canonicalUrl, s = o === void 0 ? "" : `\n <link rel="canonical" href="${e(o)}">`, c = o === void 0 ? "" : `\n <meta property="og:url" content="${e(o)}">`, l = t.ogImagePath === void 0 ? `${a}${t.base}og-image.png` : `${a}${t.ogImagePath}`, u = t.author === void 0 ? "" : `\n <meta name="author" content="${e(t.author)}">`, d = t.siteTitle === void 0 ? "" : `\n <meta property="og:site_name" content="${e(t.siteTitle)}">`, f = a === "" ? "" : `\n <link rel="alternate" type="application/rss+xml" title="${t.siteTitle === void 0 ? "RSS Feed" : e(t.siteTitle)}" href="${a}${t.base}feed.xml">`, p = (t.jsonLdBlocks ?? []).map((e) => `\n <script type="application/ld+json">${e}<\/script>`).join(""), m = t.headExtra === void 0 ? "" : t.headExtra + "\n";
5
5
  return `<!DOCTYPE html>
6
- <html lang="${e.lang ?? "en"}">
6
+ <html lang="${t.lang ?? "en"}">
7
7
  <head>
8
8
  <meta charset="UTF-8">
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -11,15 +11,15 @@ function r(e) {
11
11
  <meta name="robots" content="index, follow">
12
12
  <title>${i}</title>
13
13
  <meta name="description" content="${r}">${u}${s}
14
- <link rel="icon" href="${e.base}favicon.svg" type="image/svg+xml">${f}
14
+ <link rel="icon" href="${t.base}favicon.svg" type="image/svg+xml">${f}
15
15
  <meta property="og:type" content="article">${d}${c}
16
16
  <meta property="og:title" content="${n}">
17
17
  <meta property="og:description" content="${r}">
18
- <meta property="og:image" content="${t(l)}">
18
+ <meta property="og:image" content="${e(l)}">
19
19
  <meta name="twitter:card" content="summary_large_image">
20
20
  <meta name="twitter:title" content="${n}">
21
21
  <meta name="twitter:description" content="${r}">
22
- <meta name="twitter:image" content="${t(l)}">${p}
22
+ <meta name="twitter:image" content="${e(l)}">${p}
23
23
  <script>
24
24
  (function () {
25
25
  var theme = localStorage.getItem('td-theme');
@@ -29,8 +29,8 @@ function r(e) {
29
29
  <\/script>
30
30
  ${m} </head>
31
31
  <body>
32
- <div id="app">${e.appContent ?? ""}</div>
33
- <script type="module" src="${e.base}${e.entryScript}"><\/script>
32
+ <div id="app">${t.appContent ?? ""}</div>
33
+ <script type="module" src="${t.base}${t.entryScript}"><\/script>
34
34
  </body>
35
35
  </html>`;
36
36
  }
@@ -45,8 +45,8 @@ function a(e) {
45
45
  return t === void 0 ? "" : String(t);
46
46
  }
47
47
  function o(e) {
48
- let t = e.fileMetadata?.mtime;
49
- return t === void 0 ? void 0 : n(t);
48
+ let n = e.fileMetadata?.mtime;
49
+ return n === void 0 ? void 0 : t(n);
50
50
  }
51
51
  function s(e) {
52
52
  return e.seoMetadata?.image;
@@ -67,12 +67,12 @@ function c(e) {
67
67
  ...e.dateModified === void 0 ? {} : { dateModified: e.dateModified }
68
68
  });
69
69
  }
70
- function l(t, n) {
71
- if (t === "/") return;
72
- let r = t.split("/").filter(Boolean), i = r.map((t, i) => ({
70
+ function l(e, t) {
71
+ if (e === "/") return;
72
+ let r = e.split("/").filter(Boolean), i = r.map((e, i) => ({
73
73
  "@type": "ListItem",
74
74
  position: i + 1,
75
- name: i === r.length - 1 ? n : e(t)
75
+ name: i === r.length - 1 ? t : n(e)
76
76
  }));
77
77
  return JSON.stringify({
78
78
  "@context": "https://schema.org",
@@ -0,0 +1,3 @@
1
+ import type { ContractEntry } from '../lib/prop-schema';
2
+ export declare function buildBuiltinContract(): Record<string, ContractEntry>;
3
+ //# sourceMappingURL=builtin-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtin-contract.d.ts","sourceRoot":"","sources":["../../../src/node/build/builtin-contract.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA0BxD,wBAAgB,oBAAoB,IAAK,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAWrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/node/cli/init.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,eAAoB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAWf"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/node/cli/init.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,eAAoB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAWf"}
@@ -1,14 +1,16 @@
1
1
  import type { TdComponentEntry } from '@typerighter/rpc-client';
2
- import type { JsonSchema } from '@/shared/types/json-schema';
3
2
  export interface UserComponent {
4
3
  name: string;
5
4
  absolutePath: string;
6
5
  }
7
- export declare function buildComponentContract(components: UserComponent[], projectRoot: string): Record<string, ComponentContractEntry>;
6
+ export declare function createComponentChecker(projectRoot: string): {
7
+ getExportNames: (componentPath: string) => string[];
8
+ getComponentMeta(fileName: string, exportName?: string): import("vue-component-meta").ComponentMeta;
9
+ updateFile(fileName: string, text: string): void;
10
+ deleteFile(fileName: string): void;
11
+ reload(): void;
12
+ clearCache(): void;
13
+ getProgram(): import("typescript").Program | undefined;
14
+ };
8
15
  export declare function resolveUserComponents(entries: TdComponentEntry[], projectRoot: string): Promise<UserComponent[]>;
9
- interface ComponentContractEntry {
10
- source: string;
11
- props?: Record<string, JsonSchema>;
12
- }
13
- export {};
14
16
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/node/lib/components.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAGD,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,aAAa,EAAE,EAC3B,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAsCxC;AAGD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,EAAE,CAAC,CAiC1B;AAED,UAAU,sBAAsB;IAC9B,MAAM,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACpC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/node/lib/components.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAGD,wBAAgB,sBAAsB,CAAE,WAAW,EAAE,MAAM;;;;;;;;EAoB1D;AAGD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,EAAE,CAAC,CA+C1B"}
@@ -0,0 +1,17 @@
1
+ import type { ComponentMetaChecker } from 'vue-component-meta';
2
+ import type { JsonSchema } from '../../shared/types/json-schema';
3
+ export interface ComponentPropertyEntry {
4
+ schema: JsonSchema;
5
+ description?: string;
6
+ }
7
+ export interface ContractEntry {
8
+ source: string;
9
+ props?: Record<string, ComponentPropertyEntry>;
10
+ slots?: string[];
11
+ deprecated?: string;
12
+ }
13
+ export declare function buildContractWithChecker(components: Array<{
14
+ name: string;
15
+ absolutePath: string;
16
+ }>, projectRoot: string, checker: ComponentMetaChecker): Record<string, ContractEntry>;
17
+ //# sourceMappingURL=prop-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-schema.d.ts","sourceRoot":"","sources":["../../../src/node/lib/prop-schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,EACF,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,oBAAoB,GAC5B,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAgD/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"component-contract.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/subplugins/component-contract.ts"],"names":[],"mappings":"AAEA,OAAO,EACU,KAAK,MAAM,EAC3B,MAAM,MAAM,CAAC;AASd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,UAAU,GAAG,SAAS,GACvC,MAAM,CAuCR"}
1
+ {"version":3,"file":"component-contract.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/subplugins/component-contract.ts"],"names":[],"mappings":"AAKA,OAAO,EACU,KAAK,MAAM,EAC3B,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,UAAU,GAAG,SAAS,GACvC,MAAM,CAuCR"}
@@ -1,5 +1,5 @@
1
- import { P as e } from "./shared-kjMIXu1H.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-DZsAYYxx.js";
1
+ import { P as e } from "./shared-C5ERr4vS.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-CRHOaFMj.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,4 +1,4 @@
1
- import { c as e } from "./shared-kjMIXu1H.js";
1
+ import { c as e } from "./shared-C5ERr4vS.js";
2
2
  import { t } from "./temml-D47Z4xZ2.js";
3
3
  import { t as n } from "./inlineRe-Cn-J_E76.js";
4
4
  //#region src/client/theme-default/utils/renderMath.ts
@@ -0,0 +1,20 @@
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));
19
+ //#endregion
20
+ export { s as n, l as r, o as t };
@@ -1,3 +1,6 @@
1
+ export interface AnyOfSchema {
2
+ anyOf: JsonSchema[];
3
+ }
1
4
  export interface ArraySchema {
2
5
  type: 'array';
3
6
  items: JsonSchema;
@@ -6,9 +9,15 @@ export interface DictSchema {
6
9
  type: 'object';
7
10
  additionalProperties: JsonSchema;
8
11
  }
9
- export type JsonSchema = PrimitiveSchema | OptionalSchema | ArraySchema | DictSchema | ProductSchema;
10
- export interface OptionalSchema {
11
- type: [string, 'null' | 'undefined'] | [string, 'null', 'undefined'] | [string, 'undefined', 'null'];
12
+ export interface EnumSchema {
13
+ enum: (string | number | boolean | null)[];
14
+ }
15
+ export type JsonSchema = PrimitiveSchema | MultiTypeSchema | EnumSchema | ArraySchema | ProductSchema | DictSchema | OneOfSchema | AnyOfSchema;
16
+ export interface MultiTypeSchema {
17
+ type: string[];
18
+ }
19
+ export interface OneOfSchema {
20
+ oneOf: JsonSchema[];
12
21
  }
13
22
  export interface PrimitiveSchema {
14
23
  type: 'string' | 'number' | 'boolean';
@@ -1 +1 @@
1
- {"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../../src/shared/types/json-schema.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;CACnB;AAGD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,oBAAoB,EAAE,UAAU,CAAC;CAClC;AAGD,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,WAAW,GACX,UAAU,GACV,aAAa,CAAC;AAIlB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;CACtG;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;CACvC;AAGD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,EAAE,KAAK,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAEvD;AAID,wBAAgB,YAAY,CAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAc5D"}
1
+ {"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../../src/shared/types/json-schema.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAGD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;CACnB;AAGD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,oBAAoB,EAAE,UAAU,CAAC;CAClC;AAGD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;CAC5C;AAED,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,eAAe,GACf,UAAU,GACV,WAAW,GACX,aAAa,GACb,UAAU,GACV,WAAW,GACX,WAAW,CAAC;AAGhB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAGD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;CACvC;AAGD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,EAAE,KAAK,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAKvD;AAED,wBAAgB,YAAY,CAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAmC5D"}
@@ -3,6 +3,7 @@ export declare function parseNumericPrefix(name: string): {
3
3
  order: number;
4
4
  rest: string;
5
5
  };
6
+ export declare function pascalToKebab(string_: string): string;
6
7
  export declare function snakeToKebab(string_: string): string;
7
8
  export declare function unslugify(slug: string): string;
8
9
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/format.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAKD,wBAAgB,kBAAkB,CAAE,IAAI,EAAE,MAAM,GAAG;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAYA;AAID,wBAAgB,YAAY,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAID,wBAAgB,SAAS,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAW/C"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/format.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAKD,wBAAgB,kBAAkB,CAAE,IAAI,EAAE,MAAM,GAAG;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAYA;AAID,wBAAgB,aAAa,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAID,wBAAgB,YAAY,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAID,wBAAgB,SAAS,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAW/C"}
@@ -1,17 +1,24 @@
1
- import { o as e, r as t, t as n } from "./rolldown-runtime-CEFd7nDs.js";
1
+ import { n as e, r as t, t as n } from "./rolldown-runtime-B0aSnxlc.js";
2
2
  //#region src/shared/constants.ts
3
3
  var r = "index", i = [".td", ".md"], a = "**/*.{td,md}", o = ["title", "text"], s = ["title", "text"], c = /^[a-z]+:/i;
4
4
  //#endregion
5
5
  //#region src/shared/types/json-schema.ts
6
6
  function l(e) {
7
- return Array.isArray(e.type);
7
+ return "enum" in e ? e.enum.includes(null) : "type" in e && Array.isArray(e.type) ? e.type.includes("null") : !1;
8
8
  }
9
9
  function u(e) {
10
- let t = e.type;
11
- return typeof t == "string" ? {
12
- ...e,
13
- type: [t, "null"]
14
- } : e;
10
+ if ("enum" in e) return e.enum.includes(null) ? e : { enum: [...e.enum, null] };
11
+ if ("type" in e) {
12
+ if (typeof e.type == "string") return {
13
+ ...e,
14
+ type: [e.type, "null"]
15
+ };
16
+ if (Array.isArray(e.type) && !e.type.includes("null")) return {
17
+ ...e,
18
+ type: [...e.type, "null"]
19
+ };
20
+ }
21
+ return e;
15
22
  }
16
23
  //#endregion
17
24
  //#region src/shared/utils/format.ts
@@ -29,6 +36,9 @@ function f(e) {
29
36
  };
30
37
  }
31
38
  function p(e) {
39
+ return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
40
+ }
41
+ function ee(e) {
32
42
  return e.replace(/_/g, "-");
33
43
  }
34
44
  function m(e) {
@@ -37,7 +47,7 @@ function m(e) {
37
47
  }
38
48
  //#endregion
39
49
  //#region src/shared/utils/path.ts
40
- var ee = /* @__PURE__ */ t({
50
+ var te = /* @__PURE__ */ e({
41
51
  basename: () => h,
42
52
  dirname: () => g,
43
53
  extname: () => _,
@@ -86,54 +96,54 @@ function w(e) {
86
96
  }
87
97
  //#endregion
88
98
  //#region src/shared/utils/url.ts
89
- 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(","));
90
- function ne(e) {
99
+ 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(","));
100
+ function T(e) {
91
101
  let t = e.indexOf("#");
92
102
  return 0 <= t ? e.slice(t + 1) : "";
93
103
  }
94
- function T(e) {
104
+ function E(e) {
95
105
  return A(e) ? O(e) : e;
96
106
  }
97
- function E(e, t) {
107
+ function re(e, t) {
98
108
  return `${e}/${t}`;
99
109
  }
100
110
  function D(e) {
101
111
  return e === "/" ? "/index" : e + "/index";
102
112
  }
103
113
  function O(e) {
104
- return g(N(e)) || "/";
114
+ return g(P(e)) || "/";
105
115
  }
106
116
  function k(e) {
107
117
  let t = v(e);
108
118
  return "/" + x(g(e), t);
109
119
  }
110
- function re(e) {
120
+ function ie(e) {
111
121
  return e.split("?")[0].split("#")[0];
112
122
  }
113
123
  function A(e) {
114
124
  return e === "/index" || e.endsWith("/index");
115
125
  }
116
- function ie(e, t) {
126
+ function j(e, t) {
117
127
  return t.startsWith(e + "/") || t === e;
118
128
  }
119
- function ae(e) {
129
+ function M(e) {
120
130
  return c.test(e);
121
131
  }
122
- function oe(e) {
132
+ function N(e) {
123
133
  let t = _(e).slice(1);
124
- return t === "" || !te.has(t.toLowerCase());
134
+ return t === "" || !ne.has(t.toLowerCase());
125
135
  }
126
- function j(e) {
136
+ function ae(e) {
127
137
  return e === "/" ? "/index" : e;
128
138
  }
129
- function M(e) {
139
+ function oe(e) {
130
140
  let t = e.indexOf("#");
131
141
  return 0 <= t ? e.slice(0, t) : e;
132
142
  }
133
143
  function se(e) {
134
144
  return e.replace(/^\//, "");
135
145
  }
136
- function N(e) {
146
+ function P(e) {
137
147
  return e.replace(/\/$/, "") || "/";
138
148
  }
139
149
  //#endregion
@@ -160,17 +170,17 @@ function ce(e) {
160
170
  item: n
161
171
  });
162
172
  }
163
- return z(t), { entries: t.entries };
173
+ return B(t), { entries: t.entries };
164
174
  }
165
175
  function le(e, t) {
166
176
  let n = {};
167
177
  function r(e) {
168
178
  let t = 0;
169
- for (let n of e.entries) n.kind === "file" ? I(n.item.filepath) || t++ : t += r(n.node);
179
+ for (let n of e.entries) n.kind === "file" ? L(n.item.filepath) || t++ : t += r(n.node);
170
180
  return t;
171
181
  }
172
182
  function i(e, t) {
173
- let n = P(e);
183
+ let n = F(e);
174
184
  return n ? k(n.filepath) : D(`${t}/${e.name}`);
175
185
  }
176
186
  function a(e, t) {
@@ -182,9 +192,9 @@ function le(e, t) {
182
192
  url: i(a.node, t),
183
193
  count: r(a.node)
184
194
  }
185
- }) : I(a.item.filepath) || n.push({
195
+ }) : L(a.item.filepath) || n.push({
186
196
  kind: "file",
187
- item: B(a.item)
197
+ item: V(a.item)
188
198
  });
189
199
  return n;
190
200
  }
@@ -205,47 +215,47 @@ function le(e, t) {
205
215
  entries: a(e, "")
206
216
  }, o(e, ""), n;
207
217
  }
208
- function P(e) {
209
- for (let t of e.entries) if (t.kind === "file" && I(t.item.filepath)) return t.item;
218
+ function F(e) {
219
+ for (let t of e.entries) if (t.kind === "file" && L(t.item.filepath)) return t.item;
210
220
  }
211
221
  function ue(e, t) {
212
222
  let n = h(g(e));
213
223
  return n ? m(n) : t;
214
224
  }
215
- function F(e, t) {
225
+ function I(e, t) {
216
226
  if (t !== void 0) return t;
217
227
  let n = v(e);
218
- if (I(e)) {
228
+ if (L(e)) {
219
229
  let t = h(g(e));
220
230
  return t ? m(t) : n;
221
231
  }
222
232
  return m(n);
223
233
  }
224
- function I(e) {
234
+ function L(e) {
225
235
  return v(e) === r;
226
236
  }
227
- function L(e) {
237
+ function R(e) {
228
238
  return e.kind === "dir" ? e.node.name : v(e.item.filepath);
229
239
  }
230
- function R(e, ...t) {
240
+ function z(e, ...t) {
231
241
  for (let n of t) {
232
242
  let t = e[n];
233
243
  if (typeof t == "string" && 0 < t.length) return t;
234
244
  }
235
245
  }
236
- function z(e) {
246
+ function B(e) {
237
247
  e.entries.sort((e, t) => {
238
- let n = L(e), r = L(t), i = f(n), a = f(r);
248
+ let n = R(e), r = R(t), i = f(n), a = f(r);
239
249
  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;
240
250
  });
241
- for (let t of e.entries) t.kind === "dir" && z(t.node);
251
+ for (let t of e.entries) t.kind === "dir" && B(t.node);
242
252
  }
243
- function B(e) {
253
+ function V(e) {
244
254
  let t = e.header.tags, n = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
245
255
  return {
246
- name: F(e.filepath, e.label),
256
+ name: I(e.filepath, e.label),
247
257
  url: k(e.filepath),
248
- description: R(e.header, "description", "summary") ?? e.excerpt,
258
+ description: z(e.header, "description", "summary") ?? e.excerpt,
249
259
  tags: 0 < n.length ? n : void 0,
250
260
  mtime: e.fileMetadata?.mtime,
251
261
  schema: e.schema
@@ -253,13 +263,13 @@ function B(e) {
253
263
  }
254
264
  //#endregion
255
265
  //#region src/shared/utils/debounce.ts
256
- function V(e, t) {
266
+ function H(e, t) {
257
267
  let n;
258
268
  return (...r) => {
259
269
  clearTimeout(n), n = setTimeout(() => e(...r), t);
260
270
  };
261
271
  }
262
- function H(e, t) {
272
+ function de(e, t) {
263
273
  let n = 0, r;
264
274
  return (...i) => {
265
275
  let a = Date.now();
@@ -270,12 +280,12 @@ function H(e, t) {
270
280
  }
271
281
  //#endregion
272
282
  //#region src/shared/utils/field.ts
273
- function de(e) {
283
+ function fe(e) {
274
284
  return e.startsWith("_");
275
285
  }
276
286
  //#endregion
277
287
  //#region src/shared/utils/html.ts
278
- var U = /* @__PURE__ */ e((/* @__PURE__ */ n(((e, t) => {
288
+ var U = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
279
289
  (function(e) {
280
290
  if (typeof n != "function") {
281
291
  var n = function(e) {
@@ -374,22 +384,22 @@ var U = /* @__PURE__ */ e((/* @__PURE__ */ n(((e, t) => {
374
384
  }) : typeof t == "object" && t.exports ? t.exports = c : e.striptags = c;
375
385
  })(e);
376
386
  })))(), 1);
377
- function fe(e) {
387
+ function pe(e) {
378
388
  return e.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
379
389
  }
380
- function pe(e) {
390
+ function me(e) {
381
391
  return W((0, U.default)(e)).replace(/\s+/g, " ").trim();
382
392
  }
383
- var me = /* @__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(".");
384
- function he(e) {
385
- return e === void 0 ? "" : (0, U.default)(e, me);
393
+ var he = /* @__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(".");
394
+ function ge(e) {
395
+ return e === void 0 ? "" : (0, U.default)(e, he);
386
396
  }
387
397
  function W(e) {
388
398
  return e.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\"").replaceAll("&#39;", "'").replaceAll("&amp;", "&");
389
399
  }
390
400
  //#endregion
391
401
  //#region src/shared/utils/regex.ts
392
- function ge(e) {
402
+ function _e(e) {
393
403
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
394
404
  }
395
405
  //#endregion
@@ -402,7 +412,7 @@ function Q(e) {
402
412
  day: "numeric"
403
413
  });
404
414
  }
405
- function _e(e, t) {
415
+ function ve(e, t) {
406
416
  return typeof window > "u" ? "" : Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
407
417
  }
408
418
  function $(e) {
@@ -410,20 +420,20 @@ function $(e) {
410
420
  let t = Math.floor(Date.now() / 1e3) - e;
411
421
  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`;
412
422
  }
413
- var ve = new Intl.DateTimeFormat("en-US", {
423
+ var ye = new Intl.DateTimeFormat("en-US", {
414
424
  year: "numeric",
415
425
  month: "short",
416
426
  day: "numeric"
417
427
  });
418
- function ye(e) {
428
+ function be(e) {
419
429
  let t = new Date(e);
420
- return Number.isNaN(t.getTime()) ? e : ve.format(t);
430
+ return Number.isNaN(t.getTime()) ? e : ye.format(t);
421
431
  }
422
- function be(e) {
432
+ function xe(e) {
423
433
  return new Date(e).toISOString().slice(0, 10);
424
434
  }
425
- function xe(e) {
435
+ function Se(e) {
426
436
  return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
427
437
  }
428
438
  //#endregion
429
- export { o as $, ae as A, ee as B, E as C, re as D, k as E, N as F, p as G, C as H, h as I, u as J, m as K, _ as L, j as M, M as N, A as O, se as P, r as Q, y as R, T as S, O as T, d as U, S as V, f as W, i as X, c as Y, a as Z, P as _, $ as a, I as b, fe as c, W as d, s as et, de as f, le as g, ce as h, be as i, oe as j, ie as k, he as l, H as m, ye as n, xe as o, V as p, l as q, _e as r, ge as s, Q as t, pe as u, ue as v, D as w, ne as x, F as y, b as z };
439
+ export { r as $, M as A, te as B, re as C, ie as D, k as E, P as F, p as G, C as H, h as I, l as J, ee as K, _ as L, ae as M, oe as N, A as O, se as P, a as Q, y as R, E as S, O as T, d as U, S as V, f as W, c as X, u as Y, i as Z, F as _, $ as a, L as b, pe as c, W as d, o as et, fe as f, le as g, ce as h, xe as i, N as j, j as k, ge as l, de as m, be as n, Se as o, H as p, m as q, ve as r, _e as s, Q as t, s as tt, me as u, ue as v, D as w, T as x, I as y, b as z };
package/dist/shared.js CHANGED
@@ -1 +1 @@
1
- export { X as CONTENT_EXTENSIONS, Z as CONTENT_GLOB, Y as EXTERNAL_URL_RE, Q as INDEX_FILENAME, $ as SEARCH_FIELDS, et as SEARCH_STORE_FIELDS, h as buildContentTree, g as buildDirectoryListingMap, p as debounce, c as escapeHtml, s as escapeRegex, t as formatAbsoluteTime, n as formatDateString, r as formatEditTime, i as formatIsoDate, a as formatRelativeTime, o as formatTime, x as getAnchor, S as getDirectoryFromPageUrl, C as getDirectoryUrl, w as getIndexUrl, _ as getNodeIndexItem, T as getParentUrl, E as getTdContentUrl, v as getTdIndexTitle, y as getTdResourceTitle, D as getUrlPath, f as isBuiltinField, b as isIndexFile, O as isIndexUrl, q as isOptional, k as isUrlAncestorOf, A as isUrlExternal, j as isUrlToPage, U as kebabToPascal, J as makeOptional, W as parseNumericPrefix, B as path, M as resolveRootUrl, l as sanitizeInlineHtml, G as snakeToKebab, N as stripAnchor, u as stripHtml, P as stripLeadingSlash, F as stripTrailingSlash, m as throttle, d as unescapeHtml, K as unslugify } from "./shared-kjMIXu1H.js";
1
+ export { Z as CONTENT_EXTENSIONS, Q as CONTENT_GLOB, X as EXTERNAL_URL_RE, $ as INDEX_FILENAME, et as SEARCH_FIELDS, tt as SEARCH_STORE_FIELDS, h as buildContentTree, g as buildDirectoryListingMap, p as debounce, c as escapeHtml, s as escapeRegex, t as formatAbsoluteTime, n as formatDateString, r as formatEditTime, i as formatIsoDate, a as formatRelativeTime, o as formatTime, x as getAnchor, S as getDirectoryFromPageUrl, C as getDirectoryUrl, w as getIndexUrl, _ as getNodeIndexItem, T as getParentUrl, E as getTdContentUrl, v as getTdIndexTitle, y as getTdResourceTitle, D as getUrlPath, f as isBuiltinField, b as isIndexFile, O as isIndexUrl, J as isOptional, k as isUrlAncestorOf, A as isUrlExternal, j as isUrlToPage, U as kebabToPascal, Y as makeOptional, W as parseNumericPrefix, G as pascalToKebab, B as path, M as resolveRootUrl, l as sanitizeInlineHtml, K as snakeToKebab, N as stripAnchor, u as stripHtml, P as stripLeadingSlash, F as stripTrailingSlash, m as throttle, d as unescapeHtml, q as unslugify } from "./shared-C5ERr4vS.js";