@pinia/colada-devtools 0.4.2 → 0.4.3
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 +27 -28
- package/dist/index.js.map +1 -1
- package/dist-panel/{(unselected)-YGzg824P.js → (unselected)-BQ3qDKQ9.js} +4 -4
- package/dist-panel/{(unselected)-YGzg824P.js.map → (unselected)-BQ3qDKQ9.js.map} +1 -1
- package/dist-panel/(unselected)-DAm41Y3x.js +17 -0
- package/dist-panel/{(unselected)-DLGz_VHc.js.map → (unselected)-DAm41Y3x.js.map} +1 -1
- package/dist-panel/{_mutationId_int_-CYlWcwvk.js → _mutationId_int_-erdQKyLR.js} +11 -11
- package/dist-panel/{_mutationId_int_-CYlWcwvk.js.map → _mutationId_int_-erdQKyLR.js.map} +1 -1
- package/dist-panel/{_queryId_-B5WqBBVi.js → _queryId_-B4Df55YE.js} +37 -37
- package/dist-panel/{_queryId_-B5WqBBVi.js.map → _queryId_-B4Df55YE.js.map} +1 -1
- package/dist-panel/{circle-x-BPVHuFxl.js → circle-x-InxlHvaS.js} +27 -27
- package/dist-panel/{circle-x-BPVHuFxl.js.map → circle-x-InxlHvaS.js.map} +1 -1
- package/dist-panel/index-CYb5D1Be.js +6270 -0
- package/dist-panel/index-CYb5D1Be.js.map +1 -0
- package/dist-panel/index-DLKyTdsm.js +10 -0
- package/dist-panel/{index-DIpe0GU7.js.map → index-DLKyTdsm.js.map} +1 -1
- package/dist-panel/index.js +1 -1
- package/dist-panel/{loader-Cehl5zo1.js → loader-Ca7c0zg-.js} +4 -4
- package/dist-panel/loader-Ca7c0zg-.js.map +1 -0
- package/dist-panel/{mouse-pointer-click-B__pFzfy.js → mouse-pointer-click-ClYfwImy.js} +3 -3
- package/dist-panel/mouse-pointer-click-ClYfwImy.js.map +1 -0
- package/dist-panel/{mutations-Dxh-2WXX.js → mutations-pMmse5fr.js} +12 -12
- package/dist-panel/{mutations-Dxh-2WXX.js.map → mutations-pMmse5fr.js.map} +1 -1
- package/dist-panel/queries-BM6WYBXZ.js +312 -0
- package/dist-panel/queries-BM6WYBXZ.js.map +1 -0
- package/dist-panel/settings-C2hLj-3B.js +10 -0
- package/dist-panel/{settings-DTn14i2A.js.map → settings-C2hLj-3B.js.map} +1 -1
- package/dist-panel/{use-container-media-query-ChWDcLID.js → use-container-media-query-CrxtYrv0.js} +43 -43
- package/dist-panel/{use-container-media-query-ChWDcLID.js.map → use-container-media-query-CrxtYrv0.js.map} +1 -1
- package/package.json +10 -10
- package/dist-panel/(unselected)-DLGz_VHc.js +0 -17
- package/dist-panel/index-Co7OVd4_.js +0 -6231
- package/dist-panel/index-Co7OVd4_.js.map +0 -1
- package/dist-panel/index-DIpe0GU7.js +0 -10
- package/dist-panel/loader-Cehl5zo1.js.map +0 -1
- package/dist-panel/mouse-pointer-click-B__pFzfy.js.map +0 -1
- package/dist-panel/queries-DrqxEULJ.js +0 -286
- package/dist-panel/queries-DrqxEULJ.js.map +0 -1
- package/dist-panel/settings-DTn14i2A.js +0 -10
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { _ as e, c, o as n } from "./index-Co7OVd4_.js";
|
|
2
|
-
const o = {};
|
|
3
|
-
function r(t, a) {
|
|
4
|
-
return n(), c("h1", null, "Homepage");
|
|
5
|
-
}
|
|
6
|
-
const _ = /* @__PURE__ */ e(o, [["render", r]]);
|
|
7
|
-
export {
|
|
8
|
-
_ as default
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=index-DIpe0GU7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader-Cehl5zo1.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-pointer-click-B__pFzfy.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { u as F, a as I, _ as U, b as O, c as D, d as H, e as K, f as M, x as j, g as J, h as W } from "./use-container-media-query-ChWDcLID.js";
|
|
2
|
-
import { m as B, c as o, o as n, a as t, d as E, u as X, b as T, r as N, e as p, w as k, f as q, n as v, g as r, F as z, h as R, t as V, i as c, j as Y, C as Z, l as G, p as ee } from "./index-Co7OVd4_.js";
|
|
3
|
-
import { _ as te, a as ne } from "./loader-Cehl5zo1.js";
|
|
4
|
-
const se = {
|
|
5
|
-
viewBox: "0 0 24 24",
|
|
6
|
-
width: "1.2em",
|
|
7
|
-
height: "1.2em"
|
|
8
|
-
};
|
|
9
|
-
function oe(e, i) {
|
|
10
|
-
return n(), o("svg", se, [...i[0] || (i[0] = [
|
|
11
|
-
t("g", {
|
|
12
|
-
fill: "none",
|
|
13
|
-
stroke: "currentColor",
|
|
14
|
-
"stroke-linecap": "round",
|
|
15
|
-
"stroke-linejoin": "round",
|
|
16
|
-
"stroke-width": "2"
|
|
17
|
-
}, [
|
|
18
|
-
t("circle", {
|
|
19
|
-
cx: "12",
|
|
20
|
-
cy: "12",
|
|
21
|
-
r: "10"
|
|
22
|
-
}),
|
|
23
|
-
t("path", { d: "m9 15l6-6" })
|
|
24
|
-
], -1)
|
|
25
|
-
])]);
|
|
26
|
-
}
|
|
27
|
-
const re = B({ name: "lucide-circle-slash", render: oe }), ie = {
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
width: "1.2em",
|
|
30
|
-
height: "1.2em"
|
|
31
|
-
};
|
|
32
|
-
function ae(e, i) {
|
|
33
|
-
return n(), o("svg", ie, [...i[0] || (i[0] = [
|
|
34
|
-
t("path", {
|
|
35
|
-
fill: "none",
|
|
36
|
-
stroke: "currentColor",
|
|
37
|
-
"stroke-linecap": "round",
|
|
38
|
-
"stroke-linejoin": "round",
|
|
39
|
-
"stroke-width": "2",
|
|
40
|
-
d: "M18 6L7 17l-5-5m20-2l-7.5 7.5L13 16"
|
|
41
|
-
}, null, -1)
|
|
42
|
-
])]);
|
|
43
|
-
}
|
|
44
|
-
const le = B({ name: "lucide-check-check", render: ae });
|
|
45
|
-
function P(e) {
|
|
46
|
-
return e.asyncStatus === "loading" ? "loading" : e.state.status === "error" ? "error" : e.state.status === "pending" ? "pending" : e.stale ? "stale" : e.state.status === "success" ? "fresh" : "unknown";
|
|
47
|
-
}
|
|
48
|
-
const w = {
|
|
49
|
-
loading: {
|
|
50
|
-
base: "bg-purple-400",
|
|
51
|
-
clear: "bg-purple-200",
|
|
52
|
-
text: "text-purple-100"
|
|
53
|
-
},
|
|
54
|
-
fresh: {
|
|
55
|
-
base: "bg-success-500",
|
|
56
|
-
clear: "bg-success-200",
|
|
57
|
-
text: "text-success-100"
|
|
58
|
-
},
|
|
59
|
-
error: {
|
|
60
|
-
base: "bg-error-500",
|
|
61
|
-
clear: "bg-error-200",
|
|
62
|
-
text: "text-error-100"
|
|
63
|
-
},
|
|
64
|
-
stale: {
|
|
65
|
-
base: "bg-info-500",
|
|
66
|
-
clear: "bg-info-200",
|
|
67
|
-
text: "text-info-100"
|
|
68
|
-
},
|
|
69
|
-
pending: {
|
|
70
|
-
base: "bg-warning-500",
|
|
71
|
-
clear: "bg-warning-200",
|
|
72
|
-
text: "text-warning-100"
|
|
73
|
-
},
|
|
74
|
-
inactive: {
|
|
75
|
-
base: "bg-neutral-400",
|
|
76
|
-
clear: "bg-neutral-200",
|
|
77
|
-
text: "text-neutral-100"
|
|
78
|
-
},
|
|
79
|
-
unknown: {
|
|
80
|
-
base: "bg-gray-400",
|
|
81
|
-
clear: "bg-gray-200",
|
|
82
|
-
text: "text-gray-100"
|
|
83
|
-
}
|
|
84
|
-
}, ce = { class: "h-full w-6 relative" }, ue = ["title"], de = ["href", "title", "onClick"], _e = { class: "flex font-mono grow gap-0.5 overflow-auto items-center" }, me = { class: "text-wrap wrap-break-word rounded bg-(--ui-text)/5 px-0.5" }, ge = {
|
|
85
|
-
key: 0,
|
|
86
|
-
"aria-hidden": "true"
|
|
87
|
-
}, pe = {
|
|
88
|
-
key: 0,
|
|
89
|
-
title: "This query is disabled"
|
|
90
|
-
}, fe = { class: "rounded bg-theme/70 theme-neutral p-0.5 text-xs flex gap-x-0.5 items-center" }, he = {
|
|
91
|
-
key: 1,
|
|
92
|
-
title: "This query will be garbage collected"
|
|
93
|
-
}, xe = /* @__PURE__ */ E({
|
|
94
|
-
__name: "ListQueryEntry",
|
|
95
|
-
props: {
|
|
96
|
-
entry: {}
|
|
97
|
-
},
|
|
98
|
-
setup(e) {
|
|
99
|
-
const i = X(), $ = F();
|
|
100
|
-
function m(f) {
|
|
101
|
-
f.preventDefault(), f.stopPropagation(), i.push("/queries");
|
|
102
|
-
}
|
|
103
|
-
const b = I(() => e.entry.key), u = T(() => P(e.entry));
|
|
104
|
-
return (f, g) => {
|
|
105
|
-
const C = te, a = le, s = ne, _ = U, y = O, h = re, S = D, L = N("RouterLink");
|
|
106
|
-
return n(), p(L, {
|
|
107
|
-
to: { name: "/queries/[queryId]", params: { queryId: e.entry.keyHash } },
|
|
108
|
-
custom: ""
|
|
109
|
-
}, {
|
|
110
|
-
default: k(({ isActive: l, navigate: d, href: Q }) => [
|
|
111
|
-
t("div", {
|
|
112
|
-
class: v(["grid grid-cols-[minmax(0,auto)_1fr] grid-flow-col items-center gap-x-2 p-1 relative text-sm @container", [
|
|
113
|
-
l ? "bg-neutral-200 dark:bg-neutral-700" : "hover:bg-(--ui-bg-elevated)",
|
|
114
|
-
e.entry.active ? "" : "text-(--ui-text)/50"
|
|
115
|
-
]])
|
|
116
|
-
}, [
|
|
117
|
-
t("div", ce, [
|
|
118
|
-
t("div", {
|
|
119
|
-
class: v(["absolute -inset-1 right-0 flex items-center justify-center", r(w)[u.value].base]),
|
|
120
|
-
title: u.value
|
|
121
|
-
}, [
|
|
122
|
-
u.value === "loading" ? (n(), p(C, {
|
|
123
|
-
key: 0,
|
|
124
|
-
title: "Loading",
|
|
125
|
-
"aria-label": "Loading icon"
|
|
126
|
-
})) : u.value === "fresh" ? (n(), p(a, {
|
|
127
|
-
key: 1,
|
|
128
|
-
title: "Fresh successful data",
|
|
129
|
-
"aria-label": "Fresh successful data icon"
|
|
130
|
-
})) : u.value === "error" ? (n(), p(s, {
|
|
131
|
-
key: 2,
|
|
132
|
-
title: "Error",
|
|
133
|
-
"aria-label": "Error icon"
|
|
134
|
-
})) : u.value === "stale" ? (n(), p(_, {
|
|
135
|
-
key: 3,
|
|
136
|
-
title: "Stale",
|
|
137
|
-
"aria-label": "Stale icon"
|
|
138
|
-
})) : u.value === "pending" ? (n(), p(y, {
|
|
139
|
-
key: 4,
|
|
140
|
-
title: "Pending",
|
|
141
|
-
"aria-label": "Pending icon"
|
|
142
|
-
})) : q("", !0)
|
|
143
|
-
], 10, ue)
|
|
144
|
-
]),
|
|
145
|
-
t("a", {
|
|
146
|
-
href: Q,
|
|
147
|
-
class: "hover:cursor-pointer block overflow-hidden",
|
|
148
|
-
title: e.entry.active ? "Active query" : "Inactive query",
|
|
149
|
-
onClick: (x) => l ? m(x) : d(x)
|
|
150
|
-
}, [
|
|
151
|
-
t("ol", _e, [
|
|
152
|
-
(n(!0), o(z, null, R(r(b), (x, A) => (n(), o(z, { key: x }, [
|
|
153
|
-
t("li", me, V(x), 1),
|
|
154
|
-
A < r(b).length - 1 ? (n(), o("li", ge, "/")) : q("", !0)
|
|
155
|
-
], 64))), 128))
|
|
156
|
-
])
|
|
157
|
-
], 8, de),
|
|
158
|
-
e.entry.options?.enabled === !1 ? (n(), o("div", pe, [
|
|
159
|
-
t("span", fe, [
|
|
160
|
-
c(h, { "aria-hidden": "" }),
|
|
161
|
-
g[0] || (g[0] = t("span", { class: "@max-md:hidden" }, "disabled", -1))
|
|
162
|
-
])
|
|
163
|
-
])) : !e.entry.active && e.entry.gcTimeout && e.entry.devtools.inactiveAt && typeof e.entry.options?.gcTime == "number" && Number.isFinite(e.entry.options.gcTime) && e.entry.options.gcTime <= 3e4 ? (n(), o("div", he, [
|
|
164
|
-
c(S, {
|
|
165
|
-
class: "size-[1em] dark:text-neutral-500 text-neutral-400",
|
|
166
|
-
max: e.entry.options.gcTime,
|
|
167
|
-
value: e.entry.devtools.inactiveAt + e.entry.options.gcTime - r($)
|
|
168
|
-
}, null, 8, ["max", "value"])
|
|
169
|
-
])) : q("", !0)
|
|
170
|
-
], 2)
|
|
171
|
-
]),
|
|
172
|
-
_: 1
|
|
173
|
-
}, 8, ["to"]);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
}), ve = { class: "grid grid-rows-[auto_1fr] overflow-hidden @container" }, be = { class: "flex items-center p-2 border-b border-(--ui-border) gap-2" }, ye = { class: "relative grow" }, ke = { class: "flex gap-x-1" }, we = ["title"], ze = { class: "@max-[750px]:hidden" }, $e = {
|
|
177
|
-
key: 0,
|
|
178
|
-
role: "list",
|
|
179
|
-
class: "divide-y divide-(--ui-border)"
|
|
180
|
-
}, Ce = {
|
|
181
|
-
key: 1,
|
|
182
|
-
class: "flex flex-col items-center p-4 text-(--ui-text-muted) text-sm text-center gap-2"
|
|
183
|
-
}, Te = /* @__PURE__ */ E({
|
|
184
|
-
__name: "queries",
|
|
185
|
-
setup(e) {
|
|
186
|
-
const i = Y(""), $ = Z(), m = T(() => {
|
|
187
|
-
let a = $.value;
|
|
188
|
-
if (i.value) {
|
|
189
|
-
const s = i.value.toLowerCase();
|
|
190
|
-
a = a.filter((_) => _.key.some((h) => String(h).toLowerCase().includes(s)));
|
|
191
|
-
}
|
|
192
|
-
return a.toSorted((s, _) => _.devtools.updatedAt - s.devtools.updatedAt);
|
|
193
|
-
}), b = T(() => ({
|
|
194
|
-
loading: [],
|
|
195
|
-
fresh: [],
|
|
196
|
-
error: [],
|
|
197
|
-
pending: [],
|
|
198
|
-
inactive: m.value.filter((a) => !a.active),
|
|
199
|
-
...Object.groupBy(m.value, (a) => P(a))
|
|
200
|
-
})), u = G("split-panes-container"), f = H("(width < 768px)", () => u.value?.$el), g = ee("pc-devtools-query-list-panel-size", [30, 70]);
|
|
201
|
-
function C({ panes: a }) {
|
|
202
|
-
g.value = a.map((s) => s.size);
|
|
203
|
-
}
|
|
204
|
-
return (a, s) => {
|
|
205
|
-
const _ = K, y = M, h = xe, S = J, L = N("RouterView");
|
|
206
|
-
return n(), o("section", ve, [
|
|
207
|
-
t("div", be, [
|
|
208
|
-
t("div", ye, [
|
|
209
|
-
c(_, { class: "absolute left-2 top-1/2 -translate-y-1/2 text-ui-text-muted size-4" }),
|
|
210
|
-
c(y, {
|
|
211
|
-
modelValue: i.value,
|
|
212
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) => i.value = l),
|
|
213
|
-
type: "search",
|
|
214
|
-
class: "w-full",
|
|
215
|
-
placeholder: "Search Queries"
|
|
216
|
-
}, null, 8, ["modelValue"])
|
|
217
|
-
]),
|
|
218
|
-
t("div", ke, [
|
|
219
|
-
(n(!0), o(z, null, R(b.value, (l, d) => (n(), o("div", {
|
|
220
|
-
key: d,
|
|
221
|
-
class: v(["theme-neutral bg-(--ui-bg-muted) rounded p-1 text-xs font-semibold flex items-center gap-x-1", (l?.length ?? 0) === 0 ? "text-(--ui-text-muted)" : ""]),
|
|
222
|
-
title: `${l?.length ?? 0} ${d} queries (after filtering)`
|
|
223
|
-
}, [
|
|
224
|
-
t("div", {
|
|
225
|
-
class: v(["rounded-full size-2", r(w)[d].base])
|
|
226
|
-
}, null, 2),
|
|
227
|
-
t("span", ze, V(d), 1),
|
|
228
|
-
t("div", {
|
|
229
|
-
class: v([
|
|
230
|
-
"px-1.5 py-0.5 rounded min-w-[1.65em] flex justify-center",
|
|
231
|
-
(l?.length ?? 0) === 0 ? "bg-(--ui-bg-accented)" : [r(w)[d].base, r(w)[d].text]
|
|
232
|
-
])
|
|
233
|
-
}, [
|
|
234
|
-
t("span", null, V(l?.length ?? 0), 1)
|
|
235
|
-
], 2)
|
|
236
|
-
], 10, we))), 128))
|
|
237
|
-
])
|
|
238
|
-
]),
|
|
239
|
-
c(r(W), {
|
|
240
|
-
ref: "split-panes-container",
|
|
241
|
-
class: "overflow-hidden",
|
|
242
|
-
horizontal: r(f),
|
|
243
|
-
onResized: C
|
|
244
|
-
}, {
|
|
245
|
-
default: k(() => [
|
|
246
|
-
c(r(j), {
|
|
247
|
-
"min-size": "15",
|
|
248
|
-
size: r(g)[0],
|
|
249
|
-
class: "flex flex-col"
|
|
250
|
-
}, {
|
|
251
|
-
default: k(() => [
|
|
252
|
-
m.value.length > 0 ? (n(), o("ol", $e, [
|
|
253
|
-
(n(!0), o(z, null, R(m.value, (l) => (n(), o("li", {
|
|
254
|
-
key: l.keyHash
|
|
255
|
-
}, [
|
|
256
|
-
c(h, { entry: l }, null, 8, ["entry"])
|
|
257
|
-
]))), 128))
|
|
258
|
-
])) : (n(), o("div", Ce, [
|
|
259
|
-
c(S, { class: "size-8" }),
|
|
260
|
-
s[1] || (s[1] = t("h3", { class: "text-lg" }, "No queries found", -1)),
|
|
261
|
-
s[2] || (s[2] = t("p", null, "Try adjusting your search or perform some mutations in your app.", -1))
|
|
262
|
-
]))
|
|
263
|
-
]),
|
|
264
|
-
_: 1
|
|
265
|
-
}, 8, ["size"]),
|
|
266
|
-
c(r(j), {
|
|
267
|
-
"min-size": "30",
|
|
268
|
-
size: r(g)[1],
|
|
269
|
-
class: "flex flex-col"
|
|
270
|
-
}, {
|
|
271
|
-
default: k(() => [
|
|
272
|
-
c(L)
|
|
273
|
-
]),
|
|
274
|
-
_: 1
|
|
275
|
-
}, 8, ["size"])
|
|
276
|
-
]),
|
|
277
|
-
_: 1
|
|
278
|
-
}, 8, ["horizontal"])
|
|
279
|
-
]);
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
export {
|
|
284
|
-
Te as default
|
|
285
|
-
};
|
|
286
|
-
//# sourceMappingURL=queries-DrqxEULJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queries-DrqxEULJ.js","sources":["../src/panel/utils/query-state.ts","../src/panel/components/ListQueryEntry.vue","../src/panel/pages/queries.vue"],"sourcesContent":["import type { UseQueryEntryPayload } from '@pinia/colada-devtools/shared'\n\nexport type UseQueryEntryPayloadStatus =\n | 'loading'\n | 'fresh'\n | 'error'\n | 'stale'\n | 'pending'\n | 'unknown'\n\nexport function getQueryStatus(entry: UseQueryEntryPayload): UseQueryEntryPayloadStatus {\n if (entry.asyncStatus === 'loading') {\n return 'loading'\n }\n if (entry.state.status === 'error') {\n return 'error'\n }\n if (entry.state.status === 'pending') {\n return 'pending'\n }\n if (entry.stale) {\n return 'stale'\n }\n if (entry.state.status === 'success') {\n return 'fresh'\n }\n\n return 'unknown'\n}\n\nexport const STATUS_COLOR_CLASSES: Record<\n UseQueryEntryPayloadStatus | 'inactive',\n {\n base: string\n clear: string\n text: string\n }\n> = {\n loading: {\n base: 'bg-purple-400',\n clear: 'bg-purple-200',\n text: 'text-purple-100',\n },\n fresh: {\n base: 'bg-success-500',\n clear: 'bg-success-200',\n text: 'text-success-100',\n },\n error: {\n base: 'bg-error-500',\n clear: 'bg-error-200',\n text: 'text-error-100',\n },\n stale: {\n base: 'bg-info-500',\n clear: 'bg-info-200',\n text: 'text-info-100',\n },\n pending: {\n base: 'bg-warning-500',\n clear: 'bg-warning-200',\n text: 'text-warning-100',\n },\n inactive: {\n base: 'bg-neutral-400',\n clear: 'bg-neutral-200',\n text: 'text-neutral-100',\n },\n unknown: {\n base: 'bg-gray-400',\n clear: 'bg-gray-200',\n text: 'text-gray-100',\n },\n}\n","<script setup lang=\"ts\">\nimport type { UseQueryEntryPayload } from '@pinia/colada-devtools/shared'\nimport { computed } from 'vue'\nimport { getQueryStatus, STATUS_COLOR_CLASSES } from '../utils/query-state'\nimport { useRouter } from 'vue-router'\nimport { usePerformanceNow } from '../composables/performance-now'\nimport { useFormattedKey } from '../composables/entries'\n\nconst { entry } = defineProps<{\n entry: UseQueryEntryPayload\n}>()\nconst router = useRouter()\n\nconst now = usePerformanceNow()\n// const now = useNow({ interval: Math.max(100, (entry.options?.gcTime || 0) / 30) })\n\nfunction unselect(event: MouseEvent) {\n event.preventDefault()\n event.stopPropagation()\n router.push('/queries')\n}\n\nconst formattedKey = useFormattedKey(() => entry.key)\nconst status = computed(() => getQueryStatus(entry))\n</script>\n\n<template>\n <RouterLink\n v-slot=\"{ isActive, navigate, href }\"\n :to=\"{ name: '/queries/[queryId]', params: { queryId: entry.keyHash } }\"\n custom\n >\n <div\n class=\"grid grid-cols-[minmax(0,auto)_1fr] grid-flow-col items-center gap-x-2 p-1 relative text-sm @container\"\n :class=\"[\n isActive ? 'bg-neutral-200 dark:bg-neutral-700' : 'hover:bg-(--ui-bg-elevated)',\n entry.active ? '' : 'text-(--ui-text)/50',\n ]\"\n >\n <div class=\"h-full w-6 relative\">\n <div\n class=\"absolute -inset-1 right-0 flex items-center justify-center\"\n :class=\"STATUS_COLOR_CLASSES[status].base\"\n :title=\"status\"\n >\n <i-lucide-loader v-if=\"status === 'loading'\" title=\"Loading\" aria-label=\"Loading icon\" />\n <i-lucide-check-check\n v-else-if=\"status === 'fresh'\"\n title=\"Fresh successful data\"\n aria-label=\"Fresh successful data icon\"\n />\n <i-lucide-x-octagon\n v-else-if=\"status === 'error'\"\n title=\"Error\"\n aria-label=\"Error icon\"\n />\n <i-lucide-check v-else-if=\"status === 'stale'\" title=\"Stale\" aria-label=\"Stale icon\" />\n <i-lucide-pause\n v-else-if=\"status === 'pending'\"\n title=\"Pending\"\n aria-label=\"Pending icon\"\n />\n </div>\n </div>\n\n <a\n :href\n class=\"hover:cursor-pointer block overflow-hidden\"\n :title=\"entry.active ? 'Active query' : 'Inactive query'\"\n @click=\"isActive ? unselect($event) : navigate($event)\"\n >\n <ol class=\"flex font-mono grow gap-0.5 overflow-auto items-center\">\n <template v-for=\"(key, i) in formattedKey\" :key=\"key\">\n <li class=\"text-wrap wrap-break-word rounded bg-(--ui-text)/5 px-0.5\">{{ key }}</li>\n <li v-if=\"i < formattedKey.length - 1\" aria-hidden=\"true\">/</li>\n </template>\n </ol>\n </a>\n\n <div v-if=\"entry.options?.enabled === false\" title=\"This query is disabled\">\n <span class=\"rounded bg-theme/70 theme-neutral p-0.5 text-xs flex gap-x-0.5 items-center\">\n <i-lucide-circle-slash aria-hidden />\n <span class=\"@max-md:hidden\">disabled</span>\n </span>\n </div>\n <div\n v-else-if=\"\n !entry.active &&\n entry.gcTimeout &&\n entry.devtools.inactiveAt &&\n typeof entry.options?.gcTime === 'number' &&\n Number.isFinite(entry.options.gcTime) &&\n entry.options.gcTime <= 30_000\n \"\n title=\"This query will be garbage collected\"\n >\n <UCircleProgress\n class=\"size-[1em] dark:text-neutral-500 text-neutral-400\"\n :max=\"entry.options.gcTime\"\n :value=\"entry.devtools.inactiveAt + entry.options.gcTime - now\"\n />\n </div>\n </div>\n </RouterLink>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from 'vue'\nimport { Pane, Splitpanes } from '@posva/splitpanes'\nimport { useQueryEntries } from '../composables/duplex-channel'\nimport { getQueryStatus, STATUS_COLOR_CLASSES } from '../utils/query-state'\nimport type { UseQueryEntryPayloadStatus } from '../utils/query-state'\nimport type { UseQueryEntryPayload } from '@pinia/colada-devtools/shared'\nimport { useContainerMediaQuery } from '../composables/use-container-media-query'\nimport { useLocalStorage } from '@vueuse/core'\n\nconst searchQuery = ref('')\n\nconst queries = useQueryEntries()\n\nconst filteredItems = computed(() => {\n let items = queries.value\n\n if (searchQuery.value) {\n const query = searchQuery.value.toLowerCase()\n items = items.filter((item) => {\n const searchable = item.key\n return searchable.some((v) => String(v).toLowerCase().includes(query))\n })\n }\n\n // sort by last updatedAt\n return items.toSorted((a, b) => {\n return b.devtools.updatedAt - a.devtools.updatedAt\n })\n})\n\nconst queriesGrouped = computed<\n Record<\n Exclude<UseQueryEntryPayloadStatus, 'unknown' | 'stale'> | 'inactive',\n UseQueryEntryPayload[]\n >\n>(() => {\n return {\n loading: [],\n fresh: [],\n error: [],\n pending: [],\n inactive: filteredItems.value.filter((item) => !item.active),\n ...Object.groupBy(filteredItems.value, (item) => getQueryStatus(item)),\n }\n})\n\nconst container = useTemplateRef('split-panes-container')\nconst isNarrow = useContainerMediaQuery('(width < 768px)', () => container.value?.$el)\n\nconst queryListPanelSize = useLocalStorage<number[]>('pc-devtools-query-list-panel-size', [30, 70])\n\nfunction updatePanesSize({ panes }: { panes: { size: number }[] }) {\n queryListPanelSize.value = panes.map((pane) => pane.size)\n}\n</script>\n\n<template>\n <section class=\"grid grid-rows-[auto_1fr] overflow-hidden @container\">\n <!-- Search & Actions Bar -->\n <div class=\"flex items-center p-2 border-b border-(--ui-border) gap-2\">\n <div class=\"relative grow\">\n <i-lucide-search\n class=\"absolute left-2 top-1/2 -translate-y-1/2 text-ui-text-muted size-4\"\n />\n <UInput v-model=\"searchQuery\" type=\"search\" class=\"w-full\" placeholder=\"Search Queries\" />\n </div>\n\n <!-- TODO: sort source, asc/desc -->\n\n <div class=\"flex gap-x-1\">\n <div\n v-for=\"(queryGroup, status) in queriesGrouped\"\n :key=\"status\"\n class=\"theme-neutral bg-(--ui-bg-muted) rounded p-1 text-xs font-semibold flex items-center gap-x-1\"\n :class=\"(queryGroup?.length ?? 0) === 0 ? 'text-(--ui-text-muted)' : ''\"\n :title=\"`${queryGroup?.length ?? 0} ${status} queries (after filtering)`\"\n >\n <div class=\"rounded-full size-2\" :class=\"STATUS_COLOR_CLASSES[status].base\" />\n <span class=\"@max-[750px]:hidden\">{{ status }}</span>\n <div\n class=\"px-1.5 py-0.5 rounded min-w-[1.65em] flex justify-center\"\n :class=\"\n (queryGroup?.length ?? 0) === 0\n ? 'bg-(--ui-bg-accented)'\n : [STATUS_COLOR_CLASSES[status].base, STATUS_COLOR_CLASSES[status].text]\n \"\n >\n <span>{{ queryGroup?.length ?? 0 }}</span>\n </div>\n </div>\n </div>\n </div>\n\n <Splitpanes\n ref=\"split-panes-container\"\n class=\"overflow-hidden\"\n :horizontal=\"isNarrow\"\n @resized=\"updatePanesSize\"\n >\n <!-- List Panel -->\n <Pane min-size=\"15\" :size=\"queryListPanelSize[0]\" class=\"flex flex-col\">\n <ol role=\"list\" class=\"divide-y divide-(--ui-border)\" v-if=\"filteredItems.length > 0\">\n <li v-for=\"entry of filteredItems\" :key=\"entry.keyHash\">\n <ListQueryEntry :entry />\n </li>\n </ol>\n <div\n v-else\n class=\"flex flex-col items-center p-4 text-(--ui-text-muted) text-sm text-center gap-2\"\n >\n <i-lucide-inbox class=\"size-8\" />\n <h3 class=\"text-lg\">No queries found</h3>\n <p>Try adjusting your search or perform some mutations in your app.</p>\n </div>\n </Pane>\n\n <!-- Details Panel -->\n <Pane min-size=\"30\" :size=\"queryListPanelSize[1]\" class=\"flex flex-col\">\n <RouterView />\n </Pane>\n </Splitpanes>\n </section>\n</template>\n"],"names":["getQueryStatus","entry","STATUS_COLOR_CLASSES","router","useRouter","now","usePerformanceNow","unselect","event","formattedKey","useFormattedKey","__props","status","computed","_createBlock","_component_RouterLink","_withCtx","isActive","navigate","href","_createElementVNode","_hoisted_1","_unref","_component_i_lucide_loader","_component_i_lucide_check_check","_component_i_lucide_x_octagon","_component_i_lucide_check","_component_i_lucide_pause","$event","_hoisted_4","_openBlock","_createElementBlock","_Fragment","_renderList","key","i","_hoisted_5","_toDisplayString","_hoisted_6","_hoisted_7","_hoisted_8","_createVNode","_component_i_lucide_circle_slash","_cache","_hoisted_9","_component_UCircleProgress","searchQuery","ref","queries","useQueryEntries","filteredItems","items","query","item","v","a","b","queriesGrouped","container","useTemplateRef","isNarrow","useContainerMediaQuery","queryListPanelSize","useLocalStorage","updatePanesSize","panes","pane","_hoisted_2","_hoisted_3","_component_i_lucide_search","_component_UInput","queryGroup","_normalizeClass","Splitpanes","Pane","_component_ListQueryEntry","_component_i_lucide_inbox","_component_RouterView"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAASA,EAAeC,GAAyD;AACtF,SAAIA,EAAM,gBAAgB,YACjB,YAELA,EAAM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;AAAA,YAAA;yBACtD,MAAc;AAAA,gBAAdrB,EAAcoC,CAAA;AAAA,cAAA;;;;;;;;;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { _ as e, c as t, o as c } from "./index-Co7OVd4_.js";
|
|
2
|
-
const n = {};
|
|
3
|
-
function s(o, r) {
|
|
4
|
-
return c(), t("h1", null, "Settings");
|
|
5
|
-
}
|
|
6
|
-
const a = /* @__PURE__ */ e(n, [["render", s]]);
|
|
7
|
-
export {
|
|
8
|
-
a as default
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=settings-DTn14i2A.js.map
|