@vscode/component-explorer 0.1.1-10 → 0.1.1-12
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/FixturePreviewItem.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 +4 -3
- package/dist/core/CliRuntime.d.ts.map +1 -1
- package/dist/core/ErrorInfo.d.ts +1 -1
- package/dist/core/fixtureApi.d.ts +98 -6
- package/dist/core/fixtureApi.d.ts.map +1 -1
- package/dist/core/fixtureApiConsumer.d.ts +3 -3
- package/dist/core/fixtureApiConsumer.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/index-DnRcKk60.js +61 -0
- package/dist/index-DnRcKk60.js.map +1 -0
- package/dist/index.js +4 -22
- package/dist/index.js.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 +1360 -1483
- package/dist/viewer.js.map +1 -1
- package/package.json +3 -1
package/dist/viewer.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { createRoot as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { jsx as a, jsxs as
|
|
9
|
-
import { unstable_batchedUpdates as
|
|
10
|
-
function
|
|
11
|
-
return typeof
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
return typeof
|
|
15
|
-
}
|
|
16
|
-
function
|
|
17
|
-
return typeof
|
|
18
|
-
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
function
|
|
32
|
-
const n =
|
|
1
|
+
var mt = Object.defineProperty;
|
|
2
|
+
var vt = (r, e, t) => e in r ? mt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var l = (r, e, t) => vt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { f as Se, a as we, s as Re } from "./index-DnRcKk60.js";
|
|
5
|
+
import { b as Mn, d as Fn, c as En, e as Bn, g as An } from "./index-DnRcKk60.js";
|
|
6
|
+
import { createRoot as _t } from "react-dom/client";
|
|
7
|
+
import { createContext as Ue, useReducer as bt, useState as yt, useContext as xt, useEffect as Te, createElement as Ct } from "react";
|
|
8
|
+
import { jsx as a, jsxs as f, Fragment as pe } from "react/jsx-runtime";
|
|
9
|
+
import { unstable_batchedUpdates as Pe } from "react-dom";
|
|
10
|
+
function ge(r) {
|
|
11
|
+
return typeof r == "object" && r !== null && Re in r && r[Re] === !0 && "_options" in r && typeof r._options == "object";
|
|
12
|
+
}
|
|
13
|
+
function me(r) {
|
|
14
|
+
return typeof r == "object" && r !== null && Se in r && r[Se] === !0 && "_entries" in r && typeof r._entries == "object";
|
|
15
|
+
}
|
|
16
|
+
function ve(r) {
|
|
17
|
+
return typeof r == "object" && r !== null && we in r && r[we] === !0 && "_variants" in r && typeof r._variants == "object";
|
|
18
|
+
}
|
|
19
|
+
function wn(r) {
|
|
20
|
+
return ge(r) ? { success: !0, data: r } : me(r) ? { success: !0, data: r } : ve(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a valid fixture export (missing brand symbol or _options/_entries/_variants)" };
|
|
21
|
+
}
|
|
22
|
+
function Rn(r) {
|
|
23
|
+
return ge(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a SingleFixtureExport" };
|
|
24
|
+
}
|
|
25
|
+
function Tn(r) {
|
|
26
|
+
return me(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureGroupExport" };
|
|
27
|
+
}
|
|
28
|
+
function In(r) {
|
|
29
|
+
return ve(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureVariantsExport" };
|
|
30
|
+
}
|
|
31
|
+
function Ie(r, e, t) {
|
|
32
|
+
const n = r._options;
|
|
33
33
|
return {
|
|
34
34
|
id: e,
|
|
35
35
|
name: t,
|
|
@@ -42,115 +42,115 @@ function Ee(s, e, t) {
|
|
|
42
42
|
render: n.render
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return typeof
|
|
45
|
+
function On(r) {
|
|
46
|
+
return typeof r == "object" && r !== null && "render" in r && typeof r.render == "function" && "id" in r && "name" in r;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const St = {
|
|
49
49
|
mobile: { width: 390, height: 844 },
|
|
50
50
|
tablet: { width: 768, height: 1024 },
|
|
51
51
|
desktop: { width: 1440, height: 900 }
|
|
52
52
|
};
|
|
53
|
-
function
|
|
54
|
-
return typeof
|
|
53
|
+
function wt(r) {
|
|
54
|
+
return typeof r == "string" ? { name: r, ...St[r] } : r;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Rt(r) {
|
|
57
57
|
const e = {};
|
|
58
|
-
for (const t of
|
|
58
|
+
for (const t of r)
|
|
59
59
|
e[t.name] = t.defaultValue;
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function oe(r) {
|
|
63
63
|
const e = {
|
|
64
64
|
id: "",
|
|
65
65
|
name: "Components",
|
|
66
66
|
type: "folder",
|
|
67
67
|
children: []
|
|
68
68
|
};
|
|
69
|
-
for (const [t, n] of
|
|
70
|
-
const
|
|
71
|
-
|
|
69
|
+
for (const [t, n] of r) {
|
|
70
|
+
const s = Tt(t);
|
|
71
|
+
We(e, [s], n);
|
|
72
72
|
}
|
|
73
73
|
return e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return (
|
|
75
|
+
function Tt(r) {
|
|
76
|
+
return (r.split("/").pop() ?? r).replace(/\.fixture\.(tsx?|jsx?)$/, "");
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function We(r, e, t) {
|
|
79
79
|
var n;
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
id:
|
|
83
|
-
name:
|
|
80
|
+
if (ge(t)) {
|
|
81
|
+
const s = e.join("/"), o = e[e.length - 1], i = {
|
|
82
|
+
id: s,
|
|
83
|
+
name: o,
|
|
84
84
|
type: "component",
|
|
85
|
-
component:
|
|
85
|
+
component: Ie(t, s, o)
|
|
86
86
|
};
|
|
87
|
-
|
|
88
|
-
} else if (
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
(d) => d.type === "folder" && d.name ===
|
|
87
|
+
r.children || (r.children = []), r.children.push(i);
|
|
88
|
+
} else if (me(t)) {
|
|
89
|
+
const s = e[e.length - 1], o = e.join("/");
|
|
90
|
+
let i = (n = r.children) == null ? void 0 : n.find(
|
|
91
|
+
(d) => d.type === "folder" && d.name === s
|
|
92
92
|
);
|
|
93
|
-
|
|
94
|
-
id:
|
|
95
|
-
name:
|
|
93
|
+
i || (i = {
|
|
94
|
+
id: o,
|
|
95
|
+
name: s,
|
|
96
96
|
type: "folder",
|
|
97
97
|
children: []
|
|
98
|
-
},
|
|
98
|
+
}, r.children || (r.children = []), r.children.push(i));
|
|
99
99
|
for (const [d, c] of Object.entries(t._entries))
|
|
100
|
-
|
|
101
|
-
} else if (
|
|
102
|
-
const
|
|
100
|
+
We(i, [...e, d], c);
|
|
101
|
+
} else if (ve(t)) {
|
|
102
|
+
const s = e[e.length - 1], i = {
|
|
103
103
|
id: e.join("/"),
|
|
104
|
-
name:
|
|
104
|
+
name: s,
|
|
105
105
|
type: "variants",
|
|
106
106
|
children: []
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
r.children || (r.children = []), r.children.push(i);
|
|
109
109
|
for (const [d, c] of Object.entries(t._variants)) {
|
|
110
|
-
const
|
|
111
|
-
id:
|
|
110
|
+
const g = [...e, d].join("/"), _ = {
|
|
111
|
+
id: g,
|
|
112
112
|
name: d,
|
|
113
113
|
type: "component",
|
|
114
|
-
component:
|
|
114
|
+
component: Ie(c, g, d)
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
i.children.push(_);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Oe(r, e) {
|
|
121
121
|
if (e.length === 0)
|
|
122
|
-
return
|
|
123
|
-
let t =
|
|
122
|
+
return r;
|
|
123
|
+
let t = r;
|
|
124
124
|
for (const n of e) {
|
|
125
125
|
if (!t || !t.children)
|
|
126
126
|
return;
|
|
127
|
-
t = t.children.find((
|
|
127
|
+
t = t.children.find((s) => s.name === n);
|
|
128
128
|
}
|
|
129
129
|
return t;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
return [
|
|
131
|
+
function It(r) {
|
|
132
|
+
if (r.type === "component" && r.component)
|
|
133
|
+
return [r.component];
|
|
134
134
|
const e = [];
|
|
135
|
-
for (const t of
|
|
136
|
-
e.push(...
|
|
135
|
+
for (const t of r.children ?? [])
|
|
136
|
+
e.push(...It(t));
|
|
137
137
|
return e;
|
|
138
138
|
}
|
|
139
|
-
let
|
|
140
|
-
function
|
|
141
|
-
|
|
139
|
+
let $;
|
|
140
|
+
function Ot(r) {
|
|
141
|
+
$ ? $ instanceof ke ? $.loggers.push(r) : $ = new ke([$, r]) : $ = r;
|
|
142
142
|
}
|
|
143
143
|
function b() {
|
|
144
|
-
return
|
|
144
|
+
return $;
|
|
145
145
|
}
|
|
146
|
-
let
|
|
147
|
-
function
|
|
148
|
-
|
|
146
|
+
let ie;
|
|
147
|
+
function kt(r) {
|
|
148
|
+
ie = r;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function Vt(r) {
|
|
151
|
+
ie && ie(r);
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class ke {
|
|
154
154
|
constructor(e) {
|
|
155
155
|
this.loggers = e;
|
|
156
156
|
}
|
|
@@ -175,8 +175,8 @@ class Ae {
|
|
|
175
175
|
t.handleAutorunDisposed(e);
|
|
176
176
|
}
|
|
177
177
|
handleAutorunDependencyChanged(e, t, n) {
|
|
178
|
-
for (const
|
|
179
|
-
|
|
178
|
+
for (const s of this.loggers)
|
|
179
|
+
s.handleAutorunDependencyChanged(e, t, n);
|
|
180
180
|
}
|
|
181
181
|
handleAutorunStarted(e) {
|
|
182
182
|
for (const t of this.loggers)
|
|
@@ -187,8 +187,8 @@ class Ae {
|
|
|
187
187
|
t.handleAutorunFinished(e);
|
|
188
188
|
}
|
|
189
189
|
handleDerivedDependencyChanged(e, t, n) {
|
|
190
|
-
for (const
|
|
191
|
-
|
|
190
|
+
for (const s of this.loggers)
|
|
191
|
+
s.handleDerivedDependencyChanged(e, t, n);
|
|
192
192
|
}
|
|
193
193
|
handleDerivedCleared(e) {
|
|
194
194
|
for (const t of this.loggers)
|
|
@@ -203,143 +203,143 @@ class Ae {
|
|
|
203
203
|
t.handleEndTransaction(e);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
var
|
|
207
|
-
(function(
|
|
206
|
+
var D;
|
|
207
|
+
(function(r) {
|
|
208
208
|
let e = !1;
|
|
209
209
|
function t() {
|
|
210
210
|
e = !0;
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
r.enable = t;
|
|
213
213
|
function n() {
|
|
214
|
-
return
|
|
214
|
+
return s(1);
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
function
|
|
216
|
+
r.ofCaller = n;
|
|
217
|
+
function s(o) {
|
|
218
218
|
if (!e)
|
|
219
219
|
return;
|
|
220
|
-
const
|
|
221
|
-
|
|
220
|
+
const i = Error, d = i.stackTraceLimit;
|
|
221
|
+
i.stackTraceLimit = 3;
|
|
222
222
|
const c = new Error().stack;
|
|
223
|
-
return
|
|
223
|
+
return i.stackTraceLimit = d, _e.fromStack(c, o + 1);
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
})(
|
|
227
|
-
class
|
|
225
|
+
r.ofNthCaller = s;
|
|
226
|
+
})(D || (D = {}));
|
|
227
|
+
class _e {
|
|
228
228
|
static fromStack(e, t) {
|
|
229
229
|
const n = e.split(`
|
|
230
|
-
`),
|
|
231
|
-
if (
|
|
232
|
-
return new
|
|
230
|
+
`), s = Nt(n[t + 1]);
|
|
231
|
+
if (s)
|
|
232
|
+
return new _e(s.fileName, s.line, s.column, s.id);
|
|
233
233
|
}
|
|
234
|
-
constructor(e, t, n,
|
|
235
|
-
this.fileName = e, this.line = t, this.column = n, this.id =
|
|
234
|
+
constructor(e, t, n, s) {
|
|
235
|
+
this.fileName = e, this.line = t, this.column = n, this.id = s;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
if (!
|
|
238
|
+
function Nt(r) {
|
|
239
|
+
if (!r)
|
|
240
240
|
return;
|
|
241
|
-
const e =
|
|
241
|
+
const e = r.match(/\((.*):(\d+):(\d+)\)/);
|
|
242
242
|
if (e)
|
|
243
243
|
return {
|
|
244
244
|
fileName: e[1],
|
|
245
245
|
line: parseInt(e[2]),
|
|
246
246
|
column: parseInt(e[3]),
|
|
247
|
-
id:
|
|
247
|
+
id: r
|
|
248
248
|
};
|
|
249
|
-
const t =
|
|
249
|
+
const t = r.match(/at ([^\(\)]*):(\d+):(\d+)/);
|
|
250
250
|
if (t)
|
|
251
251
|
return {
|
|
252
252
|
fileName: t[1],
|
|
253
253
|
line: parseInt(t[2]),
|
|
254
254
|
column: parseInt(t[3]),
|
|
255
|
-
id:
|
|
255
|
+
id: r
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class M {
|
|
259
259
|
constructor(e, t, n) {
|
|
260
260
|
this.owner = e, this.debugNameSource = t, this.referenceFn = n;
|
|
261
261
|
}
|
|
262
262
|
getDebugName(e) {
|
|
263
|
-
return
|
|
263
|
+
return Dt(e, this);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
const
|
|
267
|
-
function
|
|
268
|
-
const t =
|
|
266
|
+
const Ve = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new WeakMap();
|
|
267
|
+
function Dt(r, e) {
|
|
268
|
+
const t = ae.get(r);
|
|
269
269
|
if (t)
|
|
270
270
|
return t;
|
|
271
|
-
const n =
|
|
271
|
+
const n = Mt(r, e);
|
|
272
272
|
if (n) {
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
return
|
|
273
|
+
let s = Ve.get(n) ?? 0;
|
|
274
|
+
s++, Ve.set(n, s);
|
|
275
|
+
const o = s === 1 ? n : `${n}#${s}`;
|
|
276
|
+
return ae.set(r, o), o;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const t =
|
|
279
|
+
function Mt(r, e) {
|
|
280
|
+
const t = ae.get(r);
|
|
281
281
|
if (t)
|
|
282
282
|
return t;
|
|
283
|
-
const n = e.owner ?
|
|
284
|
-
let
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
if (typeof
|
|
288
|
-
if (
|
|
289
|
-
return n +
|
|
283
|
+
const n = e.owner ? Et(e.owner) + "." : "";
|
|
284
|
+
let s;
|
|
285
|
+
const o = e.debugNameSource;
|
|
286
|
+
if (o !== void 0)
|
|
287
|
+
if (typeof o == "function") {
|
|
288
|
+
if (s = o(), s !== void 0)
|
|
289
|
+
return n + s;
|
|
290
290
|
} else
|
|
291
|
-
return n +
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
return n +
|
|
291
|
+
return n + o;
|
|
292
|
+
const i = e.referenceFn;
|
|
293
|
+
if (i !== void 0 && (s = be(i), s !== void 0))
|
|
294
|
+
return n + s;
|
|
295
295
|
if (e.owner !== void 0) {
|
|
296
|
-
const d =
|
|
296
|
+
const d = Ft(e.owner, r);
|
|
297
297
|
if (d !== void 0)
|
|
298
298
|
return n + d;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
for (const t in
|
|
303
|
-
if (
|
|
301
|
+
function Ft(r, e) {
|
|
302
|
+
for (const t in r)
|
|
303
|
+
if (r[t] === e)
|
|
304
304
|
return t;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
307
|
-
function
|
|
308
|
-
const e =
|
|
306
|
+
const Ne = /* @__PURE__ */ new Map(), De = /* @__PURE__ */ new WeakMap();
|
|
307
|
+
function Et(r) {
|
|
308
|
+
const e = De.get(r);
|
|
309
309
|
if (e)
|
|
310
310
|
return e;
|
|
311
|
-
const t =
|
|
312
|
-
let n =
|
|
313
|
-
n++,
|
|
314
|
-
const
|
|
315
|
-
return
|
|
316
|
-
}
|
|
317
|
-
function
|
|
318
|
-
const e =
|
|
311
|
+
const t = Ge(r) ?? "Object";
|
|
312
|
+
let n = Ne.get(t) ?? 0;
|
|
313
|
+
n++, Ne.set(t, n);
|
|
314
|
+
const s = n === 1 ? t : `${t}#${n}`;
|
|
315
|
+
return De.set(r, s), s;
|
|
316
|
+
}
|
|
317
|
+
function Ge(r) {
|
|
318
|
+
const e = r.constructor;
|
|
319
319
|
if (e)
|
|
320
320
|
return e.name === "Object" ? void 0 : e.name;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
const e =
|
|
324
|
-
return
|
|
322
|
+
function be(r) {
|
|
323
|
+
const e = r.toString(), n = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(e), s = n ? n[1] : void 0;
|
|
324
|
+
return s == null ? void 0 : s.trim();
|
|
325
325
|
}
|
|
326
|
-
let
|
|
327
|
-
function
|
|
328
|
-
|
|
326
|
+
let de;
|
|
327
|
+
function Bt(r) {
|
|
328
|
+
de = r;
|
|
329
329
|
}
|
|
330
|
-
let
|
|
331
|
-
function
|
|
332
|
-
|
|
330
|
+
let qe;
|
|
331
|
+
function At(r) {
|
|
332
|
+
qe = r;
|
|
333
333
|
}
|
|
334
|
-
let
|
|
335
|
-
function
|
|
336
|
-
|
|
334
|
+
let Ke;
|
|
335
|
+
function zt(r) {
|
|
336
|
+
Ke = r;
|
|
337
337
|
}
|
|
338
|
-
let
|
|
339
|
-
function
|
|
340
|
-
|
|
338
|
+
let Je;
|
|
339
|
+
function $t(r) {
|
|
340
|
+
Je = r;
|
|
341
341
|
}
|
|
342
|
-
class
|
|
342
|
+
class Lt {
|
|
343
343
|
get TChange() {
|
|
344
344
|
return null;
|
|
345
345
|
}
|
|
@@ -350,35 +350,35 @@ class Wt {
|
|
|
350
350
|
read(e) {
|
|
351
351
|
return e ? e.readObservable(this) : this.get();
|
|
352
352
|
}
|
|
353
|
-
map(e, t, n =
|
|
354
|
-
const
|
|
355
|
-
return
|
|
356
|
-
owner:
|
|
353
|
+
map(e, t, n = D.ofCaller()) {
|
|
354
|
+
const s = t === void 0 ? void 0 : e, o = t === void 0 ? e : t;
|
|
355
|
+
return de({
|
|
356
|
+
owner: s,
|
|
357
357
|
debugName: () => {
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
return
|
|
361
|
-
const c = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(
|
|
358
|
+
const i = be(o);
|
|
359
|
+
if (i !== void 0)
|
|
360
|
+
return i;
|
|
361
|
+
const c = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());
|
|
362
362
|
if (c)
|
|
363
363
|
return `${this.debugName}.${c[2]}`;
|
|
364
|
-
if (!
|
|
364
|
+
if (!s)
|
|
365
365
|
return `${this.debugName} (mapped)`;
|
|
366
366
|
},
|
|
367
|
-
debugReferenceFn:
|
|
368
|
-
}, (
|
|
367
|
+
debugReferenceFn: o
|
|
368
|
+
}, (i) => o(this.read(i), i), n);
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
371
|
* @sealed
|
|
372
372
|
* Converts an observable of an observable value into a direct observable of the value.
|
|
373
373
|
*/
|
|
374
374
|
flatten() {
|
|
375
|
-
return
|
|
375
|
+
return de({
|
|
376
376
|
owner: void 0,
|
|
377
377
|
debugName: () => `${this.debugName} (flattened)`
|
|
378
378
|
}, (e) => this.read(e).read(e));
|
|
379
379
|
}
|
|
380
380
|
recomputeInitiallyAndOnChange(e, t) {
|
|
381
|
-
return e.add(
|
|
381
|
+
return e.add(qe(this, t)), this;
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
384
384
|
* Ensures that this observable is observed. This keeps the cache alive.
|
|
@@ -386,16 +386,16 @@ class Wt {
|
|
|
386
386
|
* Use `recomputeInitiallyAndOnChange` for eager evaluation.
|
|
387
387
|
*/
|
|
388
388
|
keepObserved(e) {
|
|
389
|
-
return e.add(
|
|
389
|
+
return e.add(Ke(this)), this;
|
|
390
390
|
}
|
|
391
391
|
get debugValue() {
|
|
392
392
|
return this.get();
|
|
393
393
|
}
|
|
394
394
|
debugGetDependencyGraph() {
|
|
395
|
-
return
|
|
395
|
+
return Je(this);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
class
|
|
398
|
+
class ye extends Lt {
|
|
399
399
|
constructor(e) {
|
|
400
400
|
var t;
|
|
401
401
|
super(), this._observers = /* @__PURE__ */ new Set(), (t = b()) == null || t.handleObservableCreated(this, e);
|
|
@@ -417,32 +417,29 @@ class Oe extends Wt {
|
|
|
417
417
|
log() {
|
|
418
418
|
var t;
|
|
419
419
|
const e = !!b();
|
|
420
|
-
return
|
|
420
|
+
return Vt(this), e || (t = b()) == null || t.handleObservableCreated(this, D.ofCaller()), this;
|
|
421
421
|
}
|
|
422
422
|
debugGetObservers() {
|
|
423
423
|
return this._observers;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Ze(r) {
|
|
427
427
|
return {
|
|
428
|
-
dispose:
|
|
428
|
+
dispose: r
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
class
|
|
431
|
+
class H 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, H.prototype);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
throw
|
|
436
|
+
function te(r) {
|
|
437
|
+
throw r;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
console.error("Unexpected error:",
|
|
441
|
-
}
|
|
442
|
-
const X = (s, e) => s === e;
|
|
443
|
-
function Q(s) {
|
|
444
|
-
return s != null;
|
|
439
|
+
function Ht(r) {
|
|
440
|
+
console.error("Unexpected error:", r);
|
|
445
441
|
}
|
|
442
|
+
const X = (r, e) => r === e;
|
|
446
443
|
class Y {
|
|
447
444
|
constructor() {
|
|
448
445
|
this.disposables = [], this._isDisposed = !1;
|
|
@@ -471,8 +468,8 @@ class Y {
|
|
|
471
468
|
this.disposables = [];
|
|
472
469
|
}
|
|
473
470
|
}
|
|
474
|
-
function
|
|
475
|
-
switch (
|
|
471
|
+
function jt(r) {
|
|
472
|
+
switch (r) {
|
|
476
473
|
case 0:
|
|
477
474
|
return "initial";
|
|
478
475
|
case 1:
|
|
@@ -485,13 +482,13 @@ function qt(s) {
|
|
|
485
482
|
return "<unknown>";
|
|
486
483
|
}
|
|
487
484
|
}
|
|
488
|
-
class
|
|
485
|
+
class j extends ye {
|
|
489
486
|
get debugName() {
|
|
490
487
|
return this._debugNameData.getDebugName(this) ?? "(anonymous)";
|
|
491
488
|
}
|
|
492
|
-
constructor(e, t, n,
|
|
489
|
+
constructor(e, t, n, s = void 0, o, i) {
|
|
493
490
|
var d;
|
|
494
|
-
super(
|
|
491
|
+
super(i), this._debugNameData = e, this._computeFn = t, this._changeTracker = n, this._handleLastObserverRemoved = s, this._equalityComparator = o, this._state = 0, this._value = void 0, this._updateCount = 0, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._changeSummary = void 0, this._isUpdating = !1, this._isComputing = !1, this._didReportChange = !1, this._isInBeforeUpdate = !1, this._isReaderValid = !1, this._store = void 0, this._delayedStore = void 0, this._removedObserverToCallEndUpdateOn = null, this._changeSummary = (d = this._changeTracker) == null ? void 0 : d.createChangeSummary(void 0);
|
|
495
492
|
}
|
|
496
493
|
onLastObserverRemoved() {
|
|
497
494
|
var e, t;
|
|
@@ -503,20 +500,20 @@ class w extends Oe {
|
|
|
503
500
|
get() {
|
|
504
501
|
var t, n;
|
|
505
502
|
if (this._isComputing, this._observers.size === 0) {
|
|
506
|
-
let
|
|
503
|
+
let s;
|
|
507
504
|
try {
|
|
508
505
|
this._isReaderValid = !0;
|
|
509
|
-
let
|
|
510
|
-
this._changeTracker && (
|
|
506
|
+
let o;
|
|
507
|
+
this._changeTracker && (o = this._changeTracker.createChangeSummary(void 0), (n = (t = this._changeTracker).beforeUpdate) == null || n.call(t, this, o)), s = this._computeFn(this, o);
|
|
511
508
|
} finally {
|
|
512
509
|
this._isReaderValid = !1;
|
|
513
510
|
}
|
|
514
|
-
return this.onLastObserverRemoved(),
|
|
511
|
+
return this.onLastObserverRemoved(), s;
|
|
515
512
|
} else {
|
|
516
513
|
do {
|
|
517
514
|
if (this._state === 1) {
|
|
518
|
-
for (const
|
|
519
|
-
if (
|
|
515
|
+
for (const s of this._dependencies)
|
|
516
|
+
if (s.reportChanges(), this._state === 2)
|
|
520
517
|
break;
|
|
521
518
|
}
|
|
522
519
|
this._state === 1 && (this._state = 3), this._state !== 3 && this._recompute();
|
|
@@ -525,27 +522,27 @@ class w extends Oe {
|
|
|
525
522
|
}
|
|
526
523
|
}
|
|
527
524
|
_recompute() {
|
|
528
|
-
var n,
|
|
525
|
+
var n, s, o, i;
|
|
529
526
|
let e = !1;
|
|
530
527
|
this._isComputing = !0, this._didReportChange = !1;
|
|
531
528
|
const t = this._dependenciesToBeRemoved;
|
|
532
529
|
this._dependenciesToBeRemoved = this._dependencies, this._dependencies = t;
|
|
533
530
|
try {
|
|
534
531
|
const d = this._changeSummary;
|
|
535
|
-
this._isReaderValid = !0, this._changeTracker && (this._isInBeforeUpdate = !0, (
|
|
532
|
+
this._isReaderValid = !0, this._changeTracker && (this._isInBeforeUpdate = !0, (s = (n = this._changeTracker).beforeUpdate) == null || s.call(n, this, d), this._isInBeforeUpdate = !1, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(d));
|
|
536
533
|
const c = this._state !== 0, h = this._value;
|
|
537
534
|
this._state = 3;
|
|
538
|
-
const
|
|
539
|
-
|
|
535
|
+
const g = this._delayedStore;
|
|
536
|
+
g !== void 0 && (this._delayedStore = void 0);
|
|
540
537
|
try {
|
|
541
538
|
this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._value = this._computeFn(this, d);
|
|
542
539
|
} finally {
|
|
543
540
|
this._isReaderValid = !1;
|
|
544
|
-
for (const
|
|
545
|
-
|
|
546
|
-
this._dependenciesToBeRemoved.clear(),
|
|
541
|
+
for (const _ of this._dependenciesToBeRemoved)
|
|
542
|
+
_.removeObserver(this);
|
|
543
|
+
this._dependenciesToBeRemoved.clear(), g !== void 0 && g.dispose();
|
|
547
544
|
}
|
|
548
|
-
e = this._didReportChange || c && !this._equalityComparator(h, this._value), (
|
|
545
|
+
e = this._didReportChange || c && !this._equalityComparator(h, this._value), (i = b()) == null || i.handleObservableUpdated(this, {
|
|
549
546
|
oldValue: h,
|
|
550
547
|
newValue: this._value,
|
|
551
548
|
change: void 0,
|
|
@@ -553,7 +550,7 @@ class w extends Oe {
|
|
|
553
550
|
hadValue: c
|
|
554
551
|
});
|
|
555
552
|
} catch (d) {
|
|
556
|
-
|
|
553
|
+
te(d);
|
|
557
554
|
}
|
|
558
555
|
if (this._isComputing = !1, !this._didReportChange && e)
|
|
559
556
|
for (const d of this._observers)
|
|
@@ -567,7 +564,7 @@ class w extends Oe {
|
|
|
567
564
|
// IObserver Implementation
|
|
568
565
|
beginUpdate(e) {
|
|
569
566
|
if (this._isUpdating)
|
|
570
|
-
throw new
|
|
567
|
+
throw new H("Cyclic deriveds are not supported yet!");
|
|
571
568
|
this._updateCount++, this._isUpdating = !0;
|
|
572
569
|
try {
|
|
573
570
|
const t = this._updateCount === 1;
|
|
@@ -589,8 +586,8 @@ class w extends Oe {
|
|
|
589
586
|
if (this._removedObserverToCallEndUpdateOn) {
|
|
590
587
|
const n = [...this._removedObserverToCallEndUpdateOn];
|
|
591
588
|
this._removedObserverToCallEndUpdateOn = null;
|
|
592
|
-
for (const
|
|
593
|
-
|
|
589
|
+
for (const s of n)
|
|
590
|
+
s.endUpdate(this);
|
|
594
591
|
}
|
|
595
592
|
}
|
|
596
593
|
}
|
|
@@ -605,26 +602,26 @@ class w extends Oe {
|
|
|
605
602
|
var n;
|
|
606
603
|
if (this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e) || this._isInBeforeUpdate) {
|
|
607
604
|
(n = b()) == null || n.handleDerivedDependencyChanged(this, e, t);
|
|
608
|
-
let
|
|
605
|
+
let s = !1;
|
|
609
606
|
try {
|
|
610
|
-
|
|
607
|
+
s = this._changeTracker ? this._changeTracker.handleChange({
|
|
611
608
|
changedObservable: e,
|
|
612
609
|
change: t,
|
|
613
|
-
didChange: (
|
|
610
|
+
didChange: (i) => i === e
|
|
614
611
|
}, this._changeSummary) : !0;
|
|
615
|
-
} catch (
|
|
616
|
-
|
|
612
|
+
} catch (i) {
|
|
613
|
+
te(i);
|
|
617
614
|
}
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
620
|
-
for (const
|
|
621
|
-
|
|
615
|
+
const o = this._state === 3;
|
|
616
|
+
if (s && (this._state === 1 || o) && (this._state = 2, o))
|
|
617
|
+
for (const i of this._observers)
|
|
618
|
+
i.handlePossibleChange(this);
|
|
622
619
|
}
|
|
623
620
|
}
|
|
624
621
|
// IReader Implementation
|
|
625
622
|
_ensureReaderValid() {
|
|
626
623
|
if (!this._isReaderValid)
|
|
627
|
-
throw new
|
|
624
|
+
throw new H("The reader object cannot be used outside its compute function!");
|
|
628
625
|
}
|
|
629
626
|
readObservable(e) {
|
|
630
627
|
this._ensureReaderValid(), e.addObserver(this);
|
|
@@ -652,7 +649,7 @@ class w extends Oe {
|
|
|
652
649
|
debugGetState() {
|
|
653
650
|
return {
|
|
654
651
|
state: this._state,
|
|
655
|
-
stateStr:
|
|
652
|
+
stateStr: jt(this._state),
|
|
656
653
|
updateCount: this._updateCount,
|
|
657
654
|
isComputing: this._isComputing,
|
|
658
655
|
dependencies: this._dependencies,
|
|
@@ -667,33 +664,33 @@ class w extends Oe {
|
|
|
667
664
|
}
|
|
668
665
|
setValue(e, t, n) {
|
|
669
666
|
this._value = e;
|
|
670
|
-
const
|
|
667
|
+
const s = this._observers;
|
|
671
668
|
t.updateObserver(this, this);
|
|
672
|
-
for (const
|
|
673
|
-
|
|
669
|
+
for (const o of s)
|
|
670
|
+
o.handleChange(this, n);
|
|
674
671
|
}
|
|
675
672
|
}
|
|
676
|
-
function N(
|
|
677
|
-
return e !== void 0 ? new
|
|
673
|
+
function N(r, e, t = D.ofCaller()) {
|
|
674
|
+
return e !== void 0 ? new j(new M(r, void 0, e), e, void 0, void 0, X, t) : new j(new M(void 0, void 0, r), r, void 0, void 0, X, t);
|
|
678
675
|
}
|
|
679
|
-
function
|
|
680
|
-
return new
|
|
676
|
+
function Ut(r, e, t = D.ofCaller()) {
|
|
677
|
+
return new j(new M(r.owner, r.debugName, r.debugReferenceFn), e, void 0, r.onLastObserverRemoved, r.equalsFn ?? X, t);
|
|
681
678
|
}
|
|
682
|
-
|
|
683
|
-
function
|
|
684
|
-
let n,
|
|
685
|
-
n =
|
|
686
|
-
let
|
|
687
|
-
return new
|
|
688
|
-
|
|
689
|
-
const d = n(
|
|
690
|
-
return d &&
|
|
679
|
+
Bt(Ut);
|
|
680
|
+
function Pt(r, e, t = D.ofCaller()) {
|
|
681
|
+
let n, s;
|
|
682
|
+
n = r, s = void 0;
|
|
683
|
+
let o;
|
|
684
|
+
return new j(new M(s, void 0, n), (i) => {
|
|
685
|
+
o ? o.clear() : o = new Y();
|
|
686
|
+
const d = n(i);
|
|
687
|
+
return d && o.add(d), d;
|
|
691
688
|
}, void 0, () => {
|
|
692
|
-
|
|
689
|
+
o && (o.dispose(), o = void 0);
|
|
693
690
|
}, X, t);
|
|
694
691
|
}
|
|
695
|
-
function
|
|
696
|
-
switch (
|
|
692
|
+
function Wt(r) {
|
|
693
|
+
switch (r) {
|
|
697
694
|
case 1:
|
|
698
695
|
return "dependenciesMightHaveChanged";
|
|
699
696
|
case 2:
|
|
@@ -704,13 +701,13 @@ function Zt(s) {
|
|
|
704
701
|
return "<unknown>";
|
|
705
702
|
}
|
|
706
703
|
}
|
|
707
|
-
class
|
|
704
|
+
class Xe {
|
|
708
705
|
get debugName() {
|
|
709
706
|
return this._debugNameData.getDebugName(this) ?? "(anonymous)";
|
|
710
707
|
}
|
|
711
|
-
constructor(e, t, n,
|
|
712
|
-
var
|
|
713
|
-
this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (
|
|
708
|
+
constructor(e, t, n, s) {
|
|
709
|
+
var o, i;
|
|
710
|
+
this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(void 0), (i = b()) == null || i.handleAutorunCreated(this, s), this._run();
|
|
714
711
|
}
|
|
715
712
|
dispose() {
|
|
716
713
|
var e;
|
|
@@ -722,26 +719,26 @@ class se {
|
|
|
722
719
|
}
|
|
723
720
|
}
|
|
724
721
|
_run() {
|
|
725
|
-
var t, n,
|
|
722
|
+
var t, n, s, o;
|
|
726
723
|
const e = this._dependenciesToBeRemoved;
|
|
727
724
|
this._dependenciesToBeRemoved = this._dependencies, this._dependencies = e, this._state = 3;
|
|
728
725
|
try {
|
|
729
726
|
if (!this._disposed) {
|
|
730
727
|
(t = b()) == null || t.handleAutorunStarted(this);
|
|
731
|
-
const
|
|
728
|
+
const i = this._changeSummary, d = this._delayedStore;
|
|
732
729
|
d !== void 0 && (this._delayedStore = void 0);
|
|
733
730
|
try {
|
|
734
|
-
this._isRunning = !0, this._changeTracker && ((
|
|
731
|
+
this._isRunning = !0, this._changeTracker && ((s = (n = this._changeTracker).beforeUpdate) == null || s.call(n, this, i), this._changeSummary = this._changeTracker.createChangeSummary(i)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, i);
|
|
735
732
|
} catch (c) {
|
|
736
|
-
|
|
733
|
+
te(c);
|
|
737
734
|
} finally {
|
|
738
735
|
this._isRunning = !1, d !== void 0 && d.dispose();
|
|
739
736
|
}
|
|
740
737
|
}
|
|
741
738
|
} finally {
|
|
742
|
-
this._disposed || (
|
|
743
|
-
for (const
|
|
744
|
-
|
|
739
|
+
this._disposed || (o = b()) == null || o.handleAutorunFinished(this);
|
|
740
|
+
for (const i of this._dependenciesToBeRemoved)
|
|
741
|
+
i.removeObserver(this);
|
|
745
742
|
this._dependenciesToBeRemoved.clear();
|
|
746
743
|
}
|
|
747
744
|
}
|
|
@@ -779,10 +776,10 @@ class se {
|
|
|
779
776
|
(this._changeTracker ? this._changeTracker.handleChange({
|
|
780
777
|
changedObservable: e,
|
|
781
778
|
change: t,
|
|
782
|
-
didChange: (
|
|
779
|
+
didChange: (o) => o === e
|
|
783
780
|
}, this._changeSummary) : !0) && (this._state = 2);
|
|
784
|
-
} catch (
|
|
785
|
-
|
|
781
|
+
} catch (s) {
|
|
782
|
+
te(s);
|
|
786
783
|
}
|
|
787
784
|
}
|
|
788
785
|
}
|
|
@@ -792,7 +789,7 @@ class se {
|
|
|
792
789
|
// IReader implementation
|
|
793
790
|
_ensureNoRunning() {
|
|
794
791
|
if (!this._isRunning)
|
|
795
|
-
throw new
|
|
792
|
+
throw new H("The reader object cannot be used outside its compute function!");
|
|
796
793
|
}
|
|
797
794
|
readObservable(e) {
|
|
798
795
|
if (this._ensureNoRunning(), this._disposed)
|
|
@@ -803,12 +800,12 @@ class se {
|
|
|
803
800
|
}
|
|
804
801
|
get store() {
|
|
805
802
|
if (this._ensureNoRunning(), this._disposed)
|
|
806
|
-
throw new
|
|
803
|
+
throw new H("Cannot access store after dispose");
|
|
807
804
|
return this._store === void 0 && (this._store = new Y()), this._store;
|
|
808
805
|
}
|
|
809
806
|
get delayedStore() {
|
|
810
807
|
if (this._ensureNoRunning(), this._disposed)
|
|
811
|
-
throw new
|
|
808
|
+
throw new H("Cannot access store after dispose");
|
|
812
809
|
return this._delayedStore === void 0 && (this._delayedStore = new Y()), this._delayedStore;
|
|
813
810
|
}
|
|
814
811
|
debugGetState() {
|
|
@@ -817,42 +814,42 @@ class se {
|
|
|
817
814
|
updateCount: this._updateCount,
|
|
818
815
|
dependencies: this._dependencies,
|
|
819
816
|
state: this._state,
|
|
820
|
-
stateStr:
|
|
817
|
+
stateStr: Wt(this._state)
|
|
821
818
|
};
|
|
822
819
|
}
|
|
823
820
|
debugRerun() {
|
|
824
821
|
this._isRunning ? this._state = 2 : this._run();
|
|
825
822
|
}
|
|
826
823
|
}
|
|
827
|
-
function
|
|
828
|
-
return new
|
|
824
|
+
function Ye(r, e = D.ofCaller()) {
|
|
825
|
+
return new Xe(new M(void 0, void 0, r), r, void 0, e);
|
|
829
826
|
}
|
|
830
|
-
function
|
|
831
|
-
const e = new Error("BugIndicatingErrorRecovery: " +
|
|
832
|
-
|
|
827
|
+
function Me(r) {
|
|
828
|
+
const e = new Error("BugIndicatingErrorRecovery: " + r);
|
|
829
|
+
Ht(e), console.error("recovered from an error that indicates a bug", e);
|
|
833
830
|
}
|
|
834
|
-
function
|
|
835
|
-
const t = new
|
|
831
|
+
function Qe(r, e) {
|
|
832
|
+
const t = new et(r, e);
|
|
836
833
|
try {
|
|
837
|
-
|
|
834
|
+
r(t);
|
|
838
835
|
} finally {
|
|
839
836
|
t.finish();
|
|
840
837
|
}
|
|
841
838
|
}
|
|
842
|
-
function
|
|
843
|
-
|
|
839
|
+
function Gt(r, e, t) {
|
|
840
|
+
r ? e(r) : Qe(e, t);
|
|
844
841
|
}
|
|
845
|
-
class
|
|
842
|
+
class et {
|
|
846
843
|
constructor(e, t) {
|
|
847
844
|
var n;
|
|
848
845
|
this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = b()) == null || n.handleBeginTransaction(this);
|
|
849
846
|
}
|
|
850
847
|
getDebugName() {
|
|
851
|
-
return this._getDebugName ? this._getDebugName() :
|
|
848
|
+
return this._getDebugName ? this._getDebugName() : be(this._fn);
|
|
852
849
|
}
|
|
853
850
|
updateObserver(e, t) {
|
|
854
851
|
if (!this._updatingObservers) {
|
|
855
|
-
|
|
852
|
+
Me("Transaction already finished!"), Qe((n) => {
|
|
856
853
|
n.updateObserver(e, t);
|
|
857
854
|
});
|
|
858
855
|
return;
|
|
@@ -863,12 +860,12 @@ class it {
|
|
|
863
860
|
var t;
|
|
864
861
|
const e = this._updatingObservers;
|
|
865
862
|
if (!e) {
|
|
866
|
-
|
|
863
|
+
Me("transaction.finish() has already been called!");
|
|
867
864
|
return;
|
|
868
865
|
}
|
|
869
866
|
for (let n = 0; n < e.length; n++) {
|
|
870
|
-
const { observer:
|
|
871
|
-
|
|
867
|
+
const { observer: s, observable: o } = e[n];
|
|
868
|
+
s.endUpdate(o);
|
|
872
869
|
}
|
|
873
870
|
this._updatingObservers = null, (t = b()) == null || t.handleEndTransaction(this);
|
|
874
871
|
}
|
|
@@ -876,35 +873,35 @@ class it {
|
|
|
876
873
|
return this._updatingObservers;
|
|
877
874
|
}
|
|
878
875
|
}
|
|
879
|
-
function
|
|
876
|
+
function x(r, e, t = D.ofCaller()) {
|
|
880
877
|
let n;
|
|
881
|
-
return typeof
|
|
878
|
+
return typeof r == "string" ? n = new M(void 0, r, void 0) : n = new M(r, void 0, void 0), new tt(n, e, X, t);
|
|
882
879
|
}
|
|
883
|
-
class
|
|
880
|
+
class tt extends ye {
|
|
884
881
|
get debugName() {
|
|
885
882
|
return this._debugNameData.getDebugName(this) ?? "ObservableValue";
|
|
886
883
|
}
|
|
887
|
-
constructor(e, t, n,
|
|
888
|
-
var
|
|
889
|
-
super(
|
|
884
|
+
constructor(e, t, n, s) {
|
|
885
|
+
var o;
|
|
886
|
+
super(s), this._debugNameData = e, this._equalityComparator = n, this._value = t, (o = b()) == null || o.handleObservableUpdated(this, { hadValue: !1, newValue: t, change: void 0, didChange: !0, oldValue: void 0 });
|
|
890
887
|
}
|
|
891
888
|
get() {
|
|
892
889
|
return this._value;
|
|
893
890
|
}
|
|
894
891
|
set(e, t, n) {
|
|
895
|
-
var
|
|
892
|
+
var o;
|
|
896
893
|
if (n === void 0 && this._equalityComparator(this._value, e))
|
|
897
894
|
return;
|
|
898
|
-
let
|
|
899
|
-
t || (t =
|
|
895
|
+
let s;
|
|
896
|
+
t || (t = s = new et(() => {
|
|
900
897
|
}, () => `Setting ${this.debugName}`));
|
|
901
898
|
try {
|
|
902
|
-
const
|
|
903
|
-
this._setValue(e), (
|
|
899
|
+
const i = this._value;
|
|
900
|
+
this._setValue(e), (o = b()) == null || o.handleObservableUpdated(this, { oldValue: i, newValue: e, change: n, didChange: !0, hadValue: !0 });
|
|
904
901
|
for (const d of this._observers)
|
|
905
902
|
t.updateObserver(d, this), d.handleChange(this, n);
|
|
906
903
|
} finally {
|
|
907
|
-
|
|
904
|
+
s && s.finish();
|
|
908
905
|
}
|
|
909
906
|
}
|
|
910
907
|
toString() {
|
|
@@ -922,25 +919,25 @@ class re extends Oe {
|
|
|
922
919
|
this._value = e;
|
|
923
920
|
}
|
|
924
921
|
}
|
|
925
|
-
function
|
|
926
|
-
let e, t, n,
|
|
927
|
-
return
|
|
928
|
-
}
|
|
929
|
-
class
|
|
930
|
-
constructor(e, t, n,
|
|
931
|
-
super(
|
|
932
|
-
var
|
|
933
|
-
const c = this._getValue(d), h = this._value,
|
|
934
|
-
let
|
|
935
|
-
|
|
936
|
-
var
|
|
937
|
-
(
|
|
938
|
-
for (const
|
|
939
|
-
|
|
922
|
+
function Fe(...r) {
|
|
923
|
+
let e, t, n, s;
|
|
924
|
+
return r.length === 2 ? [t, n] = r : [e, t, n, s] = r, new L(new M(e, void 0, n), t, n, () => L.globalTransaction, X, s ?? D.ofCaller());
|
|
925
|
+
}
|
|
926
|
+
class L extends ye {
|
|
927
|
+
constructor(e, t, n, s, o, i) {
|
|
928
|
+
super(i), this._debugNameData = e, this.event = t, this._getValue = n, this._getTransaction = s, this._equalityComparator = o, this._hasValue = !1, this.handleEvent = (d) => {
|
|
929
|
+
var C;
|
|
930
|
+
const c = this._getValue(d), h = this._value, g = !this._hasValue || !this._equalityComparator(h, c);
|
|
931
|
+
let _ = !1;
|
|
932
|
+
g && (this._value = c, this._hasValue && (_ = !0, Gt(this._getTransaction(), (m) => {
|
|
933
|
+
var v;
|
|
934
|
+
(v = b()) == null || v.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: g, hadValue: this._hasValue });
|
|
935
|
+
for (const O of this._observers)
|
|
936
|
+
m.updateObserver(O, this), O.handleChange(this, void 0);
|
|
940
937
|
}, () => {
|
|
941
|
-
const
|
|
942
|
-
return "Event fired" + (
|
|
943
|
-
})), this._hasValue = !0),
|
|
938
|
+
const m = this.getDebugName();
|
|
939
|
+
return "Event fired" + (m ? `: ${m}` : "");
|
|
940
|
+
})), this._hasValue = !0), _ || (C = b()) == null || C.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: g, hadValue: this._hasValue });
|
|
944
941
|
};
|
|
945
942
|
}
|
|
946
943
|
getDebugName() {
|
|
@@ -966,40 +963,40 @@ class F extends Oe {
|
|
|
966
963
|
return { value: this._value, hasValue: this._hasValue };
|
|
967
964
|
}
|
|
968
965
|
}
|
|
969
|
-
(function(
|
|
970
|
-
|
|
966
|
+
(function(r) {
|
|
967
|
+
r.Observer = L;
|
|
971
968
|
function e(t, n) {
|
|
972
|
-
let
|
|
973
|
-
|
|
969
|
+
let s = !1;
|
|
970
|
+
L.globalTransaction === void 0 && (L.globalTransaction = t, s = !0);
|
|
974
971
|
try {
|
|
975
972
|
n();
|
|
976
973
|
} finally {
|
|
977
|
-
|
|
974
|
+
s && (L.globalTransaction = void 0);
|
|
978
975
|
}
|
|
979
976
|
}
|
|
980
|
-
|
|
981
|
-
})(
|
|
982
|
-
function
|
|
983
|
-
const e = new
|
|
984
|
-
return
|
|
985
|
-
|
|
977
|
+
r.batchEventsGlobally = e;
|
|
978
|
+
})(Fe || (Fe = {}));
|
|
979
|
+
function qt(r) {
|
|
980
|
+
const e = new rt(!1, void 0);
|
|
981
|
+
return r.addObserver(e), Ze(() => {
|
|
982
|
+
r.removeObserver(e);
|
|
986
983
|
});
|
|
987
984
|
}
|
|
988
|
-
|
|
989
|
-
function
|
|
990
|
-
const t = new
|
|
991
|
-
|
|
985
|
+
zt(qt);
|
|
986
|
+
function Kt(r, e) {
|
|
987
|
+
const t = new rt(!0, e);
|
|
988
|
+
r.addObserver(t);
|
|
992
989
|
try {
|
|
993
|
-
t.beginUpdate(
|
|
990
|
+
t.beginUpdate(r);
|
|
994
991
|
} finally {
|
|
995
|
-
t.endUpdate(
|
|
992
|
+
t.endUpdate(r);
|
|
996
993
|
}
|
|
997
|
-
return
|
|
998
|
-
|
|
994
|
+
return Ze(() => {
|
|
995
|
+
r.removeObserver(t);
|
|
999
996
|
});
|
|
1000
997
|
}
|
|
1001
|
-
|
|
1002
|
-
class
|
|
998
|
+
At(Kt);
|
|
999
|
+
class rt {
|
|
1003
1000
|
constructor(e, t) {
|
|
1004
1001
|
this._forceRecompute = e, this._handleValue = t, this._counter = 0;
|
|
1005
1002
|
}
|
|
@@ -1014,11 +1011,11 @@ class ot {
|
|
|
1014
1011
|
handleChange(e, t) {
|
|
1015
1012
|
}
|
|
1016
1013
|
}
|
|
1017
|
-
let
|
|
1018
|
-
function
|
|
1019
|
-
|
|
1014
|
+
let ee;
|
|
1015
|
+
function Jt(r) {
|
|
1016
|
+
ee || (ee = new Zt(), Ot(ee)), ee.addFilteredObj(r);
|
|
1020
1017
|
}
|
|
1021
|
-
class
|
|
1018
|
+
class Zt {
|
|
1022
1019
|
constructor() {
|
|
1023
1020
|
this.indentation = 0, this.changedObservablesSets = /* @__PURE__ */ new WeakMap();
|
|
1024
1021
|
}
|
|
@@ -1030,32 +1027,32 @@ class tn {
|
|
|
1030
1027
|
return ((t = this._filteredObjects) == null ? void 0 : t.has(e)) ?? !0;
|
|
1031
1028
|
}
|
|
1032
1029
|
textToConsoleArgs(e) {
|
|
1033
|
-
return
|
|
1034
|
-
|
|
1030
|
+
return Xt([
|
|
1031
|
+
U(tr("| ", this.indentation)),
|
|
1035
1032
|
e
|
|
1036
1033
|
]);
|
|
1037
1034
|
}
|
|
1038
1035
|
formatInfo(e) {
|
|
1039
1036
|
return e.hadValue ? e.didChange ? [
|
|
1040
|
-
|
|
1041
|
-
|
|
1037
|
+
U(" "),
|
|
1038
|
+
R(Z(e.oldValue, 70), {
|
|
1042
1039
|
color: "red",
|
|
1043
1040
|
strikeThrough: !0
|
|
1044
1041
|
}),
|
|
1045
|
-
|
|
1046
|
-
|
|
1042
|
+
U(" "),
|
|
1043
|
+
R(Z(e.newValue, 60), {
|
|
1047
1044
|
color: "green"
|
|
1048
1045
|
})
|
|
1049
|
-
] : [
|
|
1050
|
-
|
|
1051
|
-
|
|
1046
|
+
] : [U(" (unchanged)")] : [
|
|
1047
|
+
U(" "),
|
|
1048
|
+
R(Z(e.newValue, 60), {
|
|
1052
1049
|
color: "green"
|
|
1053
1050
|
}),
|
|
1054
|
-
|
|
1051
|
+
U(" (initial)")
|
|
1055
1052
|
];
|
|
1056
1053
|
}
|
|
1057
1054
|
handleObservableCreated(e) {
|
|
1058
|
-
if (e instanceof
|
|
1055
|
+
if (e instanceof j) {
|
|
1059
1056
|
const t = e;
|
|
1060
1057
|
this.changedObservablesSets.set(t, /* @__PURE__ */ new Set());
|
|
1061
1058
|
}
|
|
@@ -1064,32 +1061,32 @@ class tn {
|
|
|
1064
1061
|
}
|
|
1065
1062
|
handleObservableUpdated(e, t) {
|
|
1066
1063
|
if (this._isIncluded(e)) {
|
|
1067
|
-
if (e instanceof
|
|
1064
|
+
if (e instanceof j) {
|
|
1068
1065
|
this._handleDerivedRecomputed(e, t);
|
|
1069
1066
|
return;
|
|
1070
1067
|
}
|
|
1071
1068
|
console.log(...this.textToConsoleArgs([
|
|
1072
|
-
|
|
1073
|
-
|
|
1069
|
+
P("observable value changed"),
|
|
1070
|
+
R(e.debugName, { color: "BlueViolet" }),
|
|
1074
1071
|
...this.formatInfo(t)
|
|
1075
1072
|
]));
|
|
1076
1073
|
}
|
|
1077
1074
|
}
|
|
1078
1075
|
formatChanges(e) {
|
|
1079
1076
|
if (e.size !== 0)
|
|
1080
|
-
return
|
|
1077
|
+
return R(" (changed deps: " + [...e].map((t) => t.debugName).join(", ") + ")", { color: "gray" });
|
|
1081
1078
|
}
|
|
1082
1079
|
handleDerivedDependencyChanged(e, t, n) {
|
|
1083
|
-
var
|
|
1084
|
-
this._isIncluded(e) && ((
|
|
1080
|
+
var s;
|
|
1081
|
+
this._isIncluded(e) && ((s = this.changedObservablesSets.get(e)) == null || s.add(t));
|
|
1085
1082
|
}
|
|
1086
1083
|
_handleDerivedRecomputed(e, t) {
|
|
1087
1084
|
if (!this._isIncluded(e))
|
|
1088
1085
|
return;
|
|
1089
1086
|
const n = this.changedObservablesSets.get(e);
|
|
1090
1087
|
n && (console.log(...this.textToConsoleArgs([
|
|
1091
|
-
|
|
1092
|
-
|
|
1088
|
+
P("derived recomputed"),
|
|
1089
|
+
R(e.debugName, { color: "BlueViolet" }),
|
|
1093
1090
|
...this.formatInfo(t),
|
|
1094
1091
|
this.formatChanges(n),
|
|
1095
1092
|
{ data: [{ fn: e._debugNameData.referenceFn ?? e._computeFn }] }
|
|
@@ -1097,14 +1094,14 @@ class tn {
|
|
|
1097
1094
|
}
|
|
1098
1095
|
handleDerivedCleared(e) {
|
|
1099
1096
|
this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1100
|
-
|
|
1101
|
-
|
|
1097
|
+
P("derived cleared"),
|
|
1098
|
+
R(e.debugName, { color: "BlueViolet" })
|
|
1102
1099
|
]));
|
|
1103
1100
|
}
|
|
1104
1101
|
handleFromEventObservableTriggered(e, t) {
|
|
1105
1102
|
this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1106
|
-
|
|
1107
|
-
|
|
1103
|
+
P("observable from event triggered"),
|
|
1104
|
+
R(e.debugName, { color: "BlueViolet" }),
|
|
1108
1105
|
...this.formatInfo(t),
|
|
1109
1106
|
{ data: [{ fn: e._getValue }] }
|
|
1110
1107
|
]));
|
|
@@ -1120,8 +1117,8 @@ class tn {
|
|
|
1120
1117
|
handleAutorunStarted(e) {
|
|
1121
1118
|
const t = this.changedObservablesSets.get(e);
|
|
1122
1119
|
t && (this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1123
|
-
|
|
1124
|
-
|
|
1120
|
+
P("autorun"),
|
|
1121
|
+
R(e.debugName, { color: "BlueViolet" }),
|
|
1125
1122
|
this.formatChanges(t),
|
|
1126
1123
|
{ data: [{ fn: e._debugNameData.referenceFn ?? e._runFn }] }
|
|
1127
1124
|
])), t.clear(), this.indentation++);
|
|
@@ -1132,8 +1129,8 @@ class tn {
|
|
|
1132
1129
|
handleBeginTransaction(e) {
|
|
1133
1130
|
let t = e.getDebugName();
|
|
1134
1131
|
t === void 0 && (t = ""), this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1135
|
-
|
|
1136
|
-
|
|
1132
|
+
P("transaction"),
|
|
1133
|
+
R(t, { color: "BlueViolet" }),
|
|
1137
1134
|
{ data: [{ fn: e._fn }] }
|
|
1138
1135
|
])), this.indentation++;
|
|
1139
1136
|
}
|
|
@@ -1141,543 +1138,162 @@ class tn {
|
|
|
1141
1138
|
this.indentation--;
|
|
1142
1139
|
}
|
|
1143
1140
|
}
|
|
1144
|
-
function
|
|
1141
|
+
function Xt(r) {
|
|
1145
1142
|
const e = new Array(), t = [];
|
|
1146
1143
|
let n = "";
|
|
1147
|
-
function
|
|
1148
|
-
if ("length" in
|
|
1149
|
-
for (const d of
|
|
1150
|
-
d &&
|
|
1151
|
-
else "text" in
|
|
1144
|
+
function s(i) {
|
|
1145
|
+
if ("length" in i)
|
|
1146
|
+
for (const d of i)
|
|
1147
|
+
d && s(d);
|
|
1148
|
+
else "text" in i ? (n += `%c${i.text}`, e.push(i.style), i.data && t.push(...i.data)) : "data" in i && t.push(...i.data);
|
|
1152
1149
|
}
|
|
1153
|
-
r
|
|
1154
|
-
const
|
|
1155
|
-
return
|
|
1150
|
+
s(r);
|
|
1151
|
+
const o = [n, ...e];
|
|
1152
|
+
return o.push(...t), o;
|
|
1156
1153
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return
|
|
1154
|
+
function U(r) {
|
|
1155
|
+
return R(r, { color: "black" });
|
|
1159
1156
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1157
|
+
function P(r) {
|
|
1158
|
+
return R(rr(`${r}: `, 10), { color: "black", bold: !0 });
|
|
1162
1159
|
}
|
|
1163
|
-
function
|
|
1160
|
+
function R(r, e = {
|
|
1164
1161
|
color: "black"
|
|
1165
1162
|
}) {
|
|
1166
|
-
function t(
|
|
1167
|
-
return Object.entries(
|
|
1163
|
+
function t(s) {
|
|
1164
|
+
return Object.entries(s).reduce((o, [i, d]) => `${o}${i}:${d};`, "");
|
|
1168
1165
|
}
|
|
1169
1166
|
const n = {
|
|
1170
1167
|
color: e.color
|
|
1171
1168
|
};
|
|
1172
1169
|
return e.strikeThrough && (n["text-decoration"] = "line-through"), e.bold && (n["font-weight"] = "bold"), {
|
|
1173
|
-
text:
|
|
1170
|
+
text: r,
|
|
1174
1171
|
style: t(n)
|
|
1175
1172
|
};
|
|
1176
1173
|
}
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1174
|
+
function Z(r, e) {
|
|
1175
|
+
try {
|
|
1176
|
+
return Yt(r, e);
|
|
1177
|
+
} catch {
|
|
1178
|
+
return "[[???]]";
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
function Yt(r, e) {
|
|
1182
|
+
switch (typeof r) {
|
|
1179
1183
|
case "number":
|
|
1180
|
-
return "" +
|
|
1184
|
+
return "" + r;
|
|
1181
1185
|
case "string":
|
|
1182
|
-
return
|
|
1186
|
+
return r.length + 2 <= e ? `"${r}"` : `"${r.substr(0, e - 7)}"+...`;
|
|
1183
1187
|
case "boolean":
|
|
1184
|
-
return
|
|
1188
|
+
return r ? "true" : "false";
|
|
1185
1189
|
case "undefined":
|
|
1186
1190
|
return "undefined";
|
|
1187
1191
|
case "object":
|
|
1188
|
-
return
|
|
1192
|
+
return r === null ? "null" : Array.isArray(r) ? Qt(r, e) : er(r, e);
|
|
1189
1193
|
case "symbol":
|
|
1190
|
-
return
|
|
1194
|
+
return r.toString();
|
|
1191
1195
|
case "function":
|
|
1192
|
-
return `[[Function${
|
|
1196
|
+
return `[[Function${r.name ? " " + r.name : ""}]]`;
|
|
1193
1197
|
default:
|
|
1194
|
-
return "" +
|
|
1198
|
+
return "" + r;
|
|
1195
1199
|
}
|
|
1196
1200
|
}
|
|
1197
|
-
function
|
|
1201
|
+
function Qt(r, e) {
|
|
1198
1202
|
let t = "[ ", n = !0;
|
|
1199
|
-
for (const
|
|
1203
|
+
for (const s of r) {
|
|
1200
1204
|
if (n || (t += ", "), t.length - 5 > e) {
|
|
1201
1205
|
t += "...";
|
|
1202
1206
|
break;
|
|
1203
1207
|
}
|
|
1204
|
-
n = !1, t += `${
|
|
1208
|
+
n = !1, t += `${Z(s, e - t.length)}`;
|
|
1205
1209
|
}
|
|
1206
1210
|
return t += " ]", t;
|
|
1207
1211
|
}
|
|
1208
|
-
function
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
+
function er(r, e) {
|
|
1213
|
+
try {
|
|
1214
|
+
if (typeof r.toString == "function" && r.toString !== Object.prototype.toString) {
|
|
1215
|
+
const i = r.toString();
|
|
1216
|
+
return i.length <= e ? i : i.substring(0, e - 3) + "...";
|
|
1217
|
+
}
|
|
1218
|
+
} catch {
|
|
1219
|
+
return "[[Object]]";
|
|
1212
1220
|
}
|
|
1213
|
-
const t =
|
|
1214
|
-
let n = t ? t + "(" : "{ ",
|
|
1215
|
-
|
|
1216
|
-
|
|
1221
|
+
const t = Ge(r);
|
|
1222
|
+
let n = t ? t + "(" : "{ ", s = !0, o;
|
|
1223
|
+
try {
|
|
1224
|
+
o = Object.entries(r);
|
|
1225
|
+
} catch {
|
|
1226
|
+
return t ? `${t}(...)` : "[[Object]]";
|
|
1227
|
+
}
|
|
1228
|
+
for (const [i, d] of o) {
|
|
1229
|
+
if (s || (n += ", "), n.length - 5 > e) {
|
|
1217
1230
|
n += "...";
|
|
1218
1231
|
break;
|
|
1219
1232
|
}
|
|
1220
|
-
|
|
1233
|
+
s = !1, n += `${i}: ${Z(d, e - n.length)}`;
|
|
1221
1234
|
}
|
|
1222
1235
|
return n += t ? ")" : " }", n;
|
|
1223
1236
|
}
|
|
1224
|
-
function
|
|
1237
|
+
function tr(r, e) {
|
|
1225
1238
|
let t = "";
|
|
1226
1239
|
for (let n = 1; n <= e; n++)
|
|
1227
|
-
t +=
|
|
1240
|
+
t += r;
|
|
1228
1241
|
return t;
|
|
1229
1242
|
}
|
|
1230
|
-
function
|
|
1231
|
-
for (;
|
|
1232
|
-
|
|
1233
|
-
return
|
|
1234
|
-
}
|
|
1235
|
-
class ie {
|
|
1236
|
-
static createHost(e, t) {
|
|
1237
|
-
return new ie(e, t);
|
|
1238
|
-
}
|
|
1239
|
-
static createClient(e, t) {
|
|
1240
|
-
return new ie(e, t);
|
|
1241
|
-
}
|
|
1242
|
-
constructor(e, t) {
|
|
1243
|
-
this._channelFactory = e, this._getHandler = t, this._channel = this._channelFactory({
|
|
1244
|
-
handleNotification: (i) => {
|
|
1245
|
-
const o = i, d = this._getHandler().notifications[o[0]];
|
|
1246
|
-
if (!d)
|
|
1247
|
-
throw new Error(`Unknown notification "${o[0]}"!`);
|
|
1248
|
-
d(...o[1]);
|
|
1249
|
-
},
|
|
1250
|
-
handleRequest: (i) => {
|
|
1251
|
-
const o = i;
|
|
1252
|
-
try {
|
|
1253
|
-
return { type: "result", value: this._getHandler().requests[o[0]](...o[1]) };
|
|
1254
|
-
} catch (d) {
|
|
1255
|
-
return { type: "error", value: d };
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
});
|
|
1259
|
-
const n = new Proxy({}, {
|
|
1260
|
-
get: (i, o) => async (...d) => {
|
|
1261
|
-
const c = await this._channel.sendRequest([o, d]);
|
|
1262
|
-
if (c.type === "error")
|
|
1263
|
-
throw c.value;
|
|
1264
|
-
return c.value;
|
|
1265
|
-
}
|
|
1266
|
-
}), r = new Proxy({}, {
|
|
1267
|
-
get: (i, o) => (...d) => {
|
|
1268
|
-
this._channel.sendNotification([o, d]);
|
|
1269
|
-
}
|
|
1270
|
-
});
|
|
1271
|
-
this.api = { notifications: r, requests: n };
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
function dn(s, e) {
|
|
1275
|
-
const t = globalThis;
|
|
1276
|
-
let n = [], r;
|
|
1277
|
-
const { channel: i, handler: o } = cn({
|
|
1278
|
-
sendNotification: (c) => {
|
|
1279
|
-
r ? r.sendNotification(c) : n.push(c);
|
|
1280
|
-
}
|
|
1281
|
-
});
|
|
1282
|
-
let d;
|
|
1283
|
-
return (t.$$debugValueEditor_debugChannels ?? (t.$$debugValueEditor_debugChannels = {}))[s] = (c) => {
|
|
1284
|
-
d = e(), r = c;
|
|
1285
|
-
for (const h of n)
|
|
1286
|
-
c.sendNotification(h);
|
|
1287
|
-
return n = [], o;
|
|
1288
|
-
}, ie.createClient(i, () => {
|
|
1289
|
-
if (!d)
|
|
1290
|
-
throw new Error("Not supported");
|
|
1291
|
-
return d;
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
function cn(s) {
|
|
1295
|
-
let e;
|
|
1296
|
-
return {
|
|
1297
|
-
channel: (n) => (e = n, {
|
|
1298
|
-
sendNotification: (r) => {
|
|
1299
|
-
s.sendNotification(r);
|
|
1300
|
-
},
|
|
1301
|
-
sendRequest: (r) => {
|
|
1302
|
-
throw new Error("not supported");
|
|
1303
|
-
}
|
|
1304
|
-
}),
|
|
1305
|
-
handler: {
|
|
1306
|
-
handleRequest: (n) => n.type === "notification" ? e == null ? void 0 : e.handleNotification(n.data) : e == null ? void 0 : e.handleRequest(n.data)
|
|
1307
|
-
}
|
|
1308
|
-
};
|
|
1309
|
-
}
|
|
1310
|
-
class ln {
|
|
1311
|
-
constructor() {
|
|
1312
|
-
this._timeout = void 0;
|
|
1313
|
-
}
|
|
1314
|
-
throttle(e, t) {
|
|
1315
|
-
this._timeout === void 0 && (this._timeout = setTimeout(() => {
|
|
1316
|
-
this._timeout = void 0, e();
|
|
1317
|
-
}, t));
|
|
1318
|
-
}
|
|
1319
|
-
dispose() {
|
|
1320
|
-
this._timeout !== void 0 && clearTimeout(this._timeout);
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
function at(s, e) {
|
|
1324
|
-
for (const t in e)
|
|
1325
|
-
s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? at(s[t], e[t]) : s[t] = e[t];
|
|
1326
|
-
}
|
|
1327
|
-
function dt(s, e) {
|
|
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" ? dt(s[t], e[t]) : s[t] = e[t];
|
|
1330
|
-
}
|
|
1331
|
-
class U {
|
|
1332
|
-
static getInstance() {
|
|
1333
|
-
return U._instance === void 0 && (U._instance = new U()), U._instance;
|
|
1334
|
-
}
|
|
1335
|
-
getTransactionState() {
|
|
1336
|
-
const e = [], t = [...this._activeTransactions];
|
|
1337
|
-
if (t.length === 0)
|
|
1338
|
-
return;
|
|
1339
|
-
const n = t.flatMap((i) => i.debugGetUpdatingObservers() ?? []).map((i) => i.observer), r = /* @__PURE__ */ new Set();
|
|
1340
|
-
for (; n.length > 0; ) {
|
|
1341
|
-
const i = n.shift();
|
|
1342
|
-
if (r.has(i))
|
|
1343
|
-
continue;
|
|
1344
|
-
r.add(i);
|
|
1345
|
-
const o = this._getInfo(i, (d) => {
|
|
1346
|
-
r.has(d) || n.push(d);
|
|
1347
|
-
});
|
|
1348
|
-
o && e.push(o);
|
|
1349
|
-
}
|
|
1350
|
-
return { names: t.map((i) => i.getDebugName() ?? "tx"), affected: e };
|
|
1351
|
-
}
|
|
1352
|
-
_getObservableInfo(e) {
|
|
1353
|
-
const t = this._instanceInfos.get(e);
|
|
1354
|
-
if (!t) {
|
|
1355
|
-
pe(new I("No info found"));
|
|
1356
|
-
return;
|
|
1357
|
-
}
|
|
1358
|
-
return t;
|
|
1359
|
-
}
|
|
1360
|
-
_getAutorunInfo(e) {
|
|
1361
|
-
const t = this._instanceInfos.get(e);
|
|
1362
|
-
if (!t) {
|
|
1363
|
-
pe(new I("No info found"));
|
|
1364
|
-
return;
|
|
1365
|
-
}
|
|
1366
|
-
return t;
|
|
1367
|
-
}
|
|
1368
|
-
_getInfo(e, t) {
|
|
1369
|
-
if (e instanceof w) {
|
|
1370
|
-
const n = [...e.debugGetObservers()];
|
|
1371
|
-
for (const c of n)
|
|
1372
|
-
t(c);
|
|
1373
|
-
const r = this._getObservableInfo(e);
|
|
1374
|
-
if (!r)
|
|
1375
|
-
return;
|
|
1376
|
-
const i = e.debugGetState(), o = { name: e.debugName, instanceId: r.instanceId, updateCount: i.updateCount }, d = [...r.changedObservables].map((c) => {
|
|
1377
|
-
var h;
|
|
1378
|
-
return (h = this._instanceInfos.get(c)) == null ? void 0 : h.instanceId;
|
|
1379
|
-
}).filter(Q);
|
|
1380
|
-
if (i.isComputing)
|
|
1381
|
-
return { ...o, type: "observable/derived", state: "updating", changedDependencies: d, initialComputation: !1 };
|
|
1382
|
-
switch (i.state) {
|
|
1383
|
-
case 0:
|
|
1384
|
-
return { ...o, type: "observable/derived", state: "noValue" };
|
|
1385
|
-
case 3:
|
|
1386
|
-
return { ...o, type: "observable/derived", state: "upToDate" };
|
|
1387
|
-
case 2:
|
|
1388
|
-
return { ...o, type: "observable/derived", state: "stale", changedDependencies: d };
|
|
1389
|
-
case 1:
|
|
1390
|
-
return { ...o, type: "observable/derived", state: "possiblyStale" };
|
|
1391
|
-
}
|
|
1392
|
-
} else if (e instanceof se) {
|
|
1393
|
-
const n = this._getAutorunInfo(e);
|
|
1394
|
-
if (!n)
|
|
1395
|
-
return;
|
|
1396
|
-
const r = { name: e.debugName, instanceId: n.instanceId, updateCount: n.updateCount }, i = [...n.changedObservables].map((o) => this._instanceInfos.get(o).instanceId);
|
|
1397
|
-
if (e.debugGetState().isRunning)
|
|
1398
|
-
return { ...r, type: "autorun", state: "updating", changedDependencies: i };
|
|
1399
|
-
switch (e.debugGetState().state) {
|
|
1400
|
-
case 3:
|
|
1401
|
-
return { ...r, type: "autorun", state: "upToDate" };
|
|
1402
|
-
case 2:
|
|
1403
|
-
return { ...r, type: "autorun", state: "stale", changedDependencies: i };
|
|
1404
|
-
case 1:
|
|
1405
|
-
return { ...r, type: "autorun", state: "possiblyStale" };
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
_formatObservable(e) {
|
|
1410
|
-
const t = this._getObservableInfo(e);
|
|
1411
|
-
if (t)
|
|
1412
|
-
return { name: e.debugName, instanceId: t.instanceId };
|
|
1413
|
-
}
|
|
1414
|
-
_formatObserver(e) {
|
|
1415
|
-
var n;
|
|
1416
|
-
if (e instanceof w)
|
|
1417
|
-
return { name: e.toString(), instanceId: (n = this._getObservableInfo(e)) == null ? void 0 : n.instanceId };
|
|
1418
|
-
const t = this._getAutorunInfo(e);
|
|
1419
|
-
if (t)
|
|
1420
|
-
return { name: e.toString(), instanceId: t.instanceId };
|
|
1421
|
-
}
|
|
1422
|
-
constructor() {
|
|
1423
|
-
this._declarationId = 0, this._instanceId = 0, this._declarations = /* @__PURE__ */ new Map(), this._instanceInfos = /* @__PURE__ */ new WeakMap(), this._aliveInstances = /* @__PURE__ */ new Map(), this._activeTransactions = /* @__PURE__ */ new Set(), this._channel = dn("observableDevTools", () => ({
|
|
1424
|
-
notifications: {
|
|
1425
|
-
setDeclarationIdFilter: (e) => {
|
|
1426
|
-
},
|
|
1427
|
-
logObservableValue: (e) => {
|
|
1428
|
-
console.log("logObservableValue", e);
|
|
1429
|
-
},
|
|
1430
|
-
flushUpdates: () => {
|
|
1431
|
-
this._flushUpdates();
|
|
1432
|
-
},
|
|
1433
|
-
resetUpdates: () => {
|
|
1434
|
-
this._pendingChanges = null, this._channel.api.notifications.handleChange(this._fullState, !0);
|
|
1435
|
-
}
|
|
1436
|
-
},
|
|
1437
|
-
requests: {
|
|
1438
|
-
getDeclarations: () => {
|
|
1439
|
-
const e = {};
|
|
1440
|
-
for (const t of this._declarations.values())
|
|
1441
|
-
e[t.id] = t;
|
|
1442
|
-
return { decls: e };
|
|
1443
|
-
},
|
|
1444
|
-
getSummarizedInstances: () => null,
|
|
1445
|
-
getObservableValueInfo: (e) => ({
|
|
1446
|
-
observers: [...this._aliveInstances.get(e).debugGetObservers()].map((n) => this._formatObserver(n)).filter(Q)
|
|
1447
|
-
}),
|
|
1448
|
-
getDerivedInfo: (e) => {
|
|
1449
|
-
const t = this._aliveInstances.get(e);
|
|
1450
|
-
return {
|
|
1451
|
-
dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(Q),
|
|
1452
|
-
observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(Q)
|
|
1453
|
-
};
|
|
1454
|
-
},
|
|
1455
|
-
getAutorunInfo: (e) => ({
|
|
1456
|
-
dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(Q)
|
|
1457
|
-
}),
|
|
1458
|
-
getTransactionState: () => this.getTransactionState(),
|
|
1459
|
-
setValue: (e, t) => {
|
|
1460
|
-
const n = this._aliveInstances.get(e);
|
|
1461
|
-
if (n instanceof w)
|
|
1462
|
-
n.debugSetValue(t);
|
|
1463
|
-
else if (n instanceof re)
|
|
1464
|
-
n.debugSetValue(t);
|
|
1465
|
-
else if (n instanceof F)
|
|
1466
|
-
n.debugSetValue(t);
|
|
1467
|
-
else
|
|
1468
|
-
throw new I("Observable is not supported");
|
|
1469
|
-
const r = [...n.debugGetObservers()];
|
|
1470
|
-
for (const i of r)
|
|
1471
|
-
i.beginUpdate(n);
|
|
1472
|
-
for (const i of r)
|
|
1473
|
-
i.handleChange(n, void 0);
|
|
1474
|
-
for (const i of r)
|
|
1475
|
-
i.endUpdate(n);
|
|
1476
|
-
},
|
|
1477
|
-
getValue: (e) => {
|
|
1478
|
-
const t = this._aliveInstances.get(e);
|
|
1479
|
-
if (t instanceof w)
|
|
1480
|
-
return k(t.debugGetState().value, 200);
|
|
1481
|
-
if (t instanceof re)
|
|
1482
|
-
return k(t.debugGetState().value, 200);
|
|
1483
|
-
},
|
|
1484
|
-
logValue: (e) => {
|
|
1485
|
-
const t = this._aliveInstances.get(e);
|
|
1486
|
-
if (t && "get" in t)
|
|
1487
|
-
console.log("Logged Value:", t.get());
|
|
1488
|
-
else
|
|
1489
|
-
throw new I("Observable is not supported");
|
|
1490
|
-
},
|
|
1491
|
-
rerun: (e) => {
|
|
1492
|
-
const t = this._aliveInstances.get(e);
|
|
1493
|
-
if (t instanceof w)
|
|
1494
|
-
t.debugRecompute();
|
|
1495
|
-
else if (t instanceof se)
|
|
1496
|
-
t.debugRerun();
|
|
1497
|
-
else
|
|
1498
|
-
throw new I("Observable is not supported");
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
})), this._pendingChanges = null, this._changeThrottler = new ln(), this._fullState = {}, this._flushUpdates = () => {
|
|
1502
|
-
this._pendingChanges !== null && (this._channel.api.notifications.handleChange(this._pendingChanges, !1), this._pendingChanges = null);
|
|
1503
|
-
}, T.enable();
|
|
1504
|
-
}
|
|
1505
|
-
_handleChange(e) {
|
|
1506
|
-
dt(this._fullState, e), this._pendingChanges === null ? this._pendingChanges = e : at(this._pendingChanges, e), this._changeThrottler.throttle(this._flushUpdates, 10);
|
|
1507
|
-
}
|
|
1508
|
-
_getDeclarationId(e, t) {
|
|
1509
|
-
if (!t)
|
|
1510
|
-
return -1;
|
|
1511
|
-
let n = this._declarations.get(t.id);
|
|
1512
|
-
return n === void 0 && (n = {
|
|
1513
|
-
id: this._declarationId++,
|
|
1514
|
-
type: e,
|
|
1515
|
-
url: t.fileName,
|
|
1516
|
-
line: t.line,
|
|
1517
|
-
column: t.column
|
|
1518
|
-
}, this._declarations.set(t.id, n), this._handleChange({ decls: { [n.id]: n } })), n.id;
|
|
1519
|
-
}
|
|
1520
|
-
handleObservableCreated(e, t) {
|
|
1521
|
-
const r = {
|
|
1522
|
-
declarationId: this._getDeclarationId("observable/value", t),
|
|
1523
|
-
instanceId: this._instanceId++,
|
|
1524
|
-
listenerCount: 0,
|
|
1525
|
-
lastValue: void 0,
|
|
1526
|
-
updateCount: 0,
|
|
1527
|
-
changedObservables: /* @__PURE__ */ new Set()
|
|
1528
|
-
};
|
|
1529
|
-
this._instanceInfos.set(e, r);
|
|
1530
|
-
}
|
|
1531
|
-
handleOnListenerCountChanged(e, t) {
|
|
1532
|
-
const n = this._getObservableInfo(e);
|
|
1533
|
-
if (n) {
|
|
1534
|
-
if (n.listenerCount === 0 && t > 0) {
|
|
1535
|
-
const r = e instanceof w ? "observable/derived" : "observable/value";
|
|
1536
|
-
this._aliveInstances.set(n.instanceId, e), this._handleChange({
|
|
1537
|
-
instances: {
|
|
1538
|
-
[n.instanceId]: {
|
|
1539
|
-
instanceId: n.instanceId,
|
|
1540
|
-
declarationId: n.declarationId,
|
|
1541
|
-
formattedValue: n.lastValue,
|
|
1542
|
-
type: r,
|
|
1543
|
-
name: e.debugName
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
});
|
|
1547
|
-
} else n.listenerCount > 0 && t === 0 && (this._handleChange({
|
|
1548
|
-
instances: { [n.instanceId]: null }
|
|
1549
|
-
}), this._aliveInstances.delete(n.instanceId));
|
|
1550
|
-
n.listenerCount = t;
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
handleObservableUpdated(e, t) {
|
|
1554
|
-
if (e instanceof w) {
|
|
1555
|
-
this._handleDerivedRecomputed(e, t);
|
|
1556
|
-
return;
|
|
1557
|
-
}
|
|
1558
|
-
const n = this._getObservableInfo(e);
|
|
1559
|
-
n && t.didChange && (n.lastValue = k(t.newValue, 30), n.listenerCount > 0 && this._handleChange({
|
|
1560
|
-
instances: { [n.instanceId]: { formattedValue: n.lastValue } }
|
|
1561
|
-
}));
|
|
1562
|
-
}
|
|
1563
|
-
handleAutorunCreated(e, t) {
|
|
1564
|
-
const r = {
|
|
1565
|
-
declarationId: this._getDeclarationId("autorun", t),
|
|
1566
|
-
instanceId: this._instanceId++,
|
|
1567
|
-
updateCount: 0,
|
|
1568
|
-
changedObservables: /* @__PURE__ */ new Set()
|
|
1569
|
-
};
|
|
1570
|
-
this._instanceInfos.set(e, r), this._aliveInstances.set(r.instanceId, e), r && this._handleChange({
|
|
1571
|
-
instances: {
|
|
1572
|
-
[r.instanceId]: {
|
|
1573
|
-
instanceId: r.instanceId,
|
|
1574
|
-
declarationId: r.declarationId,
|
|
1575
|
-
runCount: 0,
|
|
1576
|
-
type: "autorun",
|
|
1577
|
-
name: e.debugName
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
});
|
|
1581
|
-
}
|
|
1582
|
-
handleAutorunDisposed(e) {
|
|
1583
|
-
const t = this._getAutorunInfo(e);
|
|
1584
|
-
t && (this._handleChange({
|
|
1585
|
-
instances: { [t.instanceId]: null }
|
|
1586
|
-
}), this._instanceInfos.delete(e), this._aliveInstances.delete(t.instanceId));
|
|
1587
|
-
}
|
|
1588
|
-
handleAutorunDependencyChanged(e, t, n) {
|
|
1589
|
-
const r = this._getAutorunInfo(e);
|
|
1590
|
-
r && r.changedObservables.add(t);
|
|
1591
|
-
}
|
|
1592
|
-
handleAutorunStarted(e) {
|
|
1593
|
-
}
|
|
1594
|
-
handleAutorunFinished(e) {
|
|
1595
|
-
const t = this._getAutorunInfo(e);
|
|
1596
|
-
t && (t.changedObservables.clear(), t.updateCount++, this._handleChange({
|
|
1597
|
-
instances: { [t.instanceId]: { runCount: t.updateCount } }
|
|
1598
|
-
}));
|
|
1599
|
-
}
|
|
1600
|
-
handleDerivedDependencyChanged(e, t, n) {
|
|
1601
|
-
const r = this._getObservableInfo(e);
|
|
1602
|
-
r && r.changedObservables.add(t);
|
|
1603
|
-
}
|
|
1604
|
-
_handleDerivedRecomputed(e, t) {
|
|
1605
|
-
const n = this._getObservableInfo(e);
|
|
1606
|
-
if (!n)
|
|
1607
|
-
return;
|
|
1608
|
-
const r = k(t.newValue, 30);
|
|
1609
|
-
n.updateCount++, n.changedObservables.clear(), n.lastValue = r, n.listenerCount > 0 && this._handleChange({
|
|
1610
|
-
instances: { [n.instanceId]: { formattedValue: r, recomputationCount: n.updateCount } }
|
|
1611
|
-
});
|
|
1612
|
-
}
|
|
1613
|
-
handleDerivedCleared(e) {
|
|
1614
|
-
const t = this._getObservableInfo(e);
|
|
1615
|
-
t && (t.lastValue = void 0, t.changedObservables.clear(), t.listenerCount > 0 && this._handleChange({
|
|
1616
|
-
instances: {
|
|
1617
|
-
[t.instanceId]: {
|
|
1618
|
-
formattedValue: void 0
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
}));
|
|
1622
|
-
}
|
|
1623
|
-
handleBeginTransaction(e) {
|
|
1624
|
-
this._activeTransactions.add(e);
|
|
1625
|
-
}
|
|
1626
|
-
handleEndTransaction(e) {
|
|
1627
|
-
this._activeTransactions.delete(e);
|
|
1628
|
-
}
|
|
1243
|
+
function rr(r, e) {
|
|
1244
|
+
for (; r.length < e; )
|
|
1245
|
+
r += " ";
|
|
1246
|
+
return r;
|
|
1629
1247
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
return n ? ct(n, 0, /* @__PURE__ */ new Set()).trim() : "";
|
|
1248
|
+
function nr(r, e) {
|
|
1249
|
+
const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((o) => o), n = T.from(r, t);
|
|
1250
|
+
return n ? nt(n, 0, /* @__PURE__ */ new Set()).trim() : "";
|
|
1634
1251
|
}
|
|
1635
|
-
function
|
|
1636
|
-
const n = " ".repeat(e),
|
|
1637
|
-
if (t.has(
|
|
1638
|
-
return
|
|
1252
|
+
function nt(r, e, t) {
|
|
1253
|
+
const n = " ".repeat(e), s = [];
|
|
1254
|
+
if (t.has(r.sourceObj))
|
|
1255
|
+
return s.push(`${n}* ${r.type} ${r.name} (already listed)`), s.join(`
|
|
1639
1256
|
`);
|
|
1640
|
-
if (t.add(
|
|
1641
|
-
|
|
1642
|
-
for (const
|
|
1643
|
-
|
|
1257
|
+
if (t.add(r.sourceObj), s.push(`${n}* ${r.type} ${r.name}:`), s.push(`${n} value: ${Z(r.value, 50)}`), s.push(`${n} state: ${r.state}`), r.dependencies.length > 0) {
|
|
1258
|
+
s.push(`${n} dependencies:`);
|
|
1259
|
+
for (const i of r.dependencies)
|
|
1260
|
+
s.push(nt(i, e + 1, t));
|
|
1644
1261
|
}
|
|
1645
|
-
return
|
|
1262
|
+
return s.join(`
|
|
1646
1263
|
`);
|
|
1647
1264
|
}
|
|
1648
|
-
class
|
|
1265
|
+
class T {
|
|
1649
1266
|
static from(e, t) {
|
|
1650
|
-
if (e instanceof
|
|
1267
|
+
if (e instanceof Xe) {
|
|
1651
1268
|
const n = e.debugGetState();
|
|
1652
|
-
return new
|
|
1653
|
-
} else if (e instanceof
|
|
1269
|
+
return new T(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((s) => T.from(s, t) || T.unknown(s)));
|
|
1270
|
+
} else if (e instanceof j) {
|
|
1654
1271
|
const n = e.debugGetState();
|
|
1655
|
-
return new
|
|
1656
|
-
} else if (e instanceof
|
|
1272
|
+
return new T(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((s) => T.from(s, t) || T.unknown(s)));
|
|
1273
|
+
} else if (e instanceof tt) {
|
|
1657
1274
|
const n = e.debugGetState();
|
|
1658
|
-
return new
|
|
1659
|
-
} else if (e instanceof
|
|
1275
|
+
return new T(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
|
|
1276
|
+
} else if (e instanceof L) {
|
|
1660
1277
|
const n = e.debugGetState();
|
|
1661
|
-
return new
|
|
1278
|
+
return new T(e, t(e.debugName), "fromEvent", n.value, n.hasValue ? "upToDate" : "initial", []);
|
|
1662
1279
|
}
|
|
1663
1280
|
}
|
|
1664
1281
|
static unknown(e) {
|
|
1665
|
-
return new
|
|
1282
|
+
return new T(e, "(unknown)", "unknown", void 0, "unknown", []);
|
|
1666
1283
|
}
|
|
1667
|
-
constructor(e, t, n,
|
|
1668
|
-
this.sourceObj = e, this.name = t, this.type = n, this.value =
|
|
1284
|
+
constructor(e, t, n, s, o, i) {
|
|
1285
|
+
this.sourceObj = e, this.name = t, this.type = n, this.value = s, this.state = o, this.dependencies = i;
|
|
1669
1286
|
}
|
|
1670
1287
|
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
class lt {
|
|
1288
|
+
$t(nr);
|
|
1289
|
+
kt(Jt);
|
|
1290
|
+
class sr {
|
|
1675
1291
|
constructor() {
|
|
1676
|
-
l(this, "_fixtures",
|
|
1292
|
+
l(this, "_fixtures", x(this, /* @__PURE__ */ new Map()));
|
|
1677
1293
|
/** Observable root of the fixture tree */
|
|
1678
1294
|
l(this, "root", N(this, (e) => {
|
|
1679
1295
|
const t = this._fixtures.read(e);
|
|
1680
|
-
return
|
|
1296
|
+
return oe(t);
|
|
1681
1297
|
}));
|
|
1682
1298
|
}
|
|
1683
1299
|
/**
|
|
@@ -1708,18 +1324,18 @@ class lt {
|
|
|
1708
1324
|
*/
|
|
1709
1325
|
getNode(e, t) {
|
|
1710
1326
|
const n = this.root.read(e);
|
|
1711
|
-
return
|
|
1327
|
+
return Oe(n, t);
|
|
1712
1328
|
}
|
|
1713
1329
|
/**
|
|
1714
1330
|
* Gets a component by path (non-reactive, for use in preview iframe).
|
|
1715
1331
|
* @param path Array of path segments (e.g., ['Button', 'Primary'])
|
|
1716
1332
|
*/
|
|
1717
1333
|
getComponentByPath(e) {
|
|
1718
|
-
const t = this._fixtures.get(), n =
|
|
1719
|
-
return
|
|
1334
|
+
const t = this._fixtures.get(), n = oe(t), s = Oe(n, e);
|
|
1335
|
+
return s == null ? void 0 : s.component;
|
|
1720
1336
|
}
|
|
1721
1337
|
}
|
|
1722
|
-
class
|
|
1338
|
+
class kn {
|
|
1723
1339
|
constructor(e, t) {
|
|
1724
1340
|
l(this, "sessionId", Math.random().toString(36).slice(2));
|
|
1725
1341
|
l(this, "_updateVersion", 0);
|
|
@@ -1746,65 +1362,71 @@ class Ts {
|
|
|
1746
1362
|
return this._flattenFixtures(this._root);
|
|
1747
1363
|
}
|
|
1748
1364
|
async renderFixture(e) {
|
|
1365
|
+
var C;
|
|
1749
1366
|
const t = this._findFixtureNode(this._root, e);
|
|
1750
1367
|
if (!t || !t.component)
|
|
1751
1368
|
throw new Error("Fixture not found: " + e);
|
|
1752
|
-
this._currentDisposable &&
|
|
1369
|
+
(C = this._currentDisposable) != null && C.dispose && this._currentDisposable.dispose(), this._currentDisposable = void 0, this._currentContainer && (this._currentContainer.remove(), this._currentContainer = void 0);
|
|
1753
1370
|
const n = document.createElement("div");
|
|
1754
1371
|
n.style.display = "inline-block", this._containerElement.appendChild(n), this._currentContainer = n;
|
|
1755
|
-
const
|
|
1756
|
-
let
|
|
1757
|
-
if (
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1372
|
+
const s = t.component, o = Rt(s.properties);
|
|
1373
|
+
let i = n;
|
|
1374
|
+
if (s.isolation === "shadow-dom") {
|
|
1375
|
+
const m = n.attachShadow({ mode: "open" });
|
|
1376
|
+
i = document.createElement("div"), m.appendChild(i);
|
|
1760
1377
|
}
|
|
1761
1378
|
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:
|
|
1379
|
+
console.error = (...m) => {
|
|
1380
|
+
d.push({ kind: "console", level: "error", message: m.map(String).join(" ") }), c.apply(console, m);
|
|
1381
|
+
}, console.warn = (...m) => {
|
|
1382
|
+
d.push({ kind: "console", level: "warn", message: m.map(String).join(" ") }), h.apply(console, m);
|
|
1766
1383
|
};
|
|
1767
|
-
const
|
|
1768
|
-
var
|
|
1769
|
-
d.push({ kind: "exception", message:
|
|
1770
|
-
},
|
|
1771
|
-
const
|
|
1772
|
-
d.push({ kind: "exception", message:
|
|
1384
|
+
const g = (m) => {
|
|
1385
|
+
var v;
|
|
1386
|
+
d.push({ kind: "exception", message: m.message, stack: (v = m.error) == null ? void 0 : v.stack });
|
|
1387
|
+
}, _ = (m) => {
|
|
1388
|
+
const v = m.reason, O = v instanceof Error ? v.message : String(v), S = v instanceof Error ? v.stack : void 0;
|
|
1389
|
+
d.push({ kind: "exception", message: O, stack: S });
|
|
1773
1390
|
};
|
|
1774
|
-
window.addEventListener("error",
|
|
1391
|
+
window.addEventListener("error", g), window.addEventListener("unhandledrejection", _);
|
|
1775
1392
|
try {
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1393
|
+
const m = new AbortController();
|
|
1394
|
+
let v = s.render(i, {
|
|
1395
|
+
props: o,
|
|
1396
|
+
signal: m.signal
|
|
1397
|
+
});
|
|
1398
|
+
v instanceof Promise && (v = await v), this._currentDisposable = v ?? void 0, v != null && v.ready && await v.ready;
|
|
1399
|
+
} catch (m) {
|
|
1400
|
+
const v = m instanceof Error ? m : new Error(String(m));
|
|
1401
|
+
d.push({ kind: "exception", message: v.message, stack: v.stack });
|
|
1781
1402
|
} finally {
|
|
1782
1403
|
console.error = c, console.warn = h;
|
|
1783
1404
|
}
|
|
1784
|
-
return await new Promise((
|
|
1405
|
+
return await new Promise((m) => requestAnimationFrame(() => requestAnimationFrame(() => m()))), window.removeEventListener("error", g), window.removeEventListener("unhandledrejection", _), { errors: d };
|
|
1785
1406
|
}
|
|
1786
1407
|
_buildRegistry() {
|
|
1787
1408
|
const e = /* @__PURE__ */ new Map();
|
|
1788
1409
|
for (const [t, n] of Object.entries(this._fixtureModules)) {
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1410
|
+
const s = n.default;
|
|
1411
|
+
s && typeof s == "object" && e.set(t, s);
|
|
1791
1412
|
}
|
|
1792
|
-
return
|
|
1413
|
+
return oe(e);
|
|
1793
1414
|
}
|
|
1794
1415
|
_flattenFixtures(e, t = []) {
|
|
1416
|
+
var s;
|
|
1795
1417
|
const n = [];
|
|
1796
|
-
e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t });
|
|
1797
|
-
for (const
|
|
1418
|
+
e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((s = e.component) == null ? void 0 : s.background) ?? "light" });
|
|
1419
|
+
for (const o of e.children ?? []) {
|
|
1798
1420
|
const i = e.id ? [...t, e.name] : t;
|
|
1799
|
-
n.push(...this._flattenFixtures(
|
|
1421
|
+
n.push(...this._flattenFixtures(o, i));
|
|
1800
1422
|
}
|
|
1801
1423
|
return n;
|
|
1802
1424
|
}
|
|
1803
1425
|
_findFixtureNode(e, t) {
|
|
1804
1426
|
if (e.id === t) return e;
|
|
1805
1427
|
for (const n of e.children ?? []) {
|
|
1806
|
-
const
|
|
1807
|
-
if (
|
|
1428
|
+
const s = this._findFixtureNode(n, t);
|
|
1429
|
+
if (s) return s;
|
|
1808
1430
|
}
|
|
1809
1431
|
}
|
|
1810
1432
|
_installGlobalApi() {
|
|
@@ -1820,7 +1442,7 @@ class Ts {
|
|
|
1820
1442
|
});
|
|
1821
1443
|
}
|
|
1822
1444
|
}
|
|
1823
|
-
class
|
|
1445
|
+
class or {
|
|
1824
1446
|
constructor(e) {
|
|
1825
1447
|
this._run = e, this._changes = [], this._map = /* @__PURE__ */ new Map(), this._updateCounter = 0;
|
|
1826
1448
|
}
|
|
@@ -1846,49 +1468,49 @@ class un {
|
|
|
1846
1468
|
handleChange(e, t) {
|
|
1847
1469
|
}
|
|
1848
1470
|
}
|
|
1849
|
-
function
|
|
1850
|
-
return
|
|
1471
|
+
function u() {
|
|
1472
|
+
return ce.instance;
|
|
1851
1473
|
}
|
|
1852
|
-
function
|
|
1853
|
-
return
|
|
1474
|
+
function ir() {
|
|
1475
|
+
return le.instance;
|
|
1854
1476
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return
|
|
1477
|
+
function ar() {
|
|
1478
|
+
return he.instance;
|
|
1857
1479
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
class
|
|
1480
|
+
u.const = ir;
|
|
1481
|
+
u.obs = ar;
|
|
1482
|
+
class ce {
|
|
1861
1483
|
create(e) {
|
|
1862
1484
|
const t = N((n) => e(n));
|
|
1863
1485
|
return { read: (n) => t };
|
|
1864
1486
|
}
|
|
1865
1487
|
}
|
|
1866
|
-
|
|
1867
|
-
class
|
|
1488
|
+
ce.instance = new ce();
|
|
1489
|
+
class le {
|
|
1868
1490
|
create(e) {
|
|
1869
1491
|
const t = N((n) => e(n));
|
|
1870
1492
|
return { read: (n) => t.read(n) };
|
|
1871
1493
|
}
|
|
1872
1494
|
}
|
|
1873
|
-
|
|
1874
|
-
class
|
|
1495
|
+
le.instance = new le();
|
|
1496
|
+
class he {
|
|
1875
1497
|
create(e) {
|
|
1876
1498
|
const t = N((n) => {
|
|
1877
|
-
const
|
|
1878
|
-
return
|
|
1499
|
+
const s = e(n);
|
|
1500
|
+
return dr(s) ? s.read(n) : s;
|
|
1879
1501
|
});
|
|
1880
1502
|
return { read: (n) => t };
|
|
1881
1503
|
}
|
|
1882
1504
|
}
|
|
1883
|
-
|
|
1884
|
-
function
|
|
1885
|
-
return typeof
|
|
1505
|
+
he.instance = new he();
|
|
1506
|
+
function dr(r) {
|
|
1507
|
+
return typeof r == "object" && r !== null && "read" in r;
|
|
1886
1508
|
}
|
|
1887
|
-
function K(
|
|
1888
|
-
return Object.fromEntries(Object.entries(
|
|
1509
|
+
function K(r, e) {
|
|
1510
|
+
return Object.fromEntries(Object.entries(r).map(([t, n]) => [t, e(n, t)]));
|
|
1889
1511
|
}
|
|
1890
|
-
const
|
|
1891
|
-
class
|
|
1512
|
+
const ne = Symbol("ViewModelContext");
|
|
1513
|
+
class cr {
|
|
1892
1514
|
constructor(e) {
|
|
1893
1515
|
this._store = new Y(), this.props = e;
|
|
1894
1516
|
}
|
|
@@ -1896,35 +1518,35 @@ class mn {
|
|
|
1896
1518
|
this._store.dispose();
|
|
1897
1519
|
}
|
|
1898
1520
|
}
|
|
1899
|
-
function
|
|
1900
|
-
return
|
|
1521
|
+
function lr(r) {
|
|
1522
|
+
return r[ne] || (r[ne] = Ue(void 0)), r[ne];
|
|
1901
1523
|
}
|
|
1902
|
-
function
|
|
1524
|
+
function F(r = {}) {
|
|
1903
1525
|
var e;
|
|
1904
|
-
return e = class extends
|
|
1905
|
-
}, e._props =
|
|
1526
|
+
return e = class extends cr {
|
|
1527
|
+
}, e._props = r, e;
|
|
1906
1528
|
}
|
|
1907
|
-
let
|
|
1908
|
-
const
|
|
1909
|
-
for (const e of
|
|
1529
|
+
let ue = 0;
|
|
1530
|
+
const hr = new or((r) => {
|
|
1531
|
+
for (const e of r)
|
|
1910
1532
|
e.rendered = !1;
|
|
1911
|
-
if (
|
|
1912
|
-
const e =
|
|
1913
|
-
e.itemsToRender =
|
|
1533
|
+
if (ue > 0) {
|
|
1534
|
+
const e = r.find((t) => t.isRendering);
|
|
1535
|
+
e.itemsToRender = r;
|
|
1914
1536
|
} else
|
|
1915
|
-
|
|
1916
|
-
for (const e of
|
|
1537
|
+
Pe(() => {
|
|
1538
|
+
for (const e of r)
|
|
1917
1539
|
e.rendered || e.forceUpdate();
|
|
1918
1540
|
});
|
|
1919
1541
|
});
|
|
1920
|
-
let
|
|
1921
|
-
class
|
|
1542
|
+
let ur = 0;
|
|
1543
|
+
class fr {
|
|
1922
1544
|
constructor(e, t) {
|
|
1923
1545
|
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
1546
|
var n;
|
|
1925
1547
|
(n = this._disposable) == null || n.dispose();
|
|
1926
1548
|
}, this.itemsToRender = [], this.handleAfterRender = () => {
|
|
1927
|
-
|
|
1549
|
+
Pe(() => {
|
|
1928
1550
|
for (const n of this.itemsToRender)
|
|
1929
1551
|
n.rendered || n.forceUpdate();
|
|
1930
1552
|
}), this.itemsToRender = [];
|
|
@@ -1934,135 +1556,139 @@ class yn {
|
|
|
1934
1556
|
return this.debugName;
|
|
1935
1557
|
}
|
|
1936
1558
|
updateProps(e) {
|
|
1937
|
-
this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps =
|
|
1559
|
+
this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = x(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = N(this, this._render), this._disposable = hr.addDependency(this.rendering, this));
|
|
1938
1560
|
}
|
|
1939
1561
|
}
|
|
1940
|
-
function
|
|
1941
|
-
const n = (
|
|
1942
|
-
const d =
|
|
1562
|
+
function xe(r, e, t) {
|
|
1563
|
+
const n = (i) => i + 1, s = () => new fr(r + ++ur, e), o = function(i) {
|
|
1564
|
+
const d = bt(n, 0)[1], c = yt(s)[0];
|
|
1943
1565
|
for (const h of t ?? [])
|
|
1944
|
-
c.contextValues.set(h,
|
|
1945
|
-
if (
|
|
1566
|
+
c.contextValues.set(h, xt(h));
|
|
1567
|
+
if (Te(c.cleanupEffect, []), Te(c.handleAfterRender), c.isRendering)
|
|
1946
1568
|
throw new Error("Component is already rendering");
|
|
1947
|
-
c.isRendering = !0,
|
|
1569
|
+
c.isRendering = !0, ue++;
|
|
1948
1570
|
try {
|
|
1949
|
-
c.forceUpdate = d, c.updateProps(
|
|
1571
|
+
c.forceUpdate = d, c.updateProps(i);
|
|
1950
1572
|
const h = c.rendering.get();
|
|
1951
1573
|
return c.rendered = !0, h;
|
|
1952
1574
|
} finally {
|
|
1953
|
-
c.isRendering = !1,
|
|
1575
|
+
c.isRendering = !1, ue--;
|
|
1954
1576
|
}
|
|
1955
1577
|
};
|
|
1956
|
-
return
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
function
|
|
1960
|
-
return
|
|
1961
|
-
const n = K(
|
|
1962
|
-
return (
|
|
1963
|
-
const
|
|
1964
|
-
return e(
|
|
1578
|
+
return o.displayName = r, o;
|
|
1579
|
+
}
|
|
1580
|
+
xe("ObsView", (r) => (e) => r.read(e).children(e));
|
|
1581
|
+
function I(r, e) {
|
|
1582
|
+
return xe("view", (t) => {
|
|
1583
|
+
const n = K(r, (s, o) => s.create((i) => t.read(i)[o], void 0));
|
|
1584
|
+
return (s) => {
|
|
1585
|
+
const o = K(n, (i) => i.read(s));
|
|
1586
|
+
return e(s, o);
|
|
1965
1587
|
};
|
|
1966
1588
|
});
|
|
1967
1589
|
}
|
|
1968
|
-
function
|
|
1590
|
+
function pr(r) {
|
|
1969
1591
|
const e = [];
|
|
1970
|
-
for (const t of Object.values(
|
|
1592
|
+
for (const t of Object.values(r)) {
|
|
1971
1593
|
const n = t._requiredContext;
|
|
1972
1594
|
n && !e.includes(n) && e.push(n);
|
|
1973
1595
|
}
|
|
1974
1596
|
return e;
|
|
1975
1597
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const n = typeof e == "function" ? {} : e,
|
|
1978
|
-
return
|
|
1979
|
-
const
|
|
1980
|
-
} } :
|
|
1981
|
-
const
|
|
1982
|
-
return new
|
|
1983
|
-
}),
|
|
1984
|
-
return (
|
|
1985
|
-
const
|
|
1986
|
-
return
|
|
1598
|
+
function E(r, e, t) {
|
|
1599
|
+
const n = typeof e == "function" ? {} : e, s = typeof e == "function" ? e : t, o = "_props" in r ? r._props : {}, i = pr({ ...o, ...n }), d = lr(r), c = [...i, d];
|
|
1600
|
+
return xe("viewWithModel", (h, g) => {
|
|
1601
|
+
const _ = g(), C = _.get(d), m = "_props" in r ? K(r._props, (S, B) => S.create((A) => h.read(A)[B], _.get(S._requiredContext))) : {}, v = C ? { read: () => C, dispose: () => {
|
|
1602
|
+
} } : Pt((S) => {
|
|
1603
|
+
const B = K(m, (A) => A.read(S));
|
|
1604
|
+
return new r(B);
|
|
1605
|
+
}), O = K(n, (S, B) => S.create((A) => h.read(A)[B], _.get(S._requiredContext)));
|
|
1606
|
+
return (S) => {
|
|
1607
|
+
const B = v.read(S), A = K(O, (gt) => gt.read(S));
|
|
1608
|
+
return s(S, B, A);
|
|
1987
1609
|
};
|
|
1988
1610
|
}, c.length > 0 ? c : void 0);
|
|
1989
1611
|
}
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
function
|
|
1612
|
+
I({ value: u.obs() }, (r, e) => e.value.read(r));
|
|
1613
|
+
Ue(null);
|
|
1614
|
+
function st(r) {
|
|
1993
1615
|
var e;
|
|
1994
1616
|
return {
|
|
1995
|
-
id:
|
|
1996
|
-
name:
|
|
1997
|
-
type:
|
|
1998
|
-
children: (e =
|
|
1999
|
-
component:
|
|
1617
|
+
id: r.id,
|
|
1618
|
+
name: r.name,
|
|
1619
|
+
type: r.type,
|
|
1620
|
+
children: (e = r.children) == null ? void 0 : e.map(st),
|
|
1621
|
+
component: r.component
|
|
2000
1622
|
};
|
|
2001
1623
|
}
|
|
2002
|
-
function
|
|
1624
|
+
function Q(r, e) {
|
|
2003
1625
|
const {
|
|
2004
1626
|
storageKey: t,
|
|
2005
1627
|
defaultValue: n,
|
|
2006
|
-
serialize:
|
|
2007
|
-
deserialize:
|
|
1628
|
+
serialize: s = JSON.stringify,
|
|
1629
|
+
deserialize: o = JSON.parse
|
|
2008
1630
|
} = e;
|
|
2009
|
-
let
|
|
1631
|
+
let i = n;
|
|
2010
1632
|
try {
|
|
2011
1633
|
const h = localStorage.getItem(t);
|
|
2012
|
-
h !== null && (
|
|
1634
|
+
h !== null && (i = o(h));
|
|
2013
1635
|
} catch {
|
|
2014
1636
|
}
|
|
2015
|
-
const d =
|
|
2016
|
-
return d.set = (h,
|
|
1637
|
+
const d = x(r, i), c = d.set.bind(d);
|
|
1638
|
+
return d.set = (h, g) => {
|
|
2017
1639
|
try {
|
|
2018
|
-
localStorage.setItem(t,
|
|
1640
|
+
localStorage.setItem(t, s(h));
|
|
2019
1641
|
} catch {
|
|
2020
1642
|
}
|
|
2021
|
-
c(h,
|
|
1643
|
+
c(h, g);
|
|
2022
1644
|
}, d;
|
|
2023
1645
|
}
|
|
2024
|
-
class
|
|
2025
|
-
registry:
|
|
2026
|
-
daemonModel:
|
|
1646
|
+
class gr extends F({
|
|
1647
|
+
registry: u.const(),
|
|
1648
|
+
daemonModel: u.const(),
|
|
1649
|
+
reportModel: u.const()
|
|
2027
1650
|
}) {
|
|
2028
1651
|
constructor() {
|
|
2029
1652
|
super(...arguments);
|
|
2030
|
-
l(this, "leftSidebarVisible",
|
|
1653
|
+
l(this, "leftSidebarVisible", Q(this, {
|
|
2031
1654
|
storageKey: "component-explorer:leftSidebarVisible",
|
|
2032
1655
|
defaultValue: !0
|
|
2033
1656
|
}));
|
|
2034
|
-
l(this, "rightSidebarVisible",
|
|
1657
|
+
l(this, "rightSidebarVisible", Q(this, {
|
|
2035
1658
|
storageKey: "component-explorer:rightSidebarVisible",
|
|
2036
|
-
defaultValue: !
|
|
1659
|
+
defaultValue: !1
|
|
2037
1660
|
}));
|
|
2038
|
-
l(this, "isDarkTheme",
|
|
1661
|
+
l(this, "isDarkTheme", Q(this, {
|
|
2039
1662
|
storageKey: "component-explorer:isDarkTheme",
|
|
2040
1663
|
defaultValue: !0
|
|
2041
1664
|
}));
|
|
2042
|
-
l(this, "selectedNodeId",
|
|
1665
|
+
l(this, "selectedNodeId", Q(this, {
|
|
2043
1666
|
storageKey: "component-explorer:selectedNodeId",
|
|
2044
1667
|
defaultValue: void 0
|
|
2045
1668
|
}));
|
|
2046
|
-
l(this, "expandedNodeIds",
|
|
2047
|
-
l(this, "viewMode",
|
|
1669
|
+
l(this, "expandedNodeIds", x(this, /* @__PURE__ */ new Set([""])));
|
|
1670
|
+
l(this, "viewMode", Q(this, {
|
|
2048
1671
|
storageKey: "component-explorer:viewMode",
|
|
2049
1672
|
defaultValue: "session"
|
|
2050
1673
|
}));
|
|
2051
|
-
/** The explorer's tree derived from the registry */
|
|
1674
|
+
/** The explorer's tree derived from the registry or report */
|
|
2052
1675
|
l(this, "tree", N(this, (t) => {
|
|
2053
|
-
const n = this.props.
|
|
2054
|
-
|
|
1676
|
+
const n = this.props.reportModel;
|
|
1677
|
+
if (n)
|
|
1678
|
+
return n.buildTree(t);
|
|
1679
|
+
const s = this.props.registry.root.read(t);
|
|
1680
|
+
return st(s);
|
|
2055
1681
|
}));
|
|
2056
1682
|
l(this, "selectedNode", N(this, (t) => {
|
|
2057
1683
|
const n = this.selectedNodeId.read(t);
|
|
2058
|
-
if (
|
|
2059
|
-
const
|
|
2060
|
-
return this._findNode(
|
|
1684
|
+
if (n === void 0) return;
|
|
1685
|
+
const s = this.tree.read(t);
|
|
1686
|
+
return s.id === n ? s : this._findNode(s.children ?? [], n);
|
|
2061
1687
|
}));
|
|
2062
1688
|
/** List of preview rows to render based on current selection and view mode */
|
|
2063
1689
|
l(this, "selectedFixtures", N(this, (t) => {
|
|
2064
1690
|
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) : [];
|
|
1691
|
+
return n ? this.isReportMode ? (this.props.reportModel.state.read(t), this._collectReportRows(n, n.name)) : this.viewMode.read(t) === "diff" && this.daemonAvailable && this.daemon.sessions.read(t).length > 1 ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
|
|
2066
1692
|
}));
|
|
2067
1693
|
l(this, "setViewMode", (t) => {
|
|
2068
1694
|
this.viewMode.set(t, void 0);
|
|
@@ -2070,8 +1696,8 @@ class Cn extends M({
|
|
|
2070
1696
|
l(this, "navigateToSession", (t) => {
|
|
2071
1697
|
const n = this.props.daemonModel;
|
|
2072
1698
|
if (!n) return;
|
|
2073
|
-
const
|
|
2074
|
-
|
|
1699
|
+
const s = n.getSessionExplorerUrl(t);
|
|
1700
|
+
s && (window.location.href = s);
|
|
2075
1701
|
});
|
|
2076
1702
|
l(this, "toggleLeftSidebar", () => {
|
|
2077
1703
|
this.leftSidebarVisible.set(!this.leftSidebarVisible.get(), void 0);
|
|
@@ -2086,8 +1712,8 @@ class Cn extends M({
|
|
|
2086
1712
|
this.selectedNodeId.set(t, void 0);
|
|
2087
1713
|
});
|
|
2088
1714
|
l(this, "toggleNodeExpanded", (t) => {
|
|
2089
|
-
const n = this.expandedNodeIds.get(),
|
|
2090
|
-
|
|
1715
|
+
const n = this.expandedNodeIds.get(), s = new Set(n);
|
|
1716
|
+
s.has(t) ? s.delete(t) : s.add(t), this.expandedNodeIds.set(s, void 0);
|
|
2091
1717
|
});
|
|
2092
1718
|
}
|
|
2093
1719
|
get daemonAvailable() {
|
|
@@ -2096,15 +1722,21 @@ class Cn extends M({
|
|
|
2096
1722
|
get daemon() {
|
|
2097
1723
|
return this.props.daemonModel;
|
|
2098
1724
|
}
|
|
1725
|
+
get reportModel() {
|
|
1726
|
+
return this.props.reportModel;
|
|
1727
|
+
}
|
|
1728
|
+
get isReportMode() {
|
|
1729
|
+
return this.props.reportModel !== void 0;
|
|
1730
|
+
}
|
|
2099
1731
|
isNodeExpanded(t, n) {
|
|
2100
1732
|
return this.expandedNodeIds.read(n).has(t);
|
|
2101
1733
|
}
|
|
2102
1734
|
_findNode(t, n) {
|
|
2103
|
-
for (const
|
|
2104
|
-
if (
|
|
2105
|
-
if (
|
|
2106
|
-
const
|
|
2107
|
-
if (
|
|
1735
|
+
for (const s of t) {
|
|
1736
|
+
if (s.id === n) return s;
|
|
1737
|
+
if (s.children) {
|
|
1738
|
+
const o = this._findNode(s.children, n);
|
|
1739
|
+
if (o) return o;
|
|
2108
1740
|
}
|
|
2109
1741
|
}
|
|
2110
1742
|
}
|
|
@@ -2120,28 +1752,28 @@ class Cn extends M({
|
|
|
2120
1752
|
}
|
|
2121
1753
|
}];
|
|
2122
1754
|
if (t.type === "variants") {
|
|
2123
|
-
const
|
|
2124
|
-
for (const
|
|
2125
|
-
|
|
2126
|
-
id:
|
|
2127
|
-
name:
|
|
2128
|
-
path: `${n} / ${
|
|
2129
|
-
component:
|
|
1755
|
+
const o = [];
|
|
1756
|
+
for (const i of t.children ?? [])
|
|
1757
|
+
i.type === "component" && i.component && o.push({
|
|
1758
|
+
id: i.id,
|
|
1759
|
+
name: i.name,
|
|
1760
|
+
path: `${n} / ${i.name}`,
|
|
1761
|
+
component: i.component
|
|
2130
1762
|
});
|
|
2131
|
-
return
|
|
1763
|
+
return o.length > 0 ? [{
|
|
2132
1764
|
type: "variants",
|
|
2133
1765
|
id: t.id,
|
|
2134
1766
|
name: t.name,
|
|
2135
1767
|
path: n,
|
|
2136
|
-
fixtures:
|
|
1768
|
+
fixtures: o
|
|
2137
1769
|
}] : [];
|
|
2138
1770
|
}
|
|
2139
|
-
const
|
|
2140
|
-
for (const
|
|
2141
|
-
const
|
|
2142
|
-
|
|
1771
|
+
const s = [];
|
|
1772
|
+
for (const o of t.children ?? []) {
|
|
1773
|
+
const i = n ? `${n} / ${o.name}` : o.name;
|
|
1774
|
+
s.push(...this._collectPreviewRows(o, i));
|
|
2143
1775
|
}
|
|
2144
|
-
return
|
|
1776
|
+
return s;
|
|
2145
1777
|
}
|
|
2146
1778
|
/**
|
|
2147
1779
|
* In diff mode: fixtures become screenshot comparison items showing current vs baseline.
|
|
@@ -2161,30 +1793,56 @@ class Cn extends M({
|
|
|
2161
1793
|
}]
|
|
2162
1794
|
}];
|
|
2163
1795
|
if (t.type === "variants") {
|
|
2164
|
-
const
|
|
2165
|
-
for (const
|
|
2166
|
-
|
|
2167
|
-
fixtureId:
|
|
2168
|
-
name:
|
|
2169
|
-
path: `${n} / ${
|
|
1796
|
+
const o = [];
|
|
1797
|
+
for (const i of t.children ?? [])
|
|
1798
|
+
i.type === "component" && o.push({
|
|
1799
|
+
fixtureId: i.id,
|
|
1800
|
+
name: i.name,
|
|
1801
|
+
path: `${n} / ${i.name}`
|
|
2170
1802
|
});
|
|
2171
|
-
return
|
|
1803
|
+
return o.length > 0 ? [{
|
|
2172
1804
|
type: "screenshot-comparison",
|
|
2173
1805
|
id: t.id,
|
|
2174
1806
|
name: t.name,
|
|
2175
1807
|
path: n,
|
|
2176
|
-
items:
|
|
1808
|
+
items: o
|
|
2177
1809
|
}] : [];
|
|
2178
1810
|
}
|
|
2179
|
-
const
|
|
2180
|
-
for (const
|
|
2181
|
-
const
|
|
2182
|
-
|
|
1811
|
+
const s = [];
|
|
1812
|
+
for (const o of t.children ?? []) {
|
|
1813
|
+
const i = n ? `${n} / ${o.name}` : o.name;
|
|
1814
|
+
s.push(...this._collectDiffRows(o, i));
|
|
2183
1815
|
}
|
|
2184
|
-
return
|
|
1816
|
+
return s;
|
|
1817
|
+
}
|
|
1818
|
+
_collectReportRows(t, n) {
|
|
1819
|
+
const s = this.props.reportModel.state.get();
|
|
1820
|
+
if (s.status !== "ready") return [];
|
|
1821
|
+
const o = s.report.fixtures;
|
|
1822
|
+
if (t.type === "component") {
|
|
1823
|
+
const d = o[t.id];
|
|
1824
|
+
return d ? [{
|
|
1825
|
+
type: "report-comparison",
|
|
1826
|
+
id: t.id,
|
|
1827
|
+
name: t.name,
|
|
1828
|
+
path: n,
|
|
1829
|
+
items: [{
|
|
1830
|
+
fixtureId: t.id,
|
|
1831
|
+
name: t.name,
|
|
1832
|
+
path: n,
|
|
1833
|
+
entry: d
|
|
1834
|
+
}]
|
|
1835
|
+
}] : [];
|
|
1836
|
+
}
|
|
1837
|
+
const i = [];
|
|
1838
|
+
for (const d of t.children ?? []) {
|
|
1839
|
+
const c = n ? `${n} / ${d.name}` : d.name;
|
|
1840
|
+
i.push(...this._collectReportRows(d, c));
|
|
1841
|
+
}
|
|
1842
|
+
return i;
|
|
2185
1843
|
}
|
|
2186
1844
|
}
|
|
2187
|
-
const
|
|
1845
|
+
const p = {
|
|
2188
1846
|
container: {
|
|
2189
1847
|
display: "flex",
|
|
2190
1848
|
flexDirection: "row",
|
|
@@ -2373,15 +2031,15 @@ const u = {
|
|
|
2373
2031
|
cursor: "pointer"
|
|
2374
2032
|
}
|
|
2375
2033
|
};
|
|
2376
|
-
function
|
|
2377
|
-
return Object.assign({}, ...
|
|
2034
|
+
function Ce(...r) {
|
|
2035
|
+
return Object.assign({}, ...r.filter(Boolean));
|
|
2378
2036
|
}
|
|
2379
|
-
class
|
|
2380
|
-
active:
|
|
2037
|
+
class mr extends F({
|
|
2038
|
+
active: u()
|
|
2381
2039
|
}) {
|
|
2382
2040
|
constructor() {
|
|
2383
2041
|
super(...arguments);
|
|
2384
|
-
l(this, "isHovered",
|
|
2042
|
+
l(this, "isHovered", x(this, !1));
|
|
2385
2043
|
l(this, "setHovered", (t) => {
|
|
2386
2044
|
this.isHovered.set(t, void 0);
|
|
2387
2045
|
});
|
|
@@ -2390,23 +2048,23 @@ class wn extends M({
|
|
|
2390
2048
|
return this.props.active;
|
|
2391
2049
|
}
|
|
2392
2050
|
}
|
|
2393
|
-
const
|
|
2394
|
-
|
|
2051
|
+
const se = E(
|
|
2052
|
+
mr,
|
|
2395
2053
|
{
|
|
2396
|
-
onClick:
|
|
2397
|
-
title:
|
|
2398
|
-
children:
|
|
2399
|
-
},
|
|
2400
|
-
(
|
|
2401
|
-
const n = e.isHovered.read(
|
|
2402
|
-
|
|
2403
|
-
n && !
|
|
2404
|
-
|
|
2054
|
+
onClick: u.const(),
|
|
2055
|
+
title: u.const(),
|
|
2056
|
+
children: u.const()
|
|
2057
|
+
},
|
|
2058
|
+
(r, e, t) => {
|
|
2059
|
+
const n = e.isHovered.read(r), s = e.active.read(r), o = Ce(
|
|
2060
|
+
p.titleBarButton,
|
|
2061
|
+
n && !s && p.titleBarButtonHover,
|
|
2062
|
+
s && p.titleBarButtonActive
|
|
2405
2063
|
);
|
|
2406
2064
|
return /* @__PURE__ */ a(
|
|
2407
2065
|
"button",
|
|
2408
2066
|
{
|
|
2409
|
-
style:
|
|
2067
|
+
style: o,
|
|
2410
2068
|
onClick: t.onClick,
|
|
2411
2069
|
title: t.title,
|
|
2412
2070
|
onMouseEnter: () => e.setHovered(!0),
|
|
@@ -2415,17 +2073,17 @@ const ce = B(
|
|
|
2415
2073
|
}
|
|
2416
2074
|
);
|
|
2417
2075
|
}
|
|
2418
|
-
),
|
|
2419
|
-
{ model:
|
|
2420
|
-
(
|
|
2076
|
+
), vr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, 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" }) }), _r = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, 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)" }) }), br = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, 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" }) }), yr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, 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" }) }), xr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm11 11H6V3h7v10zM3 3h2v10H3V3z" }) }), Cr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm6 11V3h5v10H8zM3 3h4v10H3V3z" }) }), Sr = () => /* @__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" }) }), wr = () => /* @__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" }) }), Rr = I(
|
|
2077
|
+
{ model: u.const() },
|
|
2078
|
+
(r, e) => {
|
|
2421
2079
|
var d, c;
|
|
2422
|
-
const t = e.model, n = t.viewMode.read(
|
|
2423
|
-
return /* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */ a(
|
|
2426
|
-
/* @__PURE__ */ a(
|
|
2080
|
+
const t = e.model, n = t.viewMode.read(r), s = ((d = t.daemon) == null ? void 0 : d.sessions.read(r)) ?? [], o = (c = t.daemon) == null ? void 0 : c.sessionName, i = s.filter((h) => h.name !== o);
|
|
2081
|
+
return s.length <= 1 ? null : /* @__PURE__ */ f("div", { style: J.container, children: [
|
|
2082
|
+
/* @__PURE__ */ f("div", { style: J.segmentedControl, children: [
|
|
2083
|
+
/* @__PURE__ */ a(Ee, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
|
|
2084
|
+
/* @__PURE__ */ a(Ee, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
|
|
2427
2085
|
] }),
|
|
2428
|
-
|
|
2086
|
+
i.length > 0 && /* @__PURE__ */ a("div", { style: J.sessionLinks, children: i.map((h) => /* @__PURE__ */ f(
|
|
2429
2087
|
"button",
|
|
2430
2088
|
{
|
|
2431
2089
|
style: J.sessionLink,
|
|
@@ -2441,57 +2099,57 @@ const ce = B(
|
|
|
2441
2099
|
] });
|
|
2442
2100
|
}
|
|
2443
2101
|
);
|
|
2444
|
-
function
|
|
2102
|
+
function Ee({ label: r, mode: e, active: t, onClick: n }) {
|
|
2445
2103
|
return /* @__PURE__ */ a(
|
|
2446
2104
|
"button",
|
|
2447
2105
|
{
|
|
2448
2106
|
style: t ? J.segmentActive : J.segment,
|
|
2449
2107
|
onClick: n,
|
|
2450
|
-
children:
|
|
2108
|
+
children: r
|
|
2451
2109
|
}
|
|
2452
2110
|
);
|
|
2453
2111
|
}
|
|
2454
|
-
const
|
|
2112
|
+
const Tr = I(
|
|
2455
2113
|
{
|
|
2456
|
-
model:
|
|
2114
|
+
model: u.const()
|
|
2457
2115
|
},
|
|
2458
|
-
(
|
|
2459
|
-
const t = e.model, n = t.leftSidebarVisible.read(
|
|
2460
|
-
return /* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */ a("div", { style:
|
|
2462
|
-
|
|
2116
|
+
(r, e) => {
|
|
2117
|
+
const t = e.model, n = t.leftSidebarVisible.read(r), s = t.rightSidebarVisible.read(r), o = t.isDarkTheme.read(r), i = t.selectedNode.read(r);
|
|
2118
|
+
return /* @__PURE__ */ f("div", { style: p.titleBar, children: [
|
|
2119
|
+
/* @__PURE__ */ a("div", { style: p.titleBarSection, children: /* @__PURE__ */ a(
|
|
2120
|
+
se,
|
|
2463
2121
|
{
|
|
2464
2122
|
active: n,
|
|
2465
2123
|
onClick: t.toggleLeftSidebar,
|
|
2466
2124
|
title: "Toggle left sidebar",
|
|
2467
|
-
children: /* @__PURE__ */ a(
|
|
2125
|
+
children: /* @__PURE__ */ a(xr, {})
|
|
2468
2126
|
}
|
|
2469
2127
|
) }),
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
t.daemonAvailable
|
|
2472
|
-
|
|
2128
|
+
/* @__PURE__ */ f("div", { style: p.titleBarCenter, children: [
|
|
2129
|
+
t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Rr, { model: t }) : null,
|
|
2130
|
+
i ? /* @__PURE__ */ f(pe, { children: [
|
|
2473
2131
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "<" }),
|
|
2474
|
-
/* @__PURE__ */ a("span", { children:
|
|
2132
|
+
/* @__PURE__ */ a("span", { children: i.name }),
|
|
2475
2133
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "/>" })
|
|
2476
2134
|
] }) : /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: "No component selected" })
|
|
2477
2135
|
] }),
|
|
2478
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ f("div", { style: p.titleBarSection, children: [
|
|
2479
2137
|
/* @__PURE__ */ a(
|
|
2480
|
-
|
|
2138
|
+
se,
|
|
2481
2139
|
{
|
|
2482
2140
|
active: !1,
|
|
2483
2141
|
onClick: t.toggleTheme,
|
|
2484
|
-
title:
|
|
2485
|
-
children:
|
|
2142
|
+
title: o ? "Switch to light theme" : "Switch to dark theme",
|
|
2143
|
+
children: o ? /* @__PURE__ */ a(Sr, {}) : /* @__PURE__ */ a(wr, {})
|
|
2486
2144
|
}
|
|
2487
2145
|
),
|
|
2488
2146
|
/* @__PURE__ */ a(
|
|
2489
|
-
|
|
2147
|
+
se,
|
|
2490
2148
|
{
|
|
2491
|
-
active:
|
|
2149
|
+
active: s,
|
|
2492
2150
|
onClick: t.toggleRightSidebar,
|
|
2493
2151
|
title: "Toggle right sidebar",
|
|
2494
|
-
children: /* @__PURE__ */ a(
|
|
2152
|
+
children: /* @__PURE__ */ a(Cr, {})
|
|
2495
2153
|
}
|
|
2496
2154
|
)
|
|
2497
2155
|
] })
|
|
@@ -2541,22 +2199,22 @@ const En = D(
|
|
|
2541
2199
|
color: "var(--vscode-textLink-foreground)",
|
|
2542
2200
|
cursor: "pointer"
|
|
2543
2201
|
}
|
|
2544
|
-
},
|
|
2202
|
+
}, ot = I(
|
|
2545
2203
|
{
|
|
2546
|
-
model:
|
|
2547
|
-
nodes:
|
|
2548
|
-
depth:
|
|
2204
|
+
model: u.const(),
|
|
2205
|
+
nodes: u.const(),
|
|
2206
|
+
depth: u.const()
|
|
2549
2207
|
},
|
|
2550
|
-
(
|
|
2208
|
+
(r, e) => /* @__PURE__ */ a(pe, { children: e.nodes.map((t) => /* @__PURE__ */ a(Or, { model: e.model, node: t, depth: e.depth }, t.id)) })
|
|
2551
2209
|
);
|
|
2552
|
-
class
|
|
2553
|
-
model:
|
|
2554
|
-
node:
|
|
2555
|
-
depth:
|
|
2210
|
+
class Ir extends F({
|
|
2211
|
+
model: u.const(),
|
|
2212
|
+
node: u.const(),
|
|
2213
|
+
depth: u.const()
|
|
2556
2214
|
}) {
|
|
2557
2215
|
constructor() {
|
|
2558
2216
|
super(...arguments);
|
|
2559
|
-
l(this, "isHovered",
|
|
2217
|
+
l(this, "isHovered", x(this, !1));
|
|
2560
2218
|
l(this, "setHovered", (t) => {
|
|
2561
2219
|
this.isHovered.set(t, void 0);
|
|
2562
2220
|
});
|
|
@@ -2584,55 +2242,55 @@ class Fn extends M({
|
|
|
2584
2242
|
return !!(this.props.node.children && this.props.node.children.length > 0);
|
|
2585
2243
|
}
|
|
2586
2244
|
}
|
|
2587
|
-
const
|
|
2588
|
-
const t = e.explorerModel, n = e.treeNode,
|
|
2589
|
-
|
|
2590
|
-
{ paddingLeft: `${8 +
|
|
2591
|
-
c &&
|
|
2592
|
-
!c && h &&
|
|
2245
|
+
const Or = E(Ir, {}, (r, e) => {
|
|
2246
|
+
const t = e.explorerModel, n = e.treeNode, s = e.treeDepth, o = !!(n.children && n.children.length > 0), i = o ? t.isNodeExpanded(n.id, r) : !1, c = t.selectedNodeId.read(r) === n.id, h = e.isHovered.read(r), g = Ce(
|
|
2247
|
+
p.treeItem,
|
|
2248
|
+
{ paddingLeft: `${8 + s * 12}px` },
|
|
2249
|
+
c && p.treeItemSelected,
|
|
2250
|
+
!c && h && p.treeItemHover
|
|
2593
2251
|
);
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ f(pe, { children: [
|
|
2253
|
+
/* @__PURE__ */ f(
|
|
2596
2254
|
"div",
|
|
2597
2255
|
{
|
|
2598
|
-
style:
|
|
2256
|
+
style: g,
|
|
2599
2257
|
onClick: e.handleClick,
|
|
2600
2258
|
onDoubleClick: e.handleDoubleClick,
|
|
2601
2259
|
onMouseEnter: () => e.setHovered(!0),
|
|
2602
2260
|
onMouseLeave: () => e.setHovered(!1),
|
|
2603
2261
|
children: [
|
|
2604
|
-
|
|
2605
|
-
/* @__PURE__ */ a("div", { style:
|
|
2606
|
-
/* @__PURE__ */ a("span", { style:
|
|
2607
|
-
|
|
2262
|
+
o ? /* @__PURE__ */ a("div", { style: p.treeItemChevron, onClick: e.handleChevronClick, children: i ? /* @__PURE__ */ a(_r, {}) : /* @__PURE__ */ a(vr, {}) }) : /* @__PURE__ */ a("div", { style: p.treeItemChevronPlaceholder }),
|
|
2263
|
+
/* @__PURE__ */ a("div", { style: p.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(yr, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(br, { style: { color: "#deb45b" } }) }),
|
|
2264
|
+
/* @__PURE__ */ a("span", { style: p.treeItemLabel, children: n.name }),
|
|
2265
|
+
o && /* @__PURE__ */ a("span", { style: p.treeItemCount, children: n.children.length })
|
|
2608
2266
|
]
|
|
2609
2267
|
}
|
|
2610
2268
|
),
|
|
2611
|
-
|
|
2269
|
+
o && i && /* @__PURE__ */ a(ot, { model: t, nodes: n.children, depth: s + 1 })
|
|
2612
2270
|
] });
|
|
2613
|
-
}),
|
|
2271
|
+
}), kr = I(
|
|
2614
2272
|
{
|
|
2615
|
-
model:
|
|
2273
|
+
model: u.const()
|
|
2616
2274
|
},
|
|
2617
|
-
(
|
|
2618
|
-
const t = e.model.tree.read(
|
|
2619
|
-
return /* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */ a("div", { style:
|
|
2621
|
-
/* @__PURE__ */ a("div", { style:
|
|
2275
|
+
(r, e) => {
|
|
2276
|
+
const t = e.model.tree.read(r);
|
|
2277
|
+
return /* @__PURE__ */ f("div", { style: p.sidebar, children: [
|
|
2278
|
+
/* @__PURE__ */ a("div", { style: p.sidebarHeader, children: "Explorer" }),
|
|
2279
|
+
/* @__PURE__ */ a("div", { style: p.sidebarContent, children: /* @__PURE__ */ a(ot, { model: e.model, nodes: [t], depth: 0 }) })
|
|
2622
2280
|
] });
|
|
2623
2281
|
}
|
|
2624
2282
|
);
|
|
2625
|
-
class
|
|
2283
|
+
class Vr extends F({}) {
|
|
2626
2284
|
constructor() {
|
|
2627
2285
|
super(...arguments);
|
|
2628
|
-
l(this, "checked",
|
|
2286
|
+
l(this, "checked", x(this, !1));
|
|
2629
2287
|
l(this, "toggle", () => {
|
|
2630
2288
|
this.checked.set(!this.checked.get(), void 0);
|
|
2631
2289
|
});
|
|
2632
2290
|
}
|
|
2633
2291
|
}
|
|
2634
|
-
const
|
|
2635
|
-
const t = e.checked.read(
|
|
2292
|
+
const Nr = E(Vr, {}, (r, e) => {
|
|
2293
|
+
const t = e.checked.read(r), n = {
|
|
2636
2294
|
position: "relative",
|
|
2637
2295
|
width: "36px",
|
|
2638
2296
|
height: "18px",
|
|
@@ -2641,7 +2299,7 @@ const zn = B(Bn, {}, (s, e) => {
|
|
|
2641
2299
|
cursor: "pointer",
|
|
2642
2300
|
transition: "background-color 0.2s",
|
|
2643
2301
|
border: "1px solid var(--vscode-input-border, transparent)"
|
|
2644
|
-
},
|
|
2302
|
+
}, s = {
|
|
2645
2303
|
position: "absolute",
|
|
2646
2304
|
top: "2px",
|
|
2647
2305
|
left: t ? "18px" : "2px",
|
|
@@ -2651,14 +2309,14 @@ const zn = B(Bn, {}, (s, e) => {
|
|
|
2651
2309
|
borderRadius: "50%",
|
|
2652
2310
|
transition: "left 0.2s"
|
|
2653
2311
|
};
|
|
2654
|
-
return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style:
|
|
2655
|
-
}),
|
|
2312
|
+
return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: s }) });
|
|
2313
|
+
}), Dr = I(
|
|
2656
2314
|
{
|
|
2657
|
-
node:
|
|
2315
|
+
node: u.const()
|
|
2658
2316
|
},
|
|
2659
|
-
(
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2317
|
+
(r, 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: [
|
|
2318
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2319
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2662
2320
|
"children",
|
|
2663
2321
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : string" })
|
|
2664
2322
|
] }),
|
|
@@ -2666,83 +2324,84 @@ const zn = B(Bn, {}, (s, e) => {
|
|
|
2666
2324
|
"input",
|
|
2667
2325
|
{
|
|
2668
2326
|
type: "text",
|
|
2669
|
-
style:
|
|
2327
|
+
style: p.propertyInput,
|
|
2670
2328
|
defaultValue: "Click me",
|
|
2671
2329
|
placeholder: "Enter text..."
|
|
2672
2330
|
}
|
|
2673
2331
|
),
|
|
2674
|
-
/* @__PURE__ */ a("div", { style:
|
|
2332
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button text content" })
|
|
2675
2333
|
] }),
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2335
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2678
2336
|
"variant",
|
|
2679
2337
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
|
|
2680
2338
|
] }),
|
|
2681
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
|
|
2682
2340
|
/* @__PURE__ */ a("option", { value: "default", children: "default" }),
|
|
2683
2341
|
/* @__PURE__ */ a("option", { value: "primary", children: "primary" }),
|
|
2684
2342
|
/* @__PURE__ */ a("option", { value: "secondary", children: "secondary" }),
|
|
2685
2343
|
/* @__PURE__ */ a("option", { value: "destructive", children: "destructive" })
|
|
2686
2344
|
] }),
|
|
2687
|
-
/* @__PURE__ */ a("div", { style:
|
|
2345
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Visual style variant" })
|
|
2688
2346
|
] }),
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2348
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2691
2349
|
"size",
|
|
2692
2350
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
|
|
2693
2351
|
] }),
|
|
2694
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
|
|
2695
2353
|
/* @__PURE__ */ a("option", { value: "sm", children: "sm" }),
|
|
2696
2354
|
/* @__PURE__ */ a("option", { value: "default", children: "default" }),
|
|
2697
2355
|
/* @__PURE__ */ a("option", { value: "lg", children: "lg" })
|
|
2698
2356
|
] }),
|
|
2699
|
-
/* @__PURE__ */ a("div", { style:
|
|
2357
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button size" })
|
|
2700
2358
|
] }),
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ f("div", { style: p.propertyRow, children: [
|
|
2360
|
+
/* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
|
|
2703
2361
|
"disabled",
|
|
2704
2362
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : boolean" })
|
|
2705
2363
|
] }),
|
|
2706
|
-
/* @__PURE__ */ a(
|
|
2707
|
-
/* @__PURE__ */ a("div", { style:
|
|
2364
|
+
/* @__PURE__ */ a(Nr, {}),
|
|
2365
|
+
/* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Disable the button" })
|
|
2708
2366
|
] })
|
|
2709
2367
|
] })
|
|
2710
|
-
),
|
|
2368
|
+
), Mr = I(
|
|
2711
2369
|
{
|
|
2712
|
-
selectedNode:
|
|
2370
|
+
selectedNode: u.const()
|
|
2713
2371
|
},
|
|
2714
|
-
(
|
|
2715
|
-
/* @__PURE__ */
|
|
2372
|
+
(r, e) => /* @__PURE__ */ f("div", { style: Ce(p.sidebar, p.sidebarRight), children: [
|
|
2373
|
+
/* @__PURE__ */ f("div", { style: p.sidebarHeader, children: [
|
|
2716
2374
|
/* @__PURE__ */ a("span", { style: { marginRight: "6px", color: "var(--vscode-textLink-foreground)" }, children: "</>" }),
|
|
2717
2375
|
"Props"
|
|
2718
2376
|
] }),
|
|
2719
|
-
/* @__PURE__ */ a("div", { style:
|
|
2377
|
+
/* @__PURE__ */ a("div", { style: p.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(Dr, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
|
|
2720
2378
|
] })
|
|
2721
2379
|
);
|
|
2722
|
-
class
|
|
2723
|
-
fixture:
|
|
2724
|
-
compact:
|
|
2380
|
+
class Fr extends F({
|
|
2381
|
+
fixture: u.const(),
|
|
2382
|
+
compact: u.const()
|
|
2725
2383
|
}) {
|
|
2726
2384
|
constructor() {
|
|
2727
2385
|
super(...arguments);
|
|
2728
2386
|
l(this, "_containerRef", null);
|
|
2729
2387
|
l(this, "_shadowRoot", null);
|
|
2730
2388
|
l(this, "_renderContainer", null);
|
|
2731
|
-
l(this, "
|
|
2389
|
+
l(this, "_renderResult", null);
|
|
2390
|
+
l(this, "_abortController", null);
|
|
2732
2391
|
l(this, "_resizeObserver", null);
|
|
2733
|
-
l(this, "measuredWidth",
|
|
2734
|
-
l(this, "measuredHeight",
|
|
2392
|
+
l(this, "measuredWidth", x(this, void 0));
|
|
2393
|
+
l(this, "measuredHeight", x(this, void 0));
|
|
2735
2394
|
l(this, "setContainerRef", (t) => {
|
|
2736
2395
|
if (t === this._containerRef || (this._cleanup(), this._containerRef = t, !t)) return;
|
|
2737
2396
|
const n = this.fixture.component;
|
|
2738
2397
|
n.isolation === "shadow-dom" ? this._renderInShadowDom(t, n) : this._renderDirect(t, n);
|
|
2739
|
-
const
|
|
2740
|
-
this._resizeObserver = new ResizeObserver((
|
|
2741
|
-
for (const
|
|
2742
|
-
const { width: d, height: c } =
|
|
2398
|
+
const s = this._renderContainer ?? t;
|
|
2399
|
+
this._resizeObserver = new ResizeObserver((o) => {
|
|
2400
|
+
for (const i of o) {
|
|
2401
|
+
const { width: d, height: c } = i.contentRect;
|
|
2743
2402
|
c > 0 && (this.measuredWidth.set(Math.round(d), void 0), this.measuredHeight.set(Math.round(c), void 0));
|
|
2744
2403
|
}
|
|
2745
|
-
}), this._resizeObserver.observe(
|
|
2404
|
+
}), this._resizeObserver.observe(s);
|
|
2746
2405
|
});
|
|
2747
2406
|
}
|
|
2748
2407
|
get fixture() {
|
|
@@ -2759,69 +2418,81 @@ class $n extends M({
|
|
|
2759
2418
|
} else
|
|
2760
2419
|
this._shadowRoot = t.attachShadow({ mode: "open" });
|
|
2761
2420
|
if (n.styles)
|
|
2762
|
-
for (const
|
|
2763
|
-
if (
|
|
2421
|
+
for (const i of n.styles)
|
|
2422
|
+
if (i.type === "css") {
|
|
2764
2423
|
const d = document.createElement("style");
|
|
2765
|
-
d.textContent =
|
|
2766
|
-
} else if (
|
|
2424
|
+
d.textContent = i.content, this._shadowRoot.appendChild(d);
|
|
2425
|
+
} else if (i.type === "url") {
|
|
2767
2426
|
const d = document.createElement("link");
|
|
2768
|
-
d.rel = "stylesheet", d.href =
|
|
2769
|
-
} else
|
|
2427
|
+
d.rel = "stylesheet", d.href = i.href, this._shadowRoot.appendChild(d);
|
|
2428
|
+
} else i.type === "adopted" && (this._shadowRoot.adoptedStyleSheets = [
|
|
2770
2429
|
...this._shadowRoot.adoptedStyleSheets,
|
|
2771
|
-
|
|
2430
|
+
i.sheet
|
|
2772
2431
|
]);
|
|
2773
|
-
const
|
|
2774
|
-
|
|
2775
|
-
const
|
|
2776
|
-
this.
|
|
2432
|
+
const s = document.createElement("div");
|
|
2433
|
+
s.style.display = "inline-block", this._renderContainer = s, this._shadowRoot.appendChild(s);
|
|
2434
|
+
const o = this._getDefaultProps(n);
|
|
2435
|
+
this._abortController = new AbortController(), this._handleRenderReturn(n.render(s, {
|
|
2436
|
+
props: o,
|
|
2437
|
+
signal: this._abortController.signal
|
|
2438
|
+
}));
|
|
2777
2439
|
}
|
|
2778
2440
|
_renderDirect(t, n) {
|
|
2779
2441
|
this._renderContainer = t;
|
|
2780
|
-
const
|
|
2781
|
-
this.
|
|
2442
|
+
const s = this._getDefaultProps(n);
|
|
2443
|
+
this._abortController = new AbortController(), this._handleRenderReturn(n.render(t, {
|
|
2444
|
+
props: s,
|
|
2445
|
+
signal: this._abortController.signal
|
|
2446
|
+
}));
|
|
2447
|
+
}
|
|
2448
|
+
_handleRenderReturn(t) {
|
|
2449
|
+
t instanceof Promise ? t.then((n) => {
|
|
2450
|
+
this._abortController && !this._abortController.signal.aborted && (this._renderResult = n ?? void 0);
|
|
2451
|
+
}).catch(() => {
|
|
2452
|
+
}) : this._renderResult = t ?? void 0;
|
|
2782
2453
|
}
|
|
2783
2454
|
_getDefaultProps(t) {
|
|
2784
2455
|
const n = {};
|
|
2785
|
-
for (const
|
|
2786
|
-
n[
|
|
2456
|
+
for (const s of t.properties)
|
|
2457
|
+
n[s.name] = s.defaultValue;
|
|
2787
2458
|
return n;
|
|
2788
2459
|
}
|
|
2789
2460
|
_cleanup() {
|
|
2790
|
-
var t;
|
|
2791
|
-
this.
|
|
2461
|
+
var t, n;
|
|
2462
|
+
this._abortController && (this._abortController.abort(), this._abortController = null), (t = this._renderResult) != null && t.dispose && this._renderResult.dispose(), this._renderResult = null, (n = this._resizeObserver) == null || n.disconnect(), this._resizeObserver = null, this._shadowRoot = null, this._renderContainer = null;
|
|
2792
2463
|
}
|
|
2793
2464
|
dispose() {
|
|
2794
2465
|
this._cleanup();
|
|
2795
2466
|
}
|
|
2796
2467
|
}
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2468
|
+
const it = E(
|
|
2469
|
+
Fr,
|
|
2799
2470
|
{},
|
|
2800
|
-
(
|
|
2801
|
-
const t = e.fixture, n = t.component,
|
|
2471
|
+
(r, e) => {
|
|
2472
|
+
const t = e.fixture, n = t.component, s = n.displayMode, o = e.measuredWidth.read(r), i = e.measuredHeight.read(r), d = e.compact;
|
|
2802
2473
|
let c;
|
|
2803
|
-
if (
|
|
2804
|
-
const
|
|
2474
|
+
if (s.type === "page") {
|
|
2475
|
+
const C = s.viewports[0], m = wt(C);
|
|
2805
2476
|
c = {
|
|
2806
|
-
width:
|
|
2807
|
-
height:
|
|
2477
|
+
width: m.width,
|
|
2478
|
+
height: m.height,
|
|
2808
2479
|
overflow: "auto"
|
|
2809
2480
|
};
|
|
2810
2481
|
} else
|
|
2811
2482
|
c = {
|
|
2812
2483
|
display: "inline-block"
|
|
2813
2484
|
};
|
|
2814
|
-
const h =
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */ a("span", { style:
|
|
2818
|
-
!d && h && /* @__PURE__ */ a("span", { style:
|
|
2485
|
+
const h = o && i ? `${o} × ${i}` : "", g = d ? G.wrapperCompact : G.wrapper, _ = d ? G.nameCompact : G.name;
|
|
2486
|
+
return /* @__PURE__ */ f("div", { style: g, children: [
|
|
2487
|
+
/* @__PURE__ */ f("div", { style: G.labelRow, children: [
|
|
2488
|
+
/* @__PURE__ */ a("span", { style: _, children: t.name }),
|
|
2489
|
+
!d && h && /* @__PURE__ */ a("span", { style: G.dimensions, children: h })
|
|
2819
2490
|
] }),
|
|
2820
|
-
/* @__PURE__ */ a("div", { style:
|
|
2491
|
+
/* @__PURE__ */ a("div", { style: zr(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: c }) })
|
|
2821
2492
|
] });
|
|
2822
2493
|
}
|
|
2823
2494
|
), W = 8;
|
|
2824
|
-
function
|
|
2495
|
+
function at(r, e) {
|
|
2825
2496
|
return `
|
|
2826
2497
|
linear-gradient(45deg, ${e} 25%, transparent 25%),
|
|
2827
2498
|
linear-gradient(-45deg, ${e} 25%, transparent 25%),
|
|
@@ -2829,13 +2500,13 @@ function pt(s, e) {
|
|
|
2829
2500
|
linear-gradient(-45deg, transparent 75%, ${e} 75%)
|
|
2830
2501
|
`;
|
|
2831
2502
|
}
|
|
2832
|
-
const
|
|
2503
|
+
const Er = {
|
|
2833
2504
|
backgroundColor: "#ffffff",
|
|
2834
|
-
backgroundImage:
|
|
2835
|
-
},
|
|
2505
|
+
backgroundImage: at("#ffffff", "#e5e5e5")
|
|
2506
|
+
}, Br = {
|
|
2836
2507
|
backgroundColor: "#1e1e1e",
|
|
2837
|
-
backgroundImage:
|
|
2838
|
-
},
|
|
2508
|
+
backgroundImage: at("#1e1e1e", "#2d2d2d")
|
|
2509
|
+
}, Ar = {
|
|
2839
2510
|
display: "inline-block",
|
|
2840
2511
|
padding: "12px",
|
|
2841
2512
|
borderRadius: "4px",
|
|
@@ -2843,15 +2514,15 @@ const jn = {
|
|
|
2843
2514
|
backgroundPosition: `0 0, 0 ${W}px, ${W}px -${W}px, -${W}px 0`,
|
|
2844
2515
|
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
|
|
2845
2516
|
};
|
|
2846
|
-
function
|
|
2847
|
-
const e =
|
|
2517
|
+
function zr(r) {
|
|
2518
|
+
const e = r === "dark" ? Br : Er;
|
|
2848
2519
|
return {
|
|
2849
|
-
...
|
|
2520
|
+
...Ar,
|
|
2850
2521
|
backgroundColor: e.backgroundColor,
|
|
2851
2522
|
backgroundImage: e.backgroundImage
|
|
2852
2523
|
};
|
|
2853
2524
|
}
|
|
2854
|
-
const
|
|
2525
|
+
const G = {
|
|
2855
2526
|
wrapper: {
|
|
2856
2527
|
marginBottom: "32px"
|
|
2857
2528
|
},
|
|
@@ -2880,16 +2551,16 @@ const q = {
|
|
|
2880
2551
|
fontFamily: "var(--vscode-editor-font-family, monospace)"
|
|
2881
2552
|
}
|
|
2882
2553
|
};
|
|
2883
|
-
class
|
|
2884
|
-
fixtureId:
|
|
2885
|
-
sessionName:
|
|
2886
|
-
daemon:
|
|
2554
|
+
class $r extends F({
|
|
2555
|
+
fixtureId: u.const(),
|
|
2556
|
+
sessionName: u.const(),
|
|
2557
|
+
daemon: u.const()
|
|
2887
2558
|
}) {
|
|
2888
2559
|
constructor(t) {
|
|
2889
2560
|
super(t);
|
|
2890
|
-
l(this, "screenshot",
|
|
2561
|
+
l(this, "screenshot", x(this, { status: "idle" }));
|
|
2891
2562
|
l(this, "_fetchVersion", 0);
|
|
2892
|
-
this._store.add(
|
|
2563
|
+
this._store.add(Ye((n) => {
|
|
2893
2564
|
this.props.daemon.sourceTreeIds.read(n).get(this.props.sessionName) && this._fetchScreenshot();
|
|
2894
2565
|
}));
|
|
2895
2566
|
}
|
|
@@ -2907,26 +2578,26 @@ class Wn extends M({
|
|
|
2907
2578
|
}
|
|
2908
2579
|
}
|
|
2909
2580
|
}
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2581
|
+
const Be = E(
|
|
2582
|
+
$r,
|
|
2912
2583
|
{},
|
|
2913
|
-
(
|
|
2914
|
-
const t = e.screenshot.read(
|
|
2584
|
+
(r, e) => {
|
|
2585
|
+
const t = e.screenshot.read(r);
|
|
2915
2586
|
if (t.status === "idle" || t.status === "loading")
|
|
2916
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2587
|
+
return /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("div", { style: z.shimmer }) });
|
|
2917
2588
|
if (t.status === "error")
|
|
2918
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2589
|
+
return /* @__PURE__ */ a("div", { style: z.error, children: /* @__PURE__ */ a("span", { style: z.errorText, children: "Screenshot failed" }) });
|
|
2919
2590
|
const { data: n } = t;
|
|
2920
2591
|
return n.image ? /* @__PURE__ */ a(
|
|
2921
2592
|
"img",
|
|
2922
2593
|
{
|
|
2923
2594
|
src: `data:image/png;base64,${n.image}`,
|
|
2924
|
-
style:
|
|
2595
|
+
style: z.image,
|
|
2925
2596
|
alt: `Screenshot of ${e.fixtureId}`
|
|
2926
2597
|
}
|
|
2927
|
-
) : /* @__PURE__ */ a("div", { style:
|
|
2598
|
+
) : /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("span", { style: z.hashText, children: n.hash.slice(0, 12) }) });
|
|
2928
2599
|
}
|
|
2929
|
-
),
|
|
2600
|
+
), z = {
|
|
2930
2601
|
placeholder: {
|
|
2931
2602
|
minHeight: 80,
|
|
2932
2603
|
display: "flex",
|
|
@@ -2969,18 +2640,18 @@ const je = B(
|
|
|
2969
2640
|
border: "1px solid var(--vscode-panel-border)"
|
|
2970
2641
|
}
|
|
2971
2642
|
};
|
|
2972
|
-
class
|
|
2973
|
-
fixtureId:
|
|
2974
|
-
daemon:
|
|
2975
|
-
baselineSession:
|
|
2976
|
-
currentSession:
|
|
2643
|
+
class Lr extends F({
|
|
2644
|
+
fixtureId: u.const(),
|
|
2645
|
+
daemon: u.const(),
|
|
2646
|
+
baselineSession: u.const(),
|
|
2647
|
+
currentSession: u.const()
|
|
2977
2648
|
}) {
|
|
2978
2649
|
constructor(t) {
|
|
2979
2650
|
super(t);
|
|
2980
|
-
l(this, "comparisonStatus",
|
|
2981
|
-
this._store.add(
|
|
2982
|
-
const
|
|
2983
|
-
|
|
2651
|
+
l(this, "comparisonStatus", x(this, { status: "loading" }));
|
|
2652
|
+
this._store.add(Ye((n) => {
|
|
2653
|
+
const s = this.props.daemon.sourceTreeIds.read(n), o = s.get(this.props.baselineSession), i = s.get(this.props.currentSession);
|
|
2654
|
+
o && i && this._fetchComparison();
|
|
2984
2655
|
}));
|
|
2985
2656
|
}
|
|
2986
2657
|
get fixtureId() {
|
|
@@ -3009,21 +2680,21 @@ class qn extends M({
|
|
|
3009
2680
|
}
|
|
3010
2681
|
}
|
|
3011
2682
|
}
|
|
3012
|
-
const
|
|
3013
|
-
|
|
2683
|
+
const Hr = E(
|
|
2684
|
+
Lr,
|
|
3014
2685
|
{},
|
|
3015
|
-
(
|
|
3016
|
-
const t = e.comparisonStatus.read(
|
|
3017
|
-
return /* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */ a("span", { style:
|
|
2686
|
+
(r, e) => {
|
|
2687
|
+
const t = e.comparisonStatus.read(r), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: w.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: w.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: w.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: w.badgeChanged, children: "● changed" });
|
|
2688
|
+
return /* @__PURE__ */ f("div", { style: w.fixtureRow, children: [
|
|
2689
|
+
/* @__PURE__ */ f("div", { style: w.fixtureLabel, children: [
|
|
2690
|
+
/* @__PURE__ */ a("span", { style: w.fixtureName, children: e.fixtureId }),
|
|
3020
2691
|
n
|
|
3021
2692
|
] }),
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */ a("span", { style:
|
|
2693
|
+
/* @__PURE__ */ f("div", { style: w.sideBySide, children: [
|
|
2694
|
+
/* @__PURE__ */ f("div", { style: w.screenshotColumn, children: [
|
|
2695
|
+
/* @__PURE__ */ a("span", { style: w.columnLabel, children: "Current" }),
|
|
3025
2696
|
/* @__PURE__ */ a(
|
|
3026
|
-
|
|
2697
|
+
Be,
|
|
3027
2698
|
{
|
|
3028
2699
|
fixtureId: e.fixtureId,
|
|
3029
2700
|
sessionName: e.currentSession,
|
|
@@ -3031,10 +2702,10 @@ const Kn = B(
|
|
|
3031
2702
|
}
|
|
3032
2703
|
)
|
|
3033
2704
|
] }),
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */ a("span", { style:
|
|
2705
|
+
/* @__PURE__ */ f("div", { style: w.screenshotColumn, children: [
|
|
2706
|
+
/* @__PURE__ */ a("span", { style: w.columnLabel, children: "Baseline" }),
|
|
3036
2707
|
/* @__PURE__ */ a(
|
|
3037
|
-
|
|
2708
|
+
Be,
|
|
3038
2709
|
{
|
|
3039
2710
|
fixtureId: e.fixtureId,
|
|
3040
2711
|
sessionName: e.baselineSession,
|
|
@@ -3045,19 +2716,19 @@ const Kn = B(
|
|
|
3045
2716
|
] })
|
|
3046
2717
|
] });
|
|
3047
2718
|
}
|
|
3048
|
-
),
|
|
2719
|
+
), jr = I(
|
|
3049
2720
|
{
|
|
3050
|
-
name:
|
|
3051
|
-
path:
|
|
3052
|
-
items:
|
|
3053
|
-
daemon:
|
|
3054
|
-
baselineSession:
|
|
3055
|
-
currentSession:
|
|
3056
|
-
},
|
|
3057
|
-
(
|
|
3058
|
-
/* @__PURE__ */ a("div", { style:
|
|
3059
|
-
/* @__PURE__ */ a("div", { style:
|
|
3060
|
-
|
|
2721
|
+
name: u.const(),
|
|
2722
|
+
path: u.const(),
|
|
2723
|
+
items: u.const(),
|
|
2724
|
+
daemon: u.const(),
|
|
2725
|
+
baselineSession: u.const(),
|
|
2726
|
+
currentSession: u.const()
|
|
2727
|
+
},
|
|
2728
|
+
(r, e) => /* @__PURE__ */ f("div", { children: [
|
|
2729
|
+
/* @__PURE__ */ a("div", { style: w.groupHeader, children: /* @__PURE__ */ a("span", { style: w.groupTitle, children: e.path }) }),
|
|
2730
|
+
/* @__PURE__ */ a("div", { style: w.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
|
|
2731
|
+
Hr,
|
|
3061
2732
|
{
|
|
3062
2733
|
fixtureId: t.fixtureId,
|
|
3063
2734
|
daemon: e.daemon,
|
|
@@ -3067,7 +2738,7 @@ const Kn = B(
|
|
|
3067
2738
|
t.fixtureId
|
|
3068
2739
|
)) })
|
|
3069
2740
|
] })
|
|
3070
|
-
),
|
|
2741
|
+
), w = {
|
|
3071
2742
|
groupHeader: {
|
|
3072
2743
|
marginBottom: 12
|
|
3073
2744
|
},
|
|
@@ -3135,107 +2806,273 @@ const Kn = B(
|
|
|
3135
2806
|
color: "var(--vscode-errorForeground)",
|
|
3136
2807
|
fontWeight: 500
|
|
3137
2808
|
}
|
|
3138
|
-
},
|
|
2809
|
+
}, q = 8;
|
|
2810
|
+
function dt(r, e) {
|
|
2811
|
+
return `
|
|
2812
|
+
linear-gradient(45deg, ${e} 25%, transparent 25%),
|
|
2813
|
+
linear-gradient(-45deg, ${e} 25%, transparent 25%),
|
|
2814
|
+
linear-gradient(45deg, transparent 75%, ${e} 75%),
|
|
2815
|
+
linear-gradient(-45deg, transparent 75%, ${e} 75%)
|
|
2816
|
+
`;
|
|
2817
|
+
}
|
|
2818
|
+
const Ur = {
|
|
2819
|
+
backgroundColor: "#ffffff",
|
|
2820
|
+
backgroundImage: dt("#ffffff", "#e5e5e5")
|
|
2821
|
+
}, Pr = {
|
|
2822
|
+
backgroundColor: "#1e1e1e",
|
|
2823
|
+
backgroundImage: dt("#1e1e1e", "#2d2d2d")
|
|
2824
|
+
}, Wr = {
|
|
2825
|
+
display: "inline-block",
|
|
2826
|
+
padding: "12px",
|
|
2827
|
+
borderRadius: "4px",
|
|
2828
|
+
backgroundSize: `${q * 2}px ${q * 2}px`,
|
|
2829
|
+
backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
|
|
2830
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
|
|
2831
|
+
};
|
|
2832
|
+
function Gr(r) {
|
|
2833
|
+
const e = r === "dark" ? Pr : Ur;
|
|
2834
|
+
return {
|
|
2835
|
+
...Wr,
|
|
2836
|
+
backgroundColor: e.backgroundColor,
|
|
2837
|
+
backgroundImage: e.backgroundImage
|
|
2838
|
+
};
|
|
2839
|
+
}
|
|
2840
|
+
function Ae({ src: r, alt: e, background: t }) {
|
|
2841
|
+
return /* @__PURE__ */ a("div", { style: Gr(t), children: /* @__PURE__ */ a("img", { src: r, alt: e, style: y.image }) });
|
|
2842
|
+
}
|
|
2843
|
+
const qr = I(
|
|
2844
|
+
{
|
|
2845
|
+
item: u.const(),
|
|
2846
|
+
reportModel: u.const()
|
|
2847
|
+
},
|
|
2848
|
+
(r, e) => {
|
|
2849
|
+
const { item: t, reportModel: n } = e, { entry: s } = t, o = s.background ?? "light", i = s.status === "unchanged" ? /* @__PURE__ */ a("span", { style: y.badgeMatch, children: "✓ match" }) : s.status === "changed" ? /* @__PURE__ */ a("span", { style: y.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: y.badgeAdded, children: "+ added" }), d = s.baselineScreenshot || s.currentScreenshot;
|
|
2850
|
+
return /* @__PURE__ */ f("div", { style: y.fixtureRow, children: [
|
|
2851
|
+
/* @__PURE__ */ f("div", { style: y.fixtureLabel, children: [
|
|
2852
|
+
/* @__PURE__ */ a("span", { style: y.fixtureName, children: t.fixtureId }),
|
|
2853
|
+
i
|
|
2854
|
+
] }),
|
|
2855
|
+
d && /* @__PURE__ */ f("div", { style: y.sideBySide, children: [
|
|
2856
|
+
s.baselineScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
|
|
2857
|
+
/* @__PURE__ */ a("span", { style: y.columnLabel, children: "Baseline" }),
|
|
2858
|
+
/* @__PURE__ */ a(
|
|
2859
|
+
Ae,
|
|
2860
|
+
{
|
|
2861
|
+
src: n.resolveScreenshotUrl(s.baselineScreenshot),
|
|
2862
|
+
alt: `Baseline screenshot of ${t.fixtureId}`,
|
|
2863
|
+
background: o
|
|
2864
|
+
}
|
|
2865
|
+
)
|
|
2866
|
+
] }),
|
|
2867
|
+
s.currentScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
|
|
2868
|
+
/* @__PURE__ */ a("span", { style: y.columnLabel, children: "Current" }),
|
|
2869
|
+
/* @__PURE__ */ a(
|
|
2870
|
+
Ae,
|
|
2871
|
+
{
|
|
2872
|
+
src: n.resolveScreenshotUrl(s.currentScreenshot),
|
|
2873
|
+
alt: `Current screenshot of ${t.fixtureId}`,
|
|
2874
|
+
background: o
|
|
2875
|
+
}
|
|
2876
|
+
)
|
|
2877
|
+
] })
|
|
2878
|
+
] }),
|
|
2879
|
+
!d && s.status === "unchanged" && /* @__PURE__ */ a("div", { style: y.hashRow, children: /* @__PURE__ */ f("span", { style: y.hashText, children: [
|
|
2880
|
+
"hash: ",
|
|
2881
|
+
s.targetHash
|
|
2882
|
+
] }) })
|
|
2883
|
+
] });
|
|
2884
|
+
}
|
|
2885
|
+
), Kr = I(
|
|
2886
|
+
{
|
|
2887
|
+
name: u.const(),
|
|
2888
|
+
path: u.const(),
|
|
2889
|
+
items: u.const(),
|
|
2890
|
+
reportModel: u.const()
|
|
2891
|
+
},
|
|
2892
|
+
(r, e) => /* @__PURE__ */ f("div", { children: [
|
|
2893
|
+
/* @__PURE__ */ a("div", { style: y.groupHeader, children: /* @__PURE__ */ a("span", { style: y.groupTitle, children: e.path }) }),
|
|
2894
|
+
/* @__PURE__ */ a("div", { style: y.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
|
|
2895
|
+
qr,
|
|
2896
|
+
{
|
|
2897
|
+
item: t,
|
|
2898
|
+
reportModel: e.reportModel
|
|
2899
|
+
},
|
|
2900
|
+
t.fixtureId
|
|
2901
|
+
)) })
|
|
2902
|
+
] })
|
|
2903
|
+
), y = {
|
|
2904
|
+
groupHeader: {
|
|
2905
|
+
marginBottom: 12
|
|
2906
|
+
},
|
|
2907
|
+
groupTitle: {
|
|
2908
|
+
fontSize: 13,
|
|
2909
|
+
fontWeight: 500,
|
|
2910
|
+
color: "var(--vscode-foreground)"
|
|
2911
|
+
},
|
|
2912
|
+
groupContent: {
|
|
2913
|
+
display: "flex",
|
|
2914
|
+
flexDirection: "column",
|
|
2915
|
+
gap: 24
|
|
2916
|
+
},
|
|
2917
|
+
fixtureRow: {
|
|
2918
|
+
display: "flex",
|
|
2919
|
+
flexDirection: "column",
|
|
2920
|
+
gap: 8
|
|
2921
|
+
},
|
|
2922
|
+
fixtureLabel: {
|
|
2923
|
+
display: "flex",
|
|
2924
|
+
alignItems: "center",
|
|
2925
|
+
gap: 8
|
|
2926
|
+
},
|
|
2927
|
+
fixtureName: {
|
|
2928
|
+
fontSize: 12,
|
|
2929
|
+
fontWeight: 500,
|
|
2930
|
+
color: "var(--vscode-foreground)"
|
|
2931
|
+
},
|
|
2932
|
+
sideBySide: {
|
|
2933
|
+
display: "flex",
|
|
2934
|
+
flexDirection: "row",
|
|
2935
|
+
gap: 16
|
|
2936
|
+
},
|
|
2937
|
+
screenshotColumn: {
|
|
2938
|
+
display: "flex",
|
|
2939
|
+
flexDirection: "column",
|
|
2940
|
+
gap: 4
|
|
2941
|
+
},
|
|
2942
|
+
columnLabel: {
|
|
2943
|
+
fontSize: 11,
|
|
2944
|
+
fontWeight: 500,
|
|
2945
|
+
color: "var(--vscode-descriptionForeground)",
|
|
2946
|
+
textTransform: "uppercase",
|
|
2947
|
+
letterSpacing: "0.05em"
|
|
2948
|
+
},
|
|
2949
|
+
image: {
|
|
2950
|
+
display: "block"
|
|
2951
|
+
},
|
|
2952
|
+
hashRow: {
|
|
2953
|
+
padding: "8px 0"
|
|
2954
|
+
},
|
|
2955
|
+
hashText: {
|
|
2956
|
+
fontSize: 11,
|
|
2957
|
+
color: "var(--vscode-descriptionForeground)",
|
|
2958
|
+
fontFamily: "monospace"
|
|
2959
|
+
},
|
|
2960
|
+
badgeMatch: {
|
|
2961
|
+
fontSize: 11,
|
|
2962
|
+
color: "var(--vscode-testing-iconPassed)",
|
|
2963
|
+
fontWeight: 500
|
|
2964
|
+
},
|
|
2965
|
+
badgeChanged: {
|
|
2966
|
+
fontSize: 11,
|
|
2967
|
+
color: "var(--vscode-testing-iconFailed)",
|
|
2968
|
+
fontWeight: 500
|
|
2969
|
+
},
|
|
2970
|
+
badgeAdded: {
|
|
2971
|
+
fontSize: 11,
|
|
2972
|
+
color: "var(--vscode-testing-iconQueued)",
|
|
2973
|
+
fontWeight: 500
|
|
2974
|
+
}
|
|
2975
|
+
}, ct = "component-explorer:fixtureHeights", ze = 500;
|
|
3139
2976
|
let V = null;
|
|
3140
|
-
function
|
|
2977
|
+
function lt() {
|
|
3141
2978
|
if (V !== null) return V;
|
|
3142
2979
|
try {
|
|
3143
|
-
const
|
|
3144
|
-
if (
|
|
3145
|
-
return V = JSON.parse(
|
|
2980
|
+
const r = localStorage.getItem(ct);
|
|
2981
|
+
if (r)
|
|
2982
|
+
return V = JSON.parse(r), V;
|
|
3146
2983
|
} catch {
|
|
3147
2984
|
}
|
|
3148
2985
|
return V = {}, V;
|
|
3149
2986
|
}
|
|
3150
|
-
function
|
|
2987
|
+
function Jr() {
|
|
3151
2988
|
if (V !== null)
|
|
3152
2989
|
try {
|
|
3153
|
-
const
|
|
3154
|
-
|
|
2990
|
+
const r = Object.entries(V);
|
|
2991
|
+
r.length > ze && (V = Object.fromEntries(r.slice(-ze))), localStorage.setItem(ct, JSON.stringify(V));
|
|
3155
2992
|
} catch {
|
|
3156
2993
|
}
|
|
3157
2994
|
}
|
|
3158
|
-
function
|
|
3159
|
-
const t =
|
|
3160
|
-
t[
|
|
2995
|
+
function Zr(r, e) {
|
|
2996
|
+
const t = lt();
|
|
2997
|
+
t[r] = e, Jr();
|
|
3161
2998
|
}
|
|
3162
|
-
function
|
|
3163
|
-
return new Map(Object.entries(
|
|
2999
|
+
function Xr() {
|
|
3000
|
+
return new Map(Object.entries(lt()));
|
|
3164
3001
|
}
|
|
3165
|
-
const
|
|
3166
|
-
function
|
|
3002
|
+
const Yr = 280, Qr = 32, re = 32, $e = 400, ht = "component-explorer:scrollAnchors", Le = 100;
|
|
3003
|
+
function ut() {
|
|
3167
3004
|
try {
|
|
3168
|
-
const
|
|
3169
|
-
if (
|
|
3005
|
+
const r = localStorage.getItem(ht);
|
|
3006
|
+
if (r) return JSON.parse(r);
|
|
3170
3007
|
} catch {
|
|
3171
3008
|
}
|
|
3172
3009
|
return {};
|
|
3173
3010
|
}
|
|
3174
|
-
function
|
|
3011
|
+
function en(r, e) {
|
|
3175
3012
|
try {
|
|
3176
|
-
const t =
|
|
3177
|
-
t[
|
|
3178
|
-
const n = Object.entries(t),
|
|
3179
|
-
localStorage.setItem(
|
|
3013
|
+
const t = ut();
|
|
3014
|
+
t[r] = e;
|
|
3015
|
+
const n = Object.entries(t), s = n.length > Le ? Object.fromEntries(n.slice(-Le)) : t;
|
|
3016
|
+
localStorage.setItem(ht, JSON.stringify(s));
|
|
3180
3017
|
} catch {
|
|
3181
3018
|
}
|
|
3182
3019
|
}
|
|
3183
|
-
function
|
|
3184
|
-
return
|
|
3020
|
+
function tn(r) {
|
|
3021
|
+
return ut()[r];
|
|
3185
3022
|
}
|
|
3186
|
-
function
|
|
3187
|
-
return
|
|
3023
|
+
function ft(r) {
|
|
3024
|
+
return r.type === "single" ? r.fixture.id : r.id;
|
|
3188
3025
|
}
|
|
3189
|
-
function
|
|
3190
|
-
const t = new Array(
|
|
3191
|
-
let n =
|
|
3192
|
-
for (let
|
|
3193
|
-
const
|
|
3194
|
-
t[
|
|
3026
|
+
function rn(r, e) {
|
|
3027
|
+
const t = new Array(r.length);
|
|
3028
|
+
let n = re;
|
|
3029
|
+
for (let s = 0; s < r.length; s++) {
|
|
3030
|
+
const o = e.get(ft(r[s])) ?? Yr;
|
|
3031
|
+
t[s] = { top: n, height: o }, n += o + Qr;
|
|
3195
3032
|
}
|
|
3196
3033
|
return t;
|
|
3197
3034
|
}
|
|
3198
|
-
function
|
|
3199
|
-
if (
|
|
3200
|
-
const e =
|
|
3201
|
-
return e.top + e.height +
|
|
3035
|
+
function nn(r) {
|
|
3036
|
+
if (r.length === 0) return 0;
|
|
3037
|
+
const e = r[r.length - 1];
|
|
3038
|
+
return e.top + e.height + re;
|
|
3202
3039
|
}
|
|
3203
|
-
function
|
|
3204
|
-
let t = 0, n =
|
|
3040
|
+
function pt(r, e) {
|
|
3041
|
+
let t = 0, n = r.length;
|
|
3205
3042
|
for (; t < n; ) {
|
|
3206
|
-
const
|
|
3207
|
-
s
|
|
3043
|
+
const s = t + n >> 1;
|
|
3044
|
+
r[s].top + r[s].height < e ? t = s + 1 : n = s;
|
|
3208
3045
|
}
|
|
3209
3046
|
return t;
|
|
3210
3047
|
}
|
|
3211
|
-
function
|
|
3212
|
-
if (
|
|
3213
|
-
const n =
|
|
3214
|
-
let
|
|
3215
|
-
const
|
|
3216
|
-
for (;
|
|
3217
|
-
|
|
3218
|
-
return { start: n, end:
|
|
3219
|
-
}
|
|
3220
|
-
function
|
|
3221
|
-
if (
|
|
3222
|
-
const t =
|
|
3048
|
+
function sn(r, e, t) {
|
|
3049
|
+
if (r.length === 0) return { start: 0, end: 0 };
|
|
3050
|
+
const n = pt(r, e - $e);
|
|
3051
|
+
let s = n;
|
|
3052
|
+
const o = e + t + $e;
|
|
3053
|
+
for (; s < r.length && r[s].top < o; )
|
|
3054
|
+
s++;
|
|
3055
|
+
return { start: n, end: s };
|
|
3056
|
+
}
|
|
3057
|
+
function He(r, e) {
|
|
3058
|
+
if (r.length === 0) return;
|
|
3059
|
+
const t = pt(r, e), n = Math.min(t, r.length - 1);
|
|
3223
3060
|
return {
|
|
3224
3061
|
rowIndex: n,
|
|
3225
|
-
offsetFromViewport:
|
|
3062
|
+
offsetFromViewport: r[n].top - e
|
|
3226
3063
|
};
|
|
3227
3064
|
}
|
|
3228
|
-
function
|
|
3229
|
-
return e.rowIndex >=
|
|
3065
|
+
function je(r, e) {
|
|
3066
|
+
return e.rowIndex >= r.length ? 0 : r[e.rowIndex].top - e.offsetFromViewport;
|
|
3230
3067
|
}
|
|
3231
|
-
class
|
|
3232
|
-
model:
|
|
3068
|
+
class on extends F({
|
|
3069
|
+
model: u.const()
|
|
3233
3070
|
}) {
|
|
3234
3071
|
constructor() {
|
|
3235
3072
|
super(...arguments);
|
|
3236
|
-
l(this, "_rowHeights",
|
|
3237
|
-
l(this, "_scrollTop",
|
|
3238
|
-
l(this, "_viewportHeight",
|
|
3073
|
+
l(this, "_rowHeights", x(this, Xr()));
|
|
3074
|
+
l(this, "_scrollTop", x(this, 0));
|
|
3075
|
+
l(this, "_viewportHeight", x(this, 0));
|
|
3239
3076
|
l(this, "_scrollContainerRef", null);
|
|
3240
3077
|
l(this, "_resizeObserver", null);
|
|
3241
3078
|
l(this, "_viewportResizeObserver", null);
|
|
@@ -3243,41 +3080,41 @@ class os extends M({
|
|
|
3243
3080
|
l(this, "_scrollSaveTimeout", null);
|
|
3244
3081
|
l(this, "_suppressScrollHandler", !1);
|
|
3245
3082
|
l(this, "layout", N(this, (t) => {
|
|
3246
|
-
const n = this.explorerModel.selectedFixtures.read(t),
|
|
3247
|
-
return
|
|
3083
|
+
const n = this.explorerModel.selectedFixtures.read(t), s = this._rowHeights.read(t);
|
|
3084
|
+
return rn(n, s);
|
|
3248
3085
|
}));
|
|
3249
3086
|
l(this, "visibleRowRange", N(this, (t) => {
|
|
3250
|
-
const n = this.layout.read(t),
|
|
3251
|
-
return
|
|
3087
|
+
const n = this.layout.read(t), s = this._scrollTop.read(t), o = this._viewportHeight.read(t);
|
|
3088
|
+
return sn(n, s, o);
|
|
3252
3089
|
}));
|
|
3253
3090
|
l(this, "setScrollContainerRef", (t) => {
|
|
3254
3091
|
var n;
|
|
3255
|
-
this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef = t, t && (t.addEventListener("scroll", this._handleScroll, { passive: !0 }), this._viewportHeight.set(t.clientHeight, void 0), this._viewportResizeObserver = new ResizeObserver(([
|
|
3256
|
-
this._viewportHeight.set(Math.round(
|
|
3092
|
+
this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef = t, t && (t.addEventListener("scroll", this._handleScroll, { passive: !0 }), this._viewportHeight.set(t.clientHeight, void 0), this._viewportResizeObserver = new ResizeObserver(([s]) => {
|
|
3093
|
+
this._viewportHeight.set(Math.round(s.contentRect.height), void 0);
|
|
3257
3094
|
}), this._viewportResizeObserver.observe(t), this._restoreScrollPosition());
|
|
3258
3095
|
});
|
|
3259
3096
|
l(this, "_handleScroll", () => {
|
|
3260
3097
|
this._scrollContainerRef && (this._scrollTop.set(this._scrollContainerRef.scrollTop, void 0), !(this._suppressScrollHandler || !this._currentNodeId) && (this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
|
|
3261
3098
|
if (!this._currentNodeId) return;
|
|
3262
|
-
const t = this.layout.get(), n =
|
|
3263
|
-
n &&
|
|
3099
|
+
const t = this.layout.get(), n = He(t, this._scrollTop.get());
|
|
3100
|
+
n && en(this._currentNodeId, n);
|
|
3264
3101
|
}, 150)));
|
|
3265
3102
|
});
|
|
3266
3103
|
l(this, "observeRowElement", (t, n) => {
|
|
3267
|
-
t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((
|
|
3268
|
-
const
|
|
3269
|
-
let
|
|
3270
|
-
for (const d of
|
|
3104
|
+
t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((s) => {
|
|
3105
|
+
const o = this._rowHeights.get();
|
|
3106
|
+
let i;
|
|
3107
|
+
for (const d of s) {
|
|
3271
3108
|
const c = d.target.getAttribute("data-row-id");
|
|
3272
3109
|
if (!c) continue;
|
|
3273
3110
|
const h = Math.round(d.contentRect.height);
|
|
3274
|
-
h > 0 &&
|
|
3111
|
+
h > 0 && o.get(c) !== h && (i || (i = new Map(o)), i.set(c, h), Zr(c, h));
|
|
3275
3112
|
}
|
|
3276
|
-
if (
|
|
3277
|
-
const d = this.layout.get(), c =
|
|
3278
|
-
if (this._rowHeights.set(
|
|
3279
|
-
const h = this.layout.get(),
|
|
3280
|
-
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop =
|
|
3113
|
+
if (i) {
|
|
3114
|
+
const d = this.layout.get(), c = He(d, this._scrollTop.get());
|
|
3115
|
+
if (this._rowHeights.set(i, void 0), c && this._scrollContainerRef) {
|
|
3116
|
+
const h = this.layout.get(), g = je(h, c);
|
|
3117
|
+
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = g, this._scrollTop.set(g, void 0), requestAnimationFrame(() => {
|
|
3281
3118
|
this._suppressScrollHandler = !1;
|
|
3282
3119
|
});
|
|
3283
3120
|
}
|
|
@@ -3293,10 +3130,10 @@ class os extends M({
|
|
|
3293
3130
|
}
|
|
3294
3131
|
_restoreScrollPosition() {
|
|
3295
3132
|
if (!this._scrollContainerRef || !this._currentNodeId) return;
|
|
3296
|
-
const t =
|
|
3133
|
+
const t = tn(this._currentNodeId);
|
|
3297
3134
|
if (!t) return;
|
|
3298
|
-
const n = this.layout.get(),
|
|
3299
|
-
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop =
|
|
3135
|
+
const n = this.layout.get(), s = je(n, t);
|
|
3136
|
+
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = s, this._scrollTop.set(s, void 0), requestAnimationFrame(() => {
|
|
3300
3137
|
this._suppressScrollHandler = !1;
|
|
3301
3138
|
});
|
|
3302
3139
|
}
|
|
@@ -3305,23 +3142,35 @@ class os extends M({
|
|
|
3305
3142
|
(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
3143
|
}
|
|
3307
3144
|
}
|
|
3308
|
-
const
|
|
3309
|
-
|
|
3145
|
+
const an = E(
|
|
3146
|
+
on,
|
|
3310
3147
|
{},
|
|
3311
|
-
(
|
|
3312
|
-
const t = e.explorerModel.selectedFixtures.read(
|
|
3313
|
-
if (e.updateForSelection(n), t.length === 0)
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3148
|
+
(r, e) => {
|
|
3149
|
+
const t = e.explorerModel.selectedFixtures.read(r), n = e.explorerModel.selectedNodeId.read(r), s = e.layout.read(r), { start: o, end: i } = e.visibleRowRange.read(r);
|
|
3150
|
+
if (e.updateForSelection(n), t.length === 0) {
|
|
3151
|
+
const c = e.explorerModel.reportModel;
|
|
3152
|
+
if (c) {
|
|
3153
|
+
const h = c.state.read(r);
|
|
3154
|
+
if (h.status === "loading")
|
|
3155
|
+
return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ a("span", { style: k.emptyText, children: "Loading report..." }) });
|
|
3156
|
+
if (h.status === "error")
|
|
3157
|
+
return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ f("span", { style: { ...k.emptyText, color: "var(--vscode-errorForeground)" }, children: [
|
|
3158
|
+
"Failed to load report: ",
|
|
3159
|
+
h.message
|
|
3160
|
+
] }) });
|
|
3161
|
+
}
|
|
3162
|
+
return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ a("span", { style: k.emptyText, children: "Select a component or folder to preview" }) });
|
|
3163
|
+
}
|
|
3164
|
+
const d = nn(s);
|
|
3165
|
+
return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: k.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(o, i).map((c, h) => {
|
|
3166
|
+
const g = o + h, { top: _ } = s[g], C = ft(c);
|
|
3318
3167
|
return /* @__PURE__ */ a(
|
|
3319
3168
|
"div",
|
|
3320
3169
|
{
|
|
3321
|
-
ref: (
|
|
3322
|
-
style: { position: "absolute", top:
|
|
3323
|
-
children: c.type === "single" ? /* @__PURE__ */ a(
|
|
3324
|
-
|
|
3170
|
+
ref: (m) => e.observeRowElement(m, C),
|
|
3171
|
+
style: { position: "absolute", top: _, left: re, right: re },
|
|
3172
|
+
children: c.type === "single" ? /* @__PURE__ */ a(it, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(dn, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
|
|
3173
|
+
jr,
|
|
3325
3174
|
{
|
|
3326
3175
|
name: c.name,
|
|
3327
3176
|
path: c.path,
|
|
@@ -3330,22 +3179,30 @@ const as = B(
|
|
|
3330
3179
|
baselineSession: "baseline",
|
|
3331
3180
|
currentSession: "current"
|
|
3332
3181
|
}
|
|
3182
|
+
) : c.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
|
|
3183
|
+
Kr,
|
|
3184
|
+
{
|
|
3185
|
+
name: c.name,
|
|
3186
|
+
path: c.path,
|
|
3187
|
+
items: c.items,
|
|
3188
|
+
reportModel: e.explorerModel.reportModel
|
|
3189
|
+
}
|
|
3333
3190
|
) : null
|
|
3334
3191
|
},
|
|
3335
|
-
|
|
3192
|
+
C
|
|
3336
3193
|
);
|
|
3337
3194
|
}) }) });
|
|
3338
3195
|
}
|
|
3339
|
-
),
|
|
3340
|
-
{ row:
|
|
3341
|
-
(
|
|
3196
|
+
), dn = I(
|
|
3197
|
+
{ row: u.const() },
|
|
3198
|
+
(r, e) => {
|
|
3342
3199
|
const t = e.row;
|
|
3343
|
-
return /* @__PURE__ */
|
|
3344
|
-
/* @__PURE__ */ a("div", { style:
|
|
3345
|
-
/* @__PURE__ */ a("div", { style:
|
|
3200
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
3201
|
+
/* @__PURE__ */ a("div", { style: k.variantsHeader, children: /* @__PURE__ */ a("span", { style: k.variantsTitle, children: t.path }) }),
|
|
3202
|
+
/* @__PURE__ */ a("div", { style: k.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(it, { fixture: n, compact: !0 }, n.id)) })
|
|
3346
3203
|
] });
|
|
3347
3204
|
}
|
|
3348
|
-
),
|
|
3205
|
+
), k = {
|
|
3349
3206
|
scrollContainer: {
|
|
3350
3207
|
flex: 1,
|
|
3351
3208
|
overflow: "auto",
|
|
@@ -3376,100 +3233,58 @@ const as = B(
|
|
|
3376
3233
|
flexWrap: "wrap",
|
|
3377
3234
|
gap: "16px"
|
|
3378
3235
|
}
|
|
3379
|
-
},
|
|
3380
|
-
|
|
3381
|
-
{ daemonModel:
|
|
3382
|
-
(
|
|
3383
|
-
const t = e.leftSidebarVisible.read(
|
|
3384
|
-
return /* @__PURE__ */
|
|
3385
|
-
t && /* @__PURE__ */ a(
|
|
3386
|
-
/* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */ a(
|
|
3388
|
-
/* @__PURE__ */ a(
|
|
3236
|
+
}, cn = E(
|
|
3237
|
+
gr,
|
|
3238
|
+
{ daemonModel: u.const(), reportModel: u.const() },
|
|
3239
|
+
(r, e) => {
|
|
3240
|
+
const t = e.leftSidebarVisible.read(r), n = e.rightSidebarVisible.read(r), s = e.isDarkTheme.read(r), o = e.selectedNode.read(r);
|
|
3241
|
+
return /* @__PURE__ */ f("div", { className: s ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: p.container, children: [
|
|
3242
|
+
t && /* @__PURE__ */ a(kr, { model: e }),
|
|
3243
|
+
/* @__PURE__ */ f("div", { style: p.centerArea, children: [
|
|
3244
|
+
/* @__PURE__ */ a(Tr, { model: e }),
|
|
3245
|
+
/* @__PURE__ */ a(an, { model: e })
|
|
3389
3246
|
] }),
|
|
3390
|
-
n && /* @__PURE__ */ a(
|
|
3247
|
+
n && /* @__PURE__ */ a(Mr, { selectedNode: o })
|
|
3391
3248
|
] });
|
|
3392
3249
|
}
|
|
3393
3250
|
);
|
|
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 {
|
|
3251
|
+
var ln = class fe {
|
|
3440
3252
|
constructor(e) {
|
|
3441
3253
|
this.iterator = e;
|
|
3442
3254
|
}
|
|
3443
3255
|
static fromIterable(e) {
|
|
3444
|
-
return new
|
|
3256
|
+
return new fe(e[Symbol.asyncIterator]());
|
|
3445
3257
|
}
|
|
3446
3258
|
static fromFn(e) {
|
|
3447
|
-
return new
|
|
3259
|
+
return new fe(e());
|
|
3448
3260
|
}
|
|
3449
3261
|
[Symbol.asyncIterator]() {
|
|
3450
3262
|
return this.iterator;
|
|
3451
3263
|
}
|
|
3452
|
-
},
|
|
3453
|
-
constructor(
|
|
3454
|
-
super(t), this.statusCode =
|
|
3264
|
+
}, hn = class extends Error {
|
|
3265
|
+
constructor(r, e, t) {
|
|
3266
|
+
super(t), this.statusCode = r, this.method = e, this.name = "ApiError";
|
|
3455
3267
|
}
|
|
3456
|
-
},
|
|
3457
|
-
constructor(
|
|
3268
|
+
}, un = class {
|
|
3269
|
+
constructor(r) {
|
|
3458
3270
|
l(this, "methods", this._createProxy(""));
|
|
3459
|
-
this._request =
|
|
3271
|
+
this._request = r;
|
|
3460
3272
|
}
|
|
3461
|
-
_createProxy(
|
|
3273
|
+
_createProxy(r) {
|
|
3462
3274
|
return new Proxy(() => {
|
|
3463
3275
|
}, {
|
|
3464
|
-
apply: async (e, t, n) => await this._request(
|
|
3465
|
-
get: (e, t) =>
|
|
3276
|
+
apply: async (e, t, n) => await this._request(r, n[0]),
|
|
3277
|
+
get: (e, t) => {
|
|
3278
|
+
if (typeof t != "symbol" && !(t === "then" || t === "catch" || t === "finally" || t === "toString" || t === "valueOf" || t === "toJSON" || t === "name" || t === "length" || t === "prototype" || t === "constructor" || t === "caller" || t === "arguments"))
|
|
3279
|
+
return this._createProxy(`${r}${r ? "/" : ""}${t}`);
|
|
3280
|
+
}
|
|
3466
3281
|
});
|
|
3467
3282
|
}
|
|
3468
3283
|
};
|
|
3469
|
-
function
|
|
3470
|
-
return new
|
|
3284
|
+
function fn(r, e) {
|
|
3285
|
+
return new un(async (t, n) => {
|
|
3471
3286
|
var d;
|
|
3472
|
-
const
|
|
3287
|
+
const s = await fetch(`${r}/${t}`, {
|
|
3473
3288
|
method: "POST",
|
|
3474
3289
|
headers: {
|
|
3475
3290
|
"Content-Type": "application/json",
|
|
@@ -3477,40 +3292,40 @@ function fs(s, e) {
|
|
|
3477
3292
|
},
|
|
3478
3293
|
body: JSON.stringify(n)
|
|
3479
3294
|
});
|
|
3480
|
-
if (
|
|
3481
|
-
const c = await
|
|
3295
|
+
if (s.status !== 200) {
|
|
3296
|
+
const c = await s.json().catch(() => null);
|
|
3482
3297
|
let h;
|
|
3483
|
-
throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${
|
|
3298
|
+
throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${s.status}, Status Text: ${s.statusText})`, new hn(s.status, t, h);
|
|
3484
3299
|
}
|
|
3485
|
-
const
|
|
3486
|
-
return
|
|
3487
|
-
var
|
|
3488
|
-
const c = (
|
|
3300
|
+
const o = s.headers.get("Content-Type");
|
|
3301
|
+
return o != null && o.startsWith("application/jsonl") ? ln.fromFn(async function* () {
|
|
3302
|
+
var C;
|
|
3303
|
+
const c = (C = s.body) == null ? void 0 : C.getReader();
|
|
3489
3304
|
if (!c)
|
|
3490
3305
|
return;
|
|
3491
3306
|
let h = "";
|
|
3492
|
-
const
|
|
3307
|
+
const g = new TextDecoder("utf-8");
|
|
3493
3308
|
for (; ; ) {
|
|
3494
|
-
const { done:
|
|
3495
|
-
if (
|
|
3309
|
+
const { done: m, value: v } = await c.read();
|
|
3310
|
+
if (m)
|
|
3496
3311
|
break;
|
|
3497
|
-
h +=
|
|
3498
|
-
let
|
|
3499
|
-
for (; (
|
|
3312
|
+
h += g.decode(v, { stream: !0 });
|
|
3313
|
+
let O;
|
|
3314
|
+
for (; (O = h.indexOf(`
|
|
3500
3315
|
`)) >= 0; ) {
|
|
3501
|
-
const
|
|
3502
|
-
h = h.slice(
|
|
3316
|
+
const S = h.slice(0, O).trim();
|
|
3317
|
+
h = h.slice(O + 1), S.length > 0 && (yield JSON.parse(S));
|
|
3503
3318
|
}
|
|
3504
3319
|
}
|
|
3505
|
-
const
|
|
3506
|
-
|
|
3507
|
-
}) : await
|
|
3320
|
+
const _ = h.trim();
|
|
3321
|
+
_.length > 0 && (yield JSON.parse(_));
|
|
3322
|
+
}) : await s.json();
|
|
3508
3323
|
});
|
|
3509
3324
|
}
|
|
3510
|
-
class
|
|
3325
|
+
class pn {
|
|
3511
3326
|
constructor(e) {
|
|
3512
|
-
l(this, "_sourceTreeIds",
|
|
3513
|
-
l(this, "_sessions",
|
|
3327
|
+
l(this, "_sourceTreeIds", x(this, /* @__PURE__ */ new Map()));
|
|
3328
|
+
l(this, "_sessions", x(this, []));
|
|
3514
3329
|
l(this, "_screenshotCache", /* @__PURE__ */ new Map());
|
|
3515
3330
|
l(this, "_client");
|
|
3516
3331
|
l(this, "_eventStreamAbort", null);
|
|
@@ -3519,7 +3334,7 @@ class ps {
|
|
|
3519
3334
|
l(this, "sourceTreeIds", this._sourceTreeIds);
|
|
3520
3335
|
/** Observable list of sessions from the daemon */
|
|
3521
3336
|
l(this, "sessions", this._sessions);
|
|
3522
|
-
this.config = e, this.sessionName = e.sessionName, this._client =
|
|
3337
|
+
this.config = e, this.sessionName = e.sessionName, this._client = fn("/__explorer/daemon-api");
|
|
3523
3338
|
}
|
|
3524
3339
|
/**
|
|
3525
3340
|
* Initializes the model: fetches initial session info and starts listening to events.
|
|
@@ -3536,30 +3351,30 @@ class ps {
|
|
|
3536
3351
|
const n = this._sourceTreeIds.get().get(e);
|
|
3537
3352
|
if (!n)
|
|
3538
3353
|
throw new Error(`No sourceTreeId known for session '${e}'`);
|
|
3539
|
-
const
|
|
3540
|
-
if (
|
|
3541
|
-
return
|
|
3542
|
-
const
|
|
3354
|
+
const s = `${e}:${t}`, o = this._screenshotCache.get(s);
|
|
3355
|
+
if (o && o.sourceTreeId === n)
|
|
3356
|
+
return o.data;
|
|
3357
|
+
const i = await this._client.methods.screenshots.take({
|
|
3543
3358
|
fixtureId: t,
|
|
3544
3359
|
sessionName: e,
|
|
3545
3360
|
sourceTreeId: n,
|
|
3546
3361
|
includeImage: !0
|
|
3547
3362
|
});
|
|
3548
|
-
return this._screenshotCache.set(
|
|
3363
|
+
return this._screenshotCache.set(s, { sourceTreeId: n, data: i }), i;
|
|
3549
3364
|
}
|
|
3550
3365
|
/**
|
|
3551
3366
|
* Compare a fixture across two sessions. Returns match status and hashes (no images).
|
|
3552
3367
|
*/
|
|
3553
3368
|
async compare(e, t, n) {
|
|
3554
|
-
const
|
|
3555
|
-
if (!
|
|
3369
|
+
const s = this._sourceTreeIds.get().get(t), o = this._sourceTreeIds.get().get(n);
|
|
3370
|
+
if (!s || !o)
|
|
3556
3371
|
throw new Error("Missing sourceTreeId for sessions");
|
|
3557
3372
|
return this._client.methods.screenshots.compare({
|
|
3558
3373
|
fixtureId: e,
|
|
3559
3374
|
baselineSessionName: t,
|
|
3560
|
-
baselineSourceTreeId:
|
|
3375
|
+
baselineSourceTreeId: s,
|
|
3561
3376
|
currentSessionName: n,
|
|
3562
|
-
currentSourceTreeId:
|
|
3377
|
+
currentSourceTreeId: o,
|
|
3563
3378
|
includeImages: !1
|
|
3564
3379
|
});
|
|
3565
3380
|
}
|
|
@@ -3589,8 +3404,8 @@ class ps {
|
|
|
3589
3404
|
// ---------------------------------------------------------------------------
|
|
3590
3405
|
async _fetchSessionInfos() {
|
|
3591
3406
|
const e = await this._client.methods.sessions(), t = /* @__PURE__ */ new Map(), n = [];
|
|
3592
|
-
for (const
|
|
3593
|
-
t.set(
|
|
3407
|
+
for (const s of e)
|
|
3408
|
+
t.set(s.name, s.sourceTreeId), n.push({ name: s.name, serverUrl: s.serverUrl });
|
|
3594
3409
|
this._sourceTreeIds.set(t, void 0), this._sessions.set(n, void 0);
|
|
3595
3410
|
}
|
|
3596
3411
|
async _startEventStream() {
|
|
@@ -3617,21 +3432,81 @@ class ps {
|
|
|
3617
3432
|
}
|
|
3618
3433
|
}
|
|
3619
3434
|
}
|
|
3620
|
-
function
|
|
3435
|
+
function gn() {
|
|
3621
3436
|
return window.__EXPLORER_DAEMON__;
|
|
3622
3437
|
}
|
|
3623
|
-
class
|
|
3438
|
+
class mn {
|
|
3439
|
+
constructor(e) {
|
|
3440
|
+
l(this, "state", x(this, { status: "loading" }));
|
|
3441
|
+
l(this, "_baseUrl");
|
|
3442
|
+
this.reportUrl = e;
|
|
3443
|
+
const t = e.lastIndexOf("/");
|
|
3444
|
+
this._baseUrl = t >= 0 ? e.slice(0, t + 1) : "", this._fetch();
|
|
3445
|
+
}
|
|
3446
|
+
resolveScreenshotUrl(e) {
|
|
3447
|
+
return this._baseUrl + e;
|
|
3448
|
+
}
|
|
3449
|
+
buildTree(e) {
|
|
3450
|
+
const t = this.state.read(e);
|
|
3451
|
+
return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : vn(t.report.fixtures);
|
|
3452
|
+
}
|
|
3453
|
+
async _fetch() {
|
|
3454
|
+
this.state.set({ status: "loading" }, void 0);
|
|
3455
|
+
try {
|
|
3456
|
+
const e = await fetch(this.reportUrl);
|
|
3457
|
+
if (!e.ok)
|
|
3458
|
+
throw new Error(`HTTP ${e.status}: ${e.statusText}`);
|
|
3459
|
+
const t = await e.json();
|
|
3460
|
+
this.state.set({ status: "ready", report: t }, void 0);
|
|
3461
|
+
} catch (e) {
|
|
3462
|
+
this.state.set({ status: "error", message: String(e) }, void 0);
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
function vn(r) {
|
|
3467
|
+
const e = { id: "", name: "Components", type: "folder", children: [] };
|
|
3468
|
+
for (const [t, n] of Object.entries(r)) {
|
|
3469
|
+
const s = t.split("/");
|
|
3470
|
+
let o = e;
|
|
3471
|
+
for (let i = 0; i < s.length; i++) {
|
|
3472
|
+
const d = s[i], c = i === s.length - 1, h = s.slice(0, i + 1).join("/");
|
|
3473
|
+
if (c)
|
|
3474
|
+
o.children.push({
|
|
3475
|
+
id: h,
|
|
3476
|
+
name: d,
|
|
3477
|
+
type: "component",
|
|
3478
|
+
reportEntry: n
|
|
3479
|
+
});
|
|
3480
|
+
else {
|
|
3481
|
+
let g = o.children.find((_) => _.type === "folder" && _.name === d);
|
|
3482
|
+
g || (g = { id: h, name: d, type: "folder", children: [] }, o.children.push(g)), o = g;
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
return e;
|
|
3487
|
+
}
|
|
3488
|
+
class Vn {
|
|
3624
3489
|
constructor(e, t) {
|
|
3625
3490
|
l(this, "_root");
|
|
3626
|
-
l(this, "_registry", new
|
|
3491
|
+
l(this, "_registry", new sr());
|
|
3627
3492
|
l(this, "_daemonModel");
|
|
3628
|
-
|
|
3493
|
+
l(this, "_reportModel");
|
|
3494
|
+
this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = _t(e), this._root.render(Ct(cn, {
|
|
3495
|
+
registry: this._registry,
|
|
3496
|
+
daemonModel: this._daemonModel,
|
|
3497
|
+
reportModel: this._reportModel
|
|
3498
|
+
}));
|
|
3499
|
+
}
|
|
3500
|
+
_initializeReportModel() {
|
|
3501
|
+
const t = new URLSearchParams(location.search).get("report");
|
|
3502
|
+
if (t)
|
|
3503
|
+
return new mn(t);
|
|
3629
3504
|
}
|
|
3630
3505
|
_initializeDaemonModel() {
|
|
3631
|
-
const e =
|
|
3506
|
+
const e = gn();
|
|
3632
3507
|
if (!e)
|
|
3633
3508
|
return;
|
|
3634
|
-
const t = new
|
|
3509
|
+
const t = new pn(e);
|
|
3635
3510
|
return t.initialize().catch((n) => {
|
|
3636
3511
|
console.error("[ExplorerApp] Failed to initialize DaemonModel:", n);
|
|
3637
3512
|
}), t;
|
|
@@ -3639,8 +3514,8 @@ class Vs {
|
|
|
3639
3514
|
_populateRegistry(e) {
|
|
3640
3515
|
this._registry.clear();
|
|
3641
3516
|
for (const [t, n] of Object.entries(e)) {
|
|
3642
|
-
const
|
|
3643
|
-
|
|
3517
|
+
const s = n.default;
|
|
3518
|
+
s && typeof s == "object" && this._registry.register(t, s);
|
|
3644
3519
|
}
|
|
3645
3520
|
}
|
|
3646
3521
|
/**
|
|
@@ -3664,50 +3539,52 @@ class Vs {
|
|
|
3664
3539
|
}
|
|
3665
3540
|
}
|
|
3666
3541
|
export {
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3542
|
+
_r as ChevronDownIcon,
|
|
3543
|
+
vr as ChevronRightIcon,
|
|
3544
|
+
kn as CliRuntime,
|
|
3545
|
+
br as ComponentIcon,
|
|
3546
|
+
pn as DaemonModel,
|
|
3547
|
+
cn as Explorer,
|
|
3548
|
+
Vn as ExplorerApp,
|
|
3549
|
+
gr as ExplorerModel,
|
|
3550
|
+
sr as FixtureRegistry,
|
|
3551
|
+
yr as FolderIcon,
|
|
3552
|
+
kr as LeftSidebar,
|
|
3553
|
+
wr as MoonIcon,
|
|
3554
|
+
xr as PanelLeftIcon,
|
|
3555
|
+
Cr as PanelRightIcon,
|
|
3556
|
+
mn as ReportModel,
|
|
3557
|
+
Mr as RightSidebar,
|
|
3558
|
+
Sr as SunIcon,
|
|
3559
|
+
Tr as TitleBar,
|
|
3560
|
+
se as TitleBarButton,
|
|
3561
|
+
Or as TreeItem,
|
|
3562
|
+
ot as TreeView,
|
|
3563
|
+
St as VIEWPORT_SIZES,
|
|
3564
|
+
Mn as asyncRender,
|
|
3565
|
+
It as collectComponents,
|
|
3566
|
+
Ie as createComponentDefinition,
|
|
3567
|
+
oe as createFixtureTree,
|
|
3568
|
+
Fn as defineFixture,
|
|
3569
|
+
En as defineFixtureGroup,
|
|
3570
|
+
Bn as defineFixtureVariants,
|
|
3571
|
+
Oe as findNodeByPath,
|
|
3572
|
+
Se as fixtureGroupBrand,
|
|
3573
|
+
we as fixtureVariantsBrand,
|
|
3574
|
+
Rt as getDefaultPropertyValues,
|
|
3575
|
+
On as isComponentDefinition,
|
|
3576
|
+
me as isFixtureGroup,
|
|
3577
|
+
ve as isFixtureVariants,
|
|
3578
|
+
ge as isSingleFixture,
|
|
3579
|
+
Ce as mergeStyles,
|
|
3580
|
+
wn as parseFixtureExport,
|
|
3581
|
+
Tn as parseFixtureGroup,
|
|
3582
|
+
In as parseFixtureVariants,
|
|
3583
|
+
Rn as parseSingleFixture,
|
|
3584
|
+
wt as resolveViewport,
|
|
3585
|
+
Re as singleFixtureBrand,
|
|
3586
|
+
p as styles,
|
|
3587
|
+
An as syncRender,
|
|
3588
|
+
st as toExplorerTree
|
|
3712
3589
|
};
|
|
3713
3590
|
//# sourceMappingURL=viewer.js.map
|