@pinia/colada-devtools 0.1.2 → 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.
Files changed (27) hide show
  1. package/dist/index.js +45 -46
  2. package/dist/index.js.map +1 -1
  3. package/dist-panel/{_queryId_-DAN49PlJ.js → _queryId_-Bilvrtoo.js} +14 -14
  4. package/dist-panel/{_queryId_-DAN49PlJ.js.map → _queryId_-Bilvrtoo.js.map} +1 -1
  5. package/dist-panel/{index-D2ld1JQh.js → index-B6c9Loor.js} +3 -3
  6. package/dist-panel/{index-D2ld1JQh.js.map → index-B6c9Loor.js.map} +1 -1
  7. package/dist-panel/index-D50XbbDk.js +6492 -0
  8. package/dist-panel/index-D50XbbDk.js.map +1 -0
  9. package/dist-panel/{index-DLAeHded.js → index-DsbwSvSM.js} +2 -2
  10. package/dist-panel/{index-DLAeHded.js.map → index-DsbwSvSM.js.map} +1 -1
  11. package/dist-panel/index.js +1 -1
  12. package/dist-panel/{loader-DDguy1zR.js → loader-BxXz3POc.js} +2 -2
  13. package/dist-panel/loader-BxXz3POc.js.map +1 -0
  14. package/dist-panel/{mouse-pointer-click-BPVNmt6b.js → mouse-pointer-click--GgfMFjw.js} +2 -2
  15. package/dist-panel/mouse-pointer-click--GgfMFjw.js.map +1 -0
  16. package/dist-panel/{mutations-45GG_V3a.js → mutations-CNQGJZrN.js} +2 -2
  17. package/dist-panel/{mutations-45GG_V3a.js.map → mutations-CNQGJZrN.js.map} +1 -1
  18. package/dist-panel/{queries-DvBTnRTp.js → queries-CSBvC4-S.js} +6 -6
  19. package/dist-panel/queries-CSBvC4-S.js.map +1 -0
  20. package/dist-panel/{settings-Dmfe8j1F.js → settings-Cl-hr-ie.js} +2 -2
  21. package/dist-panel/{settings-Dmfe8j1F.js.map → settings-Cl-hr-ie.js.map} +1 -1
  22. package/package.json +5 -5
  23. package/dist-panel/index-bwZG0BLQ.js +0 -8136
  24. package/dist-panel/index-bwZG0BLQ.js.map +0 -1
  25. package/dist-panel/loader-DDguy1zR.js.map +0 -1
  26. package/dist-panel/mouse-pointer-click-BPVNmt6b.js.map +0 -1
  27. package/dist-panel/queries-DvBTnRTp.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 W, 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";
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 w(e) {
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 b2(e, n, t, r) {
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 w2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
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", w(c));
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 b = w(c);
143
- b.asyncStatus = "loading", s.emit("queries:update", b);
142
+ const w = b(c);
143
+ w.asyncStatus = "loading", s.emit("queries:update", w);
144
144
  }
145
145
  o(() => {
146
- var b;
147
- c[p].simulate = null, s.emit("queries:update", w(c)), i === "fetch" && ((b = c.options) == null ? void 0 : b.staleTime) != null && Number.isFinite(c.options.staleTime) && setTimeout(() => {
148
- s.emit("queries:update", w(c));
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", w(c));
151
+ s.emit("queries:update", b(c));
152
152
  });
153
153
  } else if (i === "create")
154
154
  o((c) => {
155
- s.emit("queries:update", w(c));
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 b = r.getEntries({ key: c, exact: !0 })[0];
161
- b && s.emit("queries:update", w(b));
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 = W(new MessageChannel()), s = new h2(h.value.port1);
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", w(m)));
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", w(o)));
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", w(o)));
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", w(o)));
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", w(o)));
205
+ }), o[p].simulate = null, s.emit("queries:update", b(o)));
206
206
  });
207
- const a = W(null);
207
+ const a = N(null);
208
208
  P(a, () => {
209
209
  h.value = new MessageChannel();
210
- }), b2(
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(w)), s.emit(
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(w)
272
+ r.getEntries().map(b)
273
273
  );
274
274
  }
275
275
  return (i, o) => (C(), D(u2, {
@@ -277,13 +277,12 @@ const w2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
277
277
  }, [
278
278
  Q("pinia-colada-devtools-panel", {
279
279
  ref: "devtools",
280
- style: { height: "100%" },
281
280
  ".isPip": !!a.value,
282
281
  ".port": h.value.port2,
283
282
  onTogglePip: o[0] || (o[0] = (m) => x()),
284
283
  onReady: o[1] || (o[1] = (m) => z()),
285
284
  onClose: o[2] || (o[2] = (m) => t("close"))
286
- }, null, 40, w2)
285
+ }, null, 40, b2)
287
286
  ], 8, ["to"]));
288
287
  }
289
288
  });
@@ -324,7 +323,7 @@ function P2(e = e2, n = {}) {
324
323
  };
325
324
  return { isActive: K(r), pause: f, resume: h, eventFilter: s };
326
325
  }
