@citruslime/vue-utils 1.2.1 → 1.3.0-beta.0

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.
@@ -1,102 +1,110 @@
1
- import { replacePlaceholders as te } from "@citruslime/utils";
2
- import { computed as ce, ref as D, readonly as ye, unref as he, getCurrentScope as me, onScopeDispose as Oe, watch as G, isRef as fe, shallowRef as M, reactive as ve, toRefs as we } from "vue";
3
- const Je = [
1
+ import { replacePlaceholders as Y } from "@citruslime/utils";
2
+ import { toRef as se, readonly as re, customRef as le, ref as $, getCurrentScope as ce, onScopeDispose as fe, unref as de, watch as I, isRef as oe, shallowRef as q, computed as pe, reactive as he, toRefs as me } from "vue";
3
+ const He = [
4
4
  "GET",
5
5
  "POST",
6
6
  "PUT",
7
7
  "DELETE"
8
8
  ];
9
- function Ke(e, t, n = null, s = null) {
9
+ function $e(e, t, n = null, s = null) {
10
10
  return {
11
11
  url: e,
12
12
  type: t,
13
- headers: n ?? de,
14
- hasBody: ge(t, s)
13
+ headers: n ?? ae,
14
+ hasBody: ye(t, s)
15
15
  };
16
16
  }
17
- function de() {
17
+ function ae() {
18
18
  return {
19
19
  accept: "application/json",
20
20
  "content-type": "application/json"
21
21
  };
22
22
  }
23
- function ge(e, t) {
23
+ function ye(e, t) {
24
24
  return !!(t === null && (e === "PUT" || e === "POST") || t);
25
25
  }
26
- var ne;
27
- const X = typeof window < "u";
28
- X && ((ne = window == null ? void 0 : window.navigator) != null && ne.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
29
- function E(e) {
30
- return typeof e == "function" ? e() : he(e);
31
- }
32
- function re(e, t = !1, n = "Timeout") {
33
- return new Promise((s, a) => {
34
- setTimeout(t ? () => a(n) : s, e);
35
- });
36
- }
37
- function be(e) {
38
- return e;
39
- }
40
- function Pe(e, ...t) {
41
- return t.some((n) => n in e);
42
- }
43
- function pe(e) {
44
- return me() ? (Oe(e), !0) : !1;
26
+ function ie(e) {
27
+ return ce() ? (fe(e), !0) : !1;
45
28
  }
46
- function W() {
47
- const e = [], t = (a) => {
48
- const r = e.indexOf(a);
49
- r !== -1 && e.splice(r, 1);
29
+ function L() {
30
+ const e = /* @__PURE__ */ new Set(), t = (a) => {
31
+ e.delete(a);
50
32
  };
51
33
  return {
52
34
  on: (a) => {
53
- e.push(a);
35
+ e.add(a);
54
36
  const r = () => t(a);
55
- return pe(r), {
37
+ return ie(r), {
56
38
  off: r
57
39
  };
58
40
  },
59
41
  off: t,
60
- trigger: (a) => {
61
- e.forEach((r) => r(a));
62
- }
42
+ trigger: (a) => Promise.all(Array.from(e).map((r) => r(a)))
63
43
  };
64
44
  }
65
- function V(e) {
66
- return typeof e == "function" ? ce(e) : D(e);
45
+ function O(e) {
46
+ return typeof e == "function" ? e() : de(e);
67
47
  }
68
- function q(e, t = !1) {
69
- function n(i, { flush: u = "sync", deep: h = !1, timeout: d, throwOnTimeout: F } = {}) {
70
- let p = null;
71
- const N = [new Promise((I) => {
72
- p = G(e, (j) => {
73
- i(j) !== t && (p == null || p(), I(j));
74
- }, {
75
- flush: u,
76
- deep: h,
77
- immediate: !0
78
- });
48
+ const ue = typeof window < "u", ve = () => {
49
+ };
50
+ function Z(e, t = !1, n = "Timeout") {
51
+ return new Promise((s, a) => {
52
+ setTimeout(t ? () => a(n) : s, e);
53
+ });
54
+ }
55
+ function we(e, ...t) {
56
+ return t.some((n) => n in e);
57
+ }
58
+ function R(...e) {
59
+ if (e.length !== 1)
60
+ return se(...e);
61
+ const t = e[0];
62
+ return typeof t == "function" ? re(le(() => ({ get: t, set: ve }))) : $(t);
63
+ }
64
+ function k(e, t = !1) {
65
+ function n(i, { flush: u = "sync", deep: h = !1, timeout: p, throwOnTimeout: F } = {}) {
66
+ let y = null;
67
+ const D = [new Promise((E) => {
68
+ y = I(
69
+ e,
70
+ (_) => {
71
+ i(_) !== t && (y == null || y(), E(_));
72
+ },
73
+ {
74
+ flush: u,
75
+ deep: h,
76
+ immediate: !0
77
+ }
78
+ );
79
79
  })];
80
- return d != null && N.push(re(d, F).then(() => E(e)).finally(() => p == null ? void 0 : p())), Promise.race(N);
80
+ return p != null && D.push(
81
+ Z(p, F).then(() => O(e)).finally(() => y == null ? void 0 : y())
82
+ ), Promise.race(D);
81
83
  }
82
84
  function s(i, u) {
83
- if (!fe(i))
84
- return n((j) => j === i, u);
85
- const { flush: h = "sync", deep: d = !1, timeout: F, throwOnTimeout: p } = u ?? {};
86
- let v = null;
87
- const I = [new Promise((j) => {
88
- v = G([e, i], ([P, S]) => {
89
- t !== (P === S) && (v == null || v(), j(P));
90
- }, {
91
- flush: h,
92
- deep: d,
93
- immediate: !0
94
- });
85
+ if (!oe(i))
86
+ return n((_) => _ === i, u);
87
+ const { flush: h = "sync", deep: p = !1, timeout: F, throwOnTimeout: y } = u ?? {};
88
+ let w = null;
89
+ const E = [new Promise((_) => {
90
+ w = I(
91
+ [e, i],
92
+ ([j, S]) => {
93
+ t !== (j === S) && (w == null || w(), _(j));
94
+ },
95
+ {
96
+ flush: h,
97
+ deep: p,
98
+ immediate: !0
99
+ }
100
+ );
95
101
  })];
96
- return F != null && I.push(re(F, p).then(() => E(e)).finally(() => (v == null || v(), E(e)))), Promise.race(I);
102
+ return F != null && E.push(
103
+ Z(F, y).then(() => O(e)).finally(() => (w == null || w(), O(e)))
104
+ ), Promise.race(E);
97
105
  }
98
106
  function a(i) {
99
- return n((u) => Boolean(u), i);
107
+ return n((u) => !!u, i);
100
108
  }
101
109
  function r(i) {
102
110
  return s(null, i);
@@ -104,91 +112,89 @@ function q(e, t = !1) {
104
112
  function o(i) {
105
113
  return s(void 0, i);
106
114
  }
107
- function g(i) {
115
+ function b(i) {
108
116
  return n(Number.isNaN, i);
109
117
  }
110
- function y(i, u) {
118
+ function d(i, u) {
111
119
  return n((h) => {
112
- const d = Array.from(h);
113
- return d.includes(i) || d.includes(E(i));
120
+ const p = Array.from(h);
121
+ return p.includes(i) || p.includes(O(i));
114
122
  }, u);
115
123
  }
116
- function O(i) {
117
- return b(1, i);
124
+ function v(i) {
125
+ return g(1, i);
118
126
  }
119
- function b(i = 1, u) {
127
+ function g(i = 1, u) {
120
128
  let h = -1;
121
129
  return n(() => (h += 1, h >= i), u);
122
130
  }
123
- return Array.isArray(E(e)) ? {
131
+ return Array.isArray(O(e)) ? {
124
132
  toMatch: n,
125
- toContains: y,
126
- changed: O,
127
- changedTimes: b,
133
+ toContains: d,
134
+ changed: v,
135
+ changedTimes: g,
128
136
  get not() {
129
- return q(e, !t);
137
+ return k(e, !t);
130
138
  }
131
139
  } : {
132
140
  toMatch: n,
133
141
  toBe: s,
134
142
  toBeTruthy: a,
135
143
  toBeNull: r,
136
- toBeNaN: g,
144
+ toBeNaN: b,
137
145
  toBeUndefined: o,
138
- changed: O,
139
- changedTimes: b,
146
+ changed: v,
147
+ changedTimes: g,
140
148
  get not() {
141
- return q(e, !t);
149
+ return k(e, !t);
142
150
  }
143
151
  };
144
152
  }
145
- function Te(e) {
146
- return q(e);
153
+ function Pe(e) {
154
+ return k(e);
147
155
  }
148
- function _e(e, t, n = {}) {
156
+ function be(e, t, n = {}) {
149
157
  const {
150
158
  immediate: s = !0
151
- } = n, a = D(!1);
159
+ } = n, a = $(!1);
152
160
  let r = null;
153
161
  function o() {
154
162
  r && (clearTimeout(r), r = null);
155
163
  }
156
- function g() {
164
+ function b() {
157
165
  a.value = !1, o();
158
166
  }
159
- function y(...O) {
167
+ function d(...v) {
160
168
  o(), a.value = !0, r = setTimeout(() => {
161
- a.value = !1, r = null, e(...O);
162
- }, E(t));
169
+ a.value = !1, r = null, e(...v);
170
+ }, O(t));
163
171
  }
164
- return s && (a.value = !0, X && y()), pe(g), {
165
- isPending: ye(a),
166
- start: y,
167
- stop: g
172
+ return s && (a.value = !0, ue && d()), ie(b), {
173
+ isPending: re(a),
174
+ start: d,
175
+ stop: b
168
176
  };
169
177
  }
170
- const Ee = X ? window : void 0, z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, R = "__vueuse_ssr_handlers__";
171
- z[R] = z[R] || {};
172
- z[R];
173
- var Fe = Object.defineProperty, Ie = Object.defineProperties, je = Object.getOwnPropertyDescriptors, oe = Object.getOwnPropertySymbols, Ne = Object.prototype.hasOwnProperty, Se = Object.prototype.propertyIsEnumerable, ae = (e, t, n) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
178
+ const ge = ue ? window : void 0;
179
+ var Te = Object.defineProperty, Oe = Object.defineProperties, Fe = Object.getOwnPropertyDescriptors, ee = Object.getOwnPropertySymbols, Ee = Object.prototype.hasOwnProperty, _e = Object.prototype.propertyIsEnumerable, te = (e, t, n) => t in e ? Te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
174
180
  for (var n in t || (t = {}))
175
- Ne.call(t, n) && ae(e, n, t[n]);
176
- if (oe)
177
- for (var n of oe(t))
178
- Se.call(t, n) && ae(e, n, t[n]);
181
+ Ee.call(t, n) && te(e, n, t[n]);
182
+ if (ee)
183
+ for (var n of ee(t))
184
+ _e.call(t, n) && te(e, n, t[n]);
179
185
  return e;
180
- }, H = (e, t) => Ie(e, je(t));
181
- const Be = {
186
+ }, N = (e, t) => Oe(e, Fe(t));
187
+ const je = {
182
188
  json: "application/json",
183
189
  text: "text/plain"
184
190
  };
185
- function ie(e) {
186
- return e && Pe(e, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch");
191
+ function ne(e) {
192
+ return e && we(e, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch");
187
193
  }
188
- function k(e) {
194
+ function W(e) {
189
195
  return typeof Headers < "u" && e instanceof Headers ? Object.fromEntries([...e.entries()]) : e;
190
196
  }
191
- function Ce(e, ...t) {
197
+ function De(e, ...t) {
192
198
  var n;
193
199
  const s = typeof AbortController == "function";
194
200
  let a = {}, r = { immediate: !0, refetch: !1, timeout: 0 };
@@ -197,191 +203,163 @@ function Ce(e, ...t) {
197
203
  type: "text",
198
204
  payload: void 0
199
205
  };
200
- t.length > 0 && (ie(t[0]) ? r = f(f({}, r), t[0]) : a = t[0]), t.length > 1 && ie(t[1]) && (r = f(f({}, r), t[1]));
206
+ t.length > 0 && (ne(t[0]) ? r = f(f({}, r), t[0]) : a = t[0]), t.length > 1 && ne(t[1]) && (r = f(f({}, r), t[1]));
201
207
  const {
202
- fetch: g = (n = Ee) == null ? void 0 : n.fetch,
203
- initialData: y,
204
- timeout: O
205
- } = r, b = W(), i = W(), u = W(), h = D(!1), d = D(!1), F = D(!1), p = D(null), v = M(null), N = M(null), I = M(y), j = ce(() => s && d.value);
206
- let P, S;
207
- const J = () => {
208
- s && P && (P.abort(), P = void 0);
208
+ fetch: b = (n = ge) == null ? void 0 : n.fetch,
209
+ initialData: d,
210
+ timeout: v
211
+ } = r, g = L(), i = L(), u = L(), h = $(!1), p = $(!1), F = $(!1), y = $(null), w = q(null), D = q(null), E = q(d || null), _ = pe(() => s && p.value);
212
+ let j, S;
213
+ const M = () => {
214
+ s && (j == null || j.abort(), j = new AbortController(), j.signal.onabort = () => F.value = !0, a = N(f({}, a), {
215
+ signal: j.signal
216
+ }));
209
217
  }, K = (l) => {
210
- d.value = l, h.value = !l;
218
+ p.value = l, h.value = !l;
211
219
  };
212
- O && (S = _e(J, O, { immediate: !1 }));
213
- const $ = async (l = !1) => {
214
- var w;
215
- K(!0), N.value = null, p.value = null, F.value = !1, s && (J(), P = new AbortController(), P.signal.onabort = () => F.value = !0, a = H(f({}, a), {
216
- signal: P.signal
217
- }));
220
+ v && (S = be(M, v, { immediate: !1 }));
221
+ const U = async (l = !1) => {
222
+ var P;
223
+ M(), K(!0), D.value = null, y.value = null, F.value = !1;
218
224
  const m = {
219
225
  method: o.method,
220
226
  headers: {}
221
227
  };
222
228
  if (o.payload) {
223
- const Q = k(m.headers);
224
- o.payloadType && (Q["Content-Type"] = (w = Be[o.payloadType]) != null ? w : o.payloadType);
225
- const U = E(o.payload);
226
- m.body = o.payloadType === "json" ? JSON.stringify(U) : U;
229
+ const J = W(m.headers);
230
+ o.payloadType && (J["Content-Type"] = (P = je[o.payloadType]) != null ? P : o.payloadType);
231
+ const G = O(o.payload);
232
+ m.body = o.payloadType === "json" ? JSON.stringify(G) : G;
227
233
  }
228
- let C = !1;
234
+ let H = !1;
229
235
  const T = {
230
- url: E(e),
236
+ url: O(e),
231
237
  options: f(f({}, m), a),
232
238
  cancel: () => {
233
- C = !0;
239
+ H = !0;
234
240
  }
235
241
  };
236
- if (r.beforeFetch && Object.assign(T, await r.beforeFetch(T)), C || !g)
242
+ if (r.beforeFetch && Object.assign(T, await r.beforeFetch(T)), H || !b)
237
243
  return K(!1), Promise.resolve(null);
238
- let _ = null;
239
- return S && S.start(), new Promise((Q, U) => {
240
- var Z;
241
- g(T.url, H(f(f({}, m), T.options), {
242
- headers: f(f({}, k(m.headers)), k((Z = T.options) == null ? void 0 : Z.headers))
243
- })).then(async (c) => {
244
- if (v.value = c, p.value = c.status, _ = await c[o.type](), r.afterFetch && p.value >= 200 && p.value < 300 && ({ data: _ } = await r.afterFetch({ data: _, response: c })), I.value = _, !c.ok)
245
- throw new Error(c.statusText);
246
- return b.trigger(c), Q(c);
244
+ let B = null;
245
+ return S && S.start(), new Promise((J, G) => {
246
+ var Q;
247
+ b(
248
+ T.url,
249
+ N(f(f({}, m), T.options), {
250
+ headers: f(f({}, W(m.headers)), W((Q = T.options) == null ? void 0 : Q.headers))
251
+ })
252
+ ).then(async (c) => {
253
+ if (w.value = c, y.value = c.status, B = await c[o.type](), !c.ok)
254
+ throw E.value = d || null, new Error(c.statusText);
255
+ return r.afterFetch && ({ data: B } = await r.afterFetch({ data: B, response: c })), E.value = B, g.trigger(c), J(c);
247
256
  }).catch(async (c) => {
248
- let ee = c.message || c.name;
249
- return r.onFetchError && ({ data: _, error: ee } = await r.onFetchError({ data: _, error: c, response: v.value })), I.value = _, N.value = ee, i.trigger(c), l ? U(c) : Q(null);
257
+ let X = c.message || c.name;
258
+ return r.onFetchError && ({ error: X } = await r.onFetchError({ data: B, error: c, response: w.value })), D.value = X, i.trigger(c), l ? G(c) : J(null);
250
259
  }).finally(() => {
251
260
  K(!1), S && S.stop(), u.trigger(null);
252
261
  });
253
262
  });
254
- }, Y = V(r.refetch);
255
- G([
256
- Y,
257
- V(e)
258
- ], ([l]) => l && $(), { deep: !0 });
263
+ }, z = R(r.refetch);
264
+ I(
265
+ [
266
+ z,
267
+ R(e)
268
+ ],
269
+ ([l]) => l && U(),
270
+ { deep: !0 }
271
+ );
259
272
  const x = {
260
273
  isFinished: h,
261
- statusCode: p,
262
- response: v,
263
- error: N,
264
- data: I,
265
- isFetching: d,
266
- canAbort: j,
274
+ statusCode: y,
275
+ response: w,
276
+ error: D,
277
+ data: E,
278
+ isFetching: p,
279
+ canAbort: _,
267
280
  aborted: F,
268
- abort: J,
269
- execute: $,
270
- onFetchResponse: b.on,
281
+ abort: M,
282
+ execute: U,
283
+ onFetchResponse: g.on,
271
284
  onFetchError: i.on,
272
285
  onFetchFinally: u.on,
273
- get: B("GET"),
274
- put: B("PUT"),
275
- post: B("POST"),
276
- delete: B("DELETE"),
277
- patch: B("PATCH"),
278
- head: B("HEAD"),
279
- options: B("OPTIONS"),
280
- json: A("json"),
281
- text: A("text"),
282
- blob: A("blob"),
283
- arrayBuffer: A("arrayBuffer"),
284
- formData: A("formData")
286
+ // method
287
+ get: A("GET"),
288
+ put: A("PUT"),
289
+ post: A("POST"),
290
+ delete: A("DELETE"),
291
+ patch: A("PATCH"),
292
+ head: A("HEAD"),
293
+ options: A("OPTIONS"),
294
+ // type
295
+ json: C("json"),
296
+ text: C("text"),
297
+ blob: C("blob"),
298
+ arrayBuffer: C("arrayBuffer"),
299
+ formData: C("formData")
285
300
  };
286
- function B(l) {
287
- return (w, m) => {
288
- if (!d.value) {
289
- o.method = l, o.payload = w, o.payloadType = m, fe(o.payload) && G([
290
- Y,
291
- V(o.payload)
292
- ], ([T]) => T && $(), { deep: !0 });
293
- const C = E(o.payload);
294
- return !m && C && Object.getPrototypeOf(C) === Object.prototype && !(C instanceof FormData) && (o.payloadType = "json"), H(f({}, x), {
295
- then(T, _) {
296
- return L().then(T, _);
301
+ function A(l) {
302
+ return (P, m) => {
303
+ if (!p.value) {
304
+ o.method = l, o.payload = P, o.payloadType = m, oe(o.payload) && I(
305
+ [
306
+ z,
307
+ R(o.payload)
308
+ ],
309
+ ([T]) => T && U(),
310
+ { deep: !0 }
311
+ );
312
+ const H = O(o.payload);
313
+ return !m && H && Object.getPrototypeOf(H) === Object.prototype && !(H instanceof FormData) && (o.payloadType = "json"), N(f({}, x), {
314
+ then(T, B) {
315
+ return V().then(T, B);
297
316
  }
298
317
  });
299
318
  }
300
319
  };
301
320
  }
302
- function L() {
303
- return new Promise((l, w) => {
304
- Te(h).toBe(!0).then(() => l(x)).catch((m) => w(m));
321
+ function V() {
322
+ return new Promise((l, P) => {
323
+ Pe(h).toBe(!0).then(() => l(x)).catch((m) => P(m));
305
324
  });
306
325
  }
307
- function A(l) {
326
+ function C(l) {
308
327
  return () => {
309
- if (!d.value)
310
- return o.type = l, H(f({}, x), {
311
- then(w, m) {
312
- return L().then(w, m);
328
+ if (!p.value)
329
+ return o.type = l, N(f({}, x), {
330
+ then(P, m) {
331
+ return V().then(P, m);
313
332
  }
314
333
  });
315
334
  };
316
335
  }
317
- return r.immediate && setTimeout($, 0), H(f({}, x), {
318
- then(l, w) {
319
- return L().then(l, w);
336
+ return r.immediate && Promise.resolve().then(() => U()), N(f({}, x), {
337
+ then(l, P) {
338
+ return V().then(l, P);
320
339
  }
321
340
  });
322
341
  }
323
- var ue;
324
- (function(e) {
325
- e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
326
- })(ue || (ue = {}));
327
- var De = Object.defineProperty, se = Object.getOwnPropertySymbols, Ae = Object.prototype.hasOwnProperty, He = Object.prototype.propertyIsEnumerable, le = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, $e = (e, t) => {
328
- for (var n in t || (t = {}))
329
- Ae.call(t, n) && le(e, n, t[n]);
330
- if (se)
331
- for (var n of se(t))
332
- He.call(t, n) && le(e, n, t[n]);
333
- return e;
334
- };
335
- const xe = {
336
- easeInSine: [0.12, 0, 0.39, 0],
337
- easeOutSine: [0.61, 1, 0.88, 1],
338
- easeInOutSine: [0.37, 0, 0.63, 1],
339
- easeInQuad: [0.11, 0, 0.5, 0],
340
- easeOutQuad: [0.5, 1, 0.89, 1],
341
- easeInOutQuad: [0.45, 0, 0.55, 1],
342
- easeInCubic: [0.32, 0, 0.67, 0],
343
- easeOutCubic: [0.33, 1, 0.68, 1],
344
- easeInOutCubic: [0.65, 0, 0.35, 1],
345
- easeInQuart: [0.5, 0, 0.75, 0],
346
- easeOutQuart: [0.25, 1, 0.5, 1],
347
- easeInOutQuart: [0.76, 0, 0.24, 1],
348
- easeInQuint: [0.64, 0, 0.78, 0],
349
- easeOutQuint: [0.22, 1, 0.36, 1],
350
- easeInOutQuint: [0.83, 0, 0.17, 1],
351
- easeInExpo: [0.7, 0, 0.84, 0],
352
- easeOutExpo: [0.16, 1, 0.3, 1],
353
- easeInOutExpo: [0.87, 0, 0.13, 1],
354
- easeInCirc: [0.55, 0, 1, 0.45],
355
- easeOutCirc: [0, 0.55, 0.45, 1],
356
- easeInOutCirc: [0.85, 0, 0.15, 1],
357
- easeInBack: [0.36, 0, 0.66, -0.56],
358
- easeOutBack: [0.34, 1.56, 0.64, 1],
359
- easeInOutBack: [0.68, -0.6, 0.32, 1.6]
360
- };
361
- $e({
362
- linear: be
363
- }, xe);
364
- function Le(e, t) {
342
+ function Ce(e, t) {
365
343
  const n = {};
366
344
  return Object.keys(e).forEach((a) => {
367
345
  n[a] = (...r) => {
368
- const o = e[a], g = o.type;
369
- let y = `/api/${o.url}`;
370
- o.hasBody ? y = te(y, ...r.splice(1)) : y = te(y, ...r);
371
- const O = {
372
- ...de(),
346
+ const o = e[a], b = o.type;
347
+ let d = `/api/${o.url}`;
348
+ o.hasBody ? d = Y(d, ...r.splice(1)) : d = Y(d, ...r);
349
+ const v = {
350
+ ...ae(),
373
351
  ...o.headers()
374
- }, b = Ce(
375
- y,
352
+ }, g = De(
353
+ d,
376
354
  {
377
- method: g
355
+ method: b
378
356
  },
379
357
  {
380
358
  immediate: !1,
381
359
  beforeFetch({ options: u }) {
382
360
  return u.headers = {
383
361
  ...u.headers,
384
- ...O
362
+ ...v
385
363
  }, o.hasBody && r.length && (u.body = JSON.stringify(r[0])), {
386
364
  options: u
387
365
  };
@@ -392,19 +370,19 @@ function Le(e, t) {
392
370
  }
393
371
  );
394
372
  return {
395
- ...Qe(O) === "application/json" ? b.json() : b.text()
373
+ ...Se(v) === "application/json" ? g.json() : g.text()
396
374
  };
397
375
  };
398
376
  }), n;
399
377
  }
400
- function Qe(e) {
378
+ function Se(e) {
401
379
  return e.accept ?? "*/*";
402
380
  }
403
- function Me(e) {
381
+ function Ne(e) {
404
382
  return JSON.parse(JSON.stringify(e));
405
383
  }
406
- function We(e = 500) {
407
- const t = ve({
384
+ function Ue(e = 500) {
385
+ const t = he({
408
386
  debouncer: null,
409
387
  timeout: e
410
388
  });
@@ -412,15 +390,15 @@ function We(e = 500) {
412
390
  t.debouncer !== null && window.clearTimeout(t.debouncer), t.debouncer = window.setTimeout(() => s(...a), t.timeout);
413
391
  }
414
392
  return {
415
- ...we(t),
393
+ ...me(t),
416
394
  debounce: n
417
395
  };
418
396
  }
419
397
  export {
420
- Me as copy,
421
- Ke as createEndpoint,
422
- de as getDefaultHeaders,
423
- Je as requestTypes,
424
- Le as useApi,
425
- We as useDebouncer
398
+ Ne as copy,
399
+ $e as createEndpoint,
400
+ ae as getDefaultHeaders,
401
+ He as requestTypes,
402
+ Ce as useApi,
403
+ Ue as useDebouncer
426
404
  };
@@ -1 +1 @@
1
- (function(p,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("@citruslime/utils"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@citruslime/utils","vue"],A):(p=typeof globalThis<"u"?globalThis:p||self,A(p.CitrusLimeVueUtils={},p.CLUtils,p.Vue))})(this,function(p,A,u){"use strict";const fe=["GET","POST","PUT","DELETE"];function de(e,t,n=null,l=null){return{url:e,type:t,headers:n??q,hasBody:pe(t,l)}}function q(){return{accept:"application/json","content-type":"application/json"}}function pe(e,t){return!!(t===null&&(e==="PUT"||e==="POST")||t)}var Z;const J=typeof window<"u";J&&((Z=window==null?void 0:window.navigator)!=null&&Z.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function T(e){return typeof e=="function"?e():u.unref(e)}function ee(e,t=!1,n="Timeout"){return new Promise((l,a)=>{setTimeout(t?()=>a(n):l,e)})}function he(e){return e}function ye(e,...t){return t.some(n=>n in e)}function te(e){return u.getCurrentScope()?(u.onScopeDispose(e),!0):!1}function M(){const e=[],t=a=>{const r=e.indexOf(a);r!==-1&&e.splice(r,1)};return{on:a=>{e.push(a);const r=()=>t(a);return te(r),{off:r}},off:t,trigger:a=>{e.forEach(r=>r(a))}}}function V(e){return typeof e=="function"?u.computed(e):u.ref(e)}function K(e,t=!1){function n(i,{flush:s="sync",deep:O=!1,timeout:h,throwOnTimeout:I}={}){let y=null;const D=[new Promise(S=>{y=u.watch(e,C=>{i(C)!==t&&(y==null||y(),S(C))},{flush:s,deep:O,immediate:!0})})];return h!=null&&D.push(ee(h,I).then(()=>T(e)).finally(()=>y==null?void 0:y())),Promise.race(D)}function l(i,s){if(!u.isRef(i))return n(C=>C===i,s);const{flush:O="sync",deep:h=!1,timeout:I,throwOnTimeout:y}=s??{};let b=null;const S=[new Promise(C=>{b=u.watch([e,i],([E,N])=>{t!==(E===N)&&(b==null||b(),C(E))},{flush:O,deep:h,immediate:!0})})];return I!=null&&S.push(ee(I,y).then(()=>T(e)).finally(()=>(b==null||b(),T(e)))),Promise.race(S)}function a(i){return n(s=>Boolean(s),i)}function r(i){return l(null,i)}function o(i){return l(void 0,i)}function _(i){return n(Number.isNaN,i)}function m(i,s){return n(O=>{const h=Array.from(O);return h.includes(i)||h.includes(T(i))},s)}function g(i){return v(1,i)}function v(i=1,s){let O=-1;return n(()=>(O+=1,O>=i),s)}return Array.isArray(T(e))?{toMatch:n,toContains:m,changed:g,changedTimes:v,get not(){return K(e,!t)}}:{toMatch:n,toBe:l,toBeTruthy:a,toBeNull:r,toBeNaN:_,toBeUndefined:o,changed:g,changedTimes:v,get not(){return K(e,!t)}}}function me(e){return K(e)}function Oe(e,t,n={}){const{immediate:l=!0}=n,a=u.ref(!1);let r=null;function o(){r&&(clearTimeout(r),r=null)}function _(){a.value=!1,o()}function m(...g){o(),a.value=!0,r=setTimeout(()=>{a.value=!1,r=null,e(...g)},T(t))}return l&&(a.value=!0,J&&m()),te(_),{isPending:u.readonly(a),start:m,stop:_}}const we=J?window:void 0,R=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},W="__vueuse_ssr_handlers__";R[W]=R[W]||{},R[W];var ge=Object.defineProperty,be=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,re=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))Te.call(t,n)&&re(e,n,t[n]);if(ne)for(var n of ne(t))_e.call(t,n)&&re(e,n,t[n]);return e},U=(e,t)=>be(e,Pe(t));const ve={json:"application/json",text:"text/plain"};function oe(e){return e&&ye(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch")}function k(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries([...e.entries()]):e}function Ee(e,...t){var n;const l=typeof AbortController=="function";let a={},r={immediate:!0,refetch:!1,timeout:0};const o={method:"GET",type:"text",payload:void 0};t.length>0&&(oe(t[0])?r=c(c({},r),t[0]):a=t[0]),t.length>1&&oe(t[1])&&(r=c(c({},r),t[1]));const{fetch:_=(n=we)==null?void 0:n.fetch,initialData:m,timeout:g}=r,v=M(),i=M(),s=M(),O=u.ref(!1),h=u.ref(!1),I=u.ref(!1),y=u.ref(null),b=u.shallowRef(null),D=u.shallowRef(null),S=u.shallowRef(m),C=u.computed(()=>l&&h.value);let E,N;const z=()=>{l&&E&&(E.abort(),E=void 0)},X=f=>{h.value=f,O.value=!f};g&&(N=Oe(z,g,{immediate:!1}));const Q=async(f=!1)=>{var P;X(!0),D.value=null,y.value=null,I.value=!1,l&&(z(),E=new AbortController,E.signal.onabort=()=>I.value=!0,a=U(c({},a),{signal:E.signal}));const w={method:o.method,headers:{}};if(o.payload){const G=k(w.headers);o.payloadType&&(G["Content-Type"]=(P=ve[o.payloadType])!=null?P:o.payloadType);const L=T(o.payload);w.body=o.payloadType==="json"?JSON.stringify(L):L}let H=!1;const F={url:T(e),options:c(c({},w),a),cancel:()=>{H=!0}};if(r.beforeFetch&&Object.assign(F,await r.beforeFetch(F)),H||!_)return X(!1),Promise.resolve(null);let j=null;return N&&N.start(),new Promise((G,L)=>{var le;_(F.url,U(c(c({},w),F.options),{headers:c(c({},k(w.headers)),k((le=F.options)==null?void 0:le.headers))})).then(async d=>{if(b.value=d,y.value=d.status,j=await d[o.type](),r.afterFetch&&y.value>=200&&y.value<300&&({data:j}=await r.afterFetch({data:j,response:d})),S.value=j,!d.ok)throw new Error(d.statusText);return v.trigger(d),G(d)}).catch(async d=>{let ce=d.message||d.name;return r.onFetchError&&({data:j,error:ce}=await r.onFetchError({data:j,error:d,response:b.value})),S.value=j,D.value=ce,i.trigger(d),f?L(d):G(null)}).finally(()=>{X(!1),N&&N.stop(),s.trigger(null)})})},ue=V(r.refetch);u.watch([ue,V(e)],([f])=>f&&Q(),{deep:!0});const x={isFinished:O,statusCode:y,response:b,error:D,data:S,isFetching:h,canAbort:C,aborted:I,abort:z,execute:Q,onFetchResponse:v.on,onFetchError:i.on,onFetchFinally:s.on,get:B("GET"),put:B("PUT"),post:B("POST"),delete:B("DELETE"),patch:B("PATCH"),head:B("HEAD"),options:B("OPTIONS"),json:$("json"),text:$("text"),blob:$("blob"),arrayBuffer:$("arrayBuffer"),formData:$("formData")};function B(f){return(P,w)=>{if(!h.value){o.method=f,o.payload=P,o.payloadType=w,u.isRef(o.payload)&&u.watch([ue,V(o.payload)],([F])=>F&&Q(),{deep:!0});const H=T(o.payload);return!w&&H&&Object.getPrototypeOf(H)===Object.prototype&&!(H instanceof FormData)&&(o.payloadType="json"),U(c({},x),{then(F,j){return Y().then(F,j)}})}}}function Y(){return new Promise((f,P)=>{me(O).toBe(!0).then(()=>f(x)).catch(w=>P(w))})}function $(f){return()=>{if(!h.value)return o.type=f,U(c({},x),{then(P,w){return Y().then(P,w)}})}}return r.immediate&&setTimeout(Q,0),U(c({},x),{then(f,P){return Y().then(f,P)}})}var ae;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(ae||(ae={}));var Fe=Object.defineProperty,ie=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,se=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t)=>{for(var n in t||(t={}))je.call(t,n)&&se(e,n,t[n]);if(ie)for(var n of ie(t))Ie.call(t,n)&&se(e,n,t[n]);return e};Se({linear:he},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function Ce(e,t){const n={};return Object.keys(e).forEach(a=>{n[a]=(...r)=>{const o=e[a],_=o.type;let m=`/api/${o.url}`;o.hasBody?m=A.replacePlaceholders(m,...r.splice(1)):m=A.replacePlaceholders(m,...r);const g={...q(),...o.headers()},v=Ee(m,{method:_},{immediate:!1,beforeFetch({options:s}){return s.headers={...s.headers,...g},o.hasBody&&r.length&&(s.body=JSON.stringify(r[0])),{options:s}},onFetchError(s){return s!=null&&s.response&&t(s),s}});return{...De(g)==="application/json"?v.json():v.text()}}}),n}function De(e){return e.accept??"*/*"}function Ne(e){return JSON.parse(JSON.stringify(e))}function Be(e=500){const t=u.reactive({debouncer:null,timeout:e});function n(l,...a){t.debouncer!==null&&window.clearTimeout(t.debouncer),t.debouncer=window.setTimeout(()=>l(...a),t.timeout)}return{...u.toRefs(t),debounce:n}}p.copy=Ne,p.createEndpoint=de,p.getDefaultHeaders=q,p.requestTypes=fe,p.useApi=Ce,p.useDebouncer=Be,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
1
+ (function(p,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("@citruslime/utils"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@citruslime/utils","vue"],$):(p=typeof globalThis<"u"?globalThis:p||self,$(p.CitrusLimeVueUtils={},p.CLUtils,p.Vue))})(this,function(p,$,s){"use strict";const ie=["GET","POST","PUT","DELETE"];function ae(e,t,n=null,u=null){return{url:e,type:t,headers:n??I,hasBody:se(t,u)}}function I(){return{accept:"application/json","content-type":"application/json"}}function se(e,t){return!!(t===null&&(e==="PUT"||e==="POST")||t)}function Q(e){return s.getCurrentScope()?(s.onScopeDispose(e),!0):!1}function L(){const e=new Set,t=i=>{e.delete(i)};return{on:i=>{e.add(i);const r=()=>t(i);return Q(r),{off:r}},off:t,trigger:i=>Promise.all(Array.from(e).map(r=>r(i)))}}function O(e){return typeof e=="function"?e():s.unref(e)}const X=typeof window<"u",le=()=>{};function Y(e,t=!1,n="Timeout"){return new Promise((u,i)=>{setTimeout(t?()=>i(n):u,e)})}function ue(e,...t){return t.some(n=>n in e)}function R(...e){if(e.length!==1)return s.toRef(...e);const t=e[0];return typeof t=="function"?s.readonly(s.customRef(()=>({get:t,set:le}))):s.ref(t)}function K(e,t=!1){function n(a,{flush:l="sync",deep:m=!1,timeout:y,throwOnTimeout:v}={}){let T=null;const A=[new Promise(_=>{T=s.watch(e,D=>{a(D)!==t&&(T==null||T(),_(D))},{flush:l,deep:m,immediate:!0})})];return y!=null&&A.push(Y(y,v).then(()=>O(e)).finally(()=>T==null?void 0:T())),Promise.race(A)}function u(a,l){if(!s.isRef(a))return n(D=>D===a,l);const{flush:m="sync",deep:y=!1,timeout:v,throwOnTimeout:T}=l??{};let b=null;const _=[new Promise(D=>{b=s.watch([e,a],([S,B])=>{t!==(S===B)&&(b==null||b(),D(S))},{flush:m,deep:y,immediate:!0})})];return v!=null&&_.push(Y(v,T).then(()=>O(e)).finally(()=>(b==null||b(),O(e)))),Promise.race(_)}function i(a){return n(l=>!!l,a)}function r(a){return u(null,a)}function o(a){return u(void 0,a)}function F(a){return n(Number.isNaN,a)}function h(a,l){return n(m=>{const y=Array.from(m);return y.includes(a)||y.includes(O(a))},l)}function P(a){return E(1,a)}function E(a=1,l){let m=-1;return n(()=>(m+=1,m>=a),l)}return Array.isArray(O(e))?{toMatch:n,toContains:h,changed:P,changedTimes:E,get not(){return K(e,!t)}}:{toMatch:n,toBe:u,toBeTruthy:i,toBeNull:r,toBeNaN:F,toBeUndefined:o,changed:P,changedTimes:E,get not(){return K(e,!t)}}}function ce(e){return K(e)}function fe(e,t,n={}){const{immediate:u=!0}=n,i=s.ref(!1);let r=null;function o(){r&&(clearTimeout(r),r=null)}function F(){i.value=!1,o()}function h(...P){o(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...P)},O(t))}return u&&(i.value=!0,X&&h()),Q(F),{isPending:s.readonly(i),start:h,stop:F}}const de=X?window:void 0;var pe=Object.defineProperty,he=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&ee(e,n,t[n]);if(Z)for(var n of Z(t))we.call(t,n)&&ee(e,n,t[n]);return e},U=(e,t)=>he(e,ye(t));const Te={json:"application/json",text:"text/plain"};function te(e){return e&&ue(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch")}function W(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries([...e.entries()]):e}function Pe(e,...t){var n;const u=typeof AbortController=="function";let i={},r={immediate:!0,refetch:!1,timeout:0};const o={method:"GET",type:"text",payload:void 0};t.length>0&&(te(t[0])?r=c(c({},r),t[0]):i=t[0]),t.length>1&&te(t[1])&&(r=c(c({},r),t[1]));const{fetch:F=(n=de)==null?void 0:n.fetch,initialData:h,timeout:P}=r,E=L(),a=L(),l=L(),m=s.ref(!1),y=s.ref(!1),v=s.ref(!1),T=s.ref(null),b=s.shallowRef(null),A=s.shallowRef(null),_=s.shallowRef(h||null),D=s.computed(()=>u&&y.value);let S,B;const k=()=>{u&&(S==null||S.abort(),S=new AbortController,S.signal.onabort=()=>v.value=!0,i=U(c({},i),{signal:S.signal}))},x=f=>{y.value=f,m.value=!f};P&&(B=fe(k,P,{immediate:!1}));const J=async(f=!1)=>{var g;k(),x(!0),A.value=null,T.value=null,v.value=!1;const w={method:o.method,headers:{}};if(o.payload){const V=W(w.headers);o.payloadType&&(V["Content-Type"]=(g=Te[o.payloadType])!=null?g:o.payloadType);const G=O(o.payload);w.body=o.payloadType==="json"?JSON.stringify(G):G}let N=!1;const j={url:O(e),options:c(c({},w),i),cancel:()=>{N=!0}};if(r.beforeFetch&&Object.assign(j,await r.beforeFetch(j)),N||!F)return x(!1),Promise.resolve(null);let C=null;return B&&B.start(),new Promise((V,G)=>{var re;F(j.url,U(c(c({},w),j.options),{headers:c(c({},W(w.headers)),W((re=j.options)==null?void 0:re.headers))})).then(async d=>{if(b.value=d,T.value=d.status,C=await d[o.type](),!d.ok)throw _.value=h||null,new Error(d.statusText);return r.afterFetch&&({data:C}=await r.afterFetch({data:C,response:d})),_.value=C,E.trigger(d),V(d)}).catch(async d=>{let oe=d.message||d.name;return r.onFetchError&&({error:oe}=await r.onFetchError({data:C,error:d,response:b.value})),A.value=oe,a.trigger(d),f?G(d):V(null)}).finally(()=>{x(!1),B&&B.stop(),l.trigger(null)})})},ne=R(r.refetch);s.watch([ne,R(e)],([f])=>f&&J(),{deep:!0});const M={isFinished:m,statusCode:T,response:b,error:A,data:_,isFetching:y,canAbort:D,aborted:v,abort:k,execute:J,onFetchResponse:E.on,onFetchError:a.on,onFetchFinally:l.on,get:H("GET"),put:H("PUT"),post:H("POST"),delete:H("DELETE"),patch:H("PATCH"),head:H("HEAD"),options:H("OPTIONS"),json:q("json"),text:q("text"),blob:q("blob"),arrayBuffer:q("arrayBuffer"),formData:q("formData")};function H(f){return(g,w)=>{if(!y.value){o.method=f,o.payload=g,o.payloadType=w,s.isRef(o.payload)&&s.watch([ne,R(o.payload)],([j])=>j&&J(),{deep:!0});const N=O(o.payload);return!w&&N&&Object.getPrototypeOf(N)===Object.prototype&&!(N instanceof FormData)&&(o.payloadType="json"),U(c({},M),{then(j,C){return z().then(j,C)}})}}}function z(){return new Promise((f,g)=>{ce(m).toBe(!0).then(()=>f(M)).catch(w=>g(w))})}function q(f){return()=>{if(!y.value)return o.type=f,U(c({},M),{then(g,w){return z().then(g,w)}})}}return r.immediate&&Promise.resolve().then(()=>J()),U(c({},M),{then(f,g){return z().then(f,g)}})}function be(e,t){const n={};return Object.keys(e).forEach(i=>{n[i]=(...r)=>{const o=e[i],F=o.type;let h=`/api/${o.url}`;o.hasBody?h=$.replacePlaceholders(h,...r.splice(1)):h=$.replacePlaceholders(h,...r);const P={...I(),...o.headers()},E=Pe(h,{method:F},{immediate:!1,beforeFetch({options:l}){return l.headers={...l.headers,...P},o.hasBody&&r.length&&(l.body=JSON.stringify(r[0])),{options:l}},onFetchError(l){return l!=null&&l.response&&t(l),l}});return{...ge(P)==="application/json"?E.json():E.text()}}}),n}function ge(e){return e.accept??"*/*"}function Oe(e){return JSON.parse(JSON.stringify(e))}function Fe(e=500){const t=s.reactive({debouncer:null,timeout:e});function n(u,...i){t.debouncer!==null&&window.clearTimeout(t.debouncer),t.debouncer=window.setTimeout(()=>u(...i),t.timeout)}return{...s.toRefs(t),debounce:n}}p.copy=Oe,p.createEndpoint=ae,p.getDefaultHeaders=I,p.requestTypes=ie,p.useApi=be,p.useDebouncer=Fe,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citruslime/vue-utils",
3
- "version": "1.2.1",
3
+ "version": "1.3.0-beta.0",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Citrus-Lime Ltd",
@@ -23,17 +23,20 @@
23
23
  "exports": {
24
24
  ".": {
25
25
  "import": "./dist/citrus-lime-vue-utils.es.js",
26
- "require": "./dist/citrus-lime-vue-utils.umd.js"
26
+ "require": "./dist/citrus-lime-vue-utils.umd.js",
27
+ "types": "./dist/main.d.ts"
27
28
  }
28
29
  },
29
30
  "scripts": {
30
- "build": "vite build && copyfiles -u 2 \"dist/src/**/*\" dist && del-cli dist/src"
31
+ "build": "run-p build-source build-types",
32
+ "build-source": "vite build",
33
+ "build-types": "vue-tsc --declaration --emitDeclarationOnly --declarationDir ./dist --project ./tsconfig.app.json --composite false"
31
34
  },
32
35
  "dependencies": {
33
- "@citruslime/utils": "^1.1.1"
36
+ "@citruslime/utils": "^1.1.2-beta.0"
34
37
  },
35
38
  "peerDependencies": {
36
- "@vueuse/core": "^9.13.0",
39
+ "@vueuse/core": "^10.1.2",
37
40
  "vue": "^3.2.47"
38
41
  }
39
42
  }