typerighter 0.43.1 → 0.44.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-DjpuKzvd.js → app-Cs3OppHS.js} +1 -1
- package/dist/{cli-BnRDeJy2.js → cli-BcvGlMzh.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/theme-default.js +154 -154
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-BCfVnwE1.js → init-DCe3DWKz.js} +2 -2
- package/dist/{jsonld-ODTuVGMh.js → jsonld-DZsAYYxx.js} +1 -1
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/lib/codegen/app-entry.d.ts +1 -1
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/node/lib/codegen/index.d.ts +0 -1
- package/dist/node/lib/codegen/index.d.ts.map +1 -1
- package/dist/node/lib/components.d.ts +14 -0
- package/dist/node/lib/components.d.ts.map +1 -0
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/node/plugin/vite/subplugins/component-contract.d.ts +4 -0
- package/dist/node/plugin/vite/subplugins/component-contract.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/app.d.ts.map +1 -1
- package/dist/prerenderWorker.js +2 -2
- package/dist/{renderMath-C2Z7HdfG.js → renderMath-BAZXLnOu.js} +1 -1
- package/dist/rolldown-runtime-CEFd7nDs.js +30 -0
- package/dist/shared/types/index.d.ts +1 -0
- package/dist/shared/types/index.d.ts.map +1 -1
- package/dist/shared/types/json-schema.d.ts +24 -0
- package/dist/shared/types/json-schema.d.ts.map +1 -0
- package/dist/{shared-QuBFygxT.js → shared-kjMIXu1H.js} +114 -102
- package/dist/shared.js +1 -1
- package/dist/vite-DrX11EH5.js +127331 -0
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/node/lib/codegen/components.d.ts +0 -7
- package/dist/node/lib/codegen/components.d.ts.map +0 -1
- package/dist/rolldown-runtime-B0aSnxlc.js +0 -20
- package/dist/vite-C9pVUTyV.js +0 -1542
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as Content, t as createTypedownApp, c as useRoute, l as useRouter, r as useSiteConfig, i as useSiteData, a as useTdContent, o as useTheme } from "./app-
|
|
1
|
+
export { s as Content, t as createTypedownApp, c as useRoute, l as useRouter, r as useSiteConfig, i as useSiteData, a as useTdContent, o as useTheme } from "./app-Cs3OppHS.js";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-
|
|
2
|
-
import { t as s } from "./cli-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-DrX11EH5.js";
|
|
2
|
+
import { t as s } from "./cli-BcvGlMzh.js";
|
|
3
3
|
export { n as PAGES_ID, i as PAGE_DATA_EVENT, t as SEARCH_INDEX_ID, e as SITE_DATA_ID, r as THEME_ID, a as buildSite, s as cli, o as typedown };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CEFd7nDs.js";
|
|
2
2
|
import { t } from "./context-CSvoDxVt.js";
|
|
3
3
|
import { a as n, i as r, n as i, r as a, t as o } from "./brand-CG1fQshq.js";
|
|
4
4
|
import s from "node:path";
|
|
@@ -746,7 +746,7 @@ function He(e) {
|
|
|
746
746
|
build: "typerighter build",
|
|
747
747
|
preview: "typerighter preview"
|
|
748
748
|
},
|
|
749
|
-
devDependencies: { typerighter: "^0.
|
|
749
|
+
devDependencies: { typerighter: "^0.44.0" }
|
|
750
750
|
}, void 0, 2) + "\n";
|
|
751
751
|
}
|
|
752
752
|
function Ue() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as e, c as t, i as n } from "./shared-
|
|
1
|
+
import { K as e, c as t, i as n } from "./shared-kjMIXu1H.js";
|
|
2
2
|
//#region src/node/lib/html-template.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/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,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;AAqBd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,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,CAwN3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-entry.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/app-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,
|
|
1
|
+
{"version":3,"file":"app-entry.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/app-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CA8GzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,GACpB,MAAM,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TdComponentEntry } from '@typerighter/rpc-client';
|
|
2
|
+
import type { JsonSchema } from '@/shared/types/json-schema';
|
|
3
|
+
export interface UserComponent {
|
|
4
|
+
name: string;
|
|
5
|
+
absolutePath: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildComponentContract(components: UserComponent[], projectRoot: string): Record<string, ComponentContractEntry>;
|
|
8
|
+
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
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACU,KAAK,MAAM,EAC3B,MAAM,MAAM,CAAC;AAOd,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AA6CvB,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,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,CA+VvE"}
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAQxB,qBAAa,UAAU;IACf,IAAI,CAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAgCjD,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
|
package/dist/prerenderWorker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as e } from "./shared-
|
|
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-
|
|
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";
|
|
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
|
|
@@ -0,0 +1,30 @@
|
|
|
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, n) => () => {
|
|
3
|
+
if (n) throw n[0];
|
|
4
|
+
try {
|
|
5
|
+
return e && (t = e(e = 0)), t;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
throw n = [e], e;
|
|
8
|
+
}
|
|
9
|
+
}, s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = (e, n) => {
|
|
10
|
+
let r = {};
|
|
11
|
+
for (var i in e) t(r, i, {
|
|
12
|
+
get: e[i],
|
|
13
|
+
enumerable: !0
|
|
14
|
+
});
|
|
15
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
16
|
+
}, l = (e, i, o, s) => {
|
|
17
|
+
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, {
|
|
18
|
+
get: ((e) => i[e]).bind(null, d),
|
|
19
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
20
|
+
});
|
|
21
|
+
return e;
|
|
22
|
+
}, u = (n, r, o) => (o = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
23
|
+
value: n,
|
|
24
|
+
enumerable: !0
|
|
25
|
+
}) : o, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e), f = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
26
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
27
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { d as a, f as i, o as n, u as o, c as r, s as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ArraySchema {
|
|
2
|
+
type: 'array';
|
|
3
|
+
items: JsonSchema;
|
|
4
|
+
}
|
|
5
|
+
export interface DictSchema {
|
|
6
|
+
type: 'object';
|
|
7
|
+
additionalProperties: JsonSchema;
|
|
8
|
+
}
|
|
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
|
+
}
|
|
13
|
+
export interface PrimitiveSchema {
|
|
14
|
+
type: 'string' | 'number' | 'boolean';
|
|
15
|
+
}
|
|
16
|
+
export interface ProductSchema {
|
|
17
|
+
type: 'object';
|
|
18
|
+
properties: Record<string, JsonSchema>;
|
|
19
|
+
required?: string[];
|
|
20
|
+
additionalProperties: false;
|
|
21
|
+
}
|
|
22
|
+
export declare function isOptional(schema: JsonSchema): boolean;
|
|
23
|
+
export declare function makeOptional(schema: JsonSchema): JsonSchema;
|
|
24
|
+
//# sourceMappingURL=json-schema.d.ts.map
|
|
@@ -0,0 +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,12 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as e, r as t, t as n } from "./rolldown-runtime-CEFd7nDs.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
|
-
//#region src/shared/
|
|
5
|
+
//#region src/shared/types/json-schema.ts
|
|
6
6
|
function l(e) {
|
|
7
|
-
return
|
|
7
|
+
return Array.isArray(e.type);
|
|
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;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/shared/utils/format.ts
|
|
18
|
+
function d(e) {
|
|
19
|
+
return e.replace(/(^|[-_])([a-z])/g, (e, t, n) => n.toUpperCase());
|
|
20
|
+
}
|
|
21
|
+
function f(e) {
|
|
10
22
|
let t = e.match(/^(\d+)[-_](.+)$/);
|
|
11
23
|
return t ? {
|
|
12
24
|
order: Number(t[1]),
|
|
@@ -16,89 +28,89 @@ function u(e) {
|
|
|
16
28
|
rest: e
|
|
17
29
|
};
|
|
18
30
|
}
|
|
19
|
-
function
|
|
31
|
+
function p(e) {
|
|
20
32
|
return e.replace(/_/g, "-");
|
|
21
33
|
}
|
|
22
|
-
function
|
|
23
|
-
let { rest: t } =
|
|
34
|
+
function m(e) {
|
|
35
|
+
let { rest: t } = f(e), n = t.replace(/[-_]/g, " ").split(" ");
|
|
24
36
|
return 0 < n.length && (n[0] = n[0].charAt(0).toUpperCase() + n[0].slice(1)), n.join(" ");
|
|
25
37
|
}
|
|
26
38
|
//#endregion
|
|
27
39
|
//#region src/shared/utils/path.ts
|
|
28
|
-
var
|
|
29
|
-
basename: () =>
|
|
30
|
-
dirname: () =>
|
|
31
|
-
extname: () =>
|
|
32
|
-
filestem: () =>
|
|
33
|
-
isContentFile: () =>
|
|
34
|
-
isTypeFile: () =>
|
|
35
|
-
join: () =>
|
|
36
|
-
stripExtension: () =>
|
|
37
|
-
stripPrefix: () =>
|
|
40
|
+
var ee = /* @__PURE__ */ t({
|
|
41
|
+
basename: () => h,
|
|
42
|
+
dirname: () => g,
|
|
43
|
+
extname: () => _,
|
|
44
|
+
filestem: () => v,
|
|
45
|
+
isContentFile: () => y,
|
|
46
|
+
isTypeFile: () => b,
|
|
47
|
+
join: () => x,
|
|
48
|
+
stripExtension: () => S,
|
|
49
|
+
stripPrefix: () => C
|
|
38
50
|
});
|
|
39
|
-
function
|
|
40
|
-
let n =
|
|
51
|
+
function h(e, t) {
|
|
52
|
+
let n = w(e).split("/").pop() ?? "";
|
|
41
53
|
return t !== void 0 && n.endsWith(t) ? n.slice(0, -t.length) : n;
|
|
42
54
|
}
|
|
43
|
-
function h(e) {
|
|
44
|
-
let t = C(e).split("/");
|
|
45
|
-
return t.pop(), t.join("/");
|
|
46
|
-
}
|
|
47
55
|
function g(e) {
|
|
48
|
-
let t =
|
|
49
|
-
return
|
|
56
|
+
let t = w(e).split("/");
|
|
57
|
+
return t.pop(), t.join("/");
|
|
50
58
|
}
|
|
51
59
|
function _(e) {
|
|
52
|
-
let t =
|
|
53
|
-
return n <= 0 ?
|
|
60
|
+
let t = h(e), n = t.lastIndexOf(".");
|
|
61
|
+
return n <= 0 ? "" : t.slice(n);
|
|
54
62
|
}
|
|
55
63
|
function v(e) {
|
|
56
|
-
|
|
64
|
+
let t = h(e), n = t.lastIndexOf(".");
|
|
65
|
+
return n <= 0 ? t : t.slice(0, n);
|
|
57
66
|
}
|
|
58
67
|
function y(e) {
|
|
59
|
-
return
|
|
68
|
+
return i.includes(_(e));
|
|
60
69
|
}
|
|
61
|
-
function b(
|
|
70
|
+
function b(e) {
|
|
71
|
+
return y(e) && e.split("/").includes("_types");
|
|
72
|
+
}
|
|
73
|
+
function x(...e) {
|
|
62
74
|
return e.filter(Boolean).join("/").replace(/\\+/g, "/").replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
63
75
|
}
|
|
64
|
-
function
|
|
65
|
-
let t =
|
|
76
|
+
function S(e) {
|
|
77
|
+
let t = _(e);
|
|
66
78
|
return t ? e.slice(0, -t.length) : e;
|
|
67
79
|
}
|
|
68
|
-
function
|
|
69
|
-
let n =
|
|
80
|
+
function C(e, t) {
|
|
81
|
+
let n = w(e), r = `/${t}/`, i = n.lastIndexOf(r);
|
|
70
82
|
return i === -1 ? n : n.slice(i + r.length);
|
|
71
83
|
}
|
|
72
|
-
function
|
|
84
|
+
function w(e) {
|
|
73
85
|
return e.replace(/\\/g, "/");
|
|
74
86
|
}
|
|
75
87
|
//#endregion
|
|
76
88
|
//#region src/shared/utils/url.ts
|
|
77
|
-
var
|
|
78
|
-
function
|
|
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) {
|
|
79
91
|
let t = e.indexOf("#");
|
|
80
92
|
return 0 <= t ? e.slice(t + 1) : "";
|
|
81
93
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
94
|
+
function T(e) {
|
|
95
|
+
return A(e) ? O(e) : e;
|
|
84
96
|
}
|
|
85
|
-
function
|
|
97
|
+
function E(e, t) {
|
|
86
98
|
return `${e}/${t}`;
|
|
87
99
|
}
|
|
88
|
-
function
|
|
100
|
+
function D(e) {
|
|
89
101
|
return e === "/" ? "/index" : e + "/index";
|
|
90
102
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
103
|
+
function O(e) {
|
|
104
|
+
return g(N(e)) || "/";
|
|
93
105
|
}
|
|
94
|
-
function
|
|
95
|
-
let t =
|
|
96
|
-
return "/" +
|
|
106
|
+
function k(e) {
|
|
107
|
+
let t = v(e);
|
|
108
|
+
return "/" + x(g(e), t);
|
|
97
109
|
}
|
|
98
110
|
function re(e) {
|
|
99
111
|
return e.split("?")[0].split("#")[0];
|
|
100
112
|
}
|
|
101
|
-
function
|
|
113
|
+
function A(e) {
|
|
102
114
|
return e === "/index" || e.endsWith("/index");
|
|
103
115
|
}
|
|
104
116
|
function ie(e, t) {
|
|
@@ -108,25 +120,25 @@ function ae(e) {
|
|
|
108
120
|
return c.test(e);
|
|
109
121
|
}
|
|
110
122
|
function oe(e) {
|
|
111
|
-
let t =
|
|
112
|
-
return t === "" || !
|
|
123
|
+
let t = _(e).slice(1);
|
|
124
|
+
return t === "" || !te.has(t.toLowerCase());
|
|
113
125
|
}
|
|
114
|
-
function
|
|
126
|
+
function j(e) {
|
|
115
127
|
return e === "/" ? "/index" : e;
|
|
116
128
|
}
|
|
117
|
-
function
|
|
129
|
+
function M(e) {
|
|
118
130
|
let t = e.indexOf("#");
|
|
119
131
|
return 0 <= t ? e.slice(0, t) : e;
|
|
120
132
|
}
|
|
121
|
-
function
|
|
133
|
+
function se(e) {
|
|
122
134
|
return e.replace(/^\//, "");
|
|
123
135
|
}
|
|
124
|
-
function
|
|
136
|
+
function N(e) {
|
|
125
137
|
return e.replace(/\/$/, "") || "/";
|
|
126
138
|
}
|
|
127
139
|
//#endregion
|
|
128
140
|
//#region src/shared/utils/content.ts
|
|
129
|
-
function
|
|
141
|
+
function ce(e) {
|
|
130
142
|
let t = {
|
|
131
143
|
name: "",
|
|
132
144
|
entries: []
|
|
@@ -148,31 +160,31 @@ function se(e) {
|
|
|
148
160
|
item: n
|
|
149
161
|
});
|
|
150
162
|
}
|
|
151
|
-
return
|
|
163
|
+
return z(t), { entries: t.entries };
|
|
152
164
|
}
|
|
153
|
-
function
|
|
165
|
+
function le(e, t) {
|
|
154
166
|
let n = {};
|
|
155
167
|
function r(e) {
|
|
156
168
|
let t = 0;
|
|
157
|
-
for (let n of e.entries) n.kind === "file" ?
|
|
169
|
+
for (let n of e.entries) n.kind === "file" ? I(n.item.filepath) || t++ : t += r(n.node);
|
|
158
170
|
return t;
|
|
159
171
|
}
|
|
160
172
|
function i(e, t) {
|
|
161
|
-
let n =
|
|
162
|
-
return n ?
|
|
173
|
+
let n = P(e);
|
|
174
|
+
return n ? k(n.filepath) : D(`${t}/${e.name}`);
|
|
163
175
|
}
|
|
164
176
|
function a(e, t) {
|
|
165
177
|
let n = [];
|
|
166
178
|
for (let a of e) a.kind === "dir" ? n.push({
|
|
167
179
|
kind: "dir",
|
|
168
180
|
sub: {
|
|
169
|
-
name:
|
|
181
|
+
name: m(a.node.name),
|
|
170
182
|
url: i(a.node, t),
|
|
171
183
|
count: r(a.node)
|
|
172
184
|
}
|
|
173
|
-
}) :
|
|
185
|
+
}) : I(a.item.filepath) || n.push({
|
|
174
186
|
kind: "file",
|
|
175
|
-
item:
|
|
187
|
+
item: B(a.item)
|
|
176
188
|
});
|
|
177
189
|
return n;
|
|
178
190
|
}
|
|
@@ -181,7 +193,7 @@ function ce(e, t) {
|
|
|
181
193
|
if (r.kind !== "dir") continue;
|
|
182
194
|
let e = r.node, i = t ? `${t}/${e.name}` : `/${e.name}`;
|
|
183
195
|
n[i] = {
|
|
184
|
-
title:
|
|
196
|
+
title: m(e.name),
|
|
185
197
|
url: i,
|
|
186
198
|
entries: a(e.entries, i)
|
|
187
199
|
}, o(e.entries, i);
|
|
@@ -193,47 +205,47 @@ function ce(e, t) {
|
|
|
193
205
|
entries: a(e, "")
|
|
194
206
|
}, o(e, ""), n;
|
|
195
207
|
}
|
|
196
|
-
function
|
|
197
|
-
for (let t of e.entries) if (t.kind === "file" &&
|
|
208
|
+
function P(e) {
|
|
209
|
+
for (let t of e.entries) if (t.kind === "file" && I(t.item.filepath)) return t.item;
|
|
198
210
|
}
|
|
199
|
-
function
|
|
200
|
-
let n =
|
|
201
|
-
return n ?
|
|
211
|
+
function ue(e, t) {
|
|
212
|
+
let n = h(g(e));
|
|
213
|
+
return n ? m(n) : t;
|
|
202
214
|
}
|
|
203
|
-
function
|
|
215
|
+
function F(e, t) {
|
|
204
216
|
if (t !== void 0) return t;
|
|
205
|
-
let n =
|
|
206
|
-
if (
|
|
207
|
-
let t =
|
|
208
|
-
return t ?
|
|
217
|
+
let n = v(e);
|
|
218
|
+
if (I(e)) {
|
|
219
|
+
let t = h(g(e));
|
|
220
|
+
return t ? m(t) : n;
|
|
209
221
|
}
|
|
210
|
-
return
|
|
211
|
-
}
|
|
212
|
-
function F(e) {
|
|
213
|
-
return _(e) === r;
|
|
222
|
+
return m(n);
|
|
214
223
|
}
|
|
215
224
|
function I(e) {
|
|
216
|
-
return e
|
|
225
|
+
return v(e) === r;
|
|
217
226
|
}
|
|
218
|
-
function L(e
|
|
227
|
+
function L(e) {
|
|
228
|
+
return e.kind === "dir" ? e.node.name : v(e.item.filepath);
|
|
229
|
+
}
|
|
230
|
+
function R(e, ...t) {
|
|
219
231
|
for (let n of t) {
|
|
220
232
|
let t = e[n];
|
|
221
233
|
if (typeof t == "string" && 0 < t.length) return t;
|
|
222
234
|
}
|
|
223
235
|
}
|
|
224
|
-
function
|
|
236
|
+
function z(e) {
|
|
225
237
|
e.entries.sort((e, t) => {
|
|
226
|
-
let n =
|
|
238
|
+
let n = L(e), r = L(t), i = f(n), a = f(r);
|
|
227
239
|
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;
|
|
228
240
|
});
|
|
229
|
-
for (let t of e.entries) t.kind === "dir" &&
|
|
241
|
+
for (let t of e.entries) t.kind === "dir" && z(t.node);
|
|
230
242
|
}
|
|
231
|
-
function
|
|
243
|
+
function B(e) {
|
|
232
244
|
let t = e.header.tags, n = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
233
245
|
return {
|
|
234
|
-
name:
|
|
235
|
-
url:
|
|
236
|
-
description:
|
|
246
|
+
name: F(e.filepath, e.label),
|
|
247
|
+
url: k(e.filepath),
|
|
248
|
+
description: R(e.header, "description", "summary") ?? e.excerpt,
|
|
237
249
|
tags: 0 < n.length ? n : void 0,
|
|
238
250
|
mtime: e.fileMetadata?.mtime,
|
|
239
251
|
schema: e.schema
|
|
@@ -241,13 +253,13 @@ function z(e) {
|
|
|
241
253
|
}
|
|
242
254
|
//#endregion
|
|
243
255
|
//#region src/shared/utils/debounce.ts
|
|
244
|
-
function
|
|
256
|
+
function V(e, t) {
|
|
245
257
|
let n;
|
|
246
258
|
return (...r) => {
|
|
247
259
|
clearTimeout(n), n = setTimeout(() => e(...r), t);
|
|
248
260
|
};
|
|
249
261
|
}
|
|
250
|
-
function
|
|
262
|
+
function H(e, t) {
|
|
251
263
|
let n = 0, r;
|
|
252
264
|
return (...i) => {
|
|
253
265
|
let a = Date.now();
|
|
@@ -258,12 +270,12 @@ function V(e, t) {
|
|
|
258
270
|
}
|
|
259
271
|
//#endregion
|
|
260
272
|
//#region src/shared/utils/field.ts
|
|
261
|
-
function
|
|
273
|
+
function de(e) {
|
|
262
274
|
return e.startsWith("_");
|
|
263
275
|
}
|
|
264
276
|
//#endregion
|
|
265
277
|
//#region src/shared/utils/html.ts
|
|
266
|
-
var U = /* @__PURE__ */
|
|
278
|
+
var U = /* @__PURE__ */ e((/* @__PURE__ */ n(((e, t) => {
|
|
267
279
|
(function(e) {
|
|
268
280
|
if (typeof n != "function") {
|
|
269
281
|
var n = function(e) {
|
|
@@ -362,22 +374,22 @@ var U = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
|
|
|
362
374
|
}) : typeof t == "object" && t.exports ? t.exports = c : e.striptags = c;
|
|
363
375
|
})(e);
|
|
364
376
|
})))(), 1);
|
|
365
|
-
function
|
|
377
|
+
function fe(e) {
|
|
366
378
|
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
367
379
|
}
|
|
368
|
-
function
|
|
380
|
+
function pe(e) {
|
|
369
381
|
return W((0, U.default)(e)).replace(/\s+/g, " ").trim();
|
|
370
382
|
}
|
|
371
|
-
var
|
|
372
|
-
function
|
|
373
|
-
return e === void 0 ? "" : (0, U.default)(e,
|
|
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);
|
|
374
386
|
}
|
|
375
387
|
function W(e) {
|
|
376
388
|
return e.replaceAll("<", "<").replaceAll(">", ">").replaceAll(""", "\"").replaceAll("'", "'").replaceAll("&", "&");
|
|
377
389
|
}
|
|
378
390
|
//#endregion
|
|
379
391
|
//#region src/shared/utils/regex.ts
|
|
380
|
-
function
|
|
392
|
+
function ge(e) {
|
|
381
393
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
382
394
|
}
|
|
383
395
|
//#endregion
|
|
@@ -390,7 +402,7 @@ function Q(e) {
|
|
|
390
402
|
day: "numeric"
|
|
391
403
|
});
|
|
392
404
|
}
|
|
393
|
-
function
|
|
405
|
+
function _e(e, t) {
|
|
394
406
|
return typeof window > "u" ? "" : Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
|
|
395
407
|
}
|
|
396
408
|
function $(e) {
|
|
@@ -398,20 +410,20 @@ function $(e) {
|
|
|
398
410
|
let t = Math.floor(Date.now() / 1e3) - e;
|
|
399
411
|
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`;
|
|
400
412
|
}
|
|
401
|
-
var
|
|
413
|
+
var ve = new Intl.DateTimeFormat("en-US", {
|
|
402
414
|
year: "numeric",
|
|
403
415
|
month: "short",
|
|
404
416
|
day: "numeric"
|
|
405
417
|
});
|
|
406
|
-
function
|
|
418
|
+
function ye(e) {
|
|
407
419
|
let t = new Date(e);
|
|
408
|
-
return Number.isNaN(t.getTime()) ? e :
|
|
420
|
+
return Number.isNaN(t.getTime()) ? e : ve.format(t);
|
|
409
421
|
}
|
|
410
|
-
function
|
|
422
|
+
function be(e) {
|
|
411
423
|
return new Date(e).toISOString().slice(0, 10);
|
|
412
424
|
}
|
|
413
|
-
function
|
|
425
|
+
function xe(e) {
|
|
414
426
|
return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
|
|
415
427
|
}
|
|
416
428
|
//#endregion
|
|
417
|
-
export { ae as A,
|
|
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 };
|
package/dist/shared.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
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";
|