@vobs/devtools-ui 1.2.1 → 1.3.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.cjs +613 -1948
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -1393
- package/dist/index.js.map +1 -1
- package/dist/panel.cjs +589 -1836
- package/dist/panel.cjs.map +1 -1
- package/dist/panel.js +12 -1279
- package/dist/panel.js.map +1 -1
- package/dist/widget.cjs +608 -1945
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.js +35 -1392
- package/dist/widget.js.map +1 -1
- package/package.json +6 -6
package/dist/panel.cjs
CHANGED
|
@@ -1,1285 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require('axios');
|
|
4
|
-
|
|
1
|
+
var __VOBS_CJS_FILE_URL = require("url").pathToFileURL(__filename).href;
|
|
2
|
+
"use strict";
|
|
5
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var signalNames = /* @__PURE__ */ new WeakMap();
|
|
11
|
-
function hasDebugHooks() {
|
|
12
|
-
return activeDebugHooks !== null;
|
|
13
|
-
}
|
|
14
|
-
__name(hasDebugHooks, "hasDebugHooks");
|
|
15
|
-
function setSignalDebugName(signal, name) {
|
|
16
|
-
signalNames.set(signal, name);
|
|
17
|
-
invokeDebug("signalNamed", signal, name);
|
|
18
|
-
}
|
|
19
|
-
__name(setSignalDebugName, "setSignalDebugName");
|
|
20
|
-
function invokeDebug(name, ...args) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
__name(invokeDebug, "invokeDebug");
|
|
24
|
-
|
|
25
|
-
// packages/reactivity/src/owner.ts
|
|
26
|
-
var currentOwner = null;
|
|
27
|
-
var nextOwnerId = 1;
|
|
28
|
-
var ownerNames = /* @__PURE__ */ new WeakMap();
|
|
29
|
-
function createOwner() {
|
|
30
|
-
const parent = currentOwner;
|
|
31
|
-
let disposed = parent?.disposed ?? false;
|
|
32
|
-
const children = [];
|
|
33
|
-
const cleanups = [];
|
|
34
|
-
const errorHandlers = /* @__PURE__ */ new Set();
|
|
35
|
-
const owner = {
|
|
36
|
-
id: `owner-${nextOwnerId++}`,
|
|
37
|
-
parent,
|
|
38
|
-
children,
|
|
39
|
-
depth: (parent?.depth ?? -1) + 1,
|
|
40
|
-
get disposed() {
|
|
41
|
-
return disposed;
|
|
42
|
-
},
|
|
43
|
-
run(fn) {
|
|
44
|
-
if (disposed) throw new Error("Vobs: \u5DF2\u9500\u6BC1\u7684 Owner \u4E0D\u80FD\u7EE7\u7EED\u8FD0\u884C");
|
|
45
|
-
const previous = currentOwner;
|
|
46
|
-
currentOwner = owner;
|
|
47
|
-
try {
|
|
48
|
-
return fn();
|
|
49
|
-
} finally {
|
|
50
|
-
currentOwner = previous;
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
addCleanup(cleanup) {
|
|
54
|
-
if (disposed) {
|
|
55
|
-
cleanup();
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
cleanups.push(cleanup);
|
|
59
|
-
},
|
|
60
|
-
onDispose(cleanup) {
|
|
61
|
-
owner.addCleanup(cleanup);
|
|
62
|
-
},
|
|
63
|
-
onError(handler) {
|
|
64
|
-
errorHandlers.add(handler);
|
|
65
|
-
const remove = /* @__PURE__ */ __name(() => errorHandlers.delete(handler), "remove");
|
|
66
|
-
owner.addCleanup(remove);
|
|
67
|
-
return remove;
|
|
68
|
-
},
|
|
69
|
-
handleError(error) {
|
|
70
|
-
for (const handler of [...errorHandlers].reverse()) {
|
|
71
|
-
try {
|
|
72
|
-
handler(error);
|
|
73
|
-
return true;
|
|
74
|
-
} catch (handlerError) {
|
|
75
|
-
return parent?.handleError(handlerError) ?? false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return parent?.handleError(error) ?? false;
|
|
79
|
-
},
|
|
80
|
-
dispose() {
|
|
81
|
-
if (disposed) return;
|
|
82
|
-
disposed = true;
|
|
83
|
-
for (const child of [...children]) child.dispose();
|
|
84
|
-
children.length = 0;
|
|
85
|
-
let firstError;
|
|
86
|
-
for (let index = cleanups.length - 1; index >= 0; index--) {
|
|
87
|
-
try {
|
|
88
|
-
cleanups[index]();
|
|
89
|
-
} catch (error) {
|
|
90
|
-
firstError ?? (firstError = error);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
cleanups.length = 0;
|
|
94
|
-
if (parent) {
|
|
95
|
-
const index = parent.children.indexOf(owner);
|
|
96
|
-
if (index >= 0) parent.children.splice(index, 1);
|
|
97
|
-
}
|
|
98
|
-
if (firstError) throw firstError;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
if (parent && !parent.disposed) parent.children.push(owner);
|
|
102
|
-
return owner;
|
|
103
|
-
}
|
|
104
|
-
__name(createOwner, "createOwner");
|
|
105
|
-
function setOwnerDebugName(owner, name) {
|
|
106
|
-
ownerNames.set(owner, name);
|
|
107
|
-
}
|
|
108
|
-
__name(setOwnerDebugName, "setOwnerDebugName");
|
|
109
|
-
function getCurrentOwner() {
|
|
110
|
-
return currentOwner;
|
|
111
|
-
}
|
|
112
|
-
__name(getCurrentOwner, "getCurrentOwner");
|
|
113
|
-
function onDispose(cleanup) {
|
|
114
|
-
const owner = getCurrentOwner();
|
|
115
|
-
if (!owner) throw new Error("Vobs: onDispose \u5FC5\u987B\u5728 Owner \u4F5C\u7528\u57DF\u5185\u8C03\u7528");
|
|
116
|
-
owner.onDispose(cleanup);
|
|
117
|
-
}
|
|
118
|
-
__name(onDispose, "onDispose");
|
|
119
|
-
|
|
120
|
-
// packages/reactivity/src/signal.ts
|
|
121
|
-
var currentSubscriber = null;
|
|
122
|
-
function getCurrentSubscriber() {
|
|
123
|
-
return currentSubscriber;
|
|
124
|
-
}
|
|
125
|
-
__name(getCurrentSubscriber, "getCurrentSubscriber");
|
|
126
|
-
function setCurrentSubscriber(subscriber) {
|
|
127
|
-
currentSubscriber = subscriber;
|
|
128
|
-
}
|
|
129
|
-
__name(setCurrentSubscriber, "setCurrentSubscriber");
|
|
130
|
-
function trackDependency(dependency) {
|
|
131
|
-
if (!currentSubscriber || currentSubscriber.disposed) return;
|
|
132
|
-
!currentSubscriber.dependencies.has(dependency);
|
|
133
|
-
currentSubscriber.dependencies.add(dependency);
|
|
134
|
-
}
|
|
135
|
-
__name(trackDependency, "trackDependency");
|
|
136
|
-
function state(initialValue, debugName) {
|
|
137
|
-
let value = initialValue;
|
|
138
|
-
let disposed = false;
|
|
139
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
140
|
-
const signalInstance = {
|
|
141
|
-
get value() {
|
|
142
|
-
const subscriber = getCurrentSubscriber();
|
|
143
|
-
if (subscriber && !subscriber.disposed) {
|
|
144
|
-
subscribers.add(subscriber);
|
|
145
|
-
trackDependency(signalInstance);
|
|
146
|
-
}
|
|
147
|
-
return value;
|
|
148
|
-
},
|
|
149
|
-
set value(nextValue) {
|
|
150
|
-
if (disposed || Object.is(value, nextValue)) return;
|
|
151
|
-
value = nextValue;
|
|
152
|
-
for (const subscriber of [...subscribers]) subscriber.notify();
|
|
153
|
-
},
|
|
154
|
-
unsubscribe(subscriber) {
|
|
155
|
-
subscribers.delete(subscriber);
|
|
156
|
-
},
|
|
157
|
-
// 与 `.value =` 赋值同一条路径:判等短路、debug hook、notify 全部一致。
|
|
158
|
-
// 以闭包实现,可安全地作为回调直接传递(无 this 绑定问题)。
|
|
159
|
-
set(next) {
|
|
160
|
-
signalInstance.value = next;
|
|
161
|
-
},
|
|
162
|
-
dispose() {
|
|
163
|
-
if (disposed) return;
|
|
164
|
-
disposed = true;
|
|
165
|
-
subscribers.clear();
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const owner = getCurrentOwner();
|
|
169
|
-
owner?.addCleanup(signalInstance.dispose);
|
|
170
|
-
if (debugName?.trim()) setSignalDebugName(signalInstance, debugName.trim());
|
|
171
|
-
return signalInstance;
|
|
172
|
-
}
|
|
173
|
-
__name(state, "state");
|
|
174
|
-
|
|
175
|
-
// packages/reactivity/src/scheduler.ts
|
|
176
|
-
var _Scheduler = class _Scheduler {
|
|
177
|
-
constructor() {
|
|
178
|
-
this.dirtyEffects = /* @__PURE__ */ new Set();
|
|
179
|
-
this.lowPriorityEffects = /* @__PURE__ */ new Set();
|
|
180
|
-
// flush 不可重入(flushing 标志保证),缓冲数组可在轮次间安全复用,避免每轮分配。
|
|
181
|
-
this.normalBuffer = [];
|
|
182
|
-
this.lowBuffer = [];
|
|
183
|
-
this.flushing = false;
|
|
184
|
-
this.scheduled = false;
|
|
185
|
-
this.batchDepth = 0;
|
|
186
|
-
}
|
|
187
|
-
schedule(effect2) {
|
|
188
|
-
if (effect2.disposed) return;
|
|
189
|
-
this.dirtyEffects.add(effect2);
|
|
190
|
-
this.lowPriorityEffects.delete(effect2);
|
|
191
|
-
this.ensureScheduled();
|
|
192
|
-
}
|
|
193
|
-
/** Queue an effect behind normal updates while preserving deterministic order. */
|
|
194
|
-
scheduleLow(effect2) {
|
|
195
|
-
if (effect2.disposed) return;
|
|
196
|
-
if (!this.dirtyEffects.has(effect2)) this.lowPriorityEffects.add(effect2);
|
|
197
|
-
this.ensureScheduled();
|
|
198
|
-
}
|
|
199
|
-
ensureScheduled() {
|
|
200
|
-
if (this.batchDepth === 0 && !this.flushing && !this.scheduled) {
|
|
201
|
-
this.scheduled = true;
|
|
202
|
-
queueMicrotask(() => {
|
|
203
|
-
this.scheduled = false;
|
|
204
|
-
this.flush();
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
remove(effect2) {
|
|
209
|
-
this.dirtyEffects.delete(effect2);
|
|
210
|
-
this.lowPriorityEffects.delete(effect2);
|
|
211
|
-
}
|
|
212
|
-
batch(fn) {
|
|
213
|
-
this.batchDepth++;
|
|
214
|
-
try {
|
|
215
|
-
return fn();
|
|
216
|
-
} finally {
|
|
217
|
-
this.batchDepth--;
|
|
218
|
-
if (this.batchDepth === 0) this.flush();
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
flush() {
|
|
222
|
-
if (this.flushing || this.batchDepth > 0) return;
|
|
223
|
-
this.flushing = true;
|
|
224
|
-
let rounds = 0;
|
|
225
|
-
let firstError;
|
|
226
|
-
let hasError = false;
|
|
227
|
-
try {
|
|
228
|
-
while (this.dirtyEffects.size > 0 || this.lowPriorityEffects.size > 0) {
|
|
229
|
-
if (++rounds > 100) {
|
|
230
|
-
this.dirtyEffects.clear();
|
|
231
|
-
this.lowPriorityEffects.clear();
|
|
232
|
-
throw new Error("Vobs: \u54CD\u5E94\u5F0F\u66F4\u65B0\u8D85\u8FC7 100 \u8F6E\uFF0C\u53EF\u80FD\u5B58\u5728\u5FAA\u73AF\u4F9D\u8D56");
|
|
233
|
-
}
|
|
234
|
-
this.collectRunnable(this.dirtyEffects, this.normalBuffer);
|
|
235
|
-
this.collectRunnable(this.lowPriorityEffects, this.lowBuffer);
|
|
236
|
-
sortEffects(this.normalBuffer);
|
|
237
|
-
sortEffects(this.lowBuffer);
|
|
238
|
-
for (const effect2 of this.normalBuffer) {
|
|
239
|
-
try {
|
|
240
|
-
effect2.run();
|
|
241
|
-
} catch (error) {
|
|
242
|
-
if (!hasError) {
|
|
243
|
-
firstError = error;
|
|
244
|
-
hasError = true;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
for (const effect2 of this.lowBuffer) {
|
|
249
|
-
try {
|
|
250
|
-
effect2.run();
|
|
251
|
-
} catch (error) {
|
|
252
|
-
if (!hasError) {
|
|
253
|
-
firstError = error;
|
|
254
|
-
hasError = true;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
this.normalBuffer.length = 0;
|
|
259
|
-
this.lowBuffer.length = 0;
|
|
260
|
-
}
|
|
261
|
-
} finally {
|
|
262
|
-
this.normalBuffer.length = 0;
|
|
263
|
-
this.lowBuffer.length = 0;
|
|
264
|
-
this.flushing = false;
|
|
265
|
-
}
|
|
266
|
-
if (hasError) throw firstError;
|
|
267
|
-
}
|
|
268
|
-
/** 收集未 disposed 的 effect 并清空源集合;run() 期间新调度的 effect 留给下一轮。 */
|
|
269
|
-
collectRunnable(source, target) {
|
|
270
|
-
for (const effect2 of source) {
|
|
271
|
-
if (!effect2.disposed) target.push(effect2);
|
|
272
|
-
}
|
|
273
|
-
source.clear();
|
|
274
|
-
}
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
275
11
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
__name(sortEffects, "sortEffects");
|
|
284
|
-
var scheduler = new Scheduler();
|
|
285
|
-
|
|
286
|
-
// packages/reactivity/src/effect.ts
|
|
287
|
-
var nextEffectOrder = 1;
|
|
288
|
-
function cleanupDependencies(subscriber) {
|
|
289
|
-
for (const dependency of subscriber.dependencies) {
|
|
290
|
-
dependency.unsubscribe(subscriber);
|
|
291
|
-
}
|
|
292
|
-
subscriber.dependencies.clear();
|
|
293
|
-
}
|
|
294
|
-
__name(cleanupDependencies, "cleanupDependencies");
|
|
295
|
-
function effect(callback) {
|
|
296
|
-
const owner = getCurrentOwner();
|
|
297
|
-
let cleanup;
|
|
298
|
-
let dirty = true;
|
|
299
|
-
let disposed = false;
|
|
300
|
-
const eff = {
|
|
301
|
-
order: nextEffectOrder++,
|
|
302
|
-
depth: owner?.depth ?? 0,
|
|
303
|
-
dependencies: /* @__PURE__ */ new Set(),
|
|
304
|
-
get disposed() {
|
|
305
|
-
return disposed;
|
|
306
|
-
},
|
|
307
|
-
notify() {
|
|
308
|
-
if (disposed || dirty) return;
|
|
309
|
-
dirty = true;
|
|
310
|
-
scheduler.schedule(eff);
|
|
311
|
-
},
|
|
312
|
-
run() {
|
|
313
|
-
if (disposed || !dirty) return;
|
|
314
|
-
dirty = false;
|
|
315
|
-
const previousCleanup = cleanup;
|
|
316
|
-
cleanup = void 0;
|
|
317
|
-
let cleanupError;
|
|
318
|
-
if (previousCleanup) {
|
|
319
|
-
try {
|
|
320
|
-
previousCleanup();
|
|
321
|
-
} catch (error) {
|
|
322
|
-
const handled2 = owner?.handleError(error) ?? false;
|
|
323
|
-
if (!handled2) cleanupError = error;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
cleanupDependencies(eff);
|
|
327
|
-
const previous = getCurrentSubscriber();
|
|
328
|
-
setCurrentSubscriber(eff);
|
|
329
|
-
let thrown;
|
|
330
|
-
let handled = false;
|
|
331
|
-
try {
|
|
332
|
-
const result = owner ? owner.run(callback) : callback();
|
|
333
|
-
cleanup = typeof result === "function" ? result : void 0;
|
|
334
|
-
} catch (error) {
|
|
335
|
-
thrown = error;
|
|
336
|
-
handled = owner?.handleError(error) ?? false;
|
|
337
|
-
if (!handled) throw error;
|
|
338
|
-
} finally {
|
|
339
|
-
setCurrentSubscriber(previous);
|
|
340
|
-
}
|
|
341
|
-
if (cleanupError && !thrown) throw cleanupError;
|
|
342
|
-
},
|
|
343
|
-
scheduleLow() {
|
|
344
|
-
if (disposed || dirty) return;
|
|
345
|
-
dirty = true;
|
|
346
|
-
scheduler.scheduleLow(eff);
|
|
347
|
-
},
|
|
348
|
-
dispose() {
|
|
349
|
-
if (disposed) return;
|
|
350
|
-
disposed = true;
|
|
351
|
-
dirty = false;
|
|
352
|
-
scheduler.remove(eff);
|
|
353
|
-
const previousCleanup = cleanup;
|
|
354
|
-
cleanup = void 0;
|
|
355
|
-
let cleanupError;
|
|
356
|
-
if (previousCleanup) {
|
|
357
|
-
try {
|
|
358
|
-
previousCleanup();
|
|
359
|
-
} catch (error) {
|
|
360
|
-
const handled = owner?.handleError(error) ?? false;
|
|
361
|
-
if (!handled) cleanupError = error;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
cleanupDependencies(eff);
|
|
365
|
-
if (cleanupError) throw cleanupError;
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
owner?.addCleanup(eff.dispose);
|
|
369
|
-
eff.run();
|
|
370
|
-
return eff;
|
|
371
|
-
}
|
|
372
|
-
__name(effect, "effect");
|
|
373
|
-
|
|
374
|
-
// packages/runtime/src/debug.ts
|
|
375
|
-
var activeRuntimeDebugHooks = null;
|
|
376
|
-
function getRuntimeDebugHooks() {
|
|
377
|
-
return activeRuntimeDebugHooks;
|
|
378
|
-
}
|
|
379
|
-
__name(getRuntimeDebugHooks, "getRuntimeDebugHooks");
|
|
380
|
-
function invokeRuntimeDebug(name, ...args) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
__name(invokeRuntimeDebug, "invokeRuntimeDebug");
|
|
384
|
-
function readDebugValue(read) {
|
|
385
|
-
try {
|
|
386
|
-
return read();
|
|
387
|
-
} catch {
|
|
388
|
-
return "[Uninspectable]";
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
__name(readDebugValue, "readDebugValue");
|
|
392
|
-
function describeDebugNode(node) {
|
|
393
|
-
if (!node || typeof node !== "object") return "node";
|
|
394
|
-
const value = node;
|
|
395
|
-
const name = typeof value.tagName === "string" ? value.tagName.toLowerCase() : typeof value.nodeName === "string" ? value.nodeName.toLowerCase() : "node";
|
|
396
|
-
const id = typeof value.id === "string" && value.id ? `#${value.id}` : "";
|
|
397
|
-
const className = typeof value.className === "string" && value.className ? `.${value.className.trim().split(/\s+/).filter(Boolean).join(".")}` : "";
|
|
398
|
-
return `${name}${id}${className}`;
|
|
399
|
-
}
|
|
400
|
-
__name(describeDebugNode, "describeDebugNode");
|
|
401
|
-
|
|
402
|
-
// packages/runtime/src/hmr.ts
|
|
403
|
-
var globalTarget = globalThis;
|
|
404
|
-
var hmrGlobal = globalTarget.__VOBS_HMR__ ?? { modules: /* @__PURE__ */ new Map() };
|
|
405
|
-
globalTarget.__VOBS_HMR__ = hmrGlobal;
|
|
406
|
-
function registerHmrInstance(moduleId, instance) {
|
|
407
|
-
const instances = getModule(moduleId).instances;
|
|
408
|
-
instances.add(instance);
|
|
409
|
-
return () => instances.delete(instance);
|
|
410
|
-
}
|
|
411
|
-
__name(registerHmrInstance, "registerHmrInstance");
|
|
412
|
-
function markHmrInstanceMounted(node, parent) {
|
|
413
|
-
const instance = hmrInstances.get(node);
|
|
414
|
-
if (instance) instance.parent = parent;
|
|
415
|
-
}
|
|
416
|
-
__name(markHmrInstanceMounted, "markHmrInstanceMounted");
|
|
417
|
-
function getModule(moduleId) {
|
|
418
|
-
let module = hmrGlobal.modules.get(moduleId);
|
|
419
|
-
if (!module) {
|
|
420
|
-
module = { components: /* @__PURE__ */ new Map(), state: /* @__PURE__ */ new Map(), instances: /* @__PURE__ */ new Set() };
|
|
421
|
-
hmrGlobal.modules.set(moduleId, module);
|
|
422
|
-
}
|
|
423
|
-
return module;
|
|
424
|
-
}
|
|
425
|
-
__name(getModule, "getModule");
|
|
426
|
-
var hmrInstances = /* @__PURE__ */ new WeakMap();
|
|
427
|
-
function associateHmrInstance(node, instance) {
|
|
428
|
-
hmrInstances.set(node, instance);
|
|
429
|
-
}
|
|
430
|
-
__name(associateHmrInstance, "associateHmrInstance");
|
|
431
|
-
var nodeOwners = /* @__PURE__ */ new WeakMap();
|
|
432
|
-
var eventBindings = /* @__PURE__ */ new WeakMap();
|
|
433
|
-
function getRenderer() {
|
|
434
|
-
{
|
|
435
|
-
throw new Error("\u6E32\u67D3\u5668\u672A\u521D\u59CB\u5316");
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
__name(getRenderer, "getRenderer");
|
|
439
|
-
function createText(content) {
|
|
440
|
-
return getRenderer().createText(content);
|
|
441
|
-
}
|
|
442
|
-
__name(createText, "createText");
|
|
443
|
-
function createElement(tag) {
|
|
444
|
-
return getRenderer().createElement(tag);
|
|
445
|
-
}
|
|
446
|
-
__name(createElement, "createElement");
|
|
447
|
-
function createComment(content) {
|
|
448
|
-
return getRenderer().createComment(content);
|
|
449
|
-
}
|
|
450
|
-
__name(createComment, "createComment");
|
|
451
|
-
function insertBefore(parent, child, anchor) {
|
|
452
|
-
if (isVobsFragment(child)) {
|
|
453
|
-
child.mount(parent, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
getRenderer().insertBefore(parent, child, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
457
|
-
markHmrInstanceMounted(child, parent);
|
|
458
|
-
}
|
|
459
|
-
__name(insertBefore, "insertBefore");
|
|
460
|
-
function removeChild(parent, child) {
|
|
461
|
-
disposeNodeOwner(child);
|
|
462
|
-
if (isVobsFragment(child)) {
|
|
463
|
-
child.unmount(parent);
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
getRenderer().removeChild(parent, child);
|
|
467
|
-
}
|
|
468
|
-
__name(removeChild, "removeChild");
|
|
469
|
-
function setTextContent(node, content) {
|
|
470
|
-
getRenderer().setTextContent(node, content);
|
|
471
|
-
}
|
|
472
|
-
__name(setTextContent, "setTextContent");
|
|
473
|
-
function setProperty(node, key, value) {
|
|
474
|
-
getRenderer().setProperty(node, key, value);
|
|
475
|
-
}
|
|
476
|
-
__name(setProperty, "setProperty");
|
|
477
|
-
function setAttribute(node, key, value) {
|
|
478
|
-
getRenderer().setAttribute(node, key, value);
|
|
479
|
-
}
|
|
480
|
-
__name(setAttribute, "setAttribute");
|
|
481
|
-
function addEventListener(node, event, handler) {
|
|
482
|
-
const renderer = getRenderer();
|
|
483
|
-
const owner = getCurrentOwner();
|
|
484
|
-
let bindings = eventBindings.get(node);
|
|
485
|
-
if (!bindings) {
|
|
486
|
-
bindings = /* @__PURE__ */ new Map();
|
|
487
|
-
eventBindings.set(node, bindings);
|
|
488
|
-
}
|
|
489
|
-
const previous = bindings.get(event);
|
|
490
|
-
if (previous && previous.original === handler && previous.owner === owner) return;
|
|
491
|
-
if (previous) renderer.removeEventListener(node, event, previous.handler);
|
|
492
|
-
const listener = owner ? (reason) => {
|
|
493
|
-
try {
|
|
494
|
-
owner.run(() => handler(reason));
|
|
495
|
-
} catch (error) {
|
|
496
|
-
const handled = owner.handleError(error);
|
|
497
|
-
invokeRuntimeDebug("error", {
|
|
498
|
-
error,
|
|
499
|
-
owner,
|
|
500
|
-
phase: "event",
|
|
501
|
-
handled,
|
|
502
|
-
recovery: handled ? "handled" : "propagated"
|
|
503
|
-
});
|
|
504
|
-
if (!handled) throw error;
|
|
505
|
-
}
|
|
506
|
-
} : handler;
|
|
507
|
-
const binding = { handler: listener, owner, original: handler };
|
|
508
|
-
bindings.set(event, binding);
|
|
509
|
-
renderer.addEventListener(node, event, listener);
|
|
510
|
-
owner?.onDispose(() => {
|
|
511
|
-
if (bindings?.get(event) !== binding) return;
|
|
512
|
-
bindings.delete(event);
|
|
513
|
-
renderer.removeEventListener(node, event, listener);
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
__name(addEventListener, "addEventListener");
|
|
517
|
-
function createComponent(component, props, source) {
|
|
518
|
-
const owner = createOwner();
|
|
519
|
-
const componentName = component.displayName || component.name || "anonymous";
|
|
520
|
-
setOwnerDebugName(owner, source ? `${componentName} (${source.file}:${source.line}:${source.column})` : componentName);
|
|
521
|
-
owner.onError((reason) => {
|
|
522
|
-
attachSourceLocation(reason, source);
|
|
523
|
-
attachComponentContext(reason, componentName, owner.id);
|
|
524
|
-
throw reason;
|
|
525
|
-
});
|
|
526
|
-
let node;
|
|
527
|
-
try {
|
|
528
|
-
node = owner.run(() => component(props));
|
|
529
|
-
} catch (error) {
|
|
530
|
-
owner.dispose();
|
|
531
|
-
attachSourceLocation(error, source);
|
|
532
|
-
attachComponentContext(error, componentName, owner.id);
|
|
533
|
-
throw error;
|
|
534
|
-
}
|
|
535
|
-
associateNodeOwner(node, owner);
|
|
536
|
-
const hmrKey = component.hmrKey;
|
|
537
|
-
if (hmrKey) {
|
|
538
|
-
const instance = {
|
|
539
|
-
node,
|
|
540
|
-
parent: null,
|
|
541
|
-
refresh() {
|
|
542
|
-
const previous = instance.node;
|
|
543
|
-
const next = owner.run(() => component(props));
|
|
544
|
-
if (instance.parent && !isVobsFragment(previous) && !isVobsFragment(next)) {
|
|
545
|
-
getRenderer().insertBefore(instance.parent, next, previous);
|
|
546
|
-
getRenderer().removeChild(instance.parent, previous);
|
|
547
|
-
}
|
|
548
|
-
nodeOwners.delete(previous);
|
|
549
|
-
nodeOwners.set(next, owner);
|
|
550
|
-
associateHmrInstance(next, instance);
|
|
551
|
-
instance.node = next;
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
associateHmrInstance(node, instance);
|
|
555
|
-
const separator = hmrKey.lastIndexOf(":");
|
|
556
|
-
const moduleId = separator < 0 ? hmrKey : hmrKey.slice(0, separator);
|
|
557
|
-
const cleanup = registerHmrInstance(moduleId, instance);
|
|
558
|
-
owner.onDispose(cleanup);
|
|
559
|
-
}
|
|
560
|
-
return node;
|
|
561
|
-
}
|
|
562
|
-
__name(createComponent, "createComponent");
|
|
563
|
-
function attachSourceLocation(reason, source) {
|
|
564
|
-
if (!source || (!reason || typeof reason !== "object" && typeof reason !== "function")) return;
|
|
565
|
-
const error = reason;
|
|
566
|
-
if (error.vobsSource) return;
|
|
567
|
-
try {
|
|
568
|
-
Object.defineProperty(error, "vobsSource", {
|
|
569
|
-
configurable: true,
|
|
570
|
-
enumerable: false,
|
|
571
|
-
value: source,
|
|
572
|
-
writable: false
|
|
573
|
-
});
|
|
574
|
-
} catch {
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
__name(attachSourceLocation, "attachSourceLocation");
|
|
578
|
-
function attachComponentContext(reason, component, ownerId) {
|
|
579
|
-
if (!reason || typeof reason !== "object" && typeof reason !== "function") return;
|
|
580
|
-
const error = reason;
|
|
581
|
-
try {
|
|
582
|
-
if (!error.vobsComponent) Object.defineProperty(error, "vobsComponent", { configurable: true, enumerable: false, value: component, writable: false });
|
|
583
|
-
if (!error.vobsOwnerId) Object.defineProperty(error, "vobsOwnerId", { configurable: true, enumerable: false, value: ownerId, writable: false });
|
|
584
|
-
} catch {
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
__name(attachComponentContext, "attachComponentContext");
|
|
588
|
-
function createBlock(factory) {
|
|
589
|
-
const owner = createOwner();
|
|
590
|
-
setOwnerDebugName(owner, "dynamic");
|
|
591
|
-
let node;
|
|
592
|
-
try {
|
|
593
|
-
node = owner.run(factory);
|
|
594
|
-
} catch (error) {
|
|
595
|
-
owner.dispose();
|
|
596
|
-
throw error;
|
|
597
|
-
}
|
|
598
|
-
if (!node) {
|
|
599
|
-
owner.dispose();
|
|
600
|
-
return null;
|
|
601
|
-
}
|
|
602
|
-
associateNodeOwner(node, owner);
|
|
603
|
-
return node;
|
|
604
|
-
}
|
|
605
|
-
__name(createBlock, "createBlock");
|
|
606
|
-
function associateNodeOwner(node, owner) {
|
|
607
|
-
nodeOwners.set(node, owner);
|
|
608
|
-
}
|
|
609
|
-
__name(associateNodeOwner, "associateNodeOwner");
|
|
610
|
-
function disposeNodeOwner(node) {
|
|
611
|
-
const owner = nodeOwners.get(node);
|
|
612
|
-
if (!owner) return;
|
|
613
|
-
nodeOwners.delete(node);
|
|
614
|
-
owner.dispose();
|
|
615
|
-
}
|
|
616
|
-
__name(disposeNodeOwner, "disposeNodeOwner");
|
|
617
|
-
|
|
618
|
-
// packages/runtime/src/fragment.ts
|
|
619
|
-
function createFragment(factory) {
|
|
620
|
-
const start = createComment("vobs:fragment:start");
|
|
621
|
-
const end = createComment("vobs:fragment:end");
|
|
622
|
-
let parent = null;
|
|
623
|
-
let initialized = false;
|
|
624
|
-
const owner = getCurrentOwner();
|
|
625
|
-
const fragment = {
|
|
626
|
-
kind: "vobs-fragment",
|
|
627
|
-
start,
|
|
628
|
-
end,
|
|
629
|
-
mount(nextParent, anchor) {
|
|
630
|
-
if (parent && parent !== nextParent) {
|
|
631
|
-
throw new Error("Vobs Fragment: \u4E0D\u80FD\u8DE8\u7236\u8282\u70B9\u79FB\u52A8 Fragment");
|
|
632
|
-
}
|
|
633
|
-
if (initialized) {
|
|
634
|
-
moveRange(nextParent, start, end, anchor);
|
|
635
|
-
return;
|
|
636
|
-
}
|
|
637
|
-
const renderer = getRenderer();
|
|
638
|
-
renderer.insertBefore(nextParent, start, anchor);
|
|
639
|
-
renderer.insertBefore(nextParent, end, anchor);
|
|
640
|
-
parent = nextParent;
|
|
641
|
-
initialized = true;
|
|
642
|
-
if (owner) owner.run(() => factory(nextParent, end));
|
|
643
|
-
else factory(nextParent, end);
|
|
644
|
-
},
|
|
645
|
-
unmount(nextParent) {
|
|
646
|
-
if (!initialized || parent !== nextParent) {
|
|
647
|
-
throw new Error("Vobs Fragment: Fragment \u4E0D\u5C5E\u4E8E\u6307\u5B9A\u7236\u8282\u70B9");
|
|
648
|
-
}
|
|
649
|
-
const renderer = getRenderer();
|
|
650
|
-
let current = renderer.nextSibling(start);
|
|
651
|
-
while (current && current !== end) {
|
|
652
|
-
const next = renderer.nextSibling(current);
|
|
653
|
-
renderer.removeChild(nextParent, current);
|
|
654
|
-
current = next;
|
|
655
|
-
}
|
|
656
|
-
renderer.removeChild(nextParent, start);
|
|
657
|
-
renderer.removeChild(nextParent, end);
|
|
658
|
-
parent = null;
|
|
659
|
-
initialized = false;
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
return fragment;
|
|
663
|
-
}
|
|
664
|
-
__name(createFragment, "createFragment");
|
|
665
|
-
function isVobsFragment(value) {
|
|
666
|
-
return Boolean(value) && typeof value === "object" && value.kind === "vobs-fragment";
|
|
667
|
-
}
|
|
668
|
-
__name(isVobsFragment, "isVobsFragment");
|
|
669
|
-
function moveRange(parent, start, end, anchor) {
|
|
670
|
-
const renderer = getRenderer();
|
|
671
|
-
const nodes = [start];
|
|
672
|
-
let current = renderer.nextSibling(start);
|
|
673
|
-
while (current) {
|
|
674
|
-
nodes.push(current);
|
|
675
|
-
if (current === end) break;
|
|
676
|
-
current = renderer.nextSibling(current);
|
|
677
|
-
}
|
|
678
|
-
if (nodes[nodes.length - 1] !== end) {
|
|
679
|
-
throw new Error("Vobs Fragment: \u627E\u4E0D\u5230\u7ED3\u675F\u951A\u70B9");
|
|
680
|
-
}
|
|
681
|
-
for (const node of nodes) renderer.insertBefore(parent, node, anchor);
|
|
682
|
-
}
|
|
683
|
-
__name(moveRange, "moveRange");
|
|
684
|
-
|
|
685
|
-
// packages/runtime/src/dynamic.ts
|
|
686
|
-
function insertDynamic(parent, anchor, factory) {
|
|
687
|
-
const marker = createComment("vobs:dynamic");
|
|
688
|
-
insertBefore(parent, marker, anchor);
|
|
689
|
-
let current = null;
|
|
690
|
-
effect(() => {
|
|
691
|
-
const next = createBlock(factory);
|
|
692
|
-
if (next === current) return;
|
|
693
|
-
if (current) removeChild(parent, current);
|
|
694
|
-
current = next;
|
|
695
|
-
if (current) insertBefore(parent, current, marker);
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
__name(insertDynamic, "insertDynamic");
|
|
699
|
-
|
|
700
|
-
// packages/vobs/src/context.ts
|
|
701
|
-
var ownerProviders = /* @__PURE__ */ new WeakMap();
|
|
702
|
-
function inject(key, fallback) {
|
|
703
|
-
const owner = getCurrentOwner();
|
|
704
|
-
const value = owner ? injectFromOwner(owner, key) : void 0;
|
|
705
|
-
return value === void 0 ? fallback : value;
|
|
706
|
-
}
|
|
707
|
-
__name(inject, "inject");
|
|
708
|
-
function injectFromOwner(owner, key) {
|
|
709
|
-
let current = owner;
|
|
710
|
-
while (current) {
|
|
711
|
-
const providers = ownerProviders.get(current);
|
|
712
|
-
if (providers?.has(key)) return providers.get(key);
|
|
713
|
-
current = current.parent;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
714
17
|
}
|
|
715
|
-
return
|
|
716
|
-
}
|
|
717
|
-
__name(injectFromOwner, "injectFromOwner");
|
|
718
|
-
|
|
719
|
-
// packages/vobs/src/app.ts
|
|
720
|
-
function createInjectionKey(description) {
|
|
721
|
-
return Symbol(description);
|
|
722
|
-
}
|
|
723
|
-
__name(createInjectionKey, "createInjectionKey");
|
|
724
|
-
var HTTP_KEY = createInjectionKey("vobs.http");
|
|
725
|
-
var activeDevTools = null;
|
|
726
|
-
function getDevTools() {
|
|
727
|
-
return activeDevTools;
|
|
728
|
-
}
|
|
729
|
-
__name(getDevTools, "getDevTools");
|
|
730
|
-
|
|
731
|
-
// packages/ui/src/utils.ts
|
|
732
|
-
function classNames(...values) {
|
|
733
|
-
return values.flatMap((value) => typeof value === "string" ? value.trim().split(/\s+/u) : []).filter(Boolean).join(" ");
|
|
734
|
-
}
|
|
735
|
-
__name(classNames, "classNames");
|
|
736
|
-
function readProp(props, name, fallback) {
|
|
737
|
-
const value = Reflect.get(props, name);
|
|
738
|
-
return value === void 0 ? fallback : value;
|
|
739
|
-
}
|
|
740
|
-
__name(readProp, "readProp");
|
|
741
|
-
function hasProp(props, name) {
|
|
742
|
-
return name in props;
|
|
743
|
-
}
|
|
744
|
-
__name(hasProp, "hasProp");
|
|
745
|
-
function bindClassList(root, props, readBaseClasses) {
|
|
746
|
-
effect(() => {
|
|
747
|
-
setAttribute(root, "class", classNames(
|
|
748
|
-
...readBaseClasses(),
|
|
749
|
-
readString(props, "class"),
|
|
750
|
-
readString(props, "className")
|
|
751
|
-
));
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
__name(bindClassList, "bindClassList");
|
|
755
|
-
function bindCommonAttributes(root, props, skip = [], options = {}) {
|
|
756
|
-
const ignored = new Set(skip);
|
|
757
|
-
ignored.add("class");
|
|
758
|
-
ignored.add("className");
|
|
759
|
-
ignored.add("children");
|
|
760
|
-
ignored.add("style");
|
|
761
|
-
effect(() => {
|
|
762
|
-
const next = /* @__PURE__ */ new Map();
|
|
763
|
-
for (const name of Object.keys(props)) {
|
|
764
|
-
if (ignored.has(name) || name.startsWith("on")) continue;
|
|
765
|
-
if (!isCommonAttribute(name)) continue;
|
|
766
|
-
if (options.includeDataAria === false && (name.startsWith("aria-") || name.startsWith("data-"))) continue;
|
|
767
|
-
const value = Reflect.get(props, name);
|
|
768
|
-
const normalized = normalizeAttribute(name, value);
|
|
769
|
-
if (normalized !== void 0) next.set(normalized.name, normalized.value);
|
|
770
|
-
}
|
|
771
|
-
const managed = getManagedAttributes(root);
|
|
772
|
-
for (const name of managed) {
|
|
773
|
-
if (!next.has(name)) removeAttribute(root, name);
|
|
774
|
-
}
|
|
775
|
-
for (const [name, value] of next) setAttribute(root, name, value);
|
|
776
|
-
setManagedAttributes(root, next.keys());
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
__name(bindCommonAttributes, "bindCommonAttributes");
|
|
780
|
-
function bindUserStyle(root, props) {
|
|
781
|
-
bindStyle(root, props, () => "");
|
|
782
|
-
}
|
|
783
|
-
__name(bindUserStyle, "bindUserStyle");
|
|
784
|
-
function bindStyle(root, props, createStyle) {
|
|
785
|
-
effect(() => {
|
|
786
|
-
const userStyle = readString(props, "style");
|
|
787
|
-
const internalStyle = createStyle();
|
|
788
|
-
const style = [internalStyle, userStyle].filter(Boolean).join("; ");
|
|
789
|
-
if (style) setAttribute(root, "style", style);
|
|
790
|
-
else removeAttribute(root, "style");
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
__name(bindStyle, "bindStyle");
|
|
794
|
-
function bindTextContent(node, read) {
|
|
795
|
-
effect(() => {
|
|
796
|
-
setTextContent(node, String(read() ?? ""));
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
__name(bindTextContent, "bindTextContent");
|
|
800
|
-
function bindPropertyValue(node, name, read) {
|
|
801
|
-
effect(() => setProperty(node, name, read()));
|
|
802
|
-
}
|
|
803
|
-
__name(bindPropertyValue, "bindPropertyValue");
|
|
804
|
-
function listen(root, event, props, propName, disabled) {
|
|
805
|
-
addEventListener(root, event, (reason) => {
|
|
806
|
-
if (disabled?.()) return;
|
|
807
|
-
const handler = Reflect.get(props, propName);
|
|
808
|
-
if (typeof handler === "function") handler(reason);
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
__name(listen, "listen");
|
|
812
|
-
function mountSlot(parent, props, propName) {
|
|
813
|
-
insertDynamic(parent, null, () => resolveSlot(Reflect.get(props, propName)));
|
|
814
|
-
}
|
|
815
|
-
__name(mountSlot, "mountSlot");
|
|
816
|
-
function resolveSlot(value) {
|
|
817
|
-
const resolved = typeof value === "function" ? value() : value;
|
|
818
|
-
if (resolved === void 0 || resolved === null || resolved === false) return null;
|
|
819
|
-
if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
|
|
820
|
-
if (Array.isArray(resolved)) {
|
|
821
|
-
const children = resolved;
|
|
822
|
-
return createFragment((parent, anchor) => {
|
|
823
|
-
for (const child of children) {
|
|
824
|
-
const node = resolveSlot(child);
|
|
825
|
-
if (node) insertBefore(parent, node, anchor);
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
return resolved;
|
|
830
|
-
}
|
|
831
|
-
__name(resolveSlot, "resolveSlot");
|
|
832
|
-
function setOptionalAttribute(node, name, value) {
|
|
833
|
-
if (value === void 0 || value === null || value === false || value === "") {
|
|
834
|
-
removeAttribute(node, name);
|
|
835
|
-
return;
|
|
836
|
-
}
|
|
837
|
-
setAttribute(node, name, String(value));
|
|
838
|
-
}
|
|
839
|
-
__name(setOptionalAttribute, "setOptionalAttribute");
|
|
840
|
-
function setOptionalProperty(node, name, value) {
|
|
841
|
-
if (value === void 0 || value === null) return;
|
|
842
|
-
setProperty(node, name, value);
|
|
843
|
-
}
|
|
844
|
-
__name(setOptionalProperty, "setOptionalProperty");
|
|
845
|
-
function readString(props, name) {
|
|
846
|
-
const value = Reflect.get(props, name);
|
|
847
|
-
return typeof value === "string" ? value : void 0;
|
|
848
|
-
}
|
|
849
|
-
__name(readString, "readString");
|
|
850
|
-
function isCommonAttribute(name) {
|
|
851
|
-
return name === "id" || name === "title" || name === "role" || name === "tabIndex" || name.startsWith("aria-") || name.startsWith("data-");
|
|
852
|
-
}
|
|
853
|
-
__name(isCommonAttribute, "isCommonAttribute");
|
|
854
|
-
function normalizeAttribute(name, value) {
|
|
855
|
-
if (value === void 0 || value === null) return void 0;
|
|
856
|
-
if (value === false && !name.startsWith("aria-") && !name.startsWith("data-")) return void 0;
|
|
857
|
-
return { name: name === "tabIndex" ? "tabindex" : name, value: String(value) };
|
|
858
|
-
}
|
|
859
|
-
__name(normalizeAttribute, "normalizeAttribute");
|
|
860
|
-
var managedAttributes = /* @__PURE__ */ new WeakMap();
|
|
861
|
-
function getManagedAttributes(node) {
|
|
862
|
-
return managedAttributes.get(node) ?? /* @__PURE__ */ new Set();
|
|
863
|
-
}
|
|
864
|
-
__name(getManagedAttributes, "getManagedAttributes");
|
|
865
|
-
function setManagedAttributes(node, names) {
|
|
866
|
-
managedAttributes.set(node, new Set(names));
|
|
867
|
-
}
|
|
868
|
-
__name(setManagedAttributes, "setManagedAttributes");
|
|
869
|
-
function removeAttribute(node, name) {
|
|
870
|
-
const candidate = node;
|
|
871
|
-
candidate.removeAttribute?.(name);
|
|
872
|
-
}
|
|
873
|
-
__name(removeAttribute, "removeAttribute");
|
|
874
|
-
|
|
875
|
-
// packages/ui/src/button.ts
|
|
876
|
-
function Button(props = {}) {
|
|
877
|
-
const root = createElement("button");
|
|
878
|
-
bindClassList(root, props, () => [
|
|
879
|
-
"vui-btn",
|
|
880
|
-
`vui-btn--${readProp(props, "variant", "primary")}`,
|
|
881
|
-
`vui-btn--${readProp(props, "size", "md")}`,
|
|
882
|
-
readProp(props, "iconOnly", false) ? "vui-btn--icon" : void 0
|
|
883
|
-
]);
|
|
884
|
-
bindCommonAttributes(root, props, [
|
|
885
|
-
"variant",
|
|
886
|
-
"size",
|
|
887
|
-
"type",
|
|
888
|
-
"disabled",
|
|
889
|
-
"loading",
|
|
890
|
-
"iconOnly",
|
|
891
|
-
"icon",
|
|
892
|
-
"onClick"
|
|
893
|
-
]);
|
|
894
|
-
effect(() => {
|
|
895
|
-
const disabled = readProp(props, "disabled", false) || readProp(props, "loading", false);
|
|
896
|
-
setOptionalProperty(root, "disabled", disabled);
|
|
897
|
-
setOptionalAttribute(root, "type", readProp(props, "type", "button"));
|
|
898
|
-
setOptionalAttribute(root, "aria-disabled", disabled ? "true" : void 0);
|
|
899
|
-
setOptionalAttribute(root, "aria-busy", readProp(props, "loading", false) ? "true" : void 0);
|
|
900
|
-
});
|
|
901
|
-
listen(root, "click", props, "onClick", () => readProp(props, "disabled", false) || readProp(props, "loading", false));
|
|
902
|
-
if (hasProp(props, "icon")) mountSlot(root, props, "icon");
|
|
903
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
904
|
-
return root;
|
|
905
|
-
}
|
|
906
|
-
__name(Button, "Button");
|
|
907
|
-
|
|
908
|
-
// packages/ui/src/forms.ts
|
|
909
|
-
function bindSignalProp(props) {
|
|
910
|
-
const value = readProp(props, "bind", void 0);
|
|
911
|
-
return value && typeof value === "object" && "value" in value ? value : void 0;
|
|
912
|
-
}
|
|
913
|
-
__name(bindSignalProp, "bindSignalProp");
|
|
914
|
-
function Select(props = {}) {
|
|
915
|
-
const root = createElement("select");
|
|
916
|
-
bindClassList(root, props, () => ["vui-select"]);
|
|
917
|
-
bindCommonAttributes(root, props, [
|
|
918
|
-
"name",
|
|
919
|
-
"value",
|
|
920
|
-
"disabled",
|
|
921
|
-
"required",
|
|
922
|
-
"multiple",
|
|
923
|
-
"size",
|
|
924
|
-
"onChange"
|
|
925
|
-
]);
|
|
926
|
-
effect(() => {
|
|
927
|
-
setOptionalAttribute(root, "name", readProp(props, "name", void 0));
|
|
928
|
-
setOptionalProperty(root, "disabled", readProp(props, "disabled", false));
|
|
929
|
-
setOptionalProperty(root, "required", readProp(props, "required", false));
|
|
930
|
-
setOptionalProperty(root, "multiple", readProp(props, "multiple", false));
|
|
931
|
-
setOptionalAttribute(root, "size", readProp(props, "size", void 0));
|
|
932
|
-
});
|
|
933
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
934
|
-
const bind = bindSignalProp(props);
|
|
935
|
-
if (bind) {
|
|
936
|
-
bindPropertyValue(root, "value", () => String(bind.value ?? ""));
|
|
937
|
-
listen(root, "change", { onChange: /* @__PURE__ */ __name((event) => {
|
|
938
|
-
bind.value = event.target.value;
|
|
939
|
-
}, "onChange") }, "onChange", () => readProp(props, "disabled", false));
|
|
940
|
-
} else if (hasProp(props, "value")) {
|
|
941
|
-
bindPropertyValue(root, "value", () => readProp(props, "value", void 0) ?? "");
|
|
942
|
-
}
|
|
943
|
-
listen(root, "change", props, "onChange", () => readProp(props, "disabled", false));
|
|
944
|
-
return root;
|
|
945
|
-
}
|
|
946
|
-
__name(Select, "Select");
|
|
947
|
-
|
|
948
|
-
// packages/ui/src/card.ts
|
|
949
|
-
function Card(props = {}) {
|
|
950
|
-
const root = createElement("div");
|
|
951
|
-
bindClassList(root, props, () => ["vui-card"]);
|
|
952
|
-
bindCommonAttributes(root, props, ["title", "description"]);
|
|
953
|
-
bindUserStyle(root, props);
|
|
954
|
-
if (hasProp(props, "title")) {
|
|
955
|
-
const title = createElement("div");
|
|
956
|
-
const text = createText("");
|
|
957
|
-
setAttribute(title, "class", "vui-card__title");
|
|
958
|
-
bindTextContent(text, () => readProp(props, "title", ""));
|
|
959
|
-
insertBefore(title, text, null);
|
|
960
|
-
insertBefore(root, title, null);
|
|
961
|
-
}
|
|
962
|
-
if (hasProp(props, "description")) {
|
|
963
|
-
const description = createElement("p");
|
|
964
|
-
const text = createText("");
|
|
965
|
-
setAttribute(description, "class", "vui-card__desc");
|
|
966
|
-
bindTextContent(text, () => readProp(props, "description", ""));
|
|
967
|
-
insertBefore(description, text, null);
|
|
968
|
-
insertBefore(root, description, null);
|
|
969
|
-
}
|
|
970
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
971
|
-
return root;
|
|
972
|
-
}
|
|
973
|
-
__name(Card, "Card");
|
|
974
|
-
|
|
975
|
-
// packages/ui/src/tag.ts
|
|
976
|
-
function Tag(props = {}) {
|
|
977
|
-
const root = createElement("span");
|
|
978
|
-
bindClassList(root, props, () => [
|
|
979
|
-
"vui-tag",
|
|
980
|
-
readProp(props, "tone", "default") === "default" ? void 0 : `vui-tag--${readProp(props, "tone", "default")}`
|
|
981
|
-
]);
|
|
982
|
-
bindCommonAttributes(root, props, ["tone"]);
|
|
983
|
-
bindUserStyle(root, props);
|
|
984
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
985
|
-
return root;
|
|
986
|
-
}
|
|
987
|
-
__name(Tag, "Tag");
|
|
988
|
-
|
|
989
|
-
// packages/ui/src/alert.ts
|
|
990
|
-
function Alert(props = {}) {
|
|
991
|
-
const root = createElement("div");
|
|
992
|
-
bindClassList(root, props, () => [
|
|
993
|
-
"vui-alert",
|
|
994
|
-
`vui-alert--${readProp(props, "tone", "info")}`
|
|
995
|
-
]);
|
|
996
|
-
bindCommonAttributes(root, props, ["tone", "title", "description", "icon", "role"]);
|
|
997
|
-
bindUserStyle(root, props);
|
|
998
|
-
setAttribute(root, "role", "alert");
|
|
999
|
-
if (hasProp(props, "icon")) {
|
|
1000
|
-
const icon = createElement("span");
|
|
1001
|
-
setAttribute(icon, "class", "vui-alert__icon");
|
|
1002
|
-
mountSlot(icon, props, "icon");
|
|
1003
|
-
insertBefore(root, icon, null);
|
|
1004
|
-
}
|
|
1005
|
-
const content = createElement("div");
|
|
1006
|
-
if (hasProp(props, "title")) {
|
|
1007
|
-
const title = createElement("div");
|
|
1008
|
-
const text = createText("");
|
|
1009
|
-
setAttribute(title, "class", "vui-alert__title");
|
|
1010
|
-
bindTextContent(text, () => readProp(props, "title", ""));
|
|
1011
|
-
insertBefore(title, text, null);
|
|
1012
|
-
insertBefore(content, title, null);
|
|
1013
|
-
}
|
|
1014
|
-
if (hasProp(props, "description")) {
|
|
1015
|
-
const description = createElement("div");
|
|
1016
|
-
const text = createText("");
|
|
1017
|
-
setAttribute(description, "class", "vui-alert__desc");
|
|
1018
|
-
bindTextContent(text, () => readProp(props, "description", ""));
|
|
1019
|
-
insertBefore(description, text, null);
|
|
1020
|
-
insertBefore(content, description, null);
|
|
1021
|
-
}
|
|
1022
|
-
if (hasProp(props, "children")) mountSlot(content, props, "children");
|
|
1023
|
-
insertBefore(root, content, null);
|
|
1024
|
-
return root;
|
|
1025
|
-
}
|
|
1026
|
-
__name(Alert, "Alert");
|
|
1027
|
-
|
|
1028
|
-
// packages/ui/src/tabs.ts
|
|
1029
|
-
function Tabs(props) {
|
|
1030
|
-
const root = createElement("div");
|
|
1031
|
-
const tablist = createElement("div");
|
|
1032
|
-
const panel = createElement("div");
|
|
1033
|
-
const internalValue = state(void 0);
|
|
1034
|
-
bindClassList(root, props, () => ["vui-tabs-root"]);
|
|
1035
|
-
bindCommonAttributes(root, props, ["items", "value", "variant", "onChange"]);
|
|
1036
|
-
setAttribute(tablist, "role", "tablist");
|
|
1037
|
-
effect(() => {
|
|
1038
|
-
const variant = readProp(props, "variant", "default");
|
|
1039
|
-
setAttribute(tablist, "class", `vui-tabs${variant === "filled" ? " vui-tabs--filled" : ""}`);
|
|
1040
|
-
});
|
|
1041
|
-
setAttribute(panel, "class", "vui-tabs__panel");
|
|
1042
|
-
insertDynamic(tablist, null, () => createTabButtons(props, internalValue));
|
|
1043
|
-
insertDynamic(panel, null, () => {
|
|
1044
|
-
const item = activeItem(readProp(props, "items", []), activeId(props, internalValue));
|
|
1045
|
-
return item?.content === void 0 ? null : resolveSlot(item.content);
|
|
1046
|
-
});
|
|
1047
|
-
insertBefore(root, tablist, null);
|
|
1048
|
-
insertBefore(root, panel, null);
|
|
1049
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
1050
|
-
return root;
|
|
1051
|
-
}
|
|
1052
|
-
__name(Tabs, "Tabs");
|
|
1053
|
-
function createTabButtons(props, internalValue) {
|
|
1054
|
-
const items = readProp(props, "items", []);
|
|
1055
|
-
const selected = activeId(props, internalValue);
|
|
1056
|
-
return createFragment((parent, anchor) => {
|
|
1057
|
-
for (const item of items) {
|
|
1058
|
-
const button = createElement("button");
|
|
1059
|
-
const isActive = item.id === selected;
|
|
1060
|
-
setAttribute(button, "class", `vui-tab${isActive ? " is-active" : ""}`);
|
|
1061
|
-
setAttribute(button, "role", "tab");
|
|
1062
|
-
setAttribute(button, "type", "button");
|
|
1063
|
-
setAttribute(button, "aria-selected", isActive ? "true" : "false");
|
|
1064
|
-
setAttribute(button, "data-tab-id", item.id);
|
|
1065
|
-
if (item.disabled === true) {
|
|
1066
|
-
setAttribute(button, "aria-disabled", "true");
|
|
1067
|
-
setProperty(button, "disabled", true);
|
|
1068
|
-
}
|
|
1069
|
-
insertBefore(button, createText(item.label), null);
|
|
1070
|
-
addEventListener(button, "click", () => {
|
|
1071
|
-
if (item.disabled === true) return;
|
|
1072
|
-
if (readProp(props, "value", void 0) === void 0) internalValue.value = item.id;
|
|
1073
|
-
const onChange = readProp(props, "onChange", void 0);
|
|
1074
|
-
if (typeof onChange === "function") onChange(item.id);
|
|
1075
|
-
});
|
|
1076
|
-
insertBefore(parent, button, anchor);
|
|
1077
|
-
}
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
__name(createTabButtons, "createTabButtons");
|
|
1081
|
-
function activeId(props, internalValue) {
|
|
1082
|
-
const controlled = readProp(props, "value", void 0);
|
|
1083
|
-
if (controlled !== void 0) return controlled;
|
|
1084
|
-
if (internalValue.value !== void 0) return internalValue.value;
|
|
1085
|
-
return readProp(props, "items", []).find((item) => item.disabled !== true)?.id;
|
|
1086
|
-
}
|
|
1087
|
-
__name(activeId, "activeId");
|
|
1088
|
-
function activeItem(items, id) {
|
|
1089
|
-
return items.find((item) => item.id === id);
|
|
1090
|
-
}
|
|
1091
|
-
__name(activeItem, "activeItem");
|
|
1092
|
-
|
|
1093
|
-
// packages/icon-core/src/index.ts
|
|
1094
|
-
function createSvgIconNode(source, props = {}, options = {}) {
|
|
1095
|
-
const root = createElement("span");
|
|
1096
|
-
effect(() => {
|
|
1097
|
-
updateSvgIconNode(root, typeof source === "function" ? source() : source, props, options);
|
|
1098
|
-
});
|
|
1099
|
-
return root;
|
|
1100
|
-
}
|
|
1101
|
-
__name(createSvgIconNode, "createSvgIconNode");
|
|
1102
|
-
function updateSvgIconNode(root, definition, props, options) {
|
|
1103
|
-
const size = readProp2(props, "size", void 0);
|
|
1104
|
-
const width = readProp2(props, "width", size);
|
|
1105
|
-
const height = readProp2(props, "height", size);
|
|
1106
|
-
const normalizedWidth = normalizeSvgLength(width);
|
|
1107
|
-
const normalizedHeight = normalizeSvgLength(height);
|
|
1108
|
-
const userClass = [
|
|
1109
|
-
readProp2(props, "class", void 0),
|
|
1110
|
-
readProp2(props, "className", void 0)
|
|
1111
|
-
].filter(hasText).join(" ");
|
|
1112
|
-
const className = [options.class, options.className, userClass].filter(hasText).join(" ");
|
|
1113
|
-
setAttribute(root, "class", className);
|
|
1114
|
-
const internalStyle = size === void 0 ? "" : `width: ${normalizeCssLength(size)}; height: ${normalizeCssLength(size)}`;
|
|
1115
|
-
const userStyle = readProp2(props, "style", void 0);
|
|
1116
|
-
const style = [internalStyle, userStyle].filter(hasText).join("; ");
|
|
1117
|
-
setOptionalAttribute2(root, "style", style || void 0);
|
|
1118
|
-
const managedAttributes2 = /* @__PURE__ */ new Map();
|
|
1119
|
-
for (const name of Object.keys(props)) {
|
|
1120
|
-
if (name === "class" || name === "className" || name === "style" || name === "children") continue;
|
|
1121
|
-
if (!name.startsWith("aria-") && !name.startsWith("data-") && !["id", "title", "role", "tabIndex"].includes(name)) continue;
|
|
1122
|
-
const value = Reflect.get(props, name);
|
|
1123
|
-
if (value === void 0 || value === null || value === false) continue;
|
|
1124
|
-
managedAttributes2.set(name === "tabIndex" ? "tabindex" : name, String(value));
|
|
1125
|
-
}
|
|
1126
|
-
for (const [name, value] of managedAttributes2) setAttribute(root, name, value);
|
|
1127
|
-
clearStaleAttributes(root, managedAttributes2);
|
|
1128
|
-
const title = readProp2(props, "title", void 0);
|
|
1129
|
-
const ariaLabel = Reflect.get(props, "aria-label");
|
|
1130
|
-
const decorative = readProp2(props, "decorative", title === void 0 && ariaLabel === void 0);
|
|
1131
|
-
setOptionalAttribute2(root, "aria-hidden", decorative ? "true" : void 0);
|
|
1132
|
-
setOptionalAttribute2(root, "aria-label", ariaLabel === void 0 ? title : void 0);
|
|
1133
|
-
setOptionalAttribute2(root, "data-icon-name", options.dataIconName ?? definition?.name);
|
|
1134
|
-
setOptionalAttribute2(root, "color", readProp2(props, "color", void 0));
|
|
1135
|
-
if (!definition) {
|
|
1136
|
-
setProperty(root, "innerHTML", "");
|
|
1137
|
-
return;
|
|
1138
|
-
}
|
|
1139
|
-
const svgAttributes = {
|
|
1140
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1141
|
-
viewBox: definition.viewBox ?? "0 0 24 24",
|
|
1142
|
-
...options.defaultSvgAttributes,
|
|
1143
|
-
...definition.attributes,
|
|
1144
|
-
...normalizedWidth === void 0 ? {} : { width: normalizedWidth },
|
|
1145
|
-
...normalizedHeight === void 0 ? {} : { height: normalizedHeight },
|
|
1146
|
-
...readProp2(props, "color", void 0) === void 0 ? {} : { color: readProp2(props, "color", void 0) },
|
|
1147
|
-
...readProp2(props, "stroke", void 0) === void 0 ? {} : { stroke: readProp2(props, "stroke", void 0) },
|
|
1148
|
-
...readProp2(props, "fill", void 0) === void 0 ? {} : { fill: readProp2(props, "fill", void 0) },
|
|
1149
|
-
...readProp2(props, "strokeWidth", void 0) === void 0 ? {} : { "stroke-width": readProp2(props, "strokeWidth", void 0) }
|
|
1150
|
-
};
|
|
1151
|
-
const markup = Object.entries(svgAttributes).filter(([, value]) => value !== void 0).map(([name, value]) => `${name}="${escapeXml(String(value))}"`).join(" ");
|
|
1152
|
-
const titleMarkup = title === void 0 ? "" : `<title>${escapeXml(title)}</title>`;
|
|
1153
|
-
setProperty(root, "innerHTML", `<svg ${markup} aria-hidden="true">${titleMarkup}${definition.body}</svg>`);
|
|
1154
|
-
}
|
|
1155
|
-
__name(updateSvgIconNode, "updateSvgIconNode");
|
|
1156
|
-
function readProp2(props, name, fallback) {
|
|
1157
|
-
const value = Reflect.get(props, name);
|
|
1158
|
-
return value === void 0 ? fallback : value;
|
|
1159
|
-
}
|
|
1160
|
-
__name(readProp2, "readProp");
|
|
1161
|
-
function hasText(value) {
|
|
1162
|
-
return value !== void 0 && value.trim() !== "";
|
|
1163
|
-
}
|
|
1164
|
-
__name(hasText, "hasText");
|
|
1165
|
-
function normalizeSvgLength(value) {
|
|
1166
|
-
if (value === void 0) return void 0;
|
|
1167
|
-
return typeof value === "number" ? String(value) : value;
|
|
1168
|
-
}
|
|
1169
|
-
__name(normalizeSvgLength, "normalizeSvgLength");
|
|
1170
|
-
function normalizeCssLength(value) {
|
|
1171
|
-
return typeof value === "number" || /^\d+(?:\.\d+)?$/u.test(value) ? `${value}px` : value;
|
|
1172
|
-
}
|
|
1173
|
-
__name(normalizeCssLength, "normalizeCssLength");
|
|
1174
|
-
function setOptionalAttribute2(node, name, value) {
|
|
1175
|
-
if (value === void 0 || value === null || value === false || value === "") {
|
|
1176
|
-
node.removeAttribute(name);
|
|
1177
|
-
return;
|
|
1178
|
-
}
|
|
1179
|
-
setAttribute(node, name, String(value));
|
|
1180
|
-
}
|
|
1181
|
-
__name(setOptionalAttribute2, "setOptionalAttribute");
|
|
1182
|
-
function clearStaleAttributes(node, next) {
|
|
1183
|
-
const previous = node.__vobsIconAttributes ?? /* @__PURE__ */ new Set();
|
|
1184
|
-
for (const name of previous) {
|
|
1185
|
-
if (!next.has(name)) node.removeAttribute(name);
|
|
1186
|
-
}
|
|
1187
|
-
node.__vobsIconAttributes = new Set(next.keys());
|
|
1188
|
-
}
|
|
1189
|
-
__name(clearStaleAttributes, "clearStaleAttributes");
|
|
1190
|
-
function escapeXml(value) {
|
|
1191
|
-
return value.replace(/&/gu, "&").replace(/</gu, "<").replace(/>/gu, ">").replace(/"/gu, """);
|
|
1192
|
-
}
|
|
1193
|
-
__name(escapeXml, "escapeXml");
|
|
1194
|
-
|
|
1195
|
-
// packages/ui/src/icon.ts
|
|
1196
|
-
function Icon(props = {}) {
|
|
1197
|
-
const root = createSvgIconNode(() => {
|
|
1198
|
-
const definition = resolveIcon(
|
|
1199
|
-
readProp(props, "icon", void 0) ?? readProp(props, "name", void 0)
|
|
1200
|
-
);
|
|
1201
|
-
if (!definition) {
|
|
1202
|
-
if (hasProp(props, "children")) return void 0;
|
|
1203
|
-
throw new Error("Vobs UI: Icon requires a registered `name` or an `icon` definition");
|
|
1204
|
-
}
|
|
1205
|
-
return iconDefinitionToSvg(definition);
|
|
1206
|
-
}, props, {
|
|
1207
|
-
class: "vui-icon icon",
|
|
1208
|
-
defaultSvgAttributes: {
|
|
1209
|
-
fill: "none",
|
|
1210
|
-
stroke: "currentColor",
|
|
1211
|
-
"stroke-width": 2,
|
|
1212
|
-
"stroke-linecap": "butt",
|
|
1213
|
-
"stroke-linejoin": "miter"
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
1217
|
-
return root;
|
|
1218
|
-
}
|
|
1219
|
-
__name(Icon, "Icon");
|
|
1220
|
-
function iconDefinitionToSvg(definition) {
|
|
1221
|
-
return {
|
|
1222
|
-
name: definition.name,
|
|
1223
|
-
body: definition.path,
|
|
1224
|
-
viewBox: definition.viewBox
|
|
1225
|
-
};
|
|
1226
|
-
}
|
|
1227
|
-
__name(iconDefinitionToSvg, "iconDefinitionToSvg");
|
|
1228
|
-
var VUI_ICON_PATHS = {
|
|
1229
|
-
search: '<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>',
|
|
1230
|
-
check: '<polyline points="4 12 10 18 20 6"/>',
|
|
1231
|
-
x: '<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>',
|
|
1232
|
-
plus: '<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',
|
|
1233
|
-
minus: '<line x1="5" y1="12" x2="19" y2="12"/>',
|
|
1234
|
-
"chevron-right": '<polyline points="9 6 15 12 9 18"/>',
|
|
1235
|
-
"chevron-down": '<polyline points="6 9 12 15 18 9"/>',
|
|
1236
|
-
"chevron-up": '<polyline points="6 15 12 9 18 15"/>',
|
|
1237
|
-
"chevron-left": '<polyline points="15 6 9 12 15 18"/>',
|
|
1238
|
-
"arrow-left": '<line x1="20" y1="12" x2="4" y2="12"/><polyline points="10 6 4 12 10 18"/>',
|
|
1239
|
-
"arrow-right": '<line x1="4" y1="12" x2="20" y2="12"/><polyline points="14 6 20 12 14 18"/>',
|
|
1240
|
-
"arrow-up": '<line x1="12" y1="20" x2="12" y2="4"/><polyline points="6 10 12 4 18 10"/>',
|
|
1241
|
-
"arrow-down": '<line x1="12" y1="4" x2="12" y2="20"/><polyline points="6 14 12 20 18 14"/>',
|
|
1242
|
-
atom: '<circle cx="12" cy="12" r="2"/><ellipse cx="12" cy="12" rx="10" ry="4"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(60 12 12)"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(120 12 12)"/>',
|
|
1243
|
-
globe: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/>',
|
|
1244
|
-
"arrow-expand": '<polyline points="14 4 20 4 20 10"/><line x1="14" y1="10" x2="20" y2="4"/><polyline points="10 20 4 20 4 14"/><line x1="10" y1="14" x2="4" y2="20"/>',
|
|
1245
|
-
"arrow-minimize": '<polyline points="20 4 14 10 20 10"/><line x1="14" y1="10" x2="14" y2="4"/><polyline points="4 20 10 14 4 14"/><line x1="10" y1="14" x2="10" y2="20"/>',
|
|
1246
|
-
"check-circle": '<circle cx="12" cy="12" r="9"/><polyline points="8 12 11 15 16 9"/>',
|
|
1247
|
-
"alert-circle": '<circle cx="12" cy="12" r="9"/><line x1="12" y1="8" x2="12" y2="13"/><line x1="12" y1="16" x2="12" y2="16.01"/>',
|
|
1248
|
-
"alert-triangle": '<path d="M12 3 22 20 2 20 Z"/><line x1="12" y1="10" x2="12" y2="15"/><line x1="12" y1="18" x2="12" y2="18.01"/>',
|
|
1249
|
-
info: '<circle cx="12" cy="12" r="9"/><line x1="12" y1="11" x2="12" y2="16"/><line x1="12" y1="8" x2="12" y2="8.01"/>',
|
|
1250
|
-
home: '<polygon points="3 11 12 3 21 11 21 21 14 21 14 14 10 14 10 21 3 21 3 11"/>',
|
|
1251
|
-
user: '<path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"/><circle cx="12" cy="8" r="4"/>',
|
|
1252
|
-
settings: '<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/>',
|
|
1253
|
-
menu: '<line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/>',
|
|
1254
|
-
"more-h": '<circle cx="5" cy="12" r="1.5" fill="currentColor"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/><circle cx="19" cy="12" r="1.5" fill="currentColor"/>',
|
|
1255
|
-
calendar: '<rect x="3" y="5" width="18" height="16"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="8" y1="3" x2="8" y2="7"/><line x1="16" y1="3" x2="16" y2="7"/>',
|
|
1256
|
-
filter: '<polygon points="3 4 21 4 14 12 14 20 10 18 10 12 3 4"/>',
|
|
1257
|
-
sort: '<path d="M8 20V4"/><polyline points="4 8 8 4 12 8"/><path d="M16 4v16"/><polyline points="12 16 16 20 20 16"/>',
|
|
1258
|
-
edit: '<path d="M4 20h4l10-10-4-4L4 16v4z"/><path d="M14 6l4 4"/>',
|
|
1259
|
-
trash: '<polyline points="4 6 20 6"/><path d="M6 6v14h12V6"/><path d="M9 6V4h6v2"/><line x1="10" y1="10" x2="10" y2="17"/><line x1="14" y1="10" x2="14" y2="17"/>',
|
|
1260
|
-
download: '<path d="M12 3v12"/><polyline points="7 10 12 15 17 10"/><line x1="3" y1="21" x2="21" y2="21"/>',
|
|
1261
|
-
upload: '<path d="M12 21V6"/><polyline points="7 11 12 6 17 11"/><line x1="3" y1="21" x2="21" y2="21"/>',
|
|
1262
|
-
pause: '<line x1="9" y1="5" x2="9" y2="19"/><line x1="15" y1="5" x2="15" y2="19"/>',
|
|
1263
|
-
play: '<polygon points="8 5 19 12 8 19 8 5"/>',
|
|
1264
|
-
refresh: '<polyline points="21 4 21 10 15 10"/><polyline points="3 20 3 14 9 14"/><path d="M20.5 9A9 9 0 0 0 5 5.5L3 7M3.5 15A9 9 0 0 0 19 18.5L21 17"/>',
|
|
1265
|
-
bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8z"/><path d="M10 21a2 2 0 0 0 4 0"/>',
|
|
1266
|
-
folder: '<path d="M3 6h6l2 3h10v10H3z"/>',
|
|
1267
|
-
code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
|
|
1268
|
-
sparkles: '<path d="M12 3l1.8 4.2L18 9l-4.2 1.8L12 15l-1.8-4.2L6 9l4.2-1.8L12 3z"/><path d="M19 14l1 2.2 2.2 1-2.2 1L19 20.4l-1-2.2-2.2-1 2.2-1L19 14z"/>',
|
|
1269
|
-
zap: '<polygon points="13 2 4 14 12 14 11 22 20 10 12 10 13 2"/>',
|
|
1270
|
-
sun: '<circle cx="12" cy="12" r="4"/><line x1="12" y1="2" x2="12" y2="5"/><line x1="12" y1="19" x2="12" y2="22"/><line x1="2" y1="12" x2="5" y2="12"/><line x1="19" y1="12" x2="22" y2="12"/><line x1="4.6" y1="4.6" x2="6.7" y2="6.7"/><line x1="17.3" y1="17.3" x2="19.4" y2="19.4"/><line x1="4.6" y1="19.4" x2="6.7" y2="17.3"/><line x1="17.3" y1="6.7" x2="19.4" y2="4.6"/>',
|
|
1271
|
-
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
|
|
1272
|
-
terminal: '<polyline points="4 7 9 12 4 17"/><line x1="12" y1="17" x2="20" y2="17"/>'
|
|
18
|
+
return to;
|
|
1273
19
|
};
|
|
1274
|
-
var
|
|
1275
|
-
Object.entries(VUI_ICON_PATHS).map(([name, path]) => [name, { name, path }])
|
|
1276
|
-
);
|
|
1277
|
-
function resolveIcon(icon) {
|
|
1278
|
-
return typeof icon === "string" ? iconRegistry.get(icon) : icon;
|
|
1279
|
-
}
|
|
1280
|
-
__name(resolveIcon, "resolveIcon");
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1281
21
|
|
|
1282
22
|
// packages/devtools-ui/src/panel.tsx
|
|
23
|
+
var panel_exports = {};
|
|
24
|
+
__export(panel_exports, {
|
|
25
|
+
DevToolsPanel: () => DevToolsPanel,
|
|
26
|
+
DevToolsToolbar: () => DevToolsToolbar,
|
|
27
|
+
readDevToolsSnapshot: () => readDevToolsSnapshot
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(panel_exports);
|
|
30
|
+
var import_devtools = require("@vobs/devtools");
|
|
31
|
+
var import_http = require("@vobs/http");
|
|
32
|
+
var import_reactivity = require("@vobs/reactivity");
|
|
33
|
+
var import_vobs = require("@vobs/vobs");
|
|
34
|
+
var import_ui = require("@vobs/ui");
|
|
1283
35
|
var EMPTY_SNAPSHOT = {
|
|
1284
36
|
api: null,
|
|
1285
37
|
tree: [],
|
|
@@ -1296,7 +48,7 @@ var EMPTY_SNAPSHOT = {
|
|
|
1296
48
|
routerContext: null
|
|
1297
49
|
};
|
|
1298
50
|
var PANEL_REFRESH_EVENTS = ["signal-update", "update", "lifecycle", "network-request", "router", "error", "collection", "collection-cleared"];
|
|
1299
|
-
function readDevToolsSnapshot(api = getDevTools()) {
|
|
51
|
+
function readDevToolsSnapshot(api = (0, import_devtools.getDevTools)()) {
|
|
1300
52
|
return readDevToolsSnapshotWithRouter(api, null);
|
|
1301
53
|
}
|
|
1302
54
|
__name(readDevToolsSnapshot, "readDevToolsSnapshot");
|
|
@@ -1320,26 +72,26 @@ function readDevToolsSnapshotWithRouter(api, router) {
|
|
|
1320
72
|
}
|
|
1321
73
|
__name(readDevToolsSnapshotWithRouter, "readDevToolsSnapshotWithRouter");
|
|
1322
74
|
function DevToolsPanel(props = {}) {
|
|
1323
|
-
const refreshCount = state(0);
|
|
1324
|
-
const activeSection = state("updates");
|
|
1325
|
-
const activeAdvancedSection = state("signals");
|
|
1326
|
-
const activeRouterTab = state("context");
|
|
1327
|
-
const activeUpdatesTab = state("updates");
|
|
1328
|
-
const activeComponentsTab = state("tree");
|
|
1329
|
-
const activeRouteView = state("tree");
|
|
1330
|
-
const activeTimelineFilter = state("all");
|
|
1331
|
-
const networkSelection = state(null);
|
|
1332
|
-
const networkSourceFilter = state("all");
|
|
1333
|
-
const networkStatusFilter = state("all");
|
|
1334
|
-
const networkDetailTab = state("overview");
|
|
1335
|
-
const networkTesterOpen = state(false);
|
|
1336
|
-
const networkTesterRevision = state(0);
|
|
1337
|
-
const networkTesterRun = state({ status: "idle" });
|
|
1338
|
-
const networkTesterTab = state("params");
|
|
75
|
+
const refreshCount = (0, import_vobs.state)(0);
|
|
76
|
+
const activeSection = (0, import_vobs.state)("updates");
|
|
77
|
+
const activeAdvancedSection = (0, import_vobs.state)("signals");
|
|
78
|
+
const activeRouterTab = (0, import_vobs.state)("context");
|
|
79
|
+
const activeUpdatesTab = (0, import_vobs.state)("updates");
|
|
80
|
+
const activeComponentsTab = (0, import_vobs.state)("tree");
|
|
81
|
+
const activeRouteView = (0, import_vobs.state)("tree");
|
|
82
|
+
const activeTimelineFilter = (0, import_vobs.state)("all");
|
|
83
|
+
const networkSelection = (0, import_vobs.state)(null);
|
|
84
|
+
const networkSourceFilter = (0, import_vobs.state)("all");
|
|
85
|
+
const networkStatusFilter = (0, import_vobs.state)("all");
|
|
86
|
+
const networkDetailTab = (0, import_vobs.state)("overview");
|
|
87
|
+
const networkTesterOpen = (0, import_vobs.state)(false);
|
|
88
|
+
const networkTesterRevision = (0, import_vobs.state)(0);
|
|
89
|
+
const networkTesterRun = (0, import_vobs.state)({ status: "idle" });
|
|
90
|
+
const networkTesterTab = (0, import_vobs.state)("params");
|
|
1339
91
|
let networkTesterDraft = createRequestTesterDraft();
|
|
1340
|
-
const selection = state(null);
|
|
1341
|
-
const query = props.query ?? state("");
|
|
1342
|
-
const http = props.http ?? inject(HTTP_KEY) ?? null;
|
|
92
|
+
const selection = (0, import_vobs.state)(null);
|
|
93
|
+
const query = props.query ?? (0, import_vobs.state)("");
|
|
94
|
+
const http = props.http ?? (0, import_vobs.inject)(import_http.HTTP_KEY) ?? null;
|
|
1343
95
|
let refreshInvalidating = false;
|
|
1344
96
|
const notifyRefresh = /* @__PURE__ */ __name(() => {
|
|
1345
97
|
if (refreshInvalidating) return;
|
|
@@ -1353,7 +105,7 @@ function DevToolsPanel(props = {}) {
|
|
|
1353
105
|
const api = resolveApi(props);
|
|
1354
106
|
if (api) {
|
|
1355
107
|
const stops = PANEL_REFRESH_EVENTS.map((event) => api.subscribe(event, notifyRefresh));
|
|
1356
|
-
onDispose(() => {
|
|
108
|
+
(0, import_vobs.onDispose)(() => {
|
|
1357
109
|
for (const stop of stops) stop();
|
|
1358
110
|
});
|
|
1359
111
|
}
|
|
@@ -1364,7 +116,7 @@ function DevToolsPanel(props = {}) {
|
|
|
1364
116
|
const stopNavigation = router.devtools.subscribe("navigation:end", notifyRefresh);
|
|
1365
117
|
const stopRouteUpdate = router.devtools.subscribe("route:update", notifyRefresh);
|
|
1366
118
|
const stopRouteError = router.devtools.subscribe("error", notifyRefresh);
|
|
1367
|
-
onDispose(() => {
|
|
119
|
+
(0, import_vobs.onDispose)(() => {
|
|
1368
120
|
stopNavigationStart();
|
|
1369
121
|
stopNavigation();
|
|
1370
122
|
stopRouteUpdate();
|
|
@@ -1373,55 +125,55 @@ function DevToolsPanel(props = {}) {
|
|
|
1373
125
|
});
|
|
1374
126
|
}
|
|
1375
127
|
const toolbarPlacement = props.toolbarPlacement ?? "content";
|
|
1376
|
-
return /* @__PURE__ */ React.createElement("div", { class: "vobs-devtools-shell" }, /* @__PURE__ */ React.createElement("aside", { class: "vobs-devtools-shell__rail", "aria-label": "DevTools sections" }, /* @__PURE__ */ React.createElement("div", { class: "vobs-devtools-shell__mark" }, /* @__PURE__ */ React.createElement(Icon, { name: "code" })), /* @__PURE__ */ React.createElement(SectionNav, { activeSection })), /* @__PURE__ */ React.createElement("section", { class: "vobs-devtools-shell__main" }, /* @__PURE__ */ React.createElement("div", { class: "vobs-devtools-shell__content" }, toolbarPlacement === "content" ? /* @__PURE__ */ React.createElement(DevToolsToolbar, { api, query }) : null, /* @__PURE__ */ React.createElement(DevToolsContent, { refreshCount, activeSection, activeAdvancedSection, activeRouterTab, activeUpdatesTab, activeComponentsTab, activeRouteView, router, api, http, selection, query, networkSelection, networkSourceFilter, networkStatusFilter, networkDetailTab, networkTesterOpen, networkTesterRevision, networkTesterRun, networkTesterDraft, networkTesterTab }))), /* @__PURE__ */ React.createElement(ActivityRail, { refreshCount, router, api, selection, activeSection, activeFilter: activeTimelineFilter }));
|
|
128
|
+
return /* @__PURE__ */ React.createElement("div", { class: "vobs-devtools-shell" }, /* @__PURE__ */ React.createElement("aside", { class: "vobs-devtools-shell__rail", "aria-label": "DevTools sections" }, /* @__PURE__ */ React.createElement("div", { class: "vobs-devtools-shell__mark" }, /* @__PURE__ */ React.createElement(import_ui.Icon, { name: "code" })), /* @__PURE__ */ React.createElement(SectionNav, { activeSection })), /* @__PURE__ */ React.createElement("section", { class: "vobs-devtools-shell__main" }, /* @__PURE__ */ React.createElement("div", { class: "vobs-devtools-shell__content" }, toolbarPlacement === "content" ? /* @__PURE__ */ React.createElement(DevToolsToolbar, { api, query }) : null, /* @__PURE__ */ React.createElement(DevToolsContent, { refreshCount, activeSection, activeAdvancedSection, activeRouterTab, activeUpdatesTab, activeComponentsTab, activeRouteView, router, api, http, selection, query, networkSelection, networkSourceFilter, networkStatusFilter, networkDetailTab, networkTesterOpen, networkTesterRevision, networkTesterRun, networkTesterDraft, networkTesterTab }))), /* @__PURE__ */ React.createElement(ActivityRail, { refreshCount, router, api, selection, activeSection, activeFilter: activeTimelineFilter }));
|
|
1377
129
|
}
|
|
1378
130
|
__name(DevToolsPanel, "DevToolsPanel");
|
|
1379
131
|
function DevToolsToolbar(props) {
|
|
1380
|
-
const refreshCount = state(0);
|
|
132
|
+
const refreshCount = (0, import_vobs.state)(0);
|
|
1381
133
|
if (props.api) {
|
|
1382
134
|
const stops = ["collection", "collection-cleared"].map((event) => props.api.subscribe(event, () => {
|
|
1383
135
|
refreshCount.value++;
|
|
1384
136
|
}));
|
|
1385
|
-
onDispose(() => {
|
|
137
|
+
(0, import_vobs.onDispose)(() => {
|
|
1386
138
|
for (const stop of stops) stop();
|
|
1387
139
|
});
|
|
1388
140
|
}
|
|
1389
|
-
return createFragment((parent, anchor) => {
|
|
1390
|
-
const toolbar = createElement("div");
|
|
1391
|
-
setAttribute(toolbar, "class", "vobs-devtools-collection-toolbar vobs-devtools-collection-toolbar--header");
|
|
1392
|
-
const search = createElement("input");
|
|
1393
|
-
setAttribute(search, "class", "vobs-devtools-search vobs-devtools-header-search");
|
|
1394
|
-
setAttribute(search, "type", "search");
|
|
1395
|
-
setAttribute(search, "placeholder", "Search diagnostics");
|
|
1396
|
-
effect(() => {
|
|
141
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
142
|
+
const toolbar = (0, import_vobs.createElement)("div");
|
|
143
|
+
(0, import_vobs.setAttribute)(toolbar, "class", "vobs-devtools-collection-toolbar vobs-devtools-collection-toolbar--header");
|
|
144
|
+
const search = (0, import_vobs.createElement)("input");
|
|
145
|
+
(0, import_vobs.setAttribute)(search, "class", "vobs-devtools-search vobs-devtools-header-search");
|
|
146
|
+
(0, import_vobs.setAttribute)(search, "type", "search");
|
|
147
|
+
(0, import_vobs.setAttribute)(search, "placeholder", "Search diagnostics");
|
|
148
|
+
(0, import_reactivity.effect)(() => {
|
|
1397
149
|
const next = props.query.value;
|
|
1398
|
-
if (search.value !== next) setProperty(search, "value", next);
|
|
150
|
+
if (search.value !== next) (0, import_vobs.setProperty)(search, "value", next);
|
|
1399
151
|
});
|
|
1400
152
|
search.addEventListener("input", () => {
|
|
1401
153
|
props.query.value = search.value;
|
|
1402
154
|
});
|
|
1403
|
-
insertBefore(toolbar, search, null);
|
|
1404
|
-
const actions = createElement("div");
|
|
1405
|
-
setAttribute(actions, "class", "vobs-devtools-collection-toolbar__actions");
|
|
1406
|
-
insertBefore(toolbar, actions, null);
|
|
1407
|
-
insertBefore(parent, toolbar, anchor);
|
|
1408
|
-
insertDynamic(actions, null, () => {
|
|
155
|
+
(0, import_vobs.insertBefore)(toolbar, search, null);
|
|
156
|
+
const actions = (0, import_vobs.createElement)("div");
|
|
157
|
+
(0, import_vobs.setAttribute)(actions, "class", "vobs-devtools-collection-toolbar__actions");
|
|
158
|
+
(0, import_vobs.insertBefore)(toolbar, actions, null);
|
|
159
|
+
(0, import_vobs.insertBefore)(parent, toolbar, anchor);
|
|
160
|
+
(0, import_vobs.insertDynamic)(actions, null, () => {
|
|
1409
161
|
void refreshCount.value;
|
|
1410
162
|
if (!props.api) return null;
|
|
1411
163
|
const paused = props.api.getCollectionState().paused;
|
|
1412
|
-
return createFragment((actionParent, actionAnchor) => {
|
|
1413
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
164
|
+
return (0, import_vobs.createFragment)((actionParent, actionAnchor) => {
|
|
165
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1414
166
|
variant: paused ? "warning" : "secondary",
|
|
1415
167
|
iconOnly: true,
|
|
1416
|
-
icon: createComponent(Icon, { name: paused ? "play" : "pause" }),
|
|
168
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: paused ? "play" : "pause" }),
|
|
1417
169
|
"aria-label": paused ? "Resume collection" : "Pause collection",
|
|
1418
170
|
title: paused ? "Resume collection" : "Pause collection",
|
|
1419
171
|
onClick: /* @__PURE__ */ __name(() => props.api?.setCollectionPaused(!paused), "onClick")
|
|
1420
172
|
}), actionAnchor);
|
|
1421
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
173
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1422
174
|
variant: "danger-subtle",
|
|
1423
175
|
iconOnly: true,
|
|
1424
|
-
icon: createComponent(Icon, { name: "trash" }),
|
|
176
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "trash" }),
|
|
1425
177
|
"aria-label": "Clear diagnostics",
|
|
1426
178
|
title: "Clear diagnostics",
|
|
1427
179
|
onClick: /* @__PURE__ */ __name(() => {
|
|
@@ -1440,37 +192,37 @@ function DevToolsToolbar(props) {
|
|
|
1440
192
|
link.click();
|
|
1441
193
|
URL.revokeObjectURL(link.href);
|
|
1442
194
|
}, "exportDiagnostics");
|
|
1443
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
195
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1444
196
|
variant: "ghost",
|
|
1445
197
|
iconOnly: true,
|
|
1446
|
-
icon: createComponent(Icon, { name: "download" }),
|
|
198
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "download" }),
|
|
1447
199
|
"aria-label": "Export diagnostics",
|
|
1448
200
|
title: "Export diagnostics",
|
|
1449
201
|
onClick: exportDiagnostics
|
|
1450
202
|
}), actionAnchor);
|
|
1451
|
-
const importInput = createElement("input");
|
|
1452
|
-
setAttribute(importInput, "type", "file");
|
|
1453
|
-
setAttribute(importInput, "accept", "application/json,.json");
|
|
1454
|
-
setAttribute(importInput, "aria-label", "Import diagnostics");
|
|
1455
|
-
setAttribute(importInput, "hidden", "");
|
|
203
|
+
const importInput = (0, import_vobs.createElement)("input");
|
|
204
|
+
(0, import_vobs.setAttribute)(importInput, "type", "file");
|
|
205
|
+
(0, import_vobs.setAttribute)(importInput, "accept", "application/json,.json");
|
|
206
|
+
(0, import_vobs.setAttribute)(importInput, "aria-label", "Import diagnostics");
|
|
207
|
+
(0, import_vobs.setAttribute)(importInput, "hidden", "");
|
|
1456
208
|
importInput.addEventListener("change", () => {
|
|
1457
209
|
const file = importInput.files?.[0];
|
|
1458
210
|
if (!file) return;
|
|
1459
211
|
void file.text().then((text) => props.api?.importDiagnostics(JSON.parse(text))).catch((error) => props.api?.reportError("global", error));
|
|
1460
212
|
});
|
|
1461
|
-
insertBefore(actionParent, importInput, actionAnchor);
|
|
1462
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
213
|
+
(0, import_vobs.insertBefore)(actionParent, importInput, actionAnchor);
|
|
214
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1463
215
|
variant: "ghost",
|
|
1464
216
|
iconOnly: true,
|
|
1465
|
-
icon: createComponent(Icon, { name: "upload" }),
|
|
217
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "upload" }),
|
|
1466
218
|
"aria-label": "Import diagnostics",
|
|
1467
219
|
title: "Import diagnostics",
|
|
1468
220
|
onClick: /* @__PURE__ */ __name(() => importInput.click(), "onClick")
|
|
1469
221
|
}), actionAnchor);
|
|
1470
|
-
if (props.onToggleMaximize) insertBefore(actionParent, createComponent(Button, {
|
|
222
|
+
if (props.onToggleMaximize) (0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1471
223
|
variant: "ghost",
|
|
1472
224
|
iconOnly: true,
|
|
1473
|
-
icon: createComponent(Icon, { name: props.maximized ? "arrow-minimize" : "arrow-expand" }),
|
|
225
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: props.maximized ? "arrow-minimize" : "arrow-expand" }),
|
|
1474
226
|
"aria-label": props.maximized ? "Restore DevTools" : "Maximize DevTools",
|
|
1475
227
|
title: props.maximized ? "Restore DevTools" : "Maximize DevTools",
|
|
1476
228
|
onClick: props.onToggleMaximize
|
|
@@ -1492,12 +244,12 @@ var TIMELINE_FILTER_OPTIONS = [
|
|
|
1492
244
|
{ value: "error", label: "Errors" }
|
|
1493
245
|
];
|
|
1494
246
|
function resolveApi(props) {
|
|
1495
|
-
return props.api === void 0 ? getDevTools() : props.api;
|
|
247
|
+
return props.api === void 0 ? (0, import_devtools.getDevTools)() : props.api;
|
|
1496
248
|
}
|
|
1497
249
|
__name(resolveApi, "resolveApi");
|
|
1498
250
|
function DevToolsContent(props) {
|
|
1499
|
-
return createFragment((parent, anchor) => {
|
|
1500
|
-
insertDynamic(parent, anchor, () => {
|
|
251
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
252
|
+
(0, import_vobs.insertDynamic)(parent, anchor, () => {
|
|
1501
253
|
void props.refreshCount.value;
|
|
1502
254
|
void props.activeSection.value;
|
|
1503
255
|
void props.activeRouterTab.value;
|
|
@@ -1521,8 +273,8 @@ function DevToolsContent(props) {
|
|
|
1521
273
|
}
|
|
1522
274
|
__name(DevToolsContent, "DevToolsContent");
|
|
1523
275
|
function ActivityRail(props) {
|
|
1524
|
-
return createFragment((parent, anchor) => {
|
|
1525
|
-
insertDynamic(parent, anchor, () => {
|
|
276
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
277
|
+
(0, import_vobs.insertDynamic)(parent, anchor, () => {
|
|
1526
278
|
void props.refreshCount.value;
|
|
1527
279
|
const filter = props.activeFilter.value;
|
|
1528
280
|
const selected = props.selection.value;
|
|
@@ -1544,25 +296,25 @@ function focusSelection(activeSection, selection) {
|
|
|
1544
296
|
}
|
|
1545
297
|
__name(focusSelection, "focusSelection");
|
|
1546
298
|
function SectionNav(props) {
|
|
1547
|
-
return createFragment((parent, anchor) => {
|
|
1548
|
-
insertDynamic(parent, anchor, () => {
|
|
299
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
300
|
+
(0, import_vobs.insertDynamic)(parent, anchor, () => {
|
|
1549
301
|
const selected = props.activeSection.value;
|
|
1550
|
-
return createFragment((navParent, navAnchor) => {
|
|
302
|
+
return (0, import_vobs.createFragment)((navParent, navAnchor) => {
|
|
1551
303
|
for (const section of ["updates", "components", "advanced", "network", "errors", "router"]) {
|
|
1552
304
|
const label = section === "components" ? "comp..." : section === "advanced" ? "adv..." : section;
|
|
1553
|
-
const button = createElement("button");
|
|
1554
|
-
setAttribute(button, "class", `vobs-devtools-shell__nav-item${selected === section ? " is-active" : ""}`);
|
|
1555
|
-
setAttribute(button, "type", "button");
|
|
305
|
+
const button = (0, import_vobs.createElement)("button");
|
|
306
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-shell__nav-item${selected === section ? " is-active" : ""}`);
|
|
307
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
1556
308
|
const accessibleLabel = section === "advanced" ? "Advanced" : section;
|
|
1557
|
-
setAttribute(button, "aria-label", accessibleLabel);
|
|
1558
|
-
setAttribute(button, "title", accessibleLabel);
|
|
1559
|
-
setAttribute(button, "aria-pressed", selected === section ? "true" : "false");
|
|
1560
|
-
insertBefore(button, createComponent(Icon, { name: section === "router" ? "folder" : section === "components" ? "code" : section === "advanced" ? "atom" : section === "network" ? "globe" : section === "errors" ? "alert-triangle" : "refresh" }), null);
|
|
1561
|
-
insertBefore(button, createElementText(label), null);
|
|
309
|
+
(0, import_vobs.setAttribute)(button, "aria-label", accessibleLabel);
|
|
310
|
+
(0, import_vobs.setAttribute)(button, "title", accessibleLabel);
|
|
311
|
+
(0, import_vobs.setAttribute)(button, "aria-pressed", selected === section ? "true" : "false");
|
|
312
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createComponent)(import_ui.Icon, { name: section === "router" ? "folder" : section === "components" ? "code" : section === "advanced" ? "atom" : section === "network" ? "globe" : section === "errors" ? "alert-triangle" : "refresh" }), null);
|
|
313
|
+
(0, import_vobs.insertBefore)(button, createElementText(label), null);
|
|
1562
314
|
button.addEventListener("click", () => {
|
|
1563
315
|
props.activeSection.value = section;
|
|
1564
316
|
});
|
|
1565
|
-
insertBefore(navParent, button, navAnchor);
|
|
317
|
+
(0, import_vobs.insertBefore)(navParent, button, navAnchor);
|
|
1566
318
|
}
|
|
1567
319
|
});
|
|
1568
320
|
});
|
|
@@ -1618,15 +370,15 @@ function collectActivityTimeline(snapshot, router, filter = "all") {
|
|
|
1618
370
|
}
|
|
1619
371
|
__name(collectActivityTimeline, "collectActivityTimeline");
|
|
1620
372
|
function renderActivityRail(updates, timeline, api, selection, filter, onFilterChange, onFocus) {
|
|
1621
|
-
const root = createElement("aside");
|
|
1622
|
-
setAttribute(root, "class", "vobs-devtools-shell__activity");
|
|
1623
|
-
const header = createElement("div");
|
|
1624
|
-
setAttribute(header, "class", "vobs-devtools-shell__activity-header");
|
|
1625
|
-
const title = createElement("div");
|
|
1626
|
-
setAttribute(title, "class", "vobs-devtools-shell__activity-title");
|
|
1627
|
-
insertBefore(title, createElementText("Timeline"), null);
|
|
1628
|
-
insertBefore(header, title, null);
|
|
1629
|
-
insertBefore(header, createComponent(Select, {
|
|
373
|
+
const root = (0, import_vobs.createElement)("aside");
|
|
374
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-shell__activity");
|
|
375
|
+
const header = (0, import_vobs.createElement)("div");
|
|
376
|
+
(0, import_vobs.setAttribute)(header, "class", "vobs-devtools-shell__activity-header");
|
|
377
|
+
const title = (0, import_vobs.createElement)("div");
|
|
378
|
+
(0, import_vobs.setAttribute)(title, "class", "vobs-devtools-shell__activity-title");
|
|
379
|
+
(0, import_vobs.insertBefore)(title, createElementText("Timeline"), null);
|
|
380
|
+
(0, import_vobs.insertBefore)(header, title, null);
|
|
381
|
+
(0, import_vobs.insertBefore)(header, (0, import_vobs.createComponent)(import_ui.Select, {
|
|
1630
382
|
class: "vobs-devtools-timeline-filter",
|
|
1631
383
|
value: filter,
|
|
1632
384
|
"aria-label": "Filter timeline events",
|
|
@@ -1634,51 +386,51 @@ function renderActivityRail(updates, timeline, api, selection, filter, onFilterC
|
|
|
1634
386
|
const next = event.target.value;
|
|
1635
387
|
if (isTimelineFilter(next)) onFilterChange(next);
|
|
1636
388
|
}, "onChange"),
|
|
1637
|
-
children: /* @__PURE__ */ __name(() => createFragment((parent, anchor) => {
|
|
389
|
+
children: /* @__PURE__ */ __name(() => (0, import_vobs.createFragment)((parent, anchor) => {
|
|
1638
390
|
for (const option of TIMELINE_FILTER_OPTIONS) {
|
|
1639
|
-
const optionNode = createElement("option");
|
|
1640
|
-
setAttribute(optionNode, "value", option.value);
|
|
1641
|
-
insertBefore(optionNode, createText(option.label), null);
|
|
1642
|
-
insertBefore(parent, optionNode, anchor);
|
|
391
|
+
const optionNode = (0, import_vobs.createElement)("option");
|
|
392
|
+
(0, import_vobs.setAttribute)(optionNode, "value", option.value);
|
|
393
|
+
(0, import_vobs.insertBefore)(optionNode, (0, import_vobs.createText)(option.label), null);
|
|
394
|
+
(0, import_vobs.insertBefore)(parent, optionNode, anchor);
|
|
1643
395
|
}
|
|
1644
396
|
}), "children")
|
|
1645
397
|
}), null);
|
|
1646
|
-
insertBefore(root, header, null);
|
|
1647
|
-
const subtitle = createElement("div");
|
|
1648
|
-
setAttribute(subtitle, "class", "vobs-devtools-shell__activity-subtitle");
|
|
1649
|
-
insertBefore(subtitle, createElementText(`${timeline.length} shown \xB7 ${updates.length} updates`), null);
|
|
1650
|
-
insertBefore(root, subtitle, null);
|
|
1651
|
-
const list = createElement("div");
|
|
1652
|
-
setAttribute(list, "class", "vobs-devtools-activity-list");
|
|
398
|
+
(0, import_vobs.insertBefore)(root, header, null);
|
|
399
|
+
const subtitle = (0, import_vobs.createElement)("div");
|
|
400
|
+
(0, import_vobs.setAttribute)(subtitle, "class", "vobs-devtools-shell__activity-subtitle");
|
|
401
|
+
(0, import_vobs.insertBefore)(subtitle, createElementText(`${timeline.length} shown \xB7 ${updates.length} updates`), null);
|
|
402
|
+
(0, import_vobs.insertBefore)(root, subtitle, null);
|
|
403
|
+
const list = (0, import_vobs.createElement)("div");
|
|
404
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-activity-list");
|
|
1653
405
|
for (const entry of timeline) {
|
|
1654
406
|
const update = entry.update;
|
|
1655
|
-
const activityItem = createElement("div");
|
|
1656
|
-
setAttribute(activityItem, "class", `vobs-devtools-activity-item${update && selection?.type === "update" && selection.id === update.id ? " is-selected" : ""}`);
|
|
407
|
+
const activityItem = (0, import_vobs.createElement)("div");
|
|
408
|
+
(0, import_vobs.setAttribute)(activityItem, "class", `vobs-devtools-activity-item${update && selection?.type === "update" && selection.id === update.id ? " is-selected" : ""}`);
|
|
1657
409
|
if (update) activityItem.addEventListener("click", () => onFocus("updates", { type: "update", id: update.id }));
|
|
1658
|
-
const dot = createElement("span");
|
|
1659
|
-
setAttribute(dot, "class", "vobs-devtools-activity-item__dot");
|
|
1660
|
-
insertBefore(dot, createComponent(Icon, { name: entry.icon }), null);
|
|
1661
|
-
const body = createElement("div");
|
|
1662
|
-
setAttribute(body, "class", "vobs-devtools-activity-item__body");
|
|
1663
|
-
const name = createElement("span");
|
|
1664
|
-
setAttribute(name, "class", "vobs-devtools-activity-item__name");
|
|
410
|
+
const dot = (0, import_vobs.createElement)("span");
|
|
411
|
+
(0, import_vobs.setAttribute)(dot, "class", "vobs-devtools-activity-item__dot");
|
|
412
|
+
(0, import_vobs.insertBefore)(dot, (0, import_vobs.createComponent)(import_ui.Icon, { name: entry.icon }), null);
|
|
413
|
+
const body = (0, import_vobs.createElement)("div");
|
|
414
|
+
(0, import_vobs.setAttribute)(body, "class", "vobs-devtools-activity-item__body");
|
|
415
|
+
const name = (0, import_vobs.createElement)("span");
|
|
416
|
+
(0, import_vobs.setAttribute)(name, "class", "vobs-devtools-activity-item__name");
|
|
1665
417
|
const signal = update ? api?.getSignal(update.signalId) : void 0;
|
|
1666
|
-
insertBefore(name, createElementText(entry.title), null);
|
|
1667
|
-
const detail = createElement("span");
|
|
1668
|
-
insertBefore(detail, createElementText(entry.detail ?? (update ? `${formatDebugSource(signal?.component ?? "unknown")} \xB7 ${update.duration.toFixed(2)} ms \xB7 ${update.effects.length} effects` : "")), null);
|
|
1669
|
-
insertBefore(body, name, null);
|
|
1670
|
-
insertBefore(body, detail, null);
|
|
1671
|
-
insertBefore(activityItem, dot, null);
|
|
1672
|
-
insertBefore(activityItem, body, null);
|
|
1673
|
-
insertBefore(list, activityItem, null);
|
|
418
|
+
(0, import_vobs.insertBefore)(name, createElementText(entry.title), null);
|
|
419
|
+
const detail = (0, import_vobs.createElement)("span");
|
|
420
|
+
(0, import_vobs.insertBefore)(detail, createElementText(entry.detail ?? (update ? `${formatDebugSource(signal?.component ?? "unknown")} \xB7 ${update.duration.toFixed(2)} ms \xB7 ${update.effects.length} effects` : "")), null);
|
|
421
|
+
(0, import_vobs.insertBefore)(body, name, null);
|
|
422
|
+
(0, import_vobs.insertBefore)(body, detail, null);
|
|
423
|
+
(0, import_vobs.insertBefore)(activityItem, dot, null);
|
|
424
|
+
(0, import_vobs.insertBefore)(activityItem, body, null);
|
|
425
|
+
(0, import_vobs.insertBefore)(list, activityItem, null);
|
|
1674
426
|
}
|
|
1675
427
|
if (timeline.length === 0) {
|
|
1676
|
-
const empty = createElement("span");
|
|
1677
|
-
setAttribute(empty, "class", "vobs-devtools-muted");
|
|
1678
|
-
insertBefore(empty, createElementText(filter === "all" ? "No recent events." : `No ${timelineFilterLabel(filter).toLowerCase()} events.`), null);
|
|
1679
|
-
insertBefore(list, empty, null);
|
|
428
|
+
const empty = (0, import_vobs.createElement)("span");
|
|
429
|
+
(0, import_vobs.setAttribute)(empty, "class", "vobs-devtools-muted");
|
|
430
|
+
(0, import_vobs.insertBefore)(empty, createElementText(filter === "all" ? "No recent events." : `No ${timelineFilterLabel(filter).toLowerCase()} events.`), null);
|
|
431
|
+
(0, import_vobs.insertBefore)(list, empty, null);
|
|
1680
432
|
}
|
|
1681
|
-
insertBefore(root, list, null);
|
|
433
|
+
(0, import_vobs.insertBefore)(root, list, null);
|
|
1682
434
|
return root;
|
|
1683
435
|
}
|
|
1684
436
|
__name(renderActivityRail, "renderActivityRail");
|
|
@@ -1691,12 +443,12 @@ function timelineFilterLabel(filter) {
|
|
|
1691
443
|
}
|
|
1692
444
|
__name(timelineFilterLabel, "timelineFilterLabel");
|
|
1693
445
|
function createElementText(value) {
|
|
1694
|
-
return createText(value);
|
|
446
|
+
return (0, import_vobs.createText)(value);
|
|
1695
447
|
}
|
|
1696
448
|
__name(createElementText, "createElementText");
|
|
1697
449
|
function renderDevToolsContent(snapshot, section = "updates", router = null, activeRouterTab, activeUpdatesTab, activeComponentsTab, selection = null, onFocus = () => void 0, query = "", activeAdvancedSection, activeRouteView, networkSelection, networkSourceFilter, networkStatusFilter, networkDetailTab, queryState, http, networkTesterOpen, networkTesterRevision, networkTesterRun, networkTesterDraft, networkTesterTab) {
|
|
1698
450
|
if (!snapshot.api) {
|
|
1699
|
-
return createComponent(Alert, {
|
|
451
|
+
return (0, import_vobs.createComponent)(import_ui.Alert, {
|
|
1700
452
|
description: "Enable the devtools plugin to inspect the runtime."
|
|
1701
453
|
});
|
|
1702
454
|
}
|
|
@@ -1707,28 +459,28 @@ function renderFocusedSection(snapshot, section, router, activeRouterTab, active
|
|
|
1707
459
|
if (section === "router") return renderRouterSection(router, activeRouterTab, activeRouteView);
|
|
1708
460
|
if (section === "updates") return renderUpdatesSection(snapshot, activeUpdatesTab, query, selection, onFocus);
|
|
1709
461
|
if (section === "components") return renderComponentsSection(snapshot, activeComponentsTab, query, selection, onFocus);
|
|
1710
|
-
if (section === "network") return createComponent(Card, {
|
|
462
|
+
if (section === "network") return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1711
463
|
children: /* @__PURE__ */ __name(() => renderUnifiedNetworkRequests(snapshot.network, snapshot.routerContext?.dataRequests ?? [], query, selection, onFocus, networkSelection, networkSourceFilter, networkStatusFilter, networkDetailTab, snapshot.api, queryState, http, networkTesterOpen, networkTesterRevision, networkTesterRun, networkTesterDraft, snapshot.routerContext?.route, networkTesterTab), "children")
|
|
1712
464
|
});
|
|
1713
|
-
if (section === "errors") return createComponent(Card, {
|
|
465
|
+
if (section === "errors") return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1714
466
|
description: `${snapshot.errors.length} retained unique errors`,
|
|
1715
467
|
children: /* @__PURE__ */ __name(() => renderErrors(filterErrors(snapshot.errors, query), selection, onFocus), "children")
|
|
1716
468
|
});
|
|
1717
469
|
if (section === "advanced") return renderAdvancedSection(snapshot, activeAdvancedSection, query);
|
|
1718
|
-
const list = createElement("div");
|
|
1719
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
470
|
+
const list = (0, import_vobs.createElement)("div");
|
|
471
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1720
472
|
let title = "Recent updates";
|
|
1721
473
|
let description = `${snapshot.updates.length} retained traces`;
|
|
1722
|
-
return createComponent(Card, { title, description, children: /* @__PURE__ */ __name(() => list, "children") });
|
|
474
|
+
return (0, import_vobs.createComponent)(import_ui.Card, { title, description, children: /* @__PURE__ */ __name(() => list, "children") });
|
|
1723
475
|
}
|
|
1724
476
|
__name(renderFocusedSection, "renderFocusedSection");
|
|
1725
477
|
function renderComponentsSection(snapshot, activeTab, query = "", selection = null, onFocus = () => void 0) {
|
|
1726
|
-
const tabs = createComponent(Tabs, {
|
|
478
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1727
479
|
class: "vobs-devtools-router-tabs",
|
|
1728
480
|
variant: "filled",
|
|
1729
481
|
items: [
|
|
1730
482
|
{ id: "tree", label: "Component tree", content: /* @__PURE__ */ __name(() => renderComponentTree(snapshot, query, selection, onFocus), "content") },
|
|
1731
|
-
{ id: "lifecycle", label: "Lifecycle timeline", content: /* @__PURE__ */ __name(() => createComponent(Card, {
|
|
483
|
+
{ id: "lifecycle", label: "Lifecycle timeline", content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1732
484
|
class: "vobs-devtools-lifecycle-card",
|
|
1733
485
|
description: `${snapshot.lifecycle.length} retained runtime events`,
|
|
1734
486
|
children: /* @__PURE__ */ __name(() => renderLifecycleTimeline(snapshot.lifecycle, (section, next) => {
|
|
@@ -1744,19 +496,19 @@ function renderComponentsSection(snapshot, activeTab, query = "", selection = nu
|
|
|
1744
496
|
if (activeTab && isComponentsPanelTab(id)) activeTab.value = id;
|
|
1745
497
|
}, "onChange")
|
|
1746
498
|
});
|
|
1747
|
-
const root = createElement("div");
|
|
1748
|
-
setAttribute(root, "class", "vobs-devtools-components-tabs-wrap");
|
|
1749
|
-
insertBefore(root, tabs, null);
|
|
499
|
+
const root = (0, import_vobs.createElement)("div");
|
|
500
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-components-tabs-wrap");
|
|
501
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1750
502
|
return root;
|
|
1751
503
|
}
|
|
1752
504
|
__name(renderComponentsSection, "renderComponentsSection");
|
|
1753
505
|
function renderComponentTree(snapshot, query, selection, onFocus) {
|
|
1754
506
|
const componentTree = filterComponentTree(snapshot.tree, query);
|
|
1755
|
-
const list = createElement("div");
|
|
1756
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
1757
|
-
for (const node of componentTree) insertBefore(list, renderComponentSummary(node, snapshot, selection, onFocus), null);
|
|
507
|
+
const list = (0, import_vobs.createElement)("div");
|
|
508
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
509
|
+
for (const node of componentTree) (0, import_vobs.insertBefore)(list, renderComponentSummary(node, snapshot, selection, onFocus), null);
|
|
1758
510
|
if (componentTree.length === 0) appendMuted(list, query ? "No components match the search." : "No components recorded.");
|
|
1759
|
-
return createComponent(Card, {
|
|
511
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1760
512
|
class: "vobs-devtools-component-tree-card",
|
|
1761
513
|
description: `Component tree ${snapshot.memory?.ownerCount ?? 0} active owners`,
|
|
1762
514
|
children: /* @__PURE__ */ __name(() => list, "children")
|
|
@@ -1768,7 +520,7 @@ function isComponentsPanelTab(value) {
|
|
|
1768
520
|
}
|
|
1769
521
|
__name(isComponentsPanelTab, "isComponentsPanelTab");
|
|
1770
522
|
function renderUpdatesSection(snapshot, activeTab, query = "", selection = null, onFocus = () => void 0) {
|
|
1771
|
-
const tabs = createComponent(Tabs, {
|
|
523
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1772
524
|
class: "vobs-devtools-router-tabs",
|
|
1773
525
|
variant: "filled",
|
|
1774
526
|
items: [
|
|
@@ -1783,9 +535,9 @@ function renderUpdatesSection(snapshot, activeTab, query = "", selection = null,
|
|
|
1783
535
|
if (activeTab && isUpdatesPanelTab(id)) activeTab.value = id;
|
|
1784
536
|
}, "onChange")
|
|
1785
537
|
});
|
|
1786
|
-
const root = createElement("div");
|
|
1787
|
-
setAttribute(root, "class", "vobs-devtools-updates-tabs-wrap");
|
|
1788
|
-
insertBefore(root, tabs, null);
|
|
538
|
+
const root = (0, import_vobs.createElement)("div");
|
|
539
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-updates-tabs-wrap");
|
|
540
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1789
541
|
return root;
|
|
1790
542
|
}
|
|
1791
543
|
__name(renderUpdatesSection, "renderUpdatesSection");
|
|
@@ -1794,20 +546,20 @@ function isUpdatesPanelTab(value) {
|
|
|
1794
546
|
}
|
|
1795
547
|
__name(isUpdatesPanelTab, "isUpdatesPanelTab");
|
|
1796
548
|
function renderUpdatesList(snapshot, query, selection, onFocus) {
|
|
1797
|
-
const list = createElement("div");
|
|
1798
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
549
|
+
const list = (0, import_vobs.createElement)("div");
|
|
550
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1799
551
|
for (const update of [...snapshot.updates].reverse().filter((update2) => matchesQuery(query, update2.signalName, update2.signalId, update2.status, formatValue(update2.previousValue), formatValue(update2.nextValue))).slice(0, 50)) {
|
|
1800
|
-
insertBefore(list, renderUpdateRow(update, snapshot.api, selection, onFocus), null);
|
|
552
|
+
(0, import_vobs.insertBefore)(list, renderUpdateRow(update, snapshot.api, selection, onFocus), null);
|
|
1801
553
|
}
|
|
1802
554
|
if (snapshot.updates.length === 0) appendMuted(list, "Interact with the playground to record updates.");
|
|
1803
|
-
return createComponent(Card, {
|
|
555
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1804
556
|
class: "vobs-devtools-updates-card",
|
|
1805
557
|
children: /* @__PURE__ */ __name(() => list, "children")
|
|
1806
558
|
});
|
|
1807
559
|
}
|
|
1808
560
|
__name(renderUpdatesList, "renderUpdatesList");
|
|
1809
561
|
function renderAdvancedSection(snapshot, activeSection, query = "") {
|
|
1810
|
-
const tabs = createComponent(Tabs, {
|
|
562
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1811
563
|
class: "vobs-devtools-advanced-tabs",
|
|
1812
564
|
variant: "filled",
|
|
1813
565
|
items: [
|
|
@@ -1821,47 +573,47 @@ function renderAdvancedSection(snapshot, activeSection, query = "") {
|
|
|
1821
573
|
if (activeSection) activeSection.value = id;
|
|
1822
574
|
}, "onChange")
|
|
1823
575
|
});
|
|
1824
|
-
const root = createElement("div");
|
|
1825
|
-
setAttribute(root, "class", "vobs-devtools-advanced");
|
|
1826
|
-
insertBefore(root, tabs, null);
|
|
576
|
+
const root = (0, import_vobs.createElement)("div");
|
|
577
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-advanced");
|
|
578
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1827
579
|
return root;
|
|
1828
580
|
}
|
|
1829
581
|
__name(renderAdvancedSection, "renderAdvancedSection");
|
|
1830
582
|
function renderSignalsInspector(snapshot, query) {
|
|
1831
|
-
const list = createElement("div");
|
|
1832
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
583
|
+
const list = (0, import_vobs.createElement)("div");
|
|
584
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1833
585
|
const signals = snapshot.signals.filter((signal) => matchesQuery(query, signal.name, signal.component, formatValue(signal.value))).slice(0, 50);
|
|
1834
|
-
for (const signal of signals) insertBefore(list, renderSignalInspector(signal, snapshot.api), null);
|
|
586
|
+
for (const signal of signals) (0, import_vobs.insertBefore)(list, renderSignalInspector(signal, snapshot.api), null);
|
|
1835
587
|
if (signals.length === 0) appendMuted(list, query ? "No signals match the search." : "No signals recorded.");
|
|
1836
588
|
return list;
|
|
1837
589
|
}
|
|
1838
590
|
__name(renderSignalsInspector, "renderSignalsInspector");
|
|
1839
591
|
function renderEffectsInspector(snapshot, query) {
|
|
1840
|
-
const list = createElement("div");
|
|
1841
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
592
|
+
const list = (0, import_vobs.createElement)("div");
|
|
593
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1842
594
|
const effects = snapshot.effects.filter((effect2) => matchesQuery(query, effect2.name, effect2.component, effect2.id)).slice(0, 50);
|
|
1843
|
-
for (const effect2 of effects) insertBefore(list, renderEffectRow(effect2), null);
|
|
595
|
+
for (const effect2 of effects) (0, import_vobs.insertBefore)(list, renderEffectRow(effect2), null);
|
|
1844
596
|
if (effects.length === 0) appendMuted(list, query ? "No effects match the search." : "No effects recorded.");
|
|
1845
597
|
return list;
|
|
1846
598
|
}
|
|
1847
599
|
__name(renderEffectsInspector, "renderEffectsInspector");
|
|
1848
600
|
function renderPerformanceMetrics(metrics) {
|
|
1849
601
|
if (!metrics) {
|
|
1850
|
-
return createComponent(Card, { description: "Performance: Lightweight slow-path summary for the retained diagnostics.", children: /* @__PURE__ */ __name(() => {
|
|
1851
|
-
const root = createElement("div");
|
|
602
|
+
return (0, import_vobs.createComponent)(import_ui.Card, { description: "Performance: Lightweight slow-path summary for the retained diagnostics.", children: /* @__PURE__ */ __name(() => {
|
|
603
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1852
604
|
appendMuted(root, "No performance data available.");
|
|
1853
605
|
return root;
|
|
1854
606
|
}, "children") });
|
|
1855
607
|
}
|
|
1856
|
-
const metricsGrid = createElement("div");
|
|
1857
|
-
setAttribute(metricsGrid, "class", "vobs-devtools-performance-metrics");
|
|
608
|
+
const metricsGrid = (0, import_vobs.createElement)("div");
|
|
609
|
+
(0, import_vobs.setAttribute)(metricsGrid, "class", "vobs-devtools-performance-metrics");
|
|
1858
610
|
appendMetric(metricsGrid, "Slow updates", metrics.slowUpdateCount);
|
|
1859
611
|
appendMetric(metricsGrid, "Slow effects", metrics.slowEffectCount);
|
|
1860
612
|
appendMetric(metricsGrid, "Slow requests", metrics.slowRequestCount);
|
|
1861
613
|
appendMetric(metricsGrid, "Max update", `${metrics.maxUpdateDuration.toFixed(2)} ms`);
|
|
1862
614
|
appendMetric(metricsGrid, "Max effect", `${metrics.maxEffectDuration.toFixed(2)} ms`);
|
|
1863
615
|
appendMetric(metricsGrid, "Max request", `${metrics.maxRequestDuration.toFixed(2)} ms`);
|
|
1864
|
-
return createComponent(Card, {
|
|
616
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1865
617
|
class: "vobs-devtools-performance-card",
|
|
1866
618
|
description: "Lightweight slow-path summary for the retained diagnostics.",
|
|
1867
619
|
children: /* @__PURE__ */ __name(() => metricsGrid, "children")
|
|
@@ -1870,18 +622,18 @@ function renderPerformanceMetrics(metrics) {
|
|
|
1870
622
|
__name(renderPerformanceMetrics, "renderPerformanceMetrics");
|
|
1871
623
|
function renderSlowItems(entries) {
|
|
1872
624
|
const slowEntries = entries.filter((entry) => entry.duration >= 16).slice(0, 8);
|
|
1873
|
-
const slowList = createElement("div");
|
|
1874
|
-
setAttribute(slowList, "class", "vobs-devtools-performance-slow-list");
|
|
625
|
+
const slowList = (0, import_vobs.createElement)("div");
|
|
626
|
+
(0, import_vobs.setAttribute)(slowList, "class", "vobs-devtools-performance-slow-list");
|
|
1875
627
|
for (const entry of slowEntries) {
|
|
1876
|
-
const item = createElement("div");
|
|
1877
|
-
setAttribute(item, "class", "vobs-devtools-performance-slow-item");
|
|
628
|
+
const item = (0, import_vobs.createElement)("div");
|
|
629
|
+
(0, import_vobs.setAttribute)(item, "class", "vobs-devtools-performance-slow-item");
|
|
1878
630
|
appendText(item, entry.kind, "vobs-devtools-muted");
|
|
1879
631
|
appendText(item, formatPerformanceLabel(entry), "vobs-devtools-list__name");
|
|
1880
632
|
appendText(item, `${entry.duration.toFixed(2)} ms`, "vobs-devtools-code");
|
|
1881
|
-
insertBefore(slowList, item, null);
|
|
633
|
+
(0, import_vobs.insertBefore)(slowList, item, null);
|
|
1882
634
|
}
|
|
1883
635
|
if (slowEntries.length === 0) appendMuted(slowList, "No slow items recorded.");
|
|
1884
|
-
return createComponent(Card, {
|
|
636
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1885
637
|
class: "vobs-devtools-performance-slow-card",
|
|
1886
638
|
description: slowEntries.length ? `${slowEntries.length} retained item${slowEntries.length === 1 ? "" : "s"} at or above 16 ms.` : void 0,
|
|
1887
639
|
children: /* @__PURE__ */ __name(() => slowList, "children")
|
|
@@ -1902,37 +654,37 @@ function formatPerformanceLabel(entry) {
|
|
|
1902
654
|
}
|
|
1903
655
|
__name(formatPerformanceLabel, "formatPerformanceLabel");
|
|
1904
656
|
function appendMetric(parent, label, value) {
|
|
1905
|
-
const row = createElement("div");
|
|
1906
|
-
setAttribute(row, "class", "vobs-devtools-performance-item");
|
|
657
|
+
const row = (0, import_vobs.createElement)("div");
|
|
658
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-performance-item");
|
|
1907
659
|
appendText(row, label, "vobs-devtools-muted");
|
|
1908
660
|
appendText(row, String(value), "vobs-devtools-list__name");
|
|
1909
|
-
insertBefore(parent, row, null);
|
|
661
|
+
(0, import_vobs.insertBefore)(parent, row, null);
|
|
1910
662
|
}
|
|
1911
663
|
__name(appendMetric, "appendMetric");
|
|
1912
664
|
function renderRouterSection(router, activeRouterTab, activeRouteView) {
|
|
1913
|
-
if (!router) return createComponent(Alert, { tone: "warning", title: "Router unavailable", description: "Pass a Router instance to inspect route activity." });
|
|
665
|
+
if (!router) return (0, import_vobs.createComponent)(import_ui.Alert, { tone: "warning", title: "Router unavailable", description: "Pass a Router instance to inspect route activity." });
|
|
1914
666
|
const devtools = router.devtools;
|
|
1915
|
-
const root = createElement("div");
|
|
1916
|
-
setAttribute(root, "class", "vobs-devtools-router");
|
|
667
|
+
const root = (0, import_vobs.createElement)("div");
|
|
668
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-router");
|
|
1917
669
|
const current = devtools.getCurrentRoute();
|
|
1918
670
|
const state2 = devtools.getNavigationState();
|
|
1919
671
|
const metrics = devtools.getPerformanceMetrics();
|
|
1920
672
|
const activeRequests = devtools.getDataRequests().filter((request) => request.route === current.fullPath || request.key.startsWith(`${current.fullPath}#`));
|
|
1921
673
|
const activeErrors = devtools.getErrors().filter((error) => error.route === current.fullPath);
|
|
1922
|
-
const toolbar = createElement("div");
|
|
1923
|
-
setAttribute(toolbar, "class", "vobs-devtools-panel__toolbar");
|
|
1924
|
-
insertBefore(toolbar, createComponent(Button, { variant: "secondary", icon: createComponent(Icon, { name: "refresh" }), children: /* @__PURE__ */ __name(() => "Revalidate current route", "children"), onClick: /* @__PURE__ */ __name(() => {
|
|
674
|
+
const toolbar = (0, import_vobs.createElement)("div");
|
|
675
|
+
(0, import_vobs.setAttribute)(toolbar, "class", "vobs-devtools-panel__toolbar");
|
|
676
|
+
(0, import_vobs.insertBefore)(toolbar, (0, import_vobs.createComponent)(import_ui.Button, { variant: "secondary", icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "refresh" }), children: /* @__PURE__ */ __name(() => "Revalidate current route", "children"), onClick: /* @__PURE__ */ __name(() => {
|
|
1925
677
|
void devtools.revalidate(current.fullPath);
|
|
1926
678
|
}, "onClick") }), null);
|
|
1927
|
-
const tabs = createComponent(Tabs, {
|
|
679
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1928
680
|
class: "vobs-devtools-router-tabs",
|
|
1929
681
|
variant: "filled",
|
|
1930
682
|
items: [
|
|
1931
683
|
{ id: "context", label: "Context", content: /* @__PURE__ */ __name(() => createRouterContextPanel(current, state2), "content") },
|
|
1932
|
-
{ id: "requests", label: `Requests${activeRequests.length ? ` (${activeRequests.length})` : ""}`, content: /* @__PURE__ */ __name(() => createComponent(Card, { title: `Data requests for ${current.path}`, description: "Loader, action and fetcher traces for the active route.", children: /* @__PURE__ */ __name(() => renderDataRequests(activeRequests), "children") }), "content") },
|
|
1933
|
-
{ id: "errors", label: `Errors${activeErrors.length ? ` (${activeErrors.length})` : ""}`, content: /* @__PURE__ */ __name(() => createComponent(Card, { title: `Errors for ${current.path}`, description: `${activeErrors.length} errors captured for the active route.`, children: /* @__PURE__ */ __name(() => renderRouterErrors(activeErrors), "children") }), "content") },
|
|
1934
|
-
{ id: "history", label: "History", content: /* @__PURE__ */ __name(() => createComponent(Card, { title: "Navigation history", description: `${metrics.navigationCount} recorded navigations \xB7 ${metrics.averageNavigationDuration.toFixed(2)} ms average`, children: /* @__PURE__ */ __name(() => renderNavigationHistory(devtools.getNavigationHistory(), router), "children") }), "content") },
|
|
1935
|
-
{ id: "routes", label: "Route map", content: /* @__PURE__ */ __name(() => createComponent(Card, {
|
|
684
|
+
{ id: "requests", label: `Requests${activeRequests.length ? ` (${activeRequests.length})` : ""}`, content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, { title: `Data requests for ${current.path}`, description: "Loader, action and fetcher traces for the active route.", children: /* @__PURE__ */ __name(() => renderDataRequests(activeRequests), "children") }), "content") },
|
|
685
|
+
{ id: "errors", label: `Errors${activeErrors.length ? ` (${activeErrors.length})` : ""}`, content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, { title: `Errors for ${current.path}`, description: `${activeErrors.length} errors captured for the active route.`, children: /* @__PURE__ */ __name(() => renderRouterErrors(activeErrors), "children") }), "content") },
|
|
686
|
+
{ id: "history", label: "History", content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, { title: "Navigation history", description: `${metrics.navigationCount} recorded navigations \xB7 ${metrics.averageNavigationDuration.toFixed(2)} ms average`, children: /* @__PURE__ */ __name(() => renderNavigationHistory(devtools.getNavigationHistory(), router), "children") }), "content") },
|
|
687
|
+
{ id: "routes", label: "Route map", content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1936
688
|
title: "Route map",
|
|
1937
689
|
description: "All registered routes and their source locations.",
|
|
1938
690
|
children: /* @__PURE__ */ __name(() => renderRouteMap(devtools.getRouteTree(), router, activeRouteView), "children")
|
|
@@ -1945,109 +697,109 @@ function renderRouterSection(router, activeRouterTab, activeRouteView) {
|
|
|
1945
697
|
if (activeRouterTab) activeRouterTab.value = id;
|
|
1946
698
|
}, "onChange")
|
|
1947
699
|
});
|
|
1948
|
-
const tabsWrap = createElement("div");
|
|
1949
|
-
setAttribute(tabsWrap, "class", "vobs-devtools-router-tabs-wrap");
|
|
1950
|
-
insertBefore(tabsWrap, tabs, null);
|
|
1951
|
-
insertBefore(tabsWrap, toolbar, null);
|
|
1952
|
-
insertBefore(root, tabsWrap, null);
|
|
700
|
+
const tabsWrap = (0, import_vobs.createElement)("div");
|
|
701
|
+
(0, import_vobs.setAttribute)(tabsWrap, "class", "vobs-devtools-router-tabs-wrap");
|
|
702
|
+
(0, import_vobs.insertBefore)(tabsWrap, tabs, null);
|
|
703
|
+
(0, import_vobs.insertBefore)(tabsWrap, toolbar, null);
|
|
704
|
+
(0, import_vobs.insertBefore)(root, tabsWrap, null);
|
|
1953
705
|
return root;
|
|
1954
706
|
}
|
|
1955
707
|
__name(renderRouterSection, "renderRouterSection");
|
|
1956
708
|
function createRouterContextPanel(current, state2) {
|
|
1957
|
-
return createFragment((parent, anchor) => {
|
|
1958
|
-
insertBefore(parent, createComponent(Card, { title: "Active route", children: /* @__PURE__ */ __name(() => renderRouterLocation(current, state2), "children") }), anchor);
|
|
1959
|
-
insertBefore(parent, createComponent(Card, { title: "Matched route structure", children: /* @__PURE__ */ __name(() => renderMatchedRoutes(current.matched), "children") }), anchor);
|
|
709
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
710
|
+
(0, import_vobs.insertBefore)(parent, (0, import_vobs.createComponent)(import_ui.Card, { title: "Active route", children: /* @__PURE__ */ __name(() => renderRouterLocation(current, state2), "children") }), anchor);
|
|
711
|
+
(0, import_vobs.insertBefore)(parent, (0, import_vobs.createComponent)(import_ui.Card, { title: "Matched route structure", children: /* @__PURE__ */ __name(() => renderMatchedRoutes(current.matched), "children") }), anchor);
|
|
1960
712
|
});
|
|
1961
713
|
}
|
|
1962
714
|
__name(createRouterContextPanel, "createRouterContextPanel");
|
|
1963
715
|
function renderDataRequests(requests) {
|
|
1964
|
-
const root = createElement("div");
|
|
1965
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
716
|
+
const root = (0, import_vobs.createElement)("div");
|
|
717
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
1966
718
|
for (const request of [...requests].reverse().slice(0, 30)) {
|
|
1967
|
-
const row = createElement("details");
|
|
1968
|
-
setAttribute(row, "class", "vobs-devtools-list__row");
|
|
1969
|
-
const summary = createElement("summary");
|
|
719
|
+
const row = (0, import_vobs.createElement)("details");
|
|
720
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row");
|
|
721
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
1970
722
|
appendText(summary, `${request.kind} \xB7 ${request.key}`, "vobs-devtools-list__name");
|
|
1971
|
-
insertBefore(summary, createComponent(Tag, { tone: request.status === "success" ? "success" : request.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => request.status, "children") }), null);
|
|
723
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: request.status === "success" ? "success" : request.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => request.status, "children") }), null);
|
|
1972
724
|
appendText(summary, request.duration === void 0 ? "running" : `${request.duration.toFixed(2)} ms`);
|
|
1973
|
-
insertBefore(row, summary, null);
|
|
725
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
1974
726
|
if (request.error) appendText(row, request.error);
|
|
1975
|
-
if (request.status === "success" && request.result !== void 0) insertBefore(row, renderInspectableValue("Result", request.result), null);
|
|
1976
|
-
insertBefore(root, row, null);
|
|
727
|
+
if (request.status === "success" && request.result !== void 0) (0, import_vobs.insertBefore)(row, renderInspectableValue("Result", request.result), null);
|
|
728
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
1977
729
|
}
|
|
1978
730
|
if (requests.length === 0) appendMuted(root, "No data requests recorded.");
|
|
1979
731
|
return root;
|
|
1980
732
|
}
|
|
1981
733
|
__name(renderDataRequests, "renderDataRequests");
|
|
1982
734
|
function renderRouterErrors(errors) {
|
|
1983
|
-
const root = createElement("div");
|
|
1984
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
735
|
+
const root = (0, import_vobs.createElement)("div");
|
|
736
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
1985
737
|
for (const error of [...errors].reverse().slice(0, 30)) {
|
|
1986
|
-
const row = createElement("details");
|
|
1987
|
-
setAttribute(row, "class", "vobs-devtools-list__row vobs-devtools-error-row");
|
|
1988
|
-
const summary = createElement("summary");
|
|
738
|
+
const row = (0, import_vobs.createElement)("details");
|
|
739
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row vobs-devtools-error-row");
|
|
740
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
1989
741
|
appendText(summary, `${error.phase} \xB7 ${error.route}`, "vobs-devtools-list__name");
|
|
1990
742
|
appendText(summary, error.message);
|
|
1991
|
-
insertBefore(row, summary, null);
|
|
743
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
1992
744
|
if (error.stack) appendText(row, error.stack, "vobs-devtools-code");
|
|
1993
|
-
insertBefore(root, row, null);
|
|
745
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
1994
746
|
}
|
|
1995
747
|
if (errors.length === 0) appendMuted(root, "No route errors recorded.");
|
|
1996
748
|
return root;
|
|
1997
749
|
}
|
|
1998
750
|
__name(renderRouterErrors, "renderRouterErrors");
|
|
1999
751
|
function renderRouterLocation(route, state2) {
|
|
2000
|
-
const root = createElement("div");
|
|
2001
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
2002
|
-
const statusRow = createElement("div");
|
|
2003
|
-
setAttribute(statusRow, "class", "vobs-devtools-list__row");
|
|
752
|
+
const root = (0, import_vobs.createElement)("div");
|
|
753
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
754
|
+
const statusRow = (0, import_vobs.createElement)("div");
|
|
755
|
+
(0, import_vobs.setAttribute)(statusRow, "class", "vobs-devtools-list__row");
|
|
2004
756
|
appendText(statusRow, route.fullPath, "vobs-devtools-list__name");
|
|
2005
|
-
insertBefore(statusRow, createComponent(Tag, { tone: state2.status === "error" ? "danger" : state2.status === "loading" ? "warning" : "success", children: /* @__PURE__ */ __name(() => state2.status, "children") }), null);
|
|
757
|
+
(0, import_vobs.insertBefore)(statusRow, (0, import_vobs.createComponent)(import_ui.Tag, { tone: state2.status === "error" ? "danger" : state2.status === "loading" ? "warning" : "success", children: /* @__PURE__ */ __name(() => state2.status, "children") }), null);
|
|
2006
758
|
if (state2.status === "loading") appendText(statusRow, `to ${state2.to}`);
|
|
2007
759
|
if (state2.error) appendText(statusRow, state2.error);
|
|
2008
|
-
insertBefore(root, statusRow, null);
|
|
2009
|
-
insertBefore(root, renderInspectableValue("Params", route.params), null);
|
|
2010
|
-
insertBefore(root, renderInspectableValue("Query", route.query), null);
|
|
2011
|
-
insertBefore(root, renderInspectableValue("Meta", route.meta), null);
|
|
760
|
+
(0, import_vobs.insertBefore)(root, statusRow, null);
|
|
761
|
+
(0, import_vobs.insertBefore)(root, renderInspectableValue("Params", route.params), null);
|
|
762
|
+
(0, import_vobs.insertBefore)(root, renderInspectableValue("Query", route.query), null);
|
|
763
|
+
(0, import_vobs.insertBefore)(root, renderInspectableValue("Meta", route.meta), null);
|
|
2012
764
|
appendText(root, `outlet ${route.matched.map((record) => record.path ?? "(layout)").join(" > ")}`);
|
|
2013
765
|
return root;
|
|
2014
766
|
}
|
|
2015
767
|
__name(renderRouterLocation, "renderRouterLocation");
|
|
2016
768
|
function renderMatchedRoutes(records) {
|
|
2017
|
-
const root = createElement("div");
|
|
2018
|
-
setAttribute(root, "class", "vobs-devtools-route-tree");
|
|
769
|
+
const root = (0, import_vobs.createElement)("div");
|
|
770
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-route-tree");
|
|
2019
771
|
records.forEach((record, index) => {
|
|
2020
|
-
const row = createElement("div");
|
|
2021
|
-
setAttribute(row, "class", "vobs-devtools-route-node");
|
|
2022
|
-
setAttribute(row, "style", `--route-depth: ${index}`);
|
|
772
|
+
const row = (0, import_vobs.createElement)("div");
|
|
773
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-route-node");
|
|
774
|
+
(0, import_vobs.setAttribute)(row, "style", `--route-depth: ${index}`);
|
|
2023
775
|
appendText(row, record.path ?? "(layout)", "vobs-devtools-list__name");
|
|
2024
776
|
appendText(row, routeComponentName(record));
|
|
2025
777
|
if (record.source) appendText(row, record.source, "vobs-devtools-code");
|
|
2026
|
-
if (record.loader) insertBefore(row, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "loader", "children") }), null);
|
|
2027
|
-
if (record.action) insertBefore(row, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "action", "children") }), null);
|
|
2028
|
-
insertBefore(root, row, null);
|
|
778
|
+
if (record.loader) (0, import_vobs.insertBefore)(row, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "loader", "children") }), null);
|
|
779
|
+
if (record.action) (0, import_vobs.insertBefore)(row, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "action", "children") }), null);
|
|
780
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2029
781
|
});
|
|
2030
782
|
if (records.length === 0) appendMuted(root, "No matched route records.");
|
|
2031
783
|
return root;
|
|
2032
784
|
}
|
|
2033
785
|
__name(renderMatchedRoutes, "renderMatchedRoutes");
|
|
2034
786
|
function renderRouteMap(nodes, router, activeRouteView) {
|
|
2035
|
-
const tree = createElement("div");
|
|
2036
|
-
setAttribute(tree, "class", "vobs-devtools-route-tree");
|
|
2037
|
-
const controls = createElement("div");
|
|
2038
|
-
setAttribute(controls, "class", "vobs-devtools-route-view-toggle");
|
|
787
|
+
const tree = (0, import_vobs.createElement)("div");
|
|
788
|
+
(0, import_vobs.setAttribute)(tree, "class", "vobs-devtools-route-tree");
|
|
789
|
+
const controls = (0, import_vobs.createElement)("div");
|
|
790
|
+
(0, import_vobs.setAttribute)(controls, "class", "vobs-devtools-route-view-toggle");
|
|
2039
791
|
for (const mode of ["tree", "list"]) {
|
|
2040
|
-
const button = createElement("button");
|
|
2041
|
-
setAttribute(button, "class", `vobs-devtools-control${(activeRouteView?.value ?? "tree") === mode ? " is-active" : ""}`);
|
|
2042
|
-
setAttribute(button, "type", "button");
|
|
2043
|
-
setAttribute(button, "aria-pressed", (activeRouteView?.value ?? "tree") === mode ? "true" : "false");
|
|
2044
|
-
insertBefore(button, createText(mode === "tree" ? "Tree" : "List"), null);
|
|
792
|
+
const button = (0, import_vobs.createElement)("button");
|
|
793
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-control${(activeRouteView?.value ?? "tree") === mode ? " is-active" : ""}`);
|
|
794
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
795
|
+
(0, import_vobs.setAttribute)(button, "aria-pressed", (activeRouteView?.value ?? "tree") === mode ? "true" : "false");
|
|
796
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)(mode === "tree" ? "Tree" : "List"), null);
|
|
2045
797
|
button.addEventListener("click", () => {
|
|
2046
798
|
if (activeRouteView) activeRouteView.value = mode;
|
|
2047
799
|
});
|
|
2048
|
-
insertBefore(controls, button, null);
|
|
800
|
+
(0, import_vobs.insertBefore)(controls, button, null);
|
|
2049
801
|
}
|
|
2050
|
-
insertBefore(tree, controls, null);
|
|
802
|
+
(0, import_vobs.insertBefore)(tree, controls, null);
|
|
2051
803
|
const currentPath = router.currentRoute.value.path;
|
|
2052
804
|
if ((activeRouteView?.value ?? "tree") === "list") {
|
|
2053
805
|
for (const node of flattenRouteNodes(nodes)) appendRouteConfigNode(tree, node, 0, router, currentPath);
|
|
@@ -2069,20 +821,20 @@ function flattenRouteNodes(nodes) {
|
|
|
2069
821
|
__name(flattenRouteNodes, "flattenRouteNodes");
|
|
2070
822
|
function appendRouteConfigNode(parent, node, depth, router, currentPath) {
|
|
2071
823
|
const concrete = node.children.length === 0 && !node.path.includes(":") && !node.path.includes("*");
|
|
2072
|
-
const row = createElement(concrete ? "button" : "div");
|
|
2073
|
-
setAttribute(row, "class", `vobs-devtools-route-node${concrete && node.path === currentPath ? " is-active" : ""}`);
|
|
2074
|
-
setAttribute(row, "style", `--route-depth: ${depth}`);
|
|
824
|
+
const row = (0, import_vobs.createElement)(concrete ? "button" : "div");
|
|
825
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-route-node${concrete && node.path === currentPath ? " is-active" : ""}`);
|
|
826
|
+
(0, import_vobs.setAttribute)(row, "style", `--route-depth: ${depth}`);
|
|
2075
827
|
appendText(row, node.path, "vobs-devtools-list__name");
|
|
2076
828
|
appendText(row, node.component);
|
|
2077
829
|
if (node.source) appendText(row, node.source, "vobs-devtools-code");
|
|
2078
830
|
if (concrete) {
|
|
2079
|
-
setAttribute(row, "type", "button");
|
|
2080
|
-
setAttribute(row, "title", `Navigate to ${node.path}`);
|
|
831
|
+
(0, import_vobs.setAttribute)(row, "type", "button");
|
|
832
|
+
(0, import_vobs.setAttribute)(row, "title", `Navigate to ${node.path}`);
|
|
2081
833
|
row.addEventListener("click", () => {
|
|
2082
834
|
void router.push(node.path);
|
|
2083
835
|
});
|
|
2084
836
|
}
|
|
2085
|
-
insertBefore(parent, row, null);
|
|
837
|
+
(0, import_vobs.insertBefore)(parent, row, null);
|
|
2086
838
|
for (const child of node.children) appendRouteConfigNode(parent, child, depth + 1, router, currentPath);
|
|
2087
839
|
}
|
|
2088
840
|
__name(appendRouteConfigNode, "appendRouteConfigNode");
|
|
@@ -2094,62 +846,62 @@ function routeComponentName(record) {
|
|
|
2094
846
|
}
|
|
2095
847
|
__name(routeComponentName, "routeComponentName");
|
|
2096
848
|
function renderNavigationHistory(history, router) {
|
|
2097
|
-
const root = createElement("div");
|
|
2098
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
849
|
+
const root = (0, import_vobs.createElement)("div");
|
|
850
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
2099
851
|
for (const trace of [...history].reverse().slice(0, 30)) {
|
|
2100
|
-
const row = createElement("button");
|
|
2101
|
-
setAttribute(row, "class", "vobs-devtools-list__row");
|
|
2102
|
-
setAttribute(row, "type", "button");
|
|
2103
|
-
setAttribute(row, "title", `Replay ${trace.to}`);
|
|
852
|
+
const row = (0, import_vobs.createElement)("button");
|
|
853
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row");
|
|
854
|
+
(0, import_vobs.setAttribute)(row, "type", "button");
|
|
855
|
+
(0, import_vobs.setAttribute)(row, "title", `Replay ${trace.to}`);
|
|
2104
856
|
appendText(row, `${trace.from} \u2192 ${trace.to}`, "vobs-devtools-list__name");
|
|
2105
|
-
insertBefore(row, createComponent(Tag, { tone: trace.status === "success" ? "success" : trace.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => trace.status, "children") }), null);
|
|
857
|
+
(0, import_vobs.insertBefore)(row, (0, import_vobs.createComponent)(import_ui.Tag, { tone: trace.status === "success" ? "success" : trace.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => trace.status, "children") }), null);
|
|
2106
858
|
appendText(row, `${trace.duration.toFixed(2)} ms \xB7 ${trace.source}`);
|
|
2107
859
|
row.addEventListener("click", () => {
|
|
2108
860
|
void router.push(trace.to);
|
|
2109
861
|
});
|
|
2110
|
-
insertBefore(root, row, null);
|
|
862
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2111
863
|
}
|
|
2112
864
|
if (history.length === 0) appendMuted(root, "No navigation history recorded.");
|
|
2113
865
|
return root;
|
|
2114
866
|
}
|
|
2115
867
|
__name(renderNavigationHistory, "renderNavigationHistory");
|
|
2116
868
|
function appendMuted(parent, value) {
|
|
2117
|
-
const node = createElement("span");
|
|
2118
|
-
setAttribute(node, "class", "vobs-devtools-muted");
|
|
2119
|
-
insertBefore(node, createText(value), null);
|
|
2120
|
-
insertBefore(parent, node, null);
|
|
869
|
+
const node = (0, import_vobs.createElement)("span");
|
|
870
|
+
(0, import_vobs.setAttribute)(node, "class", "vobs-devtools-muted");
|
|
871
|
+
(0, import_vobs.insertBefore)(node, (0, import_vobs.createText)(value), null);
|
|
872
|
+
(0, import_vobs.insertBefore)(parent, node, null);
|
|
2121
873
|
}
|
|
2122
874
|
__name(appendMuted, "appendMuted");
|
|
2123
875
|
function renderSignalInspector(signal, api) {
|
|
2124
|
-
const row = createElement("details");
|
|
2125
|
-
setAttribute(row, "class", "vobs-devtools-list__row vobs-devtools-signal-row");
|
|
2126
|
-
const summary = createElement("summary");
|
|
876
|
+
const row = (0, import_vobs.createElement)("details");
|
|
877
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row vobs-devtools-signal-row");
|
|
878
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2127
879
|
appendText(summary, displaySignalName(signal), "vobs-devtools-list__name");
|
|
2128
880
|
appendText(summary, previewValue(signal.value), "vobs-devtools-code");
|
|
2129
|
-
insertBefore(summary, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${signal.subscribers} subscribers`, "children") }), null);
|
|
2130
|
-
insertBefore(row, summary, null);
|
|
881
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${signal.subscribers} subscribers`, "children") }), null);
|
|
882
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2131
883
|
if (!api) return row;
|
|
2132
884
|
const dependencies = api.getDependencies(signal.id);
|
|
2133
885
|
const dependents = api.getDependents(signal.id);
|
|
2134
|
-
insertBefore(row, renderInspectableValue("Current value", signal.value), null);
|
|
886
|
+
(0, import_vobs.insertBefore)(row, renderInspectableValue("Current value", signal.value), null);
|
|
2135
887
|
appendText(row, `${dependencies.length} dependencies \xB7 ${dependents.length} dependents`, "vobs-devtools-muted");
|
|
2136
|
-
if (api.canMutate() && signal.kind !== "memo") insertBefore(row, renderSignalMutationControl(signal, api), null);
|
|
888
|
+
if (api.canMutate() && signal.kind !== "memo") (0, import_vobs.insertBefore)(row, renderSignalMutationControl(signal, api), null);
|
|
2137
889
|
return row;
|
|
2138
890
|
}
|
|
2139
891
|
__name(renderSignalInspector, "renderSignalInspector");
|
|
2140
892
|
function renderSignalMutationControl(signal, api) {
|
|
2141
|
-
const root = createElement("div");
|
|
2142
|
-
setAttribute(root, "class", "vobs-devtools-mutation-control");
|
|
893
|
+
const root = (0, import_vobs.createElement)("div");
|
|
894
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-mutation-control");
|
|
2143
895
|
appendText(root, "Debug-only value edit (may trigger effects and requests).", "vobs-devtools-muted");
|
|
2144
|
-
const input = createElement("input");
|
|
2145
|
-
setAttribute(input, "class", "vobs-devtools-search");
|
|
2146
|
-
setAttribute(input, "type", "text");
|
|
2147
|
-
setAttribute(input, "aria-label", `Edit ${signal.name}`);
|
|
2148
|
-
setProperty(input, "value", formatValue(signal.value));
|
|
2149
|
-
const button = createElement("button");
|
|
2150
|
-
setAttribute(button, "class", "vobs-devtools-control");
|
|
2151
|
-
setAttribute(button, "type", "button");
|
|
2152
|
-
insertBefore(button, createText("Apply debug value"), null);
|
|
896
|
+
const input = (0, import_vobs.createElement)("input");
|
|
897
|
+
(0, import_vobs.setAttribute)(input, "class", "vobs-devtools-search");
|
|
898
|
+
(0, import_vobs.setAttribute)(input, "type", "text");
|
|
899
|
+
(0, import_vobs.setAttribute)(input, "aria-label", `Edit ${signal.name}`);
|
|
900
|
+
(0, import_vobs.setProperty)(input, "value", formatValue(signal.value));
|
|
901
|
+
const button = (0, import_vobs.createElement)("button");
|
|
902
|
+
(0, import_vobs.setAttribute)(button, "class", "vobs-devtools-control");
|
|
903
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
904
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)("Apply debug value"), null);
|
|
2153
905
|
button.addEventListener("click", (event) => {
|
|
2154
906
|
event.stopPropagation();
|
|
2155
907
|
const raw = input.value;
|
|
@@ -2160,21 +912,21 @@ function renderSignalMutationControl(signal, api) {
|
|
|
2160
912
|
}
|
|
2161
913
|
api.setSignalValue(signal.id, value);
|
|
2162
914
|
});
|
|
2163
|
-
insertBefore(root, input, null);
|
|
2164
|
-
insertBefore(root, button, null);
|
|
915
|
+
(0, import_vobs.insertBefore)(root, input, null);
|
|
916
|
+
(0, import_vobs.insertBefore)(root, button, null);
|
|
2165
917
|
return root;
|
|
2166
918
|
}
|
|
2167
919
|
__name(renderSignalMutationControl, "renderSignalMutationControl");
|
|
2168
920
|
function renderEffectRow(effect2) {
|
|
2169
|
-
const row = createElement("details");
|
|
2170
|
-
setAttribute(row, "class", "vobs-devtools-list__row");
|
|
2171
|
-
const summary = createElement("summary");
|
|
921
|
+
const row = (0, import_vobs.createElement)("details");
|
|
922
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row");
|
|
923
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2172
924
|
const component = formatDebugLocation(effect2.component);
|
|
2173
925
|
appendText(summary, effect2.name || `${debugComponentName(component)} effect`, "vobs-devtools-list__name");
|
|
2174
926
|
appendText(summary, formatDebugSource(component));
|
|
2175
|
-
insertBefore(summary, createComponent(Tag, { tone: effect2.status === "success" || effect2.status === "idle" ? "success" : effect2.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => effect2.status, "children") }), null);
|
|
927
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: effect2.status === "success" || effect2.status === "idle" ? "success" : effect2.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => effect2.status, "children") }), null);
|
|
2176
928
|
appendText(summary, `${effect2.executionCount} runs`);
|
|
2177
|
-
insertBefore(row, summary, null);
|
|
929
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2178
930
|
appendText(row, `${effect2.dependencies.length} dependencies`, "vobs-devtools-muted");
|
|
2179
931
|
if (effect2.lastExecutionTime > 0) appendText(row, `last execution ${effect2.lastDuration?.toFixed(2) ?? "0.00"} ms \xB7 ${effect2.lastRunStatus ?? "unknown"} \xB7 ${effect2.lastDomUpdates ?? 0} DOM updates`, "vobs-devtools-muted");
|
|
2180
932
|
if (effect2.lastUpdateId) appendText(row, `last update ${effect2.lastUpdateId}`, "vobs-devtools-code");
|
|
@@ -2183,43 +935,43 @@ function renderEffectRow(effect2) {
|
|
|
2183
935
|
}
|
|
2184
936
|
__name(renderEffectRow, "renderEffectRow");
|
|
2185
937
|
function renderUpdateRow(update, api, selection = null, onFocus = () => void 0) {
|
|
2186
|
-
const row = createElement("details");
|
|
938
|
+
const row = (0, import_vobs.createElement)("details");
|
|
2187
939
|
const selected = selection?.type === "update" && selection.id === update.id;
|
|
2188
|
-
setAttribute(row, "class", `vobs-devtools-update-row${selected ? " is-selected" : ""}`);
|
|
2189
|
-
if (selected) setProperty(row, "open", true);
|
|
2190
|
-
const summary = createElement("summary");
|
|
940
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-update-row${selected ? " is-selected" : ""}`);
|
|
941
|
+
if (selected) (0, import_vobs.setProperty)(row, "open", true);
|
|
942
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2191
943
|
summary.addEventListener("click", () => onFocus("updates", { type: "update", id: update.id }));
|
|
2192
944
|
const signal = api?.getSignal(update.signalId);
|
|
2193
945
|
appendText(summary, signal ? displaySignalName(signal) : displayDebugName(update.signalName), "vobs-devtools-list__name");
|
|
2194
946
|
appendText(summary, formatDebugSource(signal?.component ?? "unknown"), "vobs-devtools-update-row__source");
|
|
2195
947
|
appendText(summary, `${update.duration.toFixed(2)} ms`);
|
|
2196
|
-
insertBefore(summary, createComponent(Tag, { tone: update.duration >= 16 ? "warning" : "neutral-strong", children: /* @__PURE__ */ __name(() => `${update.effects.length} effects`, "children") }), null);
|
|
2197
|
-
insertBefore(row, summary, null);
|
|
2198
|
-
insertBefore(row, renderValuePair("Value changed", update.previousValue, update.nextValue), null);
|
|
948
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: update.duration >= 16 ? "warning" : "neutral-strong", children: /* @__PURE__ */ __name(() => `${update.effects.length} effects`, "children") }), null);
|
|
949
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
950
|
+
(0, import_vobs.insertBefore)(row, renderValuePair("Value changed", update.previousValue, update.nextValue), null);
|
|
2199
951
|
appendText(row, `status ${update.status} \xB7 ${update.affectedSignals.length} signals \xB7 ${update.affectedEffects.length} effects`, "vobs-devtools-muted");
|
|
2200
952
|
if (update.error) appendText(row, `${update.error.name}: ${update.error.message}`, "vobs-devtools-error");
|
|
2201
953
|
if (update.effects.length === 0) appendText(row, "No effects executed.", "vobs-devtools-muted");
|
|
2202
954
|
for (const effect2 of update.effects) {
|
|
2203
|
-
insertBefore(row, renderEffectExecution(effect2), null);
|
|
955
|
+
(0, import_vobs.insertBefore)(row, renderEffectExecution(effect2), null);
|
|
2204
956
|
if (effect2.error) appendText(row, `${effect2.error.name}: ${effect2.error.message}`, "vobs-devtools-error");
|
|
2205
957
|
}
|
|
2206
958
|
for (const domUpdate of update.domUpdates) {
|
|
2207
959
|
const operation = domUpdate.key ? `${domUpdate.operation}.${domUpdate.key}` : domUpdate.operation;
|
|
2208
|
-
const mutation = createElement("div");
|
|
2209
|
-
setAttribute(mutation, "class", "vobs-devtools-dom-update");
|
|
960
|
+
const mutation = (0, import_vobs.createElement)("div");
|
|
961
|
+
(0, import_vobs.setAttribute)(mutation, "class", "vobs-devtools-dom-update");
|
|
2210
962
|
appendText(mutation, operation, "vobs-devtools-list__name");
|
|
2211
963
|
appendText(mutation, domUpdate.target, "vobs-devtools-muted");
|
|
2212
964
|
if (domUpdate.previousValue !== void 0 || domUpdate.nextValue !== void 0) {
|
|
2213
|
-
insertBefore(mutation, renderValuePair("", domUpdate.previousValue, domUpdate.nextValue), null);
|
|
965
|
+
(0, import_vobs.insertBefore)(mutation, renderValuePair("", domUpdate.previousValue, domUpdate.nextValue), null);
|
|
2214
966
|
}
|
|
2215
|
-
insertBefore(row, mutation, null);
|
|
967
|
+
(0, import_vobs.insertBefore)(row, mutation, null);
|
|
2216
968
|
}
|
|
2217
969
|
return row;
|
|
2218
970
|
}
|
|
2219
971
|
__name(renderUpdateRow, "renderUpdateRow");
|
|
2220
972
|
function renderEffectExecution(effect2) {
|
|
2221
|
-
const root = createElement("div");
|
|
2222
|
-
setAttribute(root, "class", "vobs-devtools-effect-execution");
|
|
973
|
+
const root = (0, import_vobs.createElement)("div");
|
|
974
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-effect-execution");
|
|
2223
975
|
appendText(root, effect2.effectId, "vobs-devtools-code");
|
|
2224
976
|
appendText(root, `${formatDebugSource(effect2.component)} \xB7 ${effect2.duration.toFixed(2)} ms \xB7 ${effect2.domUpdates} DOM updates \xB7 ${effect2.status ?? "success"}`);
|
|
2225
977
|
return root;
|
|
@@ -2231,39 +983,39 @@ function appendUpdateLinks(parent, ids, onFocus) {
|
|
|
2231
983
|
return;
|
|
2232
984
|
}
|
|
2233
985
|
for (const id of ids) {
|
|
2234
|
-
const button = createElement("button");
|
|
2235
|
-
setAttribute(button, "class", "vobs-devtools-link");
|
|
2236
|
-
setAttribute(button, "type", "button");
|
|
986
|
+
const button = (0, import_vobs.createElement)("button");
|
|
987
|
+
(0, import_vobs.setAttribute)(button, "class", "vobs-devtools-link");
|
|
988
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
2237
989
|
button.addEventListener("click", (event) => {
|
|
2238
990
|
event.stopPropagation();
|
|
2239
991
|
onFocus("updates", { type: "update", id });
|
|
2240
992
|
});
|
|
2241
|
-
insertBefore(button, createText(id), null);
|
|
2242
|
-
insertBefore(parent, button, null);
|
|
993
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)(id), null);
|
|
994
|
+
(0, import_vobs.insertBefore)(parent, button, null);
|
|
2243
995
|
}
|
|
2244
996
|
}
|
|
2245
997
|
__name(appendUpdateLinks, "appendUpdateLinks");
|
|
2246
998
|
function renderLifecycleTimeline(events, onFocus) {
|
|
2247
|
-
const root = createElement("div");
|
|
2248
|
-
setAttribute(root, "class", "vobs-devtools-lifecycle-list");
|
|
999
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1000
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-lifecycle-list");
|
|
2249
1001
|
for (const event of [...events].reverse().slice(0, 40)) {
|
|
2250
1002
|
const selection = lifecycleSelection(event);
|
|
2251
|
-
const row = createElement(selection?.type === "component" ? "button" : "div");
|
|
2252
|
-
setAttribute(row, "class", "vobs-devtools-lifecycle-row");
|
|
2253
|
-
if (selection?.type === "component") setAttribute(row, "type", "button");
|
|
1003
|
+
const row = (0, import_vobs.createElement)(selection?.type === "component" ? "button" : "div");
|
|
1004
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-lifecycle-row");
|
|
1005
|
+
if (selection?.type === "component") (0, import_vobs.setAttribute)(row, "type", "button");
|
|
2254
1006
|
appendText(row, event.type, "vobs-devtools-list__name");
|
|
2255
1007
|
appendText(row, event.name ?? event.targetId);
|
|
2256
1008
|
appendText(row, event.status ?? "", "vobs-devtools-muted");
|
|
2257
1009
|
if (selection?.type === "component") row.addEventListener("click", () => onFocus("components", selection));
|
|
2258
|
-
insertBefore(root, row, null);
|
|
1010
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2259
1011
|
}
|
|
2260
1012
|
if (events.length === 0) appendMuted(root, "No lifecycle events recorded.");
|
|
2261
1013
|
return root;
|
|
2262
1014
|
}
|
|
2263
1015
|
__name(renderLifecycleTimeline, "renderLifecycleTimeline");
|
|
2264
1016
|
function renderUnifiedNetworkRequests(requests, routerRequests, query, selection, onFocus, networkSelection, sourceFilter, statusFilter, detailTab, api, queryState, http, testerOpen, testerRevision, testerRun, testerDraft, currentRoute, testerTab) {
|
|
2265
|
-
const root = createElement("div");
|
|
2266
|
-
setAttribute(root, "class", "vobs-devtools-network-inspector");
|
|
1017
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1018
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-network-inspector");
|
|
2267
1019
|
const activeSource = sourceFilter?.value ?? "all";
|
|
2268
1020
|
const activeStatus = statusFilter?.value ?? "all";
|
|
2269
1021
|
const entries = [
|
|
@@ -2292,19 +1044,19 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2292
1044
|
].filter((entry) => (activeSource === "all" || entry.source === activeSource) && (activeStatus === "all" || entry.status === activeStatus) && matchesQuery(query, entry.method, entry.url, entry.status, entry.source, entry.request?.responseStatus, entry.request?.route, entry.routerRequest?.route)).sort((left, right) => (right.startedAt ?? 0) - (left.startedAt ?? 0));
|
|
2293
1045
|
const selectedKey = (selection?.type === "request" ? `http:${selection.id}` : networkSelection?.value) ?? entries[0]?.key;
|
|
2294
1046
|
const selected = entries.find((entry) => entry.key === selectedKey) ?? entries[0];
|
|
2295
|
-
const controls = createElement("div");
|
|
2296
|
-
setAttribute(controls, "class", "vobs-devtools-network-toolbar");
|
|
1047
|
+
const controls = (0, import_vobs.createElement)("div");
|
|
1048
|
+
(0, import_vobs.setAttribute)(controls, "class", "vobs-devtools-network-toolbar");
|
|
2297
1049
|
appendText(controls, "Search", "vobs-devtools-network-toolbar__label");
|
|
2298
|
-
const search = createElement("input");
|
|
2299
|
-
setAttribute(search, "class", "vobs-devtools-search vobs-devtools-network-toolbar__search");
|
|
2300
|
-
setAttribute(search, "type", "search");
|
|
2301
|
-
setAttribute(search, "placeholder", "Search requests");
|
|
2302
|
-
setProperty(search, "value", query);
|
|
1050
|
+
const search = (0, import_vobs.createElement)("input");
|
|
1051
|
+
(0, import_vobs.setAttribute)(search, "class", "vobs-devtools-search vobs-devtools-network-toolbar__search");
|
|
1052
|
+
(0, import_vobs.setAttribute)(search, "type", "search");
|
|
1053
|
+
(0, import_vobs.setAttribute)(search, "placeholder", "Search requests");
|
|
1054
|
+
(0, import_vobs.setProperty)(search, "value", query);
|
|
2303
1055
|
search.addEventListener("change", () => {
|
|
2304
1056
|
if (queryState) queryState.value = search.value;
|
|
2305
1057
|
});
|
|
2306
|
-
insertBefore(controls, search, null);
|
|
2307
|
-
insertBefore(controls, createNetworkFilterSelect("Source", activeSource, [
|
|
1058
|
+
(0, import_vobs.insertBefore)(controls, search, null);
|
|
1059
|
+
(0, import_vobs.insertBefore)(controls, createNetworkFilterSelect("Source", activeSource, [
|
|
2308
1060
|
["all", "All sources"],
|
|
2309
1061
|
["http", "HTTP"],
|
|
2310
1062
|
["router", "Router"],
|
|
@@ -2312,7 +1064,7 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2312
1064
|
], (value) => {
|
|
2313
1065
|
if (sourceFilter) sourceFilter.value = value;
|
|
2314
1066
|
}), null);
|
|
2315
|
-
insertBefore(controls, createNetworkFilterSelect("Status", activeStatus, [
|
|
1067
|
+
(0, import_vobs.insertBefore)(controls, createNetworkFilterSelect("Status", activeStatus, [
|
|
2316
1068
|
["all", "All statuses"],
|
|
2317
1069
|
["loading", "Loading"],
|
|
2318
1070
|
["success", "Success"],
|
|
@@ -2321,15 +1073,15 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2321
1073
|
], (value) => {
|
|
2322
1074
|
if (statusFilter) statusFilter.value = value;
|
|
2323
1075
|
}), null);
|
|
2324
|
-
if (api) insertBefore(controls, createComponent(Button, {
|
|
1076
|
+
if (api) (0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2325
1077
|
variant: "ghost",
|
|
2326
1078
|
children: /* @__PURE__ */ __name(() => "Clear", "children"),
|
|
2327
1079
|
onClick: /* @__PURE__ */ __name(() => api.clearNetworkRequests(), "onClick")
|
|
2328
1080
|
}), null);
|
|
2329
|
-
if (testerOpen && testerDraft) insertBefore(controls, createComponent(Button, {
|
|
1081
|
+
if (testerOpen && testerDraft) (0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2330
1082
|
variant: "ghost",
|
|
2331
1083
|
iconOnly: true,
|
|
2332
|
-
icon: createComponent(Icon, { name: "settings" }),
|
|
1084
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "settings" }),
|
|
2333
1085
|
"aria-label": "Open Request Tester",
|
|
2334
1086
|
title: "Open Request Tester",
|
|
2335
1087
|
onClick: /* @__PURE__ */ __name(() => {
|
|
@@ -2338,53 +1090,53 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2338
1090
|
testerRevision && testerRevision.value++;
|
|
2339
1091
|
}, "onClick")
|
|
2340
1092
|
}), null);
|
|
2341
|
-
insertBefore(root, controls, null);
|
|
2342
|
-
const panes = createElement("div");
|
|
2343
|
-
setAttribute(panes, "class", "vobs-devtools-network-panes");
|
|
2344
|
-
const listPane = createElement("section");
|
|
2345
|
-
setAttribute(listPane, "class", "vobs-devtools-network-list-pane");
|
|
2346
|
-
setAttribute(listPane, "aria-label", "Network requests");
|
|
2347
|
-
const requestList = createElement("div");
|
|
2348
|
-
setAttribute(requestList, "class", "vobs-devtools-network-request-list");
|
|
2349
|
-
setAttribute(requestList, "role", "list");
|
|
1093
|
+
(0, import_vobs.insertBefore)(root, controls, null);
|
|
1094
|
+
const panes = (0, import_vobs.createElement)("div");
|
|
1095
|
+
(0, import_vobs.setAttribute)(panes, "class", "vobs-devtools-network-panes");
|
|
1096
|
+
const listPane = (0, import_vobs.createElement)("section");
|
|
1097
|
+
(0, import_vobs.setAttribute)(listPane, "class", "vobs-devtools-network-list-pane");
|
|
1098
|
+
(0, import_vobs.setAttribute)(listPane, "aria-label", "Network requests");
|
|
1099
|
+
const requestList = (0, import_vobs.createElement)("div");
|
|
1100
|
+
(0, import_vobs.setAttribute)(requestList, "class", "vobs-devtools-network-request-list");
|
|
1101
|
+
(0, import_vobs.setAttribute)(requestList, "role", "list");
|
|
2350
1102
|
for (const entry of entries) {
|
|
2351
|
-
const row = createElement("button");
|
|
1103
|
+
const row = (0, import_vobs.createElement)("button");
|
|
2352
1104
|
const isSelected = selectedKey === entry.key;
|
|
2353
|
-
setAttribute(row, "class", `vobs-devtools-network-request${isSelected ? " is-selected" : ""}`);
|
|
2354
|
-
setAttribute(row, "type", "button");
|
|
2355
|
-
setAttribute(row, "role", "listitem");
|
|
2356
|
-
setAttribute(row, "aria-pressed", isSelected ? "true" : "false");
|
|
1105
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-network-request${isSelected ? " is-selected" : ""}`);
|
|
1106
|
+
(0, import_vobs.setAttribute)(row, "type", "button");
|
|
1107
|
+
(0, import_vobs.setAttribute)(row, "role", "listitem");
|
|
1108
|
+
(0, import_vobs.setAttribute)(row, "aria-pressed", isSelected ? "true" : "false");
|
|
2357
1109
|
row.addEventListener("click", () => {
|
|
2358
1110
|
networkSelection && (networkSelection.value = entry.key);
|
|
2359
1111
|
if (entry.request) onFocus("network", { type: "request", id: entry.request.id });
|
|
2360
1112
|
if (detailTab) detailTab.value = "overview";
|
|
2361
1113
|
});
|
|
2362
|
-
const pathLine = createElement("span");
|
|
2363
|
-
setAttribute(pathLine, "class", "vobs-devtools-network-request__path-line");
|
|
1114
|
+
const pathLine = (0, import_vobs.createElement)("span");
|
|
1115
|
+
(0, import_vobs.setAttribute)(pathLine, "class", "vobs-devtools-network-request__path-line");
|
|
2364
1116
|
appendText(pathLine, entry.url, "vobs-devtools-network-request__url");
|
|
2365
|
-
if (entry.request?.test) insertBefore(pathLine, createComponent(Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
2366
|
-
insertBefore(pathLine, createComponent(Tag, { tone: entry.status === "success" ? "success" : entry.status === "error" || entry.status === "cancelled" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => entry.request?.responseStatus ? `${entry.status} ${entry.request.responseStatus}` : entry.status, "children") }), null);
|
|
2367
|
-
insertBefore(row, pathLine, null);
|
|
2368
|
-
const meta = createElement("span");
|
|
2369
|
-
setAttribute(meta, "class", "vobs-devtools-network-request__meta");
|
|
1117
|
+
if (entry.request?.test) (0, import_vobs.insertBefore)(pathLine, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
1118
|
+
(0, import_vobs.insertBefore)(pathLine, (0, import_vobs.createComponent)(import_ui.Tag, { tone: entry.status === "success" ? "success" : entry.status === "error" || entry.status === "cancelled" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => entry.request?.responseStatus ? `${entry.status} ${entry.request.responseStatus}` : entry.status, "children") }), null);
|
|
1119
|
+
(0, import_vobs.insertBefore)(row, pathLine, null);
|
|
1120
|
+
const meta = (0, import_vobs.createElement)("span");
|
|
1121
|
+
(0, import_vobs.setAttribute)(meta, "class", "vobs-devtools-network-request__meta");
|
|
2370
1122
|
appendText(meta, entry.duration === void 0 ? "Running" : `${entry.duration.toFixed(0)} ms`);
|
|
2371
1123
|
appendText(meta, `ID ${entry.request?.id ?? entry.routerRequest?.id}`, "vobs-devtools-code");
|
|
2372
|
-
insertBefore(row, meta, null);
|
|
2373
|
-
insertBefore(requestList, row, null);
|
|
1124
|
+
(0, import_vobs.insertBefore)(row, meta, null);
|
|
1125
|
+
(0, import_vobs.insertBefore)(requestList, row, null);
|
|
2374
1126
|
}
|
|
2375
|
-
insertBefore(listPane, requestList, null);
|
|
1127
|
+
(0, import_vobs.insertBefore)(listPane, requestList, null);
|
|
2376
1128
|
if (entries.length === 0) appendMuted(listPane, query || activeSource !== "all" || activeStatus !== "all" ? "No requests match the current filters." : "No requests recorded.");
|
|
2377
|
-
insertBefore(panes, listPane, null);
|
|
2378
|
-
const detailPane = createElement("section");
|
|
2379
|
-
setAttribute(detailPane, "class", "vobs-devtools-network-detail-pane");
|
|
2380
|
-
setAttribute(detailPane, "aria-label", "Selected network request");
|
|
2381
|
-
if (selected) insertBefore(detailPane, renderNetworkDetail(selected, detailTab?.value ?? "overview", (tab) => {
|
|
1129
|
+
(0, import_vobs.insertBefore)(panes, listPane, null);
|
|
1130
|
+
const detailPane = (0, import_vobs.createElement)("section");
|
|
1131
|
+
(0, import_vobs.setAttribute)(detailPane, "class", "vobs-devtools-network-detail-pane");
|
|
1132
|
+
(0, import_vobs.setAttribute)(detailPane, "aria-label", "Selected network request");
|
|
1133
|
+
if (selected) (0, import_vobs.insertBefore)(detailPane, renderNetworkDetail(selected, detailTab?.value ?? "overview", (tab) => {
|
|
2382
1134
|
if (detailTab) detailTab.value = tab;
|
|
2383
1135
|
}), null);
|
|
2384
1136
|
else appendMuted(detailPane, "Select a request to inspect its details.");
|
|
2385
|
-
insertBefore(panes, detailPane, null);
|
|
2386
|
-
insertBefore(root, panes, null);
|
|
2387
|
-
if (testerOpen?.value && testerDraft) insertBefore(root, renderRequestTester(testerDraft, (run) => {
|
|
1137
|
+
(0, import_vobs.insertBefore)(panes, detailPane, null);
|
|
1138
|
+
(0, import_vobs.insertBefore)(root, panes, null);
|
|
1139
|
+
if (testerOpen?.value && testerDraft) (0, import_vobs.insertBefore)(root, renderRequestTester(testerDraft, (run) => {
|
|
2388
1140
|
if (testerRun) testerRun.value = run;
|
|
2389
1141
|
testerRevision && testerRevision.value++;
|
|
2390
1142
|
}, testerRun?.value ?? { status: "idle" }, testerTab?.value ?? "params", selected, http, () => {
|
|
@@ -2397,31 +1149,31 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2397
1149
|
}
|
|
2398
1150
|
__name(renderUnifiedNetworkRequests, "renderUnifiedNetworkRequests");
|
|
2399
1151
|
function createNetworkFilterSelect(label, value, options, onChange) {
|
|
2400
|
-
const select = createElement("select");
|
|
2401
|
-
setAttribute(select, "class", "vobs-devtools-network-toolbar__select");
|
|
2402
|
-
setAttribute(select, "aria-label", label);
|
|
2403
|
-
setProperty(select, "value", value);
|
|
1152
|
+
const select = (0, import_vobs.createElement)("select");
|
|
1153
|
+
(0, import_vobs.setAttribute)(select, "class", "vobs-devtools-network-toolbar__select");
|
|
1154
|
+
(0, import_vobs.setAttribute)(select, "aria-label", label);
|
|
1155
|
+
(0, import_vobs.setProperty)(select, "value", value);
|
|
2404
1156
|
for (const [optionValue, optionLabel] of options) {
|
|
2405
|
-
const option = createElement("option");
|
|
2406
|
-
setAttribute(option, "value", optionValue);
|
|
2407
|
-
insertBefore(option, createText(optionLabel), null);
|
|
2408
|
-
insertBefore(select, option, null);
|
|
1157
|
+
const option = (0, import_vobs.createElement)("option");
|
|
1158
|
+
(0, import_vobs.setAttribute)(option, "value", optionValue);
|
|
1159
|
+
(0, import_vobs.insertBefore)(option, (0, import_vobs.createText)(optionLabel), null);
|
|
1160
|
+
(0, import_vobs.insertBefore)(select, option, null);
|
|
2409
1161
|
}
|
|
2410
|
-
setProperty(select, "value", value);
|
|
1162
|
+
(0, import_vobs.setProperty)(select, "value", value);
|
|
2411
1163
|
select.addEventListener("change", (event) => onChange(event.target.value));
|
|
2412
1164
|
return select;
|
|
2413
1165
|
}
|
|
2414
1166
|
__name(createNetworkFilterSelect, "createNetworkFilterSelect");
|
|
2415
1167
|
function renderRequestTester(draft, onRunChange, run, activeTab, selected, http, onClose, onTabChange) {
|
|
2416
|
-
const drawer = createElement("aside");
|
|
2417
|
-
setAttribute(drawer, "class", "vobs-devtools-request-tester");
|
|
2418
|
-
setAttribute(drawer, "aria-label", "Request Tester");
|
|
2419
|
-
const heading = createElement("div");
|
|
2420
|
-
setAttribute(heading, "class", "vobs-devtools-request-tester__heading");
|
|
1168
|
+
const drawer = (0, import_vobs.createElement)("aside");
|
|
1169
|
+
(0, import_vobs.setAttribute)(drawer, "class", "vobs-devtools-request-tester");
|
|
1170
|
+
(0, import_vobs.setAttribute)(drawer, "aria-label", "Request Tester");
|
|
1171
|
+
const heading = (0, import_vobs.createElement)("div");
|
|
1172
|
+
(0, import_vobs.setAttribute)(heading, "class", "vobs-devtools-request-tester__heading");
|
|
2421
1173
|
appendText(heading, "Request Tester", "vobs-devtools-request-tester__title");
|
|
2422
|
-
const headingActions = createElement("div");
|
|
2423
|
-
setAttribute(headingActions, "class", "vobs-devtools-request-tester__heading-actions");
|
|
2424
|
-
insertBefore(headingActions, createComponent(Button, {
|
|
1174
|
+
const headingActions = (0, import_vobs.createElement)("div");
|
|
1175
|
+
(0, import_vobs.setAttribute)(headingActions, "class", "vobs-devtools-request-tester__heading-actions");
|
|
1176
|
+
(0, import_vobs.insertBefore)(headingActions, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2425
1177
|
variant: "ghost",
|
|
2426
1178
|
disabled: !selected,
|
|
2427
1179
|
children: /* @__PURE__ */ __name(() => "Use selected request", "children"),
|
|
@@ -2431,29 +1183,29 @@ function renderRequestTester(draft, onRunChange, run, activeTab, selected, http,
|
|
|
2431
1183
|
onRunChange({ status: "idle" });
|
|
2432
1184
|
}, "onClick")
|
|
2433
1185
|
}), null);
|
|
2434
|
-
insertBefore(headingActions, createComponent(Button, {
|
|
1186
|
+
(0, import_vobs.insertBefore)(headingActions, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2435
1187
|
variant: "ghost",
|
|
2436
1188
|
iconOnly: true,
|
|
2437
|
-
icon: createComponent(Icon, { name: "x" }),
|
|
1189
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "x" }),
|
|
2438
1190
|
"aria-label": "Close Request Tester",
|
|
2439
1191
|
title: "Close Request Tester",
|
|
2440
1192
|
onClick: onClose
|
|
2441
1193
|
}), null);
|
|
2442
|
-
insertBefore(heading, headingActions, null);
|
|
2443
|
-
insertBefore(drawer, heading, null);
|
|
2444
|
-
const requestLine = createElement("div");
|
|
2445
|
-
setAttribute(requestLine, "class", "vobs-devtools-request-tester__request-line");
|
|
2446
|
-
insertBefore(requestLine, createTesterInput("url", draft.url, (value) => {
|
|
1194
|
+
(0, import_vobs.insertBefore)(heading, headingActions, null);
|
|
1195
|
+
(0, import_vobs.insertBefore)(drawer, heading, null);
|
|
1196
|
+
const requestLine = (0, import_vobs.createElement)("div");
|
|
1197
|
+
(0, import_vobs.setAttribute)(requestLine, "class", "vobs-devtools-request-tester__request-line");
|
|
1198
|
+
(0, import_vobs.insertBefore)(requestLine, createTesterInput("url", draft.url, (value) => {
|
|
2447
1199
|
draft.url = value;
|
|
2448
1200
|
}), null);
|
|
2449
|
-
insertBefore(requestLine, createTesterMethodSelect(draft.method, (value) => {
|
|
1201
|
+
(0, import_vobs.insertBefore)(requestLine, createTesterMethodSelect(draft.method, (value) => {
|
|
2450
1202
|
draft.method = value;
|
|
2451
1203
|
onRunChange({ status: run.status, message: run.message });
|
|
2452
1204
|
}), null);
|
|
2453
|
-
insertBefore(requestLine, createComponent(Button, {
|
|
1205
|
+
(0, import_vobs.insertBefore)(requestLine, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2454
1206
|
variant: "brand",
|
|
2455
1207
|
iconOnly: true,
|
|
2456
|
-
icon: createComponent(Icon, { name: "play" }),
|
|
1208
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "play" }),
|
|
2457
1209
|
loading: run.status === "running",
|
|
2458
1210
|
disabled: run.status === "running",
|
|
2459
1211
|
"aria-label": run.status === "running" ? "Running request" : "Start request",
|
|
@@ -2462,41 +1214,41 @@ function renderRequestTester(draft, onRunChange, run, activeTab, selected, http,
|
|
|
2462
1214
|
void executeRequestTester(http, draft, onRunChange);
|
|
2463
1215
|
}, "onClick")
|
|
2464
1216
|
}), null);
|
|
2465
|
-
insertBefore(drawer, requestLine, null);
|
|
2466
|
-
const tabs = createElement("div");
|
|
2467
|
-
setAttribute(tabs, "class", "vobs-devtools-request-tester__tabs");
|
|
1217
|
+
(0, import_vobs.insertBefore)(drawer, requestLine, null);
|
|
1218
|
+
const tabs = (0, import_vobs.createElement)("div");
|
|
1219
|
+
(0, import_vobs.setAttribute)(tabs, "class", "vobs-devtools-request-tester__tabs");
|
|
2468
1220
|
const tabLabels = [["params", "Params"], ["headers", "Headers"], ["body", "Body"]];
|
|
2469
1221
|
for (const [tab, label] of tabLabels) {
|
|
2470
|
-
const button = createElement("button");
|
|
2471
|
-
setAttribute(button, "class", `vobs-devtools-request-tester__tab${activeTab === tab ? " is-active" : ""}`);
|
|
2472
|
-
setAttribute(button, "type", "button");
|
|
2473
|
-
setAttribute(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
1222
|
+
const button = (0, import_vobs.createElement)("button");
|
|
1223
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-request-tester__tab${activeTab === tab ? " is-active" : ""}`);
|
|
1224
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
1225
|
+
(0, import_vobs.setAttribute)(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
2474
1226
|
appendText(button, label);
|
|
2475
1227
|
button.addEventListener("click", () => onTabChange(tab));
|
|
2476
|
-
insertBefore(tabs, button, null);
|
|
1228
|
+
(0, import_vobs.insertBefore)(tabs, button, null);
|
|
2477
1229
|
}
|
|
2478
|
-
insertBefore(drawer, tabs, null);
|
|
2479
|
-
if (activeTab === "params") insertBefore(drawer, renderTesterParamGroup("Params", draft.params, "parameter", onRunChange), null);
|
|
2480
|
-
if (activeTab === "headers") insertBefore(drawer, renderTesterParamGroup("Headers", draft.headers, "header", onRunChange), null);
|
|
1230
|
+
(0, import_vobs.insertBefore)(drawer, tabs, null);
|
|
1231
|
+
if (activeTab === "params") (0, import_vobs.insertBefore)(drawer, renderTesterParamGroup("Params", draft.params, "parameter", onRunChange), null);
|
|
1232
|
+
if (activeTab === "headers") (0, import_vobs.insertBefore)(drawer, renderTesterParamGroup("Headers", draft.headers, "header", onRunChange), null);
|
|
2481
1233
|
if (activeTab === "body") {
|
|
2482
|
-
const bodyLabel = createElement("label");
|
|
2483
|
-
setAttribute(bodyLabel, "class", "vobs-devtools-request-tester__field");
|
|
1234
|
+
const bodyLabel = (0, import_vobs.createElement)("label");
|
|
1235
|
+
(0, import_vobs.setAttribute)(bodyLabel, "class", "vobs-devtools-request-tester__field");
|
|
2484
1236
|
appendText(bodyLabel, "Body");
|
|
2485
|
-
const body = createElement("textarea");
|
|
2486
|
-
setAttribute(body, "class", "vobs-devtools-request-tester__textarea");
|
|
2487
|
-
setAttribute(body, "rows", "8");
|
|
2488
|
-
setAttribute(body, "placeholder", '{ "key": "value" }');
|
|
2489
|
-
setProperty(body, "value", draft.body);
|
|
1237
|
+
const body = (0, import_vobs.createElement)("textarea");
|
|
1238
|
+
(0, import_vobs.setAttribute)(body, "class", "vobs-devtools-request-tester__textarea");
|
|
1239
|
+
(0, import_vobs.setAttribute)(body, "rows", "8");
|
|
1240
|
+
(0, import_vobs.setAttribute)(body, "placeholder", '{ "key": "value" }');
|
|
1241
|
+
(0, import_vobs.setProperty)(body, "value", draft.body);
|
|
2490
1242
|
body.addEventListener("change", () => {
|
|
2491
1243
|
draft.body = body.value;
|
|
2492
1244
|
});
|
|
2493
|
-
insertBefore(bodyLabel, body, null);
|
|
2494
|
-
insertBefore(drawer, bodyLabel, null);
|
|
1245
|
+
(0, import_vobs.insertBefore)(bodyLabel, body, null);
|
|
1246
|
+
(0, import_vobs.insertBefore)(drawer, bodyLabel, null);
|
|
2495
1247
|
}
|
|
2496
|
-
const footer = createElement("div");
|
|
2497
|
-
setAttribute(footer, "class", "vobs-devtools-request-tester__footer");
|
|
1248
|
+
const footer = (0, import_vobs.createElement)("div");
|
|
1249
|
+
(0, import_vobs.setAttribute)(footer, "class", "vobs-devtools-request-tester__footer");
|
|
2498
1250
|
if (run.message) appendText(footer, run.message, `vobs-devtools-request-tester__status${run.status === "error" ? " is-error" : run.status === "success" ? " is-success" : ""}`);
|
|
2499
|
-
insertBefore(drawer, footer, null);
|
|
1251
|
+
(0, import_vobs.insertBefore)(drawer, footer, null);
|
|
2500
1252
|
return drawer;
|
|
2501
1253
|
}
|
|
2502
1254
|
__name(renderRequestTester, "renderRequestTester");
|
|
@@ -2524,70 +1276,70 @@ function isHTTPMethod(value) {
|
|
|
2524
1276
|
}
|
|
2525
1277
|
__name(isHTTPMethod, "isHTTPMethod");
|
|
2526
1278
|
function createTesterInput(name, value, onChange) {
|
|
2527
|
-
const input = createElement("input");
|
|
2528
|
-
setAttribute(input, "class", "vobs-devtools-request-tester__input");
|
|
2529
|
-
setAttribute(input, "name", name);
|
|
2530
|
-
setAttribute(input, "type", "text");
|
|
2531
|
-
setProperty(input, "value", value);
|
|
1279
|
+
const input = (0, import_vobs.createElement)("input");
|
|
1280
|
+
(0, import_vobs.setAttribute)(input, "class", "vobs-devtools-request-tester__input");
|
|
1281
|
+
(0, import_vobs.setAttribute)(input, "name", name);
|
|
1282
|
+
(0, import_vobs.setAttribute)(input, "type", "text");
|
|
1283
|
+
(0, import_vobs.setProperty)(input, "value", value);
|
|
2532
1284
|
input.addEventListener("change", () => onChange(input.value));
|
|
2533
1285
|
return input;
|
|
2534
1286
|
}
|
|
2535
1287
|
__name(createTesterInput, "createTesterInput");
|
|
2536
1288
|
function createTesterMethodSelect(value, onChange) {
|
|
2537
|
-
const select = createElement("select");
|
|
2538
|
-
setAttribute(select, "class", "vobs-devtools-request-tester__select");
|
|
1289
|
+
const select = (0, import_vobs.createElement)("select");
|
|
1290
|
+
(0, import_vobs.setAttribute)(select, "class", "vobs-devtools-request-tester__select");
|
|
2539
1291
|
for (const method of ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]) {
|
|
2540
|
-
const option = createElement("option");
|
|
2541
|
-
setAttribute(option, "value", method);
|
|
2542
|
-
if (method === value) setAttribute(option, "selected", "");
|
|
2543
|
-
insertBefore(option, createText(method), null);
|
|
2544
|
-
insertBefore(select, option, null);
|
|
1292
|
+
const option = (0, import_vobs.createElement)("option");
|
|
1293
|
+
(0, import_vobs.setAttribute)(option, "value", method);
|
|
1294
|
+
if (method === value) (0, import_vobs.setAttribute)(option, "selected", "");
|
|
1295
|
+
(0, import_vobs.insertBefore)(option, (0, import_vobs.createText)(method), null);
|
|
1296
|
+
(0, import_vobs.insertBefore)(select, option, null);
|
|
2545
1297
|
}
|
|
2546
1298
|
select.addEventListener("change", () => onChange(select.value));
|
|
2547
1299
|
return select;
|
|
2548
1300
|
}
|
|
2549
1301
|
__name(createTesterMethodSelect, "createTesterMethodSelect");
|
|
2550
1302
|
function renderTesterParamGroup(label, params, singular, onChange) {
|
|
2551
|
-
const group = createElement("section");
|
|
2552
|
-
setAttribute(group, "class", "vobs-devtools-request-tester__group");
|
|
2553
|
-
const title = createElement("div");
|
|
2554
|
-
setAttribute(title, "class", "vobs-devtools-request-tester__group-title");
|
|
1303
|
+
const group = (0, import_vobs.createElement)("section");
|
|
1304
|
+
(0, import_vobs.setAttribute)(group, "class", "vobs-devtools-request-tester__group");
|
|
1305
|
+
const title = (0, import_vobs.createElement)("div");
|
|
1306
|
+
(0, import_vobs.setAttribute)(title, "class", "vobs-devtools-request-tester__group-title");
|
|
2555
1307
|
appendText(title, label);
|
|
2556
|
-
const add = createElement("button");
|
|
2557
|
-
setAttribute(add, "class", "vobs-devtools-request-tester__add");
|
|
2558
|
-
setAttribute(add, "type", "button");
|
|
1308
|
+
const add = (0, import_vobs.createElement)("button");
|
|
1309
|
+
(0, import_vobs.setAttribute)(add, "class", "vobs-devtools-request-tester__add");
|
|
1310
|
+
(0, import_vobs.setAttribute)(add, "type", "button");
|
|
2559
1311
|
appendText(add, "+");
|
|
2560
|
-
setAttribute(add, "aria-label", `Add ${label}`);
|
|
2561
|
-
setAttribute(add, "title", `Add ${label}`);
|
|
1312
|
+
(0, import_vobs.setAttribute)(add, "aria-label", `Add ${label}`);
|
|
1313
|
+
(0, import_vobs.setAttribute)(add, "title", `Add ${label}`);
|
|
2562
1314
|
add.addEventListener("click", () => {
|
|
2563
1315
|
params.push({ key: "", value: "" });
|
|
2564
1316
|
onChange({ status: "idle" });
|
|
2565
1317
|
});
|
|
2566
|
-
insertBefore(title, add, null);
|
|
2567
|
-
insertBefore(group, title, null);
|
|
1318
|
+
(0, import_vobs.insertBefore)(title, add, null);
|
|
1319
|
+
(0, import_vobs.insertBefore)(group, title, null);
|
|
2568
1320
|
for (let index = 0; index < params.length; index++) {
|
|
2569
1321
|
const param = params[index];
|
|
2570
|
-
const row = createElement("div");
|
|
2571
|
-
setAttribute(row, "class", "vobs-devtools-request-tester__param");
|
|
2572
|
-
insertBefore(row, createTesterInput(`${singular}-key-${index}`, param.key, (value) => {
|
|
1322
|
+
const row = (0, import_vobs.createElement)("div");
|
|
1323
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-request-tester__param");
|
|
1324
|
+
(0, import_vobs.insertBefore)(row, createTesterInput(`${singular}-key-${index}`, param.key, (value) => {
|
|
2573
1325
|
param.key = value;
|
|
2574
1326
|
}), null);
|
|
2575
|
-
insertBefore(row, createTesterInput(`${singular}-value-${index}`, param.value, (value) => {
|
|
1327
|
+
(0, import_vobs.insertBefore)(row, createTesterInput(`${singular}-value-${index}`, param.value, (value) => {
|
|
2576
1328
|
param.value = value;
|
|
2577
1329
|
}), null);
|
|
2578
|
-
const remove = createElement("button");
|
|
2579
|
-
setAttribute(remove, "class", "vobs-devtools-request-tester__remove");
|
|
2580
|
-
setAttribute(remove, "type", "button");
|
|
2581
|
-
setAttribute(remove, "aria-label", `Remove ${label} row ${index + 1}`);
|
|
2582
|
-
setAttribute(remove, "title", `Remove ${label} row ${index + 1}`);
|
|
2583
|
-
insertBefore(remove, createComponent(Icon, { name: "trash" }), null);
|
|
1330
|
+
const remove = (0, import_vobs.createElement)("button");
|
|
1331
|
+
(0, import_vobs.setAttribute)(remove, "class", "vobs-devtools-request-tester__remove");
|
|
1332
|
+
(0, import_vobs.setAttribute)(remove, "type", "button");
|
|
1333
|
+
(0, import_vobs.setAttribute)(remove, "aria-label", `Remove ${label} row ${index + 1}`);
|
|
1334
|
+
(0, import_vobs.setAttribute)(remove, "title", `Remove ${label} row ${index + 1}`);
|
|
1335
|
+
(0, import_vobs.insertBefore)(remove, (0, import_vobs.createComponent)(import_ui.Icon, { name: "trash" }), null);
|
|
2584
1336
|
remove.addEventListener("click", () => {
|
|
2585
1337
|
params.splice(index, 1);
|
|
2586
1338
|
if (params.length === 0) params.push({ key: "", value: "" });
|
|
2587
1339
|
onChange({ status: "idle" });
|
|
2588
1340
|
});
|
|
2589
|
-
insertBefore(row, remove, null);
|
|
2590
|
-
insertBefore(group, row, null);
|
|
1341
|
+
(0, import_vobs.insertBefore)(row, remove, null);
|
|
1342
|
+
(0, import_vobs.insertBefore)(group, row, null);
|
|
2591
1343
|
}
|
|
2592
1344
|
return group;
|
|
2593
1345
|
}
|
|
@@ -2632,32 +1384,32 @@ async function executeRequestTester(http, draft, onRunChange) {
|
|
|
2632
1384
|
}
|
|
2633
1385
|
__name(executeRequestTester, "executeRequestTester");
|
|
2634
1386
|
function renderNetworkDetail(entry, activeTab, onTabChange) {
|
|
2635
|
-
const root = createElement("section");
|
|
2636
|
-
setAttribute(root, "class", "vobs-devtools-network-detail");
|
|
1387
|
+
const root = (0, import_vobs.createElement)("section");
|
|
1388
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-network-detail");
|
|
2637
1389
|
const request = entry.request;
|
|
2638
1390
|
const routerRequest = entry.routerRequest;
|
|
2639
|
-
const heading = createElement("div");
|
|
2640
|
-
setAttribute(heading, "class", "vobs-devtools-network-detail__heading");
|
|
1391
|
+
const heading = (0, import_vobs.createElement)("div");
|
|
1392
|
+
(0, import_vobs.setAttribute)(heading, "class", "vobs-devtools-network-detail__heading");
|
|
2641
1393
|
appendText(heading, `${entry.method} ${entry.url}`, "vobs-devtools-network-detail__title");
|
|
2642
|
-
if (request?.test) insertBefore(heading, createComponent(Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
2643
|
-
insertBefore(heading, createComponent(Tag, { tone: entry.status === "success" ? "success" : entry.status === "error" || entry.status === "cancelled" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => request?.responseStatus ? `${entry.status} ${request.responseStatus}` : entry.status, "children") }), null);
|
|
1394
|
+
if (request?.test) (0, import_vobs.insertBefore)(heading, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
1395
|
+
(0, import_vobs.insertBefore)(heading, (0, import_vobs.createComponent)(import_ui.Tag, { tone: entry.status === "success" ? "success" : entry.status === "error" || entry.status === "cancelled" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => request?.responseStatus ? `${entry.status} ${request.responseStatus}` : entry.status, "children") }), null);
|
|
2644
1396
|
if (entry.duration !== void 0) appendText(heading, `${entry.duration.toFixed(0)} ms`, "vobs-devtools-network-detail__duration");
|
|
2645
|
-
insertBefore(root, heading, null);
|
|
2646
|
-
const tabs = createElement("div");
|
|
2647
|
-
setAttribute(tabs, "class", "vobs-devtools-network-detail__tabs");
|
|
1397
|
+
(0, import_vobs.insertBefore)(root, heading, null);
|
|
1398
|
+
const tabs = (0, import_vobs.createElement)("div");
|
|
1399
|
+
(0, import_vobs.setAttribute)(tabs, "class", "vobs-devtools-network-detail__tabs");
|
|
2648
1400
|
const tabLabels = [["overview", "Overview"], ["headers", "Headers"], ["payload", "Payload"], ["response", "Response"], ["timing", "Timing"], ["context", "Context"]];
|
|
2649
1401
|
for (const [tab, label] of tabLabels) {
|
|
2650
|
-
const button = createElement("button");
|
|
2651
|
-
setAttribute(button, "type", "button");
|
|
2652
|
-
setAttribute(button, "class", `vobs-devtools-network-detail__tab${activeTab === tab ? " is-active" : ""}`);
|
|
2653
|
-
setAttribute(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
1402
|
+
const button = (0, import_vobs.createElement)("button");
|
|
1403
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
1404
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-network-detail__tab${activeTab === tab ? " is-active" : ""}`);
|
|
1405
|
+
(0, import_vobs.setAttribute)(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
2654
1406
|
appendText(button, label);
|
|
2655
1407
|
button.addEventListener("click", () => onTabChange(tab));
|
|
2656
|
-
insertBefore(tabs, button, null);
|
|
1408
|
+
(0, import_vobs.insertBefore)(tabs, button, null);
|
|
2657
1409
|
}
|
|
2658
|
-
insertBefore(root, tabs, null);
|
|
2659
|
-
const content = createElement("div");
|
|
2660
|
-
setAttribute(content, "class", "vobs-devtools-network-detail__content");
|
|
1410
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1411
|
+
const content = (0, import_vobs.createElement)("div");
|
|
1412
|
+
(0, import_vobs.setAttribute)(content, "class", "vobs-devtools-network-detail__content");
|
|
2661
1413
|
if (activeTab === "overview") {
|
|
2662
1414
|
appendNetworkField(content, "Source", entry.source.toUpperCase());
|
|
2663
1415
|
appendNetworkField(content, "Method / Type", entry.method);
|
|
@@ -2665,15 +1417,15 @@ function renderNetworkDetail(entry, activeTab, onTabChange) {
|
|
|
2665
1417
|
appendNetworkField(content, "Status", entry.status);
|
|
2666
1418
|
if (request?.error || routerRequest?.error) appendText(content, request ? `${request.error?.name}: ${request.error?.message}` : routerRequest.error, "vobs-devtools-error");
|
|
2667
1419
|
} else if (activeTab === "headers") {
|
|
2668
|
-
if (request && Object.keys(request.headers).length > 0) insertBefore(content, renderValueTree("Headers", request.headers, false), null);
|
|
1420
|
+
if (request && Object.keys(request.headers).length > 0) (0, import_vobs.insertBefore)(content, renderValueTree("Headers", request.headers, false), null);
|
|
2669
1421
|
else appendMuted(content, "No captured headers for this request.");
|
|
2670
1422
|
} else if (activeTab === "payload") {
|
|
2671
1423
|
const payload = request?.requestBody;
|
|
2672
|
-
if (payload !== void 0) insertBefore(content, renderValueTree("Request body", payload, false), null);
|
|
1424
|
+
if (payload !== void 0) (0, import_vobs.insertBefore)(content, renderValueTree("Request body", payload, false), null);
|
|
2673
1425
|
else appendMuted(content, "No request payload captured.");
|
|
2674
1426
|
} else if (activeTab === "response") {
|
|
2675
1427
|
const response = request?.responseBody ?? routerRequest?.result;
|
|
2676
|
-
if (response !== void 0) insertBefore(content, renderValueTree("Response", response, false), null);
|
|
1428
|
+
if (response !== void 0) (0, import_vobs.insertBefore)(content, renderValueTree("Response", response, false), null);
|
|
2677
1429
|
else appendMuted(content, routerRequest?.error ?? "No response body captured.");
|
|
2678
1430
|
} else if (activeTab === "timing") {
|
|
2679
1431
|
if (entry.startedAt !== void 0) appendNetworkField(content, "Started at", formatNetworkTimestamp(entry.startedAt));
|
|
@@ -2688,16 +1440,16 @@ function renderNetworkDetail(entry, activeTab, onTabChange) {
|
|
|
2688
1440
|
if (routerRequest?.trigger) appendNetworkField(content, "Trigger", routerRequest.trigger);
|
|
2689
1441
|
appendNetworkField(content, "Request ID", String(request?.id ?? routerRequest?.id), "code");
|
|
2690
1442
|
}
|
|
2691
|
-
insertBefore(root, content, null);
|
|
1443
|
+
(0, import_vobs.insertBefore)(root, content, null);
|
|
2692
1444
|
return root;
|
|
2693
1445
|
}
|
|
2694
1446
|
__name(renderNetworkDetail, "renderNetworkDetail");
|
|
2695
1447
|
function appendNetworkField(parent, label, value, valueKind) {
|
|
2696
|
-
const field = createElement("div");
|
|
2697
|
-
setAttribute(field, "class", "vobs-devtools-network-detail__field");
|
|
1448
|
+
const field = (0, import_vobs.createElement)("div");
|
|
1449
|
+
(0, import_vobs.setAttribute)(field, "class", "vobs-devtools-network-detail__field");
|
|
2698
1450
|
appendText(field, label, "vobs-devtools-network-detail__label");
|
|
2699
1451
|
appendText(field, value, `vobs-devtools-network-detail__value${valueKind ? ` vobs-devtools-${valueKind}` : ""}`);
|
|
2700
|
-
insertBefore(parent, field, null);
|
|
1452
|
+
(0, import_vobs.insertBefore)(parent, field, null);
|
|
2701
1453
|
}
|
|
2702
1454
|
__name(appendNetworkField, "appendNetworkField");
|
|
2703
1455
|
function formatNetworkTimestamp(value) {
|
|
@@ -2725,25 +1477,25 @@ function filterComponentTree(nodes, query) {
|
|
|
2725
1477
|
}
|
|
2726
1478
|
__name(filterComponentTree, "filterComponentTree");
|
|
2727
1479
|
function renderErrors(errors, selection, onFocus) {
|
|
2728
|
-
const root = createElement("div");
|
|
2729
|
-
setAttribute(root, "class", "vobs-devtools-error-list");
|
|
1480
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1481
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-error-list");
|
|
2730
1482
|
for (const error of [...errors].reverse()) {
|
|
2731
|
-
const row = createElement("details");
|
|
1483
|
+
const row = (0, import_vobs.createElement)("details");
|
|
2732
1484
|
const selected = selection?.type === "error" && selection.id === error.id;
|
|
2733
|
-
setAttribute(row, "class", `vobs-devtools-list__row vobs-devtools-error-item${selected ? " is-selected" : ""}`);
|
|
2734
|
-
if (selected) setProperty(row, "open", true);
|
|
1485
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-list__row vobs-devtools-error-item${selected ? " is-selected" : ""}`);
|
|
1486
|
+
if (selected) (0, import_vobs.setProperty)(row, "open", true);
|
|
2735
1487
|
row.addEventListener("click", (event) => {
|
|
2736
1488
|
event.stopPropagation();
|
|
2737
1489
|
onFocus("errors", { type: "error", id: error.id });
|
|
2738
1490
|
});
|
|
2739
|
-
const summary = createElement("summary");
|
|
1491
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2740
1492
|
appendText(summary, formatErrorSummary(error), "vobs-devtools-list__name");
|
|
2741
1493
|
appendText(summary, error.message, "vobs-devtools-error-item__message");
|
|
2742
|
-
insertBefore(summary, createComponent(Tag, { tone: error.origin === "framework" ? "danger" : error.origin === "usage" ? "warning" : "neutral-strong", children: /* @__PURE__ */ __name(() => error.origin, "children") }), null);
|
|
2743
|
-
insertBefore(summary, createComponent(Tag, { tone: "danger", children: /* @__PURE__ */ __name(() => `${error.count}\xD7`, "children") }), null);
|
|
2744
|
-
insertBefore(row, summary, null);
|
|
2745
|
-
const details = createElement("div");
|
|
2746
|
-
setAttribute(details, "class", "vobs-devtools-error-item__details");
|
|
1494
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: error.origin === "framework" ? "danger" : error.origin === "usage" ? "warning" : "neutral-strong", children: /* @__PURE__ */ __name(() => error.origin, "children") }), null);
|
|
1495
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "danger", children: /* @__PURE__ */ __name(() => `${error.count}\xD7`, "children") }), null);
|
|
1496
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
1497
|
+
const details = (0, import_vobs.createElement)("div");
|
|
1498
|
+
(0, import_vobs.setAttribute)(details, "class", "vobs-devtools-error-item__details");
|
|
2747
1499
|
appendErrorField(details, "Phase", error.phases.length > 1 ? error.phases.join(" / ") : error.phase);
|
|
2748
1500
|
appendErrorField(details, "Occurred", `first ${new Date(error.firstOccurredAt).toLocaleString()} \xB7 last ${new Date(error.lastOccurredAt).toLocaleString()}`, "muted");
|
|
2749
1501
|
if (error.code) appendErrorField(details, "Code", error.code, "code");
|
|
@@ -2765,53 +1517,53 @@ function renderErrors(errors, selection, onFocus) {
|
|
|
2765
1517
|
appendErrorField(details, "DOM path", error.hydration.path, "code");
|
|
2766
1518
|
}
|
|
2767
1519
|
if (error.stack) appendErrorStack(details, error.stack, error.name, error.message);
|
|
2768
|
-
insertBefore(row, details, null);
|
|
2769
|
-
insertBefore(root, row, null);
|
|
1520
|
+
(0, import_vobs.insertBefore)(row, details, null);
|
|
1521
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2770
1522
|
}
|
|
2771
1523
|
if (errors.length === 0) appendMuted(root, "No errors recorded.");
|
|
2772
1524
|
return root;
|
|
2773
1525
|
}
|
|
2774
1526
|
__name(renderErrors, "renderErrors");
|
|
2775
1527
|
function appendContextLink(parent, label, section, selection, onFocus) {
|
|
2776
|
-
const button = createElement("button");
|
|
2777
|
-
setAttribute(button, "class", "vobs-devtools-link");
|
|
2778
|
-
setAttribute(button, "type", "button");
|
|
1528
|
+
const button = (0, import_vobs.createElement)("button");
|
|
1529
|
+
(0, import_vobs.setAttribute)(button, "class", "vobs-devtools-link");
|
|
1530
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
2779
1531
|
button.addEventListener("click", (event) => {
|
|
2780
1532
|
event.stopPropagation();
|
|
2781
1533
|
onFocus(section, selection);
|
|
2782
1534
|
});
|
|
2783
|
-
insertBefore(button, createText(label), null);
|
|
2784
|
-
insertBefore(parent, button, null);
|
|
1535
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)(label), null);
|
|
1536
|
+
(0, import_vobs.insertBefore)(parent, button, null);
|
|
2785
1537
|
}
|
|
2786
1538
|
__name(appendContextLink, "appendContextLink");
|
|
2787
1539
|
function appendErrorField(parent, label, value, valueKind, wide = false) {
|
|
2788
|
-
const field = createElement("div");
|
|
2789
|
-
setAttribute(field, "class", `vobs-devtools-error-item__field${wide ? " vobs-devtools-error-item__field--wide" : ""}`);
|
|
1540
|
+
const field = (0, import_vobs.createElement)("div");
|
|
1541
|
+
(0, import_vobs.setAttribute)(field, "class", `vobs-devtools-error-item__field${wide ? " vobs-devtools-error-item__field--wide" : ""}`);
|
|
2790
1542
|
appendText(field, label, "vobs-devtools-error-item__label");
|
|
2791
1543
|
appendText(field, value, `vobs-devtools-error-item__value${valueKind ? ` vobs-devtools-${valueKind}` : ""}`);
|
|
2792
|
-
insertBefore(parent, field, null);
|
|
1544
|
+
(0, import_vobs.insertBefore)(parent, field, null);
|
|
2793
1545
|
}
|
|
2794
1546
|
__name(appendErrorField, "appendErrorField");
|
|
2795
1547
|
function appendErrorLinkField(parent, label, value, section, selection, onFocus) {
|
|
2796
|
-
const field = createElement("div");
|
|
2797
|
-
setAttribute(field, "class", "vobs-devtools-error-item__field");
|
|
1548
|
+
const field = (0, import_vobs.createElement)("div");
|
|
1549
|
+
(0, import_vobs.setAttribute)(field, "class", "vobs-devtools-error-item__field");
|
|
2798
1550
|
appendText(field, label, "vobs-devtools-error-item__label");
|
|
2799
|
-
const valueNode = createElement("span");
|
|
2800
|
-
setAttribute(valueNode, "class", "vobs-devtools-error-item__value");
|
|
1551
|
+
const valueNode = (0, import_vobs.createElement)("span");
|
|
1552
|
+
(0, import_vobs.setAttribute)(valueNode, "class", "vobs-devtools-error-item__value");
|
|
2801
1553
|
appendContextLink(valueNode, value, section, selection, onFocus);
|
|
2802
|
-
insertBefore(field, valueNode, null);
|
|
2803
|
-
insertBefore(parent, field, null);
|
|
1554
|
+
(0, import_vobs.insertBefore)(field, valueNode, null);
|
|
1555
|
+
(0, import_vobs.insertBefore)(parent, field, null);
|
|
2804
1556
|
}
|
|
2805
1557
|
__name(appendErrorLinkField, "appendErrorLinkField");
|
|
2806
1558
|
function appendErrorStack(parent, value, name, message) {
|
|
2807
|
-
const stack = createElement("div");
|
|
2808
|
-
setAttribute(stack, "class", "vobs-devtools-error-item__stack");
|
|
1559
|
+
const stack = (0, import_vobs.createElement)("div");
|
|
1560
|
+
(0, import_vobs.setAttribute)(stack, "class", "vobs-devtools-error-item__stack");
|
|
2809
1561
|
appendText(stack, "Stack trace", "vobs-devtools-error-item__label");
|
|
2810
|
-
const code = createElement("pre");
|
|
2811
|
-
setAttribute(code, "class", "vobs-devtools-error-item__stack-code vobs-devtools-code");
|
|
2812
|
-
insertBefore(code, createText(formatDebugStack(value, name, message)), null);
|
|
2813
|
-
insertBefore(stack, code, null);
|
|
2814
|
-
insertBefore(parent, stack, null);
|
|
1562
|
+
const code = (0, import_vobs.createElement)("pre");
|
|
1563
|
+
(0, import_vobs.setAttribute)(code, "class", "vobs-devtools-error-item__stack-code vobs-devtools-code");
|
|
1564
|
+
(0, import_vobs.insertBefore)(code, (0, import_vobs.createText)(formatDebugStack(value, name, message)), null);
|
|
1565
|
+
(0, import_vobs.insertBefore)(stack, code, null);
|
|
1566
|
+
(0, import_vobs.insertBefore)(parent, stack, null);
|
|
2815
1567
|
}
|
|
2816
1568
|
__name(appendErrorStack, "appendErrorStack");
|
|
2817
1569
|
function formatErrorSummary(error) {
|
|
@@ -2846,10 +1598,10 @@ function displayErrorComponent(value) {
|
|
|
2846
1598
|
}
|
|
2847
1599
|
__name(displayErrorComponent, "displayErrorComponent");
|
|
2848
1600
|
function appendText(parent, value, className) {
|
|
2849
|
-
const node = createElement("span");
|
|
2850
|
-
if (className) setAttribute(node, "class", className);
|
|
2851
|
-
insertBefore(node, createText(value), null);
|
|
2852
|
-
insertBefore(parent, node, null);
|
|
1601
|
+
const node = (0, import_vobs.createElement)("span");
|
|
1602
|
+
if (className) (0, import_vobs.setAttribute)(node, "class", className);
|
|
1603
|
+
(0, import_vobs.insertBefore)(node, (0, import_vobs.createText)(value), null);
|
|
1604
|
+
(0, import_vobs.insertBefore)(parent, node, null);
|
|
2853
1605
|
}
|
|
2854
1606
|
__name(appendText, "appendText");
|
|
2855
1607
|
function formatDebugLocation(value) {
|
|
@@ -2906,20 +1658,20 @@ function stripDebugLocation(value) {
|
|
|
2906
1658
|
}
|
|
2907
1659
|
__name(stripDebugLocation, "stripDebugLocation");
|
|
2908
1660
|
function renderComponentSummary(node, snapshot, selection, onFocus) {
|
|
2909
|
-
const row = createElement("details");
|
|
1661
|
+
const row = (0, import_vobs.createElement)("details");
|
|
2910
1662
|
const selected = selection?.type === "component" && selection.id === node.id;
|
|
2911
|
-
setAttribute(row, "class", `vobs-devtools-list__row vobs-devtools-component-row${selected ? " is-selected" : ""}`);
|
|
2912
|
-
if (selected) setProperty(row, "open", true);
|
|
1663
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-list__row vobs-devtools-component-row${selected ? " is-selected" : ""}`);
|
|
1664
|
+
if (selected) (0, import_vobs.setProperty)(row, "open", true);
|
|
2913
1665
|
row.addEventListener("click", (event) => {
|
|
2914
1666
|
event.stopPropagation();
|
|
2915
1667
|
onFocus("components", { type: "component", id: node.id });
|
|
2916
1668
|
});
|
|
2917
|
-
const summary = createElement("summary");
|
|
1669
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2918
1670
|
appendText(summary, formatDebugLocation(node.name), "vobs-devtools-list__name");
|
|
2919
|
-
insertBefore(summary, createComponent(Tag, { tone: node.mounted ? "success" : "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.signals.length} signals`, "children") }), null);
|
|
2920
|
-
insertBefore(summary, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.effects.length} effects`, "children") }), null);
|
|
1671
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: node.mounted ? "success" : "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.signals.length} signals`, "children") }), null);
|
|
1672
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.effects.length} effects`, "children") }), null);
|
|
2921
1673
|
appendText(summary, `${node.recentUpdates.length} updates \xB7 ${node.domUpdates} DOM`, "vobs-devtools-muted");
|
|
2922
|
-
insertBefore(row, summary, null);
|
|
1674
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2923
1675
|
appendText(row, `Component ID: ${node.id}`, "vobs-devtools-code");
|
|
2924
1676
|
appendText(row, "Recent updates:", "vobs-devtools-code");
|
|
2925
1677
|
appendUpdateLinks(row, node.recentUpdates, onFocus);
|
|
@@ -2935,7 +1687,7 @@ function renderComponentSummary(node, snapshot, selection, onFocus) {
|
|
|
2935
1687
|
}
|
|
2936
1688
|
if (node.children.length > 0) {
|
|
2937
1689
|
appendText(row, "Children:", "vobs-devtools-code");
|
|
2938
|
-
for (const child of node.children) insertBefore(row, renderComponentSummary(child, snapshot, selection, onFocus), null);
|
|
1690
|
+
for (const child of node.children) (0, import_vobs.insertBefore)(row, renderComponentSummary(child, snapshot, selection, onFocus), null);
|
|
2939
1691
|
}
|
|
2940
1692
|
return row;
|
|
2941
1693
|
}
|
|
@@ -2950,84 +1702,84 @@ function formatValue(value) {
|
|
|
2950
1702
|
}
|
|
2951
1703
|
__name(formatValue, "formatValue");
|
|
2952
1704
|
function renderValuePair(label, previousValue, nextValue) {
|
|
2953
|
-
const root = createElement("div");
|
|
2954
|
-
setAttribute(root, "class", `vobs-devtools-value-pair${label ? "" : " vobs-devtools-value-pair--compact"}`);
|
|
2955
|
-
const distinctMode = state(Boolean(label));
|
|
1705
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1706
|
+
(0, import_vobs.setAttribute)(root, "class", `vobs-devtools-value-pair${label ? "" : " vobs-devtools-value-pair--compact"}`);
|
|
1707
|
+
const distinctMode = (0, import_vobs.state)(Boolean(label));
|
|
2956
1708
|
root.addEventListener("click", (event) => event.stopPropagation());
|
|
2957
1709
|
root.addEventListener("pointerdown", (event) => event.stopPropagation());
|
|
2958
1710
|
if (label) {
|
|
2959
|
-
const title = createElement("div");
|
|
2960
|
-
setAttribute(title, "class", "vobs-devtools-value-pair__title");
|
|
1711
|
+
const title = (0, import_vobs.createElement)("div");
|
|
1712
|
+
(0, import_vobs.setAttribute)(title, "class", "vobs-devtools-value-pair__title");
|
|
2961
1713
|
appendText(title, label);
|
|
2962
|
-
const toggle = createElement("button");
|
|
2963
|
-
setAttribute(toggle, "class", "vobs-devtools-distinct-toggle is-active");
|
|
2964
|
-
setAttribute(toggle, "type", "button");
|
|
2965
|
-
setAttribute(toggle, "aria-pressed", "true");
|
|
2966
|
-
setAttribute(toggle, "title", "Show only values that changed");
|
|
2967
|
-
insertBefore(toggle, createText("distinct"), null);
|
|
1714
|
+
const toggle = (0, import_vobs.createElement)("button");
|
|
1715
|
+
(0, import_vobs.setAttribute)(toggle, "class", "vobs-devtools-distinct-toggle is-active");
|
|
1716
|
+
(0, import_vobs.setAttribute)(toggle, "type", "button");
|
|
1717
|
+
(0, import_vobs.setAttribute)(toggle, "aria-pressed", "true");
|
|
1718
|
+
(0, import_vobs.setAttribute)(toggle, "title", "Show only values that changed");
|
|
1719
|
+
(0, import_vobs.insertBefore)(toggle, (0, import_vobs.createText)("distinct"), null);
|
|
2968
1720
|
toggle.addEventListener("click", (event) => {
|
|
2969
1721
|
event.stopPropagation();
|
|
2970
1722
|
const enabled = !distinctMode.value;
|
|
2971
1723
|
distinctMode.value = enabled;
|
|
2972
|
-
setAttribute(toggle, "class", `vobs-devtools-distinct-toggle${enabled ? " is-active" : ""}`);
|
|
2973
|
-
setAttribute(toggle, "aria-pressed", enabled ? "true" : "false");
|
|
2974
|
-
setAttribute(toggle, "title", enabled ? "Show only values that changed" : "Show complete values");
|
|
1724
|
+
(0, import_vobs.setAttribute)(toggle, "class", `vobs-devtools-distinct-toggle${enabled ? " is-active" : ""}`);
|
|
1725
|
+
(0, import_vobs.setAttribute)(toggle, "aria-pressed", enabled ? "true" : "false");
|
|
1726
|
+
(0, import_vobs.setAttribute)(toggle, "title", enabled ? "Show only values that changed" : "Show complete values");
|
|
2975
1727
|
});
|
|
2976
|
-
insertBefore(title, toggle, null);
|
|
2977
|
-
insertBefore(root, title, null);
|
|
1728
|
+
(0, import_vobs.insertBefore)(title, toggle, null);
|
|
1729
|
+
(0, import_vobs.insertBefore)(root, title, null);
|
|
2978
1730
|
}
|
|
2979
|
-
insertDynamic(root, null, () => {
|
|
1731
|
+
(0, import_vobs.insertDynamic)(root, null, () => {
|
|
2980
1732
|
const distinct = distinctMode.value;
|
|
2981
1733
|
const difference = distinct ? createDistinctValuePair(previousValue, nextValue) : null;
|
|
2982
1734
|
const before = difference?.before ?? { value: previousValue, hasDifference: true };
|
|
2983
1735
|
const after = difference?.after ?? { value: nextValue, hasDifference: true };
|
|
2984
|
-
return createFragment((parent, anchor) => {
|
|
2985
|
-
insertBefore(parent, renderValueTree("Before", before.value, Boolean(label), distinct && !before.hasDifference ? "No differing fields" : void 0), anchor);
|
|
2986
|
-
insertBefore(parent, renderValueTree("After", after.value, Boolean(label), distinct && !after.hasDifference ? "No differing fields" : void 0), anchor);
|
|
1736
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
1737
|
+
(0, import_vobs.insertBefore)(parent, renderValueTree("Before", before.value, Boolean(label), distinct && !before.hasDifference ? "No differing fields" : void 0), anchor);
|
|
1738
|
+
(0, import_vobs.insertBefore)(parent, renderValueTree("After", after.value, Boolean(label), distinct && !after.hasDifference ? "No differing fields" : void 0), anchor);
|
|
2987
1739
|
});
|
|
2988
1740
|
});
|
|
2989
1741
|
return root;
|
|
2990
1742
|
}
|
|
2991
1743
|
__name(renderValuePair, "renderValuePair");
|
|
2992
1744
|
function renderValueTree(label, value, expanded, emptyMessage) {
|
|
2993
|
-
const root = createElement("section");
|
|
2994
|
-
setAttribute(root, "class", "vobs-devtools-value-inspector");
|
|
1745
|
+
const root = (0, import_vobs.createElement)("section");
|
|
1746
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-value-inspector");
|
|
2995
1747
|
root.addEventListener("click", (event) => event.stopPropagation());
|
|
2996
1748
|
root.addEventListener("pointerdown", (event) => event.stopPropagation());
|
|
2997
1749
|
if (hasExpandableEntries(value)) {
|
|
2998
|
-
const controls = createElement("div");
|
|
2999
|
-
setAttribute(controls, "class", "vobs-devtools-value-inspector__controls");
|
|
3000
|
-
insertBefore(controls, createComponent(Button, {
|
|
1750
|
+
const controls = (0, import_vobs.createElement)("div");
|
|
1751
|
+
(0, import_vobs.setAttribute)(controls, "class", "vobs-devtools-value-inspector__controls");
|
|
1752
|
+
(0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
3001
1753
|
variant: "ghost",
|
|
3002
1754
|
iconOnly: true,
|
|
3003
|
-
icon: createComponent(Icon, { name: "plus" }),
|
|
1755
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "plus" }),
|
|
3004
1756
|
"aria-label": `Expand all ${label} values`,
|
|
3005
1757
|
title: `Expand all ${label} values`,
|
|
3006
1758
|
onClick: /* @__PURE__ */ __name((event) => {
|
|
3007
1759
|
event.stopPropagation();
|
|
3008
|
-
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) setAttribute(node, "data-expanded", "true");
|
|
1760
|
+
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) (0, import_vobs.setAttribute)(node, "data-expanded", "true");
|
|
3009
1761
|
}, "onClick")
|
|
3010
1762
|
}), null);
|
|
3011
|
-
insertBefore(controls, createComponent(Button, {
|
|
1763
|
+
(0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
3012
1764
|
variant: "ghost",
|
|
3013
1765
|
iconOnly: true,
|
|
3014
|
-
icon: createComponent(Icon, { name: "minus" }),
|
|
1766
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "minus" }),
|
|
3015
1767
|
"aria-label": `Collapse all ${label} values`,
|
|
3016
1768
|
title: `Collapse all ${label} values`,
|
|
3017
1769
|
onClick: /* @__PURE__ */ __name((event) => {
|
|
3018
1770
|
event.stopPropagation();
|
|
3019
|
-
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) setAttribute(node, "data-expanded", "false");
|
|
1771
|
+
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) (0, import_vobs.setAttribute)(node, "data-expanded", "false");
|
|
3020
1772
|
}, "onClick")
|
|
3021
1773
|
}), null);
|
|
3022
|
-
insertBefore(root, controls, null);
|
|
1774
|
+
(0, import_vobs.insertBefore)(root, controls, null);
|
|
3023
1775
|
}
|
|
3024
|
-
const tree = createElement("div");
|
|
3025
|
-
setAttribute(tree, "class", "vobs-devtools-value-tree-root");
|
|
3026
|
-
setAttribute(tree, "role", "tree");
|
|
3027
|
-
setAttribute(tree, "aria-label", `${label} value`);
|
|
1776
|
+
const tree = (0, import_vobs.createElement)("div");
|
|
1777
|
+
(0, import_vobs.setAttribute)(tree, "class", "vobs-devtools-value-tree-root");
|
|
1778
|
+
(0, import_vobs.setAttribute)(tree, "role", "tree");
|
|
1779
|
+
(0, import_vobs.setAttribute)(tree, "aria-label", `${label} value`);
|
|
3028
1780
|
if (emptyMessage) appendText(tree, emptyMessage, "vobs-devtools-value-tree__empty");
|
|
3029
|
-
else insertBefore(tree, renderInspectableValue(label, value, expanded), null);
|
|
3030
|
-
insertBefore(root, tree, null);
|
|
1781
|
+
else (0, import_vobs.insertBefore)(tree, renderInspectableValue(label, value, expanded), null);
|
|
1782
|
+
(0, import_vobs.insertBefore)(root, tree, null);
|
|
3031
1783
|
return root;
|
|
3032
1784
|
}
|
|
3033
1785
|
__name(renderValueTree, "renderValueTree");
|
|
@@ -3109,27 +1861,27 @@ function areValuesEqual(before, after, seen = /* @__PURE__ */ new WeakMap()) {
|
|
|
3109
1861
|
__name(areValuesEqual, "areValuesEqual");
|
|
3110
1862
|
function renderInspectableValue(label, value, expanded = false, ancestors = []) {
|
|
3111
1863
|
if (!hasExpandableEntries(value) || ancestors.includes(value)) {
|
|
3112
|
-
const row = createElement("div");
|
|
3113
|
-
setAttribute(row, "class", "vobs-devtools-value-tree__leaf");
|
|
3114
|
-
setAttribute(row, "role", "treeitem");
|
|
1864
|
+
const row = (0, import_vobs.createElement)("div");
|
|
1865
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-value-tree__leaf");
|
|
1866
|
+
(0, import_vobs.setAttribute)(row, "role", "treeitem");
|
|
3115
1867
|
appendText(row, label, "vobs-devtools-value-field__label");
|
|
3116
1868
|
appendText(row, ancestors.includes(value) ? "[Circular]" : previewValue(value), "vobs-devtools-code");
|
|
3117
1869
|
return row;
|
|
3118
1870
|
}
|
|
3119
|
-
const root = createElement("div");
|
|
3120
|
-
setAttribute(root, "class", "vobs-devtools-value-tree");
|
|
3121
|
-
setAttribute(root, "role", "treeitem");
|
|
3122
|
-
setAttribute(root, "data-expanded", expanded ? "true" : "false");
|
|
3123
|
-
const summary = createElement("button");
|
|
3124
|
-
setAttribute(summary, "class", "vobs-devtools-value-tree__summary");
|
|
3125
|
-
setAttribute(summary, "type", "button");
|
|
3126
|
-
setAttribute(summary, "aria-expanded", expanded ? "true" : "false");
|
|
3127
|
-
setAttribute(summary, "title", `Expand ${label}`);
|
|
1871
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1872
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-value-tree");
|
|
1873
|
+
(0, import_vobs.setAttribute)(root, "role", "treeitem");
|
|
1874
|
+
(0, import_vobs.setAttribute)(root, "data-expanded", expanded ? "true" : "false");
|
|
1875
|
+
const summary = (0, import_vobs.createElement)("button");
|
|
1876
|
+
(0, import_vobs.setAttribute)(summary, "class", "vobs-devtools-value-tree__summary");
|
|
1877
|
+
(0, import_vobs.setAttribute)(summary, "type", "button");
|
|
1878
|
+
(0, import_vobs.setAttribute)(summary, "aria-expanded", expanded ? "true" : "false");
|
|
1879
|
+
(0, import_vobs.setAttribute)(summary, "title", `Expand ${label}`);
|
|
3128
1880
|
const toggleExpanded = /* @__PURE__ */ __name(() => {
|
|
3129
1881
|
const expanded2 = root.getAttribute("data-expanded") !== "true";
|
|
3130
|
-
setAttribute(root, "data-expanded", expanded2 ? "true" : "false");
|
|
3131
|
-
setAttribute(summary, "aria-expanded", expanded2 ? "true" : "false");
|
|
3132
|
-
setAttribute(summary, "title", `${expanded2 ? "Collapse" : "Expand"} ${label}`);
|
|
1882
|
+
(0, import_vobs.setAttribute)(root, "data-expanded", expanded2 ? "true" : "false");
|
|
1883
|
+
(0, import_vobs.setAttribute)(summary, "aria-expanded", expanded2 ? "true" : "false");
|
|
1884
|
+
(0, import_vobs.setAttribute)(summary, "title", `${expanded2 ? "Collapse" : "Expand"} ${label}`);
|
|
3133
1885
|
}, "toggleExpanded");
|
|
3134
1886
|
summary.addEventListener("pointerdown", (event) => {
|
|
3135
1887
|
event.preventDefault();
|
|
@@ -3145,14 +1897,14 @@ function renderInspectableValue(label, value, expanded = false, ancestors = [])
|
|
|
3145
1897
|
});
|
|
3146
1898
|
appendText(summary, label, "vobs-devtools-value-field__label");
|
|
3147
1899
|
appendText(summary, previewValue(value), "vobs-devtools-code");
|
|
3148
|
-
insertBefore(root, summary, null);
|
|
3149
|
-
const children = createElement("div");
|
|
3150
|
-
setAttribute(children, "class", "vobs-devtools-value-tree__children");
|
|
3151
|
-
setAttribute(children, "role", "group");
|
|
1900
|
+
(0, import_vobs.insertBefore)(root, summary, null);
|
|
1901
|
+
const children = (0, import_vobs.createElement)("div");
|
|
1902
|
+
(0, import_vobs.setAttribute)(children, "class", "vobs-devtools-value-tree__children");
|
|
1903
|
+
(0, import_vobs.setAttribute)(children, "role", "group");
|
|
3152
1904
|
for (const [key, child] of valueEntries(value)) {
|
|
3153
|
-
insertBefore(children, renderInspectableValue(key, child, false, [...ancestors, value]), null);
|
|
1905
|
+
(0, import_vobs.insertBefore)(children, renderInspectableValue(key, child, false, [...ancestors, value]), null);
|
|
3154
1906
|
}
|
|
3155
|
-
insertBefore(root, children, null);
|
|
1907
|
+
(0, import_vobs.insertBefore)(root, children, null);
|
|
3156
1908
|
return root;
|
|
3157
1909
|
}
|
|
3158
1910
|
__name(renderInspectableValue, "renderInspectableValue");
|
|
@@ -3179,9 +1931,10 @@ function previewValue(value) {
|
|
|
3179
1931
|
return String(value);
|
|
3180
1932
|
}
|
|
3181
1933
|
__name(previewValue, "previewValue");
|
|
3182
|
-
|
|
3183
|
-
exports
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
1934
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1935
|
+
0 && (module.exports = {
|
|
1936
|
+
DevToolsPanel,
|
|
1937
|
+
DevToolsToolbar,
|
|
1938
|
+
readDevToolsSnapshot
|
|
1939
|
+
});
|
|
3187
1940
|
//# sourceMappingURL=panel.cjs.map
|