@pinia/colada-devtools 0.0.4 → 0.0.6
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.js +141 -134
- package/dist/index.js.map +1 -1
- package/dist-panel/{_queryId_-SBAeSmfh.js → _queryId_-BRk1BujP.js} +85 -78
- package/dist-panel/_queryId_-BRk1BujP.js.map +1 -0
- package/dist-panel/{index-CAv-3vCR.js → index-B_58xqr0.js} +2 -2
- package/dist-panel/{index-CAv-3vCR.js.map → index-B_58xqr0.js.map} +1 -1
- package/dist-panel/{index-DZwqU9e-.js → index-CIFb4FXj.js} +3 -3
- package/dist-panel/index-CIFb4FXj.js.map +1 -0
- package/dist-panel/index-dcKxSjOS.js +8113 -0
- package/dist-panel/index-dcKxSjOS.js.map +1 -0
- package/dist-panel/index.js +1 -1
- package/dist-panel/{loader-DHLcbUhz.js → loader-CDd8nw_A.js} +2 -2
- package/dist-panel/loader-CDd8nw_A.js.map +1 -0
- package/dist-panel/{mouse-pointer-click-BHnWXkC_.js → mouse-pointer-click-BisIGlPs.js} +2 -2
- package/dist-panel/mouse-pointer-click-BisIGlPs.js.map +1 -0
- package/dist-panel/mutations-DmPjJLlL.js +13 -0
- package/dist-panel/mutations-DmPjJLlL.js.map +1 -0
- package/dist-panel/{queries-CE8W5p_h.js → queries-B9YVJVQ4.js} +88 -89
- package/dist-panel/queries-B9YVJVQ4.js.map +1 -0
- package/dist-panel/{settings-DIqJoCBU.js → settings-s4xqlsIF.js} +2 -2
- package/dist-panel/{settings-DIqJoCBU.js.map → settings-s4xqlsIF.js.map} +1 -1
- package/dist-shared/index.d.ts +1 -1
- package/dist-shared/index.js.map +1 -1
- package/package.json +7 -7
- package/dist-panel/_queryId_-SBAeSmfh.js.map +0 -1
- package/dist-panel/index-BdIpA-g4.js +0 -8026
- package/dist-panel/index-BdIpA-g4.js.map +0 -1
- package/dist-panel/index-DZwqU9e-.js.map +0 -1
- package/dist-panel/loader-DHLcbUhz.js.map +0 -1
- package/dist-panel/mouse-pointer-click-BHnWXkC_.js.map +0 -1
- package/dist-panel/mutations-BfqfXeMY.js +0 -13
- package/dist-panel/mutations-BfqfXeMY.js.map +0 -1
- package/dist-panel/queries-CE8W5p_h.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useQueryCache as
|
|
3
|
-
import { DEVTOOLS_INFO_KEY as p, DuplexChannel as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as R, onMounted as j, renderSlot as re, createCommentVNode as N, toValue as C, getCurrentScope as Q, onScopeDispose as G, useTemplateRef as se, shallowRef as W, watch as _, onBeforeUnmount as ae, createBlock as F, openBlock as x, Teleport as le, createElementVNode as ue, nextTick as K, readonly as U, getCurrentInstance as ce, toRef as de, customRef as fe, computed as Y, unref as $, withCtx as pe, createElementBlock as ve } from "vue";
|
|
2
|
+
import { useQueryCache as me } from "@pinia/colada";
|
|
3
|
+
import { DEVTOOLS_INFO_KEY as p, DuplexChannel as ye } from "@pinia/colada-devtools/shared";
|
|
4
|
+
const he = /* @__PURE__ */ L({
|
|
5
5
|
__name: "ClientOnly",
|
|
6
6
|
setup(e) {
|
|
7
7
|
const t = R(!1);
|
|
8
|
-
return
|
|
8
|
+
return j(() => {
|
|
9
9
|
t.value = !0;
|
|
10
|
-
}), (n, l) => t.value ?
|
|
10
|
+
}), (n, l) => t.value ? re(n.$slots, "default", { key: 0 }) : N("", !0);
|
|
11
11
|
}
|
|
12
12
|
}), b = () => performance.timeOrigin + performance.now();
|
|
13
|
-
function
|
|
13
|
+
function ge(e) {
|
|
14
14
|
var t;
|
|
15
|
-
if (!
|
|
16
|
-
|
|
15
|
+
if (!z.has(e)) {
|
|
16
|
+
z.set(e, !0);
|
|
17
17
|
for (const n of e.getEntries())
|
|
18
18
|
n[t = p] ?? (n[t] = {
|
|
19
19
|
count: {
|
|
@@ -47,16 +47,16 @@ function me(e) {
|
|
|
47
47
|
else if (n === "fetch") {
|
|
48
48
|
const [s] = l;
|
|
49
49
|
s[p].count.total++, s[p].updatedAt = b();
|
|
50
|
-
const
|
|
50
|
+
const c = b(), v = {
|
|
51
51
|
id: (((h = s[p].history.at(0)) == null ? void 0 : h.id) ?? -1) + 1,
|
|
52
52
|
key: s.key,
|
|
53
53
|
state: s.state.value,
|
|
54
|
-
updatedAt:
|
|
55
|
-
createdAt:
|
|
54
|
+
updatedAt: c,
|
|
55
|
+
createdAt: c,
|
|
56
56
|
fetchTime: null
|
|
57
|
-
}, E =
|
|
57
|
+
}, E = C((f = s.options) == null ? void 0 : f.enabled) ?? !0;
|
|
58
58
|
E && (v.fetchTime = {
|
|
59
|
-
start:
|
|
59
|
+
start: c,
|
|
60
60
|
end: null
|
|
61
61
|
}), s[p].history.unshift(v), s[p].history = s[p].history.slice(0, 10), r(() => {
|
|
62
62
|
E && (v.fetchTime.end = b(), s[p].count.succeed++, v.state = s.state.value, v.updatedAt = b());
|
|
@@ -68,9 +68,9 @@ function me(e) {
|
|
|
68
68
|
s.pending && s[p].count.cancelled++;
|
|
69
69
|
} else if (n === "setEntryState") {
|
|
70
70
|
const [s] = l;
|
|
71
|
-
let
|
|
71
|
+
let c = s[p].history[0];
|
|
72
72
|
r(() => {
|
|
73
|
-
s[p].updatedAt = b(),
|
|
73
|
+
s[p].updatedAt = b(), c ?? (c = s[p].history[0]), c && (c.state = s.state.value, c.updatedAt = b());
|
|
74
74
|
});
|
|
75
75
|
} else if (n === "untrack") {
|
|
76
76
|
const [s] = l;
|
|
@@ -80,8 +80,8 @@ function me(e) {
|
|
|
80
80
|
} else if (n === "setQueryData") {
|
|
81
81
|
const [s] = l;
|
|
82
82
|
r(() => {
|
|
83
|
-
const
|
|
84
|
-
|
|
83
|
+
const c = e.getEntries({ key: s, exact: !0 })[0];
|
|
84
|
+
c && !c.active && (c[p].inactiveAt = b());
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
});
|
|
@@ -89,7 +89,7 @@ function me(e) {
|
|
|
89
89
|
}
|
|
90
90
|
function S(e) {
|
|
91
91
|
return {
|
|
92
|
-
|
|
92
|
+
keyHash: e.keyHash,
|
|
93
93
|
key: e.key,
|
|
94
94
|
state: e.state.value,
|
|
95
95
|
asyncStatus: e.asyncStatus.value,
|
|
@@ -99,10 +99,10 @@ function S(e) {
|
|
|
99
99
|
options: e.options && {
|
|
100
100
|
staleTime: e.options.staleTime,
|
|
101
101
|
gcTime: e.options.gcTime,
|
|
102
|
-
refetchOnMount:
|
|
103
|
-
refetchOnReconnect:
|
|
104
|
-
refetchOnWindowFocus:
|
|
105
|
-
enabled:
|
|
102
|
+
refetchOnMount: C(e.options.refetchOnMount),
|
|
103
|
+
refetchOnReconnect: C(e.options.refetchOnReconnect),
|
|
104
|
+
refetchOnWindowFocus: C(e.options.refetchOnWindowFocus),
|
|
105
|
+
enabled: C(e.options.enabled)
|
|
106
106
|
},
|
|
107
107
|
deps: Array.from(e.deps).map(
|
|
108
108
|
(t) => "uid" in t ? {
|
|
@@ -119,17 +119,17 @@ function S(e) {
|
|
|
119
119
|
devtools: e[p]
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
function
|
|
124
|
-
e.addEventListener(t, n, l),
|
|
122
|
+
const z = /* @__PURE__ */ new WeakMap();
|
|
123
|
+
function we(e, t, n, l) {
|
|
124
|
+
e.addEventListener(t, n, l), Q() && G(() => {
|
|
125
125
|
e.removeEventListener(t, n);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const Ee = [".isPip", ".port"], Se = /* @__PURE__ */ L({
|
|
129
129
|
__name: "PiniaColadaDevtools",
|
|
130
130
|
setup(e) {
|
|
131
|
-
const t =
|
|
132
|
-
|
|
131
|
+
const t = me();
|
|
132
|
+
ge(t), t.$onAction(({ name: i, after: o, onError: m, args: g }) => {
|
|
133
133
|
if (i === "remove") {
|
|
134
134
|
const [a] = g;
|
|
135
135
|
o(() => {
|
|
@@ -161,7 +161,7 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
const n =
|
|
164
|
+
const n = se("devtools"), l = W(new MessageChannel()), r = new ye(l.value.port1);
|
|
165
165
|
_(
|
|
166
166
|
l,
|
|
167
167
|
(i) => {
|
|
@@ -207,10 +207,10 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
|
207
207
|
error: null
|
|
208
208
|
}), o[p].simulate = null, r.emit("queries:update", S(o)));
|
|
209
209
|
});
|
|
210
|
-
const d =
|
|
210
|
+
const d = W(null);
|
|
211
211
|
_(d, () => {
|
|
212
212
|
l.value = new MessageChannel();
|
|
213
|
-
}),
|
|
213
|
+
}), we(
|
|
214
214
|
window,
|
|
215
215
|
"unload",
|
|
216
216
|
() => {
|
|
@@ -218,7 +218,7 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
|
218
218
|
(i = d.value) == null || i.close();
|
|
219
219
|
},
|
|
220
220
|
{ passive: !0 }
|
|
221
|
-
),
|
|
221
|
+
), ae(() => {
|
|
222
222
|
var i;
|
|
223
223
|
(i = d.value) == null || i.close();
|
|
224
224
|
});
|
|
@@ -256,7 +256,7 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
|
256
256
|
const g = [...i.shadowRoot.styleSheets].flatMap((a) => [...a.cssRules]).filter((a) => a instanceof CSSPropertyRule).map((a) => a.cssText).join("");
|
|
257
257
|
m.textContent = g, o.head.appendChild(m);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function c() {
|
|
260
260
|
d.value ? h() : f();
|
|
261
261
|
}
|
|
262
262
|
let v = 0;
|
|
@@ -275,33 +275,33 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
|
|
|
275
275
|
t.getEntries({}).map(S)
|
|
276
276
|
);
|
|
277
277
|
}
|
|
278
|
-
return (i, o) => (x(),
|
|
278
|
+
return (i, o) => (x(), F(le, {
|
|
279
279
|
to: d.value ? d.value.document.body : "body"
|
|
280
280
|
}, [
|
|
281
|
-
|
|
281
|
+
ue("pinia-colada-devtools-panel", {
|
|
282
282
|
ref: "devtools",
|
|
283
283
|
".isPip": !!d.value,
|
|
284
284
|
".port": l.value.port2,
|
|
285
|
-
onTogglePip: o[0] || (o[0] = (m) =>
|
|
285
|
+
onTogglePip: o[0] || (o[0] = (m) => c()),
|
|
286
286
|
onReady: o[1] || (o[1] = (m) => E())
|
|
287
|
-
}, null, 40,
|
|
287
|
+
}, null, 40, Ee)
|
|
288
288
|
], 8, ["to"]));
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
-
function
|
|
292
|
-
return
|
|
291
|
+
function be(e) {
|
|
292
|
+
return Q() ? (G(e), !0) : !1;
|
|
293
293
|
}
|
|
294
|
-
const
|
|
294
|
+
const Ae = typeof window < "u" && typeof document < "u";
|
|
295
295
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
296
|
-
const
|
|
296
|
+
const Ce = Object.prototype.toString, Te = (e) => Ce.call(e) === "[object Object]", Pe = () => {
|
|
297
297
|
};
|
|
298
|
-
function
|
|
298
|
+
function _e(...e) {
|
|
299
299
|
if (e.length !== 1)
|
|
300
|
-
return
|
|
300
|
+
return de(...e);
|
|
301
301
|
const t = e[0];
|
|
302
|
-
return typeof t == "function" ?
|
|
302
|
+
return typeof t == "function" ? U(fe(() => ({ get: t, set: Pe }))) : R(t);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Oe(e, t) {
|
|
305
305
|
function n(...l) {
|
|
306
306
|
return new Promise((r, d) => {
|
|
307
307
|
Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(r).catch(d);
|
|
@@ -309,11 +309,11 @@ function Ce(e, t) {
|
|
|
309
309
|
}
|
|
310
310
|
return n;
|
|
311
311
|
}
|
|
312
|
-
const
|
|
313
|
-
function
|
|
312
|
+
const X = (e) => e();
|
|
313
|
+
function ke(e = X, t = {}) {
|
|
314
314
|
const {
|
|
315
315
|
initialState: n = "active"
|
|
316
|
-
} = t, l =
|
|
316
|
+
} = t, l = _e(n === "active");
|
|
317
317
|
function r() {
|
|
318
318
|
l.value = !1;
|
|
319
319
|
}
|
|
@@ -323,47 +323,47 @@ function Pe(e = Y, t = {}) {
|
|
|
323
323
|
const h = (...f) => {
|
|
324
324
|
l.value && e(...f);
|
|
325
325
|
};
|
|
326
|
-
return { isActive:
|
|
326
|
+
return { isActive: U(l), pause: r, resume: d, eventFilter: h };
|
|
327
327
|
}
|
|
328
328
|
function q(e) {
|
|
329
329
|
return Array.isArray(e) ? e : [e];
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
331
|
+
function xe(e) {
|
|
332
|
+
return ce();
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function De(e, t, n = {}) {
|
|
335
335
|
const {
|
|
336
|
-
eventFilter: l =
|
|
336
|
+
eventFilter: l = X,
|
|
337
337
|
...r
|
|
338
338
|
} = n;
|
|
339
339
|
return _(
|
|
340
340
|
e,
|
|
341
|
-
|
|
341
|
+
Oe(
|
|
342
342
|
l,
|
|
343
343
|
t
|
|
344
344
|
),
|
|
345
345
|
r
|
|
346
346
|
);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Re(e, t, n = {}) {
|
|
349
349
|
const {
|
|
350
350
|
eventFilter: l,
|
|
351
351
|
initialState: r = "active",
|
|
352
352
|
...d
|
|
353
|
-
} = n, { eventFilter: h, pause: f, resume: s, isActive:
|
|
354
|
-
return { stop:
|
|
353
|
+
} = n, { eventFilter: h, pause: f, resume: s, isActive: c } = ke(l, { initialState: r });
|
|
354
|
+
return { stop: De(
|
|
355
355
|
e,
|
|
356
356
|
t,
|
|
357
357
|
{
|
|
358
358
|
...d,
|
|
359
359
|
eventFilter: h
|
|
360
360
|
}
|
|
361
|
-
), pause: f, resume: s, isActive:
|
|
361
|
+
), pause: f, resume: s, isActive: c };
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
|
|
363
|
+
function Me(e, t = !0, n) {
|
|
364
|
+
xe() ? j(e, n) : t ? e() : K(e);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function qe(e, t, n) {
|
|
367
367
|
return _(
|
|
368
368
|
e,
|
|
369
369
|
t,
|
|
@@ -373,37 +373,37 @@ function De(e, t, n) {
|
|
|
373
373
|
}
|
|
374
374
|
);
|
|
375
375
|
}
|
|
376
|
-
const D =
|
|
377
|
-
function
|
|
376
|
+
const D = Ae ? window : void 0;
|
|
377
|
+
function Ne(e) {
|
|
378
378
|
var t;
|
|
379
|
-
const n =
|
|
379
|
+
const n = C(e);
|
|
380
380
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function B(...e) {
|
|
383
383
|
const t = [], n = () => {
|
|
384
384
|
t.forEach((f) => f()), t.length = 0;
|
|
385
|
-
}, l = (f, s,
|
|
386
|
-
const f = q(
|
|
385
|
+
}, l = (f, s, c, v) => (f.addEventListener(s, c, v), () => f.removeEventListener(s, c, v)), r = Y(() => {
|
|
386
|
+
const f = q(C(e[0])).filter((s) => s != null);
|
|
387
387
|
return f.every((s) => typeof s != "string") ? f : void 0;
|
|
388
|
-
}), d =
|
|
388
|
+
}), d = qe(
|
|
389
389
|
() => {
|
|
390
390
|
var f, s;
|
|
391
391
|
return [
|
|
392
|
-
(s = (f = r.value) == null ? void 0 : f.map((
|
|
393
|
-
q(
|
|
394
|
-
q(
|
|
392
|
+
(s = (f = r.value) == null ? void 0 : f.map((c) => Ne(c))) != null ? s : [D].filter((c) => c != null),
|
|
393
|
+
q(C(r.value ? e[1] : e[0])),
|
|
394
|
+
q($(r.value ? e[2] : e[1])),
|
|
395
395
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
396
|
-
|
|
396
|
+
C(r.value ? e[3] : e[2])
|
|
397
397
|
];
|
|
398
398
|
},
|
|
399
|
-
([f, s,
|
|
400
|
-
if (n(), !(f != null && f.length) || !(s != null && s.length) || !(
|
|
399
|
+
([f, s, c, v]) => {
|
|
400
|
+
if (n(), !(f != null && f.length) || !(s != null && s.length) || !(c != null && c.length))
|
|
401
401
|
return;
|
|
402
|
-
const E =
|
|
402
|
+
const E = Te(v) ? { ...v } : v;
|
|
403
403
|
t.push(
|
|
404
404
|
...f.flatMap(
|
|
405
405
|
(i) => s.flatMap(
|
|
406
|
-
(o) =>
|
|
406
|
+
(o) => c.map((m) => l(i, o, m, E))
|
|
407
407
|
)
|
|
408
408
|
)
|
|
409
409
|
);
|
|
@@ -412,19 +412,19 @@ function z(...e) {
|
|
|
412
412
|
), h = () => {
|
|
413
413
|
d(), n();
|
|
414
414
|
};
|
|
415
|
-
return
|
|
415
|
+
return be(n), h;
|
|
416
416
|
}
|
|
417
|
-
const O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, k = "__vueuse_ssr_handlers__",
|
|
418
|
-
function
|
|
417
|
+
const O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, k = "__vueuse_ssr_handlers__", We = /* @__PURE__ */ Fe();
|
|
418
|
+
function Fe() {
|
|
419
419
|
return k in O || (O[k] = O[k] || {}), O[k];
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
return
|
|
421
|
+
function $e(e, t) {
|
|
422
|
+
return We[e] || t;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function Le(e) {
|
|
425
425
|
return e == null ? "any" : e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof Date ? "date" : typeof e == "boolean" ? "boolean" : typeof e == "string" ? "string" : typeof e == "object" ? "object" : Number.isNaN(e) ? "any" : "number";
|
|
426
426
|
}
|
|
427
|
-
const
|
|
427
|
+
const je = {
|
|
428
428
|
boolean: {
|
|
429
429
|
read: (e) => e === "true",
|
|
430
430
|
write: (e) => String(e)
|
|
@@ -457,108 +457,115 @@ const Fe = {
|
|
|
457
457
|
read: (e) => new Date(e),
|
|
458
458
|
write: (e) => e.toISOString()
|
|
459
459
|
}
|
|
460
|
-
},
|
|
461
|
-
function
|
|
460
|
+
}, J = "vueuse-storage";
|
|
461
|
+
function He(e, t, n, l = {}) {
|
|
462
462
|
var r;
|
|
463
463
|
const {
|
|
464
464
|
flush: d = "pre",
|
|
465
465
|
deep: h = !0,
|
|
466
466
|
listenToStorageChanges: f = !0,
|
|
467
467
|
writeDefaults: s = !0,
|
|
468
|
-
mergeDefaults:
|
|
468
|
+
mergeDefaults: c = !1,
|
|
469
469
|
shallow: v,
|
|
470
470
|
window: E = D,
|
|
471
471
|
eventFilter: i,
|
|
472
|
-
onError: o = (
|
|
473
|
-
console.error(
|
|
472
|
+
onError: o = (u) => {
|
|
473
|
+
console.error(u);
|
|
474
474
|
},
|
|
475
475
|
initOnMounted: m
|
|
476
|
-
} = l, g = (v ?
|
|
476
|
+
} = l, g = (v ? W : R)(t), a = Y(() => C(e));
|
|
477
477
|
if (!n)
|
|
478
478
|
try {
|
|
479
|
-
n =
|
|
480
|
-
var
|
|
481
|
-
return (
|
|
479
|
+
n = $e("getDefaultStorage", () => {
|
|
480
|
+
var u;
|
|
481
|
+
return (u = D) == null ? void 0 : u.localStorage;
|
|
482
482
|
})();
|
|
483
|
-
} catch (
|
|
484
|
-
o(
|
|
483
|
+
} catch (u) {
|
|
484
|
+
o(u);
|
|
485
485
|
}
|
|
486
486
|
if (!n)
|
|
487
487
|
return g;
|
|
488
|
-
const y =
|
|
488
|
+
const y = C(t), H = Le(y), T = (r = l.serializer) != null ? r : je[H], { pause: Z, resume: V } = Re(
|
|
489
489
|
g,
|
|
490
|
-
() =>
|
|
490
|
+
() => ne(g.value),
|
|
491
491
|
{ flush: d, deep: h, eventFilter: i }
|
|
492
492
|
);
|
|
493
|
-
_(a, () => P(), { flush: d })
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
493
|
+
_(a, () => P(), { flush: d });
|
|
494
|
+
let M = !1;
|
|
495
|
+
const ee = (u) => {
|
|
496
|
+
m && !M || P(u);
|
|
497
|
+
}, te = (u) => {
|
|
498
|
+
m && !M || ie(u);
|
|
499
|
+
};
|
|
500
|
+
E && f && (n instanceof Storage ? B(E, "storage", ee, { passive: !0 }) : B(E, J, te)), m ? Me(() => {
|
|
501
|
+
M = !0, P();
|
|
502
|
+
}) : P();
|
|
503
|
+
function I(u, w) {
|
|
497
504
|
if (E) {
|
|
498
505
|
const A = {
|
|
499
506
|
key: a.value,
|
|
500
|
-
oldValue:
|
|
507
|
+
oldValue: u,
|
|
501
508
|
newValue: w,
|
|
502
509
|
storageArea: n
|
|
503
510
|
};
|
|
504
|
-
E.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(
|
|
511
|
+
E.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(J, {
|
|
505
512
|
detail: A
|
|
506
513
|
}));
|
|
507
514
|
}
|
|
508
515
|
}
|
|
509
|
-
function
|
|
516
|
+
function ne(u) {
|
|
510
517
|
try {
|
|
511
518
|
const w = n.getItem(a.value);
|
|
512
|
-
if (
|
|
513
|
-
|
|
519
|
+
if (u == null)
|
|
520
|
+
I(w, null), n.removeItem(a.value);
|
|
514
521
|
else {
|
|
515
|
-
const A =
|
|
516
|
-
w !== A && (n.setItem(a.value, A),
|
|
522
|
+
const A = T.write(u);
|
|
523
|
+
w !== A && (n.setItem(a.value, A), I(w, A));
|
|
517
524
|
}
|
|
518
525
|
} catch (w) {
|
|
519
526
|
o(w);
|
|
520
527
|
}
|
|
521
528
|
}
|
|
522
|
-
function
|
|
523
|
-
const w =
|
|
529
|
+
function oe(u) {
|
|
530
|
+
const w = u ? u.newValue : n.getItem(a.value);
|
|
524
531
|
if (w == null)
|
|
525
|
-
return s && y != null && n.setItem(a.value,
|
|
526
|
-
if (!
|
|
527
|
-
const A =
|
|
528
|
-
return typeof
|
|
529
|
-
} else return typeof w != "string" ? w :
|
|
532
|
+
return s && y != null && n.setItem(a.value, T.write(y)), y;
|
|
533
|
+
if (!u && c) {
|
|
534
|
+
const A = T.read(w);
|
|
535
|
+
return typeof c == "function" ? c(A, y) : H === "object" && !Array.isArray(A) ? { ...y, ...A } : A;
|
|
536
|
+
} else return typeof w != "string" ? w : T.read(w);
|
|
530
537
|
}
|
|
531
|
-
function P(
|
|
532
|
-
if (!(
|
|
533
|
-
if (
|
|
538
|
+
function P(u) {
|
|
539
|
+
if (!(u && u.storageArea !== n)) {
|
|
540
|
+
if (u && u.key == null) {
|
|
534
541
|
g.value = y;
|
|
535
542
|
return;
|
|
536
543
|
}
|
|
537
|
-
if (!(
|
|
538
|
-
|
|
544
|
+
if (!(u && u.key !== a.value)) {
|
|
545
|
+
Z();
|
|
539
546
|
try {
|
|
540
|
-
(
|
|
547
|
+
(u == null ? void 0 : u.newValue) !== T.write(g.value) && (g.value = oe(u));
|
|
541
548
|
} catch (w) {
|
|
542
549
|
o(w);
|
|
543
550
|
} finally {
|
|
544
|
-
|
|
551
|
+
u ? K(V) : V();
|
|
545
552
|
}
|
|
546
553
|
}
|
|
547
554
|
}
|
|
548
555
|
}
|
|
549
|
-
function
|
|
550
|
-
P(
|
|
556
|
+
function ie(u) {
|
|
557
|
+
P(u.detail);
|
|
551
558
|
}
|
|
552
559
|
return g;
|
|
553
560
|
}
|
|
554
|
-
function
|
|
561
|
+
function Ve(e, t, n = {}) {
|
|
555
562
|
const { window: l = D } = n;
|
|
556
|
-
return
|
|
563
|
+
return He(e, t, l == null ? void 0 : l.localStorage, n);
|
|
557
564
|
}
|
|
558
|
-
const
|
|
565
|
+
const Je = /* @__PURE__ */ L({
|
|
559
566
|
__name: "PCDevtoolsWrapper",
|
|
560
567
|
setup(e) {
|
|
561
|
-
const t = R(!1), n =
|
|
568
|
+
const t = R(!1), n = Ve("pinia-colada-devtools-open", !1);
|
|
562
569
|
async function l() {
|
|
563
570
|
if (!t.value && (t.value = !0, !customElements.get("pinia-colada-devtools-panel"))) {
|
|
564
571
|
const { DevtoolsPanel: d } = await import("@pinia/colada-devtools/panel");
|
|
@@ -568,24 +575,24 @@ const Ie = /* @__PURE__ */ $({
|
|
|
568
575
|
async function r() {
|
|
569
576
|
await l(), n.value = !0;
|
|
570
577
|
}
|
|
571
|
-
return
|
|
578
|
+
return j(() => {
|
|
572
579
|
requestIdleCallback(() => {
|
|
573
580
|
import("@pinia/colada-devtools/panel");
|
|
574
581
|
}), n.value && r();
|
|
575
|
-
}), (d, h) => (x(),
|
|
576
|
-
default:
|
|
577
|
-
|
|
582
|
+
}), (d, h) => (x(), F(he, null, {
|
|
583
|
+
default: pe(() => [
|
|
584
|
+
$(n) ? N("", !0) : (x(), ve("button", {
|
|
578
585
|
key: 0,
|
|
579
586
|
class: "fixed bottom-2 right-2 bg-primary-500 hover:cursor-pointer z-99999",
|
|
580
587
|
onClick: h[0] || (h[0] = (f) => r())
|
|
581
588
|
}, " 🍹 Devtools ")),
|
|
582
|
-
t.value &&
|
|
589
|
+
t.value && $(n) ? (x(), F(Se, { key: 1 })) : N("", !0)
|
|
583
590
|
]),
|
|
584
591
|
_: 1
|
|
585
592
|
}));
|
|
586
593
|
}
|
|
587
594
|
});
|
|
588
595
|
export {
|
|
589
|
-
|
|
596
|
+
Je as PiniaColadaDevtools
|
|
590
597
|
};
|
|
591
598
|
//# sourceMappingURL=index.js.map
|