@vscode/component-explorer 0.1.1-10 → 0.1.1-11
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/components/Explorer.d.ts +4 -3
- package/dist/components/Explorer.d.ts.map +1 -1
- package/dist/components/ExplorerModel.d.ts +14 -2
- package/dist/components/ExplorerModel.d.ts.map +1 -1
- package/dist/components/PreviewArea.d.ts.map +1 -1
- package/dist/components/ReportComparisonRow.d.ts +16 -0
- package/dist/components/ReportComparisonRow.d.ts.map +1 -0
- package/dist/components/TitleBar.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/core/CliRuntime.d.ts +1 -0
- package/dist/core/CliRuntime.d.ts.map +1 -1
- package/dist/report/ReportModel.d.ts +23 -0
- package/dist/report/ReportModel.d.ts.map +1 -0
- package/dist/report/ScreenshotReport.d.ts +25 -0
- package/dist/report/ScreenshotReport.d.ts.map +1 -0
- package/dist/report/index.d.ts +3 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/viewer.d.ts +5 -1
- package/dist/viewer.d.ts.map +1 -1
- package/dist/viewer.js +876 -638
- package/dist/viewer.js.map +1 -1
- package/package.json +3 -1
package/dist/viewer.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (s, e, t) =>
|
|
4
|
-
import { fixtureGroupBrand as
|
|
5
|
-
import { defineFixtureVariants as
|
|
1
|
+
var St = Object.defineProperty;
|
|
2
|
+
var wt = (s, e, t) => e in s ? St(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var l = (s, e, t) => wt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { fixtureGroupBrand as ke, fixtureVariantsBrand as Ve, singleFixtureBrand as Ne } from "./index.js";
|
|
5
|
+
import { defineFixture as Hs, defineFixtureGroup as Ls, defineFixtureVariants as Us } from "./index.js";
|
|
6
6
|
import { createRoot as It } from "react-dom/client";
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { jsx as a, jsxs as
|
|
9
|
-
import { unstable_batchedUpdates as
|
|
7
|
+
import { createContext as Je, useReducer as Ot, useState as Rt, useContext as Tt, useEffect as De, createElement as kt } from "react";
|
|
8
|
+
import { jsx as a, jsxs as f, Fragment as ye } from "react/jsx-runtime";
|
|
9
|
+
import { unstable_batchedUpdates as Ze } from "react-dom";
|
|
10
10
|
function xe(s) {
|
|
11
11
|
return typeof s == "object" && s !== null && Ne in s && s[Ne] === !0 && "_options" in s && typeof s._options == "object";
|
|
12
12
|
}
|
|
13
13
|
function Ce(s) {
|
|
14
|
-
return typeof s == "object" && s !== null &&
|
|
14
|
+
return typeof s == "object" && s !== null && ke in s && s[ke] === !0 && "_entries" in s && typeof s._entries == "object";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return typeof s == "object" && s !== null &&
|
|
16
|
+
function Se(s) {
|
|
17
|
+
return typeof s == "object" && s !== null && Ve in s && s[Ve] === !0 && "_variants" in s && typeof s._variants == "object";
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return xe(s) ? { success: !0, data: s } : Ce(s) ? { success: !0, data: s } :
|
|
19
|
+
function Ns(s) {
|
|
20
|
+
return xe(s) ? { success: !0, data: s } : Ce(s) ? { success: !0, data: s } : Se(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a valid fixture export (missing brand symbol or _options/_entries/_variants)" };
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Ds(s) {
|
|
23
23
|
return xe(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a SingleFixtureExport" };
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ms(s) {
|
|
26
26
|
return Ce(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a FixtureGroupExport" };
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function Fs(s) {
|
|
29
|
+
return Se(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a FixtureVariantsExport" };
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Me(s, e, t) {
|
|
32
32
|
const n = s._options;
|
|
33
33
|
return {
|
|
34
34
|
id: e,
|
|
@@ -42,16 +42,16 @@ function Ee(s, e, t) {
|
|
|
42
42
|
render: n.render
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Es(s) {
|
|
46
46
|
return typeof s == "object" && s !== null && "render" in s && typeof s.render == "function" && "id" in s && "name" in s;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const Vt = {
|
|
49
49
|
mobile: { width: 390, height: 844 },
|
|
50
50
|
tablet: { width: 768, height: 1024 },
|
|
51
51
|
desktop: { width: 1440, height: 900 }
|
|
52
52
|
};
|
|
53
53
|
function Nt(s) {
|
|
54
|
-
return typeof s == "string" ? { name: s, ...
|
|
54
|
+
return typeof s == "string" ? { name: s, ...Vt[s] } : s;
|
|
55
55
|
}
|
|
56
56
|
function Dt(s) {
|
|
57
57
|
const e = {};
|
|
@@ -67,22 +67,22 @@ function le(s) {
|
|
|
67
67
|
children: []
|
|
68
68
|
};
|
|
69
69
|
for (const [t, n] of s) {
|
|
70
|
-
const r =
|
|
71
|
-
|
|
70
|
+
const r = Mt(t);
|
|
71
|
+
Xe(e, [r], n);
|
|
72
72
|
}
|
|
73
73
|
return e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Mt(s) {
|
|
76
76
|
return (s.split("/").pop() ?? s).replace(/\.fixture\.(tsx?|jsx?)$/, "");
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Xe(s, e, t) {
|
|
79
79
|
var n;
|
|
80
80
|
if (xe(t)) {
|
|
81
81
|
const r = e.join("/"), i = e[e.length - 1], o = {
|
|
82
82
|
id: r,
|
|
83
83
|
name: i,
|
|
84
84
|
type: "component",
|
|
85
|
-
component:
|
|
85
|
+
component: Me(t, r, i)
|
|
86
86
|
};
|
|
87
87
|
s.children || (s.children = []), s.children.push(o);
|
|
88
88
|
} else if (Ce(t)) {
|
|
@@ -97,8 +97,8 @@ function Ze(s, e, t) {
|
|
|
97
97
|
children: []
|
|
98
98
|
}, s.children || (s.children = []), s.children.push(o));
|
|
99
99
|
for (const [d, c] of Object.entries(t._entries))
|
|
100
|
-
|
|
101
|
-
} else if (
|
|
100
|
+
Xe(o, [...e, d], c);
|
|
101
|
+
} else if (Se(t)) {
|
|
102
102
|
const r = e[e.length - 1], o = {
|
|
103
103
|
id: e.join("/"),
|
|
104
104
|
name: r,
|
|
@@ -107,13 +107,13 @@ function Ze(s, e, t) {
|
|
|
107
107
|
};
|
|
108
108
|
s.children || (s.children = []), s.children.push(o);
|
|
109
109
|
for (const [d, c] of Object.entries(t._variants)) {
|
|
110
|
-
const m = [...e, d].join("/"),
|
|
110
|
+
const m = [...e, d].join("/"), _ = {
|
|
111
111
|
id: m,
|
|
112
112
|
name: d,
|
|
113
113
|
type: "component",
|
|
114
|
-
component:
|
|
114
|
+
component: Me(c, m, d)
|
|
115
115
|
};
|
|
116
|
-
o.children.push(
|
|
116
|
+
o.children.push(_);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -137,20 +137,20 @@ function Ft(s) {
|
|
|
137
137
|
return e;
|
|
138
138
|
}
|
|
139
139
|
let j;
|
|
140
|
-
function
|
|
141
|
-
j ? j instanceof
|
|
140
|
+
function Qe(s) {
|
|
141
|
+
j ? j instanceof Ee ? j.loggers.push(s) : j = new Ee([j, s]) : j = s;
|
|
142
142
|
}
|
|
143
143
|
function b() {
|
|
144
144
|
return j;
|
|
145
145
|
}
|
|
146
146
|
let he;
|
|
147
|
-
function
|
|
147
|
+
function Et(s) {
|
|
148
148
|
he = s;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function At(s) {
|
|
151
151
|
he && he(s);
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class Ee {
|
|
154
154
|
constructor(e) {
|
|
155
155
|
this.loggers = e;
|
|
156
156
|
}
|
|
@@ -220,16 +220,16 @@ var T;
|
|
|
220
220
|
const o = Error, d = o.stackTraceLimit;
|
|
221
221
|
o.stackTraceLimit = 3;
|
|
222
222
|
const c = new Error().stack;
|
|
223
|
-
return o.stackTraceLimit = d,
|
|
223
|
+
return o.stackTraceLimit = d, we.fromStack(c, i + 1);
|
|
224
224
|
}
|
|
225
225
|
s.ofNthCaller = r;
|
|
226
226
|
})(T || (T = {}));
|
|
227
|
-
class
|
|
227
|
+
class we {
|
|
228
228
|
static fromStack(e, t) {
|
|
229
229
|
const n = e.split(`
|
|
230
230
|
`), r = Bt(n[t + 1]);
|
|
231
231
|
if (r)
|
|
232
|
-
return new
|
|
232
|
+
return new we(r.fileName, r.line, r.column, r.id);
|
|
233
233
|
}
|
|
234
234
|
constructor(e, t, n, r) {
|
|
235
235
|
this.fileName = e, this.line = t, this.column = n, this.id = r;
|
|
@@ -255,7 +255,7 @@ function Bt(s) {
|
|
|
255
255
|
id: s
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class B {
|
|
259
259
|
constructor(e, t, n) {
|
|
260
260
|
this.owner = e, this.debugNameSource = t, this.referenceFn = n;
|
|
261
261
|
}
|
|
@@ -263,24 +263,24 @@ class A {
|
|
|
263
263
|
return zt(e, this);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
const
|
|
266
|
+
const Ae = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new WeakMap();
|
|
267
267
|
function zt(s, e) {
|
|
268
268
|
const t = ue.get(s);
|
|
269
269
|
if (t)
|
|
270
270
|
return t;
|
|
271
|
-
const n =
|
|
271
|
+
const n = $t(s, e);
|
|
272
272
|
if (n) {
|
|
273
|
-
let r =
|
|
274
|
-
r++,
|
|
273
|
+
let r = Ae.get(n) ?? 0;
|
|
274
|
+
r++, Ae.set(n, r);
|
|
275
275
|
const i = r === 1 ? n : `${n}#${r}`;
|
|
276
276
|
return ue.set(s, i), i;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function $t(s, e) {
|
|
280
280
|
const t = ue.get(s);
|
|
281
281
|
if (t)
|
|
282
282
|
return t;
|
|
283
|
-
const n = e.owner ?
|
|
283
|
+
const n = e.owner ? Lt(e.owner) + "." : "";
|
|
284
284
|
let r;
|
|
285
285
|
const i = e.debugNameSource;
|
|
286
286
|
if (i !== void 0)
|
|
@@ -293,18 +293,18 @@ function Ht(s, e) {
|
|
|
293
293
|
if (o !== void 0 && (r = Ie(o), r !== void 0))
|
|
294
294
|
return n + r;
|
|
295
295
|
if (e.owner !== void 0) {
|
|
296
|
-
const d =
|
|
296
|
+
const d = Ht(e.owner, s);
|
|
297
297
|
if (d !== void 0)
|
|
298
298
|
return n + d;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Ht(s, e) {
|
|
302
302
|
for (const t in s)
|
|
303
303
|
if (s[t] === e)
|
|
304
304
|
return t;
|
|
305
305
|
}
|
|
306
306
|
const Be = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new WeakMap();
|
|
307
|
-
function
|
|
307
|
+
function Lt(s) {
|
|
308
308
|
const e = ze.get(s);
|
|
309
309
|
if (e)
|
|
310
310
|
return e;
|
|
@@ -324,21 +324,21 @@ function Ie(s) {
|
|
|
324
324
|
return r == null ? void 0 : r.trim();
|
|
325
325
|
}
|
|
326
326
|
let fe;
|
|
327
|
-
function jt(s) {
|
|
328
|
-
fe = s;
|
|
329
|
-
}
|
|
330
|
-
let Qe;
|
|
331
327
|
function Ut(s) {
|
|
332
|
-
|
|
328
|
+
fe = s;
|
|
333
329
|
}
|
|
334
330
|
let et;
|
|
335
|
-
function
|
|
331
|
+
function jt(s) {
|
|
336
332
|
et = s;
|
|
337
333
|
}
|
|
338
334
|
let tt;
|
|
339
|
-
function
|
|
335
|
+
function Pt(s) {
|
|
340
336
|
tt = s;
|
|
341
337
|
}
|
|
338
|
+
let nt;
|
|
339
|
+
function Gt(s) {
|
|
340
|
+
nt = s;
|
|
341
|
+
}
|
|
342
342
|
class Wt {
|
|
343
343
|
get TChange() {
|
|
344
344
|
return null;
|
|
@@ -378,7 +378,7 @@ class Wt {
|
|
|
378
378
|
}, (e) => this.read(e).read(e));
|
|
379
379
|
}
|
|
380
380
|
recomputeInitiallyAndOnChange(e, t) {
|
|
381
|
-
return e.add(
|
|
381
|
+
return e.add(et(this, t)), this;
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
384
384
|
* Ensures that this observable is observed. This keeps the cache alive.
|
|
@@ -386,13 +386,13 @@ class Wt {
|
|
|
386
386
|
* Use `recomputeInitiallyAndOnChange` for eager evaluation.
|
|
387
387
|
*/
|
|
388
388
|
keepObserved(e) {
|
|
389
|
-
return e.add(
|
|
389
|
+
return e.add(tt(this)), this;
|
|
390
390
|
}
|
|
391
391
|
get debugValue() {
|
|
392
392
|
return this.get();
|
|
393
393
|
}
|
|
394
394
|
debugGetDependencyGraph() {
|
|
395
|
-
return
|
|
395
|
+
return nt(this);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
class Oe extends Wt {
|
|
@@ -417,30 +417,30 @@ class Oe extends Wt {
|
|
|
417
417
|
log() {
|
|
418
418
|
var t;
|
|
419
419
|
const e = !!b();
|
|
420
|
-
return
|
|
420
|
+
return At(this), e || (t = b()) == null || t.handleObservableCreated(this, T.ofCaller()), this;
|
|
421
421
|
}
|
|
422
422
|
debugGetObservers() {
|
|
423
423
|
return this._observers;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function st(s) {
|
|
427
427
|
return {
|
|
428
428
|
dispose: s
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
class
|
|
431
|
+
class O extends Error {
|
|
432
432
|
constructor(e) {
|
|
433
|
-
super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this,
|
|
433
|
+
super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, O.prototype);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function se(s) {
|
|
437
437
|
throw s;
|
|
438
438
|
}
|
|
439
439
|
function pe(s) {
|
|
440
440
|
console.error("Unexpected error:", s);
|
|
441
441
|
}
|
|
442
|
-
const
|
|
443
|
-
function
|
|
442
|
+
const Q = (s, e) => s === e;
|
|
443
|
+
function ee(s) {
|
|
444
444
|
return s != null;
|
|
445
445
|
}
|
|
446
446
|
class Y {
|
|
@@ -541,8 +541,8 @@ class w extends Oe {
|
|
|
541
541
|
this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._value = this._computeFn(this, d);
|
|
542
542
|
} finally {
|
|
543
543
|
this._isReaderValid = !1;
|
|
544
|
-
for (const
|
|
545
|
-
|
|
544
|
+
for (const _ of this._dependenciesToBeRemoved)
|
|
545
|
+
_.removeObserver(this);
|
|
546
546
|
this._dependenciesToBeRemoved.clear(), m !== void 0 && m.dispose();
|
|
547
547
|
}
|
|
548
548
|
e = this._didReportChange || c && !this._equalityComparator(h, this._value), (o = b()) == null || o.handleObservableUpdated(this, {
|
|
@@ -553,7 +553,7 @@ class w extends Oe {
|
|
|
553
553
|
hadValue: c
|
|
554
554
|
});
|
|
555
555
|
} catch (d) {
|
|
556
|
-
|
|
556
|
+
se(d);
|
|
557
557
|
}
|
|
558
558
|
if (this._isComputing = !1, !this._didReportChange && e)
|
|
559
559
|
for (const d of this._observers)
|
|
@@ -567,7 +567,7 @@ class w extends Oe {
|
|
|
567
567
|
// IObserver Implementation
|
|
568
568
|
beginUpdate(e) {
|
|
569
569
|
if (this._isUpdating)
|
|
570
|
-
throw new
|
|
570
|
+
throw new O("Cyclic deriveds are not supported yet!");
|
|
571
571
|
this._updateCount++, this._isUpdating = !0;
|
|
572
572
|
try {
|
|
573
573
|
const t = this._updateCount === 1;
|
|
@@ -613,7 +613,7 @@ class w extends Oe {
|
|
|
613
613
|
didChange: (o) => o === e
|
|
614
614
|
}, this._changeSummary) : !0;
|
|
615
615
|
} catch (o) {
|
|
616
|
-
|
|
616
|
+
se(o);
|
|
617
617
|
}
|
|
618
618
|
const i = this._state === 3;
|
|
619
619
|
if (r && (this._state === 1 || i) && (this._state = 2, i))
|
|
@@ -624,7 +624,7 @@ class w extends Oe {
|
|
|
624
624
|
// IReader Implementation
|
|
625
625
|
_ensureReaderValid() {
|
|
626
626
|
if (!this._isReaderValid)
|
|
627
|
-
throw new
|
|
627
|
+
throw new O("The reader object cannot be used outside its compute function!");
|
|
628
628
|
}
|
|
629
629
|
readObservable(e) {
|
|
630
630
|
this._ensureReaderValid(), e.addObserver(this);
|
|
@@ -673,24 +673,24 @@ class w extends Oe {
|
|
|
673
673
|
i.handleChange(this, n);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
function
|
|
677
|
-
return e !== void 0 ? new w(new
|
|
676
|
+
function F(s, e, t = T.ofCaller()) {
|
|
677
|
+
return e !== void 0 ? new w(new B(s, void 0, e), e, void 0, void 0, Q, t) : new w(new B(void 0, void 0, s), s, void 0, void 0, Q, t);
|
|
678
678
|
}
|
|
679
679
|
function Kt(s, e, t = T.ofCaller()) {
|
|
680
|
-
return new w(new
|
|
680
|
+
return new w(new B(s.owner, s.debugName, s.debugReferenceFn), e, void 0, s.onLastObserverRemoved, s.equalsFn ?? Q, t);
|
|
681
681
|
}
|
|
682
|
-
|
|
682
|
+
Ut(Kt);
|
|
683
683
|
function Jt(s, e, t = T.ofCaller()) {
|
|
684
684
|
let n, r;
|
|
685
685
|
n = s, r = void 0;
|
|
686
686
|
let i;
|
|
687
|
-
return new w(new
|
|
687
|
+
return new w(new B(r, void 0, n), (o) => {
|
|
688
688
|
i ? i.clear() : i = new Y();
|
|
689
689
|
const d = n(o);
|
|
690
690
|
return d && i.add(d), d;
|
|
691
691
|
}, void 0, () => {
|
|
692
692
|
i && (i.dispose(), i = void 0);
|
|
693
|
-
},
|
|
693
|
+
}, Q, t);
|
|
694
694
|
}
|
|
695
695
|
function Zt(s) {
|
|
696
696
|
switch (s) {
|
|
@@ -704,7 +704,7 @@ function Zt(s) {
|
|
|
704
704
|
return "<unknown>";
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
class
|
|
707
|
+
class re {
|
|
708
708
|
get debugName() {
|
|
709
709
|
return this._debugNameData.getDebugName(this) ?? "(anonymous)";
|
|
710
710
|
}
|
|
@@ -733,7 +733,7 @@ class se {
|
|
|
733
733
|
try {
|
|
734
734
|
this._isRunning = !0, this._changeTracker && ((r = (n = this._changeTracker).beforeUpdate) == null || r.call(n, this, o), this._changeSummary = this._changeTracker.createChangeSummary(o)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, o);
|
|
735
735
|
} catch (c) {
|
|
736
|
-
|
|
736
|
+
se(c);
|
|
737
737
|
} finally {
|
|
738
738
|
this._isRunning = !1, d !== void 0 && d.dispose();
|
|
739
739
|
}
|
|
@@ -782,7 +782,7 @@ class se {
|
|
|
782
782
|
didChange: (i) => i === e
|
|
783
783
|
}, this._changeSummary) : !0) && (this._state = 2);
|
|
784
784
|
} catch (r) {
|
|
785
|
-
|
|
785
|
+
se(r);
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
788
|
}
|
|
@@ -792,7 +792,7 @@ class se {
|
|
|
792
792
|
// IReader implementation
|
|
793
793
|
_ensureNoRunning() {
|
|
794
794
|
if (!this._isRunning)
|
|
795
|
-
throw new
|
|
795
|
+
throw new O("The reader object cannot be used outside its compute function!");
|
|
796
796
|
}
|
|
797
797
|
readObservable(e) {
|
|
798
798
|
if (this._ensureNoRunning(), this._disposed)
|
|
@@ -803,12 +803,12 @@ class se {
|
|
|
803
803
|
}
|
|
804
804
|
get store() {
|
|
805
805
|
if (this._ensureNoRunning(), this._disposed)
|
|
806
|
-
throw new
|
|
806
|
+
throw new O("Cannot access store after dispose");
|
|
807
807
|
return this._store === void 0 && (this._store = new Y()), this._store;
|
|
808
808
|
}
|
|
809
809
|
get delayedStore() {
|
|
810
810
|
if (this._ensureNoRunning(), this._disposed)
|
|
811
|
-
throw new
|
|
811
|
+
throw new O("Cannot access store after dispose");
|
|
812
812
|
return this._delayedStore === void 0 && (this._delayedStore = new Y()), this._delayedStore;
|
|
813
813
|
}
|
|
814
814
|
debugGetState() {
|
|
@@ -824,15 +824,15 @@ class se {
|
|
|
824
824
|
this._isRunning ? this._state = 2 : this._run();
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
return new
|
|
827
|
+
function rt(s, e = T.ofCaller()) {
|
|
828
|
+
return new re(new B(void 0, void 0, s), s, void 0, e);
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function $e(s) {
|
|
831
831
|
const e = new Error("BugIndicatingErrorRecovery: " + s);
|
|
832
832
|
pe(e), console.error("recovered from an error that indicates a bug", e);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
const t = new
|
|
834
|
+
function it(s, e) {
|
|
835
|
+
const t = new ot(s, e);
|
|
836
836
|
try {
|
|
837
837
|
s(t);
|
|
838
838
|
} finally {
|
|
@@ -840,9 +840,9 @@ function rt(s, e) {
|
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
function Xt(s, e, t) {
|
|
843
|
-
s ? e(s) :
|
|
843
|
+
s ? e(s) : it(e, t);
|
|
844
844
|
}
|
|
845
|
-
class
|
|
845
|
+
class ot {
|
|
846
846
|
constructor(e, t) {
|
|
847
847
|
var n;
|
|
848
848
|
this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = b()) == null || n.handleBeginTransaction(this);
|
|
@@ -852,7 +852,7 @@ class it {
|
|
|
852
852
|
}
|
|
853
853
|
updateObserver(e, t) {
|
|
854
854
|
if (!this._updatingObservers) {
|
|
855
|
-
|
|
855
|
+
$e("Transaction already finished!"), it((n) => {
|
|
856
856
|
n.updateObserver(e, t);
|
|
857
857
|
});
|
|
858
858
|
return;
|
|
@@ -863,7 +863,7 @@ class it {
|
|
|
863
863
|
var t;
|
|
864
864
|
const e = this._updatingObservers;
|
|
865
865
|
if (!e) {
|
|
866
|
-
|
|
866
|
+
$e("transaction.finish() has already been called!");
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
869
869
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -876,11 +876,11 @@ class it {
|
|
|
876
876
|
return this._updatingObservers;
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function x(s, e, t = T.ofCaller()) {
|
|
880
880
|
let n;
|
|
881
|
-
return typeof s == "string" ? n = new
|
|
881
|
+
return typeof s == "string" ? n = new B(void 0, s, void 0) : n = new B(s, void 0, void 0), new ie(n, e, Q, t);
|
|
882
882
|
}
|
|
883
|
-
class
|
|
883
|
+
class ie extends Oe {
|
|
884
884
|
get debugName() {
|
|
885
885
|
return this._debugNameData.getDebugName(this) ?? "ObservableValue";
|
|
886
886
|
}
|
|
@@ -896,7 +896,7 @@ class re extends Oe {
|
|
|
896
896
|
if (n === void 0 && this._equalityComparator(this._value, e))
|
|
897
897
|
return;
|
|
898
898
|
let r;
|
|
899
|
-
t || (t = r = new
|
|
899
|
+
t || (t = r = new ot(() => {
|
|
900
900
|
}, () => `Setting ${this.debugName}`));
|
|
901
901
|
try {
|
|
902
902
|
const o = this._value;
|
|
@@ -922,25 +922,25 @@ class re extends Oe {
|
|
|
922
922
|
this._value = e;
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function He(...s) {
|
|
926
926
|
let e, t, n, r;
|
|
927
|
-
return s.length === 2 ? [t, n] = s : [e, t, n, r] = s, new
|
|
927
|
+
return s.length === 2 ? [t, n] = s : [e, t, n, r] = s, new A(new B(e, void 0, n), t, n, () => A.globalTransaction, Q, r ?? T.ofCaller());
|
|
928
928
|
}
|
|
929
|
-
class
|
|
929
|
+
class A extends Oe {
|
|
930
930
|
constructor(e, t, n, r, i, o) {
|
|
931
931
|
super(o), this._debugNameData = e, this.event = t, this._getValue = n, this._getTransaction = r, this._equalityComparator = i, this._hasValue = !1, this.handleEvent = (d) => {
|
|
932
|
-
var
|
|
932
|
+
var g;
|
|
933
933
|
const c = this._getValue(d), h = this._value, m = !this._hasValue || !this._equalityComparator(h, c);
|
|
934
|
-
let
|
|
935
|
-
m && (this._value = c, this._hasValue && (
|
|
934
|
+
let _ = !1;
|
|
935
|
+
m && (this._value = c, this._hasValue && (_ = !0, Xt(this._getTransaction(), (v) => {
|
|
936
936
|
var E;
|
|
937
937
|
(E = b()) == null || E.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
|
|
938
|
-
for (const
|
|
939
|
-
|
|
938
|
+
for (const V of this._observers)
|
|
939
|
+
v.updateObserver(V, this), V.handleChange(this, void 0);
|
|
940
940
|
}, () => {
|
|
941
|
-
const
|
|
942
|
-
return "Event fired" + (
|
|
943
|
-
})), this._hasValue = !0),
|
|
941
|
+
const v = this.getDebugName();
|
|
942
|
+
return "Event fired" + (v ? `: ${v}` : "");
|
|
943
|
+
})), this._hasValue = !0), _ || (g = b()) == null || g.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
946
|
getDebugName() {
|
|
@@ -967,39 +967,39 @@ class F extends Oe {
|
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
969
|
(function(s) {
|
|
970
|
-
s.Observer =
|
|
970
|
+
s.Observer = A;
|
|
971
971
|
function e(t, n) {
|
|
972
972
|
let r = !1;
|
|
973
|
-
|
|
973
|
+
A.globalTransaction === void 0 && (A.globalTransaction = t, r = !0);
|
|
974
974
|
try {
|
|
975
975
|
n();
|
|
976
976
|
} finally {
|
|
977
|
-
r && (
|
|
977
|
+
r && (A.globalTransaction = void 0);
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
s.batchEventsGlobally = e;
|
|
981
|
-
})(
|
|
982
|
-
function
|
|
983
|
-
const e = new
|
|
984
|
-
return s.addObserver(e),
|
|
981
|
+
})(He || (He = {}));
|
|
982
|
+
function Qt(s) {
|
|
983
|
+
const e = new at(!1, void 0);
|
|
984
|
+
return s.addObserver(e), st(() => {
|
|
985
985
|
s.removeObserver(e);
|
|
986
986
|
});
|
|
987
987
|
}
|
|
988
|
-
Pt(
|
|
989
|
-
function
|
|
990
|
-
const t = new
|
|
988
|
+
Pt(Qt);
|
|
989
|
+
function Yt(s, e) {
|
|
990
|
+
const t = new at(!0, e);
|
|
991
991
|
s.addObserver(t);
|
|
992
992
|
try {
|
|
993
993
|
t.beginUpdate(s);
|
|
994
994
|
} finally {
|
|
995
995
|
t.endUpdate(s);
|
|
996
996
|
}
|
|
997
|
-
return
|
|
997
|
+
return st(() => {
|
|
998
998
|
s.removeObserver(t);
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
1001
|
-
|
|
1002
|
-
class
|
|
1001
|
+
jt(Yt);
|
|
1002
|
+
class at {
|
|
1003
1003
|
constructor(e, t) {
|
|
1004
1004
|
this._forceRecompute = e, this._handleValue = t, this._counter = 0;
|
|
1005
1005
|
}
|
|
@@ -1014,9 +1014,9 @@ class ot {
|
|
|
1014
1014
|
handleChange(e, t) {
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
let
|
|
1017
|
+
let ne;
|
|
1018
1018
|
function en(s) {
|
|
1019
|
-
|
|
1019
|
+
ne || (ne = new tn(), Qe(ne)), ne.addFilteredObj(s);
|
|
1020
1020
|
}
|
|
1021
1021
|
class tn {
|
|
1022
1022
|
constructor() {
|
|
@@ -1031,27 +1031,27 @@ class tn {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
textToConsoleArgs(e) {
|
|
1033
1033
|
return nn([
|
|
1034
|
-
|
|
1034
|
+
G(on("| ", this.indentation)),
|
|
1035
1035
|
e
|
|
1036
1036
|
]);
|
|
1037
1037
|
}
|
|
1038
1038
|
formatInfo(e) {
|
|
1039
1039
|
return e.hadValue ? e.didChange ? [
|
|
1040
|
-
|
|
1041
|
-
|
|
1040
|
+
G(" "),
|
|
1041
|
+
I(M(e.oldValue, 70), {
|
|
1042
1042
|
color: "red",
|
|
1043
1043
|
strikeThrough: !0
|
|
1044
1044
|
}),
|
|
1045
|
-
|
|
1046
|
-
|
|
1045
|
+
G(" "),
|
|
1046
|
+
I(M(e.newValue, 60), {
|
|
1047
1047
|
color: "green"
|
|
1048
1048
|
})
|
|
1049
|
-
] : [
|
|
1050
|
-
|
|
1051
|
-
|
|
1049
|
+
] : [G(" (unchanged)")] : [
|
|
1050
|
+
G(" "),
|
|
1051
|
+
I(M(e.newValue, 60), {
|
|
1052
1052
|
color: "green"
|
|
1053
1053
|
}),
|
|
1054
|
-
|
|
1054
|
+
G(" (initial)")
|
|
1055
1055
|
];
|
|
1056
1056
|
}
|
|
1057
1057
|
handleObservableCreated(e) {
|
|
@@ -1069,15 +1069,15 @@ class tn {
|
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
1071
|
console.log(...this.textToConsoleArgs([
|
|
1072
|
-
|
|
1073
|
-
|
|
1072
|
+
W("observable value changed"),
|
|
1073
|
+
I(e.debugName, { color: "BlueViolet" }),
|
|
1074
1074
|
...this.formatInfo(t)
|
|
1075
1075
|
]));
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
formatChanges(e) {
|
|
1079
1079
|
if (e.size !== 0)
|
|
1080
|
-
return
|
|
1080
|
+
return I(" (changed deps: " + [...e].map((t) => t.debugName).join(", ") + ")", { color: "gray" });
|
|
1081
1081
|
}
|
|
1082
1082
|
handleDerivedDependencyChanged(e, t, n) {
|
|
1083
1083
|
var r;
|
|
@@ -1088,8 +1088,8 @@ class tn {
|
|
|
1088
1088
|
return;
|
|
1089
1089
|
const n = this.changedObservablesSets.get(e);
|
|
1090
1090
|
n && (console.log(...this.textToConsoleArgs([
|
|
1091
|
-
|
|
1092
|
-
|
|
1091
|
+
W("derived recomputed"),
|
|
1092
|
+
I(e.debugName, { color: "BlueViolet" }),
|
|
1093
1093
|
...this.formatInfo(t),
|
|
1094
1094
|
this.formatChanges(n),
|
|
1095
1095
|
{ data: [{ fn: e._debugNameData.referenceFn ?? e._computeFn }] }
|
|
@@ -1097,14 +1097,14 @@ class tn {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
handleDerivedCleared(e) {
|
|
1099
1099
|
this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1100
|
-
|
|
1101
|
-
|
|
1100
|
+
W("derived cleared"),
|
|
1101
|
+
I(e.debugName, { color: "BlueViolet" })
|
|
1102
1102
|
]));
|
|
1103
1103
|
}
|
|
1104
1104
|
handleFromEventObservableTriggered(e, t) {
|
|
1105
1105
|
this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1106
|
-
|
|
1107
|
-
|
|
1106
|
+
W("observable from event triggered"),
|
|
1107
|
+
I(e.debugName, { color: "BlueViolet" }),
|
|
1108
1108
|
...this.formatInfo(t),
|
|
1109
1109
|
{ data: [{ fn: e._getValue }] }
|
|
1110
1110
|
]));
|
|
@@ -1120,8 +1120,8 @@ class tn {
|
|
|
1120
1120
|
handleAutorunStarted(e) {
|
|
1121
1121
|
const t = this.changedObservablesSets.get(e);
|
|
1122
1122
|
t && (this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1123
|
-
|
|
1124
|
-
|
|
1123
|
+
W("autorun"),
|
|
1124
|
+
I(e.debugName, { color: "BlueViolet" }),
|
|
1125
1125
|
this.formatChanges(t),
|
|
1126
1126
|
{ data: [{ fn: e._debugNameData.referenceFn ?? e._runFn }] }
|
|
1127
1127
|
])), t.clear(), this.indentation++);
|
|
@@ -1132,8 +1132,8 @@ class tn {
|
|
|
1132
1132
|
handleBeginTransaction(e) {
|
|
1133
1133
|
let t = e.getDebugName();
|
|
1134
1134
|
t === void 0 && (t = ""), this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1135
|
-
|
|
1136
|
-
|
|
1135
|
+
W("transaction"),
|
|
1136
|
+
I(t, { color: "BlueViolet" }),
|
|
1137
1137
|
{ data: [{ fn: e._fn }] }
|
|
1138
1138
|
])), this.indentation++;
|
|
1139
1139
|
}
|
|
@@ -1154,13 +1154,13 @@ function nn(s) {
|
|
|
1154
1154
|
const i = [n, ...e];
|
|
1155
1155
|
return i.push(...t), i;
|
|
1156
1156
|
}
|
|
1157
|
-
function P(s) {
|
|
1158
|
-
return S(s, { color: "black" });
|
|
1159
|
-
}
|
|
1160
1157
|
function G(s) {
|
|
1161
|
-
return
|
|
1158
|
+
return I(s, { color: "black" });
|
|
1162
1159
|
}
|
|
1163
|
-
function
|
|
1160
|
+
function W(s) {
|
|
1161
|
+
return I(an(`${s}: `, 10), { color: "black", bold: !0 });
|
|
1162
|
+
}
|
|
1163
|
+
function I(s, e = {
|
|
1164
1164
|
color: "black"
|
|
1165
1165
|
}) {
|
|
1166
1166
|
function t(r) {
|
|
@@ -1174,7 +1174,7 @@ function S(s, e = {
|
|
|
1174
1174
|
style: t(n)
|
|
1175
1175
|
};
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function M(s, e) {
|
|
1178
1178
|
switch (typeof s) {
|
|
1179
1179
|
case "number":
|
|
1180
1180
|
return "" + s;
|
|
@@ -1201,7 +1201,7 @@ function sn(s, e) {
|
|
|
1201
1201
|
t += "...";
|
|
1202
1202
|
break;
|
|
1203
1203
|
}
|
|
1204
|
-
n = !1, t += `${
|
|
1204
|
+
n = !1, t += `${M(r, e - t.length)}`;
|
|
1205
1205
|
}
|
|
1206
1206
|
return t += " ]", t;
|
|
1207
1207
|
}
|
|
@@ -1217,7 +1217,7 @@ function rn(s, e) {
|
|
|
1217
1217
|
n += "...";
|
|
1218
1218
|
break;
|
|
1219
1219
|
}
|
|
1220
|
-
r = !1, n += `${i}: ${
|
|
1220
|
+
r = !1, n += `${i}: ${M(o, e - n.length)}`;
|
|
1221
1221
|
}
|
|
1222
1222
|
return n += t ? ")" : " }", n;
|
|
1223
1223
|
}
|
|
@@ -1232,12 +1232,12 @@ function an(s, e) {
|
|
|
1232
1232
|
s += " ";
|
|
1233
1233
|
return s;
|
|
1234
1234
|
}
|
|
1235
|
-
class
|
|
1235
|
+
class oe {
|
|
1236
1236
|
static createHost(e, t) {
|
|
1237
|
-
return new
|
|
1237
|
+
return new oe(e, t);
|
|
1238
1238
|
}
|
|
1239
1239
|
static createClient(e, t) {
|
|
1240
|
-
return new
|
|
1240
|
+
return new oe(e, t);
|
|
1241
1241
|
}
|
|
1242
1242
|
constructor(e, t) {
|
|
1243
1243
|
this._channelFactory = e, this._getHandler = t, this._channel = this._channelFactory({
|
|
@@ -1285,7 +1285,7 @@ function dn(s, e) {
|
|
|
1285
1285
|
for (const h of n)
|
|
1286
1286
|
c.sendNotification(h);
|
|
1287
1287
|
return n = [], o;
|
|
1288
|
-
},
|
|
1288
|
+
}, oe.createClient(i, () => {
|
|
1289
1289
|
if (!d)
|
|
1290
1290
|
throw new Error("Not supported");
|
|
1291
1291
|
return d;
|
|
@@ -1320,17 +1320,17 @@ class ln {
|
|
|
1320
1320
|
this._timeout !== void 0 && clearTimeout(this._timeout);
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function dt(s, e) {
|
|
1324
1324
|
for (const t in e)
|
|
1325
|
-
s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ?
|
|
1325
|
+
s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? dt(s[t], e[t]) : s[t] = e[t];
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function ct(s, e) {
|
|
1328
1328
|
for (const t in e)
|
|
1329
|
-
e[t] === null ? delete s[t] : s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ?
|
|
1329
|
+
e[t] === null ? delete s[t] : s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? ct(s[t], e[t]) : s[t] = e[t];
|
|
1330
1330
|
}
|
|
1331
|
-
class
|
|
1331
|
+
class P {
|
|
1332
1332
|
static getInstance() {
|
|
1333
|
-
return
|
|
1333
|
+
return P._instance === void 0 && (P._instance = new P()), P._instance;
|
|
1334
1334
|
}
|
|
1335
1335
|
getTransactionState() {
|
|
1336
1336
|
const e = [], t = [...this._activeTransactions];
|
|
@@ -1352,7 +1352,7 @@ class U {
|
|
|
1352
1352
|
_getObservableInfo(e) {
|
|
1353
1353
|
const t = this._instanceInfos.get(e);
|
|
1354
1354
|
if (!t) {
|
|
1355
|
-
pe(new
|
|
1355
|
+
pe(new O("No info found"));
|
|
1356
1356
|
return;
|
|
1357
1357
|
}
|
|
1358
1358
|
return t;
|
|
@@ -1360,7 +1360,7 @@ class U {
|
|
|
1360
1360
|
_getAutorunInfo(e) {
|
|
1361
1361
|
const t = this._instanceInfos.get(e);
|
|
1362
1362
|
if (!t) {
|
|
1363
|
-
pe(new
|
|
1363
|
+
pe(new O("No info found"));
|
|
1364
1364
|
return;
|
|
1365
1365
|
}
|
|
1366
1366
|
return t;
|
|
@@ -1376,7 +1376,7 @@ class U {
|
|
|
1376
1376
|
const i = e.debugGetState(), o = { name: e.debugName, instanceId: r.instanceId, updateCount: i.updateCount }, d = [...r.changedObservables].map((c) => {
|
|
1377
1377
|
var h;
|
|
1378
1378
|
return (h = this._instanceInfos.get(c)) == null ? void 0 : h.instanceId;
|
|
1379
|
-
}).filter(
|
|
1379
|
+
}).filter(ee);
|
|
1380
1380
|
if (i.isComputing)
|
|
1381
1381
|
return { ...o, type: "observable/derived", state: "updating", changedDependencies: d, initialComputation: !1 };
|
|
1382
1382
|
switch (i.state) {
|
|
@@ -1389,7 +1389,7 @@ class U {
|
|
|
1389
1389
|
case 1:
|
|
1390
1390
|
return { ...o, type: "observable/derived", state: "possiblyStale" };
|
|
1391
1391
|
}
|
|
1392
|
-
} else if (e instanceof
|
|
1392
|
+
} else if (e instanceof re) {
|
|
1393
1393
|
const n = this._getAutorunInfo(e);
|
|
1394
1394
|
if (!n)
|
|
1395
1395
|
return;
|
|
@@ -1443,29 +1443,29 @@ class U {
|
|
|
1443
1443
|
},
|
|
1444
1444
|
getSummarizedInstances: () => null,
|
|
1445
1445
|
getObservableValueInfo: (e) => ({
|
|
1446
|
-
observers: [...this._aliveInstances.get(e).debugGetObservers()].map((n) => this._formatObserver(n)).filter(
|
|
1446
|
+
observers: [...this._aliveInstances.get(e).debugGetObservers()].map((n) => this._formatObserver(n)).filter(ee)
|
|
1447
1447
|
}),
|
|
1448
1448
|
getDerivedInfo: (e) => {
|
|
1449
1449
|
const t = this._aliveInstances.get(e);
|
|
1450
1450
|
return {
|
|
1451
|
-
dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(
|
|
1452
|
-
observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(
|
|
1451
|
+
dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(ee),
|
|
1452
|
+
observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(ee)
|
|
1453
1453
|
};
|
|
1454
1454
|
},
|
|
1455
1455
|
getAutorunInfo: (e) => ({
|
|
1456
|
-
dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(
|
|
1456
|
+
dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(ee)
|
|
1457
1457
|
}),
|
|
1458
1458
|
getTransactionState: () => this.getTransactionState(),
|
|
1459
1459
|
setValue: (e, t) => {
|
|
1460
1460
|
const n = this._aliveInstances.get(e);
|
|
1461
1461
|
if (n instanceof w)
|
|
1462
1462
|
n.debugSetValue(t);
|
|
1463
|
-
else if (n instanceof
|
|
1463
|
+
else if (n instanceof ie)
|
|
1464
1464
|
n.debugSetValue(t);
|
|
1465
|
-
else if (n instanceof
|
|
1465
|
+
else if (n instanceof A)
|
|
1466
1466
|
n.debugSetValue(t);
|
|
1467
1467
|
else
|
|
1468
|
-
throw new
|
|
1468
|
+
throw new O("Observable is not supported");
|
|
1469
1469
|
const r = [...n.debugGetObservers()];
|
|
1470
1470
|
for (const i of r)
|
|
1471
1471
|
i.beginUpdate(n);
|
|
@@ -1477,25 +1477,25 @@ class U {
|
|
|
1477
1477
|
getValue: (e) => {
|
|
1478
1478
|
const t = this._aliveInstances.get(e);
|
|
1479
1479
|
if (t instanceof w)
|
|
1480
|
-
return
|
|
1481
|
-
if (t instanceof
|
|
1482
|
-
return
|
|
1480
|
+
return M(t.debugGetState().value, 200);
|
|
1481
|
+
if (t instanceof ie)
|
|
1482
|
+
return M(t.debugGetState().value, 200);
|
|
1483
1483
|
},
|
|
1484
1484
|
logValue: (e) => {
|
|
1485
1485
|
const t = this._aliveInstances.get(e);
|
|
1486
1486
|
if (t && "get" in t)
|
|
1487
1487
|
console.log("Logged Value:", t.get());
|
|
1488
1488
|
else
|
|
1489
|
-
throw new
|
|
1489
|
+
throw new O("Observable is not supported");
|
|
1490
1490
|
},
|
|
1491
1491
|
rerun: (e) => {
|
|
1492
1492
|
const t = this._aliveInstances.get(e);
|
|
1493
1493
|
if (t instanceof w)
|
|
1494
1494
|
t.debugRecompute();
|
|
1495
|
-
else if (t instanceof
|
|
1495
|
+
else if (t instanceof re)
|
|
1496
1496
|
t.debugRerun();
|
|
1497
1497
|
else
|
|
1498
|
-
throw new
|
|
1498
|
+
throw new O("Observable is not supported");
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
1501
1501
|
})), this._pendingChanges = null, this._changeThrottler = new ln(), this._fullState = {}, this._flushUpdates = () => {
|
|
@@ -1503,7 +1503,7 @@ class U {
|
|
|
1503
1503
|
}, T.enable();
|
|
1504
1504
|
}
|
|
1505
1505
|
_handleChange(e) {
|
|
1506
|
-
|
|
1506
|
+
ct(this._fullState, e), this._pendingChanges === null ? this._pendingChanges = e : dt(this._pendingChanges, e), this._changeThrottler.throttle(this._flushUpdates, 10);
|
|
1507
1507
|
}
|
|
1508
1508
|
_getDeclarationId(e, t) {
|
|
1509
1509
|
if (!t)
|
|
@@ -1556,7 +1556,7 @@ class U {
|
|
|
1556
1556
|
return;
|
|
1557
1557
|
}
|
|
1558
1558
|
const n = this._getObservableInfo(e);
|
|
1559
|
-
n && t.didChange && (n.lastValue =
|
|
1559
|
+
n && t.didChange && (n.lastValue = M(t.newValue, 30), n.listenerCount > 0 && this._handleChange({
|
|
1560
1560
|
instances: { [n.instanceId]: { formattedValue: n.lastValue } }
|
|
1561
1561
|
}));
|
|
1562
1562
|
}
|
|
@@ -1605,7 +1605,7 @@ class U {
|
|
|
1605
1605
|
const n = this._getObservableInfo(e);
|
|
1606
1606
|
if (!n)
|
|
1607
1607
|
return;
|
|
1608
|
-
const r =
|
|
1608
|
+
const r = M(t.newValue, 30);
|
|
1609
1609
|
n.updateCount++, n.changedObservables.clear(), n.lastValue = r, n.listenerCount > 0 && this._handleChange({
|
|
1610
1610
|
instances: { [n.instanceId]: { formattedValue: r, recomputationCount: n.updateCount } }
|
|
1611
1611
|
});
|
|
@@ -1627,55 +1627,55 @@ class U {
|
|
|
1627
1627
|
this._activeTransactions.delete(e);
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
|
-
|
|
1630
|
+
P._instance = void 0;
|
|
1631
1631
|
function hn(s, e) {
|
|
1632
|
-
const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((i) => i), n =
|
|
1633
|
-
return n ?
|
|
1632
|
+
const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((i) => i), n = R.from(s, t);
|
|
1633
|
+
return n ? lt(n, 0, /* @__PURE__ */ new Set()).trim() : "";
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function lt(s, e, t) {
|
|
1636
1636
|
const n = " ".repeat(e), r = [];
|
|
1637
1637
|
if (t.has(s.sourceObj))
|
|
1638
1638
|
return r.push(`${n}* ${s.type} ${s.name} (already listed)`), r.join(`
|
|
1639
1639
|
`);
|
|
1640
|
-
if (t.add(s.sourceObj), r.push(`${n}* ${s.type} ${s.name}:`), r.push(`${n} value: ${
|
|
1640
|
+
if (t.add(s.sourceObj), r.push(`${n}* ${s.type} ${s.name}:`), r.push(`${n} value: ${M(s.value, 50)}`), r.push(`${n} state: ${s.state}`), s.dependencies.length > 0) {
|
|
1641
1641
|
r.push(`${n} dependencies:`);
|
|
1642
1642
|
for (const o of s.dependencies)
|
|
1643
|
-
r.push(
|
|
1643
|
+
r.push(lt(o, e + 1, t));
|
|
1644
1644
|
}
|
|
1645
1645
|
return r.join(`
|
|
1646
1646
|
`);
|
|
1647
1647
|
}
|
|
1648
|
-
class
|
|
1648
|
+
class R {
|
|
1649
1649
|
static from(e, t) {
|
|
1650
|
-
if (e instanceof
|
|
1650
|
+
if (e instanceof re) {
|
|
1651
1651
|
const n = e.debugGetState();
|
|
1652
|
-
return new
|
|
1652
|
+
return new R(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((r) => R.from(r, t) || R.unknown(r)));
|
|
1653
1653
|
} else if (e instanceof w) {
|
|
1654
1654
|
const n = e.debugGetState();
|
|
1655
|
-
return new
|
|
1656
|
-
} else if (e instanceof
|
|
1655
|
+
return new R(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((r) => R.from(r, t) || R.unknown(r)));
|
|
1656
|
+
} else if (e instanceof ie) {
|
|
1657
1657
|
const n = e.debugGetState();
|
|
1658
|
-
return new
|
|
1659
|
-
} else if (e instanceof
|
|
1658
|
+
return new R(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
|
|
1659
|
+
} else if (e instanceof A) {
|
|
1660
1660
|
const n = e.debugGetState();
|
|
1661
|
-
return new
|
|
1661
|
+
return new R(e, t(e.debugName), "fromEvent", n.value, n.hasValue ? "upToDate" : "initial", []);
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
static unknown(e) {
|
|
1665
|
-
return new
|
|
1665
|
+
return new R(e, "(unknown)", "unknown", void 0, "unknown", []);
|
|
1666
1666
|
}
|
|
1667
1667
|
constructor(e, t, n, r, i, o) {
|
|
1668
1668
|
this.sourceObj = e, this.name = t, this.type = n, this.value = r, this.state = i, this.dependencies = o;
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
1671
|
Gt(hn);
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
class
|
|
1672
|
+
Et(en);
|
|
1673
|
+
Qe(P.getInstance());
|
|
1674
|
+
class un {
|
|
1675
1675
|
constructor() {
|
|
1676
|
-
l(this, "_fixtures",
|
|
1676
|
+
l(this, "_fixtures", x(this, /* @__PURE__ */ new Map()));
|
|
1677
1677
|
/** Observable root of the fixture tree */
|
|
1678
|
-
l(this, "root",
|
|
1678
|
+
l(this, "root", F(this, (e) => {
|
|
1679
1679
|
const t = this._fixtures.read(e);
|
|
1680
1680
|
return le(t);
|
|
1681
1681
|
}));
|
|
@@ -1719,7 +1719,7 @@ class lt {
|
|
|
1719
1719
|
return r == null ? void 0 : r.component;
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
|
-
class
|
|
1722
|
+
class As {
|
|
1723
1723
|
constructor(e, t) {
|
|
1724
1724
|
l(this, "sessionId", Math.random().toString(36).slice(2));
|
|
1725
1725
|
l(this, "_updateVersion", 0);
|
|
@@ -1755,33 +1755,33 @@ class Ts {
|
|
|
1755
1755
|
const r = t.component, i = Dt(r.properties);
|
|
1756
1756
|
let o = n;
|
|
1757
1757
|
if (r.isolation === "shadow-dom") {
|
|
1758
|
-
const
|
|
1759
|
-
o = document.createElement("div"),
|
|
1758
|
+
const g = n.attachShadow({ mode: "open" });
|
|
1759
|
+
o = document.createElement("div"), g.appendChild(o);
|
|
1760
1760
|
}
|
|
1761
1761
|
const d = [], c = console.error, h = console.warn;
|
|
1762
|
-
console.error = (...
|
|
1763
|
-
d.push({ kind: "console", level: "error", message:
|
|
1764
|
-
}, console.warn = (...
|
|
1765
|
-
d.push({ kind: "console", level: "warn", message:
|
|
1762
|
+
console.error = (...g) => {
|
|
1763
|
+
d.push({ kind: "console", level: "error", message: g.map(String).join(" ") }), c.apply(console, g);
|
|
1764
|
+
}, console.warn = (...g) => {
|
|
1765
|
+
d.push({ kind: "console", level: "warn", message: g.map(String).join(" ") }), h.apply(console, g);
|
|
1766
1766
|
};
|
|
1767
|
-
const m = (
|
|
1768
|
-
var
|
|
1769
|
-
d.push({ kind: "exception", message:
|
|
1770
|
-
},
|
|
1771
|
-
const
|
|
1772
|
-
d.push({ kind: "exception", message: E, stack:
|
|
1767
|
+
const m = (g) => {
|
|
1768
|
+
var v;
|
|
1769
|
+
d.push({ kind: "exception", message: g.message, stack: (v = g.error) == null ? void 0 : v.stack });
|
|
1770
|
+
}, _ = (g) => {
|
|
1771
|
+
const v = g.reason, E = v instanceof Error ? v.message : String(v), V = v instanceof Error ? v.stack : void 0;
|
|
1772
|
+
d.push({ kind: "exception", message: E, stack: V });
|
|
1773
1773
|
};
|
|
1774
|
-
window.addEventListener("error", m), window.addEventListener("unhandledrejection",
|
|
1774
|
+
window.addEventListener("error", m), window.addEventListener("unhandledrejection", _);
|
|
1775
1775
|
try {
|
|
1776
|
-
const
|
|
1777
|
-
this._currentDisposable =
|
|
1778
|
-
} catch (
|
|
1779
|
-
const
|
|
1780
|
-
d.push({ kind: "exception", message:
|
|
1776
|
+
const g = r.render(o, i);
|
|
1777
|
+
this._currentDisposable = g && typeof g == "object" && "dispose" in g ? g : void 0;
|
|
1778
|
+
} catch (g) {
|
|
1779
|
+
const v = g instanceof Error ? g : new Error(String(g));
|
|
1780
|
+
d.push({ kind: "exception", message: v.message, stack: v.stack });
|
|
1781
1781
|
} finally {
|
|
1782
1782
|
console.error = c, console.warn = h;
|
|
1783
1783
|
}
|
|
1784
|
-
return await new Promise((
|
|
1784
|
+
return await new Promise((g) => requestAnimationFrame(() => requestAnimationFrame(() => g()))), window.removeEventListener("error", m), window.removeEventListener("unhandledrejection", _), { errors: d };
|
|
1785
1785
|
}
|
|
1786
1786
|
_buildRegistry() {
|
|
1787
1787
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -1792,11 +1792,12 @@ class Ts {
|
|
|
1792
1792
|
return le(e);
|
|
1793
1793
|
}
|
|
1794
1794
|
_flattenFixtures(e, t = []) {
|
|
1795
|
+
var r;
|
|
1795
1796
|
const n = [];
|
|
1796
|
-
e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t });
|
|
1797
|
-
for (const
|
|
1798
|
-
const
|
|
1799
|
-
n.push(...this._flattenFixtures(
|
|
1797
|
+
e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((r = e.component) == null ? void 0 : r.background) ?? "light" });
|
|
1798
|
+
for (const i of e.children ?? []) {
|
|
1799
|
+
const o = e.id ? [...t, e.name] : t;
|
|
1800
|
+
n.push(...this._flattenFixtures(i, o));
|
|
1800
1801
|
}
|
|
1801
1802
|
return n;
|
|
1802
1803
|
}
|
|
@@ -1820,7 +1821,7 @@ class Ts {
|
|
|
1820
1821
|
});
|
|
1821
1822
|
}
|
|
1822
1823
|
}
|
|
1823
|
-
class
|
|
1824
|
+
class fn {
|
|
1824
1825
|
constructor(e) {
|
|
1825
1826
|
this._run = e, this._changes = [], this._map = /* @__PURE__ */ new Map(), this._updateCounter = 0;
|
|
1826
1827
|
}
|
|
@@ -1846,49 +1847,49 @@ class un {
|
|
|
1846
1847
|
handleChange(e, t) {
|
|
1847
1848
|
}
|
|
1848
1849
|
}
|
|
1849
|
-
function
|
|
1850
|
+
function u() {
|
|
1850
1851
|
return ge.instance;
|
|
1851
1852
|
}
|
|
1852
|
-
function
|
|
1853
|
+
function pn() {
|
|
1853
1854
|
return me.instance;
|
|
1854
1855
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return
|
|
1856
|
+
function gn() {
|
|
1857
|
+
return ve.instance;
|
|
1857
1858
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1859
|
+
u.const = pn;
|
|
1860
|
+
u.obs = gn;
|
|
1860
1861
|
class ge {
|
|
1861
1862
|
create(e) {
|
|
1862
|
-
const t =
|
|
1863
|
+
const t = F((n) => e(n));
|
|
1863
1864
|
return { read: (n) => t };
|
|
1864
1865
|
}
|
|
1865
1866
|
}
|
|
1866
1867
|
ge.instance = new ge();
|
|
1867
1868
|
class me {
|
|
1868
1869
|
create(e) {
|
|
1869
|
-
const t =
|
|
1870
|
+
const t = F((n) => e(n));
|
|
1870
1871
|
return { read: (n) => t.read(n) };
|
|
1871
1872
|
}
|
|
1872
1873
|
}
|
|
1873
1874
|
me.instance = new me();
|
|
1874
|
-
class
|
|
1875
|
+
class ve {
|
|
1875
1876
|
create(e) {
|
|
1876
|
-
const t =
|
|
1877
|
+
const t = F((n) => {
|
|
1877
1878
|
const r = e(n);
|
|
1878
|
-
return
|
|
1879
|
+
return mn(r) ? r.read(n) : r;
|
|
1879
1880
|
});
|
|
1880
1881
|
return { read: (n) => t };
|
|
1881
1882
|
}
|
|
1882
1883
|
}
|
|
1883
|
-
|
|
1884
|
-
function
|
|
1884
|
+
ve.instance = new ve();
|
|
1885
|
+
function mn(s) {
|
|
1885
1886
|
return typeof s == "object" && s !== null && "read" in s;
|
|
1886
1887
|
}
|
|
1887
|
-
function
|
|
1888
|
+
function Z(s, e) {
|
|
1888
1889
|
return Object.fromEntries(Object.entries(s).map(([t, n]) => [t, e(n, t)]));
|
|
1889
1890
|
}
|
|
1890
1891
|
const de = Symbol("ViewModelContext");
|
|
1891
|
-
class
|
|
1892
|
+
class vn {
|
|
1892
1893
|
constructor(e) {
|
|
1893
1894
|
this._store = new Y(), this.props = e;
|
|
1894
1895
|
}
|
|
@@ -1897,34 +1898,34 @@ class mn {
|
|
|
1897
1898
|
}
|
|
1898
1899
|
}
|
|
1899
1900
|
function _n(s) {
|
|
1900
|
-
return s[de] || (s[de] =
|
|
1901
|
+
return s[de] || (s[de] = Je(void 0)), s[de];
|
|
1901
1902
|
}
|
|
1902
|
-
function
|
|
1903
|
+
function z(s = {}) {
|
|
1903
1904
|
var e;
|
|
1904
|
-
return e = class extends
|
|
1905
|
+
return e = class extends vn {
|
|
1905
1906
|
}, e._props = s, e;
|
|
1906
1907
|
}
|
|
1907
|
-
let
|
|
1908
|
-
const
|
|
1908
|
+
let _e = 0;
|
|
1909
|
+
const bn = new fn((s) => {
|
|
1909
1910
|
for (const e of s)
|
|
1910
1911
|
e.rendered = !1;
|
|
1911
|
-
if (
|
|
1912
|
+
if (_e > 0) {
|
|
1912
1913
|
const e = s.find((t) => t.isRendering);
|
|
1913
1914
|
e.itemsToRender = s;
|
|
1914
1915
|
} else
|
|
1915
|
-
|
|
1916
|
+
Ze(() => {
|
|
1916
1917
|
for (const e of s)
|
|
1917
1918
|
e.rendered || e.forceUpdate();
|
|
1918
1919
|
});
|
|
1919
1920
|
});
|
|
1920
|
-
let
|
|
1921
|
-
class
|
|
1921
|
+
let yn = 0;
|
|
1922
|
+
class xn {
|
|
1922
1923
|
constructor(e, t) {
|
|
1923
1924
|
this.debugName = e, this.renderFactory = t, this._obsProps = void 0, this.forceUpdate = void 0, this._render = void 0, this._disposable = void 0, this.contextValues = /* @__PURE__ */ new Map(), this.cleanupEffect = () => () => {
|
|
1924
1925
|
var n;
|
|
1925
1926
|
(n = this._disposable) == null || n.dispose();
|
|
1926
1927
|
}, this.itemsToRender = [], this.handleAfterRender = () => {
|
|
1927
|
-
|
|
1928
|
+
Ze(() => {
|
|
1928
1929
|
for (const n of this.itemsToRender)
|
|
1929
1930
|
n.rendered || n.forceUpdate();
|
|
1930
1931
|
}), this.itemsToRender = [];
|
|
@@ -1934,38 +1935,38 @@ class yn {
|
|
|
1934
1935
|
return this.debugName;
|
|
1935
1936
|
}
|
|
1936
1937
|
updateProps(e) {
|
|
1937
|
-
this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps =
|
|
1938
|
+
this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = x(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = F(this, this._render), this._disposable = bn.addDependency(this.rendering, this));
|
|
1938
1939
|
}
|
|
1939
1940
|
}
|
|
1940
|
-
function
|
|
1941
|
-
const n = (o) => o + 1, r = () => new
|
|
1942
|
-
const d = Ot(n, 0)[1], c =
|
|
1941
|
+
function Re(s, e, t) {
|
|
1942
|
+
const n = (o) => o + 1, r = () => new xn(s + ++yn, e), i = function(o) {
|
|
1943
|
+
const d = Ot(n, 0)[1], c = Rt(r)[0];
|
|
1943
1944
|
for (const h of t ?? [])
|
|
1944
|
-
c.contextValues.set(h,
|
|
1945
|
+
c.contextValues.set(h, Tt(h));
|
|
1945
1946
|
if (De(c.cleanupEffect, []), De(c.handleAfterRender), c.isRendering)
|
|
1946
1947
|
throw new Error("Component is already rendering");
|
|
1947
|
-
c.isRendering = !0,
|
|
1948
|
+
c.isRendering = !0, _e++;
|
|
1948
1949
|
try {
|
|
1949
1950
|
c.forceUpdate = d, c.updateProps(o);
|
|
1950
1951
|
const h = c.rendering.get();
|
|
1951
1952
|
return c.rendered = !0, h;
|
|
1952
1953
|
} finally {
|
|
1953
|
-
c.isRendering = !1,
|
|
1954
|
+
c.isRendering = !1, _e--;
|
|
1954
1955
|
}
|
|
1955
1956
|
};
|
|
1956
1957
|
return i.displayName = s, i;
|
|
1957
1958
|
}
|
|
1958
|
-
|
|
1959
|
-
function
|
|
1960
|
-
return
|
|
1961
|
-
const n =
|
|
1959
|
+
Re("ObsView", (s) => (e) => s.read(e).children(e));
|
|
1960
|
+
function k(s, e) {
|
|
1961
|
+
return Re("view", (t) => {
|
|
1962
|
+
const n = Z(s, (r, i) => r.create((o) => t.read(o)[i], void 0));
|
|
1962
1963
|
return (r) => {
|
|
1963
|
-
const i =
|
|
1964
|
+
const i = Z(n, (o) => o.read(r));
|
|
1964
1965
|
return e(r, i);
|
|
1965
1966
|
};
|
|
1966
1967
|
});
|
|
1967
1968
|
}
|
|
1968
|
-
function
|
|
1969
|
+
function Cn(s) {
|
|
1969
1970
|
const e = [];
|
|
1970
1971
|
for (const t of Object.values(s)) {
|
|
1971
1972
|
const n = t._requiredContext;
|
|
@@ -1973,22 +1974,22 @@ function xn(s) {
|
|
|
1973
1974
|
}
|
|
1974
1975
|
return e;
|
|
1975
1976
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const n = typeof e == "function" ? {} : e, r = typeof e == "function" ? e : t, i = "_props" in s ? s._props : {}, o =
|
|
1978
|
-
return
|
|
1979
|
-
const
|
|
1980
|
-
} } : Jt((
|
|
1981
|
-
const
|
|
1982
|
-
return new s(
|
|
1983
|
-
}),
|
|
1984
|
-
return (
|
|
1985
|
-
const
|
|
1986
|
-
return r(
|
|
1977
|
+
function $(s, e, t) {
|
|
1978
|
+
const n = typeof e == "function" ? {} : e, r = typeof e == "function" ? e : t, i = "_props" in s ? s._props : {}, o = Cn({ ...i, ...n }), d = _n(s), c = [...o, d];
|
|
1979
|
+
return Re("viewWithModel", (h, m) => {
|
|
1980
|
+
const _ = m(), g = _.get(d), v = "_props" in s ? Z(s._props, (S, H) => S.create((L) => h.read(L)[H], _.get(S._requiredContext))) : {}, E = g ? { read: () => g, dispose: () => {
|
|
1981
|
+
} } : Jt((S) => {
|
|
1982
|
+
const H = Z(v, (L) => L.read(S));
|
|
1983
|
+
return new s(H);
|
|
1984
|
+
}), V = Z(n, (S, H) => S.create((L) => h.read(L)[H], _.get(S._requiredContext)));
|
|
1985
|
+
return (S) => {
|
|
1986
|
+
const H = E.read(S), L = Z(V, (Ct) => Ct.read(S));
|
|
1987
|
+
return r(S, H, L);
|
|
1987
1988
|
};
|
|
1988
1989
|
}, c.length > 0 ? c : void 0);
|
|
1989
1990
|
}
|
|
1990
|
-
|
|
1991
|
-
|
|
1991
|
+
k({ value: u.obs() }, (s, e) => e.value.read(s));
|
|
1992
|
+
Je(null);
|
|
1992
1993
|
function ht(s) {
|
|
1993
1994
|
var e;
|
|
1994
1995
|
return {
|
|
@@ -1999,7 +2000,7 @@ function ht(s) {
|
|
|
1999
2000
|
component: s.component
|
|
2000
2001
|
};
|
|
2001
2002
|
}
|
|
2002
|
-
function
|
|
2003
|
+
function te(s, e) {
|
|
2003
2004
|
const {
|
|
2004
2005
|
storageKey: t,
|
|
2005
2006
|
defaultValue: n,
|
|
@@ -2012,7 +2013,7 @@ function ee(s, e) {
|
|
|
2012
2013
|
h !== null && (o = i(h));
|
|
2013
2014
|
} catch {
|
|
2014
2015
|
}
|
|
2015
|
-
const d =
|
|
2016
|
+
const d = x(s, o), c = d.set.bind(d);
|
|
2016
2017
|
return d.set = (h, m) => {
|
|
2017
2018
|
try {
|
|
2018
2019
|
localStorage.setItem(t, r(h));
|
|
@@ -2021,48 +2022,52 @@ function ee(s, e) {
|
|
|
2021
2022
|
c(h, m);
|
|
2022
2023
|
}, d;
|
|
2023
2024
|
}
|
|
2024
|
-
class
|
|
2025
|
-
registry:
|
|
2026
|
-
daemonModel:
|
|
2025
|
+
class Sn extends z({
|
|
2026
|
+
registry: u.const(),
|
|
2027
|
+
daemonModel: u.const(),
|
|
2028
|
+
reportModel: u.const()
|
|
2027
2029
|
}) {
|
|
2028
2030
|
constructor() {
|
|
2029
2031
|
super(...arguments);
|
|
2030
|
-
l(this, "leftSidebarVisible",
|
|
2032
|
+
l(this, "leftSidebarVisible", te(this, {
|
|
2031
2033
|
storageKey: "component-explorer:leftSidebarVisible",
|
|
2032
2034
|
defaultValue: !0
|
|
2033
2035
|
}));
|
|
2034
|
-
l(this, "rightSidebarVisible",
|
|
2036
|
+
l(this, "rightSidebarVisible", te(this, {
|
|
2035
2037
|
storageKey: "component-explorer:rightSidebarVisible",
|
|
2036
|
-
defaultValue: !
|
|
2038
|
+
defaultValue: !1
|
|
2037
2039
|
}));
|
|
2038
|
-
l(this, "isDarkTheme",
|
|
2040
|
+
l(this, "isDarkTheme", te(this, {
|
|
2039
2041
|
storageKey: "component-explorer:isDarkTheme",
|
|
2040
2042
|
defaultValue: !0
|
|
2041
2043
|
}));
|
|
2042
|
-
l(this, "selectedNodeId",
|
|
2044
|
+
l(this, "selectedNodeId", te(this, {
|
|
2043
2045
|
storageKey: "component-explorer:selectedNodeId",
|
|
2044
2046
|
defaultValue: void 0
|
|
2045
2047
|
}));
|
|
2046
|
-
l(this, "expandedNodeIds",
|
|
2047
|
-
l(this, "viewMode",
|
|
2048
|
+
l(this, "expandedNodeIds", x(this, /* @__PURE__ */ new Set([""])));
|
|
2049
|
+
l(this, "viewMode", te(this, {
|
|
2048
2050
|
storageKey: "component-explorer:viewMode",
|
|
2049
2051
|
defaultValue: "session"
|
|
2050
2052
|
}));
|
|
2051
|
-
/** The explorer's tree derived from the registry */
|
|
2052
|
-
l(this, "tree",
|
|
2053
|
-
const n = this.props.
|
|
2054
|
-
|
|
2053
|
+
/** The explorer's tree derived from the registry or report */
|
|
2054
|
+
l(this, "tree", F(this, (t) => {
|
|
2055
|
+
const n = this.props.reportModel;
|
|
2056
|
+
if (n)
|
|
2057
|
+
return n.buildTree(t);
|
|
2058
|
+
const r = this.props.registry.root.read(t);
|
|
2059
|
+
return ht(r);
|
|
2055
2060
|
}));
|
|
2056
|
-
l(this, "selectedNode",
|
|
2061
|
+
l(this, "selectedNode", F(this, (t) => {
|
|
2057
2062
|
const n = this.selectedNodeId.read(t);
|
|
2058
|
-
if (
|
|
2063
|
+
if (n === void 0) return;
|
|
2059
2064
|
const r = this.tree.read(t);
|
|
2060
|
-
return this._findNode(r.children ?? [], n);
|
|
2065
|
+
return r.id === n ? r : this._findNode(r.children ?? [], n);
|
|
2061
2066
|
}));
|
|
2062
2067
|
/** List of preview rows to render based on current selection and view mode */
|
|
2063
|
-
l(this, "selectedFixtures",
|
|
2068
|
+
l(this, "selectedFixtures", F(this, (t) => {
|
|
2064
2069
|
const n = this.selectedNode.read(t);
|
|
2065
|
-
return n ? this.viewMode.read(t) === "diff" && this.daemonAvailable ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
|
|
2070
|
+
return n ? this.isReportMode ? (this.props.reportModel.state.read(t), this._collectReportRows(n, n.name)) : this.viewMode.read(t) === "diff" && this.daemonAvailable ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
|
|
2066
2071
|
}));
|
|
2067
2072
|
l(this, "setViewMode", (t) => {
|
|
2068
2073
|
this.viewMode.set(t, void 0);
|
|
@@ -2096,6 +2101,12 @@ class Cn extends M({
|
|
|
2096
2101
|
get daemon() {
|
|
2097
2102
|
return this.props.daemonModel;
|
|
2098
2103
|
}
|
|
2104
|
+
get reportModel() {
|
|
2105
|
+
return this.props.reportModel;
|
|
2106
|
+
}
|
|
2107
|
+
get isReportMode() {
|
|
2108
|
+
return this.props.reportModel !== void 0;
|
|
2109
|
+
}
|
|
2099
2110
|
isNodeExpanded(t, n) {
|
|
2100
2111
|
return this.expandedNodeIds.read(n).has(t);
|
|
2101
2112
|
}
|
|
@@ -2183,8 +2194,34 @@ class Cn extends M({
|
|
|
2183
2194
|
}
|
|
2184
2195
|
return r;
|
|
2185
2196
|
}
|
|
2197
|
+
_collectReportRows(t, n) {
|
|
2198
|
+
const r = this.props.reportModel.state.get();
|
|
2199
|
+
if (r.status !== "ready") return [];
|
|
2200
|
+
const i = r.report.fixtures;
|
|
2201
|
+
if (t.type === "component") {
|
|
2202
|
+
const d = i[t.id];
|
|
2203
|
+
return d ? [{
|
|
2204
|
+
type: "report-comparison",
|
|
2205
|
+
id: t.id,
|
|
2206
|
+
name: t.name,
|
|
2207
|
+
path: n,
|
|
2208
|
+
items: [{
|
|
2209
|
+
fixtureId: t.id,
|
|
2210
|
+
name: t.name,
|
|
2211
|
+
path: n,
|
|
2212
|
+
entry: d
|
|
2213
|
+
}]
|
|
2214
|
+
}] : [];
|
|
2215
|
+
}
|
|
2216
|
+
const o = [];
|
|
2217
|
+
for (const d of t.children ?? []) {
|
|
2218
|
+
const c = n ? `${n} / ${d.name}` : d.name;
|
|
2219
|
+
o.push(...this._collectReportRows(d, c));
|
|
2220
|
+
}
|
|
2221
|
+
return o;
|
|
2222
|
+
}
|
|
2186
2223
|
}
|
|
2187
|
-
const
|
|
2224
|
+
const p = {
|
|
2188
2225
|
container: {
|
|
2189
2226
|
display: "flex",
|
|
2190
2227
|
flexDirection: "row",
|
|
@@ -2373,15 +2410,15 @@ const u = {
|
|
|
2373
2410
|
cursor: "pointer"
|
|
2374
2411
|
}
|
|
2375
2412
|
};
|
|
2376
|
-
function
|
|
2413
|
+
function Te(...s) {
|
|
2377
2414
|
return Object.assign({}, ...s.filter(Boolean));
|
|
2378
2415
|
}
|
|
2379
|
-
class wn extends
|
|
2380
|
-
active:
|
|
2416
|
+
class wn extends z({
|
|
2417
|
+
active: u()
|
|
2381
2418
|
}) {
|
|
2382
2419
|
constructor() {
|
|
2383
2420
|
super(...arguments);
|
|
2384
|
-
l(this, "isHovered",
|
|
2421
|
+
l(this, "isHovered", x(this, !1));
|
|
2385
2422
|
l(this, "setHovered", (t) => {
|
|
2386
2423
|
this.isHovered.set(t, void 0);
|
|
2387
2424
|
});
|
|
@@ -2390,18 +2427,18 @@ class wn extends M({
|
|
|
2390
2427
|
return this.props.active;
|
|
2391
2428
|
}
|
|
2392
2429
|
}
|
|
2393
|
-
const ce =
|
|
2430
|
+
const ce = $(
|
|
2394
2431
|
wn,
|
|
2395
2432
|
{
|
|
2396
|
-
onClick:
|
|
2397
|
-
title:
|
|
2398
|
-
children:
|
|
2433
|
+
onClick: u.const(),
|
|
2434
|
+
title: u.const(),
|
|
2435
|
+
children: u.const()
|
|
2399
2436
|
},
|
|
2400
2437
|
(s, e, t) => {
|
|
2401
|
-
const n = e.isHovered.read(s), r = e.active.read(s), i =
|
|
2402
|
-
|
|
2403
|
-
n && !r &&
|
|
2404
|
-
r &&
|
|
2438
|
+
const n = e.isHovered.read(s), r = e.active.read(s), i = Te(
|
|
2439
|
+
p.titleBarButton,
|
|
2440
|
+
n && !r && p.titleBarButtonHover,
|
|
2441
|
+
r && p.titleBarButtonActive
|
|
2405
2442
|
);
|
|
2406
2443
|
return /* @__PURE__ */ a(
|
|
2407
2444
|
"button",
|
|
@@ -2415,20 +2452,20 @@ const ce = B(
|
|
|
2415
2452
|
}
|
|
2416
2453
|
);
|
|
2417
2454
|
}
|
|
2418
|
-
),
|
|
2419
|
-
{ model:
|
|
2455
|
+
), In = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M5.7 13.7L5 13l4.6-4.6L5 3.7l.7-.7 5.3 5.4-5.3 5.3z" }) }), On = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M11 5.5L6 10.5L5.3 9.8L9.6 5.5L5.3 1.2L6 0.5L11 5.5z", transform: "rotate(90 8 5.5)" }) }), Rn = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M14.5 2H9l-.35.15-.65.64-.65-.64L7 2H1.5l-.5.5v10l.5.5H7l.35-.15.65-.64.65.64.35.15h5.5l.5-.5v-10l-.5-.5zm-7 10H2V3h5v.86L5.85 5l1.15 1.14V10l-1.15-1.14L7 7.72V12zm6 0H8V7.72l1.15 1.14L8 10V6.14L9.15 5 8 3.86V3h5v9z" }) }), Tn = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M14.5 3H7.71l-.85-.85L6.5 2h-5l-.5.5v11l.5.5h13l.5-.5v-10l-.5-.5zm-.5 10H2V6h12v7zm0-8H2V3h4.29l.85.85.36.15H14v1z" }) }), kn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm11 11H6V3h7v10zM3 3h2v10H3V3z" }) }), Vn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm6 11V3h5v10H8zM3 3h4v10H3V3z" }) }), Nn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" }) }), Dn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) }), Mn = k(
|
|
2456
|
+
{ model: u.const() },
|
|
2420
2457
|
(s, e) => {
|
|
2421
2458
|
var d, c;
|
|
2422
2459
|
const t = e.model, n = t.viewMode.read(s), r = ((d = t.daemon) == null ? void 0 : d.sessions.read(s)) ?? [], i = (c = t.daemon) == null ? void 0 : c.sessionName, o = r.filter((h) => h.name !== i);
|
|
2423
|
-
return /* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */ a(
|
|
2426
|
-
/* @__PURE__ */ a(
|
|
2460
|
+
return /* @__PURE__ */ f("div", { style: X.container, children: [
|
|
2461
|
+
/* @__PURE__ */ f("div", { style: X.segmentedControl, children: [
|
|
2462
|
+
/* @__PURE__ */ a(Le, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
|
|
2463
|
+
/* @__PURE__ */ a(Le, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
|
|
2427
2464
|
] }),
|
|
2428
|
-
o.length > 0 && /* @__PURE__ */ a("div", { style:
|
|
2465
|
+
o.length > 0 && /* @__PURE__ */ a("div", { style: X.sessionLinks, children: o.map((h) => /* @__PURE__ */ f(
|
|
2429
2466
|
"button",
|
|
2430
2467
|
{
|
|
2431
|
-
style:
|
|
2468
|
+
style: X.sessionLink,
|
|
2432
2469
|
onClick: () => t.navigateToSession(h.name),
|
|
2433
2470
|
title: `Switch to ${h.name} session`,
|
|
2434
2471
|
children: [
|
|
@@ -2441,48 +2478,48 @@ const ce = B(
|
|
|
2441
2478
|
] });
|
|
2442
2479
|
}
|
|
2443
2480
|
);
|
|
2444
|
-
function
|
|
2481
|
+
function Le({ label: s, mode: e, active: t, onClick: n }) {
|
|
2445
2482
|
return /* @__PURE__ */ a(
|
|
2446
2483
|
"button",
|
|
2447
2484
|
{
|
|
2448
|
-
style: t ?
|
|
2485
|
+
style: t ? X.segmentActive : X.segment,
|
|
2449
2486
|
onClick: n,
|
|
2450
2487
|
children: s
|
|
2451
2488
|
}
|
|
2452
2489
|
);
|
|
2453
2490
|
}
|
|
2454
|
-
const
|
|
2491
|
+
const Fn = k(
|
|
2455
2492
|
{
|
|
2456
|
-
model:
|
|
2493
|
+
model: u.const()
|
|
2457
2494
|
},
|
|
2458
2495
|
(s, e) => {
|
|
2459
2496
|
const t = e.model, n = t.leftSidebarVisible.read(s), r = t.rightSidebarVisible.read(s), i = t.isDarkTheme.read(s), o = t.selectedNode.read(s);
|
|
2460
|
-
return /* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */ a("div", { style:
|
|
2497
|
+
return /* @__PURE__ */ f("div", { style: p.titleBar, children: [
|
|
2498
|
+
/* @__PURE__ */ a("div", { style: p.titleBarSection, children: /* @__PURE__ */ a(
|
|
2462
2499
|
ce,
|
|
2463
2500
|
{
|
|
2464
2501
|
active: n,
|
|
2465
2502
|
onClick: t.toggleLeftSidebar,
|
|
2466
2503
|
title: "Toggle left sidebar",
|
|
2467
|
-
children: /* @__PURE__ */ a(
|
|
2504
|
+
children: /* @__PURE__ */ a(kn, {})
|
|
2468
2505
|
}
|
|
2469
2506
|
) }),
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
t.daemonAvailable
|
|
2472
|
-
o ? /* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ f("div", { style: p.titleBarCenter, children: [
|
|
2508
|
+
t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Mn, { model: t }) : null,
|
|
2509
|
+
o ? /* @__PURE__ */ f(ye, { children: [
|
|
2473
2510
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "<" }),
|
|
2474
2511
|
/* @__PURE__ */ a("span", { children: o.name }),
|
|
2475
2512
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "/>" })
|
|
2476
2513
|
] }) : /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: "No component selected" })
|
|
2477
2514
|
] }),
|
|
2478
|
-
/* @__PURE__ */
|
|
2515
|
+
/* @__PURE__ */ f("div", { style: p.titleBarSection, children: [
|
|
2479
2516
|
/* @__PURE__ */ a(
|
|
2480
2517
|
ce,
|
|
2481
2518
|
{
|
|
2482
2519
|
active: !1,
|
|
2483
2520
|
onClick: t.toggleTheme,
|
|
2484
2521
|
title: i ? "Switch to light theme" : "Switch to dark theme",
|
|
2485
|
-
children: i ? /* @__PURE__ */ a(
|
|
2522
|
+
children: i ? /* @__PURE__ */ a(Nn, {}) : /* @__PURE__ */ a(Dn, {})
|
|
2486
2523
|
}
|
|
2487
2524
|
),
|
|
2488
2525
|
/* @__PURE__ */ a(
|
|
@@ -2497,7 +2534,7 @@ const En = D(
|
|
|
2497
2534
|
] })
|
|
2498
2535
|
] });
|
|
2499
2536
|
}
|
|
2500
|
-
),
|
|
2537
|
+
), X = {
|
|
2501
2538
|
container: {
|
|
2502
2539
|
display: "flex",
|
|
2503
2540
|
alignItems: "center",
|
|
@@ -2541,22 +2578,22 @@ const En = D(
|
|
|
2541
2578
|
color: "var(--vscode-textLink-foreground)",
|
|
2542
2579
|
cursor: "pointer"
|
|
2543
2580
|
}
|
|
2544
|
-
}, ut =
|
|
2581
|
+
}, ut = k(
|
|
2545
2582
|
{
|
|
2546
|
-
model:
|
|
2547
|
-
nodes:
|
|
2548
|
-
depth:
|
|
2583
|
+
model: u.const(),
|
|
2584
|
+
nodes: u.const(),
|
|
2585
|
+
depth: u.const()
|
|
2549
2586
|
},
|
|
2550
2587
|
(s, e) => /* @__PURE__ */ a(ye, { children: e.nodes.map((t) => /* @__PURE__ */ a(An, { model: e.model, node: t, depth: e.depth }, t.id)) })
|
|
2551
2588
|
);
|
|
2552
|
-
class
|
|
2553
|
-
model:
|
|
2554
|
-
node:
|
|
2555
|
-
depth:
|
|
2589
|
+
class En extends z({
|
|
2590
|
+
model: u.const(),
|
|
2591
|
+
node: u.const(),
|
|
2592
|
+
depth: u.const()
|
|
2556
2593
|
}) {
|
|
2557
2594
|
constructor() {
|
|
2558
2595
|
super(...arguments);
|
|
2559
|
-
l(this, "isHovered",
|
|
2596
|
+
l(this, "isHovered", x(this, !1));
|
|
2560
2597
|
l(this, "setHovered", (t) => {
|
|
2561
2598
|
this.isHovered.set(t, void 0);
|
|
2562
2599
|
});
|
|
@@ -2584,15 +2621,15 @@ class Fn extends M({
|
|
|
2584
2621
|
return !!(this.props.node.children && this.props.node.children.length > 0);
|
|
2585
2622
|
}
|
|
2586
2623
|
}
|
|
2587
|
-
const An =
|
|
2588
|
-
const t = e.explorerModel, n = e.treeNode, r = e.treeDepth, i = !!(n.children && n.children.length > 0), o = i ? t.isNodeExpanded(n.id, s) : !1, c = t.selectedNodeId.read(s) === n.id, h = e.isHovered.read(s), m =
|
|
2589
|
-
|
|
2624
|
+
const An = $(En, {}, (s, e) => {
|
|
2625
|
+
const t = e.explorerModel, n = e.treeNode, r = e.treeDepth, i = !!(n.children && n.children.length > 0), o = i ? t.isNodeExpanded(n.id, s) : !1, c = t.selectedNodeId.read(s) === n.id, h = e.isHovered.read(s), m = Te(
|
|
2626
|
+
p.treeItem,
|
|
2590
2627
|
{ paddingLeft: `${8 + r * 12}px` },
|
|
2591
|
-
c &&
|
|
2592
|
-
!c && h &&
|
|
2628
|
+
c && p.treeItemSelected,
|
|
2629
|
+
!c && h && p.treeItemHover
|
|
2593
2630
|
);
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ f(ye, { children: [
|
|
2632
|
+
/* @__PURE__ */ f(
|
|
2596
2633
|
"div",
|
|
2597
2634
|
{
|
|
2598
2635
|
style: m,
|
|
@@ -2601,37 +2638,37 @@ const An = B(Fn, {}, (s, e) => {
|
|
|
2601
2638
|
onMouseEnter: () => e.setHovered(!0),
|
|
2602
2639
|
onMouseLeave: () => e.setHovered(!1),
|
|
2603
2640
|
children: [
|
|
2604
|
-
i ? /* @__PURE__ */ a("div", { style:
|
|
2605
|
-
/* @__PURE__ */ a("div", { style:
|
|
2606
|
-
/* @__PURE__ */ a("span", { style:
|
|
2607
|
-
i && /* @__PURE__ */ a("span", { style:
|
|
2641
|
+
i ? /* @__PURE__ */ a("div", { style: p.treeItemChevron, onClick: e.handleChevronClick, children: o ? /* @__PURE__ */ a(On, {}) : /* @__PURE__ */ a(In, {}) }) : /* @__PURE__ */ a("div", { style: p.treeItemChevronPlaceholder }),
|
|
2642
|
+
/* @__PURE__ */ a("div", { style: p.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(Tn, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(Rn, { style: { color: "#deb45b" } }) }),
|
|
2643
|
+
/* @__PURE__ */ a("span", { style: p.treeItemLabel, children: n.name }),
|
|
2644
|
+
i && /* @__PURE__ */ a("span", { style: p.treeItemCount, children: n.children.length })
|
|
2608
2645
|
]
|
|
2609
2646
|
}
|
|
2610
2647
|
),
|
|
2611
2648
|
i && o && /* @__PURE__ */ a(ut, { model: t, nodes: n.children, depth: r + 1 })
|
|
2612
2649
|
] });
|
|
2613
|
-
}),
|
|
2650
|
+
}), Bn = k(
|
|
2614
2651
|
{
|
|
2615
|
-
model:
|
|
2652
|
+
model: u.const()
|
|
2616
2653
|
},
|
|
2617
2654
|
(s, e) => {
|
|
2618
2655
|
const t = e.model.tree.read(s);
|
|
2619
|
-
return /* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */ a("div", { style:
|
|
2621
|
-
/* @__PURE__ */ a("div", { style:
|
|
2656
|
+
return /* @__PURE__ */ f("div", { style: p.sidebar, children: [
|
|
2657
|
+
/* @__PURE__ */ a("div", { style: p.sidebarHeader, children: "Explorer" }),
|
|
2658
|
+
/* @__PURE__ */ a("div", { style: p.sidebarContent, children: /* @__PURE__ */ a(ut, { model: e.model, nodes: [t], depth: 0 }) })
|
|
2622
2659
|
] });
|
|
2623
2660
|
}
|
|
2624
2661
|
);
|
|
2625
|
-
class
|
|
2662
|
+
class zn extends z({}) {
|
|
2626
2663
|
constructor() {
|
|
2627
2664
|
super(...arguments);
|
|
2628
|
-
l(this, "checked",
|
|
2665
|
+
l(this, "checked", x(this, !1));
|
|
2629
2666
|
l(this, "toggle", () => {
|
|
2630
2667
|
this.checked.set(!this.checked.get(), void 0);
|
|
2631
2668
|
});
|
|
2632
2669
|
}
|
|
2633
2670
|
}
|
|
2634
|
-
const
|
|
2671
|
+
const $n = $(zn, {}, (s, e) => {
|
|
2635
2672
|
const t = e.checked.read(s), n = {
|
|
2636
2673
|
position: "relative",
|
|
2637
2674
|
width: "36px",
|
|
@@ -2652,13 +2689,13 @@ const zn = B(Bn, {}, (s, e) => {
|
|
|
2652
2689
|
transition: "left 0.2s"
|
|
2653
2690
|
};
|
|
2654
2691
|
return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: r }) });
|
|
2655
|
-
}), Hn =
|
|
2692
|
+
}), Hn = k(
|
|
2656
2693
|
{
|
|
2657
|
-
node:
|
|
2694
|
+
node: u.const()
|
|
2658
2695
|
},
|
|
2659
|
-
(s, e) => e.node.type !== "component" ? /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component (not a folder) to view its properties" }) : /* @__PURE__ */
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2696
|
+
(s, e) => e.node.type !== "component" ? /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component (not a folder) to view its properties" }) : /* @__PURE__ */ f("div", { style: p.propertiesPanel, children: [
|
|
2697
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2698
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2662
2699
|
"children",
|
|
2663
2700
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : string" })
|
|
2664
2701
|
] }),
|
|
@@ -2666,62 +2703,62 @@ const zn = B(Bn, {}, (s, e) => {
|
|
|
2666
2703
|
"input",
|
|
2667
2704
|
{
|
|
2668
2705
|
type: "text",
|
|
2669
|
-
style:
|
|
2706
|
+
style: p.propertyInput,
|
|
2670
2707
|
defaultValue: "Click me",
|
|
2671
2708
|
placeholder: "Enter text..."
|
|
2672
2709
|
}
|
|
2673
2710
|
),
|
|
2674
|
-
/* @__PURE__ */ a("div", { style:
|
|
2711
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button text content" })
|
|
2675
2712
|
] }),
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2714
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2678
2715
|
"variant",
|
|
2679
2716
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
|
|
2680
2717
|
] }),
|
|
2681
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
|
|
2682
2719
|
/* @__PURE__ */ a("option", { value: "default", children: "default" }),
|
|
2683
2720
|
/* @__PURE__ */ a("option", { value: "primary", children: "primary" }),
|
|
2684
2721
|
/* @__PURE__ */ a("option", { value: "secondary", children: "secondary" }),
|
|
2685
2722
|
/* @__PURE__ */ a("option", { value: "destructive", children: "destructive" })
|
|
2686
2723
|
] }),
|
|
2687
|
-
/* @__PURE__ */ a("div", { style:
|
|
2724
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Visual style variant" })
|
|
2688
2725
|
] }),
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */
|
|
2726
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2727
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2691
2728
|
"size",
|
|
2692
2729
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
|
|
2693
2730
|
] }),
|
|
2694
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
|
|
2695
2732
|
/* @__PURE__ */ a("option", { value: "sm", children: "sm" }),
|
|
2696
2733
|
/* @__PURE__ */ a("option", { value: "default", children: "default" }),
|
|
2697
2734
|
/* @__PURE__ */ a("option", { value: "lg", children: "lg" })
|
|
2698
2735
|
] }),
|
|
2699
|
-
/* @__PURE__ */ a("div", { style:
|
|
2736
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button size" })
|
|
2700
2737
|
] }),
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2738
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2739
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2703
2740
|
"disabled",
|
|
2704
2741
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : boolean" })
|
|
2705
2742
|
] }),
|
|
2706
|
-
/* @__PURE__ */ a(
|
|
2707
|
-
/* @__PURE__ */ a("div", { style:
|
|
2743
|
+
/* @__PURE__ */ a($n, {}),
|
|
2744
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Disable the button" })
|
|
2708
2745
|
] })
|
|
2709
2746
|
] })
|
|
2710
|
-
), Ln =
|
|
2747
|
+
), Ln = k(
|
|
2711
2748
|
{
|
|
2712
|
-
selectedNode:
|
|
2749
|
+
selectedNode: u.const()
|
|
2713
2750
|
},
|
|
2714
|
-
(s, e) => /* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2751
|
+
(s, e) => /* @__PURE__ */ f("div", { style: Te(p.sidebar, p.sidebarRight), children: [
|
|
2752
|
+
/* @__PURE__ */ f("div", { style: p.sidebarHeader, children: [
|
|
2716
2753
|
/* @__PURE__ */ a("span", { style: { marginRight: "6px", color: "var(--vscode-textLink-foreground)" }, children: "</>" }),
|
|
2717
2754
|
"Props"
|
|
2718
2755
|
] }),
|
|
2719
|
-
/* @__PURE__ */ a("div", { style:
|
|
2756
|
+
/* @__PURE__ */ a("div", { style: p.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(Hn, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
|
|
2720
2757
|
] })
|
|
2721
2758
|
);
|
|
2722
|
-
class
|
|
2723
|
-
fixture:
|
|
2724
|
-
compact:
|
|
2759
|
+
class Un extends z({
|
|
2760
|
+
fixture: u.const(),
|
|
2761
|
+
compact: u.const()
|
|
2725
2762
|
}) {
|
|
2726
2763
|
constructor() {
|
|
2727
2764
|
super(...arguments);
|
|
@@ -2730,8 +2767,8 @@ class $n extends M({
|
|
|
2730
2767
|
l(this, "_renderContainer", null);
|
|
2731
2768
|
l(this, "_disposable", null);
|
|
2732
2769
|
l(this, "_resizeObserver", null);
|
|
2733
|
-
l(this, "measuredWidth",
|
|
2734
|
-
l(this, "measuredHeight",
|
|
2770
|
+
l(this, "measuredWidth", x(this, void 0));
|
|
2771
|
+
l(this, "measuredHeight", x(this, void 0));
|
|
2735
2772
|
l(this, "setContainerRef", (t) => {
|
|
2736
2773
|
if (t === this._containerRef || (this._cleanup(), this._containerRef = t, !t)) return;
|
|
2737
2774
|
const n = this.fixture.component;
|
|
@@ -2794,33 +2831,33 @@ class $n extends M({
|
|
|
2794
2831
|
this._cleanup();
|
|
2795
2832
|
}
|
|
2796
2833
|
}
|
|
2797
|
-
const ft =
|
|
2798
|
-
|
|
2834
|
+
const ft = $(
|
|
2835
|
+
Un,
|
|
2799
2836
|
{},
|
|
2800
2837
|
(s, e) => {
|
|
2801
2838
|
const t = e.fixture, n = t.component, r = n.displayMode, i = e.measuredWidth.read(s), o = e.measuredHeight.read(s), d = e.compact;
|
|
2802
2839
|
let c;
|
|
2803
2840
|
if (r.type === "page") {
|
|
2804
|
-
const
|
|
2841
|
+
const g = r.viewports[0], v = Nt(g);
|
|
2805
2842
|
c = {
|
|
2806
|
-
width:
|
|
2807
|
-
height:
|
|
2843
|
+
width: v.width,
|
|
2844
|
+
height: v.height,
|
|
2808
2845
|
overflow: "auto"
|
|
2809
2846
|
};
|
|
2810
2847
|
} else
|
|
2811
2848
|
c = {
|
|
2812
2849
|
display: "inline-block"
|
|
2813
2850
|
};
|
|
2814
|
-
const h = i && o ? `${i} × ${o}` : "", m = d ?
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */ a("span", { style:
|
|
2818
|
-
!d && h && /* @__PURE__ */ a("span", { style:
|
|
2851
|
+
const h = i && o ? `${i} × ${o}` : "", m = d ? K.wrapperCompact : K.wrapper, _ = d ? K.nameCompact : K.name;
|
|
2852
|
+
return /* @__PURE__ */ f("div", { style: m, children: [
|
|
2853
|
+
/* @__PURE__ */ f("div", { style: K.labelRow, children: [
|
|
2854
|
+
/* @__PURE__ */ a("span", { style: _, children: t.name }),
|
|
2855
|
+
!d && h && /* @__PURE__ */ a("span", { style: K.dimensions, children: h })
|
|
2819
2856
|
] }),
|
|
2820
|
-
/* @__PURE__ */ a("div", { style:
|
|
2857
|
+
/* @__PURE__ */ a("div", { style: Wn(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: c }) })
|
|
2821
2858
|
] });
|
|
2822
2859
|
}
|
|
2823
|
-
),
|
|
2860
|
+
), q = 8;
|
|
2824
2861
|
function pt(s, e) {
|
|
2825
2862
|
return `
|
|
2826
2863
|
linear-gradient(45deg, ${e} 25%, transparent 25%),
|
|
@@ -2832,26 +2869,26 @@ function pt(s, e) {
|
|
|
2832
2869
|
const jn = {
|
|
2833
2870
|
backgroundColor: "#ffffff",
|
|
2834
2871
|
backgroundImage: pt("#ffffff", "#e5e5e5")
|
|
2835
|
-
},
|
|
2872
|
+
}, Pn = {
|
|
2836
2873
|
backgroundColor: "#1e1e1e",
|
|
2837
2874
|
backgroundImage: pt("#1e1e1e", "#2d2d2d")
|
|
2838
|
-
},
|
|
2875
|
+
}, Gn = {
|
|
2839
2876
|
display: "inline-block",
|
|
2840
2877
|
padding: "12px",
|
|
2841
2878
|
borderRadius: "4px",
|
|
2842
|
-
backgroundSize: `${
|
|
2843
|
-
backgroundPosition: `0 0, 0 ${
|
|
2879
|
+
backgroundSize: `${q * 2}px ${q * 2}px`,
|
|
2880
|
+
backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
|
|
2844
2881
|
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
|
|
2845
2882
|
};
|
|
2846
|
-
function
|
|
2847
|
-
const e = s === "dark" ?
|
|
2883
|
+
function Wn(s) {
|
|
2884
|
+
const e = s === "dark" ? Pn : jn;
|
|
2848
2885
|
return {
|
|
2849
|
-
...
|
|
2886
|
+
...Gn,
|
|
2850
2887
|
backgroundColor: e.backgroundColor,
|
|
2851
2888
|
backgroundImage: e.backgroundImage
|
|
2852
2889
|
};
|
|
2853
2890
|
}
|
|
2854
|
-
const
|
|
2891
|
+
const K = {
|
|
2855
2892
|
wrapper: {
|
|
2856
2893
|
marginBottom: "32px"
|
|
2857
2894
|
},
|
|
@@ -2880,16 +2917,16 @@ const q = {
|
|
|
2880
2917
|
fontFamily: "var(--vscode-editor-font-family, monospace)"
|
|
2881
2918
|
}
|
|
2882
2919
|
};
|
|
2883
|
-
class
|
|
2884
|
-
fixtureId:
|
|
2885
|
-
sessionName:
|
|
2886
|
-
daemon:
|
|
2920
|
+
class qn extends z({
|
|
2921
|
+
fixtureId: u.const(),
|
|
2922
|
+
sessionName: u.const(),
|
|
2923
|
+
daemon: u.const()
|
|
2887
2924
|
}) {
|
|
2888
2925
|
constructor(t) {
|
|
2889
2926
|
super(t);
|
|
2890
|
-
l(this, "screenshot",
|
|
2927
|
+
l(this, "screenshot", x(this, { status: "idle" }));
|
|
2891
2928
|
l(this, "_fetchVersion", 0);
|
|
2892
|
-
this._store.add(
|
|
2929
|
+
this._store.add(rt((n) => {
|
|
2893
2930
|
this.props.daemon.sourceTreeIds.read(n).get(this.props.sessionName) && this._fetchScreenshot();
|
|
2894
2931
|
}));
|
|
2895
2932
|
}
|
|
@@ -2907,26 +2944,26 @@ class Wn extends M({
|
|
|
2907
2944
|
}
|
|
2908
2945
|
}
|
|
2909
2946
|
}
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2947
|
+
const Ue = $(
|
|
2948
|
+
qn,
|
|
2912
2949
|
{},
|
|
2913
2950
|
(s, e) => {
|
|
2914
2951
|
const t = e.screenshot.read(s);
|
|
2915
2952
|
if (t.status === "idle" || t.status === "loading")
|
|
2916
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2953
|
+
return /* @__PURE__ */ a("div", { style: U.placeholder, children: /* @__PURE__ */ a("div", { style: U.shimmer }) });
|
|
2917
2954
|
if (t.status === "error")
|
|
2918
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2955
|
+
return /* @__PURE__ */ a("div", { style: U.error, children: /* @__PURE__ */ a("span", { style: U.errorText, children: "Screenshot failed" }) });
|
|
2919
2956
|
const { data: n } = t;
|
|
2920
2957
|
return n.image ? /* @__PURE__ */ a(
|
|
2921
2958
|
"img",
|
|
2922
2959
|
{
|
|
2923
2960
|
src: `data:image/png;base64,${n.image}`,
|
|
2924
|
-
style:
|
|
2961
|
+
style: U.image,
|
|
2925
2962
|
alt: `Screenshot of ${e.fixtureId}`
|
|
2926
2963
|
}
|
|
2927
|
-
) : /* @__PURE__ */ a("div", { style:
|
|
2964
|
+
) : /* @__PURE__ */ a("div", { style: U.placeholder, children: /* @__PURE__ */ a("span", { style: U.hashText, children: n.hash.slice(0, 12) }) });
|
|
2928
2965
|
}
|
|
2929
|
-
),
|
|
2966
|
+
), U = {
|
|
2930
2967
|
placeholder: {
|
|
2931
2968
|
minHeight: 80,
|
|
2932
2969
|
display: "flex",
|
|
@@ -2969,16 +3006,16 @@ const je = B(
|
|
|
2969
3006
|
border: "1px solid var(--vscode-panel-border)"
|
|
2970
3007
|
}
|
|
2971
3008
|
};
|
|
2972
|
-
class
|
|
2973
|
-
fixtureId:
|
|
2974
|
-
daemon:
|
|
2975
|
-
baselineSession:
|
|
2976
|
-
currentSession:
|
|
3009
|
+
class Kn extends z({
|
|
3010
|
+
fixtureId: u.const(),
|
|
3011
|
+
daemon: u.const(),
|
|
3012
|
+
baselineSession: u.const(),
|
|
3013
|
+
currentSession: u.const()
|
|
2977
3014
|
}) {
|
|
2978
3015
|
constructor(t) {
|
|
2979
3016
|
super(t);
|
|
2980
|
-
l(this, "comparisonStatus",
|
|
2981
|
-
this._store.add(
|
|
3017
|
+
l(this, "comparisonStatus", x(this, { status: "loading" }));
|
|
3018
|
+
this._store.add(rt((n) => {
|
|
2982
3019
|
const r = this.props.daemon.sourceTreeIds.read(n), i = r.get(this.props.baselineSession), o = r.get(this.props.currentSession);
|
|
2983
3020
|
i && o && this._fetchComparison();
|
|
2984
3021
|
}));
|
|
@@ -3009,21 +3046,21 @@ class qn extends M({
|
|
|
3009
3046
|
}
|
|
3010
3047
|
}
|
|
3011
3048
|
}
|
|
3012
|
-
const
|
|
3013
|
-
|
|
3049
|
+
const Jn = $(
|
|
3050
|
+
Kn,
|
|
3014
3051
|
{},
|
|
3015
3052
|
(s, e) => {
|
|
3016
|
-
const t = e.comparisonStatus.read(s), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style:
|
|
3017
|
-
return /* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */ a("span", { style:
|
|
3053
|
+
const t = e.comparisonStatus.read(s), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: C.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: C.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: C.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: C.badgeChanged, children: "● changed" });
|
|
3054
|
+
return /* @__PURE__ */ f("div", { style: C.fixtureRow, children: [
|
|
3055
|
+
/* @__PURE__ */ f("div", { style: C.fixtureLabel, children: [
|
|
3056
|
+
/* @__PURE__ */ a("span", { style: C.fixtureName, children: e.fixtureId }),
|
|
3020
3057
|
n
|
|
3021
3058
|
] }),
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */ a("span", { style:
|
|
3059
|
+
/* @__PURE__ */ f("div", { style: C.sideBySide, children: [
|
|
3060
|
+
/* @__PURE__ */ f("div", { style: C.screenshotColumn, children: [
|
|
3061
|
+
/* @__PURE__ */ a("span", { style: C.columnLabel, children: "Current" }),
|
|
3025
3062
|
/* @__PURE__ */ a(
|
|
3026
|
-
|
|
3063
|
+
Ue,
|
|
3027
3064
|
{
|
|
3028
3065
|
fixtureId: e.fixtureId,
|
|
3029
3066
|
sessionName: e.currentSession,
|
|
@@ -3031,10 +3068,10 @@ const Kn = B(
|
|
|
3031
3068
|
}
|
|
3032
3069
|
)
|
|
3033
3070
|
] }),
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */ a("span", { style:
|
|
3071
|
+
/* @__PURE__ */ f("div", { style: C.screenshotColumn, children: [
|
|
3072
|
+
/* @__PURE__ */ a("span", { style: C.columnLabel, children: "Baseline" }),
|
|
3036
3073
|
/* @__PURE__ */ a(
|
|
3037
|
-
|
|
3074
|
+
Ue,
|
|
3038
3075
|
{
|
|
3039
3076
|
fixtureId: e.fixtureId,
|
|
3040
3077
|
sessionName: e.baselineSession,
|
|
@@ -3045,19 +3082,19 @@ const Kn = B(
|
|
|
3045
3082
|
] })
|
|
3046
3083
|
] });
|
|
3047
3084
|
}
|
|
3048
|
-
),
|
|
3085
|
+
), Zn = k(
|
|
3049
3086
|
{
|
|
3050
|
-
name:
|
|
3051
|
-
path:
|
|
3052
|
-
items:
|
|
3053
|
-
daemon:
|
|
3054
|
-
baselineSession:
|
|
3055
|
-
currentSession:
|
|
3056
|
-
},
|
|
3057
|
-
(s, e) => /* @__PURE__ */
|
|
3058
|
-
/* @__PURE__ */ a("div", { style:
|
|
3059
|
-
/* @__PURE__ */ a("div", { style:
|
|
3060
|
-
|
|
3087
|
+
name: u.const(),
|
|
3088
|
+
path: u.const(),
|
|
3089
|
+
items: u.const(),
|
|
3090
|
+
daemon: u.const(),
|
|
3091
|
+
baselineSession: u.const(),
|
|
3092
|
+
currentSession: u.const()
|
|
3093
|
+
},
|
|
3094
|
+
(s, e) => /* @__PURE__ */ f("div", { children: [
|
|
3095
|
+
/* @__PURE__ */ a("div", { style: C.groupHeader, children: /* @__PURE__ */ a("span", { style: C.groupTitle, children: e.path }) }),
|
|
3096
|
+
/* @__PURE__ */ a("div", { style: C.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
|
|
3097
|
+
Jn,
|
|
3061
3098
|
{
|
|
3062
3099
|
fixtureId: t.fixtureId,
|
|
3063
3100
|
daemon: e.daemon,
|
|
@@ -3067,7 +3104,7 @@ const Kn = B(
|
|
|
3067
3104
|
t.fixtureId
|
|
3068
3105
|
)) })
|
|
3069
3106
|
] })
|
|
3070
|
-
),
|
|
3107
|
+
), C = {
|
|
3071
3108
|
groupHeader: {
|
|
3072
3109
|
marginBottom: 12
|
|
3073
3110
|
},
|
|
@@ -3135,35 +3172,201 @@ const Kn = B(
|
|
|
3135
3172
|
color: "var(--vscode-errorForeground)",
|
|
3136
3173
|
fontWeight: 500
|
|
3137
3174
|
}
|
|
3138
|
-
},
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3175
|
+
}, J = 8;
|
|
3176
|
+
function gt(s, e) {
|
|
3177
|
+
return `
|
|
3178
|
+
linear-gradient(45deg, ${e} 25%, transparent 25%),
|
|
3179
|
+
linear-gradient(-45deg, ${e} 25%, transparent 25%),
|
|
3180
|
+
linear-gradient(45deg, transparent 75%, ${e} 75%),
|
|
3181
|
+
linear-gradient(-45deg, transparent 75%, ${e} 75%)
|
|
3182
|
+
`;
|
|
3183
|
+
}
|
|
3184
|
+
const Xn = {
|
|
3185
|
+
backgroundColor: "#ffffff",
|
|
3186
|
+
backgroundImage: gt("#ffffff", "#e5e5e5")
|
|
3187
|
+
}, Qn = {
|
|
3188
|
+
backgroundColor: "#1e1e1e",
|
|
3189
|
+
backgroundImage: gt("#1e1e1e", "#2d2d2d")
|
|
3190
|
+
}, Yn = {
|
|
3191
|
+
display: "inline-block",
|
|
3192
|
+
padding: "12px",
|
|
3193
|
+
borderRadius: "4px",
|
|
3194
|
+
backgroundSize: `${J * 2}px ${J * 2}px`,
|
|
3195
|
+
backgroundPosition: `0 0, 0 ${J}px, ${J}px -${J}px, -${J}px 0`,
|
|
3196
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
|
|
3197
|
+
};
|
|
3198
|
+
function es(s) {
|
|
3199
|
+
const e = s === "dark" ? Qn : Xn;
|
|
3200
|
+
return {
|
|
3201
|
+
...Yn,
|
|
3202
|
+
backgroundColor: e.backgroundColor,
|
|
3203
|
+
backgroundImage: e.backgroundImage
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
function je({ src: s, alt: e, background: t }) {
|
|
3207
|
+
return /* @__PURE__ */ a("div", { style: es(t), children: /* @__PURE__ */ a("img", { src: s, alt: e, style: y.image }) });
|
|
3208
|
+
}
|
|
3209
|
+
const ts = k(
|
|
3210
|
+
{
|
|
3211
|
+
item: u.const(),
|
|
3212
|
+
reportModel: u.const()
|
|
3213
|
+
},
|
|
3214
|
+
(s, e) => {
|
|
3215
|
+
const { item: t, reportModel: n } = e, { entry: r } = t, i = r.background ?? "light", o = r.status === "unchanged" ? /* @__PURE__ */ a("span", { style: y.badgeMatch, children: "✓ match" }) : r.status === "changed" ? /* @__PURE__ */ a("span", { style: y.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: y.badgeAdded, children: "+ added" }), d = r.baselineScreenshot || r.currentScreenshot;
|
|
3216
|
+
return /* @__PURE__ */ f("div", { style: y.fixtureRow, children: [
|
|
3217
|
+
/* @__PURE__ */ f("div", { style: y.fixtureLabel, children: [
|
|
3218
|
+
/* @__PURE__ */ a("span", { style: y.fixtureName, children: t.fixtureId }),
|
|
3219
|
+
o
|
|
3220
|
+
] }),
|
|
3221
|
+
d && /* @__PURE__ */ f("div", { style: y.sideBySide, children: [
|
|
3222
|
+
r.baselineScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
|
|
3223
|
+
/* @__PURE__ */ a("span", { style: y.columnLabel, children: "Baseline" }),
|
|
3224
|
+
/* @__PURE__ */ a(
|
|
3225
|
+
je,
|
|
3226
|
+
{
|
|
3227
|
+
src: n.resolveScreenshotUrl(r.baselineScreenshot),
|
|
3228
|
+
alt: `Baseline screenshot of ${t.fixtureId}`,
|
|
3229
|
+
background: i
|
|
3230
|
+
}
|
|
3231
|
+
)
|
|
3232
|
+
] }),
|
|
3233
|
+
r.currentScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
|
|
3234
|
+
/* @__PURE__ */ a("span", { style: y.columnLabel, children: "Current" }),
|
|
3235
|
+
/* @__PURE__ */ a(
|
|
3236
|
+
je,
|
|
3237
|
+
{
|
|
3238
|
+
src: n.resolveScreenshotUrl(r.currentScreenshot),
|
|
3239
|
+
alt: `Current screenshot of ${t.fixtureId}`,
|
|
3240
|
+
background: i
|
|
3241
|
+
}
|
|
3242
|
+
)
|
|
3243
|
+
] })
|
|
3244
|
+
] }),
|
|
3245
|
+
!d && r.status === "unchanged" && /* @__PURE__ */ a("div", { style: y.hashRow, children: /* @__PURE__ */ f("span", { style: y.hashText, children: [
|
|
3246
|
+
"hash: ",
|
|
3247
|
+
r.targetHash
|
|
3248
|
+
] }) })
|
|
3249
|
+
] });
|
|
3250
|
+
}
|
|
3251
|
+
), ns = k(
|
|
3252
|
+
{
|
|
3253
|
+
name: u.const(),
|
|
3254
|
+
path: u.const(),
|
|
3255
|
+
items: u.const(),
|
|
3256
|
+
reportModel: u.const()
|
|
3257
|
+
},
|
|
3258
|
+
(s, e) => /* @__PURE__ */ f("div", { children: [
|
|
3259
|
+
/* @__PURE__ */ a("div", { style: y.groupHeader, children: /* @__PURE__ */ a("span", { style: y.groupTitle, children: e.path }) }),
|
|
3260
|
+
/* @__PURE__ */ a("div", { style: y.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
|
|
3261
|
+
ts,
|
|
3262
|
+
{
|
|
3263
|
+
item: t,
|
|
3264
|
+
reportModel: e.reportModel
|
|
3265
|
+
},
|
|
3266
|
+
t.fixtureId
|
|
3267
|
+
)) })
|
|
3268
|
+
] })
|
|
3269
|
+
), y = {
|
|
3270
|
+
groupHeader: {
|
|
3271
|
+
marginBottom: 12
|
|
3272
|
+
},
|
|
3273
|
+
groupTitle: {
|
|
3274
|
+
fontSize: 13,
|
|
3275
|
+
fontWeight: 500,
|
|
3276
|
+
color: "var(--vscode-foreground)"
|
|
3277
|
+
},
|
|
3278
|
+
groupContent: {
|
|
3279
|
+
display: "flex",
|
|
3280
|
+
flexDirection: "column",
|
|
3281
|
+
gap: 24
|
|
3282
|
+
},
|
|
3283
|
+
fixtureRow: {
|
|
3284
|
+
display: "flex",
|
|
3285
|
+
flexDirection: "column",
|
|
3286
|
+
gap: 8
|
|
3287
|
+
},
|
|
3288
|
+
fixtureLabel: {
|
|
3289
|
+
display: "flex",
|
|
3290
|
+
alignItems: "center",
|
|
3291
|
+
gap: 8
|
|
3292
|
+
},
|
|
3293
|
+
fixtureName: {
|
|
3294
|
+
fontSize: 12,
|
|
3295
|
+
fontWeight: 500,
|
|
3296
|
+
color: "var(--vscode-foreground)"
|
|
3297
|
+
},
|
|
3298
|
+
sideBySide: {
|
|
3299
|
+
display: "flex",
|
|
3300
|
+
flexDirection: "row",
|
|
3301
|
+
gap: 16
|
|
3302
|
+
},
|
|
3303
|
+
screenshotColumn: {
|
|
3304
|
+
display: "flex",
|
|
3305
|
+
flexDirection: "column",
|
|
3306
|
+
gap: 4
|
|
3307
|
+
},
|
|
3308
|
+
columnLabel: {
|
|
3309
|
+
fontSize: 11,
|
|
3310
|
+
fontWeight: 500,
|
|
3311
|
+
color: "var(--vscode-descriptionForeground)",
|
|
3312
|
+
textTransform: "uppercase",
|
|
3313
|
+
letterSpacing: "0.05em"
|
|
3314
|
+
},
|
|
3315
|
+
image: {
|
|
3316
|
+
display: "block"
|
|
3317
|
+
},
|
|
3318
|
+
hashRow: {
|
|
3319
|
+
padding: "8px 0"
|
|
3320
|
+
},
|
|
3321
|
+
hashText: {
|
|
3322
|
+
fontSize: 11,
|
|
3323
|
+
color: "var(--vscode-descriptionForeground)",
|
|
3324
|
+
fontFamily: "monospace"
|
|
3325
|
+
},
|
|
3326
|
+
badgeMatch: {
|
|
3327
|
+
fontSize: 11,
|
|
3328
|
+
color: "var(--vscode-testing-iconPassed)",
|
|
3329
|
+
fontWeight: 500
|
|
3330
|
+
},
|
|
3331
|
+
badgeChanged: {
|
|
3332
|
+
fontSize: 11,
|
|
3333
|
+
color: "var(--vscode-testing-iconFailed)",
|
|
3334
|
+
fontWeight: 500
|
|
3335
|
+
},
|
|
3336
|
+
badgeAdded: {
|
|
3337
|
+
fontSize: 11,
|
|
3338
|
+
color: "var(--vscode-testing-iconQueued)",
|
|
3339
|
+
fontWeight: 500
|
|
3340
|
+
}
|
|
3341
|
+
}, mt = "component-explorer:fixtureHeights", Pe = 500;
|
|
3342
|
+
let D = null;
|
|
3343
|
+
function vt() {
|
|
3344
|
+
if (D !== null) return D;
|
|
3142
3345
|
try {
|
|
3143
|
-
const s = localStorage.getItem(
|
|
3346
|
+
const s = localStorage.getItem(mt);
|
|
3144
3347
|
if (s)
|
|
3145
|
-
return
|
|
3348
|
+
return D = JSON.parse(s), D;
|
|
3146
3349
|
} catch {
|
|
3147
3350
|
}
|
|
3148
|
-
return
|
|
3351
|
+
return D = {}, D;
|
|
3149
3352
|
}
|
|
3150
|
-
function
|
|
3151
|
-
if (
|
|
3353
|
+
function ss() {
|
|
3354
|
+
if (D !== null)
|
|
3152
3355
|
try {
|
|
3153
|
-
const s = Object.entries(
|
|
3154
|
-
s.length >
|
|
3356
|
+
const s = Object.entries(D);
|
|
3357
|
+
s.length > Pe && (D = Object.fromEntries(s.slice(-Pe))), localStorage.setItem(mt, JSON.stringify(D));
|
|
3155
3358
|
} catch {
|
|
3156
3359
|
}
|
|
3157
3360
|
}
|
|
3158
|
-
function
|
|
3159
|
-
const t =
|
|
3160
|
-
t[s] = e,
|
|
3361
|
+
function rs(s, e) {
|
|
3362
|
+
const t = vt();
|
|
3363
|
+
t[s] = e, ss();
|
|
3161
3364
|
}
|
|
3162
|
-
function
|
|
3163
|
-
return new Map(Object.entries(
|
|
3365
|
+
function is() {
|
|
3366
|
+
return new Map(Object.entries(vt()));
|
|
3164
3367
|
}
|
|
3165
|
-
const
|
|
3166
|
-
function
|
|
3368
|
+
const os = 280, as = 32, ae = 32, Ge = 400, _t = "component-explorer:scrollAnchors", We = 100;
|
|
3369
|
+
function bt() {
|
|
3167
3370
|
try {
|
|
3168
3371
|
const s = localStorage.getItem(_t);
|
|
3169
3372
|
if (s) return JSON.parse(s);
|
|
@@ -3171,36 +3374,36 @@ function vt() {
|
|
|
3171
3374
|
}
|
|
3172
3375
|
return {};
|
|
3173
3376
|
}
|
|
3174
|
-
function
|
|
3377
|
+
function ds(s, e) {
|
|
3175
3378
|
try {
|
|
3176
|
-
const t =
|
|
3379
|
+
const t = bt();
|
|
3177
3380
|
t[s] = e;
|
|
3178
|
-
const n = Object.entries(t), r = n.length >
|
|
3381
|
+
const n = Object.entries(t), r = n.length > We ? Object.fromEntries(n.slice(-We)) : t;
|
|
3179
3382
|
localStorage.setItem(_t, JSON.stringify(r));
|
|
3180
3383
|
} catch {
|
|
3181
3384
|
}
|
|
3182
3385
|
}
|
|
3183
|
-
function
|
|
3184
|
-
return
|
|
3386
|
+
function cs(s) {
|
|
3387
|
+
return bt()[s];
|
|
3185
3388
|
}
|
|
3186
|
-
function
|
|
3389
|
+
function yt(s) {
|
|
3187
3390
|
return s.type === "single" ? s.fixture.id : s.id;
|
|
3188
3391
|
}
|
|
3189
|
-
function
|
|
3392
|
+
function ls(s, e) {
|
|
3190
3393
|
const t = new Array(s.length);
|
|
3191
|
-
let n =
|
|
3394
|
+
let n = ae;
|
|
3192
3395
|
for (let r = 0; r < s.length; r++) {
|
|
3193
|
-
const i = e.get(
|
|
3194
|
-
t[r] = { top: n, height: i }, n += i +
|
|
3396
|
+
const i = e.get(yt(s[r])) ?? os;
|
|
3397
|
+
t[r] = { top: n, height: i }, n += i + as;
|
|
3195
3398
|
}
|
|
3196
3399
|
return t;
|
|
3197
3400
|
}
|
|
3198
|
-
function
|
|
3401
|
+
function hs(s) {
|
|
3199
3402
|
if (s.length === 0) return 0;
|
|
3200
3403
|
const e = s[s.length - 1];
|
|
3201
|
-
return e.top + e.height +
|
|
3404
|
+
return e.top + e.height + ae;
|
|
3202
3405
|
}
|
|
3203
|
-
function
|
|
3406
|
+
function xt(s, e) {
|
|
3204
3407
|
let t = 0, n = s.length;
|
|
3205
3408
|
for (; t < n; ) {
|
|
3206
3409
|
const r = t + n >> 1;
|
|
@@ -3208,47 +3411,47 @@ function yt(s, e) {
|
|
|
3208
3411
|
}
|
|
3209
3412
|
return t;
|
|
3210
3413
|
}
|
|
3211
|
-
function
|
|
3414
|
+
function us(s, e, t) {
|
|
3212
3415
|
if (s.length === 0) return { start: 0, end: 0 };
|
|
3213
|
-
const n =
|
|
3416
|
+
const n = xt(s, e - Ge);
|
|
3214
3417
|
let r = n;
|
|
3215
|
-
const i = e + t +
|
|
3418
|
+
const i = e + t + Ge;
|
|
3216
3419
|
for (; r < s.length && s[r].top < i; )
|
|
3217
3420
|
r++;
|
|
3218
3421
|
return { start: n, end: r };
|
|
3219
3422
|
}
|
|
3220
|
-
function
|
|
3423
|
+
function qe(s, e) {
|
|
3221
3424
|
if (s.length === 0) return;
|
|
3222
|
-
const t =
|
|
3425
|
+
const t = xt(s, e), n = Math.min(t, s.length - 1);
|
|
3223
3426
|
return {
|
|
3224
3427
|
rowIndex: n,
|
|
3225
3428
|
offsetFromViewport: s[n].top - e
|
|
3226
3429
|
};
|
|
3227
3430
|
}
|
|
3228
|
-
function
|
|
3431
|
+
function Ke(s, e) {
|
|
3229
3432
|
return e.rowIndex >= s.length ? 0 : s[e.rowIndex].top - e.offsetFromViewport;
|
|
3230
3433
|
}
|
|
3231
|
-
class
|
|
3232
|
-
model:
|
|
3434
|
+
class fs extends z({
|
|
3435
|
+
model: u.const()
|
|
3233
3436
|
}) {
|
|
3234
3437
|
constructor() {
|
|
3235
3438
|
super(...arguments);
|
|
3236
|
-
l(this, "_rowHeights",
|
|
3237
|
-
l(this, "_scrollTop",
|
|
3238
|
-
l(this, "_viewportHeight",
|
|
3439
|
+
l(this, "_rowHeights", x(this, is()));
|
|
3440
|
+
l(this, "_scrollTop", x(this, 0));
|
|
3441
|
+
l(this, "_viewportHeight", x(this, 0));
|
|
3239
3442
|
l(this, "_scrollContainerRef", null);
|
|
3240
3443
|
l(this, "_resizeObserver", null);
|
|
3241
3444
|
l(this, "_viewportResizeObserver", null);
|
|
3242
3445
|
l(this, "_currentNodeId");
|
|
3243
3446
|
l(this, "_scrollSaveTimeout", null);
|
|
3244
3447
|
l(this, "_suppressScrollHandler", !1);
|
|
3245
|
-
l(this, "layout",
|
|
3448
|
+
l(this, "layout", F(this, (t) => {
|
|
3246
3449
|
const n = this.explorerModel.selectedFixtures.read(t), r = this._rowHeights.read(t);
|
|
3247
|
-
return
|
|
3450
|
+
return ls(n, r);
|
|
3248
3451
|
}));
|
|
3249
|
-
l(this, "visibleRowRange",
|
|
3452
|
+
l(this, "visibleRowRange", F(this, (t) => {
|
|
3250
3453
|
const n = this.layout.read(t), r = this._scrollTop.read(t), i = this._viewportHeight.read(t);
|
|
3251
|
-
return
|
|
3454
|
+
return us(n, r, i);
|
|
3252
3455
|
}));
|
|
3253
3456
|
l(this, "setScrollContainerRef", (t) => {
|
|
3254
3457
|
var n;
|
|
@@ -3259,8 +3462,8 @@ class os extends M({
|
|
|
3259
3462
|
l(this, "_handleScroll", () => {
|
|
3260
3463
|
this._scrollContainerRef && (this._scrollTop.set(this._scrollContainerRef.scrollTop, void 0), !(this._suppressScrollHandler || !this._currentNodeId) && (this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
|
|
3261
3464
|
if (!this._currentNodeId) return;
|
|
3262
|
-
const t = this.layout.get(), n =
|
|
3263
|
-
n &&
|
|
3465
|
+
const t = this.layout.get(), n = qe(t, this._scrollTop.get());
|
|
3466
|
+
n && ds(this._currentNodeId, n);
|
|
3264
3467
|
}, 150)));
|
|
3265
3468
|
});
|
|
3266
3469
|
l(this, "observeRowElement", (t, n) => {
|
|
@@ -3271,12 +3474,12 @@ class os extends M({
|
|
|
3271
3474
|
const c = d.target.getAttribute("data-row-id");
|
|
3272
3475
|
if (!c) continue;
|
|
3273
3476
|
const h = Math.round(d.contentRect.height);
|
|
3274
|
-
h > 0 && i.get(c) !== h && (o || (o = new Map(i)), o.set(c, h),
|
|
3477
|
+
h > 0 && i.get(c) !== h && (o || (o = new Map(i)), o.set(c, h), rs(c, h));
|
|
3275
3478
|
}
|
|
3276
3479
|
if (o) {
|
|
3277
|
-
const d = this.layout.get(), c =
|
|
3480
|
+
const d = this.layout.get(), c = qe(d, this._scrollTop.get());
|
|
3278
3481
|
if (this._rowHeights.set(o, void 0), c && this._scrollContainerRef) {
|
|
3279
|
-
const h = this.layout.get(), m =
|
|
3482
|
+
const h = this.layout.get(), m = Ke(h, c);
|
|
3280
3483
|
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = m, this._scrollTop.set(m, void 0), requestAnimationFrame(() => {
|
|
3281
3484
|
this._suppressScrollHandler = !1;
|
|
3282
3485
|
});
|
|
@@ -3293,9 +3496,9 @@ class os extends M({
|
|
|
3293
3496
|
}
|
|
3294
3497
|
_restoreScrollPosition() {
|
|
3295
3498
|
if (!this._scrollContainerRef || !this._currentNodeId) return;
|
|
3296
|
-
const t =
|
|
3499
|
+
const t = cs(this._currentNodeId);
|
|
3297
3500
|
if (!t) return;
|
|
3298
|
-
const n = this.layout.get(), r =
|
|
3501
|
+
const n = this.layout.get(), r = Ke(n, t);
|
|
3299
3502
|
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = r, this._scrollTop.set(r, void 0), requestAnimationFrame(() => {
|
|
3300
3503
|
this._suppressScrollHandler = !1;
|
|
3301
3504
|
});
|
|
@@ -3305,23 +3508,35 @@ class os extends M({
|
|
|
3305
3508
|
(t = this._resizeObserver) == null || t.disconnect(), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout);
|
|
3306
3509
|
}
|
|
3307
3510
|
}
|
|
3308
|
-
const
|
|
3309
|
-
|
|
3511
|
+
const ps = $(
|
|
3512
|
+
fs,
|
|
3310
3513
|
{},
|
|
3311
3514
|
(s, e) => {
|
|
3312
3515
|
const t = e.explorerModel.selectedFixtures.read(s), n = e.explorerModel.selectedNodeId.read(s), r = e.layout.read(s), { start: i, end: o } = e.visibleRowRange.read(s);
|
|
3313
|
-
if (e.updateForSelection(n), t.length === 0)
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3516
|
+
if (e.updateForSelection(n), t.length === 0) {
|
|
3517
|
+
const c = e.explorerModel.reportModel;
|
|
3518
|
+
if (c) {
|
|
3519
|
+
const h = c.state.read(s);
|
|
3520
|
+
if (h.status === "loading")
|
|
3521
|
+
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Loading report..." }) });
|
|
3522
|
+
if (h.status === "error")
|
|
3523
|
+
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ f("span", { style: { ...N.emptyText, color: "var(--vscode-errorForeground)" }, children: [
|
|
3524
|
+
"Failed to load report: ",
|
|
3525
|
+
h.message
|
|
3526
|
+
] }) });
|
|
3527
|
+
}
|
|
3528
|
+
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Select a component or folder to preview" }) });
|
|
3529
|
+
}
|
|
3530
|
+
const d = hs(r);
|
|
3531
|
+
return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: N.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(i, o).map((c, h) => {
|
|
3532
|
+
const m = i + h, { top: _ } = r[m], g = yt(c);
|
|
3318
3533
|
return /* @__PURE__ */ a(
|
|
3319
3534
|
"div",
|
|
3320
3535
|
{
|
|
3321
|
-
ref: (
|
|
3322
|
-
style: { position: "absolute", top:
|
|
3323
|
-
children: c.type === "single" ? /* @__PURE__ */ a(ft, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(
|
|
3324
|
-
|
|
3536
|
+
ref: (v) => e.observeRowElement(v, g),
|
|
3537
|
+
style: { position: "absolute", top: _, left: ae, right: ae },
|
|
3538
|
+
children: c.type === "single" ? /* @__PURE__ */ a(ft, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(gs, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
|
|
3539
|
+
Zn,
|
|
3325
3540
|
{
|
|
3326
3541
|
name: c.name,
|
|
3327
3542
|
path: c.path,
|
|
@@ -3330,22 +3545,30 @@ const as = B(
|
|
|
3330
3545
|
baselineSession: "baseline",
|
|
3331
3546
|
currentSession: "current"
|
|
3332
3547
|
}
|
|
3548
|
+
) : c.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
|
|
3549
|
+
ns,
|
|
3550
|
+
{
|
|
3551
|
+
name: c.name,
|
|
3552
|
+
path: c.path,
|
|
3553
|
+
items: c.items,
|
|
3554
|
+
reportModel: e.explorerModel.reportModel
|
|
3555
|
+
}
|
|
3333
3556
|
) : null
|
|
3334
3557
|
},
|
|
3335
|
-
|
|
3558
|
+
g
|
|
3336
3559
|
);
|
|
3337
3560
|
}) }) });
|
|
3338
3561
|
}
|
|
3339
|
-
),
|
|
3340
|
-
{ row:
|
|
3562
|
+
), gs = k(
|
|
3563
|
+
{ row: u.const() },
|
|
3341
3564
|
(s, e) => {
|
|
3342
3565
|
const t = e.row;
|
|
3343
|
-
return /* @__PURE__ */
|
|
3344
|
-
/* @__PURE__ */ a("div", { style:
|
|
3345
|
-
/* @__PURE__ */ a("div", { style:
|
|
3566
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
3567
|
+
/* @__PURE__ */ a("div", { style: N.variantsHeader, children: /* @__PURE__ */ a("span", { style: N.variantsTitle, children: t.path }) }),
|
|
3568
|
+
/* @__PURE__ */ a("div", { style: N.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(ft, { fixture: n, compact: !0 }, n.id)) })
|
|
3346
3569
|
] });
|
|
3347
3570
|
}
|
|
3348
|
-
),
|
|
3571
|
+
), N = {
|
|
3349
3572
|
scrollContainer: {
|
|
3350
3573
|
flex: 1,
|
|
3351
3574
|
overflow: "auto",
|
|
@@ -3376,67 +3599,22 @@ const as = B(
|
|
|
3376
3599
|
flexWrap: "wrap",
|
|
3377
3600
|
gap: "16px"
|
|
3378
3601
|
}
|
|
3379
|
-
},
|
|
3380
|
-
|
|
3381
|
-
{ daemonModel:
|
|
3602
|
+
}, ms = $(
|
|
3603
|
+
Sn,
|
|
3604
|
+
{ daemonModel: u.const(), reportModel: u.const() },
|
|
3382
3605
|
(s, e) => {
|
|
3383
3606
|
const t = e.leftSidebarVisible.read(s), n = e.rightSidebarVisible.read(s), r = e.isDarkTheme.read(s), i = e.selectedNode.read(s);
|
|
3384
|
-
return /* @__PURE__ */
|
|
3385
|
-
t && /* @__PURE__ */ a(
|
|
3386
|
-
/* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */ a(
|
|
3388
|
-
/* @__PURE__ */ a(
|
|
3607
|
+
return /* @__PURE__ */ f("div", { className: r ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: p.container, children: [
|
|
3608
|
+
t && /* @__PURE__ */ a(Bn, { model: e }),
|
|
3609
|
+
/* @__PURE__ */ f("div", { style: p.centerArea, children: [
|
|
3610
|
+
/* @__PURE__ */ a(Fn, { model: e }),
|
|
3611
|
+
/* @__PURE__ */ a(ps, { model: e })
|
|
3389
3612
|
] }),
|
|
3390
3613
|
n && /* @__PURE__ */ a(Ln, { selectedNode: i })
|
|
3391
3614
|
] });
|
|
3392
3615
|
}
|
|
3393
3616
|
);
|
|
3394
|
-
|
|
3395
|
-
const s = new lt();
|
|
3396
|
-
return s.register("components/Button.fixture.tsx", ae({
|
|
3397
|
-
Primary: L({
|
|
3398
|
-
render: (e) => (e.innerHTML = "<button>Primary Button</button>", { dispose: () => {
|
|
3399
|
-
e.innerHTML = "";
|
|
3400
|
-
} })
|
|
3401
|
-
}),
|
|
3402
|
-
Icon: L({
|
|
3403
|
-
render: (e) => (e.innerHTML = "<button>🔔 Icon Button</button>", { dispose: () => {
|
|
3404
|
-
e.innerHTML = "";
|
|
3405
|
-
} })
|
|
3406
|
-
})
|
|
3407
|
-
})), s.register("components/Input.fixture.tsx", ae({
|
|
3408
|
-
Text: L({
|
|
3409
|
-
render: (e) => (e.innerHTML = '<input type="text" placeholder="Text Input" />', { dispose: () => {
|
|
3410
|
-
e.innerHTML = "";
|
|
3411
|
-
} })
|
|
3412
|
-
}),
|
|
3413
|
-
Search: L({
|
|
3414
|
-
render: (e) => (e.innerHTML = '<input type="search" placeholder="Search..." />', { dispose: () => {
|
|
3415
|
-
e.innerHTML = "";
|
|
3416
|
-
} })
|
|
3417
|
-
})
|
|
3418
|
-
})), s.register("components/Card.fixture.tsx", L({
|
|
3419
|
-
render: (e) => (e.innerHTML = '<div style="border: 1px solid #ccc; padding: 16px;">Basic Card</div>', { dispose: () => {
|
|
3420
|
-
e.innerHTML = "";
|
|
3421
|
-
} })
|
|
3422
|
-
})), s.register("components/Feedback.fixture.tsx", ae({
|
|
3423
|
-
Badge: L({
|
|
3424
|
-
render: (e) => (e.innerHTML = '<span style="background: blue; color: white; padding: 2px 8px; border-radius: 4px;">Badge</span>', { dispose: () => {
|
|
3425
|
-
e.innerHTML = "";
|
|
3426
|
-
} })
|
|
3427
|
-
}),
|
|
3428
|
-
Alert: L({
|
|
3429
|
-
render: (e) => (e.innerHTML = '<div style="background: #ffffcc; padding: 8px; border: 1px solid #cc0;">Alert message</div>', { dispose: () => {
|
|
3430
|
-
e.innerHTML = "";
|
|
3431
|
-
} })
|
|
3432
|
-
})
|
|
3433
|
-
})), s;
|
|
3434
|
-
}
|
|
3435
|
-
function Rs() {
|
|
3436
|
-
const s = cs();
|
|
3437
|
-
return /* @__PURE__ */ a(xt, { registry: s, daemonModel: void 0 });
|
|
3438
|
-
}
|
|
3439
|
-
var ls = class be {
|
|
3617
|
+
var vs = class be {
|
|
3440
3618
|
constructor(e) {
|
|
3441
3619
|
this.iterator = e;
|
|
3442
3620
|
}
|
|
@@ -3449,11 +3627,11 @@ var ls = class be {
|
|
|
3449
3627
|
[Symbol.asyncIterator]() {
|
|
3450
3628
|
return this.iterator;
|
|
3451
3629
|
}
|
|
3452
|
-
},
|
|
3630
|
+
}, _s = class extends Error {
|
|
3453
3631
|
constructor(s, e, t) {
|
|
3454
3632
|
super(t), this.statusCode = s, this.method = e, this.name = "ApiError";
|
|
3455
3633
|
}
|
|
3456
|
-
},
|
|
3634
|
+
}, bs = class {
|
|
3457
3635
|
constructor(s) {
|
|
3458
3636
|
l(this, "methods", this._createProxy(""));
|
|
3459
3637
|
this._request = s;
|
|
@@ -3466,8 +3644,8 @@ var ls = class be {
|
|
|
3466
3644
|
});
|
|
3467
3645
|
}
|
|
3468
3646
|
};
|
|
3469
|
-
function
|
|
3470
|
-
return new
|
|
3647
|
+
function ys(s, e) {
|
|
3648
|
+
return new bs(async (t, n) => {
|
|
3471
3649
|
var d;
|
|
3472
3650
|
const r = await fetch(`${s}/${t}`, {
|
|
3473
3651
|
method: "POST",
|
|
@@ -3480,37 +3658,37 @@ function fs(s, e) {
|
|
|
3480
3658
|
if (r.status !== 200) {
|
|
3481
3659
|
const c = await r.json().catch(() => null);
|
|
3482
3660
|
let h;
|
|
3483
|
-
throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${r.status}, Status Text: ${r.statusText})`, new
|
|
3661
|
+
throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${r.status}, Status Text: ${r.statusText})`, new _s(r.status, t, h);
|
|
3484
3662
|
}
|
|
3485
3663
|
const i = r.headers.get("Content-Type");
|
|
3486
|
-
return i != null && i.startsWith("application/jsonl") ?
|
|
3487
|
-
var
|
|
3488
|
-
const c = (
|
|
3664
|
+
return i != null && i.startsWith("application/jsonl") ? vs.fromFn(async function* () {
|
|
3665
|
+
var g;
|
|
3666
|
+
const c = (g = r.body) == null ? void 0 : g.getReader();
|
|
3489
3667
|
if (!c)
|
|
3490
3668
|
return;
|
|
3491
3669
|
let h = "";
|
|
3492
3670
|
const m = new TextDecoder("utf-8");
|
|
3493
3671
|
for (; ; ) {
|
|
3494
|
-
const { done:
|
|
3495
|
-
if (
|
|
3672
|
+
const { done: v, value: E } = await c.read();
|
|
3673
|
+
if (v)
|
|
3496
3674
|
break;
|
|
3497
3675
|
h += m.decode(E, { stream: !0 });
|
|
3498
|
-
let
|
|
3499
|
-
for (; (
|
|
3676
|
+
let V;
|
|
3677
|
+
for (; (V = h.indexOf(`
|
|
3500
3678
|
`)) >= 0; ) {
|
|
3501
|
-
const
|
|
3502
|
-
h = h.slice(
|
|
3679
|
+
const S = h.slice(0, V).trim();
|
|
3680
|
+
h = h.slice(V + 1), S.length > 0 && (yield JSON.parse(S));
|
|
3503
3681
|
}
|
|
3504
3682
|
}
|
|
3505
|
-
const
|
|
3506
|
-
|
|
3683
|
+
const _ = h.trim();
|
|
3684
|
+
_.length > 0 && (yield JSON.parse(_));
|
|
3507
3685
|
}) : await r.json();
|
|
3508
3686
|
});
|
|
3509
3687
|
}
|
|
3510
|
-
class
|
|
3688
|
+
class xs {
|
|
3511
3689
|
constructor(e) {
|
|
3512
|
-
l(this, "_sourceTreeIds",
|
|
3513
|
-
l(this, "_sessions",
|
|
3690
|
+
l(this, "_sourceTreeIds", x(this, /* @__PURE__ */ new Map()));
|
|
3691
|
+
l(this, "_sessions", x(this, []));
|
|
3514
3692
|
l(this, "_screenshotCache", /* @__PURE__ */ new Map());
|
|
3515
3693
|
l(this, "_client");
|
|
3516
3694
|
l(this, "_eventStreamAbort", null);
|
|
@@ -3519,7 +3697,7 @@ class ps {
|
|
|
3519
3697
|
l(this, "sourceTreeIds", this._sourceTreeIds);
|
|
3520
3698
|
/** Observable list of sessions from the daemon */
|
|
3521
3699
|
l(this, "sessions", this._sessions);
|
|
3522
|
-
this.config = e, this.sessionName = e.sessionName, this._client =
|
|
3700
|
+
this.config = e, this.sessionName = e.sessionName, this._client = ys("/__explorer/daemon-api");
|
|
3523
3701
|
}
|
|
3524
3702
|
/**
|
|
3525
3703
|
* Initializes the model: fetches initial session info and starts listening to events.
|
|
@@ -3617,21 +3795,81 @@ class ps {
|
|
|
3617
3795
|
}
|
|
3618
3796
|
}
|
|
3619
3797
|
}
|
|
3620
|
-
function
|
|
3798
|
+
function Cs() {
|
|
3621
3799
|
return window.__EXPLORER_DAEMON__;
|
|
3622
3800
|
}
|
|
3623
|
-
class
|
|
3801
|
+
class Ss {
|
|
3802
|
+
constructor(e) {
|
|
3803
|
+
l(this, "state", x(this, { status: "loading" }));
|
|
3804
|
+
l(this, "_baseUrl");
|
|
3805
|
+
this.reportUrl = e;
|
|
3806
|
+
const t = e.lastIndexOf("/");
|
|
3807
|
+
this._baseUrl = t >= 0 ? e.slice(0, t + 1) : "", this._fetch();
|
|
3808
|
+
}
|
|
3809
|
+
resolveScreenshotUrl(e) {
|
|
3810
|
+
return this._baseUrl + e;
|
|
3811
|
+
}
|
|
3812
|
+
buildTree(e) {
|
|
3813
|
+
const t = this.state.read(e);
|
|
3814
|
+
return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : ws(t.report.fixtures);
|
|
3815
|
+
}
|
|
3816
|
+
async _fetch() {
|
|
3817
|
+
this.state.set({ status: "loading" }, void 0);
|
|
3818
|
+
try {
|
|
3819
|
+
const e = await fetch(this.reportUrl);
|
|
3820
|
+
if (!e.ok)
|
|
3821
|
+
throw new Error(`HTTP ${e.status}: ${e.statusText}`);
|
|
3822
|
+
const t = await e.json();
|
|
3823
|
+
this.state.set({ status: "ready", report: t }, void 0);
|
|
3824
|
+
} catch (e) {
|
|
3825
|
+
this.state.set({ status: "error", message: String(e) }, void 0);
|
|
3826
|
+
}
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
function ws(s) {
|
|
3830
|
+
const e = { id: "", name: "Components", type: "folder", children: [] };
|
|
3831
|
+
for (const [t, n] of Object.entries(s)) {
|
|
3832
|
+
const r = t.split("/");
|
|
3833
|
+
let i = e;
|
|
3834
|
+
for (let o = 0; o < r.length; o++) {
|
|
3835
|
+
const d = r[o], c = o === r.length - 1, h = r.slice(0, o + 1).join("/");
|
|
3836
|
+
if (c)
|
|
3837
|
+
i.children.push({
|
|
3838
|
+
id: h,
|
|
3839
|
+
name: d,
|
|
3840
|
+
type: "component",
|
|
3841
|
+
reportEntry: n
|
|
3842
|
+
});
|
|
3843
|
+
else {
|
|
3844
|
+
let m = i.children.find((_) => _.type === "folder" && _.name === d);
|
|
3845
|
+
m || (m = { id: h, name: d, type: "folder", children: [] }, i.children.push(m)), i = m;
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
}
|
|
3849
|
+
return e;
|
|
3850
|
+
}
|
|
3851
|
+
class Bs {
|
|
3624
3852
|
constructor(e, t) {
|
|
3625
3853
|
l(this, "_root");
|
|
3626
|
-
l(this, "_registry", new
|
|
3854
|
+
l(this, "_registry", new un());
|
|
3627
3855
|
l(this, "_daemonModel");
|
|
3628
|
-
|
|
3856
|
+
l(this, "_reportModel");
|
|
3857
|
+
this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = It(e), this._root.render(kt(ms, {
|
|
3858
|
+
registry: this._registry,
|
|
3859
|
+
daemonModel: this._daemonModel,
|
|
3860
|
+
reportModel: this._reportModel
|
|
3861
|
+
}));
|
|
3862
|
+
}
|
|
3863
|
+
_initializeReportModel() {
|
|
3864
|
+
const t = new URLSearchParams(location.search).get("report");
|
|
3865
|
+
if (t)
|
|
3866
|
+
return new Ss(t);
|
|
3629
3867
|
}
|
|
3630
3868
|
_initializeDaemonModel() {
|
|
3631
|
-
const e =
|
|
3869
|
+
const e = Cs();
|
|
3632
3870
|
if (!e)
|
|
3633
3871
|
return;
|
|
3634
|
-
const t = new
|
|
3872
|
+
const t = new xs(e);
|
|
3635
3873
|
return t.initialize().catch((n) => {
|
|
3636
3874
|
console.error("[ExplorerApp] Failed to initialize DaemonModel:", n);
|
|
3637
3875
|
}), t;
|
|
@@ -3664,50 +3902,50 @@ class Vs {
|
|
|
3664
3902
|
}
|
|
3665
3903
|
}
|
|
3666
3904
|
export {
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
lt as FixtureRegistry,
|
|
3905
|
+
On as ChevronDownIcon,
|
|
3906
|
+
In as ChevronRightIcon,
|
|
3907
|
+
As as CliRuntime,
|
|
3908
|
+
Rn as ComponentIcon,
|
|
3909
|
+
xs as DaemonModel,
|
|
3910
|
+
ms as Explorer,
|
|
3911
|
+
Bs as ExplorerApp,
|
|
3912
|
+
Sn as ExplorerModel,
|
|
3913
|
+
un as FixtureRegistry,
|
|
3677
3914
|
Tn as FolderIcon,
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3915
|
+
Bn as LeftSidebar,
|
|
3916
|
+
Dn as MoonIcon,
|
|
3917
|
+
kn as PanelLeftIcon,
|
|
3681
3918
|
Vn as PanelRightIcon,
|
|
3919
|
+
Ss as ReportModel,
|
|
3682
3920
|
Ln as RightSidebar,
|
|
3683
|
-
|
|
3684
|
-
|
|
3921
|
+
Nn as SunIcon,
|
|
3922
|
+
Fn as TitleBar,
|
|
3685
3923
|
ce as TitleBarButton,
|
|
3686
3924
|
An as TreeItem,
|
|
3687
3925
|
ut as TreeView,
|
|
3688
|
-
|
|
3926
|
+
Vt as VIEWPORT_SIZES,
|
|
3689
3927
|
Ft as collectComponents,
|
|
3690
|
-
|
|
3928
|
+
Me as createComponentDefinition,
|
|
3691
3929
|
le as createFixtureTree,
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3930
|
+
Hs as defineFixture,
|
|
3931
|
+
Ls as defineFixtureGroup,
|
|
3932
|
+
Us as defineFixtureVariants,
|
|
3695
3933
|
Fe as findNodeByPath,
|
|
3696
|
-
|
|
3697
|
-
|
|
3934
|
+
ke as fixtureGroupBrand,
|
|
3935
|
+
Ve as fixtureVariantsBrand,
|
|
3698
3936
|
Dt as getDefaultPropertyValues,
|
|
3699
|
-
|
|
3937
|
+
Es as isComponentDefinition,
|
|
3700
3938
|
Ce as isFixtureGroup,
|
|
3701
|
-
|
|
3939
|
+
Se as isFixtureVariants,
|
|
3702
3940
|
xe as isSingleFixture,
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3941
|
+
Te as mergeStyles,
|
|
3942
|
+
Ns as parseFixtureExport,
|
|
3943
|
+
Ms as parseFixtureGroup,
|
|
3944
|
+
Fs as parseFixtureVariants,
|
|
3945
|
+
Ds as parseSingleFixture,
|
|
3708
3946
|
Nt as resolveViewport,
|
|
3709
3947
|
Ne as singleFixtureBrand,
|
|
3710
|
-
|
|
3948
|
+
p as styles,
|
|
3711
3949
|
ht as toExplorerTree
|
|
3712
3950
|
};
|
|
3713
3951
|
//# sourceMappingURL=viewer.js.map
|