x-essential-lib 0.11.13 → 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 +28 -36
- package/dist/{vendor.hsixv85u.js → vendor.dyl22a0i.js} +15 -302
- package/package.json +2 -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
|
-
safeAreaInsets: {
|
|
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
|
}
|
|
@@ -706,34 +727,6 @@ function useSystem() {
|
|
|
706
727
|
navigator.Backbutton?.goHome(() => {}, () => {});
|
|
707
728
|
if (isTauri()) await minimizeApp();
|
|
708
729
|
}
|
|
709
|
-
const safeAreaInsets = reactive({
|
|
710
|
-
top: 0,
|
|
711
|
-
bottom: 0,
|
|
712
|
-
left: 0,
|
|
713
|
-
right: 0
|
|
714
|
-
});
|
|
715
|
-
async function syncInsets() {
|
|
716
|
-
const result = await insets();
|
|
717
|
-
const { top, bottom, left, right } = mergeInsets(result.statusBars, result.navigationBars, result.displayCutout);
|
|
718
|
-
safeAreaInsets.top = top;
|
|
719
|
-
safeAreaInsets.bottom = bottom;
|
|
720
|
-
safeAreaInsets.left = left;
|
|
721
|
-
safeAreaInsets.right = right;
|
|
722
|
-
}
|
|
723
|
-
const handleResize = debounce(() => {
|
|
724
|
-
syncInsets();
|
|
725
|
-
}, 250);
|
|
726
|
-
function onResize() {
|
|
727
|
-
handleResize();
|
|
728
|
-
}
|
|
729
|
-
onMounted(() => {
|
|
730
|
-
window.addEventListener("resize", onResize);
|
|
731
|
-
syncInsets();
|
|
732
|
-
});
|
|
733
|
-
onUnmounted(() => {
|
|
734
|
-
window.removeEventListener("resize", onResize);
|
|
735
|
-
handleResize.cancel();
|
|
736
|
-
});
|
|
737
730
|
function nameList(entries, instances) {
|
|
738
731
|
let name;
|
|
739
732
|
const names = entries.map((entry) => t(entry));
|
|
@@ -758,7 +751,6 @@ function useSystem() {
|
|
|
758
751
|
isMobile,
|
|
759
752
|
compactWidth,
|
|
760
753
|
minimizeApp: minimizeApp$1,
|
|
761
|
-
safeAreaInsets,
|
|
762
754
|
nameList,
|
|
763
755
|
sentenceOfAsk
|
|
764
756
|
};
|
|
@@ -779,7 +771,7 @@ function useMicroApp(globalStates, customBack) {
|
|
|
779
771
|
}
|
|
780
772
|
const routeMeta = matchRouteMeta(route.path);
|
|
781
773
|
if (!routeMeta) return;
|
|
782
|
-
if (routeMeta.level === 0) minimizeApp();
|
|
774
|
+
if (routeMeta.level === 0) await minimizeApp();
|
|
783
775
|
else if (customBack) customBack(routeMeta);
|
|
784
776
|
else {
|
|
785
777
|
let back;
|
|
@@ -1592,4 +1584,4 @@ async function loadLocaleMessageEssential(locale) {
|
|
|
1592
1584
|
var src_default = { install };
|
|
1593
1585
|
|
|
1594
1586
|
//#endregion
|
|
1595
|
-
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
|
}
|
|
@@ -4912,119 +4912,6 @@ function baseToString(value) {
|
|
|
4912
4912
|
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
4913
4913
|
}
|
|
4914
4914
|
|
|
4915
|
-
//#endregion
|
|
4916
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js
|
|
4917
|
-
/** Used to match a single whitespace character. */
|
|
4918
|
-
var reWhitespace = /\s/;
|
|
4919
|
-
/**
|
|
4920
|
-
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
4921
|
-
* character of `string`.
|
|
4922
|
-
*
|
|
4923
|
-
* @private
|
|
4924
|
-
* @param {string} string The string to inspect.
|
|
4925
|
-
* @returns {number} Returns the index of the last non-whitespace character.
|
|
4926
|
-
*/
|
|
4927
|
-
function trimmedEndIndex(string) {
|
|
4928
|
-
var index = string.length;
|
|
4929
|
-
while (index-- && reWhitespace.test(string.charAt(index)));
|
|
4930
|
-
return index;
|
|
4931
|
-
}
|
|
4932
|
-
|
|
4933
|
-
//#endregion
|
|
4934
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js
|
|
4935
|
-
/** Used to match leading whitespace. */
|
|
4936
|
-
var reTrimStart = /^\s+/;
|
|
4937
|
-
/**
|
|
4938
|
-
* The base implementation of `_.trim`.
|
|
4939
|
-
*
|
|
4940
|
-
* @private
|
|
4941
|
-
* @param {string} string The string to trim.
|
|
4942
|
-
* @returns {string} Returns the trimmed string.
|
|
4943
|
-
*/
|
|
4944
|
-
function baseTrim(string) {
|
|
4945
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
4946
|
-
}
|
|
4947
|
-
|
|
4948
|
-
//#endregion
|
|
4949
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
|
|
4950
|
-
/**
|
|
4951
|
-
* Checks if `value` is the
|
|
4952
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
4953
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
4954
|
-
*
|
|
4955
|
-
* @static
|
|
4956
|
-
* @memberOf _
|
|
4957
|
-
* @since 0.1.0
|
|
4958
|
-
* @category Lang
|
|
4959
|
-
* @param {*} value The value to check.
|
|
4960
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
4961
|
-
* @example
|
|
4962
|
-
*
|
|
4963
|
-
* _.isObject({});
|
|
4964
|
-
* // => true
|
|
4965
|
-
*
|
|
4966
|
-
* _.isObject([1, 2, 3]);
|
|
4967
|
-
* // => true
|
|
4968
|
-
*
|
|
4969
|
-
* _.isObject(_.noop);
|
|
4970
|
-
* // => true
|
|
4971
|
-
*
|
|
4972
|
-
* _.isObject(null);
|
|
4973
|
-
* // => false
|
|
4974
|
-
*/
|
|
4975
|
-
function isObject(value) {
|
|
4976
|
-
var type = typeof value;
|
|
4977
|
-
return value != null && (type == "object" || type == "function");
|
|
4978
|
-
}
|
|
4979
|
-
|
|
4980
|
-
//#endregion
|
|
4981
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js
|
|
4982
|
-
/** Used as references for various `Number` constants. */
|
|
4983
|
-
var NAN = NaN;
|
|
4984
|
-
/** Used to detect bad signed hexadecimal string values. */
|
|
4985
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
4986
|
-
/** Used to detect binary string values. */
|
|
4987
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
4988
|
-
/** Used to detect octal string values. */
|
|
4989
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
4990
|
-
/** Built-in method references without a dependency on `root`. */
|
|
4991
|
-
var freeParseInt = parseInt;
|
|
4992
|
-
/**
|
|
4993
|
-
* Converts `value` to a number.
|
|
4994
|
-
*
|
|
4995
|
-
* @static
|
|
4996
|
-
* @memberOf _
|
|
4997
|
-
* @since 4.0.0
|
|
4998
|
-
* @category Lang
|
|
4999
|
-
* @param {*} value The value to process.
|
|
5000
|
-
* @returns {number} Returns the number.
|
|
5001
|
-
* @example
|
|
5002
|
-
*
|
|
5003
|
-
* _.toNumber(3.2);
|
|
5004
|
-
* // => 3.2
|
|
5005
|
-
*
|
|
5006
|
-
* _.toNumber(Number.MIN_VALUE);
|
|
5007
|
-
* // => 5e-324
|
|
5008
|
-
*
|
|
5009
|
-
* _.toNumber(Infinity);
|
|
5010
|
-
* // => Infinity
|
|
5011
|
-
*
|
|
5012
|
-
* _.toNumber('3.2');
|
|
5013
|
-
* // => 3.2
|
|
5014
|
-
*/
|
|
5015
|
-
function toNumber(value) {
|
|
5016
|
-
if (typeof value == "number") return value;
|
|
5017
|
-
if (isSymbol(value)) return NAN;
|
|
5018
|
-
if (isObject(value)) {
|
|
5019
|
-
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
5020
|
-
value = isObject(other) ? other + "" : other;
|
|
5021
|
-
}
|
|
5022
|
-
if (typeof value != "string") return value === 0 ? value : +value;
|
|
5023
|
-
value = baseTrim(value);
|
|
5024
|
-
var isBinary = reIsBinary.test(value);
|
|
5025
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
5026
|
-
}
|
|
5027
|
-
|
|
5028
4915
|
//#endregion
|
|
5029
4916
|
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.js
|
|
5030
4917
|
/**
|
|
@@ -5052,158 +4939,6 @@ function toString(value) {
|
|
|
5052
4939
|
return value == null ? "" : baseToString(value);
|
|
5053
4940
|
}
|
|
5054
4941
|
|
|
5055
|
-
//#endregion
|
|
5056
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/now.js
|
|
5057
|
-
/**
|
|
5058
|
-
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
5059
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
5060
|
-
*
|
|
5061
|
-
* @static
|
|
5062
|
-
* @memberOf _
|
|
5063
|
-
* @since 2.4.0
|
|
5064
|
-
* @category Date
|
|
5065
|
-
* @returns {number} Returns the timestamp.
|
|
5066
|
-
* @example
|
|
5067
|
-
*
|
|
5068
|
-
* _.defer(function(stamp) {
|
|
5069
|
-
* console.log(_.now() - stamp);
|
|
5070
|
-
* }, _.now());
|
|
5071
|
-
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
5072
|
-
*/
|
|
5073
|
-
var now = function() {
|
|
5074
|
-
return root.Date.now();
|
|
5075
|
-
};
|
|
5076
|
-
|
|
5077
|
-
//#endregion
|
|
5078
|
-
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/debounce.js
|
|
5079
|
-
/** Error message constants. */
|
|
5080
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
5081
|
-
var nativeMax = Math.max;
|
|
5082
|
-
var nativeMin = Math.min;
|
|
5083
|
-
/**
|
|
5084
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
5085
|
-
* milliseconds have elapsed since the last time the debounced function was
|
|
5086
|
-
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
5087
|
-
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
5088
|
-
* Provide `options` to indicate whether `func` should be invoked on the
|
|
5089
|
-
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
5090
|
-
* with the last arguments provided to the debounced function. Subsequent
|
|
5091
|
-
* calls to the debounced function return the result of the last `func`
|
|
5092
|
-
* invocation.
|
|
5093
|
-
*
|
|
5094
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
5095
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
|
5096
|
-
* is invoked more than once during the `wait` timeout.
|
|
5097
|
-
*
|
|
5098
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
5099
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
5100
|
-
*
|
|
5101
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
5102
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
5103
|
-
*
|
|
5104
|
-
* @static
|
|
5105
|
-
* @memberOf _
|
|
5106
|
-
* @since 0.1.0
|
|
5107
|
-
* @category Function
|
|
5108
|
-
* @param {Function} func The function to debounce.
|
|
5109
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
5110
|
-
* @param {Object} [options={}] The options object.
|
|
5111
|
-
* @param {boolean} [options.leading=false]
|
|
5112
|
-
* Specify invoking on the leading edge of the timeout.
|
|
5113
|
-
* @param {number} [options.maxWait]
|
|
5114
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
5115
|
-
* @param {boolean} [options.trailing=true]
|
|
5116
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
5117
|
-
* @returns {Function} Returns the new debounced function.
|
|
5118
|
-
* @example
|
|
5119
|
-
*
|
|
5120
|
-
* // Avoid costly calculations while the window size is in flux.
|
|
5121
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
5122
|
-
*
|
|
5123
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
5124
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
5125
|
-
* 'leading': true,
|
|
5126
|
-
* 'trailing': false
|
|
5127
|
-
* }));
|
|
5128
|
-
*
|
|
5129
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
5130
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
5131
|
-
* var source = new EventSource('/stream');
|
|
5132
|
-
* jQuery(source).on('message', debounced);
|
|
5133
|
-
*
|
|
5134
|
-
* // Cancel the trailing debounced invocation.
|
|
5135
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
|
5136
|
-
*/
|
|
5137
|
-
function debounce(func, wait, options) {
|
|
5138
|
-
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
5139
|
-
if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
|
|
5140
|
-
wait = toNumber(wait) || 0;
|
|
5141
|
-
if (isObject(options)) {
|
|
5142
|
-
leading = !!options.leading;
|
|
5143
|
-
maxing = "maxWait" in options;
|
|
5144
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
5145
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
5146
|
-
}
|
|
5147
|
-
function invokeFunc(time) {
|
|
5148
|
-
var args = lastArgs, thisArg = lastThis;
|
|
5149
|
-
lastArgs = lastThis = void 0;
|
|
5150
|
-
lastInvokeTime = time;
|
|
5151
|
-
result = func.apply(thisArg, args);
|
|
5152
|
-
return result;
|
|
5153
|
-
}
|
|
5154
|
-
function leadingEdge(time) {
|
|
5155
|
-
lastInvokeTime = time;
|
|
5156
|
-
timerId = setTimeout(timerExpired, wait);
|
|
5157
|
-
return leading ? invokeFunc(time) : result;
|
|
5158
|
-
}
|
|
5159
|
-
function remainingWait(time) {
|
|
5160
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
5161
|
-
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
5162
|
-
}
|
|
5163
|
-
function shouldInvoke(time) {
|
|
5164
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
5165
|
-
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
5166
|
-
}
|
|
5167
|
-
function timerExpired() {
|
|
5168
|
-
var time = now();
|
|
5169
|
-
if (shouldInvoke(time)) return trailingEdge(time);
|
|
5170
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
5171
|
-
}
|
|
5172
|
-
function trailingEdge(time) {
|
|
5173
|
-
timerId = void 0;
|
|
5174
|
-
if (trailing && lastArgs) return invokeFunc(time);
|
|
5175
|
-
lastArgs = lastThis = void 0;
|
|
5176
|
-
return result;
|
|
5177
|
-
}
|
|
5178
|
-
function cancel() {
|
|
5179
|
-
if (timerId !== void 0) clearTimeout(timerId);
|
|
5180
|
-
lastInvokeTime = 0;
|
|
5181
|
-
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
5182
|
-
}
|
|
5183
|
-
function flush() {
|
|
5184
|
-
return timerId === void 0 ? result : trailingEdge(now());
|
|
5185
|
-
}
|
|
5186
|
-
function debounced() {
|
|
5187
|
-
var time = now(), isInvoking = shouldInvoke(time);
|
|
5188
|
-
lastArgs = arguments;
|
|
5189
|
-
lastThis = this;
|
|
5190
|
-
lastCallTime = time;
|
|
5191
|
-
if (isInvoking) {
|
|
5192
|
-
if (timerId === void 0) return leadingEdge(lastCallTime);
|
|
5193
|
-
if (maxing) {
|
|
5194
|
-
clearTimeout(timerId);
|
|
5195
|
-
timerId = setTimeout(timerExpired, wait);
|
|
5196
|
-
return invokeFunc(lastCallTime);
|
|
5197
|
-
}
|
|
5198
|
-
}
|
|
5199
|
-
if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
|
|
5200
|
-
return result;
|
|
5201
|
-
}
|
|
5202
|
-
debounced.cancel = cancel;
|
|
5203
|
-
debounced.flush = flush;
|
|
5204
|
-
return debounced;
|
|
5205
|
-
}
|
|
5206
|
-
|
|
5207
4942
|
//#endregion
|
|
5208
4943
|
//#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toLower.js
|
|
5209
4944
|
/**
|
|
@@ -5232,42 +4967,20 @@ function toLower(value) {
|
|
|
5232
4967
|
}
|
|
5233
4968
|
|
|
5234
4969
|
//#endregion
|
|
5235
|
-
//#region node_modules/.pnpm/tauri-plugin-z9@0.1.
|
|
4970
|
+
//#region node_modules/.pnpm/tauri-plugin-z9@0.1.6/node_modules/tauri-plugin-z9/dist-js/index.mjs
|
|
5236
4971
|
async function minimizeApp() {
|
|
5237
4972
|
return await invoke("plugin:z9|minimize_app");
|
|
5238
4973
|
}
|
|
5239
|
-
async function insets() {
|
|
5240
|
-
return await invoke("plugin:z9|insets");
|
|
5241
|
-
}
|
|
5242
|
-
function mergeInsets(...allInsets) {
|
|
5243
|
-
let top = 0;
|
|
5244
|
-
let bottom = 0;
|
|
5245
|
-
let left = 0;
|
|
5246
|
-
let right = 0;
|
|
5247
|
-
for (const insets of allInsets) {
|
|
5248
|
-
if (!insets) continue;
|
|
5249
|
-
if (insets.top > top) top = insets.top;
|
|
5250
|
-
if (insets.bottom > bottom) bottom = insets.bottom;
|
|
5251
|
-
if (insets.left > left) left = insets.left;
|
|
5252
|
-
if (insets.right > right) right = insets.right;
|
|
5253
|
-
}
|
|
5254
|
-
return {
|
|
5255
|
-
top,
|
|
5256
|
-
bottom,
|
|
5257
|
-
left,
|
|
5258
|
-
right
|
|
5259
|
-
};
|
|
5260
|
-
}
|
|
5261
4974
|
|
|
5262
4975
|
//#endregion
|
|
5263
4976
|
//#region node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/index.d.ts
|
|
5264
4977
|
var [EventType] = [
|
|
5265
|
-
|
|
4978
|
+
71,
|
|
5266
4979
|
() => [],
|
|
5267
4980
|
[]
|
|
5268
4981
|
];
|
|
5269
4982
|
var [Handler] = [
|
|
5270
|
-
|
|
4983
|
+
72,
|
|
5271
4984
|
(T) => [T],
|
|
5272
4985
|
[
|
|
5273
4986
|
"",
|
|
@@ -5276,7 +4989,7 @@ var [Handler] = [
|
|
|
5276
4989
|
]
|
|
5277
4990
|
];
|
|
5278
4991
|
var [WildcardHandler] = [
|
|
5279
|
-
|
|
4992
|
+
73,
|
|
5280
4993
|
(T) => [
|
|
5281
4994
|
Record,
|
|
5282
4995
|
T,
|
|
@@ -5294,7 +5007,7 @@ var [WildcardHandler] = [
|
|
|
5294
5007
|
]
|
|
5295
5008
|
];
|
|
5296
5009
|
var [EventHandlerList] = [
|
|
5297
|
-
|
|
5010
|
+
74,
|
|
5298
5011
|
(T) => [
|
|
5299
5012
|
T,
|
|
5300
5013
|
Handler,
|
|
@@ -5308,7 +5021,7 @@ var [EventHandlerList] = [
|
|
|
5308
5021
|
]
|
|
5309
5022
|
];
|
|
5310
5023
|
var [WildCardEventHandlerList] = [
|
|
5311
|
-
|
|
5024
|
+
75,
|
|
5312
5025
|
(T) => [
|
|
5313
5026
|
Record,
|
|
5314
5027
|
T,
|
|
@@ -5324,7 +5037,7 @@ var [WildCardEventHandlerList] = [
|
|
|
5324
5037
|
]
|
|
5325
5038
|
];
|
|
5326
5039
|
var [EventHandlerMap] = [
|
|
5327
|
-
|
|
5040
|
+
76,
|
|
5328
5041
|
(Events) => [
|
|
5329
5042
|
EventType,
|
|
5330
5043
|
Record,
|
|
@@ -5350,7 +5063,7 @@ var [EventHandlerMap] = [
|
|
|
5350
5063
|
]
|
|
5351
5064
|
];
|
|
5352
5065
|
var [Emitter] = [
|
|
5353
|
-
|
|
5066
|
+
77,
|
|
5354
5067
|
(Key, Events) => [
|
|
5355
5068
|
EventType,
|
|
5356
5069
|
Record,
|
|
@@ -5433,4 +5146,4 @@ var [Emitter] = [
|
|
|
5433
5146
|
];
|
|
5434
5147
|
|
|
5435
5148
|
//#endregion
|
|
5436
|
-
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,7 +44,7 @@
|
|
|
44
44
|
"picomatch": "^4.0.7",
|
|
45
45
|
"rolldown": "^1.2.12",
|
|
46
46
|
"sass": "^1.105.1",
|
|
47
|
-
"tauri-plugin-z9": "^0.1.
|
|
47
|
+
"tauri-plugin-z9": "^0.1.6",
|
|
48
48
|
"tsdown": "^0.23.0",
|
|
49
49
|
"typescript": "^6.0.3",
|
|
50
50
|
"vite": "^8.3.2",
|