@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
package/dist/strings.js
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { createContext as e, useContext as t, useMemo as n } from "react";
|
|
2
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
//#region src/strings.tsx
|
|
4
|
+
var o = {
|
|
5
|
+
shell: {
|
|
6
|
+
brand: "Voltro Devtools",
|
|
7
|
+
brandWord: "Voltro",
|
|
8
|
+
kicker: "Devtools",
|
|
9
|
+
openLabel: "Open Voltro Devtools",
|
|
10
|
+
openTitle: "Open Voltro Devtools (Alt+V) · drag to move",
|
|
11
|
+
closeTitle: "Close (Alt+V)",
|
|
12
|
+
searchPlaceholder: "Search subscriptions, mutations, actions, traces, logs…",
|
|
13
|
+
searchLabel: "Search",
|
|
14
|
+
dockMenuTitle: "Dock position",
|
|
15
|
+
dockBottom: "Dock to bottom",
|
|
16
|
+
dockTop: "Dock to top",
|
|
17
|
+
dockLeft: "Dock to left",
|
|
18
|
+
dockRight: "Dock to right",
|
|
19
|
+
dockWindow: "Floating window",
|
|
20
|
+
dockExternal: "Own browser window",
|
|
21
|
+
externalBlocked: "The browser blocked the console window — allow pop-ups for this page, or click the capsule to try again.",
|
|
22
|
+
pushPage: "Push the page",
|
|
23
|
+
pushPageHint: "Lays the page out beside the console, dialogs included. 100vw and media queries still see the full window.",
|
|
24
|
+
resizeLabel: "Resize",
|
|
25
|
+
moveTitle: "Drag to move",
|
|
26
|
+
scopeAll: "All",
|
|
27
|
+
connected: "connected",
|
|
28
|
+
recovering: "reconnecting",
|
|
29
|
+
degraded: "degraded",
|
|
30
|
+
offline: "offline",
|
|
31
|
+
live: "live",
|
|
32
|
+
pending: "pending",
|
|
33
|
+
retainedSelection: "Saved selection — no longer in the recent feed. Select another entry to release it.",
|
|
34
|
+
pendingInvocations: (e) => `Show pending calls (${e})`,
|
|
35
|
+
emptyPending: "No pending calls.",
|
|
36
|
+
emptyPendingHint: "All captured calls have settled. Turn off the pending filter to see their results.",
|
|
37
|
+
failed: "failed",
|
|
38
|
+
errorsWord: (e) => e === 1 ? "error" : "errors",
|
|
39
|
+
warningsWord: (e) => e === 1 ? "warning" : "warnings",
|
|
40
|
+
results: (e) => `${e} result${e === 1 ? "" : "s"}`,
|
|
41
|
+
noResults: "Nothing matches.",
|
|
42
|
+
noResultsHint: "Search matches names, inputs, messages and error text. Quote a phrase to match it whole.",
|
|
43
|
+
emptyAll: "Nothing captured yet.",
|
|
44
|
+
emptyAllHint: "Subscriptions, mutations, actions, traces and logs appear here as the app produces them.",
|
|
45
|
+
emptySubscriptions: "No live subscriptions.",
|
|
46
|
+
emptySubscriptionsHint: "Mount a `useSubscription` hook and its cache entry appears here.",
|
|
47
|
+
emptyMutations: "No mutations yet.",
|
|
48
|
+
emptyMutationsHint: "Every `useMutation` call lands here with its input, result and timing.",
|
|
49
|
+
emptyActions: "No actions yet.",
|
|
50
|
+
emptyActionsHint: "Every `useAction` call lands here with its input, result and timing.",
|
|
51
|
+
emptyTraces: "No traces yet.",
|
|
52
|
+
emptyTracesHint: "Spans arrive from the api while the console is open.",
|
|
53
|
+
emptyLogs: "No log records yet.",
|
|
54
|
+
emptyLogsHint: "Records from `@voltro/logger` in this page land here.",
|
|
55
|
+
selectHint: "Select a row to see its detail.",
|
|
56
|
+
hintNavigate: "navigate",
|
|
57
|
+
hintOpen: "open",
|
|
58
|
+
hintToggle: "toggle",
|
|
59
|
+
hintDock: "dock",
|
|
60
|
+
crashTitle: "The devtools overlay hit an error. The page is unaffected.",
|
|
61
|
+
crashReset: "Reset overlay"
|
|
62
|
+
},
|
|
63
|
+
inspect: {
|
|
64
|
+
refusedTitle: (e, t) => `The inspect surface of \`${e}\` refused the devtools (HTTP ${t}).`,
|
|
65
|
+
unreachableTitle: (e) => `The inspect surface of \`${e}\` could not be read.`,
|
|
66
|
+
unreachableHint: "The browser gave no status. An api on another origin looks exactly like this when it refuses the request — the browser hides the reason. The api answers a cross-origin read only for a page on `localhost`, so from a deployed host that path cannot work with or without a token. Read it through the web server instead: drop `apis.<name>.url` and point `VOLTRO_API_ORIGIN_<NAME>` at the api, so the overlay fetches `/_voltro/api/<name>` on this origin. The web server lends the api's credential only to its own machine, to a session signed in with `VOLTRO_DASHBOARD_TOKEN`, or to a client network listed in `VOLTRO_INSPECT_TRUSTED_CLIENTS` (behind the proxies in `VOLTRO_TRUSTED_PROXIES`).",
|
|
67
|
+
fixLabel: "Fix:",
|
|
68
|
+
paused: "Inspect reads for this api are paused until you reopen the console.",
|
|
69
|
+
tokenLabel: "Devtools token (VOLTRO_DASHBOARD_TOKEN)",
|
|
70
|
+
signIn: "Sign in",
|
|
71
|
+
signInFailed: (e) => `Sign-in refused: ${e}`
|
|
72
|
+
},
|
|
73
|
+
tabs: {
|
|
74
|
+
subscriptions: "Subs",
|
|
75
|
+
mutations: "Mutations",
|
|
76
|
+
actions: "Actions",
|
|
77
|
+
stores: "Stores",
|
|
78
|
+
indexes: "Indexes",
|
|
79
|
+
webhooks: "Webhooks",
|
|
80
|
+
traces: "Traces",
|
|
81
|
+
routes: "Routes",
|
|
82
|
+
runtimes: "Runtimes",
|
|
83
|
+
logs: "Logs",
|
|
84
|
+
workflows: "Workflows",
|
|
85
|
+
pwa: "PWA",
|
|
86
|
+
desktop: "Desktop"
|
|
87
|
+
},
|
|
88
|
+
pwa: {
|
|
89
|
+
loading: "Reading the worker…",
|
|
90
|
+
unsupported: "No service worker support in this browser — the PWA surface is off here.",
|
|
91
|
+
refresh: "Refresh",
|
|
92
|
+
worker: "Service worker",
|
|
93
|
+
scope: "scope",
|
|
94
|
+
script: "script",
|
|
95
|
+
backgroundSync: "background sync",
|
|
96
|
+
update: "Update",
|
|
97
|
+
checkNow: "Check now",
|
|
98
|
+
forceUpdate: "Force update",
|
|
99
|
+
currentBuild: "current build",
|
|
100
|
+
waitingBuild: "waiting build",
|
|
101
|
+
online: "online",
|
|
102
|
+
precache: "Caches",
|
|
103
|
+
noCaches: "No voltro-* cache yet — the worker precaches at install.",
|
|
104
|
+
entries: (e) => e === 1 ? "1 entry" : `${e} entries`,
|
|
105
|
+
installAndPush: "Install + push",
|
|
106
|
+
install: "Install",
|
|
107
|
+
installed: "installed",
|
|
108
|
+
installPrompt: "install prompt",
|
|
109
|
+
pushPermission: "push permission",
|
|
110
|
+
pushSubscription: "push subscription",
|
|
111
|
+
yes: "yes",
|
|
112
|
+
no: "no",
|
|
113
|
+
none: "—",
|
|
114
|
+
unknown: "?"
|
|
115
|
+
},
|
|
116
|
+
desktop: {
|
|
117
|
+
notDesktop: "Not a desktop shell — this is a browser tab; the desktop surface is off here.",
|
|
118
|
+
refresh: "Refresh",
|
|
119
|
+
shell: "Shell",
|
|
120
|
+
kind: "kind",
|
|
121
|
+
os: "os",
|
|
122
|
+
theme: "theme",
|
|
123
|
+
window: "window",
|
|
124
|
+
appVersion: "app version",
|
|
125
|
+
updater: "Updater",
|
|
126
|
+
updaterPort: "update channel",
|
|
127
|
+
checkNow: "Check now",
|
|
128
|
+
waitingVersion: "available version",
|
|
129
|
+
localStack: "Local Stack",
|
|
130
|
+
sidecarPort: "sidecar port",
|
|
131
|
+
apiUrl: "api url",
|
|
132
|
+
apiName: "api name",
|
|
133
|
+
capabilities: "Capabilities",
|
|
134
|
+
noCapabilities: "No capability reports true — the adapter fills in what the shell has.",
|
|
135
|
+
yes: "yes",
|
|
136
|
+
no: "no",
|
|
137
|
+
none: "—",
|
|
138
|
+
unknown: "?"
|
|
139
|
+
},
|
|
140
|
+
workflows: {
|
|
141
|
+
noApi: "No api processes connected — workflows discover from `*.workflow.tsx`.",
|
|
142
|
+
noDefinitions: "This api registers no workflows.",
|
|
143
|
+
noRuns: "No runs yet — start one above, or call `useWorkflow()` from the page.",
|
|
144
|
+
runsUnavailable: "The run list is unavailable — the api refused the workflow built-ins (check access or the api log).",
|
|
145
|
+
runs: (e) => `Runs (${e})`,
|
|
146
|
+
runsBadge: (e) => `${e} runs`,
|
|
147
|
+
runningBadge: (e) => `${e} running`,
|
|
148
|
+
child: "child",
|
|
149
|
+
start: "Start",
|
|
150
|
+
starting: "Starting…",
|
|
151
|
+
workflowLabel: "Workflow",
|
|
152
|
+
payloadLabel: "Payload (JSON)",
|
|
153
|
+
payloadHint: "Prefilled from the last run of this workflow; edit and start.",
|
|
154
|
+
invalidJson: (e) => `Payload is not valid JSON: ${e}`,
|
|
155
|
+
started: (e, t) => `Started · ${e} · ${t}`,
|
|
156
|
+
startFailed: (e) => `Start refused: ${e}`,
|
|
157
|
+
steps: (e) => `Steps (${e})`,
|
|
158
|
+
noSteps: "No steps recorded yet.",
|
|
159
|
+
events: (e) => `Events (${e})`,
|
|
160
|
+
attempt: (e) => `attempt ${e}`,
|
|
161
|
+
input: "Input",
|
|
162
|
+
output: "Output",
|
|
163
|
+
error: "Error",
|
|
164
|
+
trace: "trace",
|
|
165
|
+
cancel: "Cancel run",
|
|
166
|
+
cancelResult: (e) => `Cancel · ${e}`,
|
|
167
|
+
awaiting: "awaiting signal",
|
|
168
|
+
signalName: "Signal",
|
|
169
|
+
signalPayload: "Signal payload (JSON)",
|
|
170
|
+
sendSignal: "Send signal",
|
|
171
|
+
signalSent: (e) => `Signal \`${e}\` sent.`,
|
|
172
|
+
actionFailed: (e, t) => `${e} refused: ${t}`
|
|
173
|
+
},
|
|
174
|
+
subscriptions: {
|
|
175
|
+
emptyTitle: "No active subscriptions.",
|
|
176
|
+
emptyHint: "Mount a `useSubscription` hook to see live cache state here.",
|
|
177
|
+
timelineTitle: "Client recovery timeline"
|
|
178
|
+
},
|
|
179
|
+
indexes: {
|
|
180
|
+
noApis: "No APIs mounted in this app.",
|
|
181
|
+
unreachableTitle: "Couldn't reach any api's `/_voltro/inspect/subscriptions` endpoint.",
|
|
182
|
+
unreachableHint: "Is `voltro dev` running? `/_voltro/inspect/*` requires `VOLTRO_INSPECT_TOKEN`; `voltro dev` mints one per project and its proxy sends it for you. Under `voltro start` / `voltro serve` you must set it yourself, or pass `<VoltroDevtools inspectToken>`.",
|
|
183
|
+
offline: "offline",
|
|
184
|
+
tables: "Tables",
|
|
185
|
+
subscriptionsSection: "Subscriptions",
|
|
186
|
+
subsBadge: (e) => `${e} subs`,
|
|
187
|
+
live: "live",
|
|
188
|
+
poll: "poll",
|
|
189
|
+
via: "via",
|
|
190
|
+
clients: (e) => e === 1 ? "client" : "clients"
|
|
191
|
+
},
|
|
192
|
+
webhooks: {
|
|
193
|
+
empty: "No api processes connected — webhooks discover from `*.webhook.tsx`.",
|
|
194
|
+
outgoing: (e) => `Outgoing events (${e})`,
|
|
195
|
+
incoming: (e) => `Incoming routes (${e})`,
|
|
196
|
+
targets: (e) => `Active targets (${e})`,
|
|
197
|
+
deliveries: (e) => `Recent deliveries (${e})`,
|
|
198
|
+
signed: "signed",
|
|
199
|
+
unsigned: "unsigned",
|
|
200
|
+
active: "active",
|
|
201
|
+
paused: "paused",
|
|
202
|
+
attempt: (e) => `attempt ${e}`
|
|
203
|
+
},
|
|
204
|
+
mutations: {
|
|
205
|
+
emptyTitle: "No mutations yet.",
|
|
206
|
+
emptyHint: "Calling `mutate(input)` from any `useMutation()` hook will land a row here. Newest-first; capped at 100 entries.",
|
|
207
|
+
clearTitle: "Clear mutation history",
|
|
208
|
+
clear: "Clear",
|
|
209
|
+
recent: (e) => `Recent (${e})`
|
|
210
|
+
},
|
|
211
|
+
logs: {
|
|
212
|
+
filters: "Filters",
|
|
213
|
+
clearTitle: "Clear log history",
|
|
214
|
+
clear: "Clear",
|
|
215
|
+
searchPlaceholder: "Filter messages, scope, fields…",
|
|
216
|
+
emptyNone: "No log records yet.",
|
|
217
|
+
emptyNoMatch: "No records match the current filters.",
|
|
218
|
+
emptyHint: "Every `createLogger().info(...)` / `Effect.log*` call lands here (capped at 500, newest-first).",
|
|
219
|
+
tail: "Tail"
|
|
220
|
+
},
|
|
221
|
+
routes: {
|
|
222
|
+
currentRoute: "Current Route",
|
|
223
|
+
loaderData: "Loader Data",
|
|
224
|
+
collapse: "collapse",
|
|
225
|
+
expand: "expand",
|
|
226
|
+
noLoaderTitle: "No loader data for this route.",
|
|
227
|
+
noLoaderHint: (e) => /* @__PURE__ */ a(r, { children: [
|
|
228
|
+
"Pages with an exported `loader` see their resolved data here. UI-only apps (no ",
|
|
229
|
+
e,
|
|
230
|
+
") don't surface loader state at all."
|
|
231
|
+
] })
|
|
232
|
+
},
|
|
233
|
+
runtimes: {
|
|
234
|
+
emptyTitle: "No APIs mounted in this app.",
|
|
235
|
+
emptyHint: "UI-only apps (no `apis` in app.config.ts) don't open any runtimes.",
|
|
236
|
+
live: "live"
|
|
237
|
+
},
|
|
238
|
+
traces: {
|
|
239
|
+
includeBackground: "Show background traces",
|
|
240
|
+
duration: "Duration",
|
|
241
|
+
lastDelivery: "Last delivery",
|
|
242
|
+
attributes: "Recorded attributes",
|
|
243
|
+
noAttributes: "No attributes were recorded for this span.",
|
|
244
|
+
sqlWithoutCaller: "Only database spans were captured. No calling request or action was recorded in this trace.",
|
|
245
|
+
missingParents: "Parent spans are missing from this capture. The calling operation and full duration may be unavailable.",
|
|
246
|
+
noApi: "No API connected. Traces appear once a `useMutation` / `useSubscription` call runs.",
|
|
247
|
+
noneCaptured: (e) => `${e} — no traces captured yet. Trigger an action.`,
|
|
248
|
+
proxiedTitle: "Traces aren't fetchable from this browser — the API is reached over a proxied socket, so there's no direct inspect origin for this panel.",
|
|
249
|
+
proxiedHint: (e) => /* @__PURE__ */ a(r, { children: [
|
|
250
|
+
"They're still recorded server-side. Use ",
|
|
251
|
+
e,
|
|
252
|
+
" or open the app's",
|
|
253
|
+
" ",
|
|
254
|
+
"Traces page in the cloud dashboard."
|
|
255
|
+
] }),
|
|
256
|
+
ok: "ok",
|
|
257
|
+
error: "error",
|
|
258
|
+
sub: "sub",
|
|
259
|
+
delivery: (e) => e === 1 ? "delivery" : "deliveries",
|
|
260
|
+
spans: (e) => `${e} ${e === 1 ? "span" : "spans"}`
|
|
261
|
+
}
|
|
262
|
+
}, s = e(o), c = (e, t) => ({
|
|
263
|
+
shell: {
|
|
264
|
+
...e.shell,
|
|
265
|
+
...t.shell
|
|
266
|
+
},
|
|
267
|
+
inspect: {
|
|
268
|
+
...e.inspect,
|
|
269
|
+
...t.inspect
|
|
270
|
+
},
|
|
271
|
+
tabs: {
|
|
272
|
+
...e.tabs,
|
|
273
|
+
...t.tabs
|
|
274
|
+
},
|
|
275
|
+
subscriptions: {
|
|
276
|
+
...e.subscriptions,
|
|
277
|
+
...t.subscriptions
|
|
278
|
+
},
|
|
279
|
+
indexes: {
|
|
280
|
+
...e.indexes,
|
|
281
|
+
...t.indexes
|
|
282
|
+
},
|
|
283
|
+
webhooks: {
|
|
284
|
+
...e.webhooks,
|
|
285
|
+
...t.webhooks
|
|
286
|
+
},
|
|
287
|
+
mutations: {
|
|
288
|
+
...e.mutations,
|
|
289
|
+
...t.mutations
|
|
290
|
+
},
|
|
291
|
+
logs: {
|
|
292
|
+
...e.logs,
|
|
293
|
+
...t.logs
|
|
294
|
+
},
|
|
295
|
+
routes: {
|
|
296
|
+
...e.routes,
|
|
297
|
+
...t.routes
|
|
298
|
+
},
|
|
299
|
+
runtimes: {
|
|
300
|
+
...e.runtimes,
|
|
301
|
+
...t.runtimes
|
|
302
|
+
},
|
|
303
|
+
traces: {
|
|
304
|
+
...e.traces,
|
|
305
|
+
...t.traces
|
|
306
|
+
},
|
|
307
|
+
workflows: {
|
|
308
|
+
...e.workflows,
|
|
309
|
+
...t.workflows
|
|
310
|
+
},
|
|
311
|
+
pwa: {
|
|
312
|
+
...e.pwa,
|
|
313
|
+
...t.pwa
|
|
314
|
+
},
|
|
315
|
+
desktop: {
|
|
316
|
+
...e.desktop,
|
|
317
|
+
...t.desktop
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
function l(e) {
|
|
321
|
+
let r = t(s), a = n(() => c(r, e.strings), [r, e.strings]);
|
|
322
|
+
return /* @__PURE__ */ i(s.Provider, {
|
|
323
|
+
value: a,
|
|
324
|
+
children: e.children
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
var u = (e) => {
|
|
328
|
+
let r = t(s);
|
|
329
|
+
return n(() => e ? c(r, e) : r, [r, e]);
|
|
330
|
+
};
|
|
331
|
+
//#endregion
|
|
332
|
+
export { l as DevtoolsStringsProvider, o as defaultDevtoolsStrings, u as useDevtoolsStrings };
|
package/dist/styles.css
CHANGED
|
@@ -393,6 +393,26 @@
|
|
|
393
393
|
font-weight: 600;
|
|
394
394
|
color: var(--foreground);
|
|
395
395
|
}
|
|
396
|
+
.vdt-scope .vdt-capsule-label {
|
|
397
|
+
max-width: 34ch;
|
|
398
|
+
overflow: hidden;
|
|
399
|
+
text-overflow: ellipsis;
|
|
400
|
+
white-space: nowrap;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* A dense host can leave no free space for the full face. Keep a reachable
|
|
404
|
+
* status mark; the accessible label and title still carry the complete state.
|
|
405
|
+
* The clearance hook measures the natural face before deciding to restore it. */
|
|
406
|
+
.vdt-scope .vdt-capsule[data-clearance-compact="true"] {
|
|
407
|
+
width: 44px !important;
|
|
408
|
+
height: 44px;
|
|
409
|
+
min-width: 44px;
|
|
410
|
+
padding: 0;
|
|
411
|
+
justify-content: center;
|
|
412
|
+
gap: 0;
|
|
413
|
+
}
|
|
414
|
+
.vdt-scope .vdt-capsule[data-clearance-compact="true"] .vdt-capsule-status,
|
|
415
|
+
.vdt-scope .vdt-capsule[data-clearance-compact="true"] .vdt-capsule-chips { display: none; }
|
|
396
416
|
|
|
397
417
|
/* Busy kinds re-colour the ring + mark so the capsule reads as one state. */
|
|
398
418
|
.vdt-scope .vdt-capsule[data-kind="reconnecting"] { --pill-glow: var(--warning); }
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isSamePlacement as e } from "./capsulePlacement.js";
|
|
2
|
+
import { clearCapsulePlacement as t, hasCapsuleClearance as n } from "./capsuleClearance.js";
|
|
3
|
+
import { useLayoutEffect as r, useRef as i, useState as a } from "react";
|
|
4
|
+
//#region src/useCapsuleClearance.ts
|
|
5
|
+
var o = "a[href],button,input,select,textarea,label,legend,summary,th,td,[role=\"button\"],[role=\"link\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"tab\"],[role=\"alert\"],[role=\"status\"],[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],[aria-live]:not([aria-live=\"off\"]),[contenteditable=\"true\"],[tabindex]:not([tabindex=\"-1\"]),h1,h2,h3,h4,h5,h6,p", s = (s, c, l) => {
|
|
6
|
+
let [u, d] = a({
|
|
7
|
+
preferred: c,
|
|
8
|
+
placement: c,
|
|
9
|
+
compact: !1
|
|
10
|
+
}), f = i(u);
|
|
11
|
+
return r(() => {
|
|
12
|
+
let r = s.current;
|
|
13
|
+
if (!l || !r) return;
|
|
14
|
+
let i = r.ownerDocument, a = i.defaultView;
|
|
15
|
+
if (!a) return;
|
|
16
|
+
let u = !1, p = !1, m = null, h = () => {
|
|
17
|
+
let s = r.getAttribute("data-clearance-compact");
|
|
18
|
+
r.removeAttribute("data-clearance-compact");
|
|
19
|
+
let l = r.getBoundingClientRect();
|
|
20
|
+
if (s !== null && r.setAttribute("data-clearance-compact", s), l.width === 0 || l.height === 0) return;
|
|
21
|
+
let u = {
|
|
22
|
+
width: a.innerWidth,
|
|
23
|
+
height: a.innerHeight
|
|
24
|
+
}, p = [];
|
|
25
|
+
for (let e of i.body.querySelectorAll(o)) {
|
|
26
|
+
if (e.closest("[hidden],[inert]")) continue;
|
|
27
|
+
let t = e.getBoundingClientRect();
|
|
28
|
+
t.width === 0 || t.height === 0 || t.right <= 0 || t.bottom <= 0 || t.left >= u.width || t.top >= u.height || a.getComputedStyle(e).visibility !== "hidden" && p.push(t);
|
|
29
|
+
}
|
|
30
|
+
let m = e(f.current.preferred, c), h = m ? f.current.placement : c, g = {
|
|
31
|
+
w: l.width,
|
|
32
|
+
h: l.height
|
|
33
|
+
}, _ = t(c, h, g, u, p), v = !n(_, g, u, p), y = v ? t(c, h, {
|
|
34
|
+
w: 44,
|
|
35
|
+
h: 44
|
|
36
|
+
}, u, p) : _;
|
|
37
|
+
m && e(f.current.placement, y) && f.current.compact === v || (f.current = {
|
|
38
|
+
preferred: c,
|
|
39
|
+
placement: y,
|
|
40
|
+
compact: v
|
|
41
|
+
}, d(f.current));
|
|
42
|
+
}, g = () => {
|
|
43
|
+
if (u || p) return;
|
|
44
|
+
p = !0;
|
|
45
|
+
let e = requestAnimationFrame(() => {
|
|
46
|
+
p = !1, m = null, u || h();
|
|
47
|
+
});
|
|
48
|
+
p && (m = e);
|
|
49
|
+
}, _ = new MutationObserver(g);
|
|
50
|
+
_.observe(i.body, {
|
|
51
|
+
childList: !0,
|
|
52
|
+
characterData: !0,
|
|
53
|
+
subtree: !0,
|
|
54
|
+
attributes: !0,
|
|
55
|
+
attributeFilter: [
|
|
56
|
+
"class",
|
|
57
|
+
"style",
|
|
58
|
+
"hidden",
|
|
59
|
+
"inert",
|
|
60
|
+
"open",
|
|
61
|
+
"disabled",
|
|
62
|
+
"role",
|
|
63
|
+
"aria-live",
|
|
64
|
+
"tabindex"
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
let v = typeof ResizeObserver > "u" ? null : new ResizeObserver(g);
|
|
68
|
+
return v?.observe(r), v?.observe(i.body), i.addEventListener("scroll", g, {
|
|
69
|
+
capture: !0,
|
|
70
|
+
passive: !0
|
|
71
|
+
}), a.addEventListener("resize", g, { passive: !0 }), g(), () => {
|
|
72
|
+
u = !0, _.disconnect(), v?.disconnect(), i.removeEventListener("scroll", g, !0), a.removeEventListener("resize", g), m !== null && cancelAnimationFrame(m);
|
|
73
|
+
};
|
|
74
|
+
}, [
|
|
75
|
+
s,
|
|
76
|
+
c.x,
|
|
77
|
+
c.y,
|
|
78
|
+
l
|
|
79
|
+
]), l && e(u.preferred, c) ? u : {
|
|
80
|
+
placement: c,
|
|
81
|
+
compact: u.compact
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { s as useCapsuleClearance };
|
package/dist/useDock.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { DEFAULT_CAPSULE_PLACEMENT as e, decodeCapsulePlacement as t, isSamePlacement as n } from "./capsulePlacement.js";
|
|
2
|
+
import { useCallback as r, useEffect as i, useState as a, useSyncExternalStore as o } from "react";
|
|
3
|
+
//#region src/useDock.ts
|
|
4
|
+
var s = [
|
|
5
|
+
"bottom",
|
|
6
|
+
"top",
|
|
7
|
+
"left",
|
|
8
|
+
"right",
|
|
9
|
+
"window",
|
|
10
|
+
"external"
|
|
11
|
+
], c = [
|
|
12
|
+
"bottom",
|
|
13
|
+
"top",
|
|
14
|
+
"left",
|
|
15
|
+
"right"
|
|
16
|
+
], l = (e) => typeof e == "string" && s.includes(e), u = (e) => e !== "window" && e !== "external", d = {
|
|
17
|
+
bottom: 240,
|
|
18
|
+
top: 240,
|
|
19
|
+
left: 320,
|
|
20
|
+
right: 320
|
|
21
|
+
}, f = {
|
|
22
|
+
w: 480,
|
|
23
|
+
h: 320
|
|
24
|
+
}, p = 64, m = {
|
|
25
|
+
dock: "bottom",
|
|
26
|
+
sizes: {
|
|
27
|
+
bottom: 400,
|
|
28
|
+
top: 400,
|
|
29
|
+
left: 460,
|
|
30
|
+
right: 460
|
|
31
|
+
},
|
|
32
|
+
window: {
|
|
33
|
+
x: 80,
|
|
34
|
+
y: 80,
|
|
35
|
+
w: 860,
|
|
36
|
+
h: 560
|
|
37
|
+
},
|
|
38
|
+
push: !1,
|
|
39
|
+
capsule: e
|
|
40
|
+
}, h = "voltro:devtools:dock", g = (e) => typeof e == "number" && Number.isFinite(e), _ = (e, n) => {
|
|
41
|
+
let r = {
|
|
42
|
+
...m,
|
|
43
|
+
dock: n
|
|
44
|
+
};
|
|
45
|
+
if (typeof e != "object" || !e) return r;
|
|
46
|
+
let i = e, a = typeof i.sizes == "object" && i.sizes !== null ? i.sizes : {}, o = { ...m.sizes };
|
|
47
|
+
for (let e of c) {
|
|
48
|
+
let t = a[e];
|
|
49
|
+
g(t) && t >= d[e] && (o[e] = Math.round(t));
|
|
50
|
+
}
|
|
51
|
+
let s = typeof i.window == "object" && i.window !== null ? i.window : {}, u = {
|
|
52
|
+
x: g(s.x) ? Math.round(s.x) : r.window.x,
|
|
53
|
+
y: g(s.y) ? Math.round(s.y) : r.window.y,
|
|
54
|
+
w: g(s.w) && s.w >= f.w ? Math.round(s.w) : r.window.w,
|
|
55
|
+
h: g(s.h) && s.h >= f.h ? Math.round(s.h) : r.window.h
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
dock: l(i.dock) ? i.dock : n,
|
|
59
|
+
sizes: o,
|
|
60
|
+
window: u,
|
|
61
|
+
push: i.push === !0,
|
|
62
|
+
capsule: t(i.capsule)
|
|
63
|
+
};
|
|
64
|
+
}, v = (e) => {
|
|
65
|
+
if (typeof window > "u") return {
|
|
66
|
+
...m,
|
|
67
|
+
dock: e
|
|
68
|
+
};
|
|
69
|
+
try {
|
|
70
|
+
let t = window.localStorage.getItem(h);
|
|
71
|
+
return t === null ? {
|
|
72
|
+
...m,
|
|
73
|
+
dock: e
|
|
74
|
+
} : _(JSON.parse(t), e);
|
|
75
|
+
} catch {
|
|
76
|
+
return {
|
|
77
|
+
...m,
|
|
78
|
+
dock: e
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}, y = (e) => {
|
|
82
|
+
if (typeof window < "u") try {
|
|
83
|
+
window.localStorage.setItem(h, JSON.stringify(e));
|
|
84
|
+
} catch {}
|
|
85
|
+
}, b = () => typeof window > "u" ? {
|
|
86
|
+
width: 1440,
|
|
87
|
+
height: 900
|
|
88
|
+
} : {
|
|
89
|
+
width: window.innerWidth,
|
|
90
|
+
height: window.innerHeight
|
|
91
|
+
}, x = (e, t, n = b()) => {
|
|
92
|
+
let r = e === "left" || e === "right" ? n.width : n.height, i = Math.max(d[e], r - p);
|
|
93
|
+
return Math.round(Math.min(i, Math.max(d[e], t)));
|
|
94
|
+
}, S = (e, t = b()) => {
|
|
95
|
+
let n = Math.max(120, t.width - 16), r = Math.max(120, t.height - 16), i = Math.round(Math.min(Math.max(Math.min(f.w, n), e.w), n)), a = Math.round(Math.min(Math.max(Math.min(f.h, r), e.h), r));
|
|
96
|
+
return {
|
|
97
|
+
x: Math.round(Math.min(Math.max(8, e.x), Math.max(8, t.width - i - 8))),
|
|
98
|
+
y: Math.round(Math.min(Math.max(8, e.y), Math.max(8, t.height - a - 8))),
|
|
99
|
+
w: i,
|
|
100
|
+
h: a
|
|
101
|
+
};
|
|
102
|
+
}, C = (e, t) => {
|
|
103
|
+
let n = { ...e.sizes }, r = !1;
|
|
104
|
+
for (let e of c) {
|
|
105
|
+
let i = x(e, n[e], t);
|
|
106
|
+
i !== n[e] && (n[e] = i, r = !0);
|
|
107
|
+
}
|
|
108
|
+
let i = S(e.window, t), a = i.x !== e.window.x || i.y !== e.window.y || i.w !== e.window.w || i.h !== e.window.h;
|
|
109
|
+
return !r && !a ? e : {
|
|
110
|
+
...e,
|
|
111
|
+
sizes: n,
|
|
112
|
+
window: i
|
|
113
|
+
};
|
|
114
|
+
}, w = (e) => (window.addEventListener("resize", e), () => window.removeEventListener("resize", e)), T = {
|
|
115
|
+
width: 0,
|
|
116
|
+
height: 0
|
|
117
|
+
}, E = () => {
|
|
118
|
+
let e = window.innerWidth, t = window.innerHeight;
|
|
119
|
+
return (T.width !== e || T.height !== t) && (T = {
|
|
120
|
+
width: e,
|
|
121
|
+
height: t
|
|
122
|
+
}), T;
|
|
123
|
+
}, D = {
|
|
124
|
+
width: 1440,
|
|
125
|
+
height: 900
|
|
126
|
+
}, O = () => D, k = () => o(w, E, O), A = (e = "bottom") => {
|
|
127
|
+
let [t, o] = a(() => v(e));
|
|
128
|
+
i(() => {
|
|
129
|
+
if (typeof window > "u") return;
|
|
130
|
+
let t = (t) => {
|
|
131
|
+
if (t.key === h && t.newValue !== null) try {
|
|
132
|
+
o(_(JSON.parse(t.newValue), e));
|
|
133
|
+
} catch {}
|
|
134
|
+
};
|
|
135
|
+
return window.addEventListener("storage", t), () => window.removeEventListener("storage", t);
|
|
136
|
+
}, [e]);
|
|
137
|
+
let s = r((e) => {
|
|
138
|
+
o((t) => {
|
|
139
|
+
let n = e(t);
|
|
140
|
+
return y(n), n;
|
|
141
|
+
});
|
|
142
|
+
}, []);
|
|
143
|
+
return [t, {
|
|
144
|
+
setDock: r((e) => s((t) => t.dock === e ? t : {
|
|
145
|
+
...t,
|
|
146
|
+
dock: e
|
|
147
|
+
}), [s]),
|
|
148
|
+
setEdgeSize: r((e, t) => s((n) => {
|
|
149
|
+
let r = x(e, t);
|
|
150
|
+
return n.sizes[e] === r ? n : {
|
|
151
|
+
...n,
|
|
152
|
+
sizes: {
|
|
153
|
+
...n.sizes,
|
|
154
|
+
[e]: r
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}), [s]),
|
|
158
|
+
setWindowRect: r((e) => s((t) => ({
|
|
159
|
+
...t,
|
|
160
|
+
window: S(e)
|
|
161
|
+
})), [s]),
|
|
162
|
+
setPush: r((e) => s((t) => t.push === e ? t : {
|
|
163
|
+
...t,
|
|
164
|
+
push: e
|
|
165
|
+
}), [s]),
|
|
166
|
+
setCapsule: r((e) => s((t) => n(t.capsule, e) ? t : {
|
|
167
|
+
...t,
|
|
168
|
+
capsule: e
|
|
169
|
+
}), [s])
|
|
170
|
+
}];
|
|
171
|
+
}, j = (e) => {
|
|
172
|
+
switch (e) {
|
|
173
|
+
case "ArrowDown": return "bottom";
|
|
174
|
+
case "ArrowUp": return "top";
|
|
175
|
+
case "ArrowLeft": return "left";
|
|
176
|
+
case "ArrowRight": return "right";
|
|
177
|
+
default: return null;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
export { s as ALL_DOCKS, m as DEFAULT_DOCK_STATE, c as EDGE_DOCKS, d as MIN_EDGE_SIZE, f as MIN_WINDOW, C as clampDockState, x as clampEdgeSize, S as clampWindow, _ as decodeDockState, j as dockForArrow, l as isDock, u as isEdgeDock, v as readStoredDock, A as useDockState, k as useViewport };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useSyncExternalStore as e } from "react";
|
|
2
|
+
//#region src/useDocumentVisible.ts
|
|
3
|
+
var t = (e) => typeof document > "u" ? () => {} : (document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e)), n = () => typeof document > "u" || !document.hidden, r = () => !0, i = () => e(t, n, r);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { i as useDocumentVisible };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
//#region src/useLiveCacheEntries.ts
|
|
3
|
+
var r = 500, i = (e) => {
|
|
4
|
+
let t = "";
|
|
5
|
+
for (let n of e) t += `${n.key}|${n.subscriberCount}|${n.snapshot.revision}|${n.snapshot.pendingPatches}|${n.snapshot.error === void 0 ? "0" : "1"}|${n.hasFiber ? "1" : "0"}|${n.evicting ? "1" : "0"};`;
|
|
6
|
+
return t;
|
|
7
|
+
}, a = (a) => {
|
|
8
|
+
let [o, s] = n(() => a ? a.peekAll() : []), c = t(i(o));
|
|
9
|
+
return e(() => {
|
|
10
|
+
if (!a) return;
|
|
11
|
+
let e = () => {
|
|
12
|
+
let e = a.peekAll(), t = i(e);
|
|
13
|
+
t !== c.current && (c.current = t, s(e));
|
|
14
|
+
}, t = setInterval(e, r);
|
|
15
|
+
return e(), () => clearInterval(t);
|
|
16
|
+
}, [a]), o;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { i as snapshotSignature, a as useLiveCacheEntries };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/devtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"description": "Local admin / devtools surface over a running app's /_voltro/inspect/* — routes, RPC, workflows, schedules, cache, logs, and traces.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"node": ">=24.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@voltro/client": "0.
|
|
38
|
-
"@voltro/logger": "0.
|
|
39
|
-
"@voltro/web": "0.
|
|
37
|
+
"@voltro/client": "0.87.0",
|
|
38
|
+
"@voltro/logger": "0.87.0",
|
|
39
|
+
"@voltro/web": "0.87.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": "^19.0.0",
|