@pinia/colada-devtools 0.1.3 → 0.1.4
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 +45 -45
- package/dist/index.js.map +1 -1
- package/dist-panel/{_queryId_-DBYj1x2l.js → _queryId_-Bilvrtoo.js} +14 -14
- package/dist-panel/{_queryId_-DBYj1x2l.js.map → _queryId_-Bilvrtoo.js.map} +1 -1
- package/dist-panel/{index-B5Pabqnp.js → index-B6c9Loor.js} +3 -3
- package/dist-panel/{index-B5Pabqnp.js.map → index-B6c9Loor.js.map} +1 -1
- package/dist-panel/index-D50XbbDk.js +6492 -0
- package/dist-panel/index-D50XbbDk.js.map +1 -0
- package/dist-panel/{index-BiCss4be.js → index-DsbwSvSM.js} +2 -2
- package/dist-panel/{index-BiCss4be.js.map → index-DsbwSvSM.js.map} +1 -1
- package/dist-panel/index.js +1 -1
- package/dist-panel/{loader-1Im1Cd49.js → loader-BxXz3POc.js} +2 -2
- package/dist-panel/loader-BxXz3POc.js.map +1 -0
- package/dist-panel/{mouse-pointer-click-DrNfYH7O.js → mouse-pointer-click--GgfMFjw.js} +2 -2
- package/dist-panel/mouse-pointer-click--GgfMFjw.js.map +1 -0
- package/dist-panel/{mutations-CXpAyQVd.js → mutations-CNQGJZrN.js} +2 -2
- package/dist-panel/{mutations-CXpAyQVd.js.map → mutations-CNQGJZrN.js.map} +1 -1
- package/dist-panel/{queries-C2Kny_VH.js → queries-CSBvC4-S.js} +6 -6
- package/dist-panel/{queries-C2Kny_VH.js.map → queries-CSBvC4-S.js.map} +1 -1
- package/dist-panel/{settings-kYLoG5O4.js → settings-Cl-hr-ie.js} +2 -2
- package/dist-panel/{settings-kYLoG5O4.js.map → settings-Cl-hr-ie.js.map} +1 -1
- package/package.json +1 -1
- package/dist-panel/index-BCMgcfY0.js +0 -8157
- package/dist-panel/index-BCMgcfY0.js.map +0 -1
- package/dist-panel/loader-1Im1Cd49.js.map +0 -1
- package/dist-panel/mouse-pointer-click-DrNfYH7O.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as R, ref as F, onMounted as $, renderSlot as s2, createCommentVNode as U, toValue as E, getCurrentScope as V, onScopeDispose as J, useTemplateRef as a2, shallowRef as
|
|
1
|
+
import { defineComponent as R, ref as F, onMounted as $, renderSlot as s2, createCommentVNode as U, toValue as E, getCurrentScope as V, onScopeDispose as J, useTemplateRef as a2, shallowRef as N, watch as P, onBeforeUnmount as c2, createBlock as D, openBlock as C, Teleport as u2, createElementVNode as Q, nextTick as Y, readonly as K, getCurrentInstance as d2, toRef as f2, customRef as p2, computed as X, unref as G, withCtx as m2, createElementBlock as v2 } from "vue";
|
|
2
2
|
import { useQueryCache as Z } from "@pinia/colada";
|
|
3
3
|
import { DEVTOOLS_INFO_KEY as p, DuplexChannel as h2 } from "@pinia/colada-devtools/shared";
|
|
4
4
|
const y2 = /* @__PURE__ */ R({
|
|
@@ -87,7 +87,7 @@ function g2(e) {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function b(e) {
|
|
91
91
|
return {
|
|
92
92
|
keyHash: e.keyHash,
|
|
93
93
|
key: e.key,
|
|
@@ -120,12 +120,12 @@ function w(e) {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
const L = /* @__PURE__ */ new WeakMap();
|
|
123
|
-
function
|
|
123
|
+
function w2(e, n, t, r) {
|
|
124
124
|
e.addEventListener(n, t, r), V() && J(() => {
|
|
125
125
|
e.removeEventListener(n, t);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const b2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
|
|
129
129
|
__name: "PiniaColadaDevtools",
|
|
130
130
|
emits: ["close"],
|
|
131
131
|
setup(e, { emit: n }) {
|
|
@@ -134,35 +134,35 @@ const w2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
|
|
|
134
134
|
if (i === "remove") {
|
|
135
135
|
const [c] = y;
|
|
136
136
|
o(() => {
|
|
137
|
-
s.emit("queries:delete",
|
|
137
|
+
s.emit("queries:delete", b(c));
|
|
138
138
|
});
|
|
139
139
|
} else if (i === "track" || i === "untrack" || i === "cancel" || i === "invalidate" || i === "fetch" || i === "setEntryState") {
|
|
140
140
|
const [c] = y;
|
|
141
141
|
if (i === "fetch") {
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const w = b(c);
|
|
143
|
+
w.asyncStatus = "loading", s.emit("queries:update", w);
|
|
144
144
|
}
|
|
145
145
|
o(() => {
|
|
146
|
-
var
|
|
147
|
-
c[p].simulate = null, s.emit("queries:update",
|
|
148
|
-
s.emit("queries:update",
|
|
146
|
+
var w;
|
|
147
|
+
c[p].simulate = null, s.emit("queries:update", b(c)), i === "fetch" && ((w = c.options) == null ? void 0 : w.staleTime) != null && Number.isFinite(c.options.staleTime) && setTimeout(() => {
|
|
148
|
+
s.emit("queries:update", b(c));
|
|
149
149
|
}, c.options.staleTime);
|
|
150
150
|
}), m(() => {
|
|
151
|
-
s.emit("queries:update",
|
|
151
|
+
s.emit("queries:update", b(c));
|
|
152
152
|
});
|
|
153
153
|
} else if (i === "create")
|
|
154
154
|
o((c) => {
|
|
155
|
-
s.emit("queries:update",
|
|
155
|
+
s.emit("queries:update", b(c));
|
|
156
156
|
});
|
|
157
157
|
else if (i === "setQueryData") {
|
|
158
158
|
const [c] = y;
|
|
159
159
|
o(() => {
|
|
160
|
-
const
|
|
161
|
-
|
|
160
|
+
const w = r.getEntries({ key: c, exact: !0 })[0];
|
|
161
|
+
w && s.emit("queries:update", b(w));
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
const f = a2("devtools"), h =
|
|
165
|
+
const f = a2("devtools"), h = N(new MessageChannel()), s = new h2(h.value.port1);
|
|
166
166
|
P(
|
|
167
167
|
h,
|
|
168
168
|
(i) => {
|
|
@@ -182,32 +182,32 @@ const w2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
|
|
|
182
182
|
}));
|
|
183
183
|
}), s.on("queries:set:state", (i, o) => {
|
|
184
184
|
const m = r.getEntries({ key: i, exact: !0 })[0];
|
|
185
|
-
m && (r.setEntryState(m, o), s.emit("queries:update",
|
|
185
|
+
m && (r.setEntryState(m, o), s.emit("queries:update", b(m)));
|
|
186
186
|
}), s.on("queries:simulate:loading", (i) => {
|
|
187
187
|
const o = r.getEntries({ key: i, exact: !0 })[0];
|
|
188
|
-
o && (o.asyncStatus.value = "loading", o[p].simulate = "loading", s.emit("queries:update",
|
|
188
|
+
o && (o.asyncStatus.value = "loading", o[p].simulate = "loading", s.emit("queries:update", b(o)));
|
|
189
189
|
}), s.on("queries:simulate:loading:stop", (i) => {
|
|
190
190
|
const o = r.getEntries({ key: i, exact: !0 })[0];
|
|
191
|
-
o && o[p].simulate === "loading" && (o.asyncStatus.value = "idle", o[p].simulate = null, s.emit("queries:update",
|
|
191
|
+
o && o[p].simulate === "loading" && (o.asyncStatus.value = "idle", o[p].simulate = null, s.emit("queries:update", b(o)));
|
|
192
192
|
}), s.on("queries:simulate:error", (i) => {
|
|
193
193
|
const o = r.getEntries({ key: i, exact: !0 })[0];
|
|
194
194
|
o && (r.cancel(o), r.setEntryState(o, {
|
|
195
195
|
...o.state.value,
|
|
196
196
|
status: "error",
|
|
197
197
|
error: new Error("Simulated error")
|
|
198
|
-
}), o[p].simulate = "error", s.emit("queries:update",
|
|
198
|
+
}), o[p].simulate = "error", s.emit("queries:update", b(o)));
|
|
199
199
|
}), s.on("queries:simulate:error:stop", (i) => {
|
|
200
200
|
const o = r.getEntries({ key: i, exact: !0 })[0];
|
|
201
201
|
o && o[p].simulate === "error" && (r.cancel(o), r.setEntryState(o, {
|
|
202
202
|
...o.state.value,
|
|
203
203
|
status: o.state.value.data !== void 0 ? "success" : "pending",
|
|
204
204
|
error: null
|
|
205
|
-
}), o[p].simulate = null, s.emit("queries:update",
|
|
205
|
+
}), o[p].simulate = null, s.emit("queries:update", b(o)));
|
|
206
206
|
});
|
|
207
|
-
const a =
|
|
207
|
+
const a = N(null);
|
|
208
208
|
P(a, () => {
|
|
209
209
|
h.value = new MessageChannel();
|
|
210
|
-
}),
|
|
210
|
+
}), w2(
|
|
211
211
|
window,
|
|
212
212
|
"unload",
|
|
213
213
|
() => {
|
|
@@ -266,10 +266,10 @@ const w2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
|
|
|
266
266
|
}, 100);
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
v(f.value), s.emit("queries:all", r.getEntries().map(
|
|
269
|
+
v(f.value), s.emit("queries:all", r.getEntries().map(b)), s.emit(
|
|
270
270
|
"mutations:all",
|
|
271
271
|
// FIXME: add mutations
|
|
272
|
-
r.getEntries().map(
|
|
272
|
+
r.getEntries().map(b)
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
return (i, o) => (C(), D(u2, {
|
|
@@ -282,7 +282,7 @@ const w2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
|
|
|
282
282
|
onTogglePip: o[0] || (o[0] = (m) => x()),
|
|
283
283
|
onReady: o[1] || (o[1] = (m) => z()),
|
|
284
284
|
onClose: o[2] || (o[2] = (m) => t("close"))
|
|
285
|
-
}, null, 40,
|
|
285
|
+
}, null, 40, b2)
|
|
286
286
|
], 8, ["to"]));
|
|
287
287
|
}
|
|
288
288
|
});
|
|
@@ -323,7 +323,7 @@ function P2(e = e2, n = {}) {
|
|
|
323
323
|
};
|
|
324
324
|
return { isActive: K(r), pause: f, resume: h, eventFilter: s };
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function W(e) {
|
|
327
327
|
return Array.isArray(e) ? e : [e];
|
|
328
328
|
}
|
|
329
329
|
function T2(e) {
|
|
@@ -381,15 +381,15 @@ function I(...e) {
|
|
|
381
381
|
const n = [], t = () => {
|
|
382
382
|
n.forEach((a) => a()), n.length = 0;
|
|
383
383
|
}, r = (a, l, d, v) => (a.addEventListener(l, d, v), () => a.removeEventListener(l, d, v)), f = X(() => {
|
|
384
|
-
const a =
|
|
384
|
+
const a = W(E(e[0])).filter((l) => l != null);
|
|
385
385
|
return a.every((l) => typeof l != "string") ? a : void 0;
|
|
386
386
|
}), h = D2(
|
|
387
387
|
() => {
|
|
388
388
|
var a, l;
|
|
389
389
|
return [
|
|
390
390
|
(l = (a = f.value) == null ? void 0 : a.map((d) => q2(d))) != null ? l : [q].filter((d) => d != null),
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
W(E(f.value ? e[1] : e[0])),
|
|
392
|
+
W(G(f.value ? e[2] : e[1])),
|
|
393
393
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
394
394
|
E(f.value ? e[3] : e[2])
|
|
395
395
|
];
|
|
@@ -416,13 +416,13 @@ const T = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window :
|
|
|
416
416
|
function F2() {
|
|
417
417
|
return A in T || (T[A] = T[A] || {}), T[A];
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function M2(e, n) {
|
|
420
420
|
return R2[e] || n;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function W2(e) {
|
|
423
423
|
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";
|
|
424
424
|
}
|
|
425
|
-
const
|
|
425
|
+
const N2 = {
|
|
426
426
|
boolean: {
|
|
427
427
|
read: (e) => e === "true",
|
|
428
428
|
write: (e) => String(e)
|
|
@@ -471,10 +471,10 @@ function $2(e, n, t, r = {}) {
|
|
|
471
471
|
console.error(u);
|
|
472
472
|
},
|
|
473
473
|
initOnMounted: i
|
|
474
|
-
} = r, o = (v ?
|
|
474
|
+
} = r, o = (v ? N : F)(n), m = X(() => E(e));
|
|
475
475
|
if (!t)
|
|
476
476
|
try {
|
|
477
|
-
t =
|
|
477
|
+
t = M2("getDefaultStorage", () => {
|
|
478
478
|
var u;
|
|
479
479
|
return (u = q) == null ? void 0 : u.localStorage;
|
|
480
480
|
})();
|
|
@@ -483,20 +483,20 @@ function $2(e, n, t, r = {}) {
|
|
|
483
483
|
}
|
|
484
484
|
if (!t)
|
|
485
485
|
return o;
|
|
486
|
-
const y = E(n), c =
|
|
486
|
+
const y = E(n), c = W2(y), w = (f = r.serializer) != null ? f : N2[c], { pause: t2, resume: j } = G2(
|
|
487
487
|
o,
|
|
488
488
|
() => i2(o.value),
|
|
489
489
|
{ flush: h, deep: s, eventFilter: O }
|
|
490
490
|
);
|
|
491
491
|
P(m, () => _(), { flush: h });
|
|
492
|
-
let
|
|
492
|
+
let M = !1;
|
|
493
493
|
const o2 = (u) => {
|
|
494
|
-
i && !
|
|
494
|
+
i && !M || _(u);
|
|
495
495
|
}, n2 = (u) => {
|
|
496
|
-
i && !
|
|
496
|
+
i && !M || l2(u);
|
|
497
497
|
};
|
|
498
498
|
x && a && (t instanceof Storage ? I(x, "storage", o2, { passive: !0 }) : I(x, H, n2)), i ? U2(() => {
|
|
499
|
-
|
|
499
|
+
M = !0, _();
|
|
500
500
|
}) : _();
|
|
501
501
|
function B(u, g) {
|
|
502
502
|
if (x) {
|
|
@@ -517,7 +517,7 @@ function $2(e, n, t, r = {}) {
|
|
|
517
517
|
if (u == null)
|
|
518
518
|
B(g, null), t.removeItem(m.value);
|
|
519
519
|
else {
|
|
520
|
-
const S =
|
|
520
|
+
const S = w.write(u);
|
|
521
521
|
g !== S && (t.setItem(m.value, S), B(g, S));
|
|
522
522
|
}
|
|
523
523
|
} catch (g) {
|
|
@@ -527,11 +527,11 @@ function $2(e, n, t, r = {}) {
|
|
|
527
527
|
function r2(u) {
|
|
528
528
|
const g = u ? u.newValue : t.getItem(m.value);
|
|
529
529
|
if (g == null)
|
|
530
|
-
return l && y != null && t.setItem(m.value,
|
|
530
|
+
return l && y != null && t.setItem(m.value, w.write(y)), y;
|
|
531
531
|
if (!u && d) {
|
|
532
|
-
const S =
|
|
532
|
+
const S = w.read(g);
|
|
533
533
|
return typeof d == "function" ? d(S, y) : c === "object" && !Array.isArray(S) ? { ...y, ...S } : S;
|
|
534
|
-
} else return typeof g != "string" ? g :
|
|
534
|
+
} else return typeof g != "string" ? g : w.read(g);
|
|
535
535
|
}
|
|
536
536
|
function _(u) {
|
|
537
537
|
if (!(u && u.storageArea !== t)) {
|
|
@@ -542,7 +542,7 @@ function $2(e, n, t, r = {}) {
|
|
|
542
542
|
if (!(u && u.key !== m.value)) {
|
|
543
543
|
t2();
|
|
544
544
|
try {
|
|
545
|
-
(u == null ? void 0 : u.newValue) !==
|
|
545
|
+
(u == null ? void 0 : u.newValue) !== w.write(o.value) && (o.value = r2(u));
|
|
546
546
|
} catch (g) {
|
|
547
547
|
z(g);
|
|
548
548
|
} finally {
|
|
@@ -605,7 +605,7 @@ const B2 = "data:image/svg+xml,%3csvg%20fill='none'%20height='898'%20viewBox='0%
|
|
|
605
605
|
}), Y2 = /* @__PURE__ */ R({
|
|
606
606
|
__name: "ProductionWrapper",
|
|
607
607
|
props: {
|
|
608
|
-
disabled: { type: Boolean, default: () =>
|
|
608
|
+
disabled: { type: Boolean, default: () => !0 }
|
|
609
609
|
},
|
|
610
610
|
setup(e) {
|
|
611
611
|
return (n, t) => n.disabled ? U("", !0) : (C(), D(H2, { key: 0 }));
|