typerighter 0.56.0 → 0.56.1
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/README.md +3 -3
- package/README.npm.md +3 -3
- package/dist/{app-Btmcn8ed.js → app-Dh1RgRtN.js} +440 -501
- package/dist/{cli-0cwy5E5t.js → cli-Be64NWBp.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/theme-default/composables/client-preferences/index.d.ts +0 -2
- package/dist/client/theme-default/composables/client-preferences/index.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/useSidebarConfig.d.ts +1 -0
- package/dist/client/theme-default/composables/client-preferences/useSidebarConfig.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/useTheme.d.ts +1 -0
- package/dist/client/theme-default/composables/client-preferences/useTheme.d.ts.map +1 -1
- package/dist/client/theme-default.js +1098 -1126
- package/dist/client.js +3 -1
- package/dist/index.js +2 -2
- package/dist/{init-CVVOslzB.js → init-BmrfQCbP.js} +1 -1
- package/dist/{page-I67xAM4w.js → page-RL9qA6-j.js} +22 -21
- package/dist/prerenderWorker.js +1 -1
- package/dist/useSidebarConfig-n149FAq4.js +31 -0
- package/dist/useTheme-B-j0bXCL.js +62 -0
- package/dist/{vite-DQoRnpfn.js → vite-C2ruOX7H.js} +1 -1
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/client/theme-default/composables/client-preferences/utils/registry.d.ts +0 -3
- package/dist/client/theme-default/composables/client-preferences/utils/registry.d.ts.map +0 -1
- package/dist/registry-DHnqBLvh.js +0 -9
package/dist/client.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as e } from "./useTheme-B-j0bXCL.js";
|
|
2
|
+
import { a as t, c as n, i as r, o as i, r as a, s as o, t as s } from "./app-Dh1RgRtN.js";
|
|
3
|
+
export { i as Content, s as createTypedownApp, o as useRoute, n as useRouter, a as useSiteConfig, r as useSiteData, t as useTdContent, e as useTheme };
|
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-C2ruOX7H.js";
|
|
2
|
+
import { t as s } from "./cli-Be64NWBp.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,12 +1,13 @@
|
|
|
1
1
|
import { F as e, J as t, Y as n, c as r, i, k as a, x as o } from "./shared-BK7uzYmy.js";
|
|
2
|
-
import { t as s } from "./
|
|
2
|
+
import { t as s } from "./useTheme-B-j0bXCL.js";
|
|
3
|
+
import { a as c } from "./useSidebarConfig-n149FAq4.js";
|
|
3
4
|
// src/client/theme-default/composables/client-preferences/index.ts
|
|
4
|
-
function
|
|
5
|
-
return s();
|
|
5
|
+
function l() {
|
|
6
|
+
return s() + c();
|
|
6
7
|
}
|
|
7
8
|
// src/node/lib/html-template.ts
|
|
8
|
-
function
|
|
9
|
-
let t = r(e.title), n = r(e.description), i = e.siteTitle !== void 0 && e.title !== e.siteTitle ? `${t} - ${r(e.siteTitle)}` : t, a = e.origin ?? "", o = e.canonicalUrl, s = o === void 0 ? "" : `\n <link rel="canonical" href="${r(o)}">`,
|
|
9
|
+
function u(e) {
|
|
10
|
+
let t = r(e.title), n = r(e.description), i = e.siteTitle !== void 0 && e.title !== e.siteTitle ? `${t} - ${r(e.siteTitle)}` : t, a = e.origin ?? "", o = e.canonicalUrl, s = o === void 0 ? "" : `\n <link rel="canonical" href="${r(o)}">`, c = o === void 0 ? "" : `\n <meta property="og:url" content="${r(o)}">`, u = e.ogImagePath === void 0 ? `${a}${e.base}og-image.png` : `${a}${e.ogImagePath}`, d = e.author === void 0 ? "" : `\n <meta name="author" content="${r(e.author)}">`, f = e.siteTitle === void 0 ? "" : `\n <meta property="og:site_name" content="${r(e.siteTitle)}">`, p = a === "" ? "" : `\n <link rel="alternate" type="application/rss+xml" title="${e.siteTitle === void 0 ? "RSS Feed" : r(e.siteTitle)}" href="${a}${e.base}feed.xml">`, m = (e.jsonLdBlocks ?? []).map((e) => `\n <script type="application/ld+json">${e}<\/script>`).join(""), h = e.headExtra === void 0 ? "" : e.headExtra + "\n";
|
|
10
11
|
return `<!DOCTYPE html>
|
|
11
12
|
<html lang="${e.lang ?? "en"}">
|
|
12
13
|
<head>
|
|
@@ -18,7 +19,7 @@ function l(e) {
|
|
|
18
19
|
<meta name="description" content="${n}">${d}${s}
|
|
19
20
|
<link rel="icon" href="${e.base}favicon.svg" type="image/svg+xml">
|
|
20
21
|
<link rel="apple-touch-icon" href="${e.base}apple-touch-icon.png">${p}
|
|
21
|
-
<meta property="og:type" content="${e.ogType ?? "article"}">${f}${
|
|
22
|
+
<meta property="og:type" content="${e.ogType ?? "article"}">${f}${c}
|
|
22
23
|
<meta property="og:title" content="${t}">
|
|
23
24
|
<meta property="og:description" content="${n}">
|
|
24
25
|
<meta property="og:image" content="${r(u)}">
|
|
@@ -28,7 +29,7 @@ function l(e) {
|
|
|
28
29
|
<meta name="twitter:image" content="${r(u)}">${m}
|
|
29
30
|
<script>
|
|
30
31
|
(function () {
|
|
31
|
-
${
|
|
32
|
+
${l()}
|
|
32
33
|
})()
|
|
33
34
|
<\/script>
|
|
34
35
|
${h} </head>
|
|
@@ -39,7 +40,7 @@ ${h} </head>
|
|
|
39
40
|
</html>`;
|
|
40
41
|
}
|
|
41
42
|
// src/node/build/seo/jsonld.ts
|
|
42
|
-
function
|
|
43
|
+
function d(e) {
|
|
43
44
|
return JSON.stringify({
|
|
44
45
|
"@context": "https://schema.org",
|
|
45
46
|
"@type": "Article",
|
|
@@ -53,7 +54,7 @@ function u(e) {
|
|
|
53
54
|
...e.dateModified === void 0 ? {} : { dateModified: e.dateModified }
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function f(e) {
|
|
57
58
|
return JSON.stringify({
|
|
58
59
|
"@context": "https://schema.org",
|
|
59
60
|
"@type": "WebSite",
|
|
@@ -61,7 +62,7 @@ function d(e) {
|
|
|
61
62
|
url: e.canonicalUrl
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function p(e) {
|
|
65
66
|
let { pageRoute: t, title: r, origin: i = "" } = e, s = a(t), c = o(e.base);
|
|
66
67
|
if (t === "/") return;
|
|
67
68
|
let l = t.split("/").filter(Boolean), u = l.map((e, t) => {
|
|
@@ -80,18 +81,18 @@ function f(e) {
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
// src/node/build/seo/page.ts
|
|
83
|
-
var
|
|
84
|
-
function
|
|
85
|
-
let a = t.seoMetadata?.title ?? t.title, o =
|
|
84
|
+
var m = 160;
|
|
85
|
+
function h(t, n, r) {
|
|
86
|
+
let a = t.seoMetadata?.title ?? t.title, o = g(t), s = n === "/", c = (r.origin ?? "") + r.base + e(n), l = t.fileMetadata?.mtimeSecs === void 0 ? void 0 : i(t.fileMetadata.mtimeSecs * 1e3), u = [s ? f({
|
|
86
87
|
title: a,
|
|
87
88
|
canonicalUrl: c
|
|
88
|
-
}) :
|
|
89
|
+
}) : d({
|
|
89
90
|
title: a,
|
|
90
91
|
description: o,
|
|
91
92
|
canonicalUrl: c,
|
|
92
93
|
author: r.author,
|
|
93
94
|
dateModified: l
|
|
94
|
-
}),
|
|
95
|
+
}), p({
|
|
95
96
|
pageRoute: n,
|
|
96
97
|
title: a,
|
|
97
98
|
origin: r.origin,
|
|
@@ -104,14 +105,14 @@ function m(t, n, r) {
|
|
|
104
105
|
isHomepage: s,
|
|
105
106
|
ogType: s ? "website" : "article",
|
|
106
107
|
ogImagePath: t.seoMetadata?.image,
|
|
107
|
-
jsonLdBlocks:
|
|
108
|
+
jsonLdBlocks: u
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
function h(e) {
|
|
111
|
-
return e.seoMetadata?.description === void 0 ? e.frontmatter.description === void 0 ? e.excerpt === void 0 ? g(e) : t(e.excerpt, p) : String(e.frontmatter.description) : e.seoMetadata.description;
|
|
112
|
-
}
|
|
113
111
|
function g(e) {
|
|
112
|
+
return e.seoMetadata?.description === void 0 ? e.frontmatter.description === void 0 ? e.excerpt === void 0 ? _(e) : t(e.excerpt, m) : String(e.frontmatter.description) : e.seoMetadata.description;
|
|
113
|
+
}
|
|
114
|
+
function _(e) {
|
|
114
115
|
let n = e.headings.filter((e) => e.level === 2).slice(0, 5).map((e) => e.title);
|
|
115
|
-
return n.length === 0 ? t(e.title,
|
|
116
|
+
return n.length === 0 ? t(e.title, m) : t(`${e.title}: ${n.join(", ")}`, m);
|
|
116
117
|
}
|
|
117
|
-
export {
|
|
118
|
+
export { u as n, h as t };
|
package/dist/prerenderWorker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { F as e } from "./shared-BK7uzYmy.js";
|
|
2
|
-
import { n as t, t as n } from "./page-
|
|
2
|
+
import { n as t, t as n } from "./page-RL9qA6-j.js";
|
|
3
3
|
import { pathToFileURL as r } from "node:url";
|
|
4
4
|
import { parentPort as i, workerData as a } from "node:worker_threads";
|
|
5
5
|
// src/node/build/prerenderWorker.ts
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { a as e, i as t, r as n } from "./useTheme-B-j0bXCL.js";
|
|
2
|
+
import { computed as r, onMounted as i, ref as a, watch as o } from "vue";
|
|
3
|
+
// src/client/theme-default/composables/client-preferences/utils/useClientPreferences.ts
|
|
4
|
+
function s(e, t) {
|
|
5
|
+
let n = typeof localStorage < "u" ? localStorage.getItem(e) : null, r = n === null ? t : c(n, t), i = a(r);
|
|
6
|
+
return o(i, (t) => {
|
|
7
|
+
typeof localStorage < "u" && localStorage.setItem(e, String(t));
|
|
8
|
+
}), i;
|
|
9
|
+
}
|
|
10
|
+
function c(e, t) {
|
|
11
|
+
return typeof t == "boolean" ? e === "true" : typeof t == "number" ? Number(e) || t : e;
|
|
12
|
+
}
|
|
13
|
+
// src/client/theme-default/composables/client-preferences/useSidebarConfig.ts
|
|
14
|
+
var l = "td-sidebar-width", u = "td-sidebar-collapsed", d = "--td-sidebar-width", f = 300, p = 48, m = 200, h = 500;
|
|
15
|
+
function g() {
|
|
16
|
+
let e = s(l, 300), t = s(u, !1), n = a(!1);
|
|
17
|
+
i(() => {
|
|
18
|
+
n.value = !0;
|
|
19
|
+
});
|
|
20
|
+
let o = r(() => t.value ? 48 : e.value);
|
|
21
|
+
return {
|
|
22
|
+
sidebarWidth: e,
|
|
23
|
+
sidebarCollapsed: t,
|
|
24
|
+
sidebarStyle: r(() => n.value ? { width: `${o.value}px` } : {})
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function _() {
|
|
28
|
+
let r = `${n(u)}==='true'`, i = `collapsed?48:(Number(${n(l)})||300)`;
|
|
29
|
+
return e(`var collapsed=${r};var width=${i};` + t(d, "`${width}px`"));
|
|
30
|
+
}
|
|
31
|
+
export { _ as a, m as i, f as n, g as o, h as r, s, p as t };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { computed as e, readonly as t, ref as n } from "vue";
|
|
2
|
+
// src/client/theme-default/composables/client-preferences/utils/buildHeadScript.ts
|
|
3
|
+
function r(e, t) {
|
|
4
|
+
return `if(${e})document.documentElement.classList.add(${JSON.stringify(t)});`;
|
|
5
|
+
}
|
|
6
|
+
function i(e) {
|
|
7
|
+
return `localStorage.getItem(${JSON.stringify(e)})`;
|
|
8
|
+
}
|
|
9
|
+
function a(e, t) {
|
|
10
|
+
return `document.documentElement.style.setProperty(${JSON.stringify(e)},${t});`;
|
|
11
|
+
}
|
|
12
|
+
function o(e) {
|
|
13
|
+
return `try{${e}}catch{}`;
|
|
14
|
+
}
|
|
15
|
+
// src/client/theme-default/composables/client-preferences/useTheme.ts
|
|
16
|
+
var s = "td-theme", c = "(prefers-color-scheme: dark)", l;
|
|
17
|
+
function u(e) {
|
|
18
|
+
if (typeof document > "u") return;
|
|
19
|
+
let t = e === "system" ? d() : e, n = document.documentElement;
|
|
20
|
+
if (l !== void 0 && (clearTimeout(l), l = void 0, n.classList.remove("td-theme-transition")), m && n.classList.add("td-theme-transition"), n.classList.toggle("dark", t === "dark"), m) {
|
|
21
|
+
let e = () => {
|
|
22
|
+
clearTimeout(l), l = void 0, n.classList.remove("td-theme-transition"), n.removeEventListener("transitionend", e);
|
|
23
|
+
};
|
|
24
|
+
n.addEventListener("transitionend", e), l = setTimeout(e, 500);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function d() {
|
|
28
|
+
return typeof window > "u" ? "light" : window.matchMedia(c).matches ? "dark" : "light";
|
|
29
|
+
}
|
|
30
|
+
var f = n("system"), p = n(d()), m = !1;
|
|
31
|
+
function h() {
|
|
32
|
+
_();
|
|
33
|
+
let n = e(() => f.value === "system" ? p.value : f.value), r = e(() => n.value === "dark");
|
|
34
|
+
function i(e) {
|
|
35
|
+
f.value = e, u(e), typeof localStorage < "u" && localStorage.setItem(s, e);
|
|
36
|
+
}
|
|
37
|
+
function a() {
|
|
38
|
+
f.value === "system" ? i(p.value === "light" ? "dark" : "light") : i("system");
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
theme: t(f),
|
|
42
|
+
effectiveTheme: n,
|
|
43
|
+
isDark: r,
|
|
44
|
+
setTheme: i,
|
|
45
|
+
toggle: a
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function g() {
|
|
49
|
+
return o(`var t=${i(s)};` + r(`t==='dark'||(t!=='light'&&matchMedia(${JSON.stringify(c)}).matches)`, "dark"));
|
|
50
|
+
}
|
|
51
|
+
function _() {
|
|
52
|
+
if (!m) {
|
|
53
|
+
if (m = !0, typeof localStorage < "u") {
|
|
54
|
+
let e = localStorage.getItem(s);
|
|
55
|
+
(e === "light" || e === "dark" || e === "system") && (f.value = e);
|
|
56
|
+
}
|
|
57
|
+
u(f.value), typeof window < "u" && window.matchMedia(c).addEventListener("change", () => {
|
|
58
|
+
p.value = d(), f.value === "system" && u("system");
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export { o as a, a as i, h as n, i as r, g as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as e, B as t, D as n, F as r, H as i, I as a, O as o, R as s, T as c, U as l, Z as u, _ as d, b as f, c as p, d as m, et as h, g, h as _, i as v, nt as y, p as b, q as x, rt as S, v as C, x as w, y as T, z as E } from "./shared-BK7uzYmy.js";
|
|
2
|
-
import { n as D, t as O } from "./page-
|
|
2
|
+
import { n as D, t as O } from "./page-RL9qA6-j.js";
|
|
3
3
|
import { t as k } from "./temml-CjI4drVW.js";
|
|
4
4
|
import { a as ee, i as te, n as ne, r as re } from "./context-CPrHBM3S.js";
|
|
5
5
|
import { t as ie } from "./es-B_QJMowB.js";
|
package/dist/vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PAGES_ID, r as PAGE_DATA_EVENT, i as SEARCH_INDEX_ID, a as SITE_DATA_ID, o as THEME_ID, t as typedown } from "./vite-
|
|
1
|
+
export { n as PAGES_ID, r as PAGE_DATA_EVENT, i as SEARCH_INDEX_ID, a as SITE_DATA_ID, o as THEME_ID, t as typedown } from "./vite-C2ruOX7H.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "typerighter",
|
|
4
|
-
"version": "0.56.
|
|
4
|
+
"version": "0.56.1",
|
|
5
5
|
"description": "Typedown: A typed content framework.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@lucide/vue": "^1.47.0",
|
|
62
62
|
"@shikijs/transformers": "^4.4.3",
|
|
63
63
|
"@tailwindcss/vite": "^4.3.3",
|
|
64
|
-
"@typerighter/rpc-client": "0.56.
|
|
65
|
-
"@typerighter/rpc-server": "0.56.
|
|
64
|
+
"@typerighter/rpc-client": "0.56.1",
|
|
65
|
+
"@typerighter/rpc-server": "0.56.1",
|
|
66
66
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
67
67
|
"cac": "^7.1.0",
|
|
68
68
|
"picocolors": "^1.1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../../src/client/theme-default/composables/client-preferences/utils/registry.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,IAAK,MAAM,CAE5C;AAGD,wBAAgB,kBAAkB,CAAE,QAAQ,EAAE,MAAM,MAAM,GAAG,IAAI,CAEhE"}
|