x-essential-lib 0.11.12 → 0.11.14
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/index.d.ts +16 -8
- package/dist/index.js +31 -41
- package/dist/{vendor.nkww20g1.js → vendor.dyl22a0i.js} +42 -279
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as EventType, t as Emitter } from "./vendor.
|
|
2
|
-
import { Ref } from "vue";
|
|
1
|
+
import { n as EventType, t as Emitter } from "./vendor.dyl22a0i.js";
|
|
2
|
+
import { Reactive, Ref } from "vue";
|
|
3
3
|
import { VuetifyOptions } from "vuetify";
|
|
4
4
|
import { AxiosInstance } from "axios";
|
|
5
5
|
//#region src/composables/color.d.ts
|
|
@@ -67,6 +67,14 @@ export declare function providePermissionObjects(permissionObjects: Ref<Permissi
|
|
|
67
67
|
export declare function injectPermissionObjects(): Ref<PermissionObjects>;
|
|
68
68
|
export declare function provideViews(views: Ref<string[]>): void;
|
|
69
69
|
export declare function injectViews(): Ref<string[]>;
|
|
70
|
+
interface SafeAreaInsets {
|
|
71
|
+
top: number;
|
|
72
|
+
bottom: number;
|
|
73
|
+
left: number;
|
|
74
|
+
right: number;
|
|
75
|
+
}
|
|
76
|
+
export declare function provideSafeAreaInsets(safeAreaInsets: Reactive<SafeAreaInsets>): void;
|
|
77
|
+
export declare function injectSafeAreaInsets(): Reactive<SafeAreaInsets>;
|
|
70
78
|
//#endregion
|
|
71
79
|
//#region src/logic/router/index.d.ts
|
|
72
80
|
export interface RouteMeta {
|
|
@@ -157,6 +165,12 @@ export interface GlobalStates {
|
|
|
157
165
|
permissionChecksum: Ref<string>;
|
|
158
166
|
lastAppPath: Ref<string>;
|
|
159
167
|
views: Ref<string[]>;
|
|
168
|
+
safeAreaInsets: Reactive<{
|
|
169
|
+
top: number;
|
|
170
|
+
bottom: number;
|
|
171
|
+
left: number;
|
|
172
|
+
right: number;
|
|
173
|
+
}>;
|
|
160
174
|
}
|
|
161
175
|
export declare function useGlobalStates(globalStates: GlobalStates, base?: boolean): void;
|
|
162
176
|
//#endregion
|
|
@@ -185,12 +199,6 @@ export declare function useSystem(): {
|
|
|
185
199
|
isMobile: () => boolean;
|
|
186
200
|
compactWidth: import("vue").ComputedRef<string>;
|
|
187
201
|
minimizeApp: () => Promise<void>;
|
|
188
|
-
safeAreaInset: {
|
|
189
|
-
top: number;
|
|
190
|
-
bottom: number;
|
|
191
|
-
left: number;
|
|
192
|
-
right: number;
|
|
193
|
-
};
|
|
194
202
|
nameList: (entries: string[], instances?: string[]) => string;
|
|
195
203
|
sentenceOfAsk: (verb: string, object: string, name: string) => string;
|
|
196
204
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){try{document.getElementById(`x-essential-lib`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-essential-lib`);const t = document.createTextNode(`.fade-leave-active[data-v-x-essential-lib-c3545c8d]{transition:opacity .5s}.fade-leave-to[data-v-x-essential-lib-c3545c8d]{opacity:0}.x-cont[data-v-x-essential-lib-c3545c8d]{justify-content:center;align-items:center;display:flex;position:absolute;inset:0;overflow:hidden}.lds-spinner[data-v-x-essential-lib-c3545c8d]{color:official;width:40px;height:40px;display:inline-block;position:relative}.lds-spinner div[data-v-x-essential-lib-c3545c8d]{transform-origin:20px 20px;animation:1.2s linear infinite lds-spinner-x-essential-lib-c3545c8d}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:after{content:" ";background:#9e9e9e;border-radius:5%;width:2px;height:6px;display:block;position:absolute;top:3px;left:18px}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:first-child{animation-delay:-1.1s;transform:rotate(0)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(2){animation-delay:-1s;transform:rotate(30deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(3){animation-delay:-.9s;transform:rotate(60deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(4){animation-delay:-.8s;transform:rotate(90deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(5){animation-delay:-.7s;transform:rotate(120deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(6){animation-delay:-.6s;transform:rotate(150deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(7){animation-delay:-.5s;transform:rotate(180deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(8){animation-delay:-.4s;transform:rotate(210deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(9){animation-delay:-.3s;transform:rotate(240deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(10){animation-delay:-.2s;transform:rotate(270deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(11){animation-delay:-.1s;transform:rotate(300deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(12){animation-delay:0s;transform:rotate(330deg)}@keyframes lds-spinner-x-essential-lib-c3545c8d{0%{opacity:1}to{opacity:0}}.x-item[data-v-x-essential-lib-cfcda9d9]{width:600px}@media (width<=600px){.x-item[data-v-x-essential-lib-cfcda9d9]{width:calc(100vw - 16px)}}.x-cont[data-v-x-essential-lib-b973907d]{z-index:9999;position:fixed;bottom:50px;left:50%;transform:translate(-50%)}`);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
|
|
2
|
-
import { a as
|
|
3
|
-
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted,
|
|
2
|
+
import { a as isTauri, c as string, d as usePreferredDark, i as toLower, l as api, o as custom, r as minimizeApp, s as email$1, u as mitt_default } from "./vendor.dyl22a0i.js";
|
|
3
|
+
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, resolveComponent, toDisplayString, unref, useTemplateRef, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
import { useDisplay, useTheme } from "vuetify";
|
|
6
6
|
import axios from "axios";
|
|
@@ -249,10 +249,16 @@ function injectPermissionObjects() {
|
|
|
249
249
|
return inject("essentialPermissionObjects");
|
|
250
250
|
}
|
|
251
251
|
function provideViews(views) {
|
|
252
|
-
provide("
|
|
252
|
+
provide("essentialViews", views);
|
|
253
253
|
}
|
|
254
254
|
function injectViews() {
|
|
255
|
-
return inject("
|
|
255
|
+
return inject("essentialViews");
|
|
256
|
+
}
|
|
257
|
+
function provideSafeAreaInsets(safeAreaInsets) {
|
|
258
|
+
provide("essentialSafeAreaInsets", safeAreaInsets);
|
|
259
|
+
}
|
|
260
|
+
function injectSafeAreaInsets() {
|
|
261
|
+
return inject("essentialSafeAreaInsets");
|
|
256
262
|
}
|
|
257
263
|
|
|
258
264
|
//#endregion
|
|
@@ -623,11 +629,12 @@ const baseVuetifyOptions = {
|
|
|
623
629
|
//#region src/composables/globalStates.ts
|
|
624
630
|
function useGlobalStates(globalStates, base) {
|
|
625
631
|
const { t } = useI18n();
|
|
626
|
-
const { darkRaw, dark, locale, activeOrg, activeOrgNameRaw, activeOrgName, privateDomain, permissionObjects, permissionChecksum, lastAppPath, views } = globalStates;
|
|
632
|
+
const { darkRaw, dark, locale, activeOrg, activeOrgNameRaw, activeOrgName, privateDomain, permissionObjects, permissionChecksum, lastAppPath, views, safeAreaInsets } = globalStates;
|
|
627
633
|
provideDark(dark);
|
|
628
634
|
provideLocale(locale);
|
|
629
635
|
providePermissionObjects(permissionObjects);
|
|
630
636
|
provideViews(views);
|
|
637
|
+
provideSafeAreaInsets(safeAreaInsets);
|
|
631
638
|
const prefDark = usePreferredDark();
|
|
632
639
|
watchEffect(() => {
|
|
633
640
|
let d;
|
|
@@ -663,12 +670,24 @@ function useGlobalStates(globalStates, base) {
|
|
|
663
670
|
function onUpdateLastAppPath(val) {
|
|
664
671
|
lastAppPath.value = val;
|
|
665
672
|
}
|
|
673
|
+
function onUpdateSafeAreaInsets(val) {
|
|
674
|
+
safeAreaInsets.top = val.top;
|
|
675
|
+
safeAreaInsets.bottom = val.bottom;
|
|
676
|
+
safeAreaInsets.left = val.left;
|
|
677
|
+
safeAreaInsets.right = val.right;
|
|
678
|
+
}
|
|
666
679
|
function onSyncGlobalStates() {
|
|
667
680
|
eventBus.emit("updateDark", dark.value);
|
|
668
681
|
eventBus.emit("updateLocale", locale.value);
|
|
669
682
|
eventBus.emit("updateActiveOrg", [activeOrg.value, activeOrgNameRaw.value]);
|
|
670
683
|
eventBus.emit("updatePermission", [permissionObjects.value, permissionChecksum.value]);
|
|
671
684
|
eventBus.emit("updateLastAppPath", lastAppPath.value);
|
|
685
|
+
eventBus.emit("updateSafeAreaInsets", {
|
|
686
|
+
top: safeAreaInsets.top,
|
|
687
|
+
bottom: safeAreaInsets.bottom,
|
|
688
|
+
left: safeAreaInsets.left,
|
|
689
|
+
right: safeAreaInsets.right
|
|
690
|
+
});
|
|
672
691
|
}
|
|
673
692
|
onBeforeMount(() => {
|
|
674
693
|
eventBus.on("updateDark", onUpdateDark);
|
|
@@ -676,6 +695,7 @@ function useGlobalStates(globalStates, base) {
|
|
|
676
695
|
eventBus.on("updateActiveOrg", onUpdateActiveOrg);
|
|
677
696
|
eventBus.on("updatePermission", onUpdatePermission);
|
|
678
697
|
eventBus.on("updateLastAppPath", onUpdateLastAppPath);
|
|
698
|
+
eventBus.on("updateSafeAreaInsets", onUpdateSafeAreaInsets);
|
|
679
699
|
if (base) eventBus.on("syncGlobalStates", onSyncGlobalStates);
|
|
680
700
|
else eventBus.emit("syncGlobalStates");
|
|
681
701
|
});
|
|
@@ -685,6 +705,7 @@ function useGlobalStates(globalStates, base) {
|
|
|
685
705
|
eventBus.off("updateActiveOrg", onUpdateActiveOrg);
|
|
686
706
|
eventBus.off("updatePermission", onUpdatePermission);
|
|
687
707
|
eventBus.off("updateLastAppPath", onUpdateLastAppPath);
|
|
708
|
+
eventBus.off("updateSafeAreaInsets", onUpdateSafeAreaInsets);
|
|
688
709
|
if (base) eventBus.off("syncGlobalStates", onSyncGlobalStates);
|
|
689
710
|
});
|
|
690
711
|
}
|
|
@@ -702,40 +723,10 @@ function useSystem() {
|
|
|
702
723
|
else if (display.width.value <= 1920) return "768px";
|
|
703
724
|
else return "1024px";
|
|
704
725
|
});
|
|
705
|
-
async function minimizeApp() {
|
|
726
|
+
async function minimizeApp$1() {
|
|
706
727
|
navigator.Backbutton?.goHome(() => {}, () => {});
|
|
707
|
-
|
|
708
|
-
}
|
|
709
|
-
const safeAreaInset = reactive({
|
|
710
|
-
top: 0,
|
|
711
|
-
bottom: 0,
|
|
712
|
-
left: 0,
|
|
713
|
-
right: 0
|
|
714
|
-
});
|
|
715
|
-
function getSafeAreaVar(name) {
|
|
716
|
-
const str = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
717
|
-
return parseFloat(str) || 0;
|
|
728
|
+
if (isTauri()) await minimizeApp();
|
|
718
729
|
}
|
|
719
|
-
function syncSafeArea() {
|
|
720
|
-
safeAreaInset.top = getSafeAreaVar("--safe-area-inset-top");
|
|
721
|
-
safeAreaInset.bottom = getSafeAreaVar("--safe-area-inset-bottom");
|
|
722
|
-
safeAreaInset.left = getSafeAreaVar("--safe-area-inset-left");
|
|
723
|
-
safeAreaInset.right = getSafeAreaVar("--safe-area-inset-right");
|
|
724
|
-
}
|
|
725
|
-
const handleResize = debounce(() => {
|
|
726
|
-
syncSafeArea();
|
|
727
|
-
}, 250);
|
|
728
|
-
function onResize() {
|
|
729
|
-
handleResize();
|
|
730
|
-
}
|
|
731
|
-
onMounted(() => {
|
|
732
|
-
window.addEventListener("resize", onResize);
|
|
733
|
-
syncSafeArea();
|
|
734
|
-
});
|
|
735
|
-
onUnmounted(() => {
|
|
736
|
-
window.removeEventListener("resize", onResize);
|
|
737
|
-
handleResize.cancel();
|
|
738
|
-
});
|
|
739
730
|
function nameList(entries, instances) {
|
|
740
731
|
let name;
|
|
741
732
|
const names = entries.map((entry) => t(entry));
|
|
@@ -759,8 +750,7 @@ function useSystem() {
|
|
|
759
750
|
return {
|
|
760
751
|
isMobile,
|
|
761
752
|
compactWidth,
|
|
762
|
-
minimizeApp,
|
|
763
|
-
safeAreaInset,
|
|
753
|
+
minimizeApp: minimizeApp$1,
|
|
764
754
|
nameList,
|
|
765
755
|
sentenceOfAsk
|
|
766
756
|
};
|
|
@@ -781,7 +771,7 @@ function useMicroApp(globalStates, customBack) {
|
|
|
781
771
|
}
|
|
782
772
|
const routeMeta = matchRouteMeta(route.path);
|
|
783
773
|
if (!routeMeta) return;
|
|
784
|
-
if (routeMeta.level === 0) minimizeApp();
|
|
774
|
+
if (routeMeta.level === 0) await minimizeApp();
|
|
785
775
|
else if (customBack) customBack(routeMeta);
|
|
786
776
|
else {
|
|
787
777
|
let back;
|
|
@@ -1594,4 +1584,4 @@ async function loadLocaleMessageEssential(locale) {
|
|
|
1594
1584
|
var src_default = { install };
|
|
1595
1585
|
|
|
1596
1586
|
//#endregion
|
|
1597
|
-
export { addView, baseVuetifyOptions, clearViews, closeWaitDlg, createAxios, src_default as default, delView, email, eventBus, getErrorMessage, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, length, loadLocaleMessageEssential, matchRouteMeta, maxLength, messageError, messageInfo, messageSuccess, messageWarning, minLength, onBeforeEnter, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, required, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePageRoute, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
1587
|
+
export { addView, baseVuetifyOptions, clearViews, closeWaitDlg, createAxios, src_default as default, delView, email, eventBus, getErrorMessage, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectSafeAreaInsets, injectViews, isEmpty, isExist, lastView, length, loadLocaleMessageEssential, matchRouteMeta, maxLength, messageError, messageInfo, messageSuccess, messageWarning, minLength, onBeforeEnter, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideSafeAreaInsets, provideViews, required, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePageRoute, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, computed, defineComponent, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isRef, onBeforeMount, onBeforeUnmount, onMounted,
|
|
1
|
+
import { Fragment, computed, defineComponent, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isRef, onBeforeMount, onBeforeUnmount, onMounted, provide, ref, shallowRef, toValue, unref, watch, watchEffect } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region node_modules/.pnpm/@vueuse+shared@15.0.0_vue@3.5.43_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
|
|
4
4
|
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -25,7 +25,7 @@ const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
|
25
25
|
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
26
26
|
const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
27
27
|
const toString$1 = Object.prototype.toString;
|
|
28
|
-
const isObject$
|
|
28
|
+
const isObject$1 = (val) => toString$1.call(val) === "[object Object]";
|
|
29
29
|
/**
|
|
30
30
|
* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
|
|
31
31
|
*/
|
|
@@ -94,7 +94,7 @@ function useEventListener(...args) {
|
|
|
94
94
|
];
|
|
95
95
|
}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
|
|
96
96
|
if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
|
|
97
|
-
const optionsClone = isObject$
|
|
97
|
+
const optionsClone = isObject$1(raw_options) ? { ...raw_options } : raw_options;
|
|
98
98
|
const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
|
|
99
99
|
onCleanup(() => {
|
|
100
100
|
cleanups.forEach((fn) => fn());
|
|
@@ -322,16 +322,16 @@ function slugify(input) {
|
|
|
322
322
|
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
323
323
|
}
|
|
324
324
|
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
325
|
-
function isObject
|
|
325
|
+
function isObject(data) {
|
|
326
326
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
327
327
|
}
|
|
328
328
|
function isPlainObject(o) {
|
|
329
|
-
if (isObject
|
|
329
|
+
if (isObject(o) === false) return false;
|
|
330
330
|
const ctor = o.constructor;
|
|
331
331
|
if (ctor === void 0) return true;
|
|
332
332
|
if (typeof ctor !== "function") return true;
|
|
333
333
|
const prot = ctor.prototype;
|
|
334
|
-
if (isObject
|
|
334
|
+
if (isObject(prot) === false) return false;
|
|
335
335
|
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
336
336
|
return true;
|
|
337
337
|
}
|
|
@@ -4677,6 +4677,28 @@ var Resource = class {
|
|
|
4677
4677
|
await this.close();
|
|
4678
4678
|
}
|
|
4679
4679
|
};
|
|
4680
|
+
/**
|
|
4681
|
+
* Checks whether the code is running inside a Tauri webview.
|
|
4682
|
+
*
|
|
4683
|
+
* Useful for frontends that are also served on the web, to guard calls to APIs
|
|
4684
|
+
* that only exist inside the application.
|
|
4685
|
+
*
|
|
4686
|
+
* @example
|
|
4687
|
+
* ```typescript
|
|
4688
|
+
* import { isTauri } from '@tauri-apps/api/core';
|
|
4689
|
+
* import { getVersion } from '@tauri-apps/api/app';
|
|
4690
|
+
*
|
|
4691
|
+
* const version = isTauri() ? await getVersion() : 'web';
|
|
4692
|
+
* ```
|
|
4693
|
+
*
|
|
4694
|
+
* @returns `true` when running inside a Tauri app, `false` otherwise (e.g. in a
|
|
4695
|
+
* browser or in unit tests).
|
|
4696
|
+
*
|
|
4697
|
+
* @since 2.0.0
|
|
4698
|
+
*/
|
|
4699
|
+
function isTauri() {
|
|
4700
|
+
return !!(globalThis || window).isTauri;
|
|
4701
|
+
}
|
|
4680
4702
|
|
|
4681
4703
|
//#endregion
|
|
4682
4704
|
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
|
|
@@ -4890,119 +4912,6 @@ function baseToString(value) {
|
|
|
4890
4912
|
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
4891
4913
|
}
|
|
4892
4914
|
|
|
4893
|
-
//#endregion
|
|
4894
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js
|
|
4895
|
-
/** Used to match a single whitespace character. */
|
|
4896
|
-
var reWhitespace = /\s/;
|
|
4897
|
-
/**
|
|
4898
|
-
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
4899
|
-
* character of `string`.
|
|
4900
|
-
*
|
|
4901
|
-
* @private
|
|
4902
|
-
* @param {string} string The string to inspect.
|
|
4903
|
-
* @returns {number} Returns the index of the last non-whitespace character.
|
|
4904
|
-
*/
|
|
4905
|
-
function trimmedEndIndex(string) {
|
|
4906
|
-
var index = string.length;
|
|
4907
|
-
while (index-- && reWhitespace.test(string.charAt(index)));
|
|
4908
|
-
return index;
|
|
4909
|
-
}
|
|
4910
|
-
|
|
4911
|
-
//#endregion
|
|
4912
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js
|
|
4913
|
-
/** Used to match leading whitespace. */
|
|
4914
|
-
var reTrimStart = /^\s+/;
|
|
4915
|
-
/**
|
|
4916
|
-
* The base implementation of `_.trim`.
|
|
4917
|
-
*
|
|
4918
|
-
* @private
|
|
4919
|
-
* @param {string} string The string to trim.
|
|
4920
|
-
* @returns {string} Returns the trimmed string.
|
|
4921
|
-
*/
|
|
4922
|
-
function baseTrim(string) {
|
|
4923
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
4924
|
-
}
|
|
4925
|
-
|
|
4926
|
-
//#endregion
|
|
4927
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
|
|
4928
|
-
/**
|
|
4929
|
-
* Checks if `value` is the
|
|
4930
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
4931
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
4932
|
-
*
|
|
4933
|
-
* @static
|
|
4934
|
-
* @memberOf _
|
|
4935
|
-
* @since 0.1.0
|
|
4936
|
-
* @category Lang
|
|
4937
|
-
* @param {*} value The value to check.
|
|
4938
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
4939
|
-
* @example
|
|
4940
|
-
*
|
|
4941
|
-
* _.isObject({});
|
|
4942
|
-
* // => true
|
|
4943
|
-
*
|
|
4944
|
-
* _.isObject([1, 2, 3]);
|
|
4945
|
-
* // => true
|
|
4946
|
-
*
|
|
4947
|
-
* _.isObject(_.noop);
|
|
4948
|
-
* // => true
|
|
4949
|
-
*
|
|
4950
|
-
* _.isObject(null);
|
|
4951
|
-
* // => false
|
|
4952
|
-
*/
|
|
4953
|
-
function isObject(value) {
|
|
4954
|
-
var type = typeof value;
|
|
4955
|
-
return value != null && (type == "object" || type == "function");
|
|
4956
|
-
}
|
|
4957
|
-
|
|
4958
|
-
//#endregion
|
|
4959
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js
|
|
4960
|
-
/** Used as references for various `Number` constants. */
|
|
4961
|
-
var NAN = NaN;
|
|
4962
|
-
/** Used to detect bad signed hexadecimal string values. */
|
|
4963
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
4964
|
-
/** Used to detect binary string values. */
|
|
4965
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
4966
|
-
/** Used to detect octal string values. */
|
|
4967
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
4968
|
-
/** Built-in method references without a dependency on `root`. */
|
|
4969
|
-
var freeParseInt = parseInt;
|
|
4970
|
-
/**
|
|
4971
|
-
* Converts `value` to a number.
|
|
4972
|
-
*
|
|
4973
|
-
* @static
|
|
4974
|
-
* @memberOf _
|
|
4975
|
-
* @since 4.0.0
|
|
4976
|
-
* @category Lang
|
|
4977
|
-
* @param {*} value The value to process.
|
|
4978
|
-
* @returns {number} Returns the number.
|
|
4979
|
-
* @example
|
|
4980
|
-
*
|
|
4981
|
-
* _.toNumber(3.2);
|
|
4982
|
-
* // => 3.2
|
|
4983
|
-
*
|
|
4984
|
-
* _.toNumber(Number.MIN_VALUE);
|
|
4985
|
-
* // => 5e-324
|
|
4986
|
-
*
|
|
4987
|
-
* _.toNumber(Infinity);
|
|
4988
|
-
* // => Infinity
|
|
4989
|
-
*
|
|
4990
|
-
* _.toNumber('3.2');
|
|
4991
|
-
* // => 3.2
|
|
4992
|
-
*/
|
|
4993
|
-
function toNumber(value) {
|
|
4994
|
-
if (typeof value == "number") return value;
|
|
4995
|
-
if (isSymbol(value)) return NAN;
|
|
4996
|
-
if (isObject(value)) {
|
|
4997
|
-
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
4998
|
-
value = isObject(other) ? other + "" : other;
|
|
4999
|
-
}
|
|
5000
|
-
if (typeof value != "string") return value === 0 ? value : +value;
|
|
5001
|
-
value = baseTrim(value);
|
|
5002
|
-
var isBinary = reIsBinary.test(value);
|
|
5003
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
5004
|
-
}
|
|
5005
|
-
|
|
5006
4915
|
//#endregion
|
|
5007
4916
|
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.js
|
|
5008
4917
|
/**
|
|
@@ -5030,158 +4939,6 @@ function toString(value) {
|
|
|
5030
4939
|
return value == null ? "" : baseToString(value);
|
|
5031
4940
|
}
|
|
5032
4941
|
|
|
5033
|
-
//#endregion
|
|
5034
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/now.js
|
|
5035
|
-
/**
|
|
5036
|
-
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
5037
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
5038
|
-
*
|
|
5039
|
-
* @static
|
|
5040
|
-
* @memberOf _
|
|
5041
|
-
* @since 2.4.0
|
|
5042
|
-
* @category Date
|
|
5043
|
-
* @returns {number} Returns the timestamp.
|
|
5044
|
-
* @example
|
|
5045
|
-
*
|
|
5046
|
-
* _.defer(function(stamp) {
|
|
5047
|
-
* console.log(_.now() - stamp);
|
|
5048
|
-
* }, _.now());
|
|
5049
|
-
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
5050
|
-
*/
|
|
5051
|
-
var now = function() {
|
|
5052
|
-
return root.Date.now();
|
|
5053
|
-
};
|
|
5054
|
-
|
|
5055
|
-
//#endregion
|
|
5056
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/debounce.js
|
|
5057
|
-
/** Error message constants. */
|
|
5058
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
5059
|
-
var nativeMax = Math.max;
|
|
5060
|
-
var nativeMin = Math.min;
|
|
5061
|
-
/**
|
|
5062
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
5063
|
-
* milliseconds have elapsed since the last time the debounced function was
|
|
5064
|
-
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
5065
|
-
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
5066
|
-
* Provide `options` to indicate whether `func` should be invoked on the
|
|
5067
|
-
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
5068
|
-
* with the last arguments provided to the debounced function. Subsequent
|
|
5069
|
-
* calls to the debounced function return the result of the last `func`
|
|
5070
|
-
* invocation.
|
|
5071
|
-
*
|
|
5072
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
5073
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
|
5074
|
-
* is invoked more than once during the `wait` timeout.
|
|
5075
|
-
*
|
|
5076
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
5077
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
5078
|
-
*
|
|
5079
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
5080
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
5081
|
-
*
|
|
5082
|
-
* @static
|
|
5083
|
-
* @memberOf _
|
|
5084
|
-
* @since 0.1.0
|
|
5085
|
-
* @category Function
|
|
5086
|
-
* @param {Function} func The function to debounce.
|
|
5087
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
5088
|
-
* @param {Object} [options={}] The options object.
|
|
5089
|
-
* @param {boolean} [options.leading=false]
|
|
5090
|
-
* Specify invoking on the leading edge of the timeout.
|
|
5091
|
-
* @param {number} [options.maxWait]
|
|
5092
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
5093
|
-
* @param {boolean} [options.trailing=true]
|
|
5094
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
5095
|
-
* @returns {Function} Returns the new debounced function.
|
|
5096
|
-
* @example
|
|
5097
|
-
*
|
|
5098
|
-
* // Avoid costly calculations while the window size is in flux.
|
|
5099
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
5100
|
-
*
|
|
5101
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
5102
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
5103
|
-
* 'leading': true,
|
|
5104
|
-
* 'trailing': false
|
|
5105
|
-
* }));
|
|
5106
|
-
*
|
|
5107
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
5108
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
5109
|
-
* var source = new EventSource('/stream');
|
|
5110
|
-
* jQuery(source).on('message', debounced);
|
|
5111
|
-
*
|
|
5112
|
-
* // Cancel the trailing debounced invocation.
|
|
5113
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
|
5114
|
-
*/
|
|
5115
|
-
function debounce(func, wait, options) {
|
|
5116
|
-
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
5117
|
-
if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
|
|
5118
|
-
wait = toNumber(wait) || 0;
|
|
5119
|
-
if (isObject(options)) {
|
|
5120
|
-
leading = !!options.leading;
|
|
5121
|
-
maxing = "maxWait" in options;
|
|
5122
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
5123
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
5124
|
-
}
|
|
5125
|
-
function invokeFunc(time) {
|
|
5126
|
-
var args = lastArgs, thisArg = lastThis;
|
|
5127
|
-
lastArgs = lastThis = void 0;
|
|
5128
|
-
lastInvokeTime = time;
|
|
5129
|
-
result = func.apply(thisArg, args);
|
|
5130
|
-
return result;
|
|
5131
|
-
}
|
|
5132
|
-
function leadingEdge(time) {
|
|
5133
|
-
lastInvokeTime = time;
|
|
5134
|
-
timerId = setTimeout(timerExpired, wait);
|
|
5135
|
-
return leading ? invokeFunc(time) : result;
|
|
5136
|
-
}
|
|
5137
|
-
function remainingWait(time) {
|
|
5138
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
5139
|
-
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
5140
|
-
}
|
|
5141
|
-
function shouldInvoke(time) {
|
|
5142
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
5143
|
-
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
5144
|
-
}
|
|
5145
|
-
function timerExpired() {
|
|
5146
|
-
var time = now();
|
|
5147
|
-
if (shouldInvoke(time)) return trailingEdge(time);
|
|
5148
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
5149
|
-
}
|
|
5150
|
-
function trailingEdge(time) {
|
|
5151
|
-
timerId = void 0;
|
|
5152
|
-
if (trailing && lastArgs) return invokeFunc(time);
|
|
5153
|
-
lastArgs = lastThis = void 0;
|
|
5154
|
-
return result;
|
|
5155
|
-
}
|
|
5156
|
-
function cancel() {
|
|
5157
|
-
if (timerId !== void 0) clearTimeout(timerId);
|
|
5158
|
-
lastInvokeTime = 0;
|
|
5159
|
-
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
5160
|
-
}
|
|
5161
|
-
function flush() {
|
|
5162
|
-
return timerId === void 0 ? result : trailingEdge(now());
|
|
5163
|
-
}
|
|
5164
|
-
function debounced() {
|
|
5165
|
-
var time = now(), isInvoking = shouldInvoke(time);
|
|
5166
|
-
lastArgs = arguments;
|
|
5167
|
-
lastThis = this;
|
|
5168
|
-
lastCallTime = time;
|
|
5169
|
-
if (isInvoking) {
|
|
5170
|
-
if (timerId === void 0) return leadingEdge(lastCallTime);
|
|
5171
|
-
if (maxing) {
|
|
5172
|
-
clearTimeout(timerId);
|
|
5173
|
-
timerId = setTimeout(timerExpired, wait);
|
|
5174
|
-
return invokeFunc(lastCallTime);
|
|
5175
|
-
}
|
|
5176
|
-
}
|
|
5177
|
-
if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
|
|
5178
|
-
return result;
|
|
5179
|
-
}
|
|
5180
|
-
debounced.cancel = cancel;
|
|
5181
|
-
debounced.flush = flush;
|
|
5182
|
-
return debounced;
|
|
5183
|
-
}
|
|
5184
|
-
|
|
5185
4942
|
//#endregion
|
|
5186
4943
|
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toLower.js
|
|
5187
4944
|
/**
|
|
@@ -5209,15 +4966,21 @@ function toLower(value) {
|
|
|
5209
4966
|
return toString(value).toLowerCase();
|
|
5210
4967
|
}
|
|
5211
4968
|
|
|
4969
|
+
//#endregion
|
|
4970
|
+
//#region node_modules/.pnpm/tauri-plugin-z9@0.1.6/node_modules/tauri-plugin-z9/dist-js/index.mjs
|
|
4971
|
+
async function minimizeApp() {
|
|
4972
|
+
return await invoke("plugin:z9|minimize_app");
|
|
4973
|
+
}
|
|
4974
|
+
|
|
5212
4975
|
//#endregion
|
|
5213
4976
|
//#region node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/index.d.ts
|
|
5214
4977
|
var [EventType] = [
|
|
5215
|
-
|
|
4978
|
+
71,
|
|
5216
4979
|
() => [],
|
|
5217
4980
|
[]
|
|
5218
4981
|
];
|
|
5219
4982
|
var [Handler] = [
|
|
5220
|
-
|
|
4983
|
+
72,
|
|
5221
4984
|
(T) => [T],
|
|
5222
4985
|
[
|
|
5223
4986
|
"",
|
|
@@ -5226,7 +4989,7 @@ var [Handler] = [
|
|
|
5226
4989
|
]
|
|
5227
4990
|
];
|
|
5228
4991
|
var [WildcardHandler] = [
|
|
5229
|
-
|
|
4992
|
+
73,
|
|
5230
4993
|
(T) => [
|
|
5231
4994
|
Record,
|
|
5232
4995
|
T,
|
|
@@ -5244,7 +5007,7 @@ var [WildcardHandler] = [
|
|
|
5244
5007
|
]
|
|
5245
5008
|
];
|
|
5246
5009
|
var [EventHandlerList] = [
|
|
5247
|
-
|
|
5010
|
+
74,
|
|
5248
5011
|
(T) => [
|
|
5249
5012
|
T,
|
|
5250
5013
|
Handler,
|
|
@@ -5258,7 +5021,7 @@ var [EventHandlerList] = [
|
|
|
5258
5021
|
]
|
|
5259
5022
|
];
|
|
5260
5023
|
var [WildCardEventHandlerList] = [
|
|
5261
|
-
|
|
5024
|
+
75,
|
|
5262
5025
|
(T) => [
|
|
5263
5026
|
Record,
|
|
5264
5027
|
T,
|
|
@@ -5274,7 +5037,7 @@ var [WildCardEventHandlerList] = [
|
|
|
5274
5037
|
]
|
|
5275
5038
|
];
|
|
5276
5039
|
var [EventHandlerMap] = [
|
|
5277
|
-
|
|
5040
|
+
76,
|
|
5278
5041
|
(Events) => [
|
|
5279
5042
|
EventType,
|
|
5280
5043
|
Record,
|
|
@@ -5300,7 +5063,7 @@ var [EventHandlerMap] = [
|
|
|
5300
5063
|
]
|
|
5301
5064
|
];
|
|
5302
5065
|
var [Emitter] = [
|
|
5303
|
-
|
|
5066
|
+
77,
|
|
5304
5067
|
(Key, Events) => [
|
|
5305
5068
|
EventType,
|
|
5306
5069
|
Record,
|
|
@@ -5383,4 +5146,4 @@ var [Emitter] = [
|
|
|
5383
5146
|
];
|
|
5384
5147
|
|
|
5385
5148
|
//#endregion
|
|
5386
|
-
export {
|
|
5149
|
+
export { isTauri as a, string as c, usePreferredDark as d, toLower as i, api as l, EventType as n, custom as o, minimizeApp as r, email as s, Emitter as t, mitt_default as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-essential-lib",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.14",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -44,11 +44,12 @@
|
|
|
44
44
|
"picomatch": "^4.0.7",
|
|
45
45
|
"rolldown": "^1.2.12",
|
|
46
46
|
"sass": "^1.105.1",
|
|
47
|
+
"tauri-plugin-z9": "^0.1.6",
|
|
47
48
|
"tsdown": "^0.23.0",
|
|
48
49
|
"typescript": "^6.0.3",
|
|
49
50
|
"vite": "^8.3.2",
|
|
50
51
|
"vue-tsc": "^3.3.12",
|
|
51
|
-
"x-config-lib": "^0.1.
|
|
52
|
+
"x-config-lib": "^0.1.11",
|
|
52
53
|
"x-config-oxfmt": "^0.1.7",
|
|
53
54
|
"x-config-oxlint": "^0.1.8",
|
|
54
55
|
"zod": "^4.6.5"
|