327
- function M(e) {
326
+ function W(e) {
328
327
  return Array.isArray(e) ? e : [e];
329
328
  }
330
329
  function T2(e) {
@@ -382,15 +381,15 @@ function I(...e) {
382
381
  const n = [], t = () => {
383
382
  n.forEach((a) => a()), n.length = 0;
384
383
  }, r = (a, l, d, v) => (a.addEventListener(l, d, v), () => a.removeEventListener(l, d, v)), f = X(() => {
385
- const a = M(E(e[0])).filter((l) => l != null);
384
+ const a = W(E(e[0])).filter((l) => l != null);
386
385
  return a.every((l) => typeof l != "string") ? a : void 0;
387
386
  }), h = D2(
388
387
  () => {
389
388
  var a, l;
390
389
  return [
391
390
  (l = (a = f.value) == null ? void 0 : a.map((d) => q2(d))) != null ? l : [q].filter((d) => d != null),
392
- M(E(f.value ? e[1] : e[0])),
393
- M(G(f.value ? e[2] : e[1])),
391
+ W(E(f.value ? e[1] : e[0])),
392
+ W(G(f.value ? e[2] : e[1])),
394
393
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
395
394
  E(f.value ? e[3] : e[2])
396
395
  ];
@@ -417,13 +416,13 @@ const T = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window :
417
416
  function F2() {
418
417
  return A in T || (T[A] = T[A] || {}), T[A];
419
418
  }
420
- function N2(e, n) {
419
+ function M2(e, n) {
421
420
  return R2[e] || n;
422
421
  }
423
- function M2(e) {
422
+ function W2(e) {
424
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";
425
424
  }
426
- const W2 = {
425
+ const N2 = {
427
426
  boolean: {
428
427
  read: (e) => e === "true",
429
428
  write: (e) => String(e)
@@ -472,10 +471,10 @@ function $2(e, n, t, r = {}) {
472
471
  console.error(u);
473
472
  },
474
473
  initOnMounted: i
475
- } = r, o = (v ? W : F)(n), m = X(() => E(e));
474
+ } = r, o = (v ? N : F)(n), m = X(() => E(e));
476
475
  if (!t)
477
476
  try {
478
- t = N2("getDefaultStorage", () => {
477
+ t = M2("getDefaultStorage", () => {
479
478
  var u;
480
479
  return (u = q) == null ? void 0 : u.localStorage;
481
480
  })();
@@ -484,20 +483,20 @@ function $2(e, n, t, r = {}) {
484
483
  }
485
484
  if (!t)
486
485
  return o;
487
- const y = E(n), c = M2(y), b = (f = r.serializer) != null ? f : W2[c], { pause: t2, resume: j } = G2(
486
+ const y = E(n), c = W2(y), w = (f = r.serializer) != null ? f : N2[c], { pause: t2, resume: j } = G2(
488
487
  o,
489
488
  () => i2(o.value),
490
489
  { flush: h, deep: s, eventFilter: O }
491
490
  );
492
491
  P(m, () => _(), { flush: h });
493
- let N = !1;
492
+ let M = !1;
494
493
  const o2 = (u) => {
495
- i && !N || _(u);
494
+ i && !M || _(u);
496
495
  }, n2 = (u) => {
497
- i && !N || l2(u);
496
+ i && !M || l2(u);
498
497
  };
499
498
  x && a && (t instanceof Storage ? I(x, "storage", o2, { passive: !0 }) : I(x, H, n2)), i ? U2(() => {
500
- N = !0, _();
499
+ M = !0, _();
501
500
  }) : _();
502
501
  function B(u, g) {
503
502
  if (x) {
@@ -518,7 +517,7 @@ function $2(e, n, t, r = {}) {
518
517
  if (u == null)
519
518
  B(g, null), t.removeItem(m.value);
520
519
  else {
521
- const S = b.write(u);
520
+ const S = w.write(u);
522
521
  g !== S && (t.setItem(m.value, S), B(g, S));
523
522
  }
524
523
  } catch (g) {
@@ -528,11 +527,11 @@ function $2(e, n, t, r = {}) {
528
527
  function r2(u) {
529
528
  const g = u ? u.newValue : t.getItem(m.value);
530
529
  if (g == null)
531
- return l && y != null && t.setItem(m.value, b.write(y)), y;
530
+ return l && y != null && t.setItem(m.value, w.write(y)), y;
532
531
  if (!u && d) {
533
- const S = b.read(g);
532
+ const S = w.read(g);
534
533
  return typeof d == "function" ? d(S, y) : c === "object" && !Array.isArray(S) ? { ...y, ...S } : S;
535
- } else return typeof g != "string" ? g : b.read(g);
534
+ } else return typeof g != "string" ? g : w.read(g);
536
535
  }
537
536
  function _(u) {
538
537
  if (!(u && u.storageArea !== t)) {
@@ -543,7 +542,7 @@ function $2(e, n, t, r = {}) {
543
542
  if (!(u && u.key !== m.value)) {
544
543
  t2();
545
544
  try {
546
- (u == null ? void 0 : u.newValue) !== b.write(o.value) && (o.value = r2(u));
545
+ (u == null ? void 0 : u.newValue) !== w.write(o.value) && (o.value = r2(u));
547
546
  } catch (g) {
548
547
  z(g);
549
548
  } finally {
@@ -606,7 +605,7 @@ const B2 = "data:image/svg+xml,%3csvg%20fill='none'%20height='898'%20viewBox='0%
606
605
  }), Y2 = /* @__PURE__ */ R({
607
606
  __name: "ProductionWrapper",
608
607
  props: {
609
- disabled: { type: Boolean, default: () => process.env.NODE_ENV === "production" }
608
+ disabled: { type: Boolean, default: () => !0 }
610
609
  },
611
610
  setup(e) {
612
611
  return (n, t) => n.disabled ? U("", !0) : (C(), D(H2, { key: 0 }));