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