@vobs/devtools-ui 1.2.1 → 1.2.2
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/index.cjs
CHANGED
|
@@ -1,1378 +1,39 @@
|
|
|
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;
|
|
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 });
|
|
601
17
|
}
|
|
602
|
-
|
|
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;
|
|
714
|
-
}
|
|
715
|
-
return void 0;
|
|
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/ui/src/overlay.ts
|
|
1094
|
-
function createPortal(node, adapter, target) {
|
|
1095
|
-
const placeholder = createComment("vui:portal");
|
|
1096
|
-
const owner = getCurrentOwner();
|
|
1097
|
-
if (!owner) throw new Error("Vobs UI: createPortal \u5FC5\u987B\u5728\u7EC4\u4EF6 Owner \u4F5C\u7528\u57DF\u5185\u8C03\u7528");
|
|
1098
|
-
adapter.mount(node, target);
|
|
1099
|
-
const cleanup = /* @__PURE__ */ __name(() => adapter.unmount(node, target), "cleanup");
|
|
1100
|
-
owner.onDispose(cleanup);
|
|
1101
|
-
return placeholder;
|
|
1102
|
-
}
|
|
1103
|
-
__name(createPortal, "createPortal");
|
|
1104
|
-
|
|
1105
|
-
// packages/ui/src/dialog.ts
|
|
1106
|
-
function Dialog(props = {}) {
|
|
1107
|
-
const root = createElement("div");
|
|
1108
|
-
const surface = createElement("section");
|
|
1109
|
-
const body = createElement("div");
|
|
1110
|
-
bindClassList(root, props, () => ["vui-backdrop"]);
|
|
1111
|
-
bindUserStyle(root, props);
|
|
1112
|
-
bindCommonAttributes(surface, props, [
|
|
1113
|
-
"open",
|
|
1114
|
-
"title",
|
|
1115
|
-
"headerActions",
|
|
1116
|
-
"size",
|
|
1117
|
-
"modal",
|
|
1118
|
-
"closeOnBackdrop",
|
|
1119
|
-
"closeOnEscape",
|
|
1120
|
-
"titleId",
|
|
1121
|
-
"descriptionId",
|
|
1122
|
-
"closeLabel",
|
|
1123
|
-
"onClose",
|
|
1124
|
-
"portal",
|
|
1125
|
-
"portalTarget"
|
|
1126
|
-
]);
|
|
1127
|
-
setAttribute(root, "role", "presentation");
|
|
1128
|
-
setAttribute(surface, "class", "vui-dialog");
|
|
1129
|
-
setAttribute(surface, "role", "dialog");
|
|
1130
|
-
setAttribute(body, "class", "vui-dialog__body");
|
|
1131
|
-
effect(() => {
|
|
1132
|
-
const open = readProp(props, "open", false);
|
|
1133
|
-
const modal = readProp(props, "modal", true);
|
|
1134
|
-
setOptionalProperty(root, "hidden", !open);
|
|
1135
|
-
setOptionalAttribute(root, "data-state", open ? "open" : "closed");
|
|
1136
|
-
setOptionalAttribute(surface, "aria-modal", modal ? "true" : "false");
|
|
1137
|
-
setOptionalAttribute(surface, "aria-labelledby", readProp(props, "titleId", void 0));
|
|
1138
|
-
setOptionalAttribute(surface, "aria-describedby", readProp(props, "descriptionId", void 0));
|
|
1139
|
-
setOptionalAttribute(surface, "data-size", readProp(props, "size", "md"));
|
|
1140
|
-
});
|
|
1141
|
-
if (hasProp(props, "title") || hasProp(props, "headerActions") || hasProp(props, "onClose")) {
|
|
1142
|
-
const head = createElement("header");
|
|
1143
|
-
setAttribute(head, "class", "vui-dialog__head");
|
|
1144
|
-
if (hasProp(props, "title")) {
|
|
1145
|
-
const title = createElement("div");
|
|
1146
|
-
const text = createText("");
|
|
1147
|
-
setAttribute(title, "class", "vui-dialog__title");
|
|
1148
|
-
bindTextContent(text, () => readProp(props, "title", ""));
|
|
1149
|
-
insertBefore(title, text, null);
|
|
1150
|
-
insertBefore(head, title, null);
|
|
1151
|
-
}
|
|
1152
|
-
if (hasProp(props, "headerActions")) mountSlot(head, props, "headerActions");
|
|
1153
|
-
if (hasProp(props, "onClose")) {
|
|
1154
|
-
const close = createElement("button");
|
|
1155
|
-
setAttribute(close, "class", "vui-dialog__close");
|
|
1156
|
-
setAttribute(close, "type", "button");
|
|
1157
|
-
setAttribute(close, "aria-label", readProp(props, "closeLabel", "Close"));
|
|
1158
|
-
insertBefore(close, createText("x"), null);
|
|
1159
|
-
addEventListener(close, "click", () => emitClose(props, "close-button"));
|
|
1160
|
-
insertBefore(head, close, null);
|
|
1161
|
-
}
|
|
1162
|
-
insertBefore(surface, head, null);
|
|
1163
|
-
}
|
|
1164
|
-
if (hasProp(props, "children")) mountSlot(body, props, "children");
|
|
1165
|
-
insertBefore(surface, body, null);
|
|
1166
|
-
insertBefore(root, surface, null);
|
|
1167
|
-
addEventListener(root, "click", (event) => {
|
|
1168
|
-
if (event.target !== root) return;
|
|
1169
|
-
if (readProp(props, "closeOnBackdrop", true)) emitClose(props, "backdrop");
|
|
1170
|
-
});
|
|
1171
|
-
addEventListener(root, "keydown", (event) => {
|
|
1172
|
-
if (event.key !== "Escape") return;
|
|
1173
|
-
if (readProp(props, "closeOnEscape", true)) emitClose(props, "escape");
|
|
1174
|
-
});
|
|
1175
|
-
const portal = readProp(props, "portal", void 0);
|
|
1176
|
-
return portal ? createPortal(root, portal, readProp(props, "portalTarget", void 0)) : root;
|
|
1177
|
-
}
|
|
1178
|
-
__name(Dialog, "Dialog");
|
|
1179
|
-
function emitClose(props, reason) {
|
|
1180
|
-
if (!readProp(props, "open", false)) return;
|
|
1181
|
-
const handler = readProp(props, "onClose", void 0);
|
|
1182
|
-
if (typeof handler === "function") handler(reason);
|
|
1183
|
-
}
|
|
1184
|
-
__name(emitClose, "emitClose");
|
|
1185
|
-
|
|
1186
|
-
// packages/icon-core/src/index.ts
|
|
1187
|
-
function createSvgIconNode(source, props = {}, options = {}) {
|
|
1188
|
-
const root = createElement("span");
|
|
1189
|
-
effect(() => {
|
|
1190
|
-
updateSvgIconNode(root, typeof source === "function" ? source() : source, props, options);
|
|
1191
|
-
});
|
|
1192
|
-
return root;
|
|
1193
|
-
}
|
|
1194
|
-
__name(createSvgIconNode, "createSvgIconNode");
|
|
1195
|
-
function updateSvgIconNode(root, definition, props, options) {
|
|
1196
|
-
const size = readProp2(props, "size", void 0);
|
|
1197
|
-
const width = readProp2(props, "width", size);
|
|
1198
|
-
const height = readProp2(props, "height", size);
|
|
1199
|
-
const normalizedWidth = normalizeSvgLength(width);
|
|
1200
|
-
const normalizedHeight = normalizeSvgLength(height);
|
|
1201
|
-
const userClass = [
|
|
1202
|
-
readProp2(props, "class", void 0),
|
|
1203
|
-
readProp2(props, "className", void 0)
|
|
1204
|
-
].filter(hasText).join(" ");
|
|
1205
|
-
const className = [options.class, options.className, userClass].filter(hasText).join(" ");
|
|
1206
|
-
setAttribute(root, "class", className);
|
|
1207
|
-
const internalStyle = size === void 0 ? "" : `width: ${normalizeCssLength(size)}; height: ${normalizeCssLength(size)}`;
|
|
1208
|
-
const userStyle = readProp2(props, "style", void 0);
|
|
1209
|
-
const style = [internalStyle, userStyle].filter(hasText).join("; ");
|
|
1210
|
-
setOptionalAttribute2(root, "style", style || void 0);
|
|
1211
|
-
const managedAttributes2 = /* @__PURE__ */ new Map();
|
|
1212
|
-
for (const name of Object.keys(props)) {
|
|
1213
|
-
if (name === "class" || name === "className" || name === "style" || name === "children") continue;
|
|
1214
|
-
if (!name.startsWith("aria-") && !name.startsWith("data-") && !["id", "title", "role", "tabIndex"].includes(name)) continue;
|
|
1215
|
-
const value = Reflect.get(props, name);
|
|
1216
|
-
if (value === void 0 || value === null || value === false) continue;
|
|
1217
|
-
managedAttributes2.set(name === "tabIndex" ? "tabindex" : name, String(value));
|
|
1218
|
-
}
|
|
1219
|
-
for (const [name, value] of managedAttributes2) setAttribute(root, name, value);
|
|
1220
|
-
clearStaleAttributes(root, managedAttributes2);
|
|
1221
|
-
const title = readProp2(props, "title", void 0);
|
|
1222
|
-
const ariaLabel = Reflect.get(props, "aria-label");
|
|
1223
|
-
const decorative = readProp2(props, "decorative", title === void 0 && ariaLabel === void 0);
|
|
1224
|
-
setOptionalAttribute2(root, "aria-hidden", decorative ? "true" : void 0);
|
|
1225
|
-
setOptionalAttribute2(root, "aria-label", ariaLabel === void 0 ? title : void 0);
|
|
1226
|
-
setOptionalAttribute2(root, "data-icon-name", options.dataIconName ?? definition?.name);
|
|
1227
|
-
setOptionalAttribute2(root, "color", readProp2(props, "color", void 0));
|
|
1228
|
-
if (!definition) {
|
|
1229
|
-
setProperty(root, "innerHTML", "");
|
|
1230
|
-
return;
|
|
1231
|
-
}
|
|
1232
|
-
const svgAttributes = {
|
|
1233
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1234
|
-
viewBox: definition.viewBox ?? "0 0 24 24",
|
|
1235
|
-
...options.defaultSvgAttributes,
|
|
1236
|
-
...definition.attributes,
|
|
1237
|
-
...normalizedWidth === void 0 ? {} : { width: normalizedWidth },
|
|
1238
|
-
...normalizedHeight === void 0 ? {} : { height: normalizedHeight },
|
|
1239
|
-
...readProp2(props, "color", void 0) === void 0 ? {} : { color: readProp2(props, "color", void 0) },
|
|
1240
|
-
...readProp2(props, "stroke", void 0) === void 0 ? {} : { stroke: readProp2(props, "stroke", void 0) },
|
|
1241
|
-
...readProp2(props, "fill", void 0) === void 0 ? {} : { fill: readProp2(props, "fill", void 0) },
|
|
1242
|
-
...readProp2(props, "strokeWidth", void 0) === void 0 ? {} : { "stroke-width": readProp2(props, "strokeWidth", void 0) }
|
|
1243
|
-
};
|
|
1244
|
-
const markup = Object.entries(svgAttributes).filter(([, value]) => value !== void 0).map(([name, value]) => `${name}="${escapeXml(String(value))}"`).join(" ");
|
|
1245
|
-
const titleMarkup = title === void 0 ? "" : `<title>${escapeXml(title)}</title>`;
|
|
1246
|
-
setProperty(root, "innerHTML", `<svg ${markup} aria-hidden="true">${titleMarkup}${definition.body}</svg>`);
|
|
1247
|
-
}
|
|
1248
|
-
__name(updateSvgIconNode, "updateSvgIconNode");
|
|
1249
|
-
function readProp2(props, name, fallback) {
|
|
1250
|
-
const value = Reflect.get(props, name);
|
|
1251
|
-
return value === void 0 ? fallback : value;
|
|
1252
|
-
}
|
|
1253
|
-
__name(readProp2, "readProp");
|
|
1254
|
-
function hasText(value) {
|
|
1255
|
-
return value !== void 0 && value.trim() !== "";
|
|
1256
|
-
}
|
|
1257
|
-
__name(hasText, "hasText");
|
|
1258
|
-
function normalizeSvgLength(value) {
|
|
1259
|
-
if (value === void 0) return void 0;
|
|
1260
|
-
return typeof value === "number" ? String(value) : value;
|
|
1261
|
-
}
|
|
1262
|
-
__name(normalizeSvgLength, "normalizeSvgLength");
|
|
1263
|
-
function normalizeCssLength(value) {
|
|
1264
|
-
return typeof value === "number" || /^\d+(?:\.\d+)?$/u.test(value) ? `${value}px` : value;
|
|
1265
|
-
}
|
|
1266
|
-
__name(normalizeCssLength, "normalizeCssLength");
|
|
1267
|
-
function setOptionalAttribute2(node, name, value) {
|
|
1268
|
-
if (value === void 0 || value === null || value === false || value === "") {
|
|
1269
|
-
node.removeAttribute(name);
|
|
1270
|
-
return;
|
|
1271
|
-
}
|
|
1272
|
-
setAttribute(node, name, String(value));
|
|
1273
|
-
}
|
|
1274
|
-
__name(setOptionalAttribute2, "setOptionalAttribute");
|
|
1275
|
-
function clearStaleAttributes(node, next) {
|
|
1276
|
-
const previous = node.__vobsIconAttributes ?? /* @__PURE__ */ new Set();
|
|
1277
|
-
for (const name of previous) {
|
|
1278
|
-
if (!next.has(name)) node.removeAttribute(name);
|
|
1279
|
-
}
|
|
1280
|
-
node.__vobsIconAttributes = new Set(next.keys());
|
|
1281
|
-
}
|
|
1282
|
-
__name(clearStaleAttributes, "clearStaleAttributes");
|
|
1283
|
-
function escapeXml(value) {
|
|
1284
|
-
return value.replace(/&/gu, "&").replace(/</gu, "<").replace(/>/gu, ">").replace(/"/gu, """);
|
|
1285
|
-
}
|
|
1286
|
-
__name(escapeXml, "escapeXml");
|
|
1287
|
-
|
|
1288
|
-
// packages/ui/src/icon.ts
|
|
1289
|
-
function Icon(props = {}) {
|
|
1290
|
-
const root = createSvgIconNode(() => {
|
|
1291
|
-
const definition = resolveIcon(
|
|
1292
|
-
readProp(props, "icon", void 0) ?? readProp(props, "name", void 0)
|
|
1293
|
-
);
|
|
1294
|
-
if (!definition) {
|
|
1295
|
-
if (hasProp(props, "children")) return void 0;
|
|
1296
|
-
throw new Error("Vobs UI: Icon requires a registered `name` or an `icon` definition");
|
|
1297
|
-
}
|
|
1298
|
-
return iconDefinitionToSvg(definition);
|
|
1299
|
-
}, props, {
|
|
1300
|
-
class: "vui-icon icon",
|
|
1301
|
-
defaultSvgAttributes: {
|
|
1302
|
-
fill: "none",
|
|
1303
|
-
stroke: "currentColor",
|
|
1304
|
-
"stroke-width": 2,
|
|
1305
|
-
"stroke-linecap": "butt",
|
|
1306
|
-
"stroke-linejoin": "miter"
|
|
1307
|
-
}
|
|
1308
|
-
});
|
|
1309
|
-
if (hasProp(props, "children")) mountSlot(root, props, "children");
|
|
1310
|
-
return root;
|
|
1311
|
-
}
|
|
1312
|
-
__name(Icon, "Icon");
|
|
1313
|
-
function iconDefinitionToSvg(definition) {
|
|
1314
|
-
return {
|
|
1315
|
-
name: definition.name,
|
|
1316
|
-
body: definition.path,
|
|
1317
|
-
viewBox: definition.viewBox
|
|
1318
|
-
};
|
|
1319
|
-
}
|
|
1320
|
-
__name(iconDefinitionToSvg, "iconDefinitionToSvg");
|
|
1321
|
-
var VUI_ICON_PATHS = {
|
|
1322
|
-
search: '<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>',
|
|
1323
|
-
check: '<polyline points="4 12 10 18 20 6"/>',
|
|
1324
|
-
x: '<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>',
|
|
1325
|
-
plus: '<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',
|
|
1326
|
-
minus: '<line x1="5" y1="12" x2="19" y2="12"/>',
|
|
1327
|
-
"chevron-right": '<polyline points="9 6 15 12 9 18"/>',
|
|
1328
|
-
"chevron-down": '<polyline points="6 9 12 15 18 9"/>',
|
|
1329
|
-
"chevron-up": '<polyline points="6 15 12 9 18 15"/>',
|
|
1330
|
-
"chevron-left": '<polyline points="15 6 9 12 15 18"/>',
|
|
1331
|
-
"arrow-left": '<line x1="20" y1="12" x2="4" y2="12"/><polyline points="10 6 4 12 10 18"/>',
|
|
1332
|
-
"arrow-right": '<line x1="4" y1="12" x2="20" y2="12"/><polyline points="14 6 20 12 14 18"/>',
|
|
1333
|
-
"arrow-up": '<line x1="12" y1="20" x2="12" y2="4"/><polyline points="6 10 12 4 18 10"/>',
|
|
1334
|
-
"arrow-down": '<line x1="12" y1="4" x2="12" y2="20"/><polyline points="6 14 12 20 18 14"/>',
|
|
1335
|
-
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)"/>',
|
|
1336
|
-
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"/>',
|
|
1337
|
-
"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"/>',
|
|
1338
|
-
"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"/>',
|
|
1339
|
-
"check-circle": '<circle cx="12" cy="12" r="9"/><polyline points="8 12 11 15 16 9"/>',
|
|
1340
|
-
"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"/>',
|
|
1341
|
-
"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"/>',
|
|
1342
|
-
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"/>',
|
|
1343
|
-
home: '<polygon points="3 11 12 3 21 11 21 21 14 21 14 14 10 14 10 21 3 21 3 11"/>',
|
|
1344
|
-
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"/>',
|
|
1345
|
-
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"/>',
|
|
1346
|
-
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"/>',
|
|
1347
|
-
"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"/>',
|
|
1348
|
-
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"/>',
|
|
1349
|
-
filter: '<polygon points="3 4 21 4 14 12 14 20 10 18 10 12 3 4"/>',
|
|
1350
|
-
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"/>',
|
|
1351
|
-
edit: '<path d="M4 20h4l10-10-4-4L4 16v4z"/><path d="M14 6l4 4"/>',
|
|
1352
|
-
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"/>',
|
|
1353
|
-
download: '<path d="M12 3v12"/><polyline points="7 10 12 15 17 10"/><line x1="3" y1="21" x2="21" y2="21"/>',
|
|
1354
|
-
upload: '<path d="M12 21V6"/><polyline points="7 11 12 6 17 11"/><line x1="3" y1="21" x2="21" y2="21"/>',
|
|
1355
|
-
pause: '<line x1="9" y1="5" x2="9" y2="19"/><line x1="15" y1="5" x2="15" y2="19"/>',
|
|
1356
|
-
play: '<polygon points="8 5 19 12 8 19 8 5"/>',
|
|
1357
|
-
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"/>',
|
|
1358
|
-
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"/>',
|
|
1359
|
-
folder: '<path d="M3 6h6l2 3h10v10H3z"/>',
|
|
1360
|
-
code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
|
|
1361
|
-
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"/>',
|
|
1362
|
-
zap: '<polygon points="13 2 4 14 12 14 11 22 20 10 12 10 13 2"/>',
|
|
1363
|
-
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"/>',
|
|
1364
|
-
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
|
|
1365
|
-
terminal: '<polyline points="4 7 9 12 4 17"/><line x1="12" y1="17" x2="20" y2="17"/>'
|
|
18
|
+
return to;
|
|
1366
19
|
};
|
|
1367
|
-
var
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// packages/devtools-ui/src/index.ts
|
|
23
|
+
var src_exports = {};
|
|
24
|
+
__export(src_exports, {
|
|
25
|
+
DevToolsPanel: () => DevToolsPanel,
|
|
26
|
+
DevToolsWidget: () => DevToolsWidget,
|
|
27
|
+
readDevToolsSnapshot: () => readDevToolsSnapshot
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(src_exports);
|
|
1374
30
|
|
|
1375
31
|
// packages/devtools-ui/src/panel.tsx
|
|
32
|
+
var import_devtools = require("@vobs/devtools");
|
|
33
|
+
var import_http = require("@vobs/http");
|
|
34
|
+
var import_reactivity = require("@vobs/reactivity");
|
|
35
|
+
var import_vobs = require("@vobs/vobs");
|
|
36
|
+
var import_ui = require("@vobs/ui");
|
|
1376
37
|
var EMPTY_SNAPSHOT = {
|
|
1377
38
|
api: null,
|
|
1378
39
|
tree: [],
|
|
@@ -1389,7 +50,7 @@ var EMPTY_SNAPSHOT = {
|
|
|
1389
50
|
routerContext: null
|
|
1390
51
|
};
|
|
1391
52
|
var PANEL_REFRESH_EVENTS = ["signal-update", "update", "lifecycle", "network-request", "router", "error", "collection", "collection-cleared"];
|
|
1392
|
-
function readDevToolsSnapshot(api = getDevTools()) {
|
|
53
|
+
function readDevToolsSnapshot(api = (0, import_devtools.getDevTools)()) {
|
|
1393
54
|
return readDevToolsSnapshotWithRouter(api, null);
|
|
1394
55
|
}
|
|
1395
56
|
__name(readDevToolsSnapshot, "readDevToolsSnapshot");
|
|
@@ -1413,26 +74,26 @@ function readDevToolsSnapshotWithRouter(api, router) {
|
|
|
1413
74
|
}
|
|
1414
75
|
__name(readDevToolsSnapshotWithRouter, "readDevToolsSnapshotWithRouter");
|
|
1415
76
|
function DevToolsPanel(props = {}) {
|
|
1416
|
-
const refreshCount = state(0);
|
|
1417
|
-
const activeSection = state("updates");
|
|
1418
|
-
const activeAdvancedSection = state("signals");
|
|
1419
|
-
const activeRouterTab = state("context");
|
|
1420
|
-
const activeUpdatesTab = state("updates");
|
|
1421
|
-
const activeComponentsTab = state("tree");
|
|
1422
|
-
const activeRouteView = state("tree");
|
|
1423
|
-
const activeTimelineFilter = state("all");
|
|
1424
|
-
const networkSelection = state(null);
|
|
1425
|
-
const networkSourceFilter = state("all");
|
|
1426
|
-
const networkStatusFilter = state("all");
|
|
1427
|
-
const networkDetailTab = state("overview");
|
|
1428
|
-
const networkTesterOpen = state(false);
|
|
1429
|
-
const networkTesterRevision = state(0);
|
|
1430
|
-
const networkTesterRun = state({ status: "idle" });
|
|
1431
|
-
const networkTesterTab = state("params");
|
|
77
|
+
const refreshCount = (0, import_vobs.state)(0);
|
|
78
|
+
const activeSection = (0, import_vobs.state)("updates");
|
|
79
|
+
const activeAdvancedSection = (0, import_vobs.state)("signals");
|
|
80
|
+
const activeRouterTab = (0, import_vobs.state)("context");
|
|
81
|
+
const activeUpdatesTab = (0, import_vobs.state)("updates");
|
|
82
|
+
const activeComponentsTab = (0, import_vobs.state)("tree");
|
|
83
|
+
const activeRouteView = (0, import_vobs.state)("tree");
|
|
84
|
+
const activeTimelineFilter = (0, import_vobs.state)("all");
|
|
85
|
+
const networkSelection = (0, import_vobs.state)(null);
|
|
86
|
+
const networkSourceFilter = (0, import_vobs.state)("all");
|
|
87
|
+
const networkStatusFilter = (0, import_vobs.state)("all");
|
|
88
|
+
const networkDetailTab = (0, import_vobs.state)("overview");
|
|
89
|
+
const networkTesterOpen = (0, import_vobs.state)(false);
|
|
90
|
+
const networkTesterRevision = (0, import_vobs.state)(0);
|
|
91
|
+
const networkTesterRun = (0, import_vobs.state)({ status: "idle" });
|
|
92
|
+
const networkTesterTab = (0, import_vobs.state)("params");
|
|
1432
93
|
let networkTesterDraft = createRequestTesterDraft();
|
|
1433
|
-
const selection = state(null);
|
|
1434
|
-
const query = props.query ?? state("");
|
|
1435
|
-
const http = props.http ?? inject(HTTP_KEY) ?? null;
|
|
94
|
+
const selection = (0, import_vobs.state)(null);
|
|
95
|
+
const query = props.query ?? (0, import_vobs.state)("");
|
|
96
|
+
const http = props.http ?? (0, import_vobs.inject)(import_http.HTTP_KEY) ?? null;
|
|
1436
97
|
let refreshInvalidating = false;
|
|
1437
98
|
const notifyRefresh = /* @__PURE__ */ __name(() => {
|
|
1438
99
|
if (refreshInvalidating) return;
|
|
@@ -1446,7 +107,7 @@ function DevToolsPanel(props = {}) {
|
|
|
1446
107
|
const api = resolveApi(props);
|
|
1447
108
|
if (api) {
|
|
1448
109
|
const stops = PANEL_REFRESH_EVENTS.map((event) => api.subscribe(event, notifyRefresh));
|
|
1449
|
-
onDispose(() => {
|
|
110
|
+
(0, import_vobs.onDispose)(() => {
|
|
1450
111
|
for (const stop of stops) stop();
|
|
1451
112
|
});
|
|
1452
113
|
}
|
|
@@ -1457,7 +118,7 @@ function DevToolsPanel(props = {}) {
|
|
|
1457
118
|
const stopNavigation = router.devtools.subscribe("navigation:end", notifyRefresh);
|
|
1458
119
|
const stopRouteUpdate = router.devtools.subscribe("route:update", notifyRefresh);
|
|
1459
120
|
const stopRouteError = router.devtools.subscribe("error", notifyRefresh);
|
|
1460
|
-
onDispose(() => {
|
|
121
|
+
(0, import_vobs.onDispose)(() => {
|
|
1461
122
|
stopNavigationStart();
|
|
1462
123
|
stopNavigation();
|
|
1463
124
|
stopRouteUpdate();
|
|
@@ -1466,55 +127,55 @@ function DevToolsPanel(props = {}) {
|
|
|
1466
127
|
});
|
|
1467
128
|
}
|
|
1468
129
|
const toolbarPlacement = props.toolbarPlacement ?? "content";
|
|
1469
|
-
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 }));
|
|
130
|
+
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 }));
|
|
1470
131
|
}
|
|
1471
132
|
__name(DevToolsPanel, "DevToolsPanel");
|
|
1472
133
|
function DevToolsToolbar(props) {
|
|
1473
|
-
const refreshCount = state(0);
|
|
134
|
+
const refreshCount = (0, import_vobs.state)(0);
|
|
1474
135
|
if (props.api) {
|
|
1475
136
|
const stops = ["collection", "collection-cleared"].map((event) => props.api.subscribe(event, () => {
|
|
1476
137
|
refreshCount.value++;
|
|
1477
138
|
}));
|
|
1478
|
-
onDispose(() => {
|
|
139
|
+
(0, import_vobs.onDispose)(() => {
|
|
1479
140
|
for (const stop of stops) stop();
|
|
1480
141
|
});
|
|
1481
142
|
}
|
|
1482
|
-
return createFragment((parent, anchor) => {
|
|
1483
|
-
const toolbar = createElement("div");
|
|
1484
|
-
setAttribute(toolbar, "class", "vobs-devtools-collection-toolbar vobs-devtools-collection-toolbar--header");
|
|
1485
|
-
const search = createElement("input");
|
|
1486
|
-
setAttribute(search, "class", "vobs-devtools-search vobs-devtools-header-search");
|
|
1487
|
-
setAttribute(search, "type", "search");
|
|
1488
|
-
setAttribute(search, "placeholder", "Search diagnostics");
|
|
1489
|
-
effect(() => {
|
|
143
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
144
|
+
const toolbar = (0, import_vobs.createElement)("div");
|
|
145
|
+
(0, import_vobs.setAttribute)(toolbar, "class", "vobs-devtools-collection-toolbar vobs-devtools-collection-toolbar--header");
|
|
146
|
+
const search = (0, import_vobs.createElement)("input");
|
|
147
|
+
(0, import_vobs.setAttribute)(search, "class", "vobs-devtools-search vobs-devtools-header-search");
|
|
148
|
+
(0, import_vobs.setAttribute)(search, "type", "search");
|
|
149
|
+
(0, import_vobs.setAttribute)(search, "placeholder", "Search diagnostics");
|
|
150
|
+
(0, import_reactivity.effect)(() => {
|
|
1490
151
|
const next = props.query.value;
|
|
1491
|
-
if (search.value !== next) setProperty(search, "value", next);
|
|
152
|
+
if (search.value !== next) (0, import_vobs.setProperty)(search, "value", next);
|
|
1492
153
|
});
|
|
1493
154
|
search.addEventListener("input", () => {
|
|
1494
155
|
props.query.value = search.value;
|
|
1495
156
|
});
|
|
1496
|
-
insertBefore(toolbar, search, null);
|
|
1497
|
-
const actions = createElement("div");
|
|
1498
|
-
setAttribute(actions, "class", "vobs-devtools-collection-toolbar__actions");
|
|
1499
|
-
insertBefore(toolbar, actions, null);
|
|
1500
|
-
insertBefore(parent, toolbar, anchor);
|
|
1501
|
-
insertDynamic(actions, null, () => {
|
|
157
|
+
(0, import_vobs.insertBefore)(toolbar, search, null);
|
|
158
|
+
const actions = (0, import_vobs.createElement)("div");
|
|
159
|
+
(0, import_vobs.setAttribute)(actions, "class", "vobs-devtools-collection-toolbar__actions");
|
|
160
|
+
(0, import_vobs.insertBefore)(toolbar, actions, null);
|
|
161
|
+
(0, import_vobs.insertBefore)(parent, toolbar, anchor);
|
|
162
|
+
(0, import_vobs.insertDynamic)(actions, null, () => {
|
|
1502
163
|
void refreshCount.value;
|
|
1503
164
|
if (!props.api) return null;
|
|
1504
165
|
const paused = props.api.getCollectionState().paused;
|
|
1505
|
-
return createFragment((actionParent, actionAnchor) => {
|
|
1506
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
166
|
+
return (0, import_vobs.createFragment)((actionParent, actionAnchor) => {
|
|
167
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1507
168
|
variant: paused ? "warning" : "secondary",
|
|
1508
169
|
iconOnly: true,
|
|
1509
|
-
icon: createComponent(Icon, { name: paused ? "play" : "pause" }),
|
|
170
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: paused ? "play" : "pause" }),
|
|
1510
171
|
"aria-label": paused ? "Resume collection" : "Pause collection",
|
|
1511
172
|
title: paused ? "Resume collection" : "Pause collection",
|
|
1512
173
|
onClick: /* @__PURE__ */ __name(() => props.api?.setCollectionPaused(!paused), "onClick")
|
|
1513
174
|
}), actionAnchor);
|
|
1514
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
175
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1515
176
|
variant: "danger-subtle",
|
|
1516
177
|
iconOnly: true,
|
|
1517
|
-
icon: createComponent(Icon, { name: "trash" }),
|
|
178
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "trash" }),
|
|
1518
179
|
"aria-label": "Clear diagnostics",
|
|
1519
180
|
title: "Clear diagnostics",
|
|
1520
181
|
onClick: /* @__PURE__ */ __name(() => {
|
|
@@ -1533,37 +194,37 @@ function DevToolsToolbar(props) {
|
|
|
1533
194
|
link.click();
|
|
1534
195
|
URL.revokeObjectURL(link.href);
|
|
1535
196
|
}, "exportDiagnostics");
|
|
1536
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
197
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1537
198
|
variant: "ghost",
|
|
1538
199
|
iconOnly: true,
|
|
1539
|
-
icon: createComponent(Icon, { name: "download" }),
|
|
200
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "download" }),
|
|
1540
201
|
"aria-label": "Export diagnostics",
|
|
1541
202
|
title: "Export diagnostics",
|
|
1542
203
|
onClick: exportDiagnostics
|
|
1543
204
|
}), actionAnchor);
|
|
1544
|
-
const importInput = createElement("input");
|
|
1545
|
-
setAttribute(importInput, "type", "file");
|
|
1546
|
-
setAttribute(importInput, "accept", "application/json,.json");
|
|
1547
|
-
setAttribute(importInput, "aria-label", "Import diagnostics");
|
|
1548
|
-
setAttribute(importInput, "hidden", "");
|
|
205
|
+
const importInput = (0, import_vobs.createElement)("input");
|
|
206
|
+
(0, import_vobs.setAttribute)(importInput, "type", "file");
|
|
207
|
+
(0, import_vobs.setAttribute)(importInput, "accept", "application/json,.json");
|
|
208
|
+
(0, import_vobs.setAttribute)(importInput, "aria-label", "Import diagnostics");
|
|
209
|
+
(0, import_vobs.setAttribute)(importInput, "hidden", "");
|
|
1549
210
|
importInput.addEventListener("change", () => {
|
|
1550
211
|
const file = importInput.files?.[0];
|
|
1551
212
|
if (!file) return;
|
|
1552
213
|
void file.text().then((text) => props.api?.importDiagnostics(JSON.parse(text))).catch((error) => props.api?.reportError("global", error));
|
|
1553
214
|
});
|
|
1554
|
-
insertBefore(actionParent, importInput, actionAnchor);
|
|
1555
|
-
insertBefore(actionParent, createComponent(Button, {
|
|
215
|
+
(0, import_vobs.insertBefore)(actionParent, importInput, actionAnchor);
|
|
216
|
+
(0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1556
217
|
variant: "ghost",
|
|
1557
218
|
iconOnly: true,
|
|
1558
|
-
icon: createComponent(Icon, { name: "upload" }),
|
|
219
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "upload" }),
|
|
1559
220
|
"aria-label": "Import diagnostics",
|
|
1560
221
|
title: "Import diagnostics",
|
|
1561
222
|
onClick: /* @__PURE__ */ __name(() => importInput.click(), "onClick")
|
|
1562
223
|
}), actionAnchor);
|
|
1563
|
-
if (props.onToggleMaximize) insertBefore(actionParent, createComponent(Button, {
|
|
224
|
+
if (props.onToggleMaximize) (0, import_vobs.insertBefore)(actionParent, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
1564
225
|
variant: "ghost",
|
|
1565
226
|
iconOnly: true,
|
|
1566
|
-
icon: createComponent(Icon, { name: props.maximized ? "arrow-minimize" : "arrow-expand" }),
|
|
227
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: props.maximized ? "arrow-minimize" : "arrow-expand" }),
|
|
1567
228
|
"aria-label": props.maximized ? "Restore DevTools" : "Maximize DevTools",
|
|
1568
229
|
title: props.maximized ? "Restore DevTools" : "Maximize DevTools",
|
|
1569
230
|
onClick: props.onToggleMaximize
|
|
@@ -1585,12 +246,12 @@ var TIMELINE_FILTER_OPTIONS = [
|
|
|
1585
246
|
{ value: "error", label: "Errors" }
|
|
1586
247
|
];
|
|
1587
248
|
function resolveApi(props) {
|
|
1588
|
-
return props.api === void 0 ? getDevTools() : props.api;
|
|
249
|
+
return props.api === void 0 ? (0, import_devtools.getDevTools)() : props.api;
|
|
1589
250
|
}
|
|
1590
251
|
__name(resolveApi, "resolveApi");
|
|
1591
252
|
function DevToolsContent(props) {
|
|
1592
|
-
return createFragment((parent, anchor) => {
|
|
1593
|
-
insertDynamic(parent, anchor, () => {
|
|
253
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
254
|
+
(0, import_vobs.insertDynamic)(parent, anchor, () => {
|
|
1594
255
|
void props.refreshCount.value;
|
|
1595
256
|
void props.activeSection.value;
|
|
1596
257
|
void props.activeRouterTab.value;
|
|
@@ -1614,8 +275,8 @@ function DevToolsContent(props) {
|
|
|
1614
275
|
}
|
|
1615
276
|
__name(DevToolsContent, "DevToolsContent");
|
|
1616
277
|
function ActivityRail(props) {
|
|
1617
|
-
return createFragment((parent, anchor) => {
|
|
1618
|
-
insertDynamic(parent, anchor, () => {
|
|
278
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
279
|
+
(0, import_vobs.insertDynamic)(parent, anchor, () => {
|
|
1619
280
|
void props.refreshCount.value;
|
|
1620
281
|
const filter = props.activeFilter.value;
|
|
1621
282
|
const selected = props.selection.value;
|
|
@@ -1637,25 +298,25 @@ function focusSelection(activeSection, selection) {
|
|
|
1637
298
|
}
|
|
1638
299
|
__name(focusSelection, "focusSelection");
|
|
1639
300
|
function SectionNav(props) {
|
|
1640
|
-
return createFragment((parent, anchor) => {
|
|
1641
|
-
insertDynamic(parent, anchor, () => {
|
|
301
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
302
|
+
(0, import_vobs.insertDynamic)(parent, anchor, () => {
|
|
1642
303
|
const selected = props.activeSection.value;
|
|
1643
|
-
return createFragment((navParent, navAnchor) => {
|
|
304
|
+
return (0, import_vobs.createFragment)((navParent, navAnchor) => {
|
|
1644
305
|
for (const section of ["updates", "components", "advanced", "network", "errors", "router"]) {
|
|
1645
306
|
const label = section === "components" ? "comp..." : section === "advanced" ? "adv..." : section;
|
|
1646
|
-
const button = createElement("button");
|
|
1647
|
-
setAttribute(button, "class", `vobs-devtools-shell__nav-item${selected === section ? " is-active" : ""}`);
|
|
1648
|
-
setAttribute(button, "type", "button");
|
|
307
|
+
const button = (0, import_vobs.createElement)("button");
|
|
308
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-shell__nav-item${selected === section ? " is-active" : ""}`);
|
|
309
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
1649
310
|
const accessibleLabel = section === "advanced" ? "Advanced" : section;
|
|
1650
|
-
setAttribute(button, "aria-label", accessibleLabel);
|
|
1651
|
-
setAttribute(button, "title", accessibleLabel);
|
|
1652
|
-
setAttribute(button, "aria-pressed", selected === section ? "true" : "false");
|
|
1653
|
-
insertBefore(button, createComponent(Icon, { name: section === "router" ? "folder" : section === "components" ? "code" : section === "advanced" ? "atom" : section === "network" ? "globe" : section === "errors" ? "alert-triangle" : "refresh" }), null);
|
|
1654
|
-
insertBefore(button, createElementText(label), null);
|
|
311
|
+
(0, import_vobs.setAttribute)(button, "aria-label", accessibleLabel);
|
|
312
|
+
(0, import_vobs.setAttribute)(button, "title", accessibleLabel);
|
|
313
|
+
(0, import_vobs.setAttribute)(button, "aria-pressed", selected === section ? "true" : "false");
|
|
314
|
+
(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);
|
|
315
|
+
(0, import_vobs.insertBefore)(button, createElementText(label), null);
|
|
1655
316
|
button.addEventListener("click", () => {
|
|
1656
317
|
props.activeSection.value = section;
|
|
1657
318
|
});
|
|
1658
|
-
insertBefore(navParent, button, navAnchor);
|
|
319
|
+
(0, import_vobs.insertBefore)(navParent, button, navAnchor);
|
|
1659
320
|
}
|
|
1660
321
|
});
|
|
1661
322
|
});
|
|
@@ -1711,15 +372,15 @@ function collectActivityTimeline(snapshot, router, filter = "all") {
|
|
|
1711
372
|
}
|
|
1712
373
|
__name(collectActivityTimeline, "collectActivityTimeline");
|
|
1713
374
|
function renderActivityRail(updates, timeline, api, selection, filter, onFilterChange, onFocus) {
|
|
1714
|
-
const root = createElement("aside");
|
|
1715
|
-
setAttribute(root, "class", "vobs-devtools-shell__activity");
|
|
1716
|
-
const header = createElement("div");
|
|
1717
|
-
setAttribute(header, "class", "vobs-devtools-shell__activity-header");
|
|
1718
|
-
const title = createElement("div");
|
|
1719
|
-
setAttribute(title, "class", "vobs-devtools-shell__activity-title");
|
|
1720
|
-
insertBefore(title, createElementText("Timeline"), null);
|
|
1721
|
-
insertBefore(header, title, null);
|
|
1722
|
-
insertBefore(header, createComponent(Select, {
|
|
375
|
+
const root = (0, import_vobs.createElement)("aside");
|
|
376
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-shell__activity");
|
|
377
|
+
const header = (0, import_vobs.createElement)("div");
|
|
378
|
+
(0, import_vobs.setAttribute)(header, "class", "vobs-devtools-shell__activity-header");
|
|
379
|
+
const title = (0, import_vobs.createElement)("div");
|
|
380
|
+
(0, import_vobs.setAttribute)(title, "class", "vobs-devtools-shell__activity-title");
|
|
381
|
+
(0, import_vobs.insertBefore)(title, createElementText("Timeline"), null);
|
|
382
|
+
(0, import_vobs.insertBefore)(header, title, null);
|
|
383
|
+
(0, import_vobs.insertBefore)(header, (0, import_vobs.createComponent)(import_ui.Select, {
|
|
1723
384
|
class: "vobs-devtools-timeline-filter",
|
|
1724
385
|
value: filter,
|
|
1725
386
|
"aria-label": "Filter timeline events",
|
|
@@ -1727,51 +388,51 @@ function renderActivityRail(updates, timeline, api, selection, filter, onFilterC
|
|
|
1727
388
|
const next = event.target.value;
|
|
1728
389
|
if (isTimelineFilter(next)) onFilterChange(next);
|
|
1729
390
|
}, "onChange"),
|
|
1730
|
-
children: /* @__PURE__ */ __name(() => createFragment((parent, anchor) => {
|
|
391
|
+
children: /* @__PURE__ */ __name(() => (0, import_vobs.createFragment)((parent, anchor) => {
|
|
1731
392
|
for (const option of TIMELINE_FILTER_OPTIONS) {
|
|
1732
|
-
const optionNode = createElement("option");
|
|
1733
|
-
setAttribute(optionNode, "value", option.value);
|
|
1734
|
-
insertBefore(optionNode, createText(option.label), null);
|
|
1735
|
-
insertBefore(parent, optionNode, anchor);
|
|
393
|
+
const optionNode = (0, import_vobs.createElement)("option");
|
|
394
|
+
(0, import_vobs.setAttribute)(optionNode, "value", option.value);
|
|
395
|
+
(0, import_vobs.insertBefore)(optionNode, (0, import_vobs.createText)(option.label), null);
|
|
396
|
+
(0, import_vobs.insertBefore)(parent, optionNode, anchor);
|
|
1736
397
|
}
|
|
1737
398
|
}), "children")
|
|
1738
399
|
}), null);
|
|
1739
|
-
insertBefore(root, header, null);
|
|
1740
|
-
const subtitle = createElement("div");
|
|
1741
|
-
setAttribute(subtitle, "class", "vobs-devtools-shell__activity-subtitle");
|
|
1742
|
-
insertBefore(subtitle, createElementText(`${timeline.length} shown \xB7 ${updates.length} updates`), null);
|
|
1743
|
-
insertBefore(root, subtitle, null);
|
|
1744
|
-
const list = createElement("div");
|
|
1745
|
-
setAttribute(list, "class", "vobs-devtools-activity-list");
|
|
400
|
+
(0, import_vobs.insertBefore)(root, header, null);
|
|
401
|
+
const subtitle = (0, import_vobs.createElement)("div");
|
|
402
|
+
(0, import_vobs.setAttribute)(subtitle, "class", "vobs-devtools-shell__activity-subtitle");
|
|
403
|
+
(0, import_vobs.insertBefore)(subtitle, createElementText(`${timeline.length} shown \xB7 ${updates.length} updates`), null);
|
|
404
|
+
(0, import_vobs.insertBefore)(root, subtitle, null);
|
|
405
|
+
const list = (0, import_vobs.createElement)("div");
|
|
406
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-activity-list");
|
|
1746
407
|
for (const entry of timeline) {
|
|
1747
408
|
const update = entry.update;
|
|
1748
|
-
const activityItem = createElement("div");
|
|
1749
|
-
setAttribute(activityItem, "class", `vobs-devtools-activity-item${update && selection?.type === "update" && selection.id === update.id ? " is-selected" : ""}`);
|
|
409
|
+
const activityItem = (0, import_vobs.createElement)("div");
|
|
410
|
+
(0, import_vobs.setAttribute)(activityItem, "class", `vobs-devtools-activity-item${update && selection?.type === "update" && selection.id === update.id ? " is-selected" : ""}`);
|
|
1750
411
|
if (update) activityItem.addEventListener("click", () => onFocus("updates", { type: "update", id: update.id }));
|
|
1751
|
-
const dot = createElement("span");
|
|
1752
|
-
setAttribute(dot, "class", "vobs-devtools-activity-item__dot");
|
|
1753
|
-
insertBefore(dot, createComponent(Icon, { name: entry.icon }), null);
|
|
1754
|
-
const body = createElement("div");
|
|
1755
|
-
setAttribute(body, "class", "vobs-devtools-activity-item__body");
|
|
1756
|
-
const name = createElement("span");
|
|
1757
|
-
setAttribute(name, "class", "vobs-devtools-activity-item__name");
|
|
412
|
+
const dot = (0, import_vobs.createElement)("span");
|
|
413
|
+
(0, import_vobs.setAttribute)(dot, "class", "vobs-devtools-activity-item__dot");
|
|
414
|
+
(0, import_vobs.insertBefore)(dot, (0, import_vobs.createComponent)(import_ui.Icon, { name: entry.icon }), null);
|
|
415
|
+
const body = (0, import_vobs.createElement)("div");
|
|
416
|
+
(0, import_vobs.setAttribute)(body, "class", "vobs-devtools-activity-item__body");
|
|
417
|
+
const name = (0, import_vobs.createElement)("span");
|
|
418
|
+
(0, import_vobs.setAttribute)(name, "class", "vobs-devtools-activity-item__name");
|
|
1758
419
|
const signal = update ? api?.getSignal(update.signalId) : void 0;
|
|
1759
|
-
insertBefore(name, createElementText(entry.title), null);
|
|
1760
|
-
const detail = createElement("span");
|
|
1761
|
-
insertBefore(detail, createElementText(entry.detail ?? (update ? `${formatDebugSource(signal?.component ?? "unknown")} \xB7 ${update.duration.toFixed(2)} ms \xB7 ${update.effects.length} effects` : "")), null);
|
|
1762
|
-
insertBefore(body, name, null);
|
|
1763
|
-
insertBefore(body, detail, null);
|
|
1764
|
-
insertBefore(activityItem, dot, null);
|
|
1765
|
-
insertBefore(activityItem, body, null);
|
|
1766
|
-
insertBefore(list, activityItem, null);
|
|
420
|
+
(0, import_vobs.insertBefore)(name, createElementText(entry.title), null);
|
|
421
|
+
const detail = (0, import_vobs.createElement)("span");
|
|
422
|
+
(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);
|
|
423
|
+
(0, import_vobs.insertBefore)(body, name, null);
|
|
424
|
+
(0, import_vobs.insertBefore)(body, detail, null);
|
|
425
|
+
(0, import_vobs.insertBefore)(activityItem, dot, null);
|
|
426
|
+
(0, import_vobs.insertBefore)(activityItem, body, null);
|
|
427
|
+
(0, import_vobs.insertBefore)(list, activityItem, null);
|
|
1767
428
|
}
|
|
1768
429
|
if (timeline.length === 0) {
|
|
1769
|
-
const empty = createElement("span");
|
|
1770
|
-
setAttribute(empty, "class", "vobs-devtools-muted");
|
|
1771
|
-
insertBefore(empty, createElementText(filter === "all" ? "No recent events." : `No ${timelineFilterLabel(filter).toLowerCase()} events.`), null);
|
|
1772
|
-
insertBefore(list, empty, null);
|
|
430
|
+
const empty = (0, import_vobs.createElement)("span");
|
|
431
|
+
(0, import_vobs.setAttribute)(empty, "class", "vobs-devtools-muted");
|
|
432
|
+
(0, import_vobs.insertBefore)(empty, createElementText(filter === "all" ? "No recent events." : `No ${timelineFilterLabel(filter).toLowerCase()} events.`), null);
|
|
433
|
+
(0, import_vobs.insertBefore)(list, empty, null);
|
|
1773
434
|
}
|
|
1774
|
-
insertBefore(root, list, null);
|
|
435
|
+
(0, import_vobs.insertBefore)(root, list, null);
|
|
1775
436
|
return root;
|
|
1776
437
|
}
|
|
1777
438
|
__name(renderActivityRail, "renderActivityRail");
|
|
@@ -1784,12 +445,12 @@ function timelineFilterLabel(filter) {
|
|
|
1784
445
|
}
|
|
1785
446
|
__name(timelineFilterLabel, "timelineFilterLabel");
|
|
1786
447
|
function createElementText(value) {
|
|
1787
|
-
return createText(value);
|
|
448
|
+
return (0, import_vobs.createText)(value);
|
|
1788
449
|
}
|
|
1789
450
|
__name(createElementText, "createElementText");
|
|
1790
451
|
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) {
|
|
1791
452
|
if (!snapshot.api) {
|
|
1792
|
-
return createComponent(Alert, {
|
|
453
|
+
return (0, import_vobs.createComponent)(import_ui.Alert, {
|
|
1793
454
|
description: "Enable the devtools plugin to inspect the runtime."
|
|
1794
455
|
});
|
|
1795
456
|
}
|
|
@@ -1800,28 +461,28 @@ function renderFocusedSection(snapshot, section, router, activeRouterTab, active
|
|
|
1800
461
|
if (section === "router") return renderRouterSection(router, activeRouterTab, activeRouteView);
|
|
1801
462
|
if (section === "updates") return renderUpdatesSection(snapshot, activeUpdatesTab, query, selection, onFocus);
|
|
1802
463
|
if (section === "components") return renderComponentsSection(snapshot, activeComponentsTab, query, selection, onFocus);
|
|
1803
|
-
if (section === "network") return createComponent(Card, {
|
|
464
|
+
if (section === "network") return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1804
465
|
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")
|
|
1805
466
|
});
|
|
1806
|
-
if (section === "errors") return createComponent(Card, {
|
|
467
|
+
if (section === "errors") return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1807
468
|
description: `${snapshot.errors.length} retained unique errors`,
|
|
1808
469
|
children: /* @__PURE__ */ __name(() => renderErrors(filterErrors(snapshot.errors, query), selection, onFocus), "children")
|
|
1809
470
|
});
|
|
1810
471
|
if (section === "advanced") return renderAdvancedSection(snapshot, activeAdvancedSection, query);
|
|
1811
|
-
const list = createElement("div");
|
|
1812
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
472
|
+
const list = (0, import_vobs.createElement)("div");
|
|
473
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1813
474
|
let title = "Recent updates";
|
|
1814
475
|
let description = `${snapshot.updates.length} retained traces`;
|
|
1815
|
-
return createComponent(Card, { title, description, children: /* @__PURE__ */ __name(() => list, "children") });
|
|
476
|
+
return (0, import_vobs.createComponent)(import_ui.Card, { title, description, children: /* @__PURE__ */ __name(() => list, "children") });
|
|
1816
477
|
}
|
|
1817
478
|
__name(renderFocusedSection, "renderFocusedSection");
|
|
1818
479
|
function renderComponentsSection(snapshot, activeTab, query = "", selection = null, onFocus = () => void 0) {
|
|
1819
|
-
const tabs = createComponent(Tabs, {
|
|
480
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1820
481
|
class: "vobs-devtools-router-tabs",
|
|
1821
482
|
variant: "filled",
|
|
1822
483
|
items: [
|
|
1823
484
|
{ id: "tree", label: "Component tree", content: /* @__PURE__ */ __name(() => renderComponentTree(snapshot, query, selection, onFocus), "content") },
|
|
1824
|
-
{ id: "lifecycle", label: "Lifecycle timeline", content: /* @__PURE__ */ __name(() => createComponent(Card, {
|
|
485
|
+
{ id: "lifecycle", label: "Lifecycle timeline", content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1825
486
|
class: "vobs-devtools-lifecycle-card",
|
|
1826
487
|
description: `${snapshot.lifecycle.length} retained runtime events`,
|
|
1827
488
|
children: /* @__PURE__ */ __name(() => renderLifecycleTimeline(snapshot.lifecycle, (section, next) => {
|
|
@@ -1837,19 +498,19 @@ function renderComponentsSection(snapshot, activeTab, query = "", selection = nu
|
|
|
1837
498
|
if (activeTab && isComponentsPanelTab(id)) activeTab.value = id;
|
|
1838
499
|
}, "onChange")
|
|
1839
500
|
});
|
|
1840
|
-
const root = createElement("div");
|
|
1841
|
-
setAttribute(root, "class", "vobs-devtools-components-tabs-wrap");
|
|
1842
|
-
insertBefore(root, tabs, null);
|
|
501
|
+
const root = (0, import_vobs.createElement)("div");
|
|
502
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-components-tabs-wrap");
|
|
503
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1843
504
|
return root;
|
|
1844
505
|
}
|
|
1845
506
|
__name(renderComponentsSection, "renderComponentsSection");
|
|
1846
507
|
function renderComponentTree(snapshot, query, selection, onFocus) {
|
|
1847
508
|
const componentTree = filterComponentTree(snapshot.tree, query);
|
|
1848
|
-
const list = createElement("div");
|
|
1849
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
1850
|
-
for (const node of componentTree) insertBefore(list, renderComponentSummary(node, snapshot, selection, onFocus), null);
|
|
509
|
+
const list = (0, import_vobs.createElement)("div");
|
|
510
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
511
|
+
for (const node of componentTree) (0, import_vobs.insertBefore)(list, renderComponentSummary(node, snapshot, selection, onFocus), null);
|
|
1851
512
|
if (componentTree.length === 0) appendMuted(list, query ? "No components match the search." : "No components recorded.");
|
|
1852
|
-
return createComponent(Card, {
|
|
513
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1853
514
|
class: "vobs-devtools-component-tree-card",
|
|
1854
515
|
description: `Component tree ${snapshot.memory?.ownerCount ?? 0} active owners`,
|
|
1855
516
|
children: /* @__PURE__ */ __name(() => list, "children")
|
|
@@ -1861,7 +522,7 @@ function isComponentsPanelTab(value) {
|
|
|
1861
522
|
}
|
|
1862
523
|
__name(isComponentsPanelTab, "isComponentsPanelTab");
|
|
1863
524
|
function renderUpdatesSection(snapshot, activeTab, query = "", selection = null, onFocus = () => void 0) {
|
|
1864
|
-
const tabs = createComponent(Tabs, {
|
|
525
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1865
526
|
class: "vobs-devtools-router-tabs",
|
|
1866
527
|
variant: "filled",
|
|
1867
528
|
items: [
|
|
@@ -1876,9 +537,9 @@ function renderUpdatesSection(snapshot, activeTab, query = "", selection = null,
|
|
|
1876
537
|
if (activeTab && isUpdatesPanelTab(id)) activeTab.value = id;
|
|
1877
538
|
}, "onChange")
|
|
1878
539
|
});
|
|
1879
|
-
const root = createElement("div");
|
|
1880
|
-
setAttribute(root, "class", "vobs-devtools-updates-tabs-wrap");
|
|
1881
|
-
insertBefore(root, tabs, null);
|
|
540
|
+
const root = (0, import_vobs.createElement)("div");
|
|
541
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-updates-tabs-wrap");
|
|
542
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1882
543
|
return root;
|
|
1883
544
|
}
|
|
1884
545
|
__name(renderUpdatesSection, "renderUpdatesSection");
|
|
@@ -1887,20 +548,20 @@ function isUpdatesPanelTab(value) {
|
|
|
1887
548
|
}
|
|
1888
549
|
__name(isUpdatesPanelTab, "isUpdatesPanelTab");
|
|
1889
550
|
function renderUpdatesList(snapshot, query, selection, onFocus) {
|
|
1890
|
-
const list = createElement("div");
|
|
1891
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
551
|
+
const list = (0, import_vobs.createElement)("div");
|
|
552
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1892
553
|
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)) {
|
|
1893
|
-
insertBefore(list, renderUpdateRow(update, snapshot.api, selection, onFocus), null);
|
|
554
|
+
(0, import_vobs.insertBefore)(list, renderUpdateRow(update, snapshot.api, selection, onFocus), null);
|
|
1894
555
|
}
|
|
1895
556
|
if (snapshot.updates.length === 0) appendMuted(list, "Interact with the playground to record updates.");
|
|
1896
|
-
return createComponent(Card, {
|
|
557
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1897
558
|
class: "vobs-devtools-updates-card",
|
|
1898
559
|
children: /* @__PURE__ */ __name(() => list, "children")
|
|
1899
560
|
});
|
|
1900
561
|
}
|
|
1901
562
|
__name(renderUpdatesList, "renderUpdatesList");
|
|
1902
563
|
function renderAdvancedSection(snapshot, activeSection, query = "") {
|
|
1903
|
-
const tabs = createComponent(Tabs, {
|
|
564
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
1904
565
|
class: "vobs-devtools-advanced-tabs",
|
|
1905
566
|
variant: "filled",
|
|
1906
567
|
items: [
|
|
@@ -1914,47 +575,47 @@ function renderAdvancedSection(snapshot, activeSection, query = "") {
|
|
|
1914
575
|
if (activeSection) activeSection.value = id;
|
|
1915
576
|
}, "onChange")
|
|
1916
577
|
});
|
|
1917
|
-
const root = createElement("div");
|
|
1918
|
-
setAttribute(root, "class", "vobs-devtools-advanced");
|
|
1919
|
-
insertBefore(root, tabs, null);
|
|
578
|
+
const root = (0, import_vobs.createElement)("div");
|
|
579
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-advanced");
|
|
580
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1920
581
|
return root;
|
|
1921
582
|
}
|
|
1922
583
|
__name(renderAdvancedSection, "renderAdvancedSection");
|
|
1923
584
|
function renderSignalsInspector(snapshot, query) {
|
|
1924
|
-
const list = createElement("div");
|
|
1925
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
585
|
+
const list = (0, import_vobs.createElement)("div");
|
|
586
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1926
587
|
const signals = snapshot.signals.filter((signal) => matchesQuery(query, signal.name, signal.component, formatValue(signal.value))).slice(0, 50);
|
|
1927
|
-
for (const signal of signals) insertBefore(list, renderSignalInspector(signal, snapshot.api), null);
|
|
588
|
+
for (const signal of signals) (0, import_vobs.insertBefore)(list, renderSignalInspector(signal, snapshot.api), null);
|
|
1928
589
|
if (signals.length === 0) appendMuted(list, query ? "No signals match the search." : "No signals recorded.");
|
|
1929
590
|
return list;
|
|
1930
591
|
}
|
|
1931
592
|
__name(renderSignalsInspector, "renderSignalsInspector");
|
|
1932
593
|
function renderEffectsInspector(snapshot, query) {
|
|
1933
|
-
const list = createElement("div");
|
|
1934
|
-
setAttribute(list, "class", "vobs-devtools-list");
|
|
594
|
+
const list = (0, import_vobs.createElement)("div");
|
|
595
|
+
(0, import_vobs.setAttribute)(list, "class", "vobs-devtools-list");
|
|
1935
596
|
const effects = snapshot.effects.filter((effect2) => matchesQuery(query, effect2.name, effect2.component, effect2.id)).slice(0, 50);
|
|
1936
|
-
for (const effect2 of effects) insertBefore(list, renderEffectRow(effect2), null);
|
|
597
|
+
for (const effect2 of effects) (0, import_vobs.insertBefore)(list, renderEffectRow(effect2), null);
|
|
1937
598
|
if (effects.length === 0) appendMuted(list, query ? "No effects match the search." : "No effects recorded.");
|
|
1938
599
|
return list;
|
|
1939
600
|
}
|
|
1940
601
|
__name(renderEffectsInspector, "renderEffectsInspector");
|
|
1941
602
|
function renderPerformanceMetrics(metrics) {
|
|
1942
603
|
if (!metrics) {
|
|
1943
|
-
return createComponent(Card, { description: "Performance: Lightweight slow-path summary for the retained diagnostics.", children: /* @__PURE__ */ __name(() => {
|
|
1944
|
-
const root = createElement("div");
|
|
604
|
+
return (0, import_vobs.createComponent)(import_ui.Card, { description: "Performance: Lightweight slow-path summary for the retained diagnostics.", children: /* @__PURE__ */ __name(() => {
|
|
605
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1945
606
|
appendMuted(root, "No performance data available.");
|
|
1946
607
|
return root;
|
|
1947
608
|
}, "children") });
|
|
1948
609
|
}
|
|
1949
|
-
const metricsGrid = createElement("div");
|
|
1950
|
-
setAttribute(metricsGrid, "class", "vobs-devtools-performance-metrics");
|
|
610
|
+
const metricsGrid = (0, import_vobs.createElement)("div");
|
|
611
|
+
(0, import_vobs.setAttribute)(metricsGrid, "class", "vobs-devtools-performance-metrics");
|
|
1951
612
|
appendMetric(metricsGrid, "Slow updates", metrics.slowUpdateCount);
|
|
1952
613
|
appendMetric(metricsGrid, "Slow effects", metrics.slowEffectCount);
|
|
1953
614
|
appendMetric(metricsGrid, "Slow requests", metrics.slowRequestCount);
|
|
1954
615
|
appendMetric(metricsGrid, "Max update", `${metrics.maxUpdateDuration.toFixed(2)} ms`);
|
|
1955
616
|
appendMetric(metricsGrid, "Max effect", `${metrics.maxEffectDuration.toFixed(2)} ms`);
|
|
1956
617
|
appendMetric(metricsGrid, "Max request", `${metrics.maxRequestDuration.toFixed(2)} ms`);
|
|
1957
|
-
return createComponent(Card, {
|
|
618
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1958
619
|
class: "vobs-devtools-performance-card",
|
|
1959
620
|
description: "Lightweight slow-path summary for the retained diagnostics.",
|
|
1960
621
|
children: /* @__PURE__ */ __name(() => metricsGrid, "children")
|
|
@@ -1963,18 +624,18 @@ function renderPerformanceMetrics(metrics) {
|
|
|
1963
624
|
__name(renderPerformanceMetrics, "renderPerformanceMetrics");
|
|
1964
625
|
function renderSlowItems(entries) {
|
|
1965
626
|
const slowEntries = entries.filter((entry) => entry.duration >= 16).slice(0, 8);
|
|
1966
|
-
const slowList = createElement("div");
|
|
1967
|
-
setAttribute(slowList, "class", "vobs-devtools-performance-slow-list");
|
|
627
|
+
const slowList = (0, import_vobs.createElement)("div");
|
|
628
|
+
(0, import_vobs.setAttribute)(slowList, "class", "vobs-devtools-performance-slow-list");
|
|
1968
629
|
for (const entry of slowEntries) {
|
|
1969
|
-
const item = createElement("div");
|
|
1970
|
-
setAttribute(item, "class", "vobs-devtools-performance-slow-item");
|
|
630
|
+
const item = (0, import_vobs.createElement)("div");
|
|
631
|
+
(0, import_vobs.setAttribute)(item, "class", "vobs-devtools-performance-slow-item");
|
|
1971
632
|
appendText(item, entry.kind, "vobs-devtools-muted");
|
|
1972
633
|
appendText(item, formatPerformanceLabel(entry), "vobs-devtools-list__name");
|
|
1973
634
|
appendText(item, `${entry.duration.toFixed(2)} ms`, "vobs-devtools-code");
|
|
1974
|
-
insertBefore(slowList, item, null);
|
|
635
|
+
(0, import_vobs.insertBefore)(slowList, item, null);
|
|
1975
636
|
}
|
|
1976
637
|
if (slowEntries.length === 0) appendMuted(slowList, "No slow items recorded.");
|
|
1977
|
-
return createComponent(Card, {
|
|
638
|
+
return (0, import_vobs.createComponent)(import_ui.Card, {
|
|
1978
639
|
class: "vobs-devtools-performance-slow-card",
|
|
1979
640
|
description: slowEntries.length ? `${slowEntries.length} retained item${slowEntries.length === 1 ? "" : "s"} at or above 16 ms.` : void 0,
|
|
1980
641
|
children: /* @__PURE__ */ __name(() => slowList, "children")
|
|
@@ -1995,37 +656,37 @@ function formatPerformanceLabel(entry) {
|
|
|
1995
656
|
}
|
|
1996
657
|
__name(formatPerformanceLabel, "formatPerformanceLabel");
|
|
1997
658
|
function appendMetric(parent, label, value) {
|
|
1998
|
-
const row = createElement("div");
|
|
1999
|
-
setAttribute(row, "class", "vobs-devtools-performance-item");
|
|
659
|
+
const row = (0, import_vobs.createElement)("div");
|
|
660
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-performance-item");
|
|
2000
661
|
appendText(row, label, "vobs-devtools-muted");
|
|
2001
662
|
appendText(row, String(value), "vobs-devtools-list__name");
|
|
2002
|
-
insertBefore(parent, row, null);
|
|
663
|
+
(0, import_vobs.insertBefore)(parent, row, null);
|
|
2003
664
|
}
|
|
2004
665
|
__name(appendMetric, "appendMetric");
|
|
2005
666
|
function renderRouterSection(router, activeRouterTab, activeRouteView) {
|
|
2006
|
-
if (!router) return createComponent(Alert, { tone: "warning", title: "Router unavailable", description: "Pass a Router instance to inspect route activity." });
|
|
667
|
+
if (!router) return (0, import_vobs.createComponent)(import_ui.Alert, { tone: "warning", title: "Router unavailable", description: "Pass a Router instance to inspect route activity." });
|
|
2007
668
|
const devtools = router.devtools;
|
|
2008
|
-
const root = createElement("div");
|
|
2009
|
-
setAttribute(root, "class", "vobs-devtools-router");
|
|
669
|
+
const root = (0, import_vobs.createElement)("div");
|
|
670
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-router");
|
|
2010
671
|
const current = devtools.getCurrentRoute();
|
|
2011
|
-
const
|
|
672
|
+
const state3 = devtools.getNavigationState();
|
|
2012
673
|
const metrics = devtools.getPerformanceMetrics();
|
|
2013
674
|
const activeRequests = devtools.getDataRequests().filter((request) => request.route === current.fullPath || request.key.startsWith(`${current.fullPath}#`));
|
|
2014
675
|
const activeErrors = devtools.getErrors().filter((error) => error.route === current.fullPath);
|
|
2015
|
-
const toolbar = createElement("div");
|
|
2016
|
-
setAttribute(toolbar, "class", "vobs-devtools-panel__toolbar");
|
|
2017
|
-
insertBefore(toolbar, createComponent(Button, { variant: "secondary", icon: createComponent(Icon, { name: "refresh" }), children: /* @__PURE__ */ __name(() => "Revalidate current route", "children"), onClick: /* @__PURE__ */ __name(() => {
|
|
676
|
+
const toolbar = (0, import_vobs.createElement)("div");
|
|
677
|
+
(0, import_vobs.setAttribute)(toolbar, "class", "vobs-devtools-panel__toolbar");
|
|
678
|
+
(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(() => {
|
|
2018
679
|
void devtools.revalidate(current.fullPath);
|
|
2019
680
|
}, "onClick") }), null);
|
|
2020
|
-
const tabs = createComponent(Tabs, {
|
|
681
|
+
const tabs = (0, import_vobs.createComponent)(import_ui.Tabs, {
|
|
2021
682
|
class: "vobs-devtools-router-tabs",
|
|
2022
683
|
variant: "filled",
|
|
2023
684
|
items: [
|
|
2024
|
-
{ id: "context", label: "Context", content: /* @__PURE__ */ __name(() => createRouterContextPanel(current,
|
|
2025
|
-
{ 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") },
|
|
2026
|
-
{ 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") },
|
|
2027
|
-
{ 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") },
|
|
2028
|
-
{ id: "routes", label: "Route map", content: /* @__PURE__ */ __name(() => createComponent(Card, {
|
|
685
|
+
{ id: "context", label: "Context", content: /* @__PURE__ */ __name(() => createRouterContextPanel(current, state3), "content") },
|
|
686
|
+
{ 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") },
|
|
687
|
+
{ 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") },
|
|
688
|
+
{ 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") },
|
|
689
|
+
{ id: "routes", label: "Route map", content: /* @__PURE__ */ __name(() => (0, import_vobs.createComponent)(import_ui.Card, {
|
|
2029
690
|
title: "Route map",
|
|
2030
691
|
description: "All registered routes and their source locations.",
|
|
2031
692
|
children: /* @__PURE__ */ __name(() => renderRouteMap(devtools.getRouteTree(), router, activeRouteView), "children")
|
|
@@ -2038,109 +699,109 @@ function renderRouterSection(router, activeRouterTab, activeRouteView) {
|
|
|
2038
699
|
if (activeRouterTab) activeRouterTab.value = id;
|
|
2039
700
|
}, "onChange")
|
|
2040
701
|
});
|
|
2041
|
-
const tabsWrap = createElement("div");
|
|
2042
|
-
setAttribute(tabsWrap, "class", "vobs-devtools-router-tabs-wrap");
|
|
2043
|
-
insertBefore(tabsWrap, tabs, null);
|
|
2044
|
-
insertBefore(tabsWrap, toolbar, null);
|
|
2045
|
-
insertBefore(root, tabsWrap, null);
|
|
702
|
+
const tabsWrap = (0, import_vobs.createElement)("div");
|
|
703
|
+
(0, import_vobs.setAttribute)(tabsWrap, "class", "vobs-devtools-router-tabs-wrap");
|
|
704
|
+
(0, import_vobs.insertBefore)(tabsWrap, tabs, null);
|
|
705
|
+
(0, import_vobs.insertBefore)(tabsWrap, toolbar, null);
|
|
706
|
+
(0, import_vobs.insertBefore)(root, tabsWrap, null);
|
|
2046
707
|
return root;
|
|
2047
708
|
}
|
|
2048
709
|
__name(renderRouterSection, "renderRouterSection");
|
|
2049
|
-
function createRouterContextPanel(current,
|
|
2050
|
-
return createFragment((parent, anchor) => {
|
|
2051
|
-
insertBefore(parent, createComponent(Card, { title: "Active route", children: /* @__PURE__ */ __name(() => renderRouterLocation(current,
|
|
2052
|
-
insertBefore(parent, createComponent(Card, { title: "Matched route structure", children: /* @__PURE__ */ __name(() => renderMatchedRoutes(current.matched), "children") }), anchor);
|
|
710
|
+
function createRouterContextPanel(current, state3) {
|
|
711
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
712
|
+
(0, import_vobs.insertBefore)(parent, (0, import_vobs.createComponent)(import_ui.Card, { title: "Active route", children: /* @__PURE__ */ __name(() => renderRouterLocation(current, state3), "children") }), anchor);
|
|
713
|
+
(0, import_vobs.insertBefore)(parent, (0, import_vobs.createComponent)(import_ui.Card, { title: "Matched route structure", children: /* @__PURE__ */ __name(() => renderMatchedRoutes(current.matched), "children") }), anchor);
|
|
2053
714
|
});
|
|
2054
715
|
}
|
|
2055
716
|
__name(createRouterContextPanel, "createRouterContextPanel");
|
|
2056
717
|
function renderDataRequests(requests) {
|
|
2057
|
-
const root = createElement("div");
|
|
2058
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
718
|
+
const root = (0, import_vobs.createElement)("div");
|
|
719
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
2059
720
|
for (const request of [...requests].reverse().slice(0, 30)) {
|
|
2060
|
-
const row = createElement("details");
|
|
2061
|
-
setAttribute(row, "class", "vobs-devtools-list__row");
|
|
2062
|
-
const summary = createElement("summary");
|
|
721
|
+
const row = (0, import_vobs.createElement)("details");
|
|
722
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row");
|
|
723
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2063
724
|
appendText(summary, `${request.kind} \xB7 ${request.key}`, "vobs-devtools-list__name");
|
|
2064
|
-
insertBefore(summary, createComponent(Tag, { tone: request.status === "success" ? "success" : request.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => request.status, "children") }), null);
|
|
725
|
+
(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);
|
|
2065
726
|
appendText(summary, request.duration === void 0 ? "running" : `${request.duration.toFixed(2)} ms`);
|
|
2066
|
-
insertBefore(row, summary, null);
|
|
727
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2067
728
|
if (request.error) appendText(row, request.error);
|
|
2068
|
-
if (request.status === "success" && request.result !== void 0) insertBefore(row, renderInspectableValue("Result", request.result), null);
|
|
2069
|
-
insertBefore(root, row, null);
|
|
729
|
+
if (request.status === "success" && request.result !== void 0) (0, import_vobs.insertBefore)(row, renderInspectableValue("Result", request.result), null);
|
|
730
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2070
731
|
}
|
|
2071
732
|
if (requests.length === 0) appendMuted(root, "No data requests recorded.");
|
|
2072
733
|
return root;
|
|
2073
734
|
}
|
|
2074
735
|
__name(renderDataRequests, "renderDataRequests");
|
|
2075
736
|
function renderRouterErrors(errors) {
|
|
2076
|
-
const root = createElement("div");
|
|
2077
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
737
|
+
const root = (0, import_vobs.createElement)("div");
|
|
738
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
2078
739
|
for (const error of [...errors].reverse().slice(0, 30)) {
|
|
2079
|
-
const row = createElement("details");
|
|
2080
|
-
setAttribute(row, "class", "vobs-devtools-list__row vobs-devtools-error-row");
|
|
2081
|
-
const summary = createElement("summary");
|
|
740
|
+
const row = (0, import_vobs.createElement)("details");
|
|
741
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row vobs-devtools-error-row");
|
|
742
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2082
743
|
appendText(summary, `${error.phase} \xB7 ${error.route}`, "vobs-devtools-list__name");
|
|
2083
744
|
appendText(summary, error.message);
|
|
2084
|
-
insertBefore(row, summary, null);
|
|
745
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2085
746
|
if (error.stack) appendText(row, error.stack, "vobs-devtools-code");
|
|
2086
|
-
insertBefore(root, row, null);
|
|
747
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2087
748
|
}
|
|
2088
749
|
if (errors.length === 0) appendMuted(root, "No route errors recorded.");
|
|
2089
750
|
return root;
|
|
2090
751
|
}
|
|
2091
752
|
__name(renderRouterErrors, "renderRouterErrors");
|
|
2092
|
-
function renderRouterLocation(route,
|
|
2093
|
-
const root = createElement("div");
|
|
2094
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
2095
|
-
const statusRow = createElement("div");
|
|
2096
|
-
setAttribute(statusRow, "class", "vobs-devtools-list__row");
|
|
753
|
+
function renderRouterLocation(route, state3) {
|
|
754
|
+
const root = (0, import_vobs.createElement)("div");
|
|
755
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
756
|
+
const statusRow = (0, import_vobs.createElement)("div");
|
|
757
|
+
(0, import_vobs.setAttribute)(statusRow, "class", "vobs-devtools-list__row");
|
|
2097
758
|
appendText(statusRow, route.fullPath, "vobs-devtools-list__name");
|
|
2098
|
-
insertBefore(statusRow, createComponent(Tag, { tone:
|
|
2099
|
-
if (
|
|
2100
|
-
if (
|
|
2101
|
-
insertBefore(root, statusRow, null);
|
|
2102
|
-
insertBefore(root, renderInspectableValue("Params", route.params), null);
|
|
2103
|
-
insertBefore(root, renderInspectableValue("Query", route.query), null);
|
|
2104
|
-
insertBefore(root, renderInspectableValue("Meta", route.meta), null);
|
|
759
|
+
(0, import_vobs.insertBefore)(statusRow, (0, import_vobs.createComponent)(import_ui.Tag, { tone: state3.status === "error" ? "danger" : state3.status === "loading" ? "warning" : "success", children: /* @__PURE__ */ __name(() => state3.status, "children") }), null);
|
|
760
|
+
if (state3.status === "loading") appendText(statusRow, `to ${state3.to}`);
|
|
761
|
+
if (state3.error) appendText(statusRow, state3.error);
|
|
762
|
+
(0, import_vobs.insertBefore)(root, statusRow, null);
|
|
763
|
+
(0, import_vobs.insertBefore)(root, renderInspectableValue("Params", route.params), null);
|
|
764
|
+
(0, import_vobs.insertBefore)(root, renderInspectableValue("Query", route.query), null);
|
|
765
|
+
(0, import_vobs.insertBefore)(root, renderInspectableValue("Meta", route.meta), null);
|
|
2105
766
|
appendText(root, `outlet ${route.matched.map((record) => record.path ?? "(layout)").join(" > ")}`);
|
|
2106
767
|
return root;
|
|
2107
768
|
}
|
|
2108
769
|
__name(renderRouterLocation, "renderRouterLocation");
|
|
2109
770
|
function renderMatchedRoutes(records) {
|
|
2110
|
-
const root = createElement("div");
|
|
2111
|
-
setAttribute(root, "class", "vobs-devtools-route-tree");
|
|
771
|
+
const root = (0, import_vobs.createElement)("div");
|
|
772
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-route-tree");
|
|
2112
773
|
records.forEach((record, index) => {
|
|
2113
|
-
const row = createElement("div");
|
|
2114
|
-
setAttribute(row, "class", "vobs-devtools-route-node");
|
|
2115
|
-
setAttribute(row, "style", `--route-depth: ${index}`);
|
|
774
|
+
const row = (0, import_vobs.createElement)("div");
|
|
775
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-route-node");
|
|
776
|
+
(0, import_vobs.setAttribute)(row, "style", `--route-depth: ${index}`);
|
|
2116
777
|
appendText(row, record.path ?? "(layout)", "vobs-devtools-list__name");
|
|
2117
778
|
appendText(row, routeComponentName(record));
|
|
2118
779
|
if (record.source) appendText(row, record.source, "vobs-devtools-code");
|
|
2119
|
-
if (record.loader) insertBefore(row, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "loader", "children") }), null);
|
|
2120
|
-
if (record.action) insertBefore(row, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "action", "children") }), null);
|
|
2121
|
-
insertBefore(root, row, null);
|
|
780
|
+
if (record.loader) (0, import_vobs.insertBefore)(row, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "loader", "children") }), null);
|
|
781
|
+
if (record.action) (0, import_vobs.insertBefore)(row, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => "action", "children") }), null);
|
|
782
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2122
783
|
});
|
|
2123
784
|
if (records.length === 0) appendMuted(root, "No matched route records.");
|
|
2124
785
|
return root;
|
|
2125
786
|
}
|
|
2126
787
|
__name(renderMatchedRoutes, "renderMatchedRoutes");
|
|
2127
788
|
function renderRouteMap(nodes, router, activeRouteView) {
|
|
2128
|
-
const tree = createElement("div");
|
|
2129
|
-
setAttribute(tree, "class", "vobs-devtools-route-tree");
|
|
2130
|
-
const controls = createElement("div");
|
|
2131
|
-
setAttribute(controls, "class", "vobs-devtools-route-view-toggle");
|
|
789
|
+
const tree = (0, import_vobs.createElement)("div");
|
|
790
|
+
(0, import_vobs.setAttribute)(tree, "class", "vobs-devtools-route-tree");
|
|
791
|
+
const controls = (0, import_vobs.createElement)("div");
|
|
792
|
+
(0, import_vobs.setAttribute)(controls, "class", "vobs-devtools-route-view-toggle");
|
|
2132
793
|
for (const mode of ["tree", "list"]) {
|
|
2133
|
-
const button = createElement("button");
|
|
2134
|
-
setAttribute(button, "class", `vobs-devtools-control${(activeRouteView?.value ?? "tree") === mode ? " is-active" : ""}`);
|
|
2135
|
-
setAttribute(button, "type", "button");
|
|
2136
|
-
setAttribute(button, "aria-pressed", (activeRouteView?.value ?? "tree") === mode ? "true" : "false");
|
|
2137
|
-
insertBefore(button, createText(mode === "tree" ? "Tree" : "List"), null);
|
|
794
|
+
const button = (0, import_vobs.createElement)("button");
|
|
795
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-control${(activeRouteView?.value ?? "tree") === mode ? " is-active" : ""}`);
|
|
796
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
797
|
+
(0, import_vobs.setAttribute)(button, "aria-pressed", (activeRouteView?.value ?? "tree") === mode ? "true" : "false");
|
|
798
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)(mode === "tree" ? "Tree" : "List"), null);
|
|
2138
799
|
button.addEventListener("click", () => {
|
|
2139
800
|
if (activeRouteView) activeRouteView.value = mode;
|
|
2140
801
|
});
|
|
2141
|
-
insertBefore(controls, button, null);
|
|
802
|
+
(0, import_vobs.insertBefore)(controls, button, null);
|
|
2142
803
|
}
|
|
2143
|
-
insertBefore(tree, controls, null);
|
|
804
|
+
(0, import_vobs.insertBefore)(tree, controls, null);
|
|
2144
805
|
const currentPath = router.currentRoute.value.path;
|
|
2145
806
|
if ((activeRouteView?.value ?? "tree") === "list") {
|
|
2146
807
|
for (const node of flattenRouteNodes(nodes)) appendRouteConfigNode(tree, node, 0, router, currentPath);
|
|
@@ -2162,20 +823,20 @@ function flattenRouteNodes(nodes) {
|
|
|
2162
823
|
__name(flattenRouteNodes, "flattenRouteNodes");
|
|
2163
824
|
function appendRouteConfigNode(parent, node, depth, router, currentPath) {
|
|
2164
825
|
const concrete = node.children.length === 0 && !node.path.includes(":") && !node.path.includes("*");
|
|
2165
|
-
const row = createElement(concrete ? "button" : "div");
|
|
2166
|
-
setAttribute(row, "class", `vobs-devtools-route-node${concrete && node.path === currentPath ? " is-active" : ""}`);
|
|
2167
|
-
setAttribute(row, "style", `--route-depth: ${depth}`);
|
|
826
|
+
const row = (0, import_vobs.createElement)(concrete ? "button" : "div");
|
|
827
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-route-node${concrete && node.path === currentPath ? " is-active" : ""}`);
|
|
828
|
+
(0, import_vobs.setAttribute)(row, "style", `--route-depth: ${depth}`);
|
|
2168
829
|
appendText(row, node.path, "vobs-devtools-list__name");
|
|
2169
830
|
appendText(row, node.component);
|
|
2170
831
|
if (node.source) appendText(row, node.source, "vobs-devtools-code");
|
|
2171
832
|
if (concrete) {
|
|
2172
|
-
setAttribute(row, "type", "button");
|
|
2173
|
-
setAttribute(row, "title", `Navigate to ${node.path}`);
|
|
833
|
+
(0, import_vobs.setAttribute)(row, "type", "button");
|
|
834
|
+
(0, import_vobs.setAttribute)(row, "title", `Navigate to ${node.path}`);
|
|
2174
835
|
row.addEventListener("click", () => {
|
|
2175
836
|
void router.push(node.path);
|
|
2176
837
|
});
|
|
2177
838
|
}
|
|
2178
|
-
insertBefore(parent, row, null);
|
|
839
|
+
(0, import_vobs.insertBefore)(parent, row, null);
|
|
2179
840
|
for (const child of node.children) appendRouteConfigNode(parent, child, depth + 1, router, currentPath);
|
|
2180
841
|
}
|
|
2181
842
|
__name(appendRouteConfigNode, "appendRouteConfigNode");
|
|
@@ -2187,62 +848,62 @@ function routeComponentName(record) {
|
|
|
2187
848
|
}
|
|
2188
849
|
__name(routeComponentName, "routeComponentName");
|
|
2189
850
|
function renderNavigationHistory(history, router) {
|
|
2190
|
-
const root = createElement("div");
|
|
2191
|
-
setAttribute(root, "class", "vobs-devtools-list");
|
|
851
|
+
const root = (0, import_vobs.createElement)("div");
|
|
852
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-list");
|
|
2192
853
|
for (const trace of [...history].reverse().slice(0, 30)) {
|
|
2193
|
-
const row = createElement("button");
|
|
2194
|
-
setAttribute(row, "class", "vobs-devtools-list__row");
|
|
2195
|
-
setAttribute(row, "type", "button");
|
|
2196
|
-
setAttribute(row, "title", `Replay ${trace.to}`);
|
|
854
|
+
const row = (0, import_vobs.createElement)("button");
|
|
855
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row");
|
|
856
|
+
(0, import_vobs.setAttribute)(row, "type", "button");
|
|
857
|
+
(0, import_vobs.setAttribute)(row, "title", `Replay ${trace.to}`);
|
|
2197
858
|
appendText(row, `${trace.from} \u2192 ${trace.to}`, "vobs-devtools-list__name");
|
|
2198
|
-
insertBefore(row, createComponent(Tag, { tone: trace.status === "success" ? "success" : trace.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => trace.status, "children") }), null);
|
|
859
|
+
(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);
|
|
2199
860
|
appendText(row, `${trace.duration.toFixed(2)} ms \xB7 ${trace.source}`);
|
|
2200
861
|
row.addEventListener("click", () => {
|
|
2201
862
|
void router.push(trace.to);
|
|
2202
863
|
});
|
|
2203
|
-
insertBefore(root, row, null);
|
|
864
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2204
865
|
}
|
|
2205
866
|
if (history.length === 0) appendMuted(root, "No navigation history recorded.");
|
|
2206
867
|
return root;
|
|
2207
868
|
}
|
|
2208
869
|
__name(renderNavigationHistory, "renderNavigationHistory");
|
|
2209
870
|
function appendMuted(parent, value) {
|
|
2210
|
-
const node = createElement("span");
|
|
2211
|
-
setAttribute(node, "class", "vobs-devtools-muted");
|
|
2212
|
-
insertBefore(node, createText(value), null);
|
|
2213
|
-
insertBefore(parent, node, null);
|
|
871
|
+
const node = (0, import_vobs.createElement)("span");
|
|
872
|
+
(0, import_vobs.setAttribute)(node, "class", "vobs-devtools-muted");
|
|
873
|
+
(0, import_vobs.insertBefore)(node, (0, import_vobs.createText)(value), null);
|
|
874
|
+
(0, import_vobs.insertBefore)(parent, node, null);
|
|
2214
875
|
}
|
|
2215
876
|
__name(appendMuted, "appendMuted");
|
|
2216
877
|
function renderSignalInspector(signal, api) {
|
|
2217
|
-
const row = createElement("details");
|
|
2218
|
-
setAttribute(row, "class", "vobs-devtools-list__row vobs-devtools-signal-row");
|
|
2219
|
-
const summary = createElement("summary");
|
|
878
|
+
const row = (0, import_vobs.createElement)("details");
|
|
879
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row vobs-devtools-signal-row");
|
|
880
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2220
881
|
appendText(summary, displaySignalName(signal), "vobs-devtools-list__name");
|
|
2221
882
|
appendText(summary, previewValue(signal.value), "vobs-devtools-code");
|
|
2222
|
-
insertBefore(summary, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${signal.subscribers} subscribers`, "children") }), null);
|
|
2223
|
-
insertBefore(row, summary, null);
|
|
883
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${signal.subscribers} subscribers`, "children") }), null);
|
|
884
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2224
885
|
if (!api) return row;
|
|
2225
886
|
const dependencies = api.getDependencies(signal.id);
|
|
2226
887
|
const dependents = api.getDependents(signal.id);
|
|
2227
|
-
insertBefore(row, renderInspectableValue("Current value", signal.value), null);
|
|
888
|
+
(0, import_vobs.insertBefore)(row, renderInspectableValue("Current value", signal.value), null);
|
|
2228
889
|
appendText(row, `${dependencies.length} dependencies \xB7 ${dependents.length} dependents`, "vobs-devtools-muted");
|
|
2229
|
-
if (api.canMutate() && signal.kind !== "memo") insertBefore(row, renderSignalMutationControl(signal, api), null);
|
|
890
|
+
if (api.canMutate() && signal.kind !== "memo") (0, import_vobs.insertBefore)(row, renderSignalMutationControl(signal, api), null);
|
|
2230
891
|
return row;
|
|
2231
892
|
}
|
|
2232
893
|
__name(renderSignalInspector, "renderSignalInspector");
|
|
2233
894
|
function renderSignalMutationControl(signal, api) {
|
|
2234
|
-
const root = createElement("div");
|
|
2235
|
-
setAttribute(root, "class", "vobs-devtools-mutation-control");
|
|
895
|
+
const root = (0, import_vobs.createElement)("div");
|
|
896
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-mutation-control");
|
|
2236
897
|
appendText(root, "Debug-only value edit (may trigger effects and requests).", "vobs-devtools-muted");
|
|
2237
|
-
const input = createElement("input");
|
|
2238
|
-
setAttribute(input, "class", "vobs-devtools-search");
|
|
2239
|
-
setAttribute(input, "type", "text");
|
|
2240
|
-
setAttribute(input, "aria-label", `Edit ${signal.name}`);
|
|
2241
|
-
setProperty(input, "value", formatValue(signal.value));
|
|
2242
|
-
const button = createElement("button");
|
|
2243
|
-
setAttribute(button, "class", "vobs-devtools-control");
|
|
2244
|
-
setAttribute(button, "type", "button");
|
|
2245
|
-
insertBefore(button, createText("Apply debug value"), null);
|
|
898
|
+
const input = (0, import_vobs.createElement)("input");
|
|
899
|
+
(0, import_vobs.setAttribute)(input, "class", "vobs-devtools-search");
|
|
900
|
+
(0, import_vobs.setAttribute)(input, "type", "text");
|
|
901
|
+
(0, import_vobs.setAttribute)(input, "aria-label", `Edit ${signal.name}`);
|
|
902
|
+
(0, import_vobs.setProperty)(input, "value", formatValue(signal.value));
|
|
903
|
+
const button = (0, import_vobs.createElement)("button");
|
|
904
|
+
(0, import_vobs.setAttribute)(button, "class", "vobs-devtools-control");
|
|
905
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
906
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)("Apply debug value"), null);
|
|
2246
907
|
button.addEventListener("click", (event) => {
|
|
2247
908
|
event.stopPropagation();
|
|
2248
909
|
const raw = input.value;
|
|
@@ -2253,21 +914,21 @@ function renderSignalMutationControl(signal, api) {
|
|
|
2253
914
|
}
|
|
2254
915
|
api.setSignalValue(signal.id, value);
|
|
2255
916
|
});
|
|
2256
|
-
insertBefore(root, input, null);
|
|
2257
|
-
insertBefore(root, button, null);
|
|
917
|
+
(0, import_vobs.insertBefore)(root, input, null);
|
|
918
|
+
(0, import_vobs.insertBefore)(root, button, null);
|
|
2258
919
|
return root;
|
|
2259
920
|
}
|
|
2260
921
|
__name(renderSignalMutationControl, "renderSignalMutationControl");
|
|
2261
922
|
function renderEffectRow(effect2) {
|
|
2262
|
-
const row = createElement("details");
|
|
2263
|
-
setAttribute(row, "class", "vobs-devtools-list__row");
|
|
2264
|
-
const summary = createElement("summary");
|
|
923
|
+
const row = (0, import_vobs.createElement)("details");
|
|
924
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-list__row");
|
|
925
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2265
926
|
const component = formatDebugLocation(effect2.component);
|
|
2266
927
|
appendText(summary, effect2.name || `${debugComponentName(component)} effect`, "vobs-devtools-list__name");
|
|
2267
928
|
appendText(summary, formatDebugSource(component));
|
|
2268
|
-
insertBefore(summary, createComponent(Tag, { tone: effect2.status === "success" || effect2.status === "idle" ? "success" : effect2.status === "error" ? "danger" : "warning", children: /* @__PURE__ */ __name(() => effect2.status, "children") }), null);
|
|
929
|
+
(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);
|
|
2269
930
|
appendText(summary, `${effect2.executionCount} runs`);
|
|
2270
|
-
insertBefore(row, summary, null);
|
|
931
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
2271
932
|
appendText(row, `${effect2.dependencies.length} dependencies`, "vobs-devtools-muted");
|
|
2272
933
|
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");
|
|
2273
934
|
if (effect2.lastUpdateId) appendText(row, `last update ${effect2.lastUpdateId}`, "vobs-devtools-code");
|
|
@@ -2276,43 +937,43 @@ function renderEffectRow(effect2) {
|
|
|
2276
937
|
}
|
|
2277
938
|
__name(renderEffectRow, "renderEffectRow");
|
|
2278
939
|
function renderUpdateRow(update, api, selection = null, onFocus = () => void 0) {
|
|
2279
|
-
const row = createElement("details");
|
|
940
|
+
const row = (0, import_vobs.createElement)("details");
|
|
2280
941
|
const selected = selection?.type === "update" && selection.id === update.id;
|
|
2281
|
-
setAttribute(row, "class", `vobs-devtools-update-row${selected ? " is-selected" : ""}`);
|
|
2282
|
-
if (selected) setProperty(row, "open", true);
|
|
2283
|
-
const summary = createElement("summary");
|
|
942
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-update-row${selected ? " is-selected" : ""}`);
|
|
943
|
+
if (selected) (0, import_vobs.setProperty)(row, "open", true);
|
|
944
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2284
945
|
summary.addEventListener("click", () => onFocus("updates", { type: "update", id: update.id }));
|
|
2285
946
|
const signal = api?.getSignal(update.signalId);
|
|
2286
947
|
appendText(summary, signal ? displaySignalName(signal) : displayDebugName(update.signalName), "vobs-devtools-list__name");
|
|
2287
948
|
appendText(summary, formatDebugSource(signal?.component ?? "unknown"), "vobs-devtools-update-row__source");
|
|
2288
949
|
appendText(summary, `${update.duration.toFixed(2)} ms`);
|
|
2289
|
-
insertBefore(summary, createComponent(Tag, { tone: update.duration >= 16 ? "warning" : "neutral-strong", children: /* @__PURE__ */ __name(() => `${update.effects.length} effects`, "children") }), null);
|
|
2290
|
-
insertBefore(row, summary, null);
|
|
2291
|
-
insertBefore(row, renderValuePair("Value changed", update.previousValue, update.nextValue), null);
|
|
950
|
+
(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);
|
|
951
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
952
|
+
(0, import_vobs.insertBefore)(row, renderValuePair("Value changed", update.previousValue, update.nextValue), null);
|
|
2292
953
|
appendText(row, `status ${update.status} \xB7 ${update.affectedSignals.length} signals \xB7 ${update.affectedEffects.length} effects`, "vobs-devtools-muted");
|
|
2293
954
|
if (update.error) appendText(row, `${update.error.name}: ${update.error.message}`, "vobs-devtools-error");
|
|
2294
955
|
if (update.effects.length === 0) appendText(row, "No effects executed.", "vobs-devtools-muted");
|
|
2295
956
|
for (const effect2 of update.effects) {
|
|
2296
|
-
insertBefore(row, renderEffectExecution(effect2), null);
|
|
957
|
+
(0, import_vobs.insertBefore)(row, renderEffectExecution(effect2), null);
|
|
2297
958
|
if (effect2.error) appendText(row, `${effect2.error.name}: ${effect2.error.message}`, "vobs-devtools-error");
|
|
2298
959
|
}
|
|
2299
960
|
for (const domUpdate of update.domUpdates) {
|
|
2300
961
|
const operation = domUpdate.key ? `${domUpdate.operation}.${domUpdate.key}` : domUpdate.operation;
|
|
2301
|
-
const mutation = createElement("div");
|
|
2302
|
-
setAttribute(mutation, "class", "vobs-devtools-dom-update");
|
|
962
|
+
const mutation = (0, import_vobs.createElement)("div");
|
|
963
|
+
(0, import_vobs.setAttribute)(mutation, "class", "vobs-devtools-dom-update");
|
|
2303
964
|
appendText(mutation, operation, "vobs-devtools-list__name");
|
|
2304
965
|
appendText(mutation, domUpdate.target, "vobs-devtools-muted");
|
|
2305
966
|
if (domUpdate.previousValue !== void 0 || domUpdate.nextValue !== void 0) {
|
|
2306
|
-
insertBefore(mutation, renderValuePair("", domUpdate.previousValue, domUpdate.nextValue), null);
|
|
967
|
+
(0, import_vobs.insertBefore)(mutation, renderValuePair("", domUpdate.previousValue, domUpdate.nextValue), null);
|
|
2307
968
|
}
|
|
2308
|
-
insertBefore(row, mutation, null);
|
|
969
|
+
(0, import_vobs.insertBefore)(row, mutation, null);
|
|
2309
970
|
}
|
|
2310
971
|
return row;
|
|
2311
972
|
}
|
|
2312
973
|
__name(renderUpdateRow, "renderUpdateRow");
|
|
2313
974
|
function renderEffectExecution(effect2) {
|
|
2314
|
-
const root = createElement("div");
|
|
2315
|
-
setAttribute(root, "class", "vobs-devtools-effect-execution");
|
|
975
|
+
const root = (0, import_vobs.createElement)("div");
|
|
976
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-effect-execution");
|
|
2316
977
|
appendText(root, effect2.effectId, "vobs-devtools-code");
|
|
2317
978
|
appendText(root, `${formatDebugSource(effect2.component)} \xB7 ${effect2.duration.toFixed(2)} ms \xB7 ${effect2.domUpdates} DOM updates \xB7 ${effect2.status ?? "success"}`);
|
|
2318
979
|
return root;
|
|
@@ -2324,39 +985,39 @@ function appendUpdateLinks(parent, ids, onFocus) {
|
|
|
2324
985
|
return;
|
|
2325
986
|
}
|
|
2326
987
|
for (const id of ids) {
|
|
2327
|
-
const button = createElement("button");
|
|
2328
|
-
setAttribute(button, "class", "vobs-devtools-link");
|
|
2329
|
-
setAttribute(button, "type", "button");
|
|
988
|
+
const button = (0, import_vobs.createElement)("button");
|
|
989
|
+
(0, import_vobs.setAttribute)(button, "class", "vobs-devtools-link");
|
|
990
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
2330
991
|
button.addEventListener("click", (event) => {
|
|
2331
992
|
event.stopPropagation();
|
|
2332
993
|
onFocus("updates", { type: "update", id });
|
|
2333
994
|
});
|
|
2334
|
-
insertBefore(button, createText(id), null);
|
|
2335
|
-
insertBefore(parent, button, null);
|
|
995
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)(id), null);
|
|
996
|
+
(0, import_vobs.insertBefore)(parent, button, null);
|
|
2336
997
|
}
|
|
2337
998
|
}
|
|
2338
999
|
__name(appendUpdateLinks, "appendUpdateLinks");
|
|
2339
1000
|
function renderLifecycleTimeline(events, onFocus) {
|
|
2340
|
-
const root = createElement("div");
|
|
2341
|
-
setAttribute(root, "class", "vobs-devtools-lifecycle-list");
|
|
1001
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1002
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-lifecycle-list");
|
|
2342
1003
|
for (const event of [...events].reverse().slice(0, 40)) {
|
|
2343
1004
|
const selection = lifecycleSelection(event);
|
|
2344
|
-
const row = createElement(selection?.type === "component" ? "button" : "div");
|
|
2345
|
-
setAttribute(row, "class", "vobs-devtools-lifecycle-row");
|
|
2346
|
-
if (selection?.type === "component") setAttribute(row, "type", "button");
|
|
1005
|
+
const row = (0, import_vobs.createElement)(selection?.type === "component" ? "button" : "div");
|
|
1006
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-lifecycle-row");
|
|
1007
|
+
if (selection?.type === "component") (0, import_vobs.setAttribute)(row, "type", "button");
|
|
2347
1008
|
appendText(row, event.type, "vobs-devtools-list__name");
|
|
2348
1009
|
appendText(row, event.name ?? event.targetId);
|
|
2349
1010
|
appendText(row, event.status ?? "", "vobs-devtools-muted");
|
|
2350
1011
|
if (selection?.type === "component") row.addEventListener("click", () => onFocus("components", selection));
|
|
2351
|
-
insertBefore(root, row, null);
|
|
1012
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2352
1013
|
}
|
|
2353
1014
|
if (events.length === 0) appendMuted(root, "No lifecycle events recorded.");
|
|
2354
1015
|
return root;
|
|
2355
1016
|
}
|
|
2356
1017
|
__name(renderLifecycleTimeline, "renderLifecycleTimeline");
|
|
2357
1018
|
function renderUnifiedNetworkRequests(requests, routerRequests, query, selection, onFocus, networkSelection, sourceFilter, statusFilter, detailTab, api, queryState, http, testerOpen, testerRevision, testerRun, testerDraft, currentRoute, testerTab) {
|
|
2358
|
-
const root = createElement("div");
|
|
2359
|
-
setAttribute(root, "class", "vobs-devtools-network-inspector");
|
|
1019
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1020
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-network-inspector");
|
|
2360
1021
|
const activeSource = sourceFilter?.value ?? "all";
|
|
2361
1022
|
const activeStatus = statusFilter?.value ?? "all";
|
|
2362
1023
|
const entries = [
|
|
@@ -2385,19 +1046,19 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2385
1046
|
].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));
|
|
2386
1047
|
const selectedKey = (selection?.type === "request" ? `http:${selection.id}` : networkSelection?.value) ?? entries[0]?.key;
|
|
2387
1048
|
const selected = entries.find((entry) => entry.key === selectedKey) ?? entries[0];
|
|
2388
|
-
const controls = createElement("div");
|
|
2389
|
-
setAttribute(controls, "class", "vobs-devtools-network-toolbar");
|
|
1049
|
+
const controls = (0, import_vobs.createElement)("div");
|
|
1050
|
+
(0, import_vobs.setAttribute)(controls, "class", "vobs-devtools-network-toolbar");
|
|
2390
1051
|
appendText(controls, "Search", "vobs-devtools-network-toolbar__label");
|
|
2391
|
-
const search = createElement("input");
|
|
2392
|
-
setAttribute(search, "class", "vobs-devtools-search vobs-devtools-network-toolbar__search");
|
|
2393
|
-
setAttribute(search, "type", "search");
|
|
2394
|
-
setAttribute(search, "placeholder", "Search requests");
|
|
2395
|
-
setProperty(search, "value", query);
|
|
1052
|
+
const search = (0, import_vobs.createElement)("input");
|
|
1053
|
+
(0, import_vobs.setAttribute)(search, "class", "vobs-devtools-search vobs-devtools-network-toolbar__search");
|
|
1054
|
+
(0, import_vobs.setAttribute)(search, "type", "search");
|
|
1055
|
+
(0, import_vobs.setAttribute)(search, "placeholder", "Search requests");
|
|
1056
|
+
(0, import_vobs.setProperty)(search, "value", query);
|
|
2396
1057
|
search.addEventListener("change", () => {
|
|
2397
1058
|
if (queryState) queryState.value = search.value;
|
|
2398
1059
|
});
|
|
2399
|
-
insertBefore(controls, search, null);
|
|
2400
|
-
insertBefore(controls, createNetworkFilterSelect("Source", activeSource, [
|
|
1060
|
+
(0, import_vobs.insertBefore)(controls, search, null);
|
|
1061
|
+
(0, import_vobs.insertBefore)(controls, createNetworkFilterSelect("Source", activeSource, [
|
|
2401
1062
|
["all", "All sources"],
|
|
2402
1063
|
["http", "HTTP"],
|
|
2403
1064
|
["router", "Router"],
|
|
@@ -2405,7 +1066,7 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2405
1066
|
], (value) => {
|
|
2406
1067
|
if (sourceFilter) sourceFilter.value = value;
|
|
2407
1068
|
}), null);
|
|
2408
|
-
insertBefore(controls, createNetworkFilterSelect("Status", activeStatus, [
|
|
1069
|
+
(0, import_vobs.insertBefore)(controls, createNetworkFilterSelect("Status", activeStatus, [
|
|
2409
1070
|
["all", "All statuses"],
|
|
2410
1071
|
["loading", "Loading"],
|
|
2411
1072
|
["success", "Success"],
|
|
@@ -2414,15 +1075,15 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2414
1075
|
], (value) => {
|
|
2415
1076
|
if (statusFilter) statusFilter.value = value;
|
|
2416
1077
|
}), null);
|
|
2417
|
-
if (api) insertBefore(controls, createComponent(Button, {
|
|
1078
|
+
if (api) (0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2418
1079
|
variant: "ghost",
|
|
2419
1080
|
children: /* @__PURE__ */ __name(() => "Clear", "children"),
|
|
2420
1081
|
onClick: /* @__PURE__ */ __name(() => api.clearNetworkRequests(), "onClick")
|
|
2421
1082
|
}), null);
|
|
2422
|
-
if (testerOpen && testerDraft) insertBefore(controls, createComponent(Button, {
|
|
1083
|
+
if (testerOpen && testerDraft) (0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2423
1084
|
variant: "ghost",
|
|
2424
1085
|
iconOnly: true,
|
|
2425
|
-
icon: createComponent(Icon, { name: "settings" }),
|
|
1086
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "settings" }),
|
|
2426
1087
|
"aria-label": "Open Request Tester",
|
|
2427
1088
|
title: "Open Request Tester",
|
|
2428
1089
|
onClick: /* @__PURE__ */ __name(() => {
|
|
@@ -2431,53 +1092,53 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2431
1092
|
testerRevision && testerRevision.value++;
|
|
2432
1093
|
}, "onClick")
|
|
2433
1094
|
}), null);
|
|
2434
|
-
insertBefore(root, controls, null);
|
|
2435
|
-
const panes = createElement("div");
|
|
2436
|
-
setAttribute(panes, "class", "vobs-devtools-network-panes");
|
|
2437
|
-
const listPane = createElement("section");
|
|
2438
|
-
setAttribute(listPane, "class", "vobs-devtools-network-list-pane");
|
|
2439
|
-
setAttribute(listPane, "aria-label", "Network requests");
|
|
2440
|
-
const requestList = createElement("div");
|
|
2441
|
-
setAttribute(requestList, "class", "vobs-devtools-network-request-list");
|
|
2442
|
-
setAttribute(requestList, "role", "list");
|
|
1095
|
+
(0, import_vobs.insertBefore)(root, controls, null);
|
|
1096
|
+
const panes = (0, import_vobs.createElement)("div");
|
|
1097
|
+
(0, import_vobs.setAttribute)(panes, "class", "vobs-devtools-network-panes");
|
|
1098
|
+
const listPane = (0, import_vobs.createElement)("section");
|
|
1099
|
+
(0, import_vobs.setAttribute)(listPane, "class", "vobs-devtools-network-list-pane");
|
|
1100
|
+
(0, import_vobs.setAttribute)(listPane, "aria-label", "Network requests");
|
|
1101
|
+
const requestList = (0, import_vobs.createElement)("div");
|
|
1102
|
+
(0, import_vobs.setAttribute)(requestList, "class", "vobs-devtools-network-request-list");
|
|
1103
|
+
(0, import_vobs.setAttribute)(requestList, "role", "list");
|
|
2443
1104
|
for (const entry of entries) {
|
|
2444
|
-
const row = createElement("button");
|
|
1105
|
+
const row = (0, import_vobs.createElement)("button");
|
|
2445
1106
|
const isSelected = selectedKey === entry.key;
|
|
2446
|
-
setAttribute(row, "class", `vobs-devtools-network-request${isSelected ? " is-selected" : ""}`);
|
|
2447
|
-
setAttribute(row, "type", "button");
|
|
2448
|
-
setAttribute(row, "role", "listitem");
|
|
2449
|
-
setAttribute(row, "aria-pressed", isSelected ? "true" : "false");
|
|
1107
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-network-request${isSelected ? " is-selected" : ""}`);
|
|
1108
|
+
(0, import_vobs.setAttribute)(row, "type", "button");
|
|
1109
|
+
(0, import_vobs.setAttribute)(row, "role", "listitem");
|
|
1110
|
+
(0, import_vobs.setAttribute)(row, "aria-pressed", isSelected ? "true" : "false");
|
|
2450
1111
|
row.addEventListener("click", () => {
|
|
2451
1112
|
networkSelection && (networkSelection.value = entry.key);
|
|
2452
1113
|
if (entry.request) onFocus("network", { type: "request", id: entry.request.id });
|
|
2453
1114
|
if (detailTab) detailTab.value = "overview";
|
|
2454
1115
|
});
|
|
2455
|
-
const pathLine = createElement("span");
|
|
2456
|
-
setAttribute(pathLine, "class", "vobs-devtools-network-request__path-line");
|
|
1116
|
+
const pathLine = (0, import_vobs.createElement)("span");
|
|
1117
|
+
(0, import_vobs.setAttribute)(pathLine, "class", "vobs-devtools-network-request__path-line");
|
|
2457
1118
|
appendText(pathLine, entry.url, "vobs-devtools-network-request__url");
|
|
2458
|
-
if (entry.request?.test) insertBefore(pathLine, createComponent(Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
2459
|
-
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);
|
|
2460
|
-
insertBefore(row, pathLine, null);
|
|
2461
|
-
const meta = createElement("span");
|
|
2462
|
-
setAttribute(meta, "class", "vobs-devtools-network-request__meta");
|
|
1119
|
+
if (entry.request?.test) (0, import_vobs.insertBefore)(pathLine, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
1120
|
+
(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);
|
|
1121
|
+
(0, import_vobs.insertBefore)(row, pathLine, null);
|
|
1122
|
+
const meta = (0, import_vobs.createElement)("span");
|
|
1123
|
+
(0, import_vobs.setAttribute)(meta, "class", "vobs-devtools-network-request__meta");
|
|
2463
1124
|
appendText(meta, entry.duration === void 0 ? "Running" : `${entry.duration.toFixed(0)} ms`);
|
|
2464
1125
|
appendText(meta, `ID ${entry.request?.id ?? entry.routerRequest?.id}`, "vobs-devtools-code");
|
|
2465
|
-
insertBefore(row, meta, null);
|
|
2466
|
-
insertBefore(requestList, row, null);
|
|
1126
|
+
(0, import_vobs.insertBefore)(row, meta, null);
|
|
1127
|
+
(0, import_vobs.insertBefore)(requestList, row, null);
|
|
2467
1128
|
}
|
|
2468
|
-
insertBefore(listPane, requestList, null);
|
|
1129
|
+
(0, import_vobs.insertBefore)(listPane, requestList, null);
|
|
2469
1130
|
if (entries.length === 0) appendMuted(listPane, query || activeSource !== "all" || activeStatus !== "all" ? "No requests match the current filters." : "No requests recorded.");
|
|
2470
|
-
insertBefore(panes, listPane, null);
|
|
2471
|
-
const detailPane = createElement("section");
|
|
2472
|
-
setAttribute(detailPane, "class", "vobs-devtools-network-detail-pane");
|
|
2473
|
-
setAttribute(detailPane, "aria-label", "Selected network request");
|
|
2474
|
-
if (selected) insertBefore(detailPane, renderNetworkDetail(selected, detailTab?.value ?? "overview", (tab) => {
|
|
1131
|
+
(0, import_vobs.insertBefore)(panes, listPane, null);
|
|
1132
|
+
const detailPane = (0, import_vobs.createElement)("section");
|
|
1133
|
+
(0, import_vobs.setAttribute)(detailPane, "class", "vobs-devtools-network-detail-pane");
|
|
1134
|
+
(0, import_vobs.setAttribute)(detailPane, "aria-label", "Selected network request");
|
|
1135
|
+
if (selected) (0, import_vobs.insertBefore)(detailPane, renderNetworkDetail(selected, detailTab?.value ?? "overview", (tab) => {
|
|
2475
1136
|
if (detailTab) detailTab.value = tab;
|
|
2476
1137
|
}), null);
|
|
2477
1138
|
else appendMuted(detailPane, "Select a request to inspect its details.");
|
|
2478
|
-
insertBefore(panes, detailPane, null);
|
|
2479
|
-
insertBefore(root, panes, null);
|
|
2480
|
-
if (testerOpen?.value && testerDraft) insertBefore(root, renderRequestTester(testerDraft, (run) => {
|
|
1139
|
+
(0, import_vobs.insertBefore)(panes, detailPane, null);
|
|
1140
|
+
(0, import_vobs.insertBefore)(root, panes, null);
|
|
1141
|
+
if (testerOpen?.value && testerDraft) (0, import_vobs.insertBefore)(root, renderRequestTester(testerDraft, (run) => {
|
|
2481
1142
|
if (testerRun) testerRun.value = run;
|
|
2482
1143
|
testerRevision && testerRevision.value++;
|
|
2483
1144
|
}, testerRun?.value ?? { status: "idle" }, testerTab?.value ?? "params", selected, http, () => {
|
|
@@ -2490,31 +1151,31 @@ function renderUnifiedNetworkRequests(requests, routerRequests, query, selection
|
|
|
2490
1151
|
}
|
|
2491
1152
|
__name(renderUnifiedNetworkRequests, "renderUnifiedNetworkRequests");
|
|
2492
1153
|
function createNetworkFilterSelect(label, value, options, onChange) {
|
|
2493
|
-
const select = createElement("select");
|
|
2494
|
-
setAttribute(select, "class", "vobs-devtools-network-toolbar__select");
|
|
2495
|
-
setAttribute(select, "aria-label", label);
|
|
2496
|
-
setProperty(select, "value", value);
|
|
1154
|
+
const select = (0, import_vobs.createElement)("select");
|
|
1155
|
+
(0, import_vobs.setAttribute)(select, "class", "vobs-devtools-network-toolbar__select");
|
|
1156
|
+
(0, import_vobs.setAttribute)(select, "aria-label", label);
|
|
1157
|
+
(0, import_vobs.setProperty)(select, "value", value);
|
|
2497
1158
|
for (const [optionValue, optionLabel] of options) {
|
|
2498
|
-
const option = createElement("option");
|
|
2499
|
-
setAttribute(option, "value", optionValue);
|
|
2500
|
-
insertBefore(option, createText(optionLabel), null);
|
|
2501
|
-
insertBefore(select, option, null);
|
|
1159
|
+
const option = (0, import_vobs.createElement)("option");
|
|
1160
|
+
(0, import_vobs.setAttribute)(option, "value", optionValue);
|
|
1161
|
+
(0, import_vobs.insertBefore)(option, (0, import_vobs.createText)(optionLabel), null);
|
|
1162
|
+
(0, import_vobs.insertBefore)(select, option, null);
|
|
2502
1163
|
}
|
|
2503
|
-
setProperty(select, "value", value);
|
|
1164
|
+
(0, import_vobs.setProperty)(select, "value", value);
|
|
2504
1165
|
select.addEventListener("change", (event) => onChange(event.target.value));
|
|
2505
1166
|
return select;
|
|
2506
1167
|
}
|
|
2507
1168
|
__name(createNetworkFilterSelect, "createNetworkFilterSelect");
|
|
2508
1169
|
function renderRequestTester(draft, onRunChange, run, activeTab, selected, http, onClose, onTabChange) {
|
|
2509
|
-
const drawer = createElement("aside");
|
|
2510
|
-
setAttribute(drawer, "class", "vobs-devtools-request-tester");
|
|
2511
|
-
setAttribute(drawer, "aria-label", "Request Tester");
|
|
2512
|
-
const heading = createElement("div");
|
|
2513
|
-
setAttribute(heading, "class", "vobs-devtools-request-tester__heading");
|
|
1170
|
+
const drawer = (0, import_vobs.createElement)("aside");
|
|
1171
|
+
(0, import_vobs.setAttribute)(drawer, "class", "vobs-devtools-request-tester");
|
|
1172
|
+
(0, import_vobs.setAttribute)(drawer, "aria-label", "Request Tester");
|
|
1173
|
+
const heading = (0, import_vobs.createElement)("div");
|
|
1174
|
+
(0, import_vobs.setAttribute)(heading, "class", "vobs-devtools-request-tester__heading");
|
|
2514
1175
|
appendText(heading, "Request Tester", "vobs-devtools-request-tester__title");
|
|
2515
|
-
const headingActions = createElement("div");
|
|
2516
|
-
setAttribute(headingActions, "class", "vobs-devtools-request-tester__heading-actions");
|
|
2517
|
-
insertBefore(headingActions, createComponent(Button, {
|
|
1176
|
+
const headingActions = (0, import_vobs.createElement)("div");
|
|
1177
|
+
(0, import_vobs.setAttribute)(headingActions, "class", "vobs-devtools-request-tester__heading-actions");
|
|
1178
|
+
(0, import_vobs.insertBefore)(headingActions, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2518
1179
|
variant: "ghost",
|
|
2519
1180
|
disabled: !selected,
|
|
2520
1181
|
children: /* @__PURE__ */ __name(() => "Use selected request", "children"),
|
|
@@ -2524,29 +1185,29 @@ function renderRequestTester(draft, onRunChange, run, activeTab, selected, http,
|
|
|
2524
1185
|
onRunChange({ status: "idle" });
|
|
2525
1186
|
}, "onClick")
|
|
2526
1187
|
}), null);
|
|
2527
|
-
insertBefore(headingActions, createComponent(Button, {
|
|
1188
|
+
(0, import_vobs.insertBefore)(headingActions, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2528
1189
|
variant: "ghost",
|
|
2529
1190
|
iconOnly: true,
|
|
2530
|
-
icon: createComponent(Icon, { name: "x" }),
|
|
1191
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "x" }),
|
|
2531
1192
|
"aria-label": "Close Request Tester",
|
|
2532
1193
|
title: "Close Request Tester",
|
|
2533
1194
|
onClick: onClose
|
|
2534
1195
|
}), null);
|
|
2535
|
-
insertBefore(heading, headingActions, null);
|
|
2536
|
-
insertBefore(drawer, heading, null);
|
|
2537
|
-
const requestLine = createElement("div");
|
|
2538
|
-
setAttribute(requestLine, "class", "vobs-devtools-request-tester__request-line");
|
|
2539
|
-
insertBefore(requestLine, createTesterInput("url", draft.url, (value) => {
|
|
1196
|
+
(0, import_vobs.insertBefore)(heading, headingActions, null);
|
|
1197
|
+
(0, import_vobs.insertBefore)(drawer, heading, null);
|
|
1198
|
+
const requestLine = (0, import_vobs.createElement)("div");
|
|
1199
|
+
(0, import_vobs.setAttribute)(requestLine, "class", "vobs-devtools-request-tester__request-line");
|
|
1200
|
+
(0, import_vobs.insertBefore)(requestLine, createTesterInput("url", draft.url, (value) => {
|
|
2540
1201
|
draft.url = value;
|
|
2541
1202
|
}), null);
|
|
2542
|
-
insertBefore(requestLine, createTesterMethodSelect(draft.method, (value) => {
|
|
1203
|
+
(0, import_vobs.insertBefore)(requestLine, createTesterMethodSelect(draft.method, (value) => {
|
|
2543
1204
|
draft.method = value;
|
|
2544
1205
|
onRunChange({ status: run.status, message: run.message });
|
|
2545
1206
|
}), null);
|
|
2546
|
-
insertBefore(requestLine, createComponent(Button, {
|
|
1207
|
+
(0, import_vobs.insertBefore)(requestLine, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
2547
1208
|
variant: "brand",
|
|
2548
1209
|
iconOnly: true,
|
|
2549
|
-
icon: createComponent(Icon, { name: "play" }),
|
|
1210
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "play" }),
|
|
2550
1211
|
loading: run.status === "running",
|
|
2551
1212
|
disabled: run.status === "running",
|
|
2552
1213
|
"aria-label": run.status === "running" ? "Running request" : "Start request",
|
|
@@ -2555,41 +1216,41 @@ function renderRequestTester(draft, onRunChange, run, activeTab, selected, http,
|
|
|
2555
1216
|
void executeRequestTester(http, draft, onRunChange);
|
|
2556
1217
|
}, "onClick")
|
|
2557
1218
|
}), null);
|
|
2558
|
-
insertBefore(drawer, requestLine, null);
|
|
2559
|
-
const tabs = createElement("div");
|
|
2560
|
-
setAttribute(tabs, "class", "vobs-devtools-request-tester__tabs");
|
|
1219
|
+
(0, import_vobs.insertBefore)(drawer, requestLine, null);
|
|
1220
|
+
const tabs = (0, import_vobs.createElement)("div");
|
|
1221
|
+
(0, import_vobs.setAttribute)(tabs, "class", "vobs-devtools-request-tester__tabs");
|
|
2561
1222
|
const tabLabels = [["params", "Params"], ["headers", "Headers"], ["body", "Body"]];
|
|
2562
1223
|
for (const [tab, label] of tabLabels) {
|
|
2563
|
-
const button = createElement("button");
|
|
2564
|
-
setAttribute(button, "class", `vobs-devtools-request-tester__tab${activeTab === tab ? " is-active" : ""}`);
|
|
2565
|
-
setAttribute(button, "type", "button");
|
|
2566
|
-
setAttribute(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
1224
|
+
const button = (0, import_vobs.createElement)("button");
|
|
1225
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-request-tester__tab${activeTab === tab ? " is-active" : ""}`);
|
|
1226
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
1227
|
+
(0, import_vobs.setAttribute)(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
2567
1228
|
appendText(button, label);
|
|
2568
1229
|
button.addEventListener("click", () => onTabChange(tab));
|
|
2569
|
-
insertBefore(tabs, button, null);
|
|
1230
|
+
(0, import_vobs.insertBefore)(tabs, button, null);
|
|
2570
1231
|
}
|
|
2571
|
-
insertBefore(drawer, tabs, null);
|
|
2572
|
-
if (activeTab === "params") insertBefore(drawer, renderTesterParamGroup("Params", draft.params, "parameter", onRunChange), null);
|
|
2573
|
-
if (activeTab === "headers") insertBefore(drawer, renderTesterParamGroup("Headers", draft.headers, "header", onRunChange), null);
|
|
1232
|
+
(0, import_vobs.insertBefore)(drawer, tabs, null);
|
|
1233
|
+
if (activeTab === "params") (0, import_vobs.insertBefore)(drawer, renderTesterParamGroup("Params", draft.params, "parameter", onRunChange), null);
|
|
1234
|
+
if (activeTab === "headers") (0, import_vobs.insertBefore)(drawer, renderTesterParamGroup("Headers", draft.headers, "header", onRunChange), null);
|
|
2574
1235
|
if (activeTab === "body") {
|
|
2575
|
-
const bodyLabel = createElement("label");
|
|
2576
|
-
setAttribute(bodyLabel, "class", "vobs-devtools-request-tester__field");
|
|
1236
|
+
const bodyLabel = (0, import_vobs.createElement)("label");
|
|
1237
|
+
(0, import_vobs.setAttribute)(bodyLabel, "class", "vobs-devtools-request-tester__field");
|
|
2577
1238
|
appendText(bodyLabel, "Body");
|
|
2578
|
-
const body = createElement("textarea");
|
|
2579
|
-
setAttribute(body, "class", "vobs-devtools-request-tester__textarea");
|
|
2580
|
-
setAttribute(body, "rows", "8");
|
|
2581
|
-
setAttribute(body, "placeholder", '{ "key": "value" }');
|
|
2582
|
-
setProperty(body, "value", draft.body);
|
|
1239
|
+
const body = (0, import_vobs.createElement)("textarea");
|
|
1240
|
+
(0, import_vobs.setAttribute)(body, "class", "vobs-devtools-request-tester__textarea");
|
|
1241
|
+
(0, import_vobs.setAttribute)(body, "rows", "8");
|
|
1242
|
+
(0, import_vobs.setAttribute)(body, "placeholder", '{ "key": "value" }');
|
|
1243
|
+
(0, import_vobs.setProperty)(body, "value", draft.body);
|
|
2583
1244
|
body.addEventListener("change", () => {
|
|
2584
1245
|
draft.body = body.value;
|
|
2585
1246
|
});
|
|
2586
|
-
insertBefore(bodyLabel, body, null);
|
|
2587
|
-
insertBefore(drawer, bodyLabel, null);
|
|
1247
|
+
(0, import_vobs.insertBefore)(bodyLabel, body, null);
|
|
1248
|
+
(0, import_vobs.insertBefore)(drawer, bodyLabel, null);
|
|
2588
1249
|
}
|
|
2589
|
-
const footer = createElement("div");
|
|
2590
|
-
setAttribute(footer, "class", "vobs-devtools-request-tester__footer");
|
|
1250
|
+
const footer = (0, import_vobs.createElement)("div");
|
|
1251
|
+
(0, import_vobs.setAttribute)(footer, "class", "vobs-devtools-request-tester__footer");
|
|
2591
1252
|
if (run.message) appendText(footer, run.message, `vobs-devtools-request-tester__status${run.status === "error" ? " is-error" : run.status === "success" ? " is-success" : ""}`);
|
|
2592
|
-
insertBefore(drawer, footer, null);
|
|
1253
|
+
(0, import_vobs.insertBefore)(drawer, footer, null);
|
|
2593
1254
|
return drawer;
|
|
2594
1255
|
}
|
|
2595
1256
|
__name(renderRequestTester, "renderRequestTester");
|
|
@@ -2617,70 +1278,70 @@ function isHTTPMethod(value) {
|
|
|
2617
1278
|
}
|
|
2618
1279
|
__name(isHTTPMethod, "isHTTPMethod");
|
|
2619
1280
|
function createTesterInput(name, value, onChange) {
|
|
2620
|
-
const input = createElement("input");
|
|
2621
|
-
setAttribute(input, "class", "vobs-devtools-request-tester__input");
|
|
2622
|
-
setAttribute(input, "name", name);
|
|
2623
|
-
setAttribute(input, "type", "text");
|
|
2624
|
-
setProperty(input, "value", value);
|
|
1281
|
+
const input = (0, import_vobs.createElement)("input");
|
|
1282
|
+
(0, import_vobs.setAttribute)(input, "class", "vobs-devtools-request-tester__input");
|
|
1283
|
+
(0, import_vobs.setAttribute)(input, "name", name);
|
|
1284
|
+
(0, import_vobs.setAttribute)(input, "type", "text");
|
|
1285
|
+
(0, import_vobs.setProperty)(input, "value", value);
|
|
2625
1286
|
input.addEventListener("change", () => onChange(input.value));
|
|
2626
1287
|
return input;
|
|
2627
1288
|
}
|
|
2628
1289
|
__name(createTesterInput, "createTesterInput");
|
|
2629
1290
|
function createTesterMethodSelect(value, onChange) {
|
|
2630
|
-
const select = createElement("select");
|
|
2631
|
-
setAttribute(select, "class", "vobs-devtools-request-tester__select");
|
|
1291
|
+
const select = (0, import_vobs.createElement)("select");
|
|
1292
|
+
(0, import_vobs.setAttribute)(select, "class", "vobs-devtools-request-tester__select");
|
|
2632
1293
|
for (const method of ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]) {
|
|
2633
|
-
const option = createElement("option");
|
|
2634
|
-
setAttribute(option, "value", method);
|
|
2635
|
-
if (method === value) setAttribute(option, "selected", "");
|
|
2636
|
-
insertBefore(option, createText(method), null);
|
|
2637
|
-
insertBefore(select, option, null);
|
|
1294
|
+
const option = (0, import_vobs.createElement)("option");
|
|
1295
|
+
(0, import_vobs.setAttribute)(option, "value", method);
|
|
1296
|
+
if (method === value) (0, import_vobs.setAttribute)(option, "selected", "");
|
|
1297
|
+
(0, import_vobs.insertBefore)(option, (0, import_vobs.createText)(method), null);
|
|
1298
|
+
(0, import_vobs.insertBefore)(select, option, null);
|
|
2638
1299
|
}
|
|
2639
1300
|
select.addEventListener("change", () => onChange(select.value));
|
|
2640
1301
|
return select;
|
|
2641
1302
|
}
|
|
2642
1303
|
__name(createTesterMethodSelect, "createTesterMethodSelect");
|
|
2643
1304
|
function renderTesterParamGroup(label, params, singular, onChange) {
|
|
2644
|
-
const group = createElement("section");
|
|
2645
|
-
setAttribute(group, "class", "vobs-devtools-request-tester__group");
|
|
2646
|
-
const title = createElement("div");
|
|
2647
|
-
setAttribute(title, "class", "vobs-devtools-request-tester__group-title");
|
|
1305
|
+
const group = (0, import_vobs.createElement)("section");
|
|
1306
|
+
(0, import_vobs.setAttribute)(group, "class", "vobs-devtools-request-tester__group");
|
|
1307
|
+
const title = (0, import_vobs.createElement)("div");
|
|
1308
|
+
(0, import_vobs.setAttribute)(title, "class", "vobs-devtools-request-tester__group-title");
|
|
2648
1309
|
appendText(title, label);
|
|
2649
|
-
const add = createElement("button");
|
|
2650
|
-
setAttribute(add, "class", "vobs-devtools-request-tester__add");
|
|
2651
|
-
setAttribute(add, "type", "button");
|
|
1310
|
+
const add = (0, import_vobs.createElement)("button");
|
|
1311
|
+
(0, import_vobs.setAttribute)(add, "class", "vobs-devtools-request-tester__add");
|
|
1312
|
+
(0, import_vobs.setAttribute)(add, "type", "button");
|
|
2652
1313
|
appendText(add, "+");
|
|
2653
|
-
setAttribute(add, "aria-label", `Add ${label}`);
|
|
2654
|
-
setAttribute(add, "title", `Add ${label}`);
|
|
1314
|
+
(0, import_vobs.setAttribute)(add, "aria-label", `Add ${label}`);
|
|
1315
|
+
(0, import_vobs.setAttribute)(add, "title", `Add ${label}`);
|
|
2655
1316
|
add.addEventListener("click", () => {
|
|
2656
1317
|
params.push({ key: "", value: "" });
|
|
2657
1318
|
onChange({ status: "idle" });
|
|
2658
1319
|
});
|
|
2659
|
-
insertBefore(title, add, null);
|
|
2660
|
-
insertBefore(group, title, null);
|
|
1320
|
+
(0, import_vobs.insertBefore)(title, add, null);
|
|
1321
|
+
(0, import_vobs.insertBefore)(group, title, null);
|
|
2661
1322
|
for (let index = 0; index < params.length; index++) {
|
|
2662
1323
|
const param = params[index];
|
|
2663
|
-
const row = createElement("div");
|
|
2664
|
-
setAttribute(row, "class", "vobs-devtools-request-tester__param");
|
|
2665
|
-
insertBefore(row, createTesterInput(`${singular}-key-${index}`, param.key, (value) => {
|
|
1324
|
+
const row = (0, import_vobs.createElement)("div");
|
|
1325
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-request-tester__param");
|
|
1326
|
+
(0, import_vobs.insertBefore)(row, createTesterInput(`${singular}-key-${index}`, param.key, (value) => {
|
|
2666
1327
|
param.key = value;
|
|
2667
1328
|
}), null);
|
|
2668
|
-
insertBefore(row, createTesterInput(`${singular}-value-${index}`, param.value, (value) => {
|
|
1329
|
+
(0, import_vobs.insertBefore)(row, createTesterInput(`${singular}-value-${index}`, param.value, (value) => {
|
|
2669
1330
|
param.value = value;
|
|
2670
1331
|
}), null);
|
|
2671
|
-
const remove = createElement("button");
|
|
2672
|
-
setAttribute(remove, "class", "vobs-devtools-request-tester__remove");
|
|
2673
|
-
setAttribute(remove, "type", "button");
|
|
2674
|
-
setAttribute(remove, "aria-label", `Remove ${label} row ${index + 1}`);
|
|
2675
|
-
setAttribute(remove, "title", `Remove ${label} row ${index + 1}`);
|
|
2676
|
-
insertBefore(remove, createComponent(Icon, { name: "trash" }), null);
|
|
1332
|
+
const remove = (0, import_vobs.createElement)("button");
|
|
1333
|
+
(0, import_vobs.setAttribute)(remove, "class", "vobs-devtools-request-tester__remove");
|
|
1334
|
+
(0, import_vobs.setAttribute)(remove, "type", "button");
|
|
1335
|
+
(0, import_vobs.setAttribute)(remove, "aria-label", `Remove ${label} row ${index + 1}`);
|
|
1336
|
+
(0, import_vobs.setAttribute)(remove, "title", `Remove ${label} row ${index + 1}`);
|
|
1337
|
+
(0, import_vobs.insertBefore)(remove, (0, import_vobs.createComponent)(import_ui.Icon, { name: "trash" }), null);
|
|
2677
1338
|
remove.addEventListener("click", () => {
|
|
2678
1339
|
params.splice(index, 1);
|
|
2679
1340
|
if (params.length === 0) params.push({ key: "", value: "" });
|
|
2680
1341
|
onChange({ status: "idle" });
|
|
2681
1342
|
});
|
|
2682
|
-
insertBefore(row, remove, null);
|
|
2683
|
-
insertBefore(group, row, null);
|
|
1343
|
+
(0, import_vobs.insertBefore)(row, remove, null);
|
|
1344
|
+
(0, import_vobs.insertBefore)(group, row, null);
|
|
2684
1345
|
}
|
|
2685
1346
|
return group;
|
|
2686
1347
|
}
|
|
@@ -2725,32 +1386,32 @@ async function executeRequestTester(http, draft, onRunChange) {
|
|
|
2725
1386
|
}
|
|
2726
1387
|
__name(executeRequestTester, "executeRequestTester");
|
|
2727
1388
|
function renderNetworkDetail(entry, activeTab, onTabChange) {
|
|
2728
|
-
const root = createElement("section");
|
|
2729
|
-
setAttribute(root, "class", "vobs-devtools-network-detail");
|
|
1389
|
+
const root = (0, import_vobs.createElement)("section");
|
|
1390
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-network-detail");
|
|
2730
1391
|
const request = entry.request;
|
|
2731
1392
|
const routerRequest = entry.routerRequest;
|
|
2732
|
-
const heading = createElement("div");
|
|
2733
|
-
setAttribute(heading, "class", "vobs-devtools-network-detail__heading");
|
|
1393
|
+
const heading = (0, import_vobs.createElement)("div");
|
|
1394
|
+
(0, import_vobs.setAttribute)(heading, "class", "vobs-devtools-network-detail__heading");
|
|
2734
1395
|
appendText(heading, `${entry.method} ${entry.url}`, "vobs-devtools-network-detail__title");
|
|
2735
|
-
if (request?.test) insertBefore(heading, createComponent(Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
2736
|
-
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);
|
|
1396
|
+
if (request?.test) (0, import_vobs.insertBefore)(heading, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "warning", children: /* @__PURE__ */ __name(() => "TEST", "children") }), null);
|
|
1397
|
+
(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);
|
|
2737
1398
|
if (entry.duration !== void 0) appendText(heading, `${entry.duration.toFixed(0)} ms`, "vobs-devtools-network-detail__duration");
|
|
2738
|
-
insertBefore(root, heading, null);
|
|
2739
|
-
const tabs = createElement("div");
|
|
2740
|
-
setAttribute(tabs, "class", "vobs-devtools-network-detail__tabs");
|
|
1399
|
+
(0, import_vobs.insertBefore)(root, heading, null);
|
|
1400
|
+
const tabs = (0, import_vobs.createElement)("div");
|
|
1401
|
+
(0, import_vobs.setAttribute)(tabs, "class", "vobs-devtools-network-detail__tabs");
|
|
2741
1402
|
const tabLabels = [["overview", "Overview"], ["headers", "Headers"], ["payload", "Payload"], ["response", "Response"], ["timing", "Timing"], ["context", "Context"]];
|
|
2742
1403
|
for (const [tab, label] of tabLabels) {
|
|
2743
|
-
const button = createElement("button");
|
|
2744
|
-
setAttribute(button, "type", "button");
|
|
2745
|
-
setAttribute(button, "class", `vobs-devtools-network-detail__tab${activeTab === tab ? " is-active" : ""}`);
|
|
2746
|
-
setAttribute(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
1404
|
+
const button = (0, import_vobs.createElement)("button");
|
|
1405
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
1406
|
+
(0, import_vobs.setAttribute)(button, "class", `vobs-devtools-network-detail__tab${activeTab === tab ? " is-active" : ""}`);
|
|
1407
|
+
(0, import_vobs.setAttribute)(button, "aria-selected", activeTab === tab ? "true" : "false");
|
|
2747
1408
|
appendText(button, label);
|
|
2748
1409
|
button.addEventListener("click", () => onTabChange(tab));
|
|
2749
|
-
insertBefore(tabs, button, null);
|
|
1410
|
+
(0, import_vobs.insertBefore)(tabs, button, null);
|
|
2750
1411
|
}
|
|
2751
|
-
insertBefore(root, tabs, null);
|
|
2752
|
-
const content = createElement("div");
|
|
2753
|
-
setAttribute(content, "class", "vobs-devtools-network-detail__content");
|
|
1412
|
+
(0, import_vobs.insertBefore)(root, tabs, null);
|
|
1413
|
+
const content = (0, import_vobs.createElement)("div");
|
|
1414
|
+
(0, import_vobs.setAttribute)(content, "class", "vobs-devtools-network-detail__content");
|
|
2754
1415
|
if (activeTab === "overview") {
|
|
2755
1416
|
appendNetworkField(content, "Source", entry.source.toUpperCase());
|
|
2756
1417
|
appendNetworkField(content, "Method / Type", entry.method);
|
|
@@ -2758,15 +1419,15 @@ function renderNetworkDetail(entry, activeTab, onTabChange) {
|
|
|
2758
1419
|
appendNetworkField(content, "Status", entry.status);
|
|
2759
1420
|
if (request?.error || routerRequest?.error) appendText(content, request ? `${request.error?.name}: ${request.error?.message}` : routerRequest.error, "vobs-devtools-error");
|
|
2760
1421
|
} else if (activeTab === "headers") {
|
|
2761
|
-
if (request && Object.keys(request.headers).length > 0) insertBefore(content, renderValueTree("Headers", request.headers, false), null);
|
|
1422
|
+
if (request && Object.keys(request.headers).length > 0) (0, import_vobs.insertBefore)(content, renderValueTree("Headers", request.headers, false), null);
|
|
2762
1423
|
else appendMuted(content, "No captured headers for this request.");
|
|
2763
1424
|
} else if (activeTab === "payload") {
|
|
2764
1425
|
const payload = request?.requestBody;
|
|
2765
|
-
if (payload !== void 0) insertBefore(content, renderValueTree("Request body", payload, false), null);
|
|
1426
|
+
if (payload !== void 0) (0, import_vobs.insertBefore)(content, renderValueTree("Request body", payload, false), null);
|
|
2766
1427
|
else appendMuted(content, "No request payload captured.");
|
|
2767
1428
|
} else if (activeTab === "response") {
|
|
2768
1429
|
const response = request?.responseBody ?? routerRequest?.result;
|
|
2769
|
-
if (response !== void 0) insertBefore(content, renderValueTree("Response", response, false), null);
|
|
1430
|
+
if (response !== void 0) (0, import_vobs.insertBefore)(content, renderValueTree("Response", response, false), null);
|
|
2770
1431
|
else appendMuted(content, routerRequest?.error ?? "No response body captured.");
|
|
2771
1432
|
} else if (activeTab === "timing") {
|
|
2772
1433
|
if (entry.startedAt !== void 0) appendNetworkField(content, "Started at", formatNetworkTimestamp(entry.startedAt));
|
|
@@ -2781,16 +1442,16 @@ function renderNetworkDetail(entry, activeTab, onTabChange) {
|
|
|
2781
1442
|
if (routerRequest?.trigger) appendNetworkField(content, "Trigger", routerRequest.trigger);
|
|
2782
1443
|
appendNetworkField(content, "Request ID", String(request?.id ?? routerRequest?.id), "code");
|
|
2783
1444
|
}
|
|
2784
|
-
insertBefore(root, content, null);
|
|
1445
|
+
(0, import_vobs.insertBefore)(root, content, null);
|
|
2785
1446
|
return root;
|
|
2786
1447
|
}
|
|
2787
1448
|
__name(renderNetworkDetail, "renderNetworkDetail");
|
|
2788
1449
|
function appendNetworkField(parent, label, value, valueKind) {
|
|
2789
|
-
const field = createElement("div");
|
|
2790
|
-
setAttribute(field, "class", "vobs-devtools-network-detail__field");
|
|
1450
|
+
const field = (0, import_vobs.createElement)("div");
|
|
1451
|
+
(0, import_vobs.setAttribute)(field, "class", "vobs-devtools-network-detail__field");
|
|
2791
1452
|
appendText(field, label, "vobs-devtools-network-detail__label");
|
|
2792
1453
|
appendText(field, value, `vobs-devtools-network-detail__value${valueKind ? ` vobs-devtools-${valueKind}` : ""}`);
|
|
2793
|
-
insertBefore(parent, field, null);
|
|
1454
|
+
(0, import_vobs.insertBefore)(parent, field, null);
|
|
2794
1455
|
}
|
|
2795
1456
|
__name(appendNetworkField, "appendNetworkField");
|
|
2796
1457
|
function formatNetworkTimestamp(value) {
|
|
@@ -2818,25 +1479,25 @@ function filterComponentTree(nodes, query) {
|
|
|
2818
1479
|
}
|
|
2819
1480
|
__name(filterComponentTree, "filterComponentTree");
|
|
2820
1481
|
function renderErrors(errors, selection, onFocus) {
|
|
2821
|
-
const root = createElement("div");
|
|
2822
|
-
setAttribute(root, "class", "vobs-devtools-error-list");
|
|
1482
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1483
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-error-list");
|
|
2823
1484
|
for (const error of [...errors].reverse()) {
|
|
2824
|
-
const row = createElement("details");
|
|
1485
|
+
const row = (0, import_vobs.createElement)("details");
|
|
2825
1486
|
const selected = selection?.type === "error" && selection.id === error.id;
|
|
2826
|
-
setAttribute(row, "class", `vobs-devtools-list__row vobs-devtools-error-item${selected ? " is-selected" : ""}`);
|
|
2827
|
-
if (selected) setProperty(row, "open", true);
|
|
1487
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-list__row vobs-devtools-error-item${selected ? " is-selected" : ""}`);
|
|
1488
|
+
if (selected) (0, import_vobs.setProperty)(row, "open", true);
|
|
2828
1489
|
row.addEventListener("click", (event) => {
|
|
2829
1490
|
event.stopPropagation();
|
|
2830
1491
|
onFocus("errors", { type: "error", id: error.id });
|
|
2831
1492
|
});
|
|
2832
|
-
const summary = createElement("summary");
|
|
1493
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
2833
1494
|
appendText(summary, formatErrorSummary(error), "vobs-devtools-list__name");
|
|
2834
1495
|
appendText(summary, error.message, "vobs-devtools-error-item__message");
|
|
2835
|
-
insertBefore(summary, createComponent(Tag, { tone: error.origin === "framework" ? "danger" : error.origin === "usage" ? "warning" : "neutral-strong", children: /* @__PURE__ */ __name(() => error.origin, "children") }), null);
|
|
2836
|
-
insertBefore(summary, createComponent(Tag, { tone: "danger", children: /* @__PURE__ */ __name(() => `${error.count}\xD7`, "children") }), null);
|
|
2837
|
-
insertBefore(row, summary, null);
|
|
2838
|
-
const details = createElement("div");
|
|
2839
|
-
setAttribute(details, "class", "vobs-devtools-error-item__details");
|
|
1496
|
+
(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);
|
|
1497
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "danger", children: /* @__PURE__ */ __name(() => `${error.count}\xD7`, "children") }), null);
|
|
1498
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
1499
|
+
const details = (0, import_vobs.createElement)("div");
|
|
1500
|
+
(0, import_vobs.setAttribute)(details, "class", "vobs-devtools-error-item__details");
|
|
2840
1501
|
appendErrorField(details, "Phase", error.phases.length > 1 ? error.phases.join(" / ") : error.phase);
|
|
2841
1502
|
appendErrorField(details, "Occurred", `first ${new Date(error.firstOccurredAt).toLocaleString()} \xB7 last ${new Date(error.lastOccurredAt).toLocaleString()}`, "muted");
|
|
2842
1503
|
if (error.code) appendErrorField(details, "Code", error.code, "code");
|
|
@@ -2858,53 +1519,53 @@ function renderErrors(errors, selection, onFocus) {
|
|
|
2858
1519
|
appendErrorField(details, "DOM path", error.hydration.path, "code");
|
|
2859
1520
|
}
|
|
2860
1521
|
if (error.stack) appendErrorStack(details, error.stack, error.name, error.message);
|
|
2861
|
-
insertBefore(row, details, null);
|
|
2862
|
-
insertBefore(root, row, null);
|
|
1522
|
+
(0, import_vobs.insertBefore)(row, details, null);
|
|
1523
|
+
(0, import_vobs.insertBefore)(root, row, null);
|
|
2863
1524
|
}
|
|
2864
1525
|
if (errors.length === 0) appendMuted(root, "No errors recorded.");
|
|
2865
1526
|
return root;
|
|
2866
1527
|
}
|
|
2867
1528
|
__name(renderErrors, "renderErrors");
|
|
2868
1529
|
function appendContextLink(parent, label, section, selection, onFocus) {
|
|
2869
|
-
const button = createElement("button");
|
|
2870
|
-
setAttribute(button, "class", "vobs-devtools-link");
|
|
2871
|
-
setAttribute(button, "type", "button");
|
|
1530
|
+
const button = (0, import_vobs.createElement)("button");
|
|
1531
|
+
(0, import_vobs.setAttribute)(button, "class", "vobs-devtools-link");
|
|
1532
|
+
(0, import_vobs.setAttribute)(button, "type", "button");
|
|
2872
1533
|
button.addEventListener("click", (event) => {
|
|
2873
1534
|
event.stopPropagation();
|
|
2874
1535
|
onFocus(section, selection);
|
|
2875
1536
|
});
|
|
2876
|
-
insertBefore(button, createText(label), null);
|
|
2877
|
-
insertBefore(parent, button, null);
|
|
1537
|
+
(0, import_vobs.insertBefore)(button, (0, import_vobs.createText)(label), null);
|
|
1538
|
+
(0, import_vobs.insertBefore)(parent, button, null);
|
|
2878
1539
|
}
|
|
2879
1540
|
__name(appendContextLink, "appendContextLink");
|
|
2880
1541
|
function appendErrorField(parent, label, value, valueKind, wide = false) {
|
|
2881
|
-
const field = createElement("div");
|
|
2882
|
-
setAttribute(field, "class", `vobs-devtools-error-item__field${wide ? " vobs-devtools-error-item__field--wide" : ""}`);
|
|
1542
|
+
const field = (0, import_vobs.createElement)("div");
|
|
1543
|
+
(0, import_vobs.setAttribute)(field, "class", `vobs-devtools-error-item__field${wide ? " vobs-devtools-error-item__field--wide" : ""}`);
|
|
2883
1544
|
appendText(field, label, "vobs-devtools-error-item__label");
|
|
2884
1545
|
appendText(field, value, `vobs-devtools-error-item__value${valueKind ? ` vobs-devtools-${valueKind}` : ""}`);
|
|
2885
|
-
insertBefore(parent, field, null);
|
|
1546
|
+
(0, import_vobs.insertBefore)(parent, field, null);
|
|
2886
1547
|
}
|
|
2887
1548
|
__name(appendErrorField, "appendErrorField");
|
|
2888
1549
|
function appendErrorLinkField(parent, label, value, section, selection, onFocus) {
|
|
2889
|
-
const field = createElement("div");
|
|
2890
|
-
setAttribute(field, "class", "vobs-devtools-error-item__field");
|
|
1550
|
+
const field = (0, import_vobs.createElement)("div");
|
|
1551
|
+
(0, import_vobs.setAttribute)(field, "class", "vobs-devtools-error-item__field");
|
|
2891
1552
|
appendText(field, label, "vobs-devtools-error-item__label");
|
|
2892
|
-
const valueNode = createElement("span");
|
|
2893
|
-
setAttribute(valueNode, "class", "vobs-devtools-error-item__value");
|
|
1553
|
+
const valueNode = (0, import_vobs.createElement)("span");
|
|
1554
|
+
(0, import_vobs.setAttribute)(valueNode, "class", "vobs-devtools-error-item__value");
|
|
2894
1555
|
appendContextLink(valueNode, value, section, selection, onFocus);
|
|
2895
|
-
insertBefore(field, valueNode, null);
|
|
2896
|
-
insertBefore(parent, field, null);
|
|
1556
|
+
(0, import_vobs.insertBefore)(field, valueNode, null);
|
|
1557
|
+
(0, import_vobs.insertBefore)(parent, field, null);
|
|
2897
1558
|
}
|
|
2898
1559
|
__name(appendErrorLinkField, "appendErrorLinkField");
|
|
2899
1560
|
function appendErrorStack(parent, value, name, message) {
|
|
2900
|
-
const stack = createElement("div");
|
|
2901
|
-
setAttribute(stack, "class", "vobs-devtools-error-item__stack");
|
|
1561
|
+
const stack = (0, import_vobs.createElement)("div");
|
|
1562
|
+
(0, import_vobs.setAttribute)(stack, "class", "vobs-devtools-error-item__stack");
|
|
2902
1563
|
appendText(stack, "Stack trace", "vobs-devtools-error-item__label");
|
|
2903
|
-
const code = createElement("pre");
|
|
2904
|
-
setAttribute(code, "class", "vobs-devtools-error-item__stack-code vobs-devtools-code");
|
|
2905
|
-
insertBefore(code, createText(formatDebugStack(value, name, message)), null);
|
|
2906
|
-
insertBefore(stack, code, null);
|
|
2907
|
-
insertBefore(parent, stack, null);
|
|
1564
|
+
const code = (0, import_vobs.createElement)("pre");
|
|
1565
|
+
(0, import_vobs.setAttribute)(code, "class", "vobs-devtools-error-item__stack-code vobs-devtools-code");
|
|
1566
|
+
(0, import_vobs.insertBefore)(code, (0, import_vobs.createText)(formatDebugStack(value, name, message)), null);
|
|
1567
|
+
(0, import_vobs.insertBefore)(stack, code, null);
|
|
1568
|
+
(0, import_vobs.insertBefore)(parent, stack, null);
|
|
2908
1569
|
}
|
|
2909
1570
|
__name(appendErrorStack, "appendErrorStack");
|
|
2910
1571
|
function formatErrorSummary(error) {
|
|
@@ -2939,10 +1600,10 @@ function displayErrorComponent(value) {
|
|
|
2939
1600
|
}
|
|
2940
1601
|
__name(displayErrorComponent, "displayErrorComponent");
|
|
2941
1602
|
function appendText(parent, value, className) {
|
|
2942
|
-
const node = createElement("span");
|
|
2943
|
-
if (className) setAttribute(node, "class", className);
|
|
2944
|
-
insertBefore(node, createText(value), null);
|
|
2945
|
-
insertBefore(parent, node, null);
|
|
1603
|
+
const node = (0, import_vobs.createElement)("span");
|
|
1604
|
+
if (className) (0, import_vobs.setAttribute)(node, "class", className);
|
|
1605
|
+
(0, import_vobs.insertBefore)(node, (0, import_vobs.createText)(value), null);
|
|
1606
|
+
(0, import_vobs.insertBefore)(parent, node, null);
|
|
2946
1607
|
}
|
|
2947
1608
|
__name(appendText, "appendText");
|
|
2948
1609
|
function formatDebugLocation(value) {
|
|
@@ -2999,20 +1660,20 @@ function stripDebugLocation(value) {
|
|
|
2999
1660
|
}
|
|
3000
1661
|
__name(stripDebugLocation, "stripDebugLocation");
|
|
3001
1662
|
function renderComponentSummary(node, snapshot, selection, onFocus) {
|
|
3002
|
-
const row = createElement("details");
|
|
1663
|
+
const row = (0, import_vobs.createElement)("details");
|
|
3003
1664
|
const selected = selection?.type === "component" && selection.id === node.id;
|
|
3004
|
-
setAttribute(row, "class", `vobs-devtools-list__row vobs-devtools-component-row${selected ? " is-selected" : ""}`);
|
|
3005
|
-
if (selected) setProperty(row, "open", true);
|
|
1665
|
+
(0, import_vobs.setAttribute)(row, "class", `vobs-devtools-list__row vobs-devtools-component-row${selected ? " is-selected" : ""}`);
|
|
1666
|
+
if (selected) (0, import_vobs.setProperty)(row, "open", true);
|
|
3006
1667
|
row.addEventListener("click", (event) => {
|
|
3007
1668
|
event.stopPropagation();
|
|
3008
1669
|
onFocus("components", { type: "component", id: node.id });
|
|
3009
1670
|
});
|
|
3010
|
-
const summary = createElement("summary");
|
|
1671
|
+
const summary = (0, import_vobs.createElement)("summary");
|
|
3011
1672
|
appendText(summary, formatDebugLocation(node.name), "vobs-devtools-list__name");
|
|
3012
|
-
insertBefore(summary, createComponent(Tag, { tone: node.mounted ? "success" : "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.signals.length} signals`, "children") }), null);
|
|
3013
|
-
insertBefore(summary, createComponent(Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.effects.length} effects`, "children") }), null);
|
|
1673
|
+
(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);
|
|
1674
|
+
(0, import_vobs.insertBefore)(summary, (0, import_vobs.createComponent)(import_ui.Tag, { tone: "neutral-strong", children: /* @__PURE__ */ __name(() => `${node.effects.length} effects`, "children") }), null);
|
|
3014
1675
|
appendText(summary, `${node.recentUpdates.length} updates \xB7 ${node.domUpdates} DOM`, "vobs-devtools-muted");
|
|
3015
|
-
insertBefore(row, summary, null);
|
|
1676
|
+
(0, import_vobs.insertBefore)(row, summary, null);
|
|
3016
1677
|
appendText(row, `Component ID: ${node.id}`, "vobs-devtools-code");
|
|
3017
1678
|
appendText(row, "Recent updates:", "vobs-devtools-code");
|
|
3018
1679
|
appendUpdateLinks(row, node.recentUpdates, onFocus);
|
|
@@ -3028,7 +1689,7 @@ function renderComponentSummary(node, snapshot, selection, onFocus) {
|
|
|
3028
1689
|
}
|
|
3029
1690
|
if (node.children.length > 0) {
|
|
3030
1691
|
appendText(row, "Children:", "vobs-devtools-code");
|
|
3031
|
-
for (const child of node.children) insertBefore(row, renderComponentSummary(child, snapshot, selection, onFocus), null);
|
|
1692
|
+
for (const child of node.children) (0, import_vobs.insertBefore)(row, renderComponentSummary(child, snapshot, selection, onFocus), null);
|
|
3032
1693
|
}
|
|
3033
1694
|
return row;
|
|
3034
1695
|
}
|
|
@@ -3043,84 +1704,84 @@ function formatValue(value) {
|
|
|
3043
1704
|
}
|
|
3044
1705
|
__name(formatValue, "formatValue");
|
|
3045
1706
|
function renderValuePair(label, previousValue, nextValue) {
|
|
3046
|
-
const root = createElement("div");
|
|
3047
|
-
setAttribute(root, "class", `vobs-devtools-value-pair${label ? "" : " vobs-devtools-value-pair--compact"}`);
|
|
3048
|
-
const distinctMode = state(Boolean(label));
|
|
1707
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1708
|
+
(0, import_vobs.setAttribute)(root, "class", `vobs-devtools-value-pair${label ? "" : " vobs-devtools-value-pair--compact"}`);
|
|
1709
|
+
const distinctMode = (0, import_vobs.state)(Boolean(label));
|
|
3049
1710
|
root.addEventListener("click", (event) => event.stopPropagation());
|
|
3050
1711
|
root.addEventListener("pointerdown", (event) => event.stopPropagation());
|
|
3051
1712
|
if (label) {
|
|
3052
|
-
const title = createElement("div");
|
|
3053
|
-
setAttribute(title, "class", "vobs-devtools-value-pair__title");
|
|
1713
|
+
const title = (0, import_vobs.createElement)("div");
|
|
1714
|
+
(0, import_vobs.setAttribute)(title, "class", "vobs-devtools-value-pair__title");
|
|
3054
1715
|
appendText(title, label);
|
|
3055
|
-
const toggle = createElement("button");
|
|
3056
|
-
setAttribute(toggle, "class", "vobs-devtools-distinct-toggle is-active");
|
|
3057
|
-
setAttribute(toggle, "type", "button");
|
|
3058
|
-
setAttribute(toggle, "aria-pressed", "true");
|
|
3059
|
-
setAttribute(toggle, "title", "Show only values that changed");
|
|
3060
|
-
insertBefore(toggle, createText("distinct"), null);
|
|
1716
|
+
const toggle = (0, import_vobs.createElement)("button");
|
|
1717
|
+
(0, import_vobs.setAttribute)(toggle, "class", "vobs-devtools-distinct-toggle is-active");
|
|
1718
|
+
(0, import_vobs.setAttribute)(toggle, "type", "button");
|
|
1719
|
+
(0, import_vobs.setAttribute)(toggle, "aria-pressed", "true");
|
|
1720
|
+
(0, import_vobs.setAttribute)(toggle, "title", "Show only values that changed");
|
|
1721
|
+
(0, import_vobs.insertBefore)(toggle, (0, import_vobs.createText)("distinct"), null);
|
|
3061
1722
|
toggle.addEventListener("click", (event) => {
|
|
3062
1723
|
event.stopPropagation();
|
|
3063
1724
|
const enabled = !distinctMode.value;
|
|
3064
1725
|
distinctMode.value = enabled;
|
|
3065
|
-
setAttribute(toggle, "class", `vobs-devtools-distinct-toggle${enabled ? " is-active" : ""}`);
|
|
3066
|
-
setAttribute(toggle, "aria-pressed", enabled ? "true" : "false");
|
|
3067
|
-
setAttribute(toggle, "title", enabled ? "Show only values that changed" : "Show complete values");
|
|
1726
|
+
(0, import_vobs.setAttribute)(toggle, "class", `vobs-devtools-distinct-toggle${enabled ? " is-active" : ""}`);
|
|
1727
|
+
(0, import_vobs.setAttribute)(toggle, "aria-pressed", enabled ? "true" : "false");
|
|
1728
|
+
(0, import_vobs.setAttribute)(toggle, "title", enabled ? "Show only values that changed" : "Show complete values");
|
|
3068
1729
|
});
|
|
3069
|
-
insertBefore(title, toggle, null);
|
|
3070
|
-
insertBefore(root, title, null);
|
|
1730
|
+
(0, import_vobs.insertBefore)(title, toggle, null);
|
|
1731
|
+
(0, import_vobs.insertBefore)(root, title, null);
|
|
3071
1732
|
}
|
|
3072
|
-
insertDynamic(root, null, () => {
|
|
1733
|
+
(0, import_vobs.insertDynamic)(root, null, () => {
|
|
3073
1734
|
const distinct = distinctMode.value;
|
|
3074
1735
|
const difference = distinct ? createDistinctValuePair(previousValue, nextValue) : null;
|
|
3075
1736
|
const before = difference?.before ?? { value: previousValue, hasDifference: true };
|
|
3076
1737
|
const after = difference?.after ?? { value: nextValue, hasDifference: true };
|
|
3077
|
-
return createFragment((parent, anchor) => {
|
|
3078
|
-
insertBefore(parent, renderValueTree("Before", before.value, Boolean(label), distinct && !before.hasDifference ? "No differing fields" : void 0), anchor);
|
|
3079
|
-
insertBefore(parent, renderValueTree("After", after.value, Boolean(label), distinct && !after.hasDifference ? "No differing fields" : void 0), anchor);
|
|
1738
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
1739
|
+
(0, import_vobs.insertBefore)(parent, renderValueTree("Before", before.value, Boolean(label), distinct && !before.hasDifference ? "No differing fields" : void 0), anchor);
|
|
1740
|
+
(0, import_vobs.insertBefore)(parent, renderValueTree("After", after.value, Boolean(label), distinct && !after.hasDifference ? "No differing fields" : void 0), anchor);
|
|
3080
1741
|
});
|
|
3081
1742
|
});
|
|
3082
1743
|
return root;
|
|
3083
1744
|
}
|
|
3084
1745
|
__name(renderValuePair, "renderValuePair");
|
|
3085
1746
|
function renderValueTree(label, value, expanded, emptyMessage) {
|
|
3086
|
-
const root = createElement("section");
|
|
3087
|
-
setAttribute(root, "class", "vobs-devtools-value-inspector");
|
|
1747
|
+
const root = (0, import_vobs.createElement)("section");
|
|
1748
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-value-inspector");
|
|
3088
1749
|
root.addEventListener("click", (event) => event.stopPropagation());
|
|
3089
1750
|
root.addEventListener("pointerdown", (event) => event.stopPropagation());
|
|
3090
1751
|
if (hasExpandableEntries(value)) {
|
|
3091
|
-
const controls = createElement("div");
|
|
3092
|
-
setAttribute(controls, "class", "vobs-devtools-value-inspector__controls");
|
|
3093
|
-
insertBefore(controls, createComponent(Button, {
|
|
1752
|
+
const controls = (0, import_vobs.createElement)("div");
|
|
1753
|
+
(0, import_vobs.setAttribute)(controls, "class", "vobs-devtools-value-inspector__controls");
|
|
1754
|
+
(0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
3094
1755
|
variant: "ghost",
|
|
3095
1756
|
iconOnly: true,
|
|
3096
|
-
icon: createComponent(Icon, { name: "plus" }),
|
|
1757
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "plus" }),
|
|
3097
1758
|
"aria-label": `Expand all ${label} values`,
|
|
3098
1759
|
title: `Expand all ${label} values`,
|
|
3099
1760
|
onClick: /* @__PURE__ */ __name((event) => {
|
|
3100
1761
|
event.stopPropagation();
|
|
3101
|
-
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) setAttribute(node, "data-expanded", "true");
|
|
1762
|
+
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) (0, import_vobs.setAttribute)(node, "data-expanded", "true");
|
|
3102
1763
|
}, "onClick")
|
|
3103
1764
|
}), null);
|
|
3104
|
-
insertBefore(controls, createComponent(Button, {
|
|
1765
|
+
(0, import_vobs.insertBefore)(controls, (0, import_vobs.createComponent)(import_ui.Button, {
|
|
3105
1766
|
variant: "ghost",
|
|
3106
1767
|
iconOnly: true,
|
|
3107
|
-
icon: createComponent(Icon, { name: "minus" }),
|
|
1768
|
+
icon: (0, import_vobs.createComponent)(import_ui.Icon, { name: "minus" }),
|
|
3108
1769
|
"aria-label": `Collapse all ${label} values`,
|
|
3109
1770
|
title: `Collapse all ${label} values`,
|
|
3110
1771
|
onClick: /* @__PURE__ */ __name((event) => {
|
|
3111
1772
|
event.stopPropagation();
|
|
3112
|
-
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) setAttribute(node, "data-expanded", "false");
|
|
1773
|
+
for (const node of root.querySelectorAll(".vobs-devtools-value-tree")) (0, import_vobs.setAttribute)(node, "data-expanded", "false");
|
|
3113
1774
|
}, "onClick")
|
|
3114
1775
|
}), null);
|
|
3115
|
-
insertBefore(root, controls, null);
|
|
1776
|
+
(0, import_vobs.insertBefore)(root, controls, null);
|
|
3116
1777
|
}
|
|
3117
|
-
const tree = createElement("div");
|
|
3118
|
-
setAttribute(tree, "class", "vobs-devtools-value-tree-root");
|
|
3119
|
-
setAttribute(tree, "role", "tree");
|
|
3120
|
-
setAttribute(tree, "aria-label", `${label} value`);
|
|
1778
|
+
const tree = (0, import_vobs.createElement)("div");
|
|
1779
|
+
(0, import_vobs.setAttribute)(tree, "class", "vobs-devtools-value-tree-root");
|
|
1780
|
+
(0, import_vobs.setAttribute)(tree, "role", "tree");
|
|
1781
|
+
(0, import_vobs.setAttribute)(tree, "aria-label", `${label} value`);
|
|
3121
1782
|
if (emptyMessage) appendText(tree, emptyMessage, "vobs-devtools-value-tree__empty");
|
|
3122
|
-
else insertBefore(tree, renderInspectableValue(label, value, expanded), null);
|
|
3123
|
-
insertBefore(root, tree, null);
|
|
1783
|
+
else (0, import_vobs.insertBefore)(tree, renderInspectableValue(label, value, expanded), null);
|
|
1784
|
+
(0, import_vobs.insertBefore)(root, tree, null);
|
|
3124
1785
|
return root;
|
|
3125
1786
|
}
|
|
3126
1787
|
__name(renderValueTree, "renderValueTree");
|
|
@@ -3202,27 +1863,27 @@ function areValuesEqual(before, after, seen = /* @__PURE__ */ new WeakMap()) {
|
|
|
3202
1863
|
__name(areValuesEqual, "areValuesEqual");
|
|
3203
1864
|
function renderInspectableValue(label, value, expanded = false, ancestors = []) {
|
|
3204
1865
|
if (!hasExpandableEntries(value) || ancestors.includes(value)) {
|
|
3205
|
-
const row = createElement("div");
|
|
3206
|
-
setAttribute(row, "class", "vobs-devtools-value-tree__leaf");
|
|
3207
|
-
setAttribute(row, "role", "treeitem");
|
|
1866
|
+
const row = (0, import_vobs.createElement)("div");
|
|
1867
|
+
(0, import_vobs.setAttribute)(row, "class", "vobs-devtools-value-tree__leaf");
|
|
1868
|
+
(0, import_vobs.setAttribute)(row, "role", "treeitem");
|
|
3208
1869
|
appendText(row, label, "vobs-devtools-value-field__label");
|
|
3209
1870
|
appendText(row, ancestors.includes(value) ? "[Circular]" : previewValue(value), "vobs-devtools-code");
|
|
3210
1871
|
return row;
|
|
3211
1872
|
}
|
|
3212
|
-
const root = createElement("div");
|
|
3213
|
-
setAttribute(root, "class", "vobs-devtools-value-tree");
|
|
3214
|
-
setAttribute(root, "role", "treeitem");
|
|
3215
|
-
setAttribute(root, "data-expanded", expanded ? "true" : "false");
|
|
3216
|
-
const summary = createElement("button");
|
|
3217
|
-
setAttribute(summary, "class", "vobs-devtools-value-tree__summary");
|
|
3218
|
-
setAttribute(summary, "type", "button");
|
|
3219
|
-
setAttribute(summary, "aria-expanded", expanded ? "true" : "false");
|
|
3220
|
-
setAttribute(summary, "title", `Expand ${label}`);
|
|
1873
|
+
const root = (0, import_vobs.createElement)("div");
|
|
1874
|
+
(0, import_vobs.setAttribute)(root, "class", "vobs-devtools-value-tree");
|
|
1875
|
+
(0, import_vobs.setAttribute)(root, "role", "treeitem");
|
|
1876
|
+
(0, import_vobs.setAttribute)(root, "data-expanded", expanded ? "true" : "false");
|
|
1877
|
+
const summary = (0, import_vobs.createElement)("button");
|
|
1878
|
+
(0, import_vobs.setAttribute)(summary, "class", "vobs-devtools-value-tree__summary");
|
|
1879
|
+
(0, import_vobs.setAttribute)(summary, "type", "button");
|
|
1880
|
+
(0, import_vobs.setAttribute)(summary, "aria-expanded", expanded ? "true" : "false");
|
|
1881
|
+
(0, import_vobs.setAttribute)(summary, "title", `Expand ${label}`);
|
|
3221
1882
|
const toggleExpanded = /* @__PURE__ */ __name(() => {
|
|
3222
1883
|
const expanded2 = root.getAttribute("data-expanded") !== "true";
|
|
3223
|
-
setAttribute(root, "data-expanded", expanded2 ? "true" : "false");
|
|
3224
|
-
setAttribute(summary, "aria-expanded", expanded2 ? "true" : "false");
|
|
3225
|
-
setAttribute(summary, "title", `${expanded2 ? "Collapse" : "Expand"} ${label}`);
|
|
1884
|
+
(0, import_vobs.setAttribute)(root, "data-expanded", expanded2 ? "true" : "false");
|
|
1885
|
+
(0, import_vobs.setAttribute)(summary, "aria-expanded", expanded2 ? "true" : "false");
|
|
1886
|
+
(0, import_vobs.setAttribute)(summary, "title", `${expanded2 ? "Collapse" : "Expand"} ${label}`);
|
|
3226
1887
|
}, "toggleExpanded");
|
|
3227
1888
|
summary.addEventListener("pointerdown", (event) => {
|
|
3228
1889
|
event.preventDefault();
|
|
@@ -3238,14 +1899,14 @@ function renderInspectableValue(label, value, expanded = false, ancestors = [])
|
|
|
3238
1899
|
});
|
|
3239
1900
|
appendText(summary, label, "vobs-devtools-value-field__label");
|
|
3240
1901
|
appendText(summary, previewValue(value), "vobs-devtools-code");
|
|
3241
|
-
insertBefore(root, summary, null);
|
|
3242
|
-
const children = createElement("div");
|
|
3243
|
-
setAttribute(children, "class", "vobs-devtools-value-tree__children");
|
|
3244
|
-
setAttribute(children, "role", "group");
|
|
1902
|
+
(0, import_vobs.insertBefore)(root, summary, null);
|
|
1903
|
+
const children = (0, import_vobs.createElement)("div");
|
|
1904
|
+
(0, import_vobs.setAttribute)(children, "class", "vobs-devtools-value-tree__children");
|
|
1905
|
+
(0, import_vobs.setAttribute)(children, "role", "group");
|
|
3245
1906
|
for (const [key, child] of valueEntries(value)) {
|
|
3246
|
-
insertBefore(children, renderInspectableValue(key, child, false, [...ancestors, value]), null);
|
|
1907
|
+
(0, import_vobs.insertBefore)(children, renderInspectableValue(key, child, false, [...ancestors, value]), null);
|
|
3247
1908
|
}
|
|
3248
|
-
insertBefore(root, children, null);
|
|
1909
|
+
(0, import_vobs.insertBefore)(root, children, null);
|
|
3249
1910
|
return root;
|
|
3250
1911
|
}
|
|
3251
1912
|
__name(renderInspectableValue, "renderInspectableValue");
|
|
@@ -3274,13 +1935,16 @@ function previewValue(value) {
|
|
|
3274
1935
|
__name(previewValue, "previewValue");
|
|
3275
1936
|
|
|
3276
1937
|
// packages/devtools-ui/src/widget.tsx
|
|
1938
|
+
var import_vobs2 = require("@vobs/vobs");
|
|
1939
|
+
var import_devtools2 = require("@vobs/devtools");
|
|
1940
|
+
var import_ui2 = require("@vobs/ui");
|
|
3277
1941
|
function DevToolsWidget(props = {}) {
|
|
3278
|
-
const open = state(false);
|
|
3279
|
-
const maximized = state(false);
|
|
3280
|
-
const query = state("");
|
|
1942
|
+
const open = (0, import_vobs2.state)(false);
|
|
1943
|
+
const maximized = (0, import_vobs2.state)(false);
|
|
1944
|
+
const query = (0, import_vobs2.state)("");
|
|
3281
1945
|
const toolbarProps = {
|
|
3282
1946
|
get api() {
|
|
3283
|
-
return props.api === void 0 ? getDevTools() : props.api ?? null;
|
|
1947
|
+
return props.api === void 0 ? (0, import_devtools2.getDevTools)() : props.api ?? null;
|
|
3284
1948
|
},
|
|
3285
1949
|
query,
|
|
3286
1950
|
get maximized() {
|
|
@@ -3290,34 +1954,34 @@ function DevToolsWidget(props = {}) {
|
|
|
3290
1954
|
maximized.value = !maximized.value;
|
|
3291
1955
|
}, "onToggleMaximize")
|
|
3292
1956
|
};
|
|
3293
|
-
return createFragment((parent, anchor) => {
|
|
3294
|
-
const launcher = createElement("div");
|
|
3295
|
-
setAttribute(launcher, "class", "vobs-devtools-widget");
|
|
3296
|
-
insertBefore(launcher, createComponent(Button, {
|
|
1957
|
+
return (0, import_vobs2.createFragment)((parent, anchor) => {
|
|
1958
|
+
const launcher = (0, import_vobs2.createElement)("div");
|
|
1959
|
+
(0, import_vobs2.setAttribute)(launcher, "class", "vobs-devtools-widget");
|
|
1960
|
+
(0, import_vobs2.insertBefore)(launcher, (0, import_vobs2.createComponent)(import_ui2.Button, {
|
|
3297
1961
|
variant: "brand",
|
|
3298
1962
|
iconOnly: true,
|
|
3299
|
-
icon: createComponent(Icon, { name: "code" }),
|
|
1963
|
+
icon: (0, import_vobs2.createComponent)(import_ui2.Icon, { name: "code" }),
|
|
3300
1964
|
"aria-label": props.label ?? "Open DevTools",
|
|
3301
1965
|
title: props.label ?? "Open DevTools",
|
|
3302
1966
|
onClick: /* @__PURE__ */ __name(() => {
|
|
3303
1967
|
open.value = true;
|
|
3304
1968
|
}, "onClick")
|
|
3305
1969
|
}), null);
|
|
3306
|
-
insertBefore(parent, launcher, anchor);
|
|
3307
|
-
insertDynamic(parent, anchor, () => open.value ? createComponent(Dialog, {
|
|
1970
|
+
(0, import_vobs2.insertBefore)(parent, launcher, anchor);
|
|
1971
|
+
(0, import_vobs2.insertDynamic)(parent, anchor, () => open.value ? (0, import_vobs2.createComponent)(import_ui2.Dialog, {
|
|
3308
1972
|
get class() {
|
|
3309
1973
|
return `vobs-devtools-widget__dialog${maximized.value ? " is-maximized" : ""}`;
|
|
3310
1974
|
},
|
|
3311
1975
|
open: true,
|
|
3312
1976
|
title: "Runtime DevTools",
|
|
3313
|
-
headerActions: /* @__PURE__ */ __name(() => createComponent(DevToolsToolbar, toolbarProps), "headerActions"),
|
|
1977
|
+
headerActions: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(DevToolsToolbar, toolbarProps), "headerActions"),
|
|
3314
1978
|
size: "lg",
|
|
3315
1979
|
closeLabel: "Close DevTools",
|
|
3316
1980
|
onClose: /* @__PURE__ */ __name(() => {
|
|
3317
1981
|
open.value = false;
|
|
3318
1982
|
maximized.value = false;
|
|
3319
1983
|
}, "onClose"),
|
|
3320
|
-
children: /* @__PURE__ */ __name(() => createComponent(DevToolsPanel, {
|
|
1984
|
+
children: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(DevToolsPanel, {
|
|
3321
1985
|
api: props.api,
|
|
3322
1986
|
router: props.router,
|
|
3323
1987
|
http: props.http,
|
|
@@ -3328,9 +1992,10 @@ function DevToolsWidget(props = {}) {
|
|
|
3328
1992
|
});
|
|
3329
1993
|
}
|
|
3330
1994
|
__name(DevToolsWidget, "DevToolsWidget");
|
|
3331
|
-
|
|
3332
|
-
exports
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
1995
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1996
|
+
0 && (module.exports = {
|
|
1997
|
+
DevToolsPanel,
|
|
1998
|
+
DevToolsWidget,
|
|
1999
|
+
readDevToolsSnapshot
|
|
2000
|
+
});
|
|
3336
2001
|
//# sourceMappingURL=index.cjs.map
|