@voltro/devtools 0.85.0 → 0.87.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/CHANGELOG.md +5987 -0
- package/THIRD-PARTY-NOTICES.md +1125 -34
- package/dist/Devtools.js +327 -0
- package/dist/capsuleClearance.js +42 -0
- package/dist/capsulePlacement.js +66 -0
- package/dist/components/boundary.js +47 -0
- package/dist/components/dockMenu.js +121 -0
- package/dist/components/icons.js +236 -0
- package/dist/components/primitives.js +75 -0
- package/dist/console/Capsule.js +169 -0
- package/dist/console/Console.js +508 -0
- package/dist/console/InspectRefusals.js +89 -0
- package/dist/console/searchIndex.js +63 -0
- package/dist/console/sources.js +106 -0
- package/dist/consoleBridge.js +76 -0
- package/dist/externalWindow.js +9 -0
- package/dist/index.js +3 -4382
- package/dist/inspectAuth.js +16 -0
- package/dist/inspectFetch.js +46 -0
- package/dist/inspectRefusal.js +45 -0
- package/dist/inspectStream.js +88 -0
- package/dist/logsBus.js +22 -0
- package/dist/panels/desktop.js +101 -0
- package/dist/panels/indexes.js +233 -0
- package/dist/panels/logs.js +55 -0
- package/dist/panels/mutations.js +81 -0
- package/dist/panels/pwa.js +171 -0
- package/dist/panels/routes.js +69 -0
- package/dist/panels/runtimes.js +67 -0
- package/dist/panels/stores.js +125 -0
- package/dist/panels/subscriptions.js +117 -0
- package/dist/panels/traces.js +160 -0
- package/dist/panels/webhooks.js +248 -0
- package/dist/panels/workflows.js +478 -0
- package/dist/pushPage.js +36 -0
- package/dist/shadowHost.js +77 -0
- package/dist/strings.js +332 -0
- package/dist/styles.css +20 -0
- package/dist/useCapsuleClearance.js +85 -0
- package/dist/useDevStatuses.js +6 -0
- package/dist/useDock.js +181 -0
- package/dist/useDocumentVisible.js +5 -0
- package/dist/useLiveCacheEntries.js +19 -0
- package/package.json +4 -4
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { useId as e } from "react";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/icons.tsx
|
|
4
|
+
var i = (e) => ({ className: t }) => /* @__PURE__ */ n("svg", {
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
fill: "none",
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
strokeWidth: "1.6",
|
|
9
|
+
strokeLinecap: "round",
|
|
10
|
+
strokeLinejoin: "round",
|
|
11
|
+
className: t ?? "vdt:w-4 vdt:h-4",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: e
|
|
14
|
+
}), a = ({ className: t }) => {
|
|
15
|
+
let i = e(), a = `vdtBoltFront-${i}`, o = `vdtBoltBack-${i}`;
|
|
16
|
+
return /* @__PURE__ */ r("svg", {
|
|
17
|
+
viewBox: "0 0 48 48",
|
|
18
|
+
fill: "none",
|
|
19
|
+
className: t,
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ r("defs", { children: [/* @__PURE__ */ r("linearGradient", {
|
|
23
|
+
id: a,
|
|
24
|
+
x1: "13",
|
|
25
|
+
y1: "5",
|
|
26
|
+
x2: "33",
|
|
27
|
+
y2: "43",
|
|
28
|
+
gradientUnits: "userSpaceOnUse",
|
|
29
|
+
children: [/* @__PURE__ */ n("stop", { stopColor: "#C4A6FF" }), /* @__PURE__ */ n("stop", {
|
|
30
|
+
offset: "1",
|
|
31
|
+
stopColor: "#9D5BFF"
|
|
32
|
+
})]
|
|
33
|
+
}), /* @__PURE__ */ r("linearGradient", {
|
|
34
|
+
id: o,
|
|
35
|
+
x1: "22",
|
|
36
|
+
y1: "5",
|
|
37
|
+
x2: "35",
|
|
38
|
+
y2: "43",
|
|
39
|
+
gradientUnits: "userSpaceOnUse",
|
|
40
|
+
children: [/* @__PURE__ */ n("stop", { stopColor: "#9D5BFF" }), /* @__PURE__ */ n("stop", {
|
|
41
|
+
offset: "1",
|
|
42
|
+
stopColor: "#7C3AED"
|
|
43
|
+
})]
|
|
44
|
+
})] }),
|
|
45
|
+
/* @__PURE__ */ n("path", {
|
|
46
|
+
d: "M28 5 13 27 22 26 20 43Z",
|
|
47
|
+
fill: `url(#${a})`
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ n("path", {
|
|
50
|
+
d: "M28 5 20 43 35 21 26 22Z",
|
|
51
|
+
fill: `url(#${o})`
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}, o = i(/* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" })), s = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("line", {
|
|
56
|
+
x1: "18",
|
|
57
|
+
y1: "6",
|
|
58
|
+
x2: "6",
|
|
59
|
+
y2: "18"
|
|
60
|
+
}), /* @__PURE__ */ n("line", {
|
|
61
|
+
x1: "6",
|
|
62
|
+
y1: "6",
|
|
63
|
+
x2: "18",
|
|
64
|
+
y2: "18"
|
|
65
|
+
})] })), c = i(/* @__PURE__ */ n("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })), l = i(/* @__PURE__ */ r(t, { children: [
|
|
66
|
+
/* @__PURE__ */ n("ellipse", {
|
|
67
|
+
cx: "12",
|
|
68
|
+
cy: "5",
|
|
69
|
+
rx: "9",
|
|
70
|
+
ry: "3"
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ n("path", { d: "M3 5 v6 c0 1.66 4 3 9 3 s9 -1.34 9 -3 V5" }),
|
|
73
|
+
/* @__PURE__ */ n("path", { d: "M3 11 v6 c0 1.66 4 3 9 3 s9 -1.34 9 -3 v-6" })
|
|
74
|
+
] })), u = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("circle", {
|
|
75
|
+
cx: "12",
|
|
76
|
+
cy: "12",
|
|
77
|
+
r: "10"
|
|
78
|
+
}), /* @__PURE__ */ n("polygon", { points: "16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76" })] })), d = i(/* @__PURE__ */ r(t, { children: [
|
|
79
|
+
/* @__PURE__ */ n("path", { d: "M12 22 v-5" }),
|
|
80
|
+
/* @__PURE__ */ n("path", { d: "M9 8 V2" }),
|
|
81
|
+
/* @__PURE__ */ n("path", { d: "M15 8 V2" }),
|
|
82
|
+
/* @__PURE__ */ n("path", { d: "M18 8 v4 a6 6 0 0 1 -12 0 V8 z" })
|
|
83
|
+
] })), f = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("polyline", { points: "17 11 12 6 7 11" }), /* @__PURE__ */ n("polyline", { points: "17 17 12 22 7 17" })] })), p = i(/* @__PURE__ */ r(t, { children: [
|
|
84
|
+
/* @__PURE__ */ n("polyline", { points: "3 6 5 6 21 6" }),
|
|
85
|
+
/* @__PURE__ */ n("path", { d: "M19 6 l-1 14 c-.05 1.1 -.96 2 -2 2 H8 c-1.04 0 -1.95 -.9 -2 -2 L5 6" }),
|
|
86
|
+
/* @__PURE__ */ n("path", { d: "M10 11 v6" }),
|
|
87
|
+
/* @__PURE__ */ n("path", { d: "M14 11 v6" })
|
|
88
|
+
] })), m = i(/* @__PURE__ */ r(t, { children: [
|
|
89
|
+
/* @__PURE__ */ n("path", { d: "M18 16.98 h-5.99 c-1.1 0 -1.95 .94 -2.48 1.9 A4 4 0 0 1 2 17 c0 -1.42 .76 -2.66 1.9 -3.34" }),
|
|
90
|
+
/* @__PURE__ */ n("path", { d: "M6 17 l3.13 -5.78 c.53 -.97 .43 -2.22 -.26 -3.07 A4 4 0 1 1 17 7" }),
|
|
91
|
+
/* @__PURE__ */ n("path", { d: "M16 6.78 a4 4 0 1 1 5 6.31 c-.84 .6 -1.36 1.59 -1.36 2.61" })
|
|
92
|
+
] })), h = i(/* @__PURE__ */ r(t, { children: [
|
|
93
|
+
/* @__PURE__ */ n("rect", {
|
|
94
|
+
x: "3",
|
|
95
|
+
y: "3",
|
|
96
|
+
width: "6",
|
|
97
|
+
height: "6",
|
|
98
|
+
rx: "1"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ n("rect", {
|
|
101
|
+
x: "15",
|
|
102
|
+
y: "15",
|
|
103
|
+
width: "6",
|
|
104
|
+
height: "6",
|
|
105
|
+
rx: "1"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ n("path", { d: "M9 6h3a3 3 0 0 1 3 3v3" }),
|
|
108
|
+
/* @__PURE__ */ n("path", { d: "M15 18h-3a3 3 0 0 1-3-3v-3" })
|
|
109
|
+
] })), g = i(/* @__PURE__ */ r(t, { children: [
|
|
110
|
+
/* @__PURE__ */ n("line", {
|
|
111
|
+
x1: "6",
|
|
112
|
+
y1: "3",
|
|
113
|
+
x2: "6",
|
|
114
|
+
y2: "15"
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ n("circle", {
|
|
117
|
+
cx: "18",
|
|
118
|
+
cy: "6",
|
|
119
|
+
r: "3"
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ n("circle", {
|
|
122
|
+
cx: "6",
|
|
123
|
+
cy: "18",
|
|
124
|
+
r: "3"
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ n("path", { d: "M18 9 a9 9 0 0 1 -9 9" })
|
|
127
|
+
] })), _ = i(/* @__PURE__ */ n("path", { d: "m13 2-9 12h7l-1 8 10-12h-7l1-8z" })), v = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("circle", {
|
|
128
|
+
cx: "11",
|
|
129
|
+
cy: "11",
|
|
130
|
+
r: "7"
|
|
131
|
+
}), /* @__PURE__ */ n("path", { d: "m20 20-3.5-3.5" })] })), y = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("path", { d: "M4 12h12M12 6l6 6-6 6" }), /* @__PURE__ */ n("path", { d: "M4 4v16" })] })), b = i(/* @__PURE__ */ r(t, { children: [
|
|
132
|
+
/* @__PURE__ */ n("path", { d: "M4 6h16M4 12h10M4 18h6" }),
|
|
133
|
+
/* @__PURE__ */ n("circle", {
|
|
134
|
+
cx: "18",
|
|
135
|
+
cy: "17",
|
|
136
|
+
r: "3"
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ n("path", { d: "m20.5 19.5 2 2" })
|
|
139
|
+
] })), x = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("path", { d: "M5 4h14v16H5z" }), /* @__PURE__ */ n("path", { d: "M8 8h8M8 12h8M8 16h5" })] })), S = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("rect", {
|
|
140
|
+
x: "3",
|
|
141
|
+
y: "4",
|
|
142
|
+
width: "18",
|
|
143
|
+
height: "12",
|
|
144
|
+
rx: "2"
|
|
145
|
+
}), /* @__PURE__ */ n("path", { d: "M8 20h8M12 16v4" })] })), C = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("rect", {
|
|
146
|
+
x: "3",
|
|
147
|
+
y: "4",
|
|
148
|
+
width: "18",
|
|
149
|
+
height: "16",
|
|
150
|
+
rx: "2"
|
|
151
|
+
}), /* @__PURE__ */ n("path", { d: "M3 14h18" })] })), w = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("rect", {
|
|
152
|
+
x: "3",
|
|
153
|
+
y: "4",
|
|
154
|
+
width: "18",
|
|
155
|
+
height: "16",
|
|
156
|
+
rx: "2"
|
|
157
|
+
}), /* @__PURE__ */ n("path", { d: "M3 10h18" })] })), T = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("rect", {
|
|
158
|
+
x: "3",
|
|
159
|
+
y: "4",
|
|
160
|
+
width: "18",
|
|
161
|
+
height: "16",
|
|
162
|
+
rx: "2"
|
|
163
|
+
}), /* @__PURE__ */ n("path", { d: "M9 4v16" })] })), E = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("rect", {
|
|
164
|
+
x: "3",
|
|
165
|
+
y: "4",
|
|
166
|
+
width: "18",
|
|
167
|
+
height: "16",
|
|
168
|
+
rx: "2"
|
|
169
|
+
}), /* @__PURE__ */ n("path", { d: "M15 4v16" })] })), D = i(/* @__PURE__ */ r(t, { children: [
|
|
170
|
+
/* @__PURE__ */ n("path", { d: "M14 4h6v6" }),
|
|
171
|
+
/* @__PURE__ */ n("path", { d: "M20 4l-8 8" }),
|
|
172
|
+
/* @__PURE__ */ n("path", { d: "M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4" })
|
|
173
|
+
] })), O = i(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("rect", {
|
|
174
|
+
x: "7",
|
|
175
|
+
y: "8",
|
|
176
|
+
width: "14",
|
|
177
|
+
height: "12",
|
|
178
|
+
rx: "2"
|
|
179
|
+
}), /* @__PURE__ */ n("path", { d: "M3 14V6a2 2 0 0 1 2-2h8" })] })), k = i(/* @__PURE__ */ r(t, { children: [
|
|
180
|
+
/* @__PURE__ */ n("circle", {
|
|
181
|
+
cx: "9",
|
|
182
|
+
cy: "6",
|
|
183
|
+
r: "1",
|
|
184
|
+
fill: "currentColor"
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ n("circle", {
|
|
187
|
+
cx: "15",
|
|
188
|
+
cy: "6",
|
|
189
|
+
r: "1",
|
|
190
|
+
fill: "currentColor"
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ n("circle", {
|
|
193
|
+
cx: "9",
|
|
194
|
+
cy: "12",
|
|
195
|
+
r: "1",
|
|
196
|
+
fill: "currentColor"
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ n("circle", {
|
|
199
|
+
cx: "15",
|
|
200
|
+
cy: "12",
|
|
201
|
+
r: "1",
|
|
202
|
+
fill: "currentColor"
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ n("circle", {
|
|
205
|
+
cx: "9",
|
|
206
|
+
cy: "18",
|
|
207
|
+
r: "1",
|
|
208
|
+
fill: "currentColor"
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ n("circle", {
|
|
211
|
+
cx: "15",
|
|
212
|
+
cy: "18",
|
|
213
|
+
r: "1",
|
|
214
|
+
fill: "currentColor"
|
|
215
|
+
})
|
|
216
|
+
] })), A = ({ className: e }) => /* @__PURE__ */ r("svg", {
|
|
217
|
+
viewBox: "0 0 24 24",
|
|
218
|
+
fill: "none",
|
|
219
|
+
className: e,
|
|
220
|
+
"aria-hidden": "true",
|
|
221
|
+
children: [/* @__PURE__ */ n("circle", {
|
|
222
|
+
cx: "12",
|
|
223
|
+
cy: "12",
|
|
224
|
+
r: "9",
|
|
225
|
+
stroke: "currentColor",
|
|
226
|
+
strokeOpacity: "0.2",
|
|
227
|
+
strokeWidth: "2.5"
|
|
228
|
+
}), /* @__PURE__ */ n("path", {
|
|
229
|
+
d: "M21 12 a9 9 0 0 0 -9 -9",
|
|
230
|
+
stroke: "currentColor",
|
|
231
|
+
strokeWidth: "2.5",
|
|
232
|
+
strokeLinecap: "round"
|
|
233
|
+
})]
|
|
234
|
+
});
|
|
235
|
+
//#endregion
|
|
236
|
+
export { c as Activity, f as ArrowUpDown, o as ChevronDown, u as Compass, l as Database, C as DockBottom, D as DockExternal, T as DockLeft, E as DockRight, w as DockTop, O as DockWindow, k as Grip, b as Indexes, x as Logs, S as Monitor, y as Mutation, d as Plug, v as Search, A as Spinner, g as Trace, p as Trash, a as VoltroMark, m as Webhook, h as Workflow, s as X, _ as Zap };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/primitives.tsx
|
|
4
|
+
var n = {
|
|
5
|
+
default: "vdt:bg-muted vdt:text-foreground vdt:hover:bg-muted/80",
|
|
6
|
+
ghost: "vdt:bg-transparent vdt:text-foreground vdt:hover:bg-muted/50",
|
|
7
|
+
outline: "vdt:bg-transparent vdt:text-foreground vdt:border vdt:border-border vdt:hover:border-border-strong",
|
|
8
|
+
accent: "vdt:bg-accent vdt:text-accent-foreground vdt:hover:bg-accent-dim",
|
|
9
|
+
danger: "vdt:bg-danger/15 vdt:text-danger vdt:hover:bg-danger/25"
|
|
10
|
+
}, r = {
|
|
11
|
+
sm: "vdt:text-xs vdt:px-2 vdt:py-1 vdt:rounded-sm",
|
|
12
|
+
md: "vdt:text-sm vdt:px-3 vdt:py-1.5 vdt:rounded-md"
|
|
13
|
+
}, i = ({ variant: t = "default", size: i = "md", onClick: a, disabled: o, children: s, className: c, title: l }) => /* @__PURE__ */ e("button", {
|
|
14
|
+
onClick: a,
|
|
15
|
+
disabled: o,
|
|
16
|
+
title: l,
|
|
17
|
+
className: [
|
|
18
|
+
"vdt:inline-flex vdt:items-center vdt:gap-1.5 vdt:font-medium vdt:transition-colors",
|
|
19
|
+
"vdt:disabled:opacity-40 vdt:disabled:cursor-not-allowed",
|
|
20
|
+
n[t],
|
|
21
|
+
r[i],
|
|
22
|
+
c ?? ""
|
|
23
|
+
].join(" "),
|
|
24
|
+
children: s
|
|
25
|
+
}), a = {
|
|
26
|
+
neutral: "vdt:bg-muted vdt:text-foreground-muted vdt:border vdt:border-border",
|
|
27
|
+
success: "vdt:bg-success/15 vdt:text-success vdt:border vdt:border-success/30",
|
|
28
|
+
warning: "vdt:bg-warning/15 vdt:text-warning vdt:border vdt:border-warning/30",
|
|
29
|
+
danger: "vdt:bg-danger/15 vdt:text-danger vdt:border vdt:border-danger/30",
|
|
30
|
+
info: "vdt:bg-info/15 vdt:text-info vdt:border vdt:border-info/30",
|
|
31
|
+
accent: "vdt:bg-accent/15 vdt:text-accent vdt:border vdt:border-accent/30"
|
|
32
|
+
}, o = ({ tone: t = "neutral", children: n, className: r }) => /* @__PURE__ */ e("span", {
|
|
33
|
+
className: [
|
|
34
|
+
"vdt:inline-flex vdt:items-center vdt:gap-1 vdt:px-1.5 vdt:py-0.5",
|
|
35
|
+
"vdt:rounded-sm vdt:text-[10px] vdt:font-medium vdt:uppercase vdt:tracking-wider",
|
|
36
|
+
a[t],
|
|
37
|
+
r ?? ""
|
|
38
|
+
].join(" "),
|
|
39
|
+
children: n
|
|
40
|
+
}), s = ({ children: t, className: n }) => /* @__PURE__ */ e("div", {
|
|
41
|
+
className: ["vdt:bg-background-elevated vdt:border vdt:border-border vdt:rounded-md", n ?? ""].join(" "),
|
|
42
|
+
children: t
|
|
43
|
+
}), c = ({ children: t, className: n }) => /* @__PURE__ */ e("div", {
|
|
44
|
+
className: ["vdt-card-body", n ?? ""].join(" "),
|
|
45
|
+
children: t
|
|
46
|
+
}), l = ({ children: n, right: r, Icon: i }) => /* @__PURE__ */ t("div", {
|
|
47
|
+
className: "vdt:flex vdt:items-center vdt:justify-between vdt:px-3 vdt:py-2 vdt:border-b vdt:border-border",
|
|
48
|
+
children: [/* @__PURE__ */ t("div", {
|
|
49
|
+
className: "vdt:flex vdt:items-center vdt:gap-1.5",
|
|
50
|
+
children: [i ? /* @__PURE__ */ e(i, { className: "vdt:w-3 vdt:h-3 vdt:text-foreground-muted" }) : null, /* @__PURE__ */ e("span", {
|
|
51
|
+
className: "vdt:text-[10px] vdt:font-semibold vdt:uppercase vdt:tracking-wider vdt:text-foreground-muted",
|
|
52
|
+
children: n
|
|
53
|
+
})]
|
|
54
|
+
}), r ?? null]
|
|
55
|
+
}), u = ({ entries: n }) => /* @__PURE__ */ e("dl", {
|
|
56
|
+
className: "vdt:grid vdt:grid-cols-[auto_1fr] vdt:gap-x-3 vdt:gap-y-1 vdt:px-3 vdt:py-2 vdt:text-xs",
|
|
57
|
+
children: n.map((n) => /* @__PURE__ */ t("div", {
|
|
58
|
+
className: "vdt:contents",
|
|
59
|
+
children: [/* @__PURE__ */ e("dt", {
|
|
60
|
+
className: "vdt:text-foreground-muted vdt:font-medium",
|
|
61
|
+
children: n.key
|
|
62
|
+
}), /* @__PURE__ */ e("dd", {
|
|
63
|
+
className: "vdt:font-mono vdt:text-foreground vdt:break-all",
|
|
64
|
+
children: n.value
|
|
65
|
+
})]
|
|
66
|
+
}, n.key))
|
|
67
|
+
}), d = ({ children: t }) => /* @__PURE__ */ e("div", {
|
|
68
|
+
className: "vdt:flex vdt:items-center vdt:justify-center vdt:py-12 vdt:px-6 vdt:text-center",
|
|
69
|
+
children: /* @__PURE__ */ e("div", {
|
|
70
|
+
className: "vdt:text-xs vdt:text-foreground-subtle vdt:max-w-xs",
|
|
71
|
+
children: t
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { o as Badge, i as Button, s as Card, c as CardBody, d as Empty, u as KeyValue, l as SectionTitle };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { getLogs as e, subscribeLogs as t } from "../logsBus.js";
|
|
2
|
+
import { Spinner as n, VoltroMark as r } from "../components/icons.js";
|
|
3
|
+
import { useDevtoolsStrings as i } from "../strings.js";
|
|
4
|
+
import { useSubscriptionsCount as a } from "../panels/subscriptions.js";
|
|
5
|
+
import { DEFAULT_CAPSULE_PLACEMENT as o } from "../capsulePlacement.js";
|
|
6
|
+
import { useCapsuleClearance as s } from "../useCapsuleClearance.js";
|
|
7
|
+
import { useCallback as c, useEffect as l, useLayoutEffect as u, useRef as d, useSyncExternalStore as f } from "react";
|
|
8
|
+
import { getMutations as p, subscribeMutations as m, useConnectionStatus as h, useFrameworkRuntimes as g } from "@voltro/client";
|
|
9
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
|
+
//#region src/console/Capsule.tsx
|
|
11
|
+
var y = (e) => e === "compiling" || e === "loading" || e === "reconnecting", b = () => f(t, e, e), x = ({ name: e }) => {
|
|
12
|
+
let t = h(e).status;
|
|
13
|
+
return /* @__PURE__ */ v("span", {
|
|
14
|
+
className: "vdt-chip",
|
|
15
|
+
"data-status": t,
|
|
16
|
+
children: [/* @__PURE__ */ _("span", {
|
|
17
|
+
className: `vdt-dot vdt-dot-${t === "connected" ? "ok" : t === "recovering" ? "warn" : "err"}`,
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}), /* @__PURE__ */ _("b", { children: e })]
|
|
20
|
+
});
|
|
21
|
+
}, S = 260, C = "cubic-bezier(0.2, 0.8, 0.2, 1)", w = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, T = (e, t, n) => {
|
|
22
|
+
let r = d(null), i = d(null), a = d(e), o = c((e) => {
|
|
23
|
+
n.current = e, t && (t.current = e);
|
|
24
|
+
}, [t, n]);
|
|
25
|
+
return l(() => {
|
|
26
|
+
let e = n.current;
|
|
27
|
+
if (e === null || typeof ResizeObserver > "u") return;
|
|
28
|
+
r.current = e.offsetWidth;
|
|
29
|
+
let t = new ResizeObserver(() => {
|
|
30
|
+
r.current = e.offsetWidth;
|
|
31
|
+
});
|
|
32
|
+
return t.observe(e), () => t.disconnect();
|
|
33
|
+
}, []), u(() => {
|
|
34
|
+
if (a.current === e) return;
|
|
35
|
+
a.current = e;
|
|
36
|
+
let t = n.current;
|
|
37
|
+
if (t === null || typeof t.animate != "function" || w()) return;
|
|
38
|
+
let o = i.current === null ? r.current : t.offsetWidth;
|
|
39
|
+
i.current?.cancel(), i.current = null;
|
|
40
|
+
let s = t.offsetWidth;
|
|
41
|
+
if (o === null || o === s) return;
|
|
42
|
+
t.setAttribute("data-morphing", "true");
|
|
43
|
+
let c = t.animate([{ width: `${o}px` }, { width: `${s}px` }], {
|
|
44
|
+
duration: S,
|
|
45
|
+
easing: C
|
|
46
|
+
});
|
|
47
|
+
i.current = c;
|
|
48
|
+
let l = () => {
|
|
49
|
+
i.current === c && (i.current = null, t.removeAttribute("data-morphing"));
|
|
50
|
+
};
|
|
51
|
+
c.addEventListener("finish", l), c.addEventListener("cancel", l);
|
|
52
|
+
}, [e]), o;
|
|
53
|
+
}, E = ({ status: e, onOpen: t, buttonRef: c, style: l, dragging: u = !1, onPointerDown: h }) => {
|
|
54
|
+
let S = i().shell, C = g(), w = a(), E = f(m, p, p), D = b(), O = E.filter((e) => e.status === "pending").length, k = E.filter((e) => e.status === "error").length, A = D.filter((e) => e.level === "error" || e.level === "fatal").length, j = D.filter((e) => e.level === "warn").length, M = e !== null, N = e?.kind ?? "idle", P = e === null ? "" : y(N) ? e.label.replace(/[…\.\s]+$/, "") : e.label, F = M ? `${N}:${P}` : "chips", I = d(null), L = T(F, c, I), R = {
|
|
55
|
+
x: l?.["--vdt-capsule-x"] ?? o.x,
|
|
56
|
+
y: l?.["--vdt-capsule-y"] ?? o.y
|
|
57
|
+
}, z = s(I, R, !u), B = {
|
|
58
|
+
...l,
|
|
59
|
+
"--vdt-capsule-x": z.placement.x,
|
|
60
|
+
"--vdt-capsule-y": z.placement.y
|
|
61
|
+
}, V = M ? P : [
|
|
62
|
+
...C.names,
|
|
63
|
+
`${w} ${S.live}`,
|
|
64
|
+
...O > 0 ? [`${O} ${S.pending}`] : [],
|
|
65
|
+
...k > 0 ? [`${k} ${S.failed}`] : [],
|
|
66
|
+
...A > 0 ? [`${A} ${S.errorsWord(A)}`] : [],
|
|
67
|
+
...A === 0 && j > 0 ? [`${j} ${S.warningsWord(j)}`] : []
|
|
68
|
+
].join(", ");
|
|
69
|
+
return /* @__PURE__ */ v("button", {
|
|
70
|
+
ref: L,
|
|
71
|
+
type: "button",
|
|
72
|
+
className: "vdt-capsule",
|
|
73
|
+
"data-busy": M ? "true" : "false",
|
|
74
|
+
"data-kind": N,
|
|
75
|
+
"data-dragging": u ? "true" : void 0,
|
|
76
|
+
"data-clearance-compact": z.compact ? "true" : void 0,
|
|
77
|
+
style: B,
|
|
78
|
+
onClick: t,
|
|
79
|
+
onPointerDown: h,
|
|
80
|
+
title: M || z.compact ? `${S.openTitle}: ${V}` : S.openTitle,
|
|
81
|
+
"aria-label": M || z.compact ? `${S.openLabel}: ${V}` : S.openLabel,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ _("span", {
|
|
84
|
+
className: "vdt-capsule-halo vdt-capsule-aura",
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ _("span", {
|
|
88
|
+
className: "vdt-capsule-halo",
|
|
89
|
+
"aria-hidden": "true"
|
|
90
|
+
}),
|
|
91
|
+
M ? /* @__PURE__ */ _(n, { className: "vdt-capsule-mark vdt-spinner" }) : /* @__PURE__ */ _(r, { className: "vdt-capsule-mark" }),
|
|
92
|
+
M ? /* @__PURE__ */ v("span", {
|
|
93
|
+
className: "vdt-capsule-status",
|
|
94
|
+
children: [/* @__PURE__ */ _("span", {
|
|
95
|
+
className: "vdt-capsule-label",
|
|
96
|
+
children: P
|
|
97
|
+
}), y(N) ? /* @__PURE__ */ v("span", {
|
|
98
|
+
className: "vdt-dots",
|
|
99
|
+
"aria-hidden": "true",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ _("span", {}),
|
|
102
|
+
/* @__PURE__ */ _("span", {}),
|
|
103
|
+
/* @__PURE__ */ _("span", {})
|
|
104
|
+
]
|
|
105
|
+
}) : null]
|
|
106
|
+
}, F) : /* @__PURE__ */ v("span", {
|
|
107
|
+
className: "vdt-capsule-chips",
|
|
108
|
+
children: [
|
|
109
|
+
C.names.map((e) => /* @__PURE__ */ _(x, { name: e }, e)),
|
|
110
|
+
/* @__PURE__ */ v("span", {
|
|
111
|
+
className: "vdt-chip",
|
|
112
|
+
"data-chip": "live",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ _("b", { children: w }),
|
|
115
|
+
" ",
|
|
116
|
+
S.live
|
|
117
|
+
]
|
|
118
|
+
}),
|
|
119
|
+
O > 0 ? /* @__PURE__ */ v("span", {
|
|
120
|
+
className: "vdt-chip vdt-chip-info",
|
|
121
|
+
"data-chip": "pending",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ _("span", {
|
|
124
|
+
className: "vdt-dot vdt-dot-info",
|
|
125
|
+
"aria-hidden": "true"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ _("b", { children: O }),
|
|
128
|
+
" ",
|
|
129
|
+
S.pending
|
|
130
|
+
]
|
|
131
|
+
}) : null,
|
|
132
|
+
k > 0 ? /* @__PURE__ */ v("span", {
|
|
133
|
+
className: "vdt-chip vdt-chip-err",
|
|
134
|
+
"data-chip": "failed",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ _("span", {
|
|
137
|
+
className: "vdt-dot vdt-dot-err",
|
|
138
|
+
"aria-hidden": "true"
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ _("b", { children: k }),
|
|
141
|
+
" ",
|
|
142
|
+
S.failed
|
|
143
|
+
]
|
|
144
|
+
}) : null,
|
|
145
|
+
A > 0 ? /* @__PURE__ */ v("span", {
|
|
146
|
+
className: "vdt-chip vdt-chip-err",
|
|
147
|
+
"data-chip": "errors",
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ _("b", { children: A }),
|
|
150
|
+
" ",
|
|
151
|
+
S.errorsWord(A)
|
|
152
|
+
]
|
|
153
|
+
}) : null,
|
|
154
|
+
A === 0 && j > 0 ? /* @__PURE__ */ v("span", {
|
|
155
|
+
className: "vdt-chip vdt-chip-warn",
|
|
156
|
+
"data-chip": "warnings",
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ _("b", { children: j }),
|
|
159
|
+
" ",
|
|
160
|
+
S.warningsWord(j)
|
|
161
|
+
]
|
|
162
|
+
}) : null
|
|
163
|
+
]
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
//#endregion
|
|
169
|
+
export { E as Capsule };
|