@pubinfo/core 2.1.10-beta.2 → 2.1.11
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/{AppSetting-Dl8pVkN4.js → AppSetting-7jlhUzze.js} +42 -42
- package/dist/{HButton-CzYSwI6a.js → HButton-Dt6qGhhR.js} +7 -7
- package/dist/{HCheckList-CHR-lWIq.js → HCheckList-cPBgATmv.js} +15 -15
- package/dist/{HDivider-CXS9rl4C.js → HDivider-BwvBr5OE.js} +3 -3
- package/dist/{HInput-CSVwTg1Q.js → HInput-KJ5nFBpF.js} +10 -10
- package/dist/HSlideover-DVQDc9q6.js +3151 -0
- package/dist/{HToggle-C_iVIpxv.js → HToggle-Ce_2-yhZ.js} +8 -8
- package/dist/{HTooltip-BHBHfrCD.js → HTooltip-DjAU-Evn.js} +6 -6
- package/dist/PreferencesContent-BAIH81yS.js +701 -0
- package/dist/SettingBreadcrumb-O9-PhAFT.js +45 -0
- package/dist/SettingCopyright-DIKsWTuf.js +45 -0
- package/dist/{SettingEnableTransition-BBH52KKl.js → SettingEnableTransition-61O7W00b.js} +19 -19
- package/dist/SettingHome-Sv65TPH8.js +31 -0
- package/dist/SettingMenu-BvwJOUZV.js +111 -0
- package/dist/{SettingMode-BwhhUYlz.js → SettingMode-B8H_eQc8.js} +14 -14
- package/dist/SettingNavSearch-BHsmYBA7.js +31 -0
- package/dist/SettingOther-CyyNnaDX.js +48 -0
- package/dist/SettingPage-B82lW41P.js +22 -0
- package/dist/{SettingTabbar-DuqQVRnz.js → SettingTabbar-Bky2xvH-.js} +58 -58
- package/dist/{SettingThemes-Doo6Ax3u.js → SettingThemes-CkdzS1xt.js} +44 -44
- package/dist/SettingToolbar-CD4qns1J.js +50 -0
- package/dist/SettingTopbar-1shjoe3s.js +49 -0
- package/dist/{SettingWidthMode-VaN0CrBa.js → SettingWidthMode-DlG6lXjA.js} +14 -14
- package/dist/auth-BLGKOyc5.js +4432 -0
- package/dist/built-in/layout-component/composables/useContext.d.ts +1 -0
- package/dist/{change-organization-OjxZhWST.js → change-organization-hsqeSzDu.js} +38 -38
- package/dist/{change-password-B6kO54-d.js → change-password-EtccCDRX.js} +73 -73
- package/dist/{chunk-EsrJ1IKw.js → chunk-CD4vhpVs.js} +3 -3
- package/dist/{components-DVIyiEVI.js → components-DFNyaAb9.js} +1584 -1584
- package/dist/core/request.d.ts +1 -1
- package/dist/core-DJIGzMMM.js +4885 -0
- package/dist/dist-7OjQvlya.js +468 -0
- package/dist/engine-oniguruma-CaNXwGSv.js +243 -0
- package/dist/features/settings/index.d.ts +90 -1
- package/dist/{form-EQ9eL9hv.js → form-C3VHofnN.js} +923 -443
- package/dist/index.js +4418 -3895
- package/dist/{modal-CSWipFvB.js → modal-Bl5xHbxa.js} +15510 -15790
- package/dist/{not-found-DBe-djEg.js → not-found-BCjngLzt.js} +19 -19
- package/dist/{not-permission-DQzWCpOK.js → not-permission-C26vTMvf.js} +19 -19
- package/dist/{profile-DJ3gpjsS.js → profile-BVXIFuBG.js} +3340 -3277
- package/dist/{question-line-BKVlJGUb.js → question-line-BG__Ycfv.js} +2 -2
- package/dist/{reload-DAR8dVYw.js → reload-DHx5Vwus.js} +4 -4
- package/dist/{right-VKgVtqD5.js → right-BxBlFUwj.js} +6 -6
- package/dist/style.css +1 -1
- package/dist/{tree-select-CTjWj5WT.js → tree-select-B8cTcGLa.js} +2575 -2256
- package/dist/watchDiff-CPZFtaOC.js +655 -0
- package/package.json +41 -41
- package/src/built-in/layout-component/components/Header/HeaderMenu.vue +2 -3
- package/src/built-in/layout-component/components/Menu/item.vue +2 -2
- package/src/built-in/layout-component/components/Menu/sub.vue +20 -1
- package/src/built-in/layout-component/composables/useContext.ts +1 -0
- package/src/built-in/layout-component/composables/useLayoutVisible.ts +1 -1
- package/src/built-in/layout-component/provider.ts +5 -0
- package/src/built-in/system-info/components/SystemInfo.vue +68 -66
- package/src/built-in/system-info/index.ts +4 -4
- package/src/core/ctx.ts +2 -2
- package/src/core/request.ts +1 -1
- package/src/features/components/PubinfoApp/index.vue +1 -0
- package/types/auto-imports.d.ts +63 -63
- package/types/components.d.ts +45 -1
- package/dist/HSlideover-Bc6OHPHe.js +0 -1695
- package/dist/HeaderFullMenu-BRhGliRJ.js +0 -6
- package/dist/HeaderFullMenu-DCF-gTCZ.js +0 -249
- package/dist/HeaderThinMenu-B_7vLcQX.js +0 -6
- package/dist/HeaderThinMenu-PA12XAvb.js +0 -437
- package/dist/PreferencesContent-cll4nwwl.js +0 -695
- package/dist/SettingBreadcrumb-BvSc7VUo.js +0 -45
- package/dist/SettingCopyright-DcWLKM5d.js +0 -45
- package/dist/SettingHome-Cd43oJmB.js +0 -31
- package/dist/SettingMenu-CJsN4F1l.js +0 -111
- package/dist/SettingNavSearch-BhHUWem3.js +0 -31
- package/dist/SettingOther-CDY0jSVT.js +0 -48
- package/dist/SettingPage-B0WNvUlj.js +0 -22
- package/dist/SettingToolbar-CHV_dVJ9.js +0 -50
- package/dist/SettingTopbar-CF1K_XIt.js +0 -49
- package/dist/auth-CPSkJwBz.js +0 -3968
- package/dist/core-Bg2PEcZK.js +0 -4884
- package/dist/dist-DAb-7mqe.js +0 -468
- package/dist/engine-oniguruma-CUfGsBrF.js +0 -243
- package/dist/overlayscrollbars-vue-BOGU2FK-.js +0 -1436
- package/dist/pick-C42gkI1h.js +0 -10
- package/dist/watchDiff-C4eGkl9e.js +0 -397
- /package/dist/{_plugin-vue_export-helper-DaPiLSxE.js → _plugin-vue_export-helper-sUTDUeGO.js} +0 -0
- /package/dist/{json-S7wVLDnW.js → json-Bu_Zprin.js} +0 -0
- /package/dist/{useContext-D6pJCZez.js → useContext-DLtu9F7E.js} +0 -0
- /package/dist/{vitesse-dark-BsnBIHGG.js → vitesse-dark-CTe40QT_.js} +0 -0
- /package/dist/{vitesse-light-Cs_6DF7j.js → vitesse-light-BWXC_WeB.js} +0 -0
- /package/dist/{wasm-EvDQvzqp.js → wasm-2zDVqo-C.js} +0 -0
package/dist/dist-DAb-7mqe.js
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
import { Fragment, TransitionGroup, computed, customRef, defineComponent, getCurrentInstance, getCurrentScope, h, hasInjectionContext, inject, isRef, markRaw, nextTick, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onMounted, onScopeDispose, onUnmounted, onUpdated, provide, reactive, readonly, ref, shallowReadonly, shallowRef, toRaw, toRef, toRefs, toValue, unref, watch, watchEffect } from "vue";
|
|
2
|
-
function tryOnScopeDispose(s, I) {
|
|
3
|
-
return getCurrentScope() ? (onScopeDispose(s, I), !0) : !1;
|
|
4
|
-
}
|
|
5
|
-
var localProvidedStateMap = /* @__PURE__ */ new WeakMap(), injectLocal = (...s) => {
|
|
6
|
-
let I = s[0], L = getCurrentInstance()?.proxy ?? getCurrentScope();
|
|
7
|
-
if (L == null && !hasInjectionContext()) throw Error("injectLocal must be called in setup");
|
|
8
|
-
return L && localProvidedStateMap.has(L) && I in localProvidedStateMap.get(L) ? localProvidedStateMap.get(L)[I] : inject(...s);
|
|
9
|
-
}, isClient = typeof window < "u" && typeof document < "u";
|
|
10
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
11
|
-
var notNullish = (s) => s != null, toString = Object.prototype.toString, isObject = (s) => toString.call(s) === "[object Object]", noop = () => {};
|
|
12
|
-
function toRef$1(...s) {
|
|
13
|
-
if (s.length !== 1) return toRef(...s);
|
|
14
|
-
let I = s[0];
|
|
15
|
-
return typeof I == "function" ? readonly(customRef(() => ({
|
|
16
|
-
get: I,
|
|
17
|
-
set: noop
|
|
18
|
-
}))) : ref(I);
|
|
19
|
-
}
|
|
20
|
-
function createSingletonPromise(s) {
|
|
21
|
-
let I;
|
|
22
|
-
function L() {
|
|
23
|
-
return I ||= s(), I;
|
|
24
|
-
}
|
|
25
|
-
return L.reset = async () => {
|
|
26
|
-
let s = I;
|
|
27
|
-
I = void 0, s && await s;
|
|
28
|
-
}, L;
|
|
29
|
-
}
|
|
30
|
-
function pxValue(s) {
|
|
31
|
-
return s.endsWith("rem") ? Number.parseFloat(s) * 16 : Number.parseFloat(s);
|
|
32
|
-
}
|
|
33
|
-
function toArray(s) {
|
|
34
|
-
return Array.isArray(s) ? s : [s];
|
|
35
|
-
}
|
|
36
|
-
function getLifeCycleTarget(s) {
|
|
37
|
-
return s || getCurrentInstance();
|
|
38
|
-
}
|
|
39
|
-
function tryOnMounted(s, I = !0, L) {
|
|
40
|
-
getLifeCycleTarget(L) ? onMounted(s, L) : I ? s() : nextTick(s);
|
|
41
|
-
}
|
|
42
|
-
function useTimeoutFn(s, I, L = {}) {
|
|
43
|
-
let { immediate: R = !0, immediateCallback: z = !1 } = L, B = shallowRef(!1), V;
|
|
44
|
-
function H() {
|
|
45
|
-
V &&= (clearTimeout(V), void 0);
|
|
46
|
-
}
|
|
47
|
-
function U() {
|
|
48
|
-
B.value = !1, H();
|
|
49
|
-
}
|
|
50
|
-
function W(...L) {
|
|
51
|
-
z && s(), H(), B.value = !0, V = setTimeout(() => {
|
|
52
|
-
B.value = !1, V = void 0, s(...L);
|
|
53
|
-
}, toValue(I));
|
|
54
|
-
}
|
|
55
|
-
return R && (B.value = !0, isClient && W()), tryOnScopeDispose(U), {
|
|
56
|
-
isPending: shallowReadonly(B),
|
|
57
|
-
start: W,
|
|
58
|
-
stop: U
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function useToggle(s = !1, I = {}) {
|
|
62
|
-
let { truthyValue: L = !0, falsyValue: R = !1 } = I, z = isRef(s), B = shallowRef(s);
|
|
63
|
-
function V(s) {
|
|
64
|
-
if (arguments.length) return B.value = s, B.value;
|
|
65
|
-
{
|
|
66
|
-
let s = toValue(L);
|
|
67
|
-
return B.value = B.value === s ? toValue(R) : s, B.value;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return z ? V : [B, V];
|
|
71
|
-
}
|
|
72
|
-
function watchImmediate(s, I, L) {
|
|
73
|
-
return watch(s, I, {
|
|
74
|
-
...L,
|
|
75
|
-
immediate: !0
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function computedAsync(s, I, R) {
|
|
79
|
-
let z;
|
|
80
|
-
z = isRef(R) ? { evaluating: R } : R || {};
|
|
81
|
-
let { lazy: B = !1, flush: V = "sync", evaluating: H = void 0, shallow: U = !0, onError: W = globalThis.reportError ?? noop } = z, K = shallowRef(!B), q = U ? shallowRef(I) : ref(I), J = 0;
|
|
82
|
-
return watchEffect(async (I) => {
|
|
83
|
-
if (!K.value) return;
|
|
84
|
-
J++;
|
|
85
|
-
let L = J, R = !1;
|
|
86
|
-
H && Promise.resolve().then(() => {
|
|
87
|
-
H.value = !0;
|
|
88
|
-
});
|
|
89
|
-
try {
|
|
90
|
-
let z = await s((s) => {
|
|
91
|
-
I(() => {
|
|
92
|
-
H && (H.value = !1), R || s();
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
L === J && (q.value = z);
|
|
96
|
-
} catch (s) {
|
|
97
|
-
W(s);
|
|
98
|
-
} finally {
|
|
99
|
-
H && L === J && (H.value = !1), R = !0;
|
|
100
|
-
}
|
|
101
|
-
}, { flush: V }), B ? computed(() => (K.value = !0, q.value)) : q;
|
|
102
|
-
}
|
|
103
|
-
var defaultWindow = isClient ? window : void 0, defaultDocument = isClient ? window.document : void 0, defaultNavigator = isClient ? window.navigator : void 0;
|
|
104
|
-
isClient && window.location;
|
|
105
|
-
function unrefElement(s) {
|
|
106
|
-
let I = toValue(s);
|
|
107
|
-
return I?.$el ?? I;
|
|
108
|
-
}
|
|
109
|
-
function useEventListener(...s) {
|
|
110
|
-
let I = (s, I, L, R) => (s.addEventListener(I, L, R), () => s.removeEventListener(I, L, R)), R = computed(() => {
|
|
111
|
-
let I = toArray(toValue(s[0])).filter((s) => s != null);
|
|
112
|
-
return I.every((s) => typeof s != "string") ? I : void 0;
|
|
113
|
-
});
|
|
114
|
-
return watchImmediate(() => [
|
|
115
|
-
R.value?.map((s) => unrefElement(s)) ?? [defaultWindow].filter((s) => s != null),
|
|
116
|
-
toArray(toValue(R.value ? s[1] : s[0])),
|
|
117
|
-
toArray(unref(R.value ? s[2] : s[1])),
|
|
118
|
-
toValue(R.value ? s[3] : s[2])
|
|
119
|
-
], ([s, L, R, z], B, V) => {
|
|
120
|
-
if (!s?.length || !L?.length || !R?.length) return;
|
|
121
|
-
let H = isObject(z) ? { ...z } : z, U = s.flatMap((s) => L.flatMap((L) => R.map((R) => I(s, L, R, H))));
|
|
122
|
-
V(() => {
|
|
123
|
-
U.forEach((s) => s());
|
|
124
|
-
});
|
|
125
|
-
}, { flush: "post" });
|
|
126
|
-
}
|
|
127
|
-
function useMounted() {
|
|
128
|
-
let s = shallowRef(!1), I = getCurrentInstance();
|
|
129
|
-
return I && onMounted(() => {
|
|
130
|
-
s.value = !0;
|
|
131
|
-
}, I), s;
|
|
132
|
-
}
|
|
133
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
134
|
-
function useSupported(s) {
|
|
135
|
-
let I = useMounted();
|
|
136
|
-
return computed(() => (I.value, !!s()));
|
|
137
|
-
}
|
|
138
|
-
function useMutationObserver(s, I, R = {}) {
|
|
139
|
-
let { window: z = defaultWindow, ...B } = R, V, H = /* @__PURE__ */ useSupported(() => z && "MutationObserver" in z), U = () => {
|
|
140
|
-
V &&= (V.disconnect(), void 0);
|
|
141
|
-
}, W = watch(computed(() => {
|
|
142
|
-
let I = toArray(toValue(s)).map(unrefElement).filter(notNullish);
|
|
143
|
-
return new Set(I);
|
|
144
|
-
}), (s) => {
|
|
145
|
-
U(), H.value && s.size && (V = new MutationObserver(I), s.forEach((s) => V.observe(s, B)));
|
|
146
|
-
}, {
|
|
147
|
-
immediate: !0,
|
|
148
|
-
flush: "post"
|
|
149
|
-
}), G = () => V?.takeRecords(), K = () => {
|
|
150
|
-
W(), U();
|
|
151
|
-
};
|
|
152
|
-
return tryOnScopeDispose(K), {
|
|
153
|
-
isSupported: H,
|
|
154
|
-
stop: K,
|
|
155
|
-
takeRecords: G
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
var ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
159
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
160
|
-
function useSSRWidth() {
|
|
161
|
-
let s = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
|
|
162
|
-
return typeof s == "number" ? s : void 0;
|
|
163
|
-
}
|
|
164
|
-
function useMediaQuery(s, I = {}) {
|
|
165
|
-
let { window: R = defaultWindow, ssrWidth: z = /* @__PURE__ */ useSSRWidth() } = I, B = /* @__PURE__ */ useSupported(() => R && "matchMedia" in R && typeof R.matchMedia == "function"), V = shallowRef(typeof z == "number"), H = shallowRef(), U = shallowRef(!1);
|
|
166
|
-
return watchEffect(() => {
|
|
167
|
-
if (V.value) {
|
|
168
|
-
V.value = !B.value, U.value = toValue(s).split(",").some((s) => {
|
|
169
|
-
let I = s.includes("not all"), L = s.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), R = s.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), B = !!(L || R);
|
|
170
|
-
return L && B && (B = z >= pxValue(L[1])), R && B && (B = z <= pxValue(R[1])), I ? !B : B;
|
|
171
|
-
});
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
B.value && (H.value = R.matchMedia(toValue(s)), U.value = H.value.matches);
|
|
175
|
-
}), useEventListener(H, "change", (s) => {
|
|
176
|
-
U.value = s.matches;
|
|
177
|
-
}, { passive: !0 }), computed(() => U.value);
|
|
178
|
-
}
|
|
179
|
-
function usePermission(s, I = {}) {
|
|
180
|
-
let { controls: L = !1, navigator: R = defaultNavigator } = I, z = /* @__PURE__ */ useSupported(() => R && "permissions" in R), B = shallowRef(), V = typeof s == "string" ? { name: s } : s, H = shallowRef(), U = () => {
|
|
181
|
-
H.value = B.value?.state ?? "prompt";
|
|
182
|
-
};
|
|
183
|
-
useEventListener(B, "change", U, { passive: !0 });
|
|
184
|
-
let W = createSingletonPromise(async () => {
|
|
185
|
-
if (z.value) {
|
|
186
|
-
if (!B.value) try {
|
|
187
|
-
B.value = await R.permissions.query(V);
|
|
188
|
-
} catch {
|
|
189
|
-
B.value = void 0;
|
|
190
|
-
} finally {
|
|
191
|
-
U();
|
|
192
|
-
}
|
|
193
|
-
if (L) return toRaw(B.value);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
return W(), L ? {
|
|
197
|
-
state: H,
|
|
198
|
-
isSupported: z,
|
|
199
|
-
query: W
|
|
200
|
-
} : H;
|
|
201
|
-
}
|
|
202
|
-
function useClipboard(s = {}) {
|
|
203
|
-
let { navigator: I = defaultNavigator, read: R = !1, source: z, copiedDuring: B = 1500, legacy: V = !1 } = s, H = /* @__PURE__ */ useSupported(() => I && "clipboard" in I), U = usePermission("clipboard-read"), W = usePermission("clipboard-write"), G = computed(() => H.value || V), K = shallowRef(""), q = shallowRef(!1), J = useTimeoutFn(() => q.value = !1, B, { immediate: !1 });
|
|
204
|
-
async function Y() {
|
|
205
|
-
let s = !(H.value && $(U.value));
|
|
206
|
-
if (!s) try {
|
|
207
|
-
K.value = await I.clipboard.readText();
|
|
208
|
-
} catch {
|
|
209
|
-
s = !0;
|
|
210
|
-
}
|
|
211
|
-
s && (K.value = Q());
|
|
212
|
-
}
|
|
213
|
-
G.value && R && useEventListener(["copy", "cut"], Y, { passive: !0 });
|
|
214
|
-
async function X(s = toValue(z)) {
|
|
215
|
-
if (G.value && s != null) {
|
|
216
|
-
let L = !(H.value && $(W.value));
|
|
217
|
-
if (!L) try {
|
|
218
|
-
await I.clipboard.writeText(s);
|
|
219
|
-
} catch {
|
|
220
|
-
L = !0;
|
|
221
|
-
}
|
|
222
|
-
L && Z(s), K.value = s, q.value = !0, J.start();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function Z(s) {
|
|
226
|
-
let I = document.createElement("textarea");
|
|
227
|
-
I.value = s, I.style.position = "absolute", I.style.opacity = "0", I.setAttribute("readonly", ""), document.body.appendChild(I), I.select(), document.execCommand("copy"), I.remove();
|
|
228
|
-
}
|
|
229
|
-
function Q() {
|
|
230
|
-
var s, I;
|
|
231
|
-
return ((s = document) == null || (I = s.getSelection) == null || (I = I.call(s)) == null ? void 0 : I.toString()) ?? "";
|
|
232
|
-
}
|
|
233
|
-
function $(s) {
|
|
234
|
-
return s === "granted" || s === "prompt";
|
|
235
|
-
}
|
|
236
|
-
return {
|
|
237
|
-
isSupported: G,
|
|
238
|
-
text: readonly(K),
|
|
239
|
-
copied: readonly(q),
|
|
240
|
-
copy: X
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
function usePreferredDark(s) {
|
|
244
|
-
return useMediaQuery("(prefers-color-scheme: dark)", s);
|
|
245
|
-
}
|
|
246
|
-
function useCssVar(s, I, R = {}) {
|
|
247
|
-
let { window: z = defaultWindow, initialValue: B, observe: V = !1 } = R, H = shallowRef(B), U = computed(() => {
|
|
248
|
-
var s;
|
|
249
|
-
return unrefElement(I) || (z == null || (s = z.document) == null ? void 0 : s.documentElement);
|
|
250
|
-
});
|
|
251
|
-
function W() {
|
|
252
|
-
let I = toValue(s), L = toValue(U);
|
|
253
|
-
L && z && I && (H.value = z.getComputedStyle(L).getPropertyValue(I)?.trim() || H.value || B);
|
|
254
|
-
}
|
|
255
|
-
return V && useMutationObserver(U, W, {
|
|
256
|
-
attributeFilter: ["style", "class"],
|
|
257
|
-
window: z
|
|
258
|
-
}), watch([U, () => toValue(s)], (s, I) => {
|
|
259
|
-
I[0] && I[1] && I[0].style.removeProperty(I[1]), W();
|
|
260
|
-
}, { immediate: !0 }), watch([H, U], ([I, L]) => {
|
|
261
|
-
let R = toValue(s);
|
|
262
|
-
L?.style && R && (I == null ? L.style.removeProperty(R) : L.style.setProperty(R, I));
|
|
263
|
-
}, { immediate: !0 }), H;
|
|
264
|
-
}
|
|
265
|
-
function useResizeObserver(s, I, R = {}) {
|
|
266
|
-
let { window: z = defaultWindow, ...B } = R, V, H = /* @__PURE__ */ useSupported(() => z && "ResizeObserver" in z), U = () => {
|
|
267
|
-
V &&= (V.disconnect(), void 0);
|
|
268
|
-
}, W = watch(computed(() => {
|
|
269
|
-
let I = toValue(s);
|
|
270
|
-
return Array.isArray(I) ? I.map((s) => unrefElement(s)) : [unrefElement(I)];
|
|
271
|
-
}), (s) => {
|
|
272
|
-
if (U(), H.value && z) {
|
|
273
|
-
V = new ResizeObserver(I);
|
|
274
|
-
for (let I of s) I && V.observe(I, B);
|
|
275
|
-
}
|
|
276
|
-
}, {
|
|
277
|
-
immediate: !0,
|
|
278
|
-
flush: "post"
|
|
279
|
-
}), G = () => {
|
|
280
|
-
U(), W();
|
|
281
|
-
};
|
|
282
|
-
return tryOnScopeDispose(G), {
|
|
283
|
-
isSupported: H,
|
|
284
|
-
stop: G
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function useElementSize(s, I = {
|
|
288
|
-
width: 0,
|
|
289
|
-
height: 0
|
|
290
|
-
}, R = {}) {
|
|
291
|
-
let { window: z = defaultWindow, box: B = "content-box" } = R, V = computed(() => {
|
|
292
|
-
var I;
|
|
293
|
-
return (I = unrefElement(s)) == null || (I = I.namespaceURI) == null ? void 0 : I.includes("svg");
|
|
294
|
-
}), H = shallowRef(I.width), U = shallowRef(I.height), { stop: W } = useResizeObserver(s, ([I]) => {
|
|
295
|
-
let L = B === "border-box" ? I.borderBoxSize : B === "content-box" ? I.contentBoxSize : I.devicePixelContentBoxSize;
|
|
296
|
-
if (z && V.value) {
|
|
297
|
-
let I = unrefElement(s);
|
|
298
|
-
if (I) {
|
|
299
|
-
let s = I.getBoundingClientRect();
|
|
300
|
-
H.value = s.width, U.value = s.height;
|
|
301
|
-
}
|
|
302
|
-
} else if (L) {
|
|
303
|
-
let s = toArray(L);
|
|
304
|
-
H.value = s.reduce((s, { inlineSize: I }) => s + I, 0), U.value = s.reduce((s, { blockSize: I }) => s + I, 0);
|
|
305
|
-
} else H.value = I.contentRect.width, U.value = I.contentRect.height;
|
|
306
|
-
}, R);
|
|
307
|
-
tryOnMounted(() => {
|
|
308
|
-
let L = unrefElement(s);
|
|
309
|
-
L && (H.value = "offsetWidth" in L ? L.offsetWidth : I.width, U.value = "offsetHeight" in L ? L.offsetHeight : I.height);
|
|
310
|
-
});
|
|
311
|
-
let G = watch(() => unrefElement(s), (s) => {
|
|
312
|
-
H.value = s ? I.width : 0, U.value = s ? I.height : 0;
|
|
313
|
-
});
|
|
314
|
-
function K() {
|
|
315
|
-
W(), G();
|
|
316
|
-
}
|
|
317
|
-
return {
|
|
318
|
-
width: H,
|
|
319
|
-
height: U,
|
|
320
|
-
stop: K
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
var eventHandlers = [
|
|
324
|
-
"fullscreenchange",
|
|
325
|
-
"webkitfullscreenchange",
|
|
326
|
-
"webkitendfullscreen",
|
|
327
|
-
"mozfullscreenchange",
|
|
328
|
-
"MSFullscreenChange"
|
|
329
|
-
];
|
|
330
|
-
function useFullscreen(s, I = {}) {
|
|
331
|
-
let { document: R = defaultDocument, autoExit: z = !1 } = I, B = computed(() => unrefElement(s) ?? R?.documentElement), V = shallowRef(!1), H = computed(() => [
|
|
332
|
-
"requestFullscreen",
|
|
333
|
-
"webkitRequestFullscreen",
|
|
334
|
-
"webkitEnterFullscreen",
|
|
335
|
-
"webkitEnterFullScreen",
|
|
336
|
-
"webkitRequestFullScreen",
|
|
337
|
-
"mozRequestFullScreen",
|
|
338
|
-
"msRequestFullscreen"
|
|
339
|
-
].find((s) => R && s in R || B.value && s in B.value)), U = computed(() => [
|
|
340
|
-
"exitFullscreen",
|
|
341
|
-
"webkitExitFullscreen",
|
|
342
|
-
"webkitExitFullScreen",
|
|
343
|
-
"webkitCancelFullScreen",
|
|
344
|
-
"mozCancelFullScreen",
|
|
345
|
-
"msExitFullscreen"
|
|
346
|
-
].find((s) => R && s in R || B.value && s in B.value)), W = computed(() => [
|
|
347
|
-
"fullScreen",
|
|
348
|
-
"webkitIsFullScreen",
|
|
349
|
-
"webkitDisplayingFullscreen",
|
|
350
|
-
"mozFullScreen",
|
|
351
|
-
"msFullscreenElement"
|
|
352
|
-
].find((s) => R && s in R || B.value && s in B.value)), G = [
|
|
353
|
-
"fullscreenElement",
|
|
354
|
-
"webkitFullscreenElement",
|
|
355
|
-
"mozFullScreenElement",
|
|
356
|
-
"msFullscreenElement"
|
|
357
|
-
].find((s) => R && s in R), K = /* @__PURE__ */ useSupported(() => B.value && R && H.value !== void 0 && U.value !== void 0 && W.value !== void 0), q = () => G ? R?.[G] === B.value : !1, J = () => {
|
|
358
|
-
if (W.value) {
|
|
359
|
-
if (R && R[W.value] != null) return R[W.value];
|
|
360
|
-
{
|
|
361
|
-
let s = B.value;
|
|
362
|
-
if (s?.[W.value] != null) return !!s[W.value];
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return !1;
|
|
366
|
-
};
|
|
367
|
-
async function Y() {
|
|
368
|
-
if (!(!K.value || !V.value)) {
|
|
369
|
-
if (U.value) if (R?.[U.value] != null) await R[U.value]();
|
|
370
|
-
else {
|
|
371
|
-
let s = B.value;
|
|
372
|
-
s?.[U.value] != null && await s[U.value]();
|
|
373
|
-
}
|
|
374
|
-
V.value = !1;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
async function X() {
|
|
378
|
-
if (!K.value || V.value) return;
|
|
379
|
-
J() && await Y();
|
|
380
|
-
let s = B.value;
|
|
381
|
-
H.value && s?.[H.value] != null && (await s[H.value](), V.value = !0);
|
|
382
|
-
}
|
|
383
|
-
async function Z() {
|
|
384
|
-
await (V.value ? Y() : X());
|
|
385
|
-
}
|
|
386
|
-
let Q = () => {
|
|
387
|
-
let s = J();
|
|
388
|
-
(!s || s && q()) && (V.value = s);
|
|
389
|
-
}, $ = {
|
|
390
|
-
capture: !1,
|
|
391
|
-
passive: !0
|
|
392
|
-
};
|
|
393
|
-
return useEventListener(R, eventHandlers, Q, $), useEventListener(() => unrefElement(B), eventHandlers, Q, $), tryOnMounted(Q, !1), z && tryOnScopeDispose(Y), {
|
|
394
|
-
isSupported: K,
|
|
395
|
-
isFullscreen: V,
|
|
396
|
-
enter: X,
|
|
397
|
-
exit: Y,
|
|
398
|
-
toggle: Z
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
var DefaultMagicKeysAliasMap = {
|
|
402
|
-
ctrl: "control",
|
|
403
|
-
command: "meta",
|
|
404
|
-
cmd: "meta",
|
|
405
|
-
option: "alt",
|
|
406
|
-
up: "arrowup",
|
|
407
|
-
down: "arrowdown",
|
|
408
|
-
left: "arrowleft",
|
|
409
|
-
right: "arrowright"
|
|
410
|
-
};
|
|
411
|
-
function useMagicKeys(s = {}) {
|
|
412
|
-
let { reactive: I = !1, target: R = defaultWindow, aliasMap: z = DefaultMagicKeysAliasMap, passive: B = !0, onEventFired: V = noop } = s, H = reactive(/* @__PURE__ */ new Set()), U = {
|
|
413
|
-
toJSON() {
|
|
414
|
-
return {};
|
|
415
|
-
},
|
|
416
|
-
current: H
|
|
417
|
-
}, W = I ? reactive(U) : U, G = /* @__PURE__ */ new Set(), K = new Map([
|
|
418
|
-
["Meta", G],
|
|
419
|
-
["Shift", /* @__PURE__ */ new Set()],
|
|
420
|
-
["Alt", /* @__PURE__ */ new Set()]
|
|
421
|
-
]), q = /* @__PURE__ */ new Set();
|
|
422
|
-
function J(s, L) {
|
|
423
|
-
s in W && (I ? W[s] = L : W[s].value = L);
|
|
424
|
-
}
|
|
425
|
-
function Y() {
|
|
426
|
-
H.clear();
|
|
427
|
-
for (let s of q) J(s, !1);
|
|
428
|
-
}
|
|
429
|
-
function X(s, I, L) {
|
|
430
|
-
if (!(!s || typeof I.getModifierState != "function")) {
|
|
431
|
-
for (let [s, R] of K) if (I.getModifierState(s)) {
|
|
432
|
-
L.forEach((s) => R.add(s));
|
|
433
|
-
break;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
function Z(s, I) {
|
|
438
|
-
if (s) return;
|
|
439
|
-
let L = `${I[0].toUpperCase()}${I.slice(1)}`, R = K.get(L);
|
|
440
|
-
if (!["shift", "alt"].includes(I) || !R) return;
|
|
441
|
-
let z = Array.from(R), B = z.indexOf(I);
|
|
442
|
-
z.forEach((s, I) => {
|
|
443
|
-
I >= B && (H.delete(s), J(s, !1));
|
|
444
|
-
}), R.clear();
|
|
445
|
-
}
|
|
446
|
-
function Q(s, I) {
|
|
447
|
-
let L = s.key?.toLowerCase(), R = [s.code?.toLowerCase(), L].filter(Boolean);
|
|
448
|
-
if (L !== "") {
|
|
449
|
-
L && (I ? H.add(L) : H.delete(L));
|
|
450
|
-
for (let s of R) q.add(s), J(s, I);
|
|
451
|
-
X(I, s, [...H, ...R]), Z(I, L), L === "meta" && !I && (G.forEach((s) => {
|
|
452
|
-
H.delete(s), J(s, !1);
|
|
453
|
-
}), G.clear());
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
useEventListener(R, "keydown", (s) => (Q(s, !0), V(s)), { passive: B }), useEventListener(R, "keyup", (s) => (Q(s, !1), V(s)), { passive: B }), useEventListener("blur", Y, { passive: B }), useEventListener("focus", Y, { passive: B });
|
|
457
|
-
let $ = new Proxy(W, { get(s, R, B) {
|
|
458
|
-
if (typeof R != "string") return Reflect.get(s, R, B);
|
|
459
|
-
if (R = R.toLowerCase(), R in z && (R = z[R]), !(R in W)) if (/[+_-]/.test(R)) {
|
|
460
|
-
let s = R.split(/[+_-]/g).map((s) => s.trim());
|
|
461
|
-
W[R] = computed(() => s.map((s) => toValue($[s])).every(Boolean));
|
|
462
|
-
} else W[R] = shallowRef(!1);
|
|
463
|
-
let V = Reflect.get(s, R, B);
|
|
464
|
-
return I ? toValue(V) : V;
|
|
465
|
-
} });
|
|
466
|
-
return $;
|
|
467
|
-
}
|
|
468
|
-
export { useFullscreen as a, isClient as c, useTimeoutFn as d, useToggle as f, useElementSize as i, toRef$1 as l, useClipboard as n, useMagicKeys as o, useCssVar as r, usePreferredDark as s, computedAsync as t, tryOnScopeDispose as u };
|