x-essential-lib 0.8.7 → 0.8.9

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.
@@ -0,0 +1,204 @@
1
+ import { getCurrentInstance as S, hasInjectionContext as A, inject as x, watch as W, getCurrentScope as b, onScopeDispose as k, shallowRef as L, watchEffect as I, toValue as d, computed as y, onMounted as E, unref as H } from "vue";
2
+ function O(e) {
3
+ return b() ? (k(e), !0) : !1;
4
+ }
5
+ const C = /* @__PURE__ */ new WeakMap(), R = (...e) => {
6
+ var n;
7
+ const t = e[0], o = (n = S()) == null ? void 0 : n.proxy;
8
+ if (o == null && !A())
9
+ throw new Error("injectLocal must be called in setup");
10
+ return o && C.has(o) && t in C.get(o) ? C.get(o)[t] : x(...e);
11
+ }, D = typeof window < "u" && typeof document < "u";
12
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
+ const U = Object.prototype.toString, B = (e) => U.call(e) === "[object Object]";
14
+ function w(e) {
15
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
16
+ }
17
+ function M(e) {
18
+ return Array.isArray(e) ? e : [e];
19
+ }
20
+ function V(e, n, t) {
21
+ return W(
22
+ e,
23
+ n,
24
+ {
25
+ ...t,
26
+ immediate: !0
27
+ }
28
+ );
29
+ }
30
+ const j = D ? window : void 0;
31
+ function F(e) {
32
+ var n;
33
+ const t = d(e);
34
+ return (n = t == null ? void 0 : t.$el) != null ? n : t;
35
+ }
36
+ function Z(...e) {
37
+ const n = [], t = () => {
38
+ n.forEach((i) => i()), n.length = 0;
39
+ }, o = (i, c, s, a) => (i.addEventListener(c, s, a), () => i.removeEventListener(c, s, a)), r = y(() => {
40
+ const i = M(d(e[0])).filter((c) => c != null);
41
+ return i.every((c) => typeof c != "string") ? i : void 0;
42
+ }), l = V(
43
+ () => {
44
+ var i, c;
45
+ return [
46
+ (c = (i = r.value) == null ? void 0 : i.map((s) => F(s))) != null ? c : [j].filter((s) => s != null),
47
+ M(d(r.value ? e[1] : e[0])),
48
+ M(H(r.value ? e[2] : e[1])),
49
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
50
+ d(r.value ? e[3] : e[2])
51
+ ];
52
+ },
53
+ ([i, c, s, a]) => {
54
+ if (t(), !(i != null && i.length) || !(c != null && c.length) || !(s != null && s.length))
55
+ return;
56
+ const m = B(a) ? { ...a } : a;
57
+ n.push(
58
+ ...i.flatMap(
59
+ (p) => c.flatMap(
60
+ (v) => s.map((f) => o(p, v, f, m))
61
+ )
62
+ )
63
+ );
64
+ },
65
+ { flush: "post" }
66
+ ), u = () => {
67
+ l(), t();
68
+ };
69
+ return O(t), u;
70
+ }
71
+ function z() {
72
+ const e = L(!1), n = S();
73
+ return n && E(() => {
74
+ e.value = !0;
75
+ }, n), e;
76
+ }
77
+ function P(e) {
78
+ const n = z();
79
+ return y(() => (n.value, !!e()));
80
+ }
81
+ const T = Symbol("vueuse-ssr-width");
82
+ function G() {
83
+ const e = A() ? R(T, null) : null;
84
+ return typeof e == "number" ? e : void 0;
85
+ }
86
+ function Q(e, n = {}) {
87
+ const { window: t = j, ssrWidth: o = G() } = n, r = P(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), l = L(typeof o == "number"), u = L(), i = L(!1), c = (s) => {
88
+ i.value = s.matches;
89
+ };
90
+ return I(() => {
91
+ if (l.value) {
92
+ l.value = !r.value;
93
+ const s = d(e).split(",");
94
+ i.value = s.some((a) => {
95
+ const m = a.includes("not all"), p = a.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), v = a.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
96
+ let f = !!(p || v);
97
+ return p && f && (f = o >= w(p[1])), v && f && (f = o <= w(v[1])), m ? !f : f;
98
+ });
99
+ return;
100
+ }
101
+ r.value && (u.value = t.matchMedia(d(e)), i.value = u.value.matches);
102
+ }), Z(u, "change", c, { passive: !0 }), y(() => i.value);
103
+ }
104
+ function K(e) {
105
+ return Q("(prefers-color-scheme: dark)", e);
106
+ }
107
+ /*! js-cookie v3.0.5 | MIT */
108
+ function h(e) {
109
+ for (var n = 1; n < arguments.length; n++) {
110
+ var t = arguments[n];
111
+ for (var o in t)
112
+ e[o] = t[o];
113
+ }
114
+ return e;
115
+ }
116
+ var $ = {
117
+ read: function(e) {
118
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
119
+ },
120
+ write: function(e) {
121
+ return encodeURIComponent(e).replace(
122
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
123
+ decodeURIComponent
124
+ );
125
+ }
126
+ };
127
+ function g(e, n) {
128
+ function t(r, l, u) {
129
+ if (!(typeof document > "u")) {
130
+ u = h({}, n, u), typeof u.expires == "number" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
131
+ var i = "";
132
+ for (var c in u)
133
+ u[c] && (i += "; " + c, u[c] !== !0 && (i += "=" + u[c].split(";")[0]));
134
+ return document.cookie = r + "=" + e.write(l, r) + i;
135
+ }
136
+ }
137
+ function o(r) {
138
+ if (!(typeof document > "u" || arguments.length && !r)) {
139
+ for (var l = document.cookie ? document.cookie.split("; ") : [], u = {}, i = 0; i < l.length; i++) {
140
+ var c = l[i].split("="), s = c.slice(1).join("=");
141
+ try {
142
+ var a = decodeURIComponent(c[0]);
143
+ if (u[a] = e.read(s, a), r === a)
144
+ break;
145
+ } catch {
146
+ }
147
+ }
148
+ return r ? u[r] : u;
149
+ }
150
+ }
151
+ return Object.create(
152
+ {
153
+ set: t,
154
+ get: o,
155
+ remove: function(r, l) {
156
+ t(
157
+ r,
158
+ "",
159
+ h({}, l, {
160
+ expires: -1
161
+ })
162
+ );
163
+ },
164
+ withAttributes: function(r) {
165
+ return g(this.converter, h({}, this.attributes, r));
166
+ },
167
+ withConverter: function(r) {
168
+ return g(h({}, this.converter, r), this.attributes);
169
+ }
170
+ },
171
+ {
172
+ attributes: { value: Object.freeze(n) },
173
+ converter: { value: Object.freeze(e) }
174
+ }
175
+ );
176
+ }
177
+ var X = g($, { path: "/" });
178
+ function Y(e) {
179
+ return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
180
+ var o = e.get(n);
181
+ o ? o.push(t) : e.set(n, [t]);
182
+ }, off: function(n, t) {
183
+ var o = e.get(n);
184
+ o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(n, []));
185
+ }, emit: function(n, t) {
186
+ var o = e.get(n);
187
+ o && o.slice().map(function(r) {
188
+ r(t);
189
+ }), (o = e.get("*")) && o.slice().map(function(r) {
190
+ r(n, t);
191
+ });
192
+ } };
193
+ }
194
+ var N = "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z", q = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z", _ = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", ee = "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z", ne = "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
195
+ export {
196
+ X as a,
197
+ N as b,
198
+ ee as c,
199
+ ne as d,
200
+ q as e,
201
+ _ as f,
202
+ Y as m,
203
+ K as u
204
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.8.7",
4
+ "version": "0.8.9",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -22,36 +22,36 @@
22
22
  "*": "prettier --write ."
23
23
  },
