typerighter 0.56.3 → 0.57.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/dist/app-D-dbbyVD.js +7830 -0
- package/dist/{cli-D-sgJzkz.js → cli-aIilXlJS.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts +9 -4
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/theme-default/composables/useCopyCode.d.ts +2 -0
- package/dist/client/theme-default/composables/useCopyCode.d.ts.map +1 -0
- package/dist/client/theme-default/composables/useHotkey.d.ts +13 -0
- package/dist/client/theme-default/composables/useHotkey.d.ts.map +1 -0
- package/dist/client/theme-default/index.d.ts +25 -0
- package/dist/client/theme-default/index.d.ts.map +1 -0
- package/dist/client/theme-default/utils/keys.d.ts +58 -0
- package/dist/client/theme-default/utils/keys.d.ts.map +1 -0
- package/dist/client/theme-default.js +3 -3892
- package/dist/client.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{init-CRbtpr2v.js → init-Bvm3vDph.js} +126 -109
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/{page-BreMA8X5.js → page-BbSO0VG8.js} +2 -3
- package/dist/prerenderWorker.js +1 -1
- package/dist/typerighter.css +1 -1
- package/dist/useSidebarConfig-0kMemgUS.js +94 -0
- package/dist/{vite-BeHH_un1.js → vite-ltcrEmat.js} +377 -436
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/app-Dm08HnZG.js +0 -3880
- package/dist/useSidebarConfig-DUcdHn0W.js +0 -33
- package/dist/useTheme-BF8TNao6.js +0 -65
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, r as n } from "./useTheme-BF8TNao6.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 = "--td-expanded-sidebar-display", p = "--td-collapsed-sidebar-display", m = 300, h = 48, g = 200, _ = 500;
|
|
15
|
-
function v() {
|
|
16
|
-
let r = `${n(u)}==='true'`, i = `collapsed?48:(Number(${n(l)})||300)`;
|
|
17
|
-
return e(`var collapsed=${r};var width=${i};` + t(d, "`${width}px`") + t(f, "\"none\"", "collapsed") + t(f, void 0, "!collapsed") + t(p, void 0, "collapsed") + t(p, "\"none\"", "!collapsed"));
|
|
18
|
-
}
|
|
19
|
-
function y() {
|
|
20
|
-
let e = s(l, 300), t = s(u, !1), n = a(!1);
|
|
21
|
-
i(() => {
|
|
22
|
-
n.value = !0;
|
|
23
|
-
});
|
|
24
|
-
let o = r(() => t.value ? 48 : e.value), c = r(() => n.value ? { width: `${o.value}px` } : { width: `var(${d})` }), m = r(() => n.value ? { display: t.value ? "none" : void 0 } : { display: `var(${f})` });
|
|
25
|
-
return {
|
|
26
|
-
sidebarWidth: e,
|
|
27
|
-
isSidebarCollapsed: t,
|
|
28
|
-
sidebarWidthStyle: c,
|
|
29
|
-
collapsedSidebarVisibilityStyle: r(() => n.value ? { display: t.value ? void 0 : "none" } : { display: `var(${p})` }),
|
|
30
|
-
expandedSidebarVisibilityStyle: m
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export { v as a, g as i, m as n, y as o, _ as r, s, h as t };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { computed as e, onMounted as t, readonly as n, ref as r } from "vue";
|
|
2
|
-
// src/client/theme-default/composables/client-preferences/utils/buildHeadScript.ts
|
|
3
|
-
function i(e, t = "true") {
|
|
4
|
-
return `if(${t})document.documentElement.classList.add(${JSON.stringify(e)});`;
|
|
5
|
-
}
|
|
6
|
-
function a(e) {
|
|
7
|
-
return `localStorage.getItem(${JSON.stringify(e)})`;
|
|
8
|
-
}
|
|
9
|
-
function o(e, t, n = "true") {
|
|
10
|
-
return `if(${n})document.documentElement.style.setProperty(${JSON.stringify(e)},${t});`;
|
|
11
|
-
}
|
|
12
|
-
function s(e) {
|
|
13
|
-
return `try{${e}}catch(e){console.log(e)}`;
|
|
14
|
-
}
|
|
15
|
-
// src/client/theme-default/composables/client-preferences/useTheme.ts
|
|
16
|
-
var c = "td-theme", l = "(prefers-color-scheme: dark)", u = "--td-dark-theme-toggle", d = "--td-light-theme-toggle", f = r(y()), p = r(b());
|
|
17
|
-
function m() {
|
|
18
|
-
return s(`var theme=${a(c)};var isDarkTheme=theme==='dark'||(theme!=='light'&&matchMedia(${JSON.stringify(l)}).matches);` + i("dark", "isDarkTheme") + o(u, "\"none\"", "!isDarkTheme") + o(u, "\"block\"", "isDarkTheme") + o(d, "\"none\"", "isDarkTheme") + o(d, "\"block\"", "!isDarkTheme"));
|
|
19
|
-
}
|
|
20
|
-
var h = !1;
|
|
21
|
-
function g() {
|
|
22
|
-
h = !0, typeof window < "u" && window.matchMedia(l).addEventListener("change", () => {
|
|
23
|
-
p.value = b(), f.value === "system" && v("system");
|
|
24
|
-
});
|
|
25
|
-
let i = r(!1);
|
|
26
|
-
t(() => {
|
|
27
|
-
i.value = !0;
|
|
28
|
-
});
|
|
29
|
-
let a = e(() => f.value === "system" ? p.value : f.value), o = e(() => a.value === "dark"), s = e(() => i.value ? { display: o.value ? "block" : "none" } : { display: `var(${u})` }), m = e(() => i.value ? { display: o.value ? "none" : "block" } : { display: `var(${d})` });
|
|
30
|
-
function g(e) {
|
|
31
|
-
f.value = e, v(e), typeof localStorage < "u" && localStorage.setItem(c, e);
|
|
32
|
-
}
|
|
33
|
-
function _() {
|
|
34
|
-
f.value === "system" ? g(p.value === "light" ? "dark" : "light") : g("system");
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
theme: n(f),
|
|
38
|
-
effectiveTheme: a,
|
|
39
|
-
isDark: o,
|
|
40
|
-
setTheme: g,
|
|
41
|
-
toggle: _,
|
|
42
|
-
darkToggleStyle: s,
|
|
43
|
-
lightToggleStyle: m
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
var _;
|
|
47
|
-
function v(e) {
|
|
48
|
-
if (typeof document > "u") return;
|
|
49
|
-
let t = e === "system" ? b() : e, n = document.documentElement;
|
|
50
|
-
if (_ !== void 0 && (clearTimeout(_), _ = void 0, n.classList.remove("td-theme-transition")), h && n.classList.add("td-theme-transition"), n.classList.toggle("dark", t === "dark"), h) {
|
|
51
|
-
let e = (t) => {
|
|
52
|
-
t && t.propertyName !== "background-color" || (clearTimeout(_), _ = void 0, n.classList.remove("td-theme-transition"), n.removeEventListener("transitionend", e));
|
|
53
|
-
};
|
|
54
|
-
n.addEventListener("transitionend", e), _ = setTimeout(e, 500);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function y() {
|
|
58
|
-
if (typeof window > "u") return "system";
|
|
59
|
-
let e = localStorage.getItem(c);
|
|
60
|
-
return e === "light" || e === "dark" || e === "system" ? e : "system";
|
|
61
|
-
}
|
|
62
|
-
function b() {
|
|
63
|
-
return typeof window > "u" ? "light" : window.matchMedia(l).matches ? "dark" : "light";
|
|
64
|
-
}
|
|
65
|
-
export { s as a, o as i, g as n, a as r, m as t };
|