@pinia/colada-devtools 0.1.9 → 0.2.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.
- package/dist/index.js +488 -372
- package/dist/index.js.map +1 -1
- package/dist-panel/(unselected)-B-_Xdo2t.js +17 -0
- package/dist-panel/(unselected)-B-_Xdo2t.js.map +1 -0
- package/dist-panel/{index-BNGmSTu0.js → (unselected)-BFwQCIEo.js} +5 -5
- package/dist-panel/(unselected)-BFwQCIEo.js.map +1 -0
- package/dist-panel/_mutationId_-BG1E7StK.js +306 -0
- package/dist-panel/_mutationId_-BG1E7StK.js.map +1 -0
- package/dist-panel/_queryId_-BHPtMxoe.js +423 -0
- package/dist-panel/_queryId_-BHPtMxoe.js.map +1 -0
- package/dist-panel/braces-B9tH-Qp5.js +294 -0
- package/dist-panel/braces-B9tH-Qp5.js.map +1 -0
- package/dist-panel/index-CTwvPt67.js +6403 -0
- package/dist-panel/index-CTwvPt67.js.map +1 -0
- package/dist-panel/{index-goOYcO8U.js → index-kHk614RY.js} +2 -2
- package/dist-panel/{index-goOYcO8U.js.map → index-kHk614RY.js.map} +1 -1
- package/dist-panel/index.js +1 -1
- package/dist-panel/{loader-t1YDOb8H.js → loader-nEPBwFfz.js} +2 -2
- package/dist-panel/loader-nEPBwFfz.js.map +1 -0
- package/dist-panel/{mouse-pointer-click-BMFWvdTu.js → mouse-pointer-click-DQLuAnaZ.js} +2 -2
- package/dist-panel/mouse-pointer-click-DQLuAnaZ.js.map +1 -0
- package/dist-panel/mutations-BZWQwG2S.js +297 -0
- package/dist-panel/mutations-BZWQwG2S.js.map +1 -0
- package/dist-panel/queries-D3ybdTKc.js +286 -0
- package/dist-panel/queries-D3ybdTKc.js.map +1 -0
- package/dist-panel/{settings-BRfTfxFz.js → settings-DddAyvXJ.js} +2 -2
- package/dist-panel/{settings-BRfTfxFz.js.map → settings-DddAyvXJ.js.map} +1 -1
- package/dist-panel/use-container-media-query-BWmwm2oB.js +555 -0
- package/dist-panel/use-container-media-query-BWmwm2oB.js.map +1 -0
- package/dist-shared/index.d.ts +105 -9
- package/dist-shared/index.js.map +1 -1
- package/package.json +9 -10
- package/dist-panel/_queryId_-BizYY_I8.js +0 -701
- package/dist-panel/_queryId_-BizYY_I8.js.map +0 -1
- package/dist-panel/index-BNGmSTu0.js.map +0 -1
- package/dist-panel/index-CIfbEdr_.js +0 -6340
- package/dist-panel/index-CIfbEdr_.js.map +0 -1
- package/dist-panel/loader-t1YDOb8H.js.map +0 -1
- package/dist-panel/mouse-pointer-click-BMFWvdTu.js.map +0 -1
- package/dist-panel/mutations-BNe8aMZH.js +0 -13
- package/dist-panel/mutations-BNe8aMZH.js.map +0 -1
- package/dist-panel/queries-0xQLbzuX.js +0 -795
- package/dist-panel/queries-0xQLbzuX.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { _ as o } from "./mouse-pointer-click-DQLuAnaZ.js";
|
|
2
|
+
import { _ as c, c as s, o as n, a as _, q as a, i as r } from "./index-CTwvPt67.js";
|
|
3
|
+
const i = {}, l = { class: "py-6 mx-auto" }, p = { class: "flex flex-col text-center items-center gap-2 text-lg px-2" };
|
|
4
|
+
function d(m, e) {
|
|
5
|
+
const t = o;
|
|
6
|
+
return n(), s("div", l, [
|
|
7
|
+
_("p", p, [
|
|
8
|
+
e[0] || (e[0] = a(" Select a Mutation to inspect ", -1)),
|
|
9
|
+
r(t)
|
|
10
|
+
])
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
const f = /* @__PURE__ */ c(i, [["render", d]]);
|
|
14
|
+
export {
|
|
15
|
+
f as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=(unselected)-B-_Xdo2t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"(unselected)-B-_Xdo2t.js","sources":["../src/panel/pages/mutations/(unselected).vue"],"sourcesContent":["<script setup lang=\"ts\"></script>\n\n<template>\n <div class=\"py-6 mx-auto\">\n <p class=\"flex flex-col text-center items-center gap-2 text-lg px-2\">\n Select a Mutation to inspect\n <i-lucide-mouse-pointer-click />\n </p>\n </div>\n</template>\n"],"names":["_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_component_i_lucide_mouse_pointer_click"],"mappings":";;cAGOA,IAAA,EAAA,OAAM,eAAc,GACpBC,IAAA,EAAA,OAAM,4DAA2D;;;AADtE,SAAAC,EAAA,GAAAC,EAKM,OALNH,GAKM;AAAA,IAJJI,EAGI,KAHJH,GAGI;AAAA,wBAHiE,kCAEnE,EAAA;AAAA,MAAAI,EAAgCC,CAAA;AAAA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as o } from "./mouse-pointer-click-
|
|
2
|
-
import { _ as c, c as s, o as n, a as _,
|
|
1
|
+
import { _ as o } from "./mouse-pointer-click-DQLuAnaZ.js";
|
|
2
|
+
import { _ as c, c as s, o as n, a as _, q as a, i as r } from "./index-CTwvPt67.js";
|
|
3
3
|
const i = {}, l = { class: "py-6 mx-auto" }, p = { class: "flex flex-col text-center items-center gap-2 text-lg px-2" };
|
|
4
4
|
function d(m, e) {
|
|
5
5
|
const t = o;
|
|
@@ -10,8 +10,8 @@ function d(m, e) {
|
|
|
10
10
|
])
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const f = /* @__PURE__ */ c(i, [["render", d]]);
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
f as default
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=(unselected)-BFwQCIEo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"(unselected)-BFwQCIEo.js","sources":["../src/panel/pages/queries/(unselected).vue"],"sourcesContent":["<script setup lang=\"ts\"></script>\n\n<template>\n <div class=\"py-6 mx-auto\">\n <p class=\"flex flex-col text-center items-center gap-2 text-lg px-2\">\n Select a Query to inspect\n <i-lucide-mouse-pointer-click />\n </p>\n </div>\n</template>\n"],"names":["_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_component_i_lucide_mouse_pointer_click"],"mappings":";;cAGOA,IAAA,EAAA,OAAM,eAAc,GACpBC,IAAA,EAAA,OAAM,4DAA2D;;;AADtE,SAAAC,EAAA,GAAAC,EAKM,OALNH,GAKM;AAAA,IAJJI,EAGI,KAHJH,GAGI;AAAA,wBAHiE,+BAEnE,EAAA;AAAA,MAAAI,EAAgCC,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { _ as L } from "./mouse-pointer-click-DQLuAnaZ.js";
|
|
2
|
+
import { I as q, _ as G, a as H, b as J, c as P, d as X, e as K, f as Q, g as Y } from "./braces-B9tH-Qp5.js";
|
|
3
|
+
import { m as V, c as u, o as a, a as o, d as Z, k as ee, b as te, s as oe, j as se, v as M, p as w, F as N, i as s, w as l, g as n, x as b, q as p, y as ne, u as ae, f as C, t as f, z as ie, A as le, e as x, B as ue } from "./index-CTwvPt67.js";
|
|
4
|
+
import { _ as re, a as de } from "./loader-nEPBwFfz.js";
|
|
5
|
+
const pe = {
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
width: "1.2em",
|
|
8
|
+
height: "1.2em"
|
|
9
|
+
};
|
|
10
|
+
function me(I, m) {
|
|
11
|
+
return a(), u("svg", pe, [...m[0] || (m[0] = [
|
|
12
|
+
o("g", {
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
"stroke-linecap": "round",
|
|
16
|
+
"stroke-linejoin": "round",
|
|
17
|
+
"stroke-width": "2"
|
|
18
|
+
}, [
|
|
19
|
+
o("path", { d: "m2 9l3-3l3 3" }),
|
|
20
|
+
o("path", { d: "M13 18H7a2 2 0 0 1-2-2V6m17 9l-3 3l-3-3" }),
|
|
21
|
+
o("path", { d: "M11 6h6a2 2 0 0 1 2 2v10" })
|
|
22
|
+
], -1)
|
|
23
|
+
])]);
|
|
24
|
+
}
|
|
25
|
+
const ce = V({ name: "lucide-repeat2", render: me }), _e = {
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
width: "1.2em",
|
|
28
|
+
height: "1.2em"
|
|
29
|
+
};
|
|
30
|
+
function ve(I, m) {
|
|
31
|
+
return a(), u("svg", _e, [...m[0] || (m[0] = [
|
|
32
|
+
o("path", {
|
|
33
|
+
fill: "none",
|
|
34
|
+
stroke: "currentColor",
|
|
35
|
+
"stroke-linecap": "round",
|
|
36
|
+
"stroke-linejoin": "round",
|
|
37
|
+
"stroke-width": "2",
|
|
38
|
+
d: "M8 21s-4-3-4-9s4-9 4-9m8 0s4 3 4 9s-4 9-4 9M15 9l-6 6m0-6l6 6"
|
|
39
|
+
}, null, -1)
|
|
40
|
+
])]);
|
|
41
|
+
}
|
|
42
|
+
const fe = V({ name: "lucide-variable", render: ve }), ge = { class: "flex flex-col divide-y dark:divide-(--ui-border) divide-(--ui-border-accented)" }, ke = { class: "py-1 text-sm" }, xe = { class: "grid grid-cols-[auto_1fr] gap-1" }, ye = { class: "rounded bg-neutral-500/20 p-0.5" }, he = { class: "grid grid-cols-[auto_1fr] gap-1" }, we = { class: "flex items-center gap-1.5" }, be = { class: "rounded p-0.5 bg-neutral-500/20" }, Ce = {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "text-xs text-(--ui-text-muted) italic cursor-help",
|
|
45
|
+
title: "This mutation was created without a custom key"
|
|
46
|
+
}, Ie = {
|
|
47
|
+
class: "grid grid-cols-[auto_1fr] gap-x-2",
|
|
48
|
+
title: "When was the mutation last updated"
|
|
49
|
+
}, Se = { class: "font-bold" }, $e = {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "grid grid-cols-[auto_1fr] gap-x-2",
|
|
52
|
+
title: "When is this mutation entry garbage collected"
|
|
53
|
+
}, Re = { class: "font-bold" }, Be = { class: "py-2 gap-2 flex flex-wrap items-center justify-items-start" }, Te = { class: "py-1" }, Me = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "rounded p-1 overflow-auto max-h-[1200px]"
|
|
56
|
+
}, Ne = {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: "text-neutral-500/50"
|
|
59
|
+
}, Ve = { class: "py-1" }, Oe = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "rounded bg-neutral-500/20 p-1 overflow-auto max-h-[1200px]"
|
|
62
|
+
}, ze = { key: 1 }, Ae = {
|
|
63
|
+
key: 1,
|
|
64
|
+
class: "py-6 mx-auto"
|
|
65
|
+
}, De = { class: "flex flex-col text-center items-center gap-2 text-lg px-2" }, We = /* @__PURE__ */ Z({
|
|
66
|
+
__name: "[mutationId]",
|
|
67
|
+
setup(I) {
|
|
68
|
+
const m = ne(), O = ae(), k = ee(), t = te(() => {
|
|
69
|
+
const i = m.params.mutationId;
|
|
70
|
+
return k.value.find((e) => e.id === Number(i)) ?? null;
|
|
71
|
+
}), S = {
|
|
72
|
+
showSecond: !0,
|
|
73
|
+
rounding: "floor",
|
|
74
|
+
max: 1e3 * 60 * 60 * 24
|
|
75
|
+
// 1 day
|
|
76
|
+
}, z = ie(() => t.value?.devtools.updatedAt ?? 0, {
|
|
77
|
+
...S,
|
|
78
|
+
updateInterval: 3e3
|
|
79
|
+
}), _ = oe();
|
|
80
|
+
let y = !1;
|
|
81
|
+
const A = se(0);
|
|
82
|
+
function D(i) {
|
|
83
|
+
A.value = k.value.length, y = !0, _.emit("mutations:replay", i);
|
|
84
|
+
}
|
|
85
|
+
M(
|
|
86
|
+
() => k.value,
|
|
87
|
+
() => {
|
|
88
|
+
if (y) {
|
|
89
|
+
const i = k.value.toSorted((e, d) => d.id - e.id)[0];
|
|
90
|
+
i && O.push({
|
|
91
|
+
name: "/mutations/[mutationId]",
|
|
92
|
+
params: { mutationId: i.id }
|
|
93
|
+
}), y = !1;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
deep: !0
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
const c = w("pc:mutation:details:data:open", !1, {}), h = w("pc:mutation:details:vars:open", !0, {});
|
|
101
|
+
let $ = c.value, R = null;
|
|
102
|
+
const g = w("pc:mutation:details:error:open", !1, {});
|
|
103
|
+
return M(
|
|
104
|
+
() => t.value?.state,
|
|
105
|
+
(i) => {
|
|
106
|
+
!i || R === i.status || (R = i.status, i.status === "error" ? (g.value = !0, $ = c.value, c.value = !1) : i.status === "success" && (c.value = $, g.value = !1));
|
|
107
|
+
}
|
|
108
|
+
), (i, e) => {
|
|
109
|
+
const d = G, B = re, v = ue, E = de, U = K, j = ce, F = Q, T = Y, W = L;
|
|
110
|
+
return a(), u("div", ge, [
|
|
111
|
+
t.value ? (a(), u(N, { key: 0 }, [
|
|
112
|
+
s(d, {
|
|
113
|
+
title: "Details",
|
|
114
|
+
icon: n(q)
|
|
115
|
+
}, {
|
|
116
|
+
default: l(() => [
|
|
117
|
+
o("div", ke, [
|
|
118
|
+
o("p", xe, [
|
|
119
|
+
e[9] || (e[9] = o("span", null, "id:", -1)),
|
|
120
|
+
o("span", null, [
|
|
121
|
+
o("code", ye, f(t.value.id), 1)
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
o("p", he, [
|
|
125
|
+
e[10] || (e[10] = o("span", null, "key:", -1)),
|
|
126
|
+
o("span", we, [
|
|
127
|
+
o("code", be, f(t.value.key ?? "undefined"), 1),
|
|
128
|
+
t.value.key ? C("", !0) : (a(), u("span", Ce, " (anonymous) "))
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
o("p", Ie, [
|
|
132
|
+
e[11] || (e[11] = o("span", null, "Last update:", -1)),
|
|
133
|
+
o("span", Se, f(n(z)), 1)
|
|
134
|
+
]),
|
|
135
|
+
!t.value.active && t.value.options ? (a(), u("p", $e, [
|
|
136
|
+
typeof t.value.options.gcTime == "number" && Number.isFinite(t.value.options.gcTime) ? (a(), u(N, { key: 0 }, [
|
|
137
|
+
e[12] || (e[12] = o("span", null, [
|
|
138
|
+
p("Will be "),
|
|
139
|
+
o("i", null, "gced")
|
|
140
|
+
], -1)),
|
|
141
|
+
o("span", Re, f(n(le)(
|
|
142
|
+
new Date(t.value.devtools.inactiveAt + t.value.options.gcTime),
|
|
143
|
+
{
|
|
144
|
+
...S,
|
|
145
|
+
max: void 0
|
|
146
|
+
}
|
|
147
|
+
)), 1)
|
|
148
|
+
], 64)) : C("", !0)
|
|
149
|
+
])) : C("", !0)
|
|
150
|
+
])
|
|
151
|
+
]),
|
|
152
|
+
_: 1
|
|
153
|
+
}, 8, ["icon"]),
|
|
154
|
+
s(d, {
|
|
155
|
+
title: "Actions",
|
|
156
|
+
icon: n(H)
|
|
157
|
+
}, {
|
|
158
|
+
default: l(() => [
|
|
159
|
+
o("div", Be, [
|
|
160
|
+
t.value.devtools.simulate !== "loading" ? (a(), x(v, {
|
|
161
|
+
key: 0,
|
|
162
|
+
class: "theme-purple",
|
|
163
|
+
size: "sm",
|
|
164
|
+
title: "Simulate a loading state",
|
|
165
|
+
onClick: e[0] || (e[0] = (r) => n(_).emit("mutations:simulate:loading", t.value.id))
|
|
166
|
+
}, {
|
|
167
|
+
default: l(() => [
|
|
168
|
+
s(B),
|
|
169
|
+
e[13] || (e[13] = p(" Simulate loading ", -1))
|
|
170
|
+
]),
|
|
171
|
+
_: 1
|
|
172
|
+
})) : (a(), x(v, {
|
|
173
|
+
key: 1,
|
|
174
|
+
class: "theme-purple",
|
|
175
|
+
size: "sm",
|
|
176
|
+
title: "Stop simulating loading state",
|
|
177
|
+
onClick: e[1] || (e[1] = (r) => n(_).emit("mutations:simulate:loading:stop", t.value.id))
|
|
178
|
+
}, {
|
|
179
|
+
default: l(() => [
|
|
180
|
+
s(B, { class: "animate-spin" }),
|
|
181
|
+
e[14] || (e[14] = p(" Stop loading ", -1))
|
|
182
|
+
]),
|
|
183
|
+
_: 1
|
|
184
|
+
})),
|
|
185
|
+
t.value.devtools.simulate !== "error" ? (a(), x(v, {
|
|
186
|
+
key: 2,
|
|
187
|
+
class: "theme-error",
|
|
188
|
+
size: "sm",
|
|
189
|
+
title: "Simulate an Error state",
|
|
190
|
+
onClick: e[2] || (e[2] = (r) => n(_).emit("mutations:simulate:error", t.value.id))
|
|
191
|
+
}, {
|
|
192
|
+
default: l(() => [
|
|
193
|
+
s(E),
|
|
194
|
+
e[15] || (e[15] = p(" Simulate error ", -1))
|
|
195
|
+
]),
|
|
196
|
+
_: 1
|
|
197
|
+
})) : (a(), x(v, {
|
|
198
|
+
key: 3,
|
|
199
|
+
class: "theme-error",
|
|
200
|
+
size: "sm",
|
|
201
|
+
title: "Restore the previous state",
|
|
202
|
+
onClick: e[3] || (e[3] = (r) => n(_).emit("mutations:simulate:error:stop", t.value.id))
|
|
203
|
+
}, {
|
|
204
|
+
default: l(() => [
|
|
205
|
+
s(U),
|
|
206
|
+
e[16] || (e[16] = p(" Remove error ", -1))
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
})),
|
|
210
|
+
s(v, {
|
|
211
|
+
class: "theme-success",
|
|
212
|
+
size: "sm",
|
|
213
|
+
title: "Re-trigger this mutation with the same variables",
|
|
214
|
+
onClick: e[4] || (e[4] = (r) => D(t.value.id))
|
|
215
|
+
}, {
|
|
216
|
+
default: l(() => [
|
|
217
|
+
s(j),
|
|
218
|
+
e[17] || (e[17] = p(" Replay ", -1))
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}),
|
|
222
|
+
s(v, {
|
|
223
|
+
class: "theme-warning",
|
|
224
|
+
size: "sm",
|
|
225
|
+
title: "Remove this mutation from the cache",
|
|
226
|
+
onClick: e[5] || (e[5] = (r) => n(_).emit("mutations:remove", t.value.id))
|
|
227
|
+
}, {
|
|
228
|
+
default: l(() => [
|
|
229
|
+
s(F),
|
|
230
|
+
e[18] || (e[18] = p(" Remove ", -1))
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
})
|
|
234
|
+
])
|
|
235
|
+
]),
|
|
236
|
+
_: 1
|
|
237
|
+
}, 8, ["icon"]),
|
|
238
|
+
s(d, {
|
|
239
|
+
open: n(h),
|
|
240
|
+
"onUpdate:open": e[6] || (e[6] = (r) => b(h) ? h.value = r : null),
|
|
241
|
+
title: "Variables",
|
|
242
|
+
icon: n(fe),
|
|
243
|
+
class: "font-mono",
|
|
244
|
+
"no-padding": ""
|
|
245
|
+
}, {
|
|
246
|
+
default: l(() => [
|
|
247
|
+
s(T, {
|
|
248
|
+
data: t.value.vars
|
|
249
|
+
}, null, 8, ["data"])
|
|
250
|
+
]),
|
|
251
|
+
_: 1
|
|
252
|
+
}, 8, ["open", "icon"]),
|
|
253
|
+
s(d, {
|
|
254
|
+
open: n(c),
|
|
255
|
+
"onUpdate:open": e[7] || (e[7] = (r) => b(c) ? c.value = r : null),
|
|
256
|
+
title: "Data",
|
|
257
|
+
icon: n(J),
|
|
258
|
+
class: "font-mono",
|
|
259
|
+
"no-padding": ""
|
|
260
|
+
}, {
|
|
261
|
+
default: l(() => [
|
|
262
|
+
s(T, {
|
|
263
|
+
data: t.value.state.data
|
|
264
|
+
}, null, 8, ["data"])
|
|
265
|
+
]),
|
|
266
|
+
_: 1
|
|
267
|
+
}, 8, ["open", "icon"]),
|
|
268
|
+
s(d, {
|
|
269
|
+
open: n(g),
|
|
270
|
+
"onUpdate:open": e[8] || (e[8] = (r) => b(g) ? g.value = r : null),
|
|
271
|
+
title: `Error${t.value.state.status === "error" ? " (!)" : ""}`,
|
|
272
|
+
icon: n(P)
|
|
273
|
+
}, {
|
|
274
|
+
default: l(() => [
|
|
275
|
+
o("div", Te, [
|
|
276
|
+
t.value.state.error ? (a(), u("pre", Me, f(t.value.state.error), 1)) : (a(), u("p", Ne, "No error"))
|
|
277
|
+
])
|
|
278
|
+
]),
|
|
279
|
+
_: 1
|
|
280
|
+
}, 8, ["open", "title", "icon"]),
|
|
281
|
+
s(d, {
|
|
282
|
+
title: "Options",
|
|
283
|
+
open: !1,
|
|
284
|
+
icon: n(X)
|
|
285
|
+
}, {
|
|
286
|
+
default: l(() => [
|
|
287
|
+
o("div", Ve, [
|
|
288
|
+
t.value.options ? (a(), u("pre", Oe, f(t.value.options), 1)) : (a(), u("p", ze, "No options configured for this mutation."))
|
|
289
|
+
])
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
}, 8, ["icon"])
|
|
293
|
+
], 64)) : (a(), u("div", Ae, [
|
|
294
|
+
o("p", De, [
|
|
295
|
+
e[19] || (e[19] = p(" Select a Mutation to inspect ", -1)),
|
|
296
|
+
s(W)
|
|
297
|
+
])
|
|
298
|
+
]))
|
|
299
|
+
]);
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
export {
|
|
304
|
+
We as default
|
|
305
|
+
};
|
|
306
|
+
//# sourceMappingURL=_mutationId_-BG1E7StK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_mutationId_-BG1E7StK.js","sources":["../src/panel/pages/mutations/[mutationId].vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { UseMutationEntryPayload } from '@pinia/colada-devtools/shared'\nimport { computed, ref, watch } from 'vue'\nimport { useDuplexChannel, useMutationEntries } from '../../composables/duplex-channel'\nimport { useRoute, useRouter } from 'vue-router'\nimport type { DataStateStatus } from '@pinia/colada'\n\nimport IWrench from '~icons/lucide/wrench'\nimport IInfoCircle from '~icons/lucide/info'\nimport IFileText from '~icons/lucide/file-text'\nimport ICircleX from '~icons/lucide/circle-x'\nimport IBraces from '~icons/lucide/braces'\nimport IVariable from '~icons/lucide/variable'\nimport { useTimeAgo, useLocalStorage, formatTimeAgo } from '@vueuse/core'\nimport type { FormatTimeAgoOptions } from '@vueuse/core'\n\nconst route = useRoute()\nconst router = useRouter()\nconst mutations = useMutationEntries()\n\nconst selectedMutation = computed<UseMutationEntryPayload | null>(() => {\n const mutationId = route.params.mutationId\n return mutations.value.find((entry) => entry.id === Number(mutationId)) ?? null\n})\n\nconst TIME_AGO_OPTIONS: FormatTimeAgoOptions = {\n showSecond: true,\n rounding: 'floor',\n max: 1000 * 60 * 60 * 24, // 1 day\n}\n\nconst lastUpdate = useTimeAgo(() => selectedMutation.value?.devtools.updatedAt ?? 0, {\n ...TIME_AGO_OPTIONS,\n updateInterval: 3000,\n})\n\nconst channel = useDuplexChannel()\n\n// Track when we're replaying to auto-navigate to new mutation\nlet justReplayed = false\nconst mutationCountBeforeReplay = ref(0)\n\nfunction replayMutation(id: UseMutationEntryPayload['id']) {\n // Track state before replay\n mutationCountBeforeReplay.value = mutations.value.length\n justReplayed = true\n\n // Emit the replay event\n channel.emit('mutations:replay', id)\n}\n\n// FIXME: we should move this logic up and auto detect replays maybe with some linking\n// isReplayOf: mutationId\n// and we can display this in the interface too\nwatch(\n () => mutations.value,\n () => {\n if (justReplayed) {\n // Find the latest id\n const newest = mutations.value.toSorted((a, b) => b.id - a.id)[0]\n\n if (newest) {\n router.push({\n name: '/mutations/[mutationId]',\n params: { mutationId: newest.id },\n })\n }\n\n justReplayed = false\n }\n },\n {\n deep: true,\n },\n)\n\nconst isDataOpen = useLocalStorage<boolean>('pc:mutation:details:data:open', false, {})\nconst isVarsOpen = useLocalStorage<boolean>('pc:mutation:details:vars:open', true, {})\nlet wasDataOpen = isDataOpen.value\nlet lastStatus: DataStateStatus | null = null\nconst isErrorOpen = useLocalStorage<boolean>('pc:mutation:details:error:open', false, {})\n\nwatch(\n () => selectedMutation.value?.state,\n (state) => {\n if (!state || lastStatus === state.status) return\n lastStatus = state.status\n if (state.status === 'error') {\n isErrorOpen.value = true\n wasDataOpen = isDataOpen.value\n isDataOpen.value = false\n } else if (state.status === 'success') {\n isDataOpen.value = wasDataOpen\n isErrorOpen.value = false\n }\n },\n)\n</script>\n\n<template>\n <div class=\"flex flex-col divide-y dark:divide-(--ui-border) divide-(--ui-border-accented)\">\n <template v-if=\"selectedMutation\">\n <UCollapse title=\"Details\" :icon=\"IInfoCircle\">\n <div class=\"py-1 text-sm\">\n <p class=\"grid grid-cols-[auto_1fr] gap-1\">\n <span>id:</span>\n <span>\n <code class=\"rounded bg-neutral-500/20 p-0.5\">{{ selectedMutation.id }}</code>\n </span>\n </p>\n\n <p class=\"grid grid-cols-[auto_1fr] gap-1\">\n <span>key:</span>\n <span class=\"flex items-center gap-1.5\">\n <code class=\"rounded p-0.5 bg-neutral-500/20\">\n {{ selectedMutation.key ?? 'undefined' }}\n </code>\n <span\n v-if=\"!selectedMutation.key\"\n class=\"text-xs text-(--ui-text-muted) italic cursor-help\"\n title=\"This mutation was created without a custom key\"\n >\n (anonymous)\n </span>\n </span>\n </p>\n\n <p class=\"grid grid-cols-[auto_1fr] gap-x-2\" title=\"When was the mutation last updated\">\n <span>Last update:</span>\n <span class=\"font-bold\">{{ lastUpdate }}</span>\n </p>\n\n <p\n v-if=\"!selectedMutation.active && selectedMutation.options\"\n class=\"grid grid-cols-[auto_1fr] gap-x-2\"\n title=\"When is this mutation entry garbage collected\"\n >\n <template\n v-if=\"\n typeof selectedMutation.options.gcTime === 'number' &&\n Number.isFinite(selectedMutation.options.gcTime)\n \"\n >\n <span>Will be <i>gced</i></span>\n <span class=\"font-bold\">{{\n formatTimeAgo(\n new Date(selectedMutation.devtools.inactiveAt + selectedMutation.options.gcTime),\n {\n ...TIME_AGO_OPTIONS,\n max: undefined,\n },\n )\n }}</span>\n </template>\n </p>\n </div>\n </UCollapse>\n\n <UCollapse title=\"Actions\" :icon=\"IWrench\">\n <div class=\"py-2 gap-2 flex flex-wrap items-center justify-items-start\">\n <UButton\n v-if=\"selectedMutation.devtools.simulate !== 'loading'\"\n class=\"theme-purple\"\n size=\"sm\"\n title=\"Simulate a loading state\"\n @click=\"channel.emit('mutations:simulate:loading', selectedMutation.id)\"\n >\n <i-lucide-loader />\n Simulate loading\n </UButton>\n <UButton\n v-else\n class=\"theme-purple\"\n size=\"sm\"\n title=\"Stop simulating loading state\"\n @click=\"channel.emit('mutations:simulate:loading:stop', selectedMutation.id)\"\n >\n <i-lucide-loader class=\"animate-spin\" />\n Stop loading\n </UButton>\n\n <UButton\n v-if=\"selectedMutation.devtools.simulate !== 'error'\"\n class=\"theme-error\"\n size=\"sm\"\n title=\"Simulate an Error state\"\n @click=\"channel.emit('mutations:simulate:error', selectedMutation.id)\"\n >\n <i-lucide-x-octagon /> Simulate error\n </UButton>\n <UButton\n v-else\n class=\"theme-error\"\n size=\"sm\"\n title=\"Restore the previous state\"\n @click=\"channel.emit('mutations:simulate:error:stop', selectedMutation.id)\"\n >\n <i-lucide-rotate-ccw /> Remove error\n </UButton>\n\n <UButton\n class=\"theme-success\"\n size=\"sm\"\n title=\"Re-trigger this mutation with the same variables\"\n @click=\"replayMutation(selectedMutation.id)\"\n >\n <i-lucide-repeat-2 />\n Replay\n </UButton>\n\n <UButton\n class=\"theme-warning\"\n size=\"sm\"\n title=\"Remove this mutation from the cache\"\n @click=\"channel.emit('mutations:remove', selectedMutation.id)\"\n >\n <i-lucide-trash /> Remove\n </UButton>\n </div>\n </UCollapse>\n\n <UCollapse\n v-model:open=\"isVarsOpen\"\n title=\"Variables\"\n :icon=\"IVariable\"\n class=\"font-mono\"\n no-padding\n >\n <JsonViewer :data=\"selectedMutation.vars\" />\n </UCollapse>\n\n <UCollapse\n v-model:open=\"isDataOpen\"\n title=\"Data\"\n :icon=\"IFileText\"\n class=\"font-mono\"\n no-padding\n >\n <JsonViewer :data=\"selectedMutation.state.data\" />\n </UCollapse>\n\n <UCollapse\n v-model:open=\"isErrorOpen\"\n :title=\"`Error${selectedMutation.state.status === 'error' ? ' (!)' : ''}`\"\n :icon=\"ICircleX\"\n >\n <div class=\"py-1\">\n <pre\n v-if=\"selectedMutation.state.error\"\n class=\"rounded p-1 overflow-auto max-h-[1200px]\"\n >{{ selectedMutation.state.error }}</pre\n >\n <p v-else class=\"text-neutral-500/50\">No error</p>\n </div>\n </UCollapse>\n\n <UCollapse title=\"Options\" :open=\"false\" :icon=\"IBraces\">\n <div class=\"py-1\">\n <pre\n v-if=\"selectedMutation.options\"\n class=\"rounded bg-neutral-500/20 p-1 overflow-auto max-h-[1200px]\"\n >{{ selectedMutation.options }}</pre\n >\n <p v-else>No options configured for this mutation.</p>\n </div>\n </UCollapse>\n </template>\n\n <template v-else>\n <div class=\"py-6 mx-auto\">\n <p class=\"flex flex-col text-center items-center gap-2 text-lg px-2\">\n Select a Mutation to inspect\n <i-lucide-mouse-pointer-click />\n </p>\n </div>\n </template>\n </div>\n</template>\n"],"names":["route","useRoute","router","useRouter","mutations","useMutationEntries","selectedMutation","computed","mutationId","entry","TIME_AGO_OPTIONS","lastUpdate","useTimeAgo","channel","useDuplexChannel","justReplayed","mutationCountBeforeReplay","ref","replayMutation","id","watch","newest","a","b","isDataOpen","useLocalStorage","isVarsOpen","wasDataOpen","lastStatus","isErrorOpen","state","_openBlock","_createElementBlock","_hoisted_1","_Fragment","_createVNode","_component_UCollapse","_unref","IInfoCircle","_createElementVNode","_hoisted_2","_hoisted_3","_cache","_hoisted_4","_toDisplayString","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","formatTimeAgo","IWrench","_hoisted_13","_createBlock","_component_UButton","_component_i_lucide_loader","_component_i_lucide_x_octagon","_component_i_lucide_rotate_ccw","$event","_component_i_lucide_repeat_2","_component_i_lucide_trash","IVariable","_component_JsonViewer","IFileText","ICircleX","_hoisted_14","_hoisted_15","_hoisted_16","IBraces","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","_component_i_lucide_mouse_pointer_click"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,UAAMA,IAAQC,GAAA,GACRC,IAASC,GAAA,GACTC,IAAYC,GAAA,GAEZC,IAAmBC,GAAyC,MAAM;AACtE,YAAMC,IAAaR,EAAM,OAAO;AAChC,aAAOI,EAAU,MAAM,KAAK,CAACK,MAAU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