@pinia/colada-devtools 0.1.4 → 0.1.5

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 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 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";
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";
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({
@@ -162,7 +162,7 @@ const b2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
162
162
  });
163
163
  }
164
164
  });
165
- const f = a2("devtools"), h = N(new MessageChannel()), s = new h2(h.value.port1);
165
+ const f = a2("devtools"), h = W(new MessageChannel()), s = new h2(h.value.port1);
166
166
  P(
167
167
  h,
168
168
  (i) => {
@@ -204,7 +204,7 @@ const b2 = [".isPip", ".port"], x2 = /* @__PURE__ */ R({
204
204
  error: null
205
205
  }), o[p].simulate = null, s.emit("queries:update", b(o)));
206
206
  });
207
- const a = N(null);
207
+ const a = W(null);
208
208
  P(a, () => {
209
209
  h.value = new MessageChannel();
210
210
  }), w2(
@@ -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 W(e) {
326
+ function M(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 = W(E(e[0])).filter((l) => l != null);
384
+ const a = M(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
- W(E(f.value ? e[1] : e[0])),
392
- W(G(f.value ? e[2] : e[1])),
391
+ M(E(f.value ? e[1] : e[0])),
392
+ M(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 M2(e, n) {
419
+ function N2(e, n) {
420
420
  return R2[e] || n;
421
421
  }
422
- function W2(e) {
422
+ function M2(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 N2 = {
425
+ const W2 = {
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 ? N : F)(n), m = X(() => E(e));
474
+ } = r, o = (v ? W : F)(n), m = X(() => E(e));
475
475
  if (!t)
476
476
  try {
477
- t = M2("getDefaultStorage", () => {
477
+ t = N2("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 = W2(y), w = (f = r.serializer) != null ? f : N2[c], { pause: t2, resume: j } = G2(
486
+ const y = E(n), c = M2(y), w = (f = r.serializer) != null ? f : W2[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 M = !1;
492
+ let N = !1;
493
493
  const o2 = (u) => {
494
- i && !M || _(u);
494
+ i && !N || _(u);
495
495
  }, n2 = (u) => {
496
- i && !M || l2(u);
496
+ i && !N || l2(u);
497
497
  };
498
498
  x && a && (t instanceof Storage ? I(x, "storage", o2, { passive: !0 }) : I(x, H, n2)), i ? U2(() => {
499
- M = !0, _();
499
+ N = !0, _();
500
500
  }) : _();
501
501
  function B(u, g) {
502
502
  if (x) {
@@ -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: () => !0 }
608
+ disabled: { type: Boolean, default: () => process.env.NODE_ENV === "production" }
609
609
  },
610
610
  setup(e) {
611
611
  return (n, t) => n.disabled ? U("", !0) : (C(), D(H2, { key: 0 }));