typerighter 0.56.2 → 0.57.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-Dh1RgRtN.js → app-C7F5xTZI.js} +293 -244
- package/dist/{cli-DtmuEnwt.js → cli-tCqB1T4m.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/useSidebarConfig.d.ts +9 -5
- 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 +7 -1
- package/dist/client/theme-default/composables/client-preferences/useTheme.d.ts.map +1 -1
- package/dist/client/theme-default/composables/client-preferences/utils/buildHeadScript.d.ts +2 -2
- package/dist/client/theme-default/composables/client-preferences/utils/buildHeadScript.d.ts.map +1 -1
- package/dist/client/theme-default.js +893 -881
- package/dist/client.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{init-Drks9yZs.js → init-BVj3BWS6.js} +126 -109
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/{page-RL9qA6-j.js → page-BreMA8X5.js} +3 -3
- package/dist/prerenderWorker.js +2 -2
- package/dist/{renderMath-CJKXI63h.js → renderMath-e3scuxfY.js} +1 -1
- package/dist/shared/utils/time.d.ts.map +1 -1
- package/dist/{shared-BK7uzYmy.js → shared-dB08amQA.js} +88 -88
- package/dist/shared.js +1 -1
- package/dist/typerighter.css +1 -1
- package/dist/{useSidebarConfig-n149FAq4.js → useSidebarConfig-DUcdHn0W.js} +13 -11
- package/dist/useTheme-BF8TNao6.js +65 -0
- package/dist/{vite-C2ruOX7H.js → vite-DKLVYuLb.js} +10 -9
- package/dist/vite.js +1 -1
- package/package.json +4 -3
- package/dist/useTheme-B-j0bXCL.js +0 -62
|
@@ -1,62 +0,0 @@
|
|
|
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 };
|