x-essential-lib 0.11.11 → 0.11.13
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 +2 -2
- package/dist/index.js +15 -17
- package/dist/{vendor.kpti1e1f.js → vendor.hsixv85u.js} +55 -5
- package/package.json +20 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as EventType, t as Emitter } from "./vendor.
|
|
1
|
+
import { n as EventType, t as Emitter } from "./vendor.hsixv85u.js";
|
|
2
2
|
import { Ref } from "vue";
|
|
3
3
|
import { VuetifyOptions } from "vuetify";
|
|
4
4
|
import { AxiosInstance } from "axios";
|
|
@@ -185,7 +185,7 @@ export declare function useSystem(): {
|
|
|
185
185
|
isMobile: () => boolean;
|
|
186
186
|
compactWidth: import("vue").ComputedRef<string>;
|
|
187
187
|
minimizeApp: () => Promise<void>;
|
|
188
|
-
|
|
188
|
+
safeAreaInsets: {
|
|
189
189
|
top: number;
|
|
190
190
|
bottom: number;
|
|
191
191
|
left: number;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
2
|
+
import { a as minimizeApp, c as isTauri, d as string, f as api, i as mergeInsets, l as custom, m as usePreferredDark, o as toLower, p as mitt_default, r as insets, s as debounce, u as email$1 } from "./vendor.hsixv85u.js";
|
|
3
3
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, 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";
|
|
@@ -702,35 +702,33 @@ function useSystem() {
|
|
|
702
702
|
else if (display.width.value <= 1920) return "768px";
|
|
703
703
|
else return "1024px";
|
|
704
704
|
});
|
|
705
|
-
async function minimizeApp() {
|
|
705
|
+
async function minimizeApp$1() {
|
|
706
706
|
navigator.Backbutton?.goHome(() => {}, () => {});
|
|
707
|
-
|
|
707
|
+
if (isTauri()) await minimizeApp();
|
|
708
708
|
}
|
|
709
|
-
const
|
|
709
|
+
const safeAreaInsets = reactive({
|
|
710
710
|
top: 0,
|
|
711
711
|
bottom: 0,
|
|
712
712
|
left: 0,
|
|
713
713
|
right: 0
|
|
714
714
|
});
|
|
715
|
-
function
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
safeAreaInset.left = getSafeAreaVar("--safe-area-inset-left");
|
|
723
|
-
safeAreaInset.right = getSafeAreaVar("--safe-area-inset-right");
|
|
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;
|
|
724
722
|
}
|
|
725
723
|
const handleResize = debounce(() => {
|
|
726
|
-
|
|
724
|
+
syncInsets();
|
|
727
725
|
}, 250);
|
|
728
726
|
function onResize() {
|
|
729
727
|
handleResize();
|
|
730
728
|
}
|
|
731
729
|
onMounted(() => {
|
|
732
730
|
window.addEventListener("resize", onResize);
|
|
733
|
-
|
|
731
|
+
syncInsets();
|
|
734
732
|
});
|
|
735
733
|
onUnmounted(() => {
|
|
736
734
|
window.removeEventListener("resize", onResize);
|
|
@@ -759,8 +757,8 @@ function useSystem() {
|
|
|
759
757
|
return {
|
|
760
758
|
isMobile,
|
|
761
759
|
compactWidth,
|
|
762
|
-
minimizeApp,
|
|
763
|
-
|
|
760
|
+
minimizeApp: minimizeApp$1,
|
|
761
|
+
safeAreaInsets,
|
|
764
762
|
nameList,
|
|
765
763
|
sentenceOfAsk
|
|
766
764
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, computed, defineComponent, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isRef, onBeforeMount, onBeforeUnmount, onMounted, onUnmounted, provide, reactive, ref, shallowRef, toValue, unref, watch, watchEffect } from "vue";
|
|
2
2
|
|
|
3
|
-
//#region node_modules/.pnpm/@vueuse+shared@
|
|
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();
|
|
5
5
|
/**
|
|
6
6
|
* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
|
|
@@ -11,9 +11,9 @@ const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
|
11
11
|
* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
14
|
+
* @NO_SIDE_EFFECTS
|
|
15
15
|
*/
|
|
16
|
-
const injectLocal = (...args) => {
|
|
16
|
+
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
17
17
|
var _getCurrentInstance;
|
|
18
18
|
const key = args[0];
|
|
19
19
|
const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
|
|
@@ -60,7 +60,7 @@ function watchImmediate(source, cb, options) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
|
-
//#region node_modules/.pnpm/@vueuse+core@
|
|
63
|
+
//#region node_modules/.pnpm/@vueuse+core@15.0.0_vue@3.5.43_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
|
|
64
64
|
const defaultWindow = isClient ? window : void 0;
|
|
65
65
|
const defaultDocument = isClient ? window.document : void 0;
|
|
66
66
|
const defaultNavigator = isClient ? window.navigator : void 0;
|
|
@@ -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
|
|
@@ -5209,6 +5231,34 @@ function toLower(value) {
|
|
|
5209
5231
|
return toString(value).toLowerCase();
|
|
5210
5232
|
}
|
|
5211
5233
|
|
|
5234
|
+
//#endregion
|
|
5235
|
+
//#region node_modules/.pnpm/tauri-plugin-z9@0.1.4/node_modules/tauri-plugin-z9/dist-js/index.mjs
|
|
5236
|
+
async function minimizeApp() {
|
|
5237
|
+
return await invoke("plugin:z9|minimize_app");
|
|
5238
|
+
}
|
|
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
|
+
|
|
5212
5262
|
//#endregion
|
|
5213
5263
|
//#region node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/index.d.ts
|
|
5214
5264
|
var [EventType] = [
|
|
@@ -5383,4 +5433,4 @@ var [Emitter] = [
|
|
|
5383
5433
|
];
|
|
5384
5434
|
|
|
5385
5435
|
//#endregion
|
|
5386
|
-
export {
|
|
5436
|
+
export { minimizeApp as a, isTauri as c, string as d, api as f, mergeInsets as i, custom as l, usePreferredDark as m, EventType as n, toLower as o, mitt_default as p, insets as r, debounce as s, Emitter as t, email 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.13",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"lint": "oxlint",
|
|
23
23
|
"fmt": "oxfmt",
|
|
24
24
|
"build": "tsdown",
|
|
25
|
+
"ncu:check": "ncu --dep dev,peer -x typescript",
|
|
26
|
+
"ncu:update": "ncu --dep dev,peer -x typescript -u",
|
|
25
27
|
"lint-staged": "lint-staged",
|
|
26
28
|
"prepare": "husky"
|
|
27
29
|
},
|
|
@@ -29,33 +31,34 @@
|
|
|
29
31
|
"@tauri-apps/api": "^2.12.1",
|
|
30
32
|
"@types/js-cookie": "^3.0.6",
|
|
31
33
|
"@types/lodash-es": "^4.17.12",
|
|
32
|
-
"@types/node": "^26.
|
|
33
|
-
"@vueuse/core": "^
|
|
34
|
+
"@types/node": "^26.6.4",
|
|
35
|
+
"@vueuse/core": "^15.0.0",
|
|
34
36
|
"husky": "^9.1.7",
|
|
35
37
|
"js-cookie": "^3.0.8",
|
|
36
|
-
"lint-staged": "^17.
|
|
38
|
+
"lint-staged": "^17.6.0",
|
|
37
39
|
"lodash-es": "^4.18.1",
|
|
38
40
|
"mitt": "^3.0.1",
|
|
39
|
-
"oxfmt": "^0.
|
|
40
|
-
"oxlint": "^1.
|
|
41
|
-
"oxlint-tsgolint": "^7.0.
|
|
41
|
+
"oxfmt": "^0.71.0",
|
|
42
|
+
"oxlint": "^1.86.0",
|
|
43
|
+
"oxlint-tsgolint": "^7.0.2003",
|
|
42
44
|
"picomatch": "^4.0.7",
|
|
43
|
-
"rolldown": "^1.2.
|
|
44
|
-
"sass": "^1.
|
|
45
|
+
"rolldown": "^1.2.12",
|
|
46
|
+
"sass": "^1.105.1",
|
|
47
|
+
"tauri-plugin-z9": "^0.1.4",
|
|
45
48
|
"tsdown": "^0.23.0",
|
|
46
49
|
"typescript": "^6.0.3",
|
|
47
|
-
"vite": "^8.3.
|
|
48
|
-
"vue-tsc": "^3.3.
|
|
49
|
-
"x-config-lib": "^0.1.
|
|
50
|
-
"x-config-oxfmt": "^0.1.
|
|
51
|
-
"x-config-oxlint": "^0.1.
|
|
50
|
+
"vite": "^8.3.2",
|
|
51
|
+
"vue-tsc": "^3.3.12",
|
|
52
|
+
"x-config-lib": "^0.1.11",
|
|
53
|
+
"x-config-oxfmt": "^0.1.7",
|
|
54
|
+
"x-config-oxlint": "^0.1.8",
|
|
52
55
|
"zod": "^4.6.5"
|
|
53
56
|
},
|
|
54
57
|
"peerDependencies": {
|
|
55
58
|
"axios": "^1.20.0",
|
|
56
|
-
"vue": "^3.5.
|
|
57
|
-
"vue-i18n": "^11.4.
|
|
59
|
+
"vue": "^3.5.43",
|
|
60
|
+
"vue-i18n": "^11.4.13",
|
|
58
61
|
"vue-router": "^5.3.1",
|
|
59
|
-
"vuetify": "^4.2.
|
|
62
|
+
"vuetify": "^4.2.3"
|
|
60
63
|
}
|
|
61
64
|
}
|