24
24
  "dependencies": {
25
- "@vueuse/core": "^13.0.0",
26
- "axios": "^1.8.4",
25
+ "@vueuse/core": "^13.1.0",
26
+ "axios": "^1.9.0",
27
27
  "js-cookie": "^3.0.5",
28
28
  "mitt": "^3.0.1",
29
29
  "vue": "^3.5.13",
30
30
  "vue-i18n": "^11.1.3",
31
- "vue-router": "^4.5.0",
32
- "vuetify": "^3.8.1"
31
+ "vue-router": "^4.5.1",
32
+ "vuetify": "^3.8.4"
33
33
  },
34
34
  "devDependencies": {
35
- "@eslint/js": "^9.24.0",
35
+ "@eslint/js": "^9.26.0",
36
36
  "@mdi/js": "^7.4.47",
37
37
  "@types/js-cookie": "^3.0.6",
38
- "@types/node": "^22.14.0",
39
- "@vitejs/plugin-vue": "^5.2.3",
40
- "eslint": "^9.24.0",
41
- "eslint-config-prettier": "^10.1.1",
42
- "eslint-plugin-prettier": "^5.2.6",
43
- "eslint-plugin-vue": "^10.0.0",
44
- "globals": "^16.0.0",
38
+ "@types/node": "^22.15.17",
39
+ "@vitejs/plugin-vue": "^5.2.4",
40
+ "eslint": "^9.26.0",
41
+ "eslint-config-prettier": "^10.1.5",
42
+ "eslint-plugin-prettier": "^5.4.0",
43
+ "eslint-plugin-vue": "^10.1.0",
44
+ "globals": "^16.1.0",
45
45
  "husky": "^9.1.7",
46
- "lint-staged": "^15.5.0",
46
+ "lint-staged": "^15.5.2",
47
47
  "prettier": "3.5.3",
48
- "sass": "^1.86.3",
48
+ "sass": "^1.87.0",
49
49
  "typescript": "^5.8.3",
50
- "typescript-eslint": "^8.29.1",
51
- "vite": "^6.2.5",
50
+ "typescript-eslint": "^8.32.0",
51
+ "vite": "^6.3.5",
52
52
  "vite-plugin-css-injected-by-js": "^3.5.2",
53
53
  "vite-plugin-vuetify": "^2.1.1",
54
54
  "vue-eslint-parser": "^10.1.3",
55
- "vue-tsc": "^2.2.8"
55
+ "vue-tsc": "^2.2.10"
56
56
  }
57
57
  }