typerighter 0.5.0 → 0.6.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.
Potentially problematic release.
This version of typerighter might be problematic. Click here for more details.
- package/dist/app-BZKg-fe3.js +364 -0
- package/dist/brand-BfamszbH.js +12 -0
- package/dist/{cli-9LGeV7cc.js → cli-D5-gYw26.js} +15 -12
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts +3 -1
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/theme-default.js +590 -441
- package/dist/client.js +1 -1
- package/dist/{constants-Bo603IxE.js → constants-Dq357AVO.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-a4nECqEz.js → init-CzF7lqKE.js} +4 -3
- package/dist/shared/utils/url.d.ts +2 -1
- package/dist/shared/utils/url.d.ts.map +1 -1
- package/dist/{brand-CmL-6h9U.js → shared-BoWAaUci.js} +35 -46
- package/dist/typerighter.css +1 -1
- package/dist/{vite-DaD9YRkN.js → vite-BrwFwz0T.js} +36 -35
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/app-Bw90hv7G.js +0 -266
package/dist/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, o as i, t as a, u as o } from "./app-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, o as i, t as a, u as o } from "./app-BZKg-fe3.js";
|
|
2
2
|
export { t as Content, a as createTypedownApp, r as useRoute, o as useRouter, n as useSiteConfig, e as useSiteData, i as useTdContent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as isUrlExternal, p as isUrlToPage, y as EXTERNAL_URL_RE } from "./shared-BoWAaUci.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import pc from "picocolors";
|
|
4
4
|
import { createLogger } from "vite";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, t } from "./vite-
|
|
1
|
+
import { n as e, t } from "./vite-BrwFwz0T.js";
|
|
2
2
|
import "./vite.js";
|
|
3
|
-
import { n, t as r } from "./cli-
|
|
3
|
+
import { n, t as r } from "./cli-D5-gYw26.js";
|
|
4
4
|
export { n as buildSite, r as cli, t as generateClientAppEntry, e as typedown };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as e, c as t, i as n } from "./constants-
|
|
2
|
-
import
|
|
1
|
+
import { a as e, c as t, i as n } from "./constants-Dq357AVO.js";
|
|
2
|
+
import "./shared-BoWAaUci.js";
|
|
3
|
+
import { o as r, r as i } from "./brand-BfamszbH.js";
|
|
3
4
|
import a from "node:path";
|
|
4
5
|
import "node:fs";
|
|
5
6
|
import o from "node:fs/promises";
|
|
@@ -2298,7 +2299,7 @@ function ei(e) {
|
|
|
2298
2299
|
build: "typerighter build",
|
|
2299
2300
|
preview: "typerighter preview"
|
|
2300
2301
|
},
|
|
2301
|
-
devDependencies: { typerighter: "^0.
|
|
2302
|
+
devDependencies: { typerighter: "^0.6.0" }
|
|
2302
2303
|
}, void 0, 2) + "\n";
|
|
2303
2304
|
}
|
|
2304
2305
|
function ti() {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare function isUrlExternal(path: string): boolean;
|
|
2
1
|
export declare function getDirectoryUrl(urlPrefix: string, name: string): string;
|
|
3
2
|
export declare function getParentUrl(urlPath: string): string;
|
|
4
3
|
export declare function getTdContentUrl(filepath: string): string;
|
|
5
4
|
export declare function isUrlAncestorOf(directoryUrl: string, path: string): boolean;
|
|
5
|
+
export declare function isUrlExternal(path: string): boolean;
|
|
6
6
|
export declare function isUrlToPage(filename: string): boolean;
|
|
7
|
+
export declare function stripAnchor(url: string): string;
|
|
7
8
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/url.ts"],"names":[],"mappings":"AAoBA,wBAAgB,eAAe,CAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,eAAe,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,wBAAgB,eAAe,CAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5E;AAGD,wBAAgB,aAAa,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAGD,wBAAgB,WAAW,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAItD;AAGD,wBAAgB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD"}
|
|
@@ -53,34 +53,34 @@ function h(e) {
|
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/shared/utils/url.ts
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
var _ = 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(","));
|
|
60
|
-
function v(e, t) {
|
|
56
|
+
var g = 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(","));
|
|
57
|
+
function _(e, t) {
|
|
61
58
|
return `${e}/${t}`;
|
|
62
59
|
}
|
|
63
|
-
function
|
|
60
|
+
function v(e) {
|
|
64
61
|
return l(e.replace(/\/$/, "")) || "/";
|
|
65
62
|
}
|
|
66
|
-
function
|
|
63
|
+
function y(e) {
|
|
67
64
|
let t = d(e);
|
|
68
|
-
if (t === "index") {
|
|
69
|
-
let t = l(e);
|
|
70
|
-
return t ? "/" + t : "/";
|
|
71
|
-
}
|
|
72
65
|
return "/" + p(l(e), t);
|
|
73
66
|
}
|
|
74
|
-
function
|
|
67
|
+
function b(e, t) {
|
|
75
68
|
return t.startsWith(e + "/") || t === e;
|
|
76
69
|
}
|
|
70
|
+
function x(e) {
|
|
71
|
+
return a.test(e);
|
|
72
|
+
}
|
|
77
73
|
function S(e) {
|
|
78
74
|
let t = u(e).slice(1);
|
|
79
|
-
return t === "" || !
|
|
75
|
+
return t === "" || !g.has(t.toLowerCase());
|
|
76
|
+
}
|
|
77
|
+
function C(e) {
|
|
78
|
+
let t = e.indexOf("#");
|
|
79
|
+
return 0 <= t ? e.slice(0, t) : e;
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/shared/utils/content.ts
|
|
83
|
-
function
|
|
83
|
+
function w(e) {
|
|
84
84
|
let t = {
|
|
85
85
|
name: "",
|
|
86
86
|
children: [],
|
|
@@ -98,12 +98,12 @@ function C(e) {
|
|
|
98
98
|
}
|
|
99
99
|
r.items.push(n);
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return O(t), {
|
|
102
102
|
rootItems: t.items,
|
|
103
103
|
children: t.children
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function T(e, t) {
|
|
107
107
|
let n = {};
|
|
108
108
|
function r(e) {
|
|
109
109
|
let t = e.items.length;
|
|
@@ -113,8 +113,8 @@ function w(e, t) {
|
|
|
113
113
|
function i(e, t) {
|
|
114
114
|
let n = e.items[0] ?? e.children[0]?.items[0];
|
|
115
115
|
if (!n) return `${t}/${e.name}`;
|
|
116
|
-
let r =
|
|
117
|
-
return d(n.filepath) === "index" ? r :
|
|
116
|
+
let r = y(n.filepath);
|
|
117
|
+
return d(n.filepath) === "index" ? r : v(r);
|
|
118
118
|
}
|
|
119
119
|
function a(e, t) {
|
|
120
120
|
for (let o of e) {
|
|
@@ -128,8 +128,8 @@ function w(e, t) {
|
|
|
128
128
|
count: r(t)
|
|
129
129
|
})),
|
|
130
130
|
items: o.items.map((e) => ({
|
|
131
|
-
name:
|
|
132
|
-
url:
|
|
131
|
+
name: D(e.header, e.filepath),
|
|
132
|
+
url: y(e.filepath)
|
|
133
133
|
}))
|
|
134
134
|
}, a(o.children, e);
|
|
135
135
|
}
|
|
@@ -145,59 +145,48 @@ function w(e, t) {
|
|
|
145
145
|
items: []
|
|
146
146
|
}, a(e, ""), n;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function E(e, t) {
|
|
149
149
|
let n = c(l(e));
|
|
150
150
|
return n ? s(n) : t;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function D(e, t) {
|
|
153
153
|
return e._label === void 0 ? e.name === void 0 ? s(d(t)) : String(e.name) : String(e._label);
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function O(e) {
|
|
156
156
|
e.children.sort((e, t) => {
|
|
157
157
|
let n = o(e.name), r = o(t.name);
|
|
158
158
|
return n.order === r.order ? n.rest.localeCompare(r.rest) : n.order - r.order;
|
|
159
159
|
}), e.items.sort((e, t) => {
|
|
160
160
|
let n = o(d(e.filepath)), r = o(d(t.filepath));
|
|
161
|
-
return n.order === r.order ?
|
|
161
|
+
return n.order === r.order ? D(e.header, e.filepath).localeCompare(D(t.header, t.filepath)) : n.order - r.order;
|
|
162
162
|
});
|
|
163
|
-
for (let t of e.children)
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region src/shared/utils/html.ts
|
|
167
|
-
function O(e) {
|
|
168
|
-
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
169
|
-
}
|
|
170
|
-
function k(e) {
|
|
171
|
-
return e.replace(/<(style|script)[^>]*>[\s\S]*?<\/\1>/gi, "").replace(/<[^>]*>/g, "").replace(/\s+/g, " ").trim();
|
|
163
|
+
for (let t of e.children) O(t);
|
|
172
164
|
}
|
|
173
165
|
//#endregion
|
|
174
166
|
//#region src/shared/utils/time.ts
|
|
175
|
-
var
|
|
176
|
-
function
|
|
167
|
+
var k = 60, A = 60 * k, j = 24 * A, M = 7 * j, N = 30 * j, P = 365 * j, F = 2 * M;
|
|
168
|
+
function I(e) {
|
|
177
169
|
return (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("en-US", {
|
|
178
170
|
year: "numeric",
|
|
179
171
|
month: "short",
|
|
180
172
|
day: "numeric"
|
|
181
173
|
});
|
|
182
174
|
}
|
|
183
|
-
function
|
|
184
|
-
return Math.floor(Date.now() / 1e3) - e <
|
|
175
|
+
function L(e, t) {
|
|
176
|
+
return Math.floor(Date.now() / 1e3) - e < F ? `${t} ${R(e)}` : `${t} at ${I(e)}`;
|
|
185
177
|
}
|
|
186
|
-
function
|
|
178
|
+
function R(e) {
|
|
187
179
|
let t = Math.floor(Date.now() / 1e3) - e;
|
|
188
|
-
return t <
|
|
180
|
+
return t < k ? "just now" : t < A ? `${Math.floor(t / k)}m ago` : t < j ? `${Math.floor(t / A)}h ago` : t < M ? `${Math.floor(t / j)}d ago` : t < N ? `${Math.floor(t / M)}w ago` : t < P ? `${Math.floor(t / N)}mo ago` : `${Math.floor(t / P)}y ago`;
|
|
189
181
|
}
|
|
190
|
-
var
|
|
182
|
+
var z = new Intl.DateTimeFormat("en-US", {
|
|
191
183
|
year: "numeric",
|
|
192
184
|
month: "short",
|
|
193
185
|
day: "numeric"
|
|
194
186
|
});
|
|
195
|
-
function
|
|
187
|
+
function B(e) {
|
|
196
188
|
let t = new Date(e);
|
|
197
|
-
return Number.isNaN(t.getTime()) ? e :
|
|
189
|
+
return Number.isNaN(t.getTime()) ? e : z.format(t);
|
|
198
190
|
}
|
|
199
191
|
//#endregion
|
|
200
|
-
|
|
201
|
-
var H = "m15 10c-2.7614 0-5 2.2386-5 5v98c0 2.761 2.2386 5 5 5h178c2.761 0 5-2.239 5-5v-98c0-2.7614-2.239-5-5-5zm-15 5c0-8.28427 6.71573-15 15-15h178c8.284 0 15 6.71573 15 15v98c0 8.284-6.716 15-15 15h-178c-8.28427 0-15-6.716-15-15z", U = "M30 30h70v16h-27v52h-16v-52h-27z", W = "m155 98-30-33h20v-35h20v35h20z", G = "0 0 208 128", K = "#a0522d", q = `<svg fill='none' viewBox='${G}' xmlns='http://www.w3.org/2000/svg'><path clip-rule='evenodd' d='${H}' fill-rule='evenodd' fill='${K}'/><path d='${U}' fill='${K}'/><path d='${W}' fill='${K}'/></svg>`, J = `data:image/svg+xml,${encodeURIComponent(q)}`;
|
|
202
|
-
//#endregion
|
|
203
|
-
export { i as A, m as C, n as D, t as E, e as O, f as S, a as T, b as _, G as a, S as b, z as c, C as d, w as f, y as g, v as h, U as i, r as k, O as l, E as m, H as n, V as o, T as p, J as r, R as s, W as t, k as u, x as v, s as w, d as x, g as y };
|
|
192
|
+
export { r as C, e as S, m as _, T as a, t as b, _ as c, b as d, x as f, f as g, d as h, w as i, v as l, C as m, L as n, E as o, S as p, R as r, D as s, B as t, y as u, s as v, i as w, n as x, a as y };
|