@vscode/component-explorer 0.1.1-11 → 0.1.1-13
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/ExplorerModel.d.ts.map +1 -1
- package/dist/components/FixturePreviewItem.d.ts.map +1 -1
- package/dist/components/TitleBar.d.ts.map +1 -1
- package/dist/core/CliRuntime.d.ts +3 -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/viewer.js +1118 -1466
- package/dist/viewer.js.map +1 -1
- package/package.json +1 -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 we, a as Re, s as Te } from "./index-DnRcKk60.js";
|
|
5
|
+
import { b as Dn, 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 Pe, useReducer as bt, useState as yt, useContext as xt, useEffect as Ie, createElement as Ct } from "react";
|
|
8
|
+
import { jsx as a, jsxs as p, Fragment as ge } from "react/jsx-runtime";
|
|
9
|
+
import { unstable_batchedUpdates as We } from "react-dom";
|
|
10
|
+
function me(r) {
|
|
11
|
+
return typeof r == "object" && r !== null && Te in r && r[Te] === !0 && "_options" in r && typeof r._options == "object";
|
|
12
|
+
}
|
|
13
|
+
function ve(r) {
|
|
14
|
+
return typeof r == "object" && r !== null && we in r && r[we] === !0 && "_entries" in r && typeof r._entries == "object";
|
|
15
|
+
}
|
|
16
|
+
function _e(r) {
|
|
17
|
+
return typeof r == "object" && r !== null && Re in r && r[Re] === !0 && "_variants" in r && typeof r._variants == "object";
|
|
18
|
+
}
|
|
19
|
+
function wn(r) {
|
|
20
|
+
return me(r) ? { success: !0, data: r } : ve(r) ? { success: !0, data: r } : _e(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 me(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a SingleFixtureExport" };
|
|
24
|
+
}
|
|
25
|
+
function Tn(r) {
|
|
26
|
+
return ve(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureGroupExport" };
|
|
27
|
+
}
|
|
28
|
+
function In(r) {
|
|
29
|
+
return _e(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureVariantsExport" };
|
|
30
|
+
}
|
|
31
|
+
function Oe(r, e, t) {
|
|
32
|
+
const n = r._options;
|
|
33
33
|
return {
|
|
34
34
|
id: e,
|
|
35
35
|
name: t,
|
|
@@ -42,115 +42,115 @@ function Me(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 ie(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
|
+
Ge(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 Ge(r, e, t) {
|
|
79
79
|
var n;
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
id:
|
|
83
|
-
name:
|
|
80
|
+
if (me(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: Oe(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 (ve(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
|
+
Ge(i, [...e, d], c);
|
|
101
|
+
} else if (_e(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 m = [...e, d].join("/"),
|
|
110
|
+
const m = [...e, d].join("/"), v = {
|
|
111
111
|
id: m,
|
|
112
112
|
name: d,
|
|
113
113
|
type: "component",
|
|
114
|
-
component:
|
|
114
|
+
component: Oe(c, m, d)
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
i.children.push(v);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function ke(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 Ve ? $.loggers.push(r) : $ = new Ve([$, r]) : $ = r;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
143
|
+
function C() {
|
|
144
|
+
return $;
|
|
145
145
|
}
|
|
146
|
-
let
|
|
147
|
-
function
|
|
148
|
-
|
|
146
|
+
let ae;
|
|
147
|
+
function kt(r) {
|
|
148
|
+
ae = r;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function Vt(r) {
|
|
151
|
+
ae && ae(r);
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class Ve {
|
|
154
154
|
constructor(e) {
|
|
155
155
|
this.loggers = e;
|
|
156
156
|
}
|
|
@@ -175,8 +175,8 @@ class Ee {
|
|
|
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 Ee {
|
|
|
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 Ee {
|
|
|
203
203
|
t.handleEndTransaction(e);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
var
|
|
207
|
-
(function(
|
|
206
|
+
var F;
|
|
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, be.fromStack(c, o + 1);
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
})(
|
|
227
|
-
class
|
|
225
|
+
r.ofNthCaller = s;
|
|
226
|
+
})(F || (F = {}));
|
|
227
|
+
class be {
|
|
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 be(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 E {
|
|
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 Mt(e, this);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
const
|
|
267
|
-
function
|
|
268
|
-
const t =
|
|
266
|
+
const Ne = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new WeakMap();
|
|
267
|
+
function Mt(r, e) {
|
|
268
|
+
const t = de.get(r);
|
|
269
269
|
if (t)
|
|
270
270
|
return t;
|
|
271
|
-
const n =
|
|
271
|
+
const n = Dt(r, e);
|
|
272
272
|
if (n) {
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
return
|
|
273
|
+
let s = Ne.get(n) ?? 0;
|
|
274
|
+
s++, Ne.set(n, s);
|
|
275
|
+
const o = s === 1 ? n : `${n}#${s}`;
|
|
276
|
+
return de.set(r, o), o;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const t =
|
|
279
|
+
function Dt(r, e) {
|
|
280
|
+
const t = de.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 = ye(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 Me = /* @__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 = qe(r) ?? "Object";
|
|
312
|
+
let n = Me.get(t) ?? 0;
|
|
313
|
+
n++, Me.set(t, n);
|
|
314
|
+
const s = n === 1 ? t : `${t}#${n}`;
|
|
315
|
+
return De.set(r, s), s;
|
|
316
|
+
}
|
|
317
|
+
function qe(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 ye(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 ce;
|
|
327
|
+
function Bt(r) {
|
|
328
|
+
ce = r;
|
|
329
329
|
}
|
|
330
|
-
let
|
|
331
|
-
function
|
|
332
|
-
|
|
330
|
+
let Ke;
|
|
331
|
+
function At(r) {
|
|
332
|
+
Ke = r;
|
|
333
333
|
}
|
|
334
|
-
let
|
|
335
|
-
function
|
|
336
|
-
|
|
334
|
+
let Je;
|
|
335
|
+
function zt(r) {
|
|
336
|
+
Je = r;
|
|
337
337
|
}
|
|
338
|
-
let
|
|
339
|
-
function
|
|
340
|
-
|
|
338
|
+
let Ze;
|
|
339
|
+
function $t(r) {
|
|
340
|
+
Ze = 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 = F.ofCaller()) {
|
|
354
|
+
const s = t === void 0 ? void 0 : e, o = t === void 0 ? e : t;
|
|
355
|
+
return ce({
|
|
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 = ye(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 ce({
|
|
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(Ke(this, t)), this;
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
384
384
|
* Ensures that this observable is observed. This keeps the cache alive.
|
|
@@ -386,29 +386,29 @@ class Wt {
|
|
|
386
386
|
* Use `recomputeInitiallyAndOnChange` for eager evaluation.
|
|
387
387
|
*/
|
|
388
388
|
keepObserved(e) {
|
|
389
|
-
return e.add(
|
|
389
|
+
return e.add(Je(this)), this;
|
|
390
390
|
}
|
|
391
391
|
get debugValue() {
|
|
392
392
|
return this.get();
|
|
393
393
|
}
|
|
394
394
|
debugGetDependencyGraph() {
|
|
395
|
-
return
|
|
395
|
+
return Ze(this);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
class
|
|
398
|
+
class xe extends Lt {
|
|
399
399
|
constructor(e) {
|
|
400
400
|
var t;
|
|
401
|
-
super(), this._observers = /* @__PURE__ */ new Set(), (t =
|
|
401
|
+
super(), this._observers = /* @__PURE__ */ new Set(), (t = C()) == null || t.handleObservableCreated(this, e);
|
|
402
402
|
}
|
|
403
403
|
addObserver(e) {
|
|
404
404
|
var n;
|
|
405
405
|
const t = this._observers.size;
|
|
406
|
-
this._observers.add(e), t === 0 && this.onFirstObserverAdded(), t !== this._observers.size && ((n =
|
|
406
|
+
this._observers.add(e), t === 0 && this.onFirstObserverAdded(), t !== this._observers.size && ((n = C()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
|
|
407
407
|
}
|
|
408
408
|
removeObserver(e) {
|
|
409
409
|
var n;
|
|
410
410
|
const t = this._observers.delete(e);
|
|
411
|
-
t && this._observers.size === 0 && this.onLastObserverRemoved(), t && ((n =
|
|
411
|
+
t && this._observers.size === 0 && this.onLastObserverRemoved(), t && ((n = C()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
|
|
412
412
|
}
|
|
413
413
|
onFirstObserverAdded() {
|
|
414
414
|
}
|
|
@@ -416,33 +416,30 @@ class Oe extends Wt {
|
|
|
416
416
|
}
|
|
417
417
|
log() {
|
|
418
418
|
var t;
|
|
419
|
-
const e = !!
|
|
420
|
-
return
|
|
419
|
+
const e = !!C();
|
|
420
|
+
return Vt(this), e || (t = C()) == null || t.handleObservableCreated(this, F.ofCaller()), this;
|
|
421
421
|
}
|
|
422
422
|
debugGetObservers() {
|
|
423
423
|
return this._observers;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Xe(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
|
|
438
|
-
}
|
|
439
|
-
function pe(s) {
|
|
440
|
-
console.error("Unexpected error:", s);
|
|
436
|
+
function re(r) {
|
|
437
|
+
throw r;
|
|
441
438
|
}
|
|
442
|
-
|
|
443
|
-
|
|
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,17 +482,17 @@ function qt(s) {
|
|
|
485
482
|
return "<unknown>";
|
|
486
483
|
}
|
|
487
484
|
}
|
|
488
|
-
class
|
|
485
|
+
class j extends xe {
|
|
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;
|
|
498
|
-
this._state = 0, this._value = void 0, (e =
|
|
495
|
+
this._state = 0, this._value = void 0, (e = C()) == null || e.handleDerivedCleared(this);
|
|
499
496
|
for (const n of this._dependencies)
|
|
500
497
|
n.removeObserver(this);
|
|
501
498
|
this._dependencies.clear(), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._delayedStore !== void 0 && (this._delayedStore.dispose(), this._delayedStore = void 0), (t = this._handleLastObserverRemoved) == null || t.call(this);
|
|
@@ -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,14 +522,14 @@ 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
535
|
const m = this._delayedStore;
|
|
@@ -541,11 +538,11 @@ class w extends Oe {
|
|
|
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
|
-
|
|
541
|
+
for (const v of this._dependenciesToBeRemoved)
|
|
542
|
+
v.removeObserver(this);
|
|
546
543
|
this._dependenciesToBeRemoved.clear(), m !== void 0 && m.dispose();
|
|
547
544
|
}
|
|
548
|
-
e = this._didReportChange || c && !this._equalityComparator(h, this._value), (
|
|
545
|
+
e = this._didReportChange || c && !this._equalityComparator(h, this._value), (i = C()) == 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
|
+
re(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
|
}
|
|
@@ -604,27 +601,27 @@ class w extends Oe {
|
|
|
604
601
|
handleChange(e, t) {
|
|
605
602
|
var n;
|
|
606
603
|
if (this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e) || this._isInBeforeUpdate) {
|
|
607
|
-
(n =
|
|
608
|
-
let
|
|
604
|
+
(n = C()) == null || n.handleDerivedDependencyChanged(this, e, t);
|
|
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
|
+
re(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
|
|
677
|
-
return e !== void 0 ? new
|
|
673
|
+
function D(r, e, t = F.ofCaller()) {
|
|
674
|
+
return e !== void 0 ? new j(new E(r, void 0, e), e, void 0, void 0, X, t) : new j(new E(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 = F.ofCaller()) {
|
|
677
|
+
return new j(new E(r.owner, r.debugName, r.debugReferenceFn), e, void 0, r.onLastObserverRemoved, r.equalsFn ?? X, t);
|
|
681
678
|
}
|
|
682
|
-
Ut
|
|
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 = F.ofCaller()) {
|
|
681
|
+
let n, s;
|
|
682
|
+
n = r, s = void 0;
|
|
683
|
+
let o;
|
|
684
|
+
return new j(new E(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
|
-
|
|
693
|
-
},
|
|
689
|
+
o && (o.dispose(), o = void 0);
|
|
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 Ye {
|
|
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 = C()) == null || i.handleAutorunCreated(this, s), this._run();
|
|
714
711
|
}
|
|
715
712
|
dispose() {
|
|
716
713
|
var e;
|
|
@@ -718,30 +715,30 @@ class re {
|
|
|
718
715
|
this._disposed = !0;
|
|
719
716
|
for (const t of this._dependencies)
|
|
720
717
|
t.removeObserver(this);
|
|
721
|
-
this._dependencies.clear(), this._store !== void 0 && this._store.dispose(), this._delayedStore !== void 0 && this._delayedStore.dispose(), (e =
|
|
718
|
+
this._dependencies.clear(), this._store !== void 0 && this._store.dispose(), this._delayedStore !== void 0 && this._delayedStore.dispose(), (e = C()) == null || e.handleAutorunDisposed(this);
|
|
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
|
-
(t =
|
|
731
|
-
const
|
|
727
|
+
(t = C()) == null || t.handleAutorunStarted(this);
|
|
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
|
+
re(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 = C()) == null || o.handleAutorunFinished(this);
|
|
740
|
+
for (const i of this._dependenciesToBeRemoved)
|
|
741
|
+
i.removeObserver(this);
|
|
745
742
|
this._dependenciesToBeRemoved.clear();
|
|
746
743
|
}
|
|
747
744
|
}
|
|
@@ -774,15 +771,15 @@ class re {
|
|
|
774
771
|
handleChange(e, t) {
|
|
775
772
|
var n;
|
|
776
773
|
if (this._isDependency(e)) {
|
|
777
|
-
(n =
|
|
774
|
+
(n = C()) == null || n.handleAutorunDependencyChanged(this, e, t);
|
|
778
775
|
try {
|
|
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
|
+
re(s);
|
|
786
783
|
}
|
|
787
784
|
}
|
|
788
785
|
}
|
|
@@ -792,7 +789,7 @@ class re {
|
|
|
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 re {
|
|
|
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 re {
|
|
|
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 Qe(r, e = F.ofCaller()) {
|
|
825
|
+
return new Ye(new E(void 0, void 0, r), r, void 0, e);
|
|
829
826
|
}
|
|
830
|
-
function
|
|
831
|
-
const e = new Error("BugIndicatingErrorRecovery: " +
|
|
832
|
-
|
|
827
|
+
function Fe(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 et(r, e) {
|
|
832
|
+
const t = new tt(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) : et(e, t);
|
|
844
841
|
}
|
|
845
|
-
class
|
|
842
|
+
class tt {
|
|
846
843
|
constructor(e, t) {
|
|
847
844
|
var n;
|
|
848
|
-
this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n =
|
|
845
|
+
this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = C()) == null || n.handleBeginTransaction(this);
|
|
849
846
|
}
|
|
850
847
|
getDebugName() {
|
|
851
|
-
return this._getDebugName ? this._getDebugName() :
|
|
848
|
+
return this._getDebugName ? this._getDebugName() : ye(this._fn);
|
|
852
849
|
}
|
|
853
850
|
updateObserver(e, t) {
|
|
854
851
|
if (!this._updatingObservers) {
|
|
855
|
-
|
|
852
|
+
Fe("Transaction already finished!"), et((n) => {
|
|
856
853
|
n.updateObserver(e, t);
|
|
857
854
|
});
|
|
858
855
|
return;
|
|
@@ -863,48 +860,48 @@ class ot {
|
|
|
863
860
|
var t;
|
|
864
861
|
const e = this._updatingObservers;
|
|
865
862
|
if (!e) {
|
|
866
|
-
|
|
863
|
+
Fe("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
|
-
this._updatingObservers = null, (t =
|
|
870
|
+
this._updatingObservers = null, (t = C()) == null || t.handleEndTransaction(this);
|
|
874
871
|
}
|
|
875
872
|
debugGetUpdatingObservers() {
|
|
876
873
|
return this._updatingObservers;
|
|
877
874
|
}
|
|
878
875
|
}
|
|
879
|
-
function
|
|
876
|
+
function w(r, e, t = F.ofCaller()) {
|
|
880
877
|
let n;
|
|
881
|
-
return typeof
|
|
878
|
+
return typeof r == "string" ? n = new E(void 0, r, void 0) : n = new E(r, void 0, void 0), new rt(n, e, X, t);
|
|
882
879
|
}
|
|
883
|
-
class
|
|
880
|
+
class rt extends xe {
|
|
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 = C()) == 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 tt(() => {
|
|
900
897
|
}, () => `Setting ${this.debugName}`));
|
|
901
898
|
try {
|
|
902
|
-
const
|
|
903
|
-
this._setValue(e), (
|
|
899
|
+
const i = this._value;
|
|
900
|
+
this._setValue(e), (o = C()) == 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 ie extends Oe {
|
|
|
922
919
|
this._value = e;
|
|
923
920
|
}
|
|
924
921
|
}
|
|
925
|
-
function
|
|
926
|
-
let e, t, n,
|
|
927
|
-
return
|
|
922
|
+
function Ee(...r) {
|
|
923
|
+
let e, t, n, s;
|
|
924
|
+
return r.length === 2 ? [t, n] = r : [e, t, n, s] = r, new L(new E(e, void 0, n), t, n, () => L.globalTransaction, X, s ?? F.ofCaller());
|
|
928
925
|
}
|
|
929
|
-
class
|
|
930
|
-
constructor(e, t, n,
|
|
931
|
-
super(
|
|
932
|
-
var
|
|
926
|
+
class L extends xe {
|
|
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 R;
|
|
933
930
|
const c = this._getValue(d), h = this._value, m = !this._hasValue || !this._equalityComparator(h, c);
|
|
934
|
-
let
|
|
935
|
-
m && (this._value = c, this._hasValue && (
|
|
936
|
-
var
|
|
937
|
-
(
|
|
938
|
-
for (const
|
|
939
|
-
|
|
931
|
+
let v = !1;
|
|
932
|
+
m && (this._value = c, this._hasValue && (v = !0, Gt(this._getTransaction(), (g) => {
|
|
933
|
+
var _;
|
|
934
|
+
(_ = C()) == null || _.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
|
|
935
|
+
for (const b of this._observers)
|
|
936
|
+
g.updateObserver(b, this), b.handleChange(this, void 0);
|
|
940
937
|
}, () => {
|
|
941
|
-
const
|
|
942
|
-
return "Event fired" + (
|
|
943
|
-
})), this._hasValue = !0),
|
|
938
|
+
const g = this.getDebugName();
|
|
939
|
+
return "Event fired" + (g ? `: ${g}` : "");
|
|
940
|
+
})), this._hasValue = !0), v || (R = C()) == null || R.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
|
|
944
941
|
};
|
|
945
942
|
}
|
|
946
943
|
getDebugName() {
|
|
@@ -966,40 +963,40 @@ class A 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
|
+
})(Ee || (Ee = {}));
|
|
979
|
+
function qt(r) {
|
|
980
|
+
const e = new nt(!1, void 0);
|
|
981
|
+
return r.addObserver(e), Xe(() => {
|
|
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 nt(!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 Xe(() => {
|
|
995
|
+
r.removeObserver(t);
|
|
999
996
|
});
|
|
1000
997
|
}
|
|
1001
|
-
|
|
1002
|
-
class
|
|
998
|
+
At(Kt);
|
|
999
|
+
class nt {
|
|
1003
1000
|
constructor(e, t) {
|
|
1004
1001
|
this._forceRecompute = e, this._handleValue = t, this._counter = 0;
|
|
1005
1002
|
}
|
|
@@ -1014,11 +1011,11 @@ class at {
|
|
|
1014
1011
|
handleChange(e, t) {
|
|
1015
1012
|
}
|
|
1016
1013
|
}
|
|
1017
|
-
let
|
|
1018
|
-
function
|
|
1019
|
-
|
|
1014
|
+
let te;
|
|
1015
|
+
function Jt(r) {
|
|
1016
|
+
te || (te = new Zt(), Ot(te)), te.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
|
-
I(
|
|
1037
|
+
U(" "),
|
|
1038
|
+
I(Z(e.oldValue, 70), {
|
|
1042
1039
|
color: "red",
|
|
1043
1040
|
strikeThrough: !0
|
|
1044
1041
|
}),
|
|
1045
|
-
|
|
1046
|
-
I(
|
|
1042
|
+
U(" "),
|
|
1043
|
+
I(Z(e.newValue, 60), {
|
|
1047
1044
|
color: "green"
|
|
1048
1045
|
})
|
|
1049
|
-
] : [
|
|
1050
|
-
|
|
1051
|
-
I(
|
|
1046
|
+
] : [U(" (unchanged)")] : [
|
|
1047
|
+
U(" "),
|
|
1048
|
+
I(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,12 +1061,12 @@ 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
|
-
|
|
1069
|
+
P("observable value changed"),
|
|
1073
1070
|
I(e.debugName, { color: "BlueViolet" }),
|
|
1074
1071
|
...this.formatInfo(t)
|
|
1075
1072
|
]));
|
|
@@ -1080,15 +1077,15 @@ class tn {
|
|
|
1080
1077
|
return I(" (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
|
-
|
|
1088
|
+
P("derived recomputed"),
|
|
1092
1089
|
I(e.debugName, { color: "BlueViolet" }),
|
|
1093
1090
|
...this.formatInfo(t),
|
|
1094
1091
|
this.formatChanges(n),
|
|
@@ -1097,13 +1094,13 @@ class tn {
|
|
|
1097
1094
|
}
|
|
1098
1095
|
handleDerivedCleared(e) {
|
|
1099
1096
|
this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1100
|
-
|
|
1097
|
+
P("derived cleared"),
|
|
1101
1098
|
I(e.debugName, { color: "BlueViolet" })
|
|
1102
1099
|
]));
|
|
1103
1100
|
}
|
|
1104
1101
|
handleFromEventObservableTriggered(e, t) {
|
|
1105
1102
|
this._isIncluded(e) && console.log(...this.textToConsoleArgs([
|
|
1106
|
-
|
|
1103
|
+
P("observable from event triggered"),
|
|
1107
1104
|
I(e.debugName, { color: "BlueViolet" }),
|
|
1108
1105
|
...this.formatInfo(t),
|
|
1109
1106
|
{ data: [{ fn: e._getValue }] }
|
|
@@ -1120,7 +1117,7 @@ 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
|
-
|
|
1120
|
+
P("autorun"),
|
|
1124
1121
|
I(e.debugName, { color: "BlueViolet" }),
|
|
1125
1122
|
this.formatChanges(t),
|
|
1126
1123
|
{ data: [{ fn: e._debugNameData.referenceFn ?? e._runFn }] }
|
|
@@ -1132,7 +1129,7 @@ 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
|
-
|
|
1132
|
+
P("transaction"),
|
|
1136
1133
|
I(t, { color: "BlueViolet" }),
|
|
1137
1134
|
{ data: [{ fn: e._fn }] }
|
|
1138
1135
|
])), this.indentation++;
|
|
@@ -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 I(
|
|
1154
|
+
function U(r) {
|
|
1155
|
+
return I(r, { color: "black" });
|
|
1159
1156
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return I(
|
|
1157
|
+
function P(r) {
|
|
1158
|
+
return I(rr(`${r}: `, 10), { color: "black", bold: !0 });
|
|
1162
1159
|
}
|
|
1163
|
-
function I(
|
|
1160
|
+
function I(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]]";
|
|
1220
|
+
}
|
|
1221
|
+
const t = qe(r);
|
|
1222
|
+
let n = t ? t + "(" : "{ ", s = !0, o;
|
|
1223
|
+
try {
|
|
1224
|
+
o = Object.entries(r);
|
|
1225
|
+
} catch {
|
|
1226
|
+
return t ? `${t}(...)` : "[[Object]]";
|
|
1212
1227
|
}
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
for (const [i, o] of Object.entries(s)) {
|
|
1216
|
-
if (r || (n += ", "), n.length - 5 > e) {
|
|
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
|
|
1243
|
+
function rr(r, e) {
|
|
1244
|
+
for (; r.length < e; )
|
|
1245
|
+
r += " ";
|
|
1246
|
+
return r;
|
|
1234
1247
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
}
|
|
1239
|
-
static createClient(e, t) {
|
|
1240
|
-
return new oe(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
|
-
}, oe.createClient(i, () => {
|
|
1289
|
-
if (!d)
|
|
1290
|
-
throw new Error("Not supported");
|
|
1291
|
-
return d;
|
|
1292
|
-
});
|
|
1248
|
+
function nr(r, e) {
|
|
1249
|
+
const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((o) => o), n = k.from(r, t);
|
|
1250
|
+
return n ? st(n, 0, /* @__PURE__ */ new Set()).trim() : "";
|
|
1293
1251
|
}
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
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 dt(s, e) {
|
|
1324
|
-
for (const t in e)
|
|
1325
|
-
s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? dt(s[t], e[t]) : s[t] = e[t];
|
|
1326
|
-
}
|
|
1327
|
-
function ct(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" ? ct(s[t], e[t]) : s[t] = e[t];
|
|
1330
|
-
}
|
|
1331
|
-
class P {
|
|
1332
|
-
static getInstance() {
|
|
1333
|
-
return P._instance === void 0 && (P._instance = new P()), P._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 O("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 O("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(ee);
|
|
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 re) {
|
|
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(ee)
|
|
1447
|
-
}),
|
|
1448
|
-
getDerivedInfo: (e) => {
|
|
1449
|
-
const t = this._aliveInstances.get(e);
|
|
1450
|
-
return {
|
|
1451
|
-
dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(ee),
|
|
1452
|
-
observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(ee)
|
|
1453
|
-
};
|
|
1454
|
-
},
|
|
1455
|
-
getAutorunInfo: (e) => ({
|
|
1456
|
-
dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(ee)
|
|
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 ie)
|
|
1464
|
-
n.debugSetValue(t);
|
|
1465
|
-
else if (n instanceof A)
|
|
1466
|
-
n.debugSetValue(t);
|
|
1467
|
-
else
|
|
1468
|
-
throw new O("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 M(t.debugGetState().value, 200);
|
|
1481
|
-
if (t instanceof ie)
|
|
1482
|
-
return M(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 O("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 re)
|
|
1496
|
-
t.debugRerun();
|
|
1497
|
-
else
|
|
1498
|
-
throw new O("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
|
-
ct(this._fullState, e), this._pendingChanges === null ? this._pendingChanges = e : dt(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 = M(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 = M(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
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
P._instance = void 0;
|
|
1631
|
-
function hn(s, e) {
|
|
1632
|
-
const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((i) => i), n = R.from(s, t);
|
|
1633
|
-
return n ? lt(n, 0, /* @__PURE__ */ new Set()).trim() : "";
|
|
1634
|
-
}
|
|
1635
|
-
function lt(s, e, t) {
|
|
1636
|
-
const n = " ".repeat(e), r = [];
|
|
1637
|
-
if (t.has(s.sourceObj))
|
|
1638
|
-
return r.push(`${n}* ${s.type} ${s.name} (already listed)`), r.join(`
|
|
1252
|
+
function st(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(st(i, e + 1, t));
|
|
1644
1261
|
}
|
|
1645
|
-
return
|
|
1262
|
+
return s.join(`
|
|
1646
1263
|
`);
|
|
1647
1264
|
}
|
|
1648
|
-
class
|
|
1265
|
+
class k {
|
|
1649
1266
|
static from(e, t) {
|
|
1650
|
-
if (e instanceof
|
|
1267
|
+
if (e instanceof Ye) {
|
|
1651
1268
|
const n = e.debugGetState();
|
|
1652
|
-
return new
|
|
1653
|
-
} else if (e instanceof
|
|
1269
|
+
return new k(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((s) => k.from(s, t) || k.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 k(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((s) => k.from(s, t) || k.unknown(s)));
|
|
1273
|
+
} else if (e instanceof rt) {
|
|
1657
1274
|
const n = e.debugGetState();
|
|
1658
|
-
return new
|
|
1659
|
-
} else if (e instanceof
|
|
1275
|
+
return new k(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 k(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 k(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 un {
|
|
1288
|
+
$t(nr);
|
|
1289
|
+
kt(Jt);
|
|
1290
|
+
class sr {
|
|
1675
1291
|
constructor() {
|
|
1676
|
-
l(this, "_fixtures",
|
|
1292
|
+
l(this, "_fixtures", w(this, /* @__PURE__ */ new Map()));
|
|
1677
1293
|
/** Observable root of the fixture tree */
|
|
1678
|
-
l(this, "root",
|
|
1294
|
+
l(this, "root", D(this, (e) => {
|
|
1679
1295
|
const t = this._fixtures.read(e);
|
|
1680
|
-
return
|
|
1296
|
+
return ie(t);
|
|
1681
1297
|
}));
|
|
1682
1298
|
}
|
|
1683
1299
|
/**
|
|
@@ -1708,18 +1324,18 @@ class un {
|
|
|
1708
1324
|
*/
|
|
1709
1325
|
getNode(e, t) {
|
|
1710
1326
|
const n = this.root.read(e);
|
|
1711
|
-
return
|
|
1327
|
+
return ke(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 = ie(t), s = ke(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,17 +1362,18 @@ class As {
|
|
|
1746
1362
|
return this._flattenFixtures(this._root);
|
|
1747
1363
|
}
|
|
1748
1364
|
async renderFixture(e) {
|
|
1365
|
+
var R;
|
|
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
|
+
(R = this._currentDisposable) != null && R.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 (
|
|
1372
|
+
const s = t.component, o = Rt(s.properties);
|
|
1373
|
+
let i = n;
|
|
1374
|
+
if (s.isolation === "shadow-dom") {
|
|
1758
1375
|
const g = n.attachShadow({ mode: "open" });
|
|
1759
|
-
|
|
1376
|
+
i = document.createElement("div"), g.appendChild(i);
|
|
1760
1377
|
}
|
|
1761
1378
|
const d = [], c = console.error, h = console.warn;
|
|
1762
1379
|
console.error = (...g) => {
|
|
@@ -1765,47 +1382,62 @@ class As {
|
|
|
1765
1382
|
d.push({ kind: "console", level: "warn", message: g.map(String).join(" ") }), h.apply(console, g);
|
|
1766
1383
|
};
|
|
1767
1384
|
const m = (g) => {
|
|
1768
|
-
var
|
|
1769
|
-
d.push({ kind: "exception", message: g.message, stack: (
|
|
1770
|
-
},
|
|
1771
|
-
const
|
|
1772
|
-
d.push({ kind: "exception", message:
|
|
1385
|
+
var _;
|
|
1386
|
+
d.push({ kind: "exception", message: g.message, stack: (_ = g.error) == null ? void 0 : _.stack });
|
|
1387
|
+
}, v = (g) => {
|
|
1388
|
+
const _ = g.reason, b = _ instanceof Error ? _.message : String(_), y = _ instanceof Error ? _.stack : void 0;
|
|
1389
|
+
d.push({ kind: "exception", message: b, stack: y });
|
|
1773
1390
|
};
|
|
1774
|
-
window.addEventListener("error", m), window.addEventListener("unhandledrejection",
|
|
1391
|
+
window.addEventListener("error", m), window.addEventListener("unhandledrejection", v);
|
|
1775
1392
|
try {
|
|
1776
|
-
const g =
|
|
1777
|
-
|
|
1393
|
+
const g = new AbortController(), _ = 3e3;
|
|
1394
|
+
let b = s.render(i, {
|
|
1395
|
+
props: o,
|
|
1396
|
+
signal: g.signal
|
|
1397
|
+
});
|
|
1398
|
+
if (b instanceof Promise) {
|
|
1399
|
+
const y = new Promise((x) => setTimeout(() => x("timeout"), _)), O = await Promise.race([b.then((x) => ({ resolved: x })), y]);
|
|
1400
|
+
O === "timeout" ? (g.abort(), d.push({ kind: "exception", message: `Fixture render() timed out after ${_}ms` }), b.then((x) => {
|
|
1401
|
+
var ee;
|
|
1402
|
+
return (ee = x == null ? void 0 : x.dispose) == null ? void 0 : ee.call(x);
|
|
1403
|
+
}).catch(() => {
|
|
1404
|
+
}), b = void 0) : b = O.resolved;
|
|
1405
|
+
}
|
|
1406
|
+
if (this._currentDisposable = b ?? void 0, b != null && b.ready) {
|
|
1407
|
+
const y = new Promise((x) => setTimeout(() => x("timeout"), _));
|
|
1408
|
+
await Promise.race([b.ready.then(() => "done"), y]) === "timeout" && (g.abort(), d.push({ kind: "exception", message: `Fixture ready promise timed out after ${_}ms` }));
|
|
1409
|
+
}
|
|
1778
1410
|
} catch (g) {
|
|
1779
|
-
const
|
|
1780
|
-
d.push({ kind: "exception", message:
|
|
1411
|
+
const _ = g instanceof Error ? g : new Error(String(g));
|
|
1412
|
+
d.push({ kind: "exception", message: _.message, stack: _.stack });
|
|
1781
1413
|
} finally {
|
|
1782
1414
|
console.error = c, console.warn = h;
|
|
1783
1415
|
}
|
|
1784
|
-
return await new Promise((g) => requestAnimationFrame(() => requestAnimationFrame(() => g()))), window.removeEventListener("error", m), window.removeEventListener("unhandledrejection",
|
|
1416
|
+
return await new Promise((g) => requestAnimationFrame(() => requestAnimationFrame(() => g()))), window.removeEventListener("error", m), window.removeEventListener("unhandledrejection", v), { errors: d };
|
|
1785
1417
|
}
|
|
1786
1418
|
_buildRegistry() {
|
|
1787
1419
|
const e = /* @__PURE__ */ new Map();
|
|
1788
1420
|
for (const [t, n] of Object.entries(this._fixtureModules)) {
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1421
|
+
const s = n.default;
|
|
1422
|
+
s && typeof s == "object" && e.set(t, s);
|
|
1791
1423
|
}
|
|
1792
|
-
return
|
|
1424
|
+
return ie(e);
|
|
1793
1425
|
}
|
|
1794
1426
|
_flattenFixtures(e, t = []) {
|
|
1795
|
-
var
|
|
1427
|
+
var s;
|
|
1796
1428
|
const n = [];
|
|
1797
|
-
e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((
|
|
1798
|
-
for (const
|
|
1799
|
-
const
|
|
1800
|
-
n.push(...this._flattenFixtures(
|
|
1429
|
+
e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((s = e.component) == null ? void 0 : s.background) ?? "light" });
|
|
1430
|
+
for (const o of e.children ?? []) {
|
|
1431
|
+
const i = e.id ? [...t, e.name] : t;
|
|
1432
|
+
n.push(...this._flattenFixtures(o, i));
|
|
1801
1433
|
}
|
|
1802
1434
|
return n;
|
|
1803
1435
|
}
|
|
1804
1436
|
_findFixtureNode(e, t) {
|
|
1805
1437
|
if (e.id === t) return e;
|
|
1806
1438
|
for (const n of e.children ?? []) {
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1439
|
+
const s = this._findFixtureNode(n, t);
|
|
1440
|
+
if (s) return s;
|
|
1809
1441
|
}
|
|
1810
1442
|
}
|
|
1811
1443
|
_installGlobalApi() {
|
|
@@ -1821,7 +1453,7 @@ class As {
|
|
|
1821
1453
|
});
|
|
1822
1454
|
}
|
|
1823
1455
|
}
|
|
1824
|
-
class
|
|
1456
|
+
class or {
|
|
1825
1457
|
constructor(e) {
|
|
1826
1458
|
this._run = e, this._changes = [], this._map = /* @__PURE__ */ new Map(), this._updateCounter = 0;
|
|
1827
1459
|
}
|
|
@@ -1848,48 +1480,48 @@ class fn {
|
|
|
1848
1480
|
}
|
|
1849
1481
|
}
|
|
1850
1482
|
function u() {
|
|
1851
|
-
return
|
|
1483
|
+
return le.instance;
|
|
1852
1484
|
}
|
|
1853
|
-
function
|
|
1854
|
-
return
|
|
1485
|
+
function ir() {
|
|
1486
|
+
return he.instance;
|
|
1855
1487
|
}
|
|
1856
|
-
function
|
|
1857
|
-
return
|
|
1488
|
+
function ar() {
|
|
1489
|
+
return ue.instance;
|
|
1858
1490
|
}
|
|
1859
|
-
u.const =
|
|
1860
|
-
u.obs =
|
|
1861
|
-
class
|
|
1491
|
+
u.const = ir;
|
|
1492
|
+
u.obs = ar;
|
|
1493
|
+
class le {
|
|
1862
1494
|
create(e) {
|
|
1863
|
-
const t =
|
|
1495
|
+
const t = D((n) => e(n));
|
|
1864
1496
|
return { read: (n) => t };
|
|
1865
1497
|
}
|
|
1866
1498
|
}
|
|
1867
|
-
|
|
1868
|
-
class
|
|
1499
|
+
le.instance = new le();
|
|
1500
|
+
class he {
|
|
1869
1501
|
create(e) {
|
|
1870
|
-
const t =
|
|
1502
|
+
const t = D((n) => e(n));
|
|
1871
1503
|
return { read: (n) => t.read(n) };
|
|
1872
1504
|
}
|
|
1873
1505
|
}
|
|
1874
|
-
|
|
1875
|
-
class
|
|
1506
|
+
he.instance = new he();
|
|
1507
|
+
class ue {
|
|
1876
1508
|
create(e) {
|
|
1877
|
-
const t =
|
|
1878
|
-
const
|
|
1879
|
-
return
|
|
1509
|
+
const t = D((n) => {
|
|
1510
|
+
const s = e(n);
|
|
1511
|
+
return dr(s) ? s.read(n) : s;
|
|
1880
1512
|
});
|
|
1881
1513
|
return { read: (n) => t };
|
|
1882
1514
|
}
|
|
1883
1515
|
}
|
|
1884
|
-
|
|
1885
|
-
function
|
|
1886
|
-
return typeof
|
|
1516
|
+
ue.instance = new ue();
|
|
1517
|
+
function dr(r) {
|
|
1518
|
+
return typeof r == "object" && r !== null && "read" in r;
|
|
1887
1519
|
}
|
|
1888
|
-
function
|
|
1889
|
-
return Object.fromEntries(Object.entries(
|
|
1520
|
+
function K(r, e) {
|
|
1521
|
+
return Object.fromEntries(Object.entries(r).map(([t, n]) => [t, e(n, t)]));
|
|
1890
1522
|
}
|
|
1891
|
-
const
|
|
1892
|
-
class
|
|
1523
|
+
const se = Symbol("ViewModelContext");
|
|
1524
|
+
class cr {
|
|
1893
1525
|
constructor(e) {
|
|
1894
1526
|
this._store = new Y(), this.props = e;
|
|
1895
1527
|
}
|
|
@@ -1897,35 +1529,35 @@ class vn {
|
|
|
1897
1529
|
this._store.dispose();
|
|
1898
1530
|
}
|
|
1899
1531
|
}
|
|
1900
|
-
function
|
|
1901
|
-
return
|
|
1532
|
+
function lr(r) {
|
|
1533
|
+
return r[se] || (r[se] = Pe(void 0)), r[se];
|
|
1902
1534
|
}
|
|
1903
|
-
function
|
|
1535
|
+
function B(r = {}) {
|
|
1904
1536
|
var e;
|
|
1905
|
-
return e = class extends
|
|
1906
|
-
}, e._props =
|
|
1537
|
+
return e = class extends cr {
|
|
1538
|
+
}, e._props = r, e;
|
|
1907
1539
|
}
|
|
1908
|
-
let
|
|
1909
|
-
const
|
|
1910
|
-
for (const e of
|
|
1540
|
+
let pe = 0;
|
|
1541
|
+
const hr = new or((r) => {
|
|
1542
|
+
for (const e of r)
|
|
1911
1543
|
e.rendered = !1;
|
|
1912
|
-
if (
|
|
1913
|
-
const e =
|
|
1914
|
-
e.itemsToRender =
|
|
1544
|
+
if (pe > 0) {
|
|
1545
|
+
const e = r.find((t) => t.isRendering);
|
|
1546
|
+
e.itemsToRender = r;
|
|
1915
1547
|
} else
|
|
1916
|
-
|
|
1917
|
-
for (const e of
|
|
1548
|
+
We(() => {
|
|
1549
|
+
for (const e of r)
|
|
1918
1550
|
e.rendered || e.forceUpdate();
|
|
1919
1551
|
});
|
|
1920
1552
|
});
|
|
1921
|
-
let
|
|
1922
|
-
class
|
|
1553
|
+
let ur = 0;
|
|
1554
|
+
class pr {
|
|
1923
1555
|
constructor(e, t) {
|
|
1924
1556
|
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 = () => () => {
|
|
1925
1557
|
var n;
|
|
1926
1558
|
(n = this._disposable) == null || n.dispose();
|
|
1927
1559
|
}, this.itemsToRender = [], this.handleAfterRender = () => {
|
|
1928
|
-
|
|
1560
|
+
We(() => {
|
|
1929
1561
|
for (const n of this.itemsToRender)
|
|
1930
1562
|
n.rendered || n.forceUpdate();
|
|
1931
1563
|
}), this.itemsToRender = [];
|
|
@@ -1935,139 +1567,139 @@ class xn {
|
|
|
1935
1567
|
return this.debugName;
|
|
1936
1568
|
}
|
|
1937
1569
|
updateProps(e) {
|
|
1938
|
-
this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps =
|
|
1570
|
+
this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = w(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = D(this, this._render), this._disposable = hr.addDependency(this.rendering, this));
|
|
1939
1571
|
}
|
|
1940
1572
|
}
|
|
1941
|
-
function
|
|
1942
|
-
const n = (
|
|
1943
|
-
const d =
|
|
1573
|
+
function Ce(r, e, t) {
|
|
1574
|
+
const n = (i) => i + 1, s = () => new pr(r + ++ur, e), o = function(i) {
|
|
1575
|
+
const d = bt(n, 0)[1], c = yt(s)[0];
|
|
1944
1576
|
for (const h of t ?? [])
|
|
1945
|
-
c.contextValues.set(h,
|
|
1946
|
-
if (
|
|
1577
|
+
c.contextValues.set(h, xt(h));
|
|
1578
|
+
if (Ie(c.cleanupEffect, []), Ie(c.handleAfterRender), c.isRendering)
|
|
1947
1579
|
throw new Error("Component is already rendering");
|
|
1948
|
-
c.isRendering = !0,
|
|
1580
|
+
c.isRendering = !0, pe++;
|
|
1949
1581
|
try {
|
|
1950
|
-
c.forceUpdate = d, c.updateProps(
|
|
1582
|
+
c.forceUpdate = d, c.updateProps(i);
|
|
1951
1583
|
const h = c.rendering.get();
|
|
1952
1584
|
return c.rendered = !0, h;
|
|
1953
1585
|
} finally {
|
|
1954
|
-
c.isRendering = !1,
|
|
1586
|
+
c.isRendering = !1, pe--;
|
|
1955
1587
|
}
|
|
1956
1588
|
};
|
|
1957
|
-
return
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
function
|
|
1961
|
-
return
|
|
1962
|
-
const n =
|
|
1963
|
-
return (
|
|
1964
|
-
const
|
|
1965
|
-
return e(
|
|
1589
|
+
return o.displayName = r, o;
|
|
1590
|
+
}
|
|
1591
|
+
Ce("ObsView", (r) => (e) => r.read(e).children(e));
|
|
1592
|
+
function V(r, e) {
|
|
1593
|
+
return Ce("view", (t) => {
|
|
1594
|
+
const n = K(r, (s, o) => s.create((i) => t.read(i)[o], void 0));
|
|
1595
|
+
return (s) => {
|
|
1596
|
+
const o = K(n, (i) => i.read(s));
|
|
1597
|
+
return e(s, o);
|
|
1966
1598
|
};
|
|
1967
1599
|
});
|
|
1968
1600
|
}
|
|
1969
|
-
function
|
|
1601
|
+
function fr(r) {
|
|
1970
1602
|
const e = [];
|
|
1971
|
-
for (const t of Object.values(
|
|
1603
|
+
for (const t of Object.values(r)) {
|
|
1972
1604
|
const n = t._requiredContext;
|
|
1973
1605
|
n && !e.includes(n) && e.push(n);
|
|
1974
1606
|
}
|
|
1975
1607
|
return e;
|
|
1976
1608
|
}
|
|
1977
|
-
function
|
|
1978
|
-
const n = typeof e == "function" ? {} : e,
|
|
1979
|
-
return
|
|
1980
|
-
const
|
|
1981
|
-
} } :
|
|
1982
|
-
const
|
|
1983
|
-
return new
|
|
1984
|
-
}),
|
|
1985
|
-
return (
|
|
1986
|
-
const
|
|
1987
|
-
return
|
|
1609
|
+
function A(r, e, t) {
|
|
1610
|
+
const n = typeof e == "function" ? {} : e, s = typeof e == "function" ? e : t, o = "_props" in r ? r._props : {}, i = fr({ ...o, ...n }), d = lr(r), c = [...i, d];
|
|
1611
|
+
return Ce("viewWithModel", (h, m) => {
|
|
1612
|
+
const v = m(), R = v.get(d), g = "_props" in r ? K(r._props, (y, O) => y.create((x) => h.read(x)[O], v.get(y._requiredContext))) : {}, _ = R ? { read: () => R, dispose: () => {
|
|
1613
|
+
} } : Pt((y) => {
|
|
1614
|
+
const O = K(g, (x) => x.read(y));
|
|
1615
|
+
return new r(O);
|
|
1616
|
+
}), b = K(n, (y, O) => y.create((x) => h.read(x)[O], v.get(y._requiredContext)));
|
|
1617
|
+
return (y) => {
|
|
1618
|
+
const O = _.read(y), x = K(b, (ee) => ee.read(y));
|
|
1619
|
+
return s(y, O, x);
|
|
1988
1620
|
};
|
|
1989
1621
|
}, c.length > 0 ? c : void 0);
|
|
1990
1622
|
}
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
function
|
|
1623
|
+
V({ value: u.obs() }, (r, e) => e.value.read(r));
|
|
1624
|
+
Pe(null);
|
|
1625
|
+
function ot(r) {
|
|
1994
1626
|
var e;
|
|
1995
1627
|
return {
|
|
1996
|
-
id:
|
|
1997
|
-
name:
|
|
1998
|
-
type:
|
|
1999
|
-
children: (e =
|
|
2000
|
-
component:
|
|
1628
|
+
id: r.id,
|
|
1629
|
+
name: r.name,
|
|
1630
|
+
type: r.type,
|
|
1631
|
+
children: (e = r.children) == null ? void 0 : e.map(ot),
|
|
1632
|
+
component: r.component
|
|
2001
1633
|
};
|
|
2002
1634
|
}
|
|
2003
|
-
function
|
|
1635
|
+
function Q(r, e) {
|
|
2004
1636
|
const {
|
|
2005
1637
|
storageKey: t,
|
|
2006
1638
|
defaultValue: n,
|
|
2007
|
-
serialize:
|
|
2008
|
-
deserialize:
|
|
1639
|
+
serialize: s = JSON.stringify,
|
|
1640
|
+
deserialize: o = JSON.parse
|
|
2009
1641
|
} = e;
|
|
2010
|
-
let
|
|
1642
|
+
let i = n;
|
|
2011
1643
|
try {
|
|
2012
1644
|
const h = localStorage.getItem(t);
|
|
2013
|
-
h !== null && (
|
|
1645
|
+
h !== null && (i = o(h));
|
|
2014
1646
|
} catch {
|
|
2015
1647
|
}
|
|
2016
|
-
const d =
|
|
1648
|
+
const d = w(r, i), c = d.set.bind(d);
|
|
2017
1649
|
return d.set = (h, m) => {
|
|
2018
1650
|
try {
|
|
2019
|
-
localStorage.setItem(t,
|
|
1651
|
+
localStorage.setItem(t, s(h));
|
|
2020
1652
|
} catch {
|
|
2021
1653
|
}
|
|
2022
1654
|
c(h, m);
|
|
2023
1655
|
}, d;
|
|
2024
1656
|
}
|
|
2025
|
-
class
|
|
1657
|
+
class gr extends B({
|
|
2026
1658
|
registry: u.const(),
|
|
2027
1659
|
daemonModel: u.const(),
|
|
2028
1660
|
reportModel: u.const()
|
|
2029
1661
|
}) {
|
|
2030
1662
|
constructor() {
|
|
2031
1663
|
super(...arguments);
|
|
2032
|
-
l(this, "leftSidebarVisible",
|
|
1664
|
+
l(this, "leftSidebarVisible", Q(this, {
|
|
2033
1665
|
storageKey: "component-explorer:leftSidebarVisible",
|
|
2034
1666
|
defaultValue: !0
|
|
2035
1667
|
}));
|
|
2036
|
-
l(this, "rightSidebarVisible",
|
|
1668
|
+
l(this, "rightSidebarVisible", Q(this, {
|
|
2037
1669
|
storageKey: "component-explorer:rightSidebarVisible",
|
|
2038
1670
|
defaultValue: !1
|
|
2039
1671
|
}));
|
|
2040
|
-
l(this, "isDarkTheme",
|
|
1672
|
+
l(this, "isDarkTheme", Q(this, {
|
|
2041
1673
|
storageKey: "component-explorer:isDarkTheme",
|
|
2042
1674
|
defaultValue: !0
|
|
2043
1675
|
}));
|
|
2044
|
-
l(this, "selectedNodeId",
|
|
1676
|
+
l(this, "selectedNodeId", Q(this, {
|
|
2045
1677
|
storageKey: "component-explorer:selectedNodeId",
|
|
2046
1678
|
defaultValue: void 0
|
|
2047
1679
|
}));
|
|
2048
|
-
l(this, "expandedNodeIds",
|
|
2049
|
-
l(this, "viewMode",
|
|
1680
|
+
l(this, "expandedNodeIds", w(this, /* @__PURE__ */ new Set([""])));
|
|
1681
|
+
l(this, "viewMode", Q(this, {
|
|
2050
1682
|
storageKey: "component-explorer:viewMode",
|
|
2051
1683
|
defaultValue: "session"
|
|
2052
1684
|
}));
|
|
2053
1685
|
/** The explorer's tree derived from the registry or report */
|
|
2054
|
-
l(this, "tree",
|
|
1686
|
+
l(this, "tree", D(this, (t) => {
|
|
2055
1687
|
const n = this.props.reportModel;
|
|
2056
1688
|
if (n)
|
|
2057
1689
|
return n.buildTree(t);
|
|
2058
|
-
const
|
|
2059
|
-
return
|
|
1690
|
+
const s = this.props.registry.root.read(t);
|
|
1691
|
+
return ot(s);
|
|
2060
1692
|
}));
|
|
2061
|
-
l(this, "selectedNode",
|
|
1693
|
+
l(this, "selectedNode", D(this, (t) => {
|
|
2062
1694
|
const n = this.selectedNodeId.read(t);
|
|
2063
1695
|
if (n === void 0) return;
|
|
2064
|
-
const
|
|
2065
|
-
return
|
|
1696
|
+
const s = this.tree.read(t);
|
|
1697
|
+
return s.id === n ? s : this._findNode(s.children ?? [], n);
|
|
2066
1698
|
}));
|
|
2067
1699
|
/** List of preview rows to render based on current selection and view mode */
|
|
2068
|
-
l(this, "selectedFixtures",
|
|
1700
|
+
l(this, "selectedFixtures", D(this, (t) => {
|
|
2069
1701
|
const n = this.selectedNode.read(t);
|
|
2070
|
-
return n ? this.isReportMode ? (this.props.reportModel.state.read(t), this._collectReportRows(n, n.name)) : this.viewMode.read(t) === "diff" && this.daemonAvailable ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
|
|
1702
|
+
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) : [];
|
|
2071
1703
|
}));
|
|
2072
1704
|
l(this, "setViewMode", (t) => {
|
|
2073
1705
|
this.viewMode.set(t, void 0);
|
|
@@ -2075,8 +1707,8 @@ class Sn extends z({
|
|
|
2075
1707
|
l(this, "navigateToSession", (t) => {
|
|
2076
1708
|
const n = this.props.daemonModel;
|
|
2077
1709
|
if (!n) return;
|
|
2078
|
-
const
|
|
2079
|
-
|
|
1710
|
+
const s = n.getSessionExplorerUrl(t);
|
|
1711
|
+
s && (window.location.href = s);
|
|
2080
1712
|
});
|
|
2081
1713
|
l(this, "toggleLeftSidebar", () => {
|
|
2082
1714
|
this.leftSidebarVisible.set(!this.leftSidebarVisible.get(), void 0);
|
|
@@ -2091,8 +1723,8 @@ class Sn extends z({
|
|
|
2091
1723
|
this.selectedNodeId.set(t, void 0);
|
|
2092
1724
|
});
|
|
2093
1725
|
l(this, "toggleNodeExpanded", (t) => {
|
|
2094
|
-
const n = this.expandedNodeIds.get(),
|
|
2095
|
-
|
|
1726
|
+
const n = this.expandedNodeIds.get(), s = new Set(n);
|
|
1727
|
+
s.has(t) ? s.delete(t) : s.add(t), this.expandedNodeIds.set(s, void 0);
|
|
2096
1728
|
});
|
|
2097
1729
|
}
|
|
2098
1730
|
get daemonAvailable() {
|
|
@@ -2111,11 +1743,11 @@ class Sn extends z({
|
|
|
2111
1743
|
return this.expandedNodeIds.read(n).has(t);
|
|
2112
1744
|
}
|
|
2113
1745
|
_findNode(t, n) {
|
|
2114
|
-
for (const
|
|
2115
|
-
if (
|
|
2116
|
-
if (
|
|
2117
|
-
const
|
|
2118
|
-
if (
|
|
1746
|
+
for (const s of t) {
|
|
1747
|
+
if (s.id === n) return s;
|
|
1748
|
+
if (s.children) {
|
|
1749
|
+
const o = this._findNode(s.children, n);
|
|
1750
|
+
if (o) return o;
|
|
2119
1751
|
}
|
|
2120
1752
|
}
|
|
2121
1753
|
}
|
|
@@ -2131,28 +1763,28 @@ class Sn extends z({
|
|
|
2131
1763
|
}
|
|
2132
1764
|
}];
|
|
2133
1765
|
if (t.type === "variants") {
|
|
2134
|
-
const
|
|
2135
|
-
for (const
|
|
2136
|
-
|
|
2137
|
-
id:
|
|
2138
|
-
name:
|
|
2139
|
-
path: `${n} / ${
|
|
2140
|
-
component:
|
|
1766
|
+
const o = [];
|
|
1767
|
+
for (const i of t.children ?? [])
|
|
1768
|
+
i.type === "component" && i.component && o.push({
|
|
1769
|
+
id: i.id,
|
|
1770
|
+
name: i.name,
|
|
1771
|
+
path: `${n} / ${i.name}`,
|
|
1772
|
+
component: i.component
|
|
2141
1773
|
});
|
|
2142
|
-
return
|
|
1774
|
+
return o.length > 0 ? [{
|
|
2143
1775
|
type: "variants",
|
|
2144
1776
|
id: t.id,
|
|
2145
1777
|
name: t.name,
|
|
2146
1778
|
path: n,
|
|
2147
|
-
fixtures:
|
|
1779
|
+
fixtures: o
|
|
2148
1780
|
}] : [];
|
|
2149
1781
|
}
|
|
2150
|
-
const
|
|
2151
|
-
for (const
|
|
2152
|
-
const
|
|
2153
|
-
|
|
1782
|
+
const s = [];
|
|
1783
|
+
for (const o of t.children ?? []) {
|
|
1784
|
+
const i = n ? `${n} / ${o.name}` : o.name;
|
|
1785
|
+
s.push(...this._collectPreviewRows(o, i));
|
|
2154
1786
|
}
|
|
2155
|
-
return
|
|
1787
|
+
return s;
|
|
2156
1788
|
}
|
|
2157
1789
|
/**
|
|
2158
1790
|
* In diff mode: fixtures become screenshot comparison items showing current vs baseline.
|
|
@@ -2172,34 +1804,34 @@ class Sn extends z({
|
|
|
2172
1804
|
}]
|
|
2173
1805
|
}];
|
|
2174
1806
|
if (t.type === "variants") {
|
|
2175
|
-
const
|
|
2176
|
-
for (const
|
|
2177
|
-
|
|
2178
|
-
fixtureId:
|
|
2179
|
-
name:
|
|
2180
|
-
path: `${n} / ${
|
|
1807
|
+
const o = [];
|
|
1808
|
+
for (const i of t.children ?? [])
|
|
1809
|
+
i.type === "component" && o.push({
|
|
1810
|
+
fixtureId: i.id,
|
|
1811
|
+
name: i.name,
|
|
1812
|
+
path: `${n} / ${i.name}`
|
|
2181
1813
|
});
|
|
2182
|
-
return
|
|
1814
|
+
return o.length > 0 ? [{
|
|
2183
1815
|
type: "screenshot-comparison",
|
|
2184
1816
|
id: t.id,
|
|
2185
1817
|
name: t.name,
|
|
2186
1818
|
path: n,
|
|
2187
|
-
items:
|
|
1819
|
+
items: o
|
|
2188
1820
|
}] : [];
|
|
2189
1821
|
}
|
|
2190
|
-
const
|
|
2191
|
-
for (const
|
|
2192
|
-
const
|
|
2193
|
-
|
|
1822
|
+
const s = [];
|
|
1823
|
+
for (const o of t.children ?? []) {
|
|
1824
|
+
const i = n ? `${n} / ${o.name}` : o.name;
|
|
1825
|
+
s.push(...this._collectDiffRows(o, i));
|
|
2194
1826
|
}
|
|
2195
|
-
return
|
|
1827
|
+
return s;
|
|
2196
1828
|
}
|
|
2197
1829
|
_collectReportRows(t, n) {
|
|
2198
|
-
const
|
|
2199
|
-
if (
|
|
2200
|
-
const
|
|
1830
|
+
const s = this.props.reportModel.state.get();
|
|
1831
|
+
if (s.status !== "ready") return [];
|
|
1832
|
+
const o = s.report.fixtures;
|
|
2201
1833
|
if (t.type === "component") {
|
|
2202
|
-
const d =
|
|
1834
|
+
const d = o[t.id];
|
|
2203
1835
|
return d ? [{
|
|
2204
1836
|
type: "report-comparison",
|
|
2205
1837
|
id: t.id,
|
|
@@ -2213,15 +1845,15 @@ class Sn extends z({
|
|
|
2213
1845
|
}]
|
|
2214
1846
|
}] : [];
|
|
2215
1847
|
}
|
|
2216
|
-
const
|
|
1848
|
+
const i = [];
|
|
2217
1849
|
for (const d of t.children ?? []) {
|
|
2218
1850
|
const c = n ? `${n} / ${d.name}` : d.name;
|
|
2219
|
-
|
|
1851
|
+
i.push(...this._collectReportRows(d, c));
|
|
2220
1852
|
}
|
|
2221
|
-
return
|
|
1853
|
+
return i;
|
|
2222
1854
|
}
|
|
2223
1855
|
}
|
|
2224
|
-
const
|
|
1856
|
+
const f = {
|
|
2225
1857
|
container: {
|
|
2226
1858
|
display: "flex",
|
|
2227
1859
|
flexDirection: "row",
|
|
@@ -2410,15 +2042,15 @@ const p = {
|
|
|
2410
2042
|
cursor: "pointer"
|
|
2411
2043
|
}
|
|
2412
2044
|
};
|
|
2413
|
-
function
|
|
2414
|
-
return Object.assign({}, ...
|
|
2045
|
+
function Se(...r) {
|
|
2046
|
+
return Object.assign({}, ...r.filter(Boolean));
|
|
2415
2047
|
}
|
|
2416
|
-
class
|
|
2048
|
+
class mr extends B({
|
|
2417
2049
|
active: u()
|
|
2418
2050
|
}) {
|
|
2419
2051
|
constructor() {
|
|
2420
2052
|
super(...arguments);
|
|
2421
|
-
l(this, "isHovered",
|
|
2053
|
+
l(this, "isHovered", w(this, !1));
|
|
2422
2054
|
l(this, "setHovered", (t) => {
|
|
2423
2055
|
this.isHovered.set(t, void 0);
|
|
2424
2056
|
});
|
|
@@ -2427,23 +2059,23 @@ class wn extends z({
|
|
|
2427
2059
|
return this.props.active;
|
|
2428
2060
|
}
|
|
2429
2061
|
}
|
|
2430
|
-
const
|
|
2431
|
-
|
|
2062
|
+
const oe = A(
|
|
2063
|
+
mr,
|
|
2432
2064
|
{
|
|
2433
2065
|
onClick: u.const(),
|
|
2434
2066
|
title: u.const(),
|
|
2435
2067
|
children: u.const()
|
|
2436
2068
|
},
|
|
2437
|
-
(
|
|
2438
|
-
const n = e.isHovered.read(
|
|
2439
|
-
|
|
2440
|
-
n && !
|
|
2441
|
-
|
|
2069
|
+
(r, e, t) => {
|
|
2070
|
+
const n = e.isHovered.read(r), s = e.active.read(r), o = Se(
|
|
2071
|
+
f.titleBarButton,
|
|
2072
|
+
n && !s && f.titleBarButtonHover,
|
|
2073
|
+
s && f.titleBarButtonActive
|
|
2442
2074
|
);
|
|
2443
2075
|
return /* @__PURE__ */ a(
|
|
2444
2076
|
"button",
|
|
2445
2077
|
{
|
|
2446
|
-
style:
|
|
2078
|
+
style: o,
|
|
2447
2079
|
onClick: t.onClick,
|
|
2448
2080
|
title: t.title,
|
|
2449
2081
|
onMouseEnter: () => e.setHovered(!0),
|
|
@@ -2452,20 +2084,20 @@ const ce = $(
|
|
|
2452
2084
|
}
|
|
2453
2085
|
);
|
|
2454
2086
|
}
|
|
2455
|
-
),
|
|
2087
|
+
), 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 = V(
|
|
2456
2088
|
{ model: u.const() },
|
|
2457
|
-
(
|
|
2089
|
+
(r, e) => {
|
|
2458
2090
|
var d, c;
|
|
2459
|
-
const t = e.model, n = t.viewMode.read(
|
|
2460
|
-
return /* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
/* @__PURE__ */ a(
|
|
2463
|
-
/* @__PURE__ */ a(
|
|
2091
|
+
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);
|
|
2092
|
+
return s.length <= 1 ? null : /* @__PURE__ */ p("div", { style: J.container, children: [
|
|
2093
|
+
/* @__PURE__ */ p("div", { style: J.segmentedControl, children: [
|
|
2094
|
+
/* @__PURE__ */ a(Be, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
|
|
2095
|
+
/* @__PURE__ */ a(Be, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
|
|
2464
2096
|
] }),
|
|
2465
|
-
|
|
2097
|
+
i.length > 0 && /* @__PURE__ */ a("div", { style: J.sessionLinks, children: i.map((h) => /* @__PURE__ */ p(
|
|
2466
2098
|
"button",
|
|
2467
2099
|
{
|
|
2468
|
-
style:
|
|
2100
|
+
style: J.sessionLink,
|
|
2469
2101
|
onClick: () => t.navigateToSession(h.name),
|
|
2470
2102
|
title: `Switch to ${h.name} session`,
|
|
2471
2103
|
children: [
|
|
@@ -2478,63 +2110,63 @@ const ce = $(
|
|
|
2478
2110
|
] });
|
|
2479
2111
|
}
|
|
2480
2112
|
);
|
|
2481
|
-
function
|
|
2113
|
+
function Be({ label: r, mode: e, active: t, onClick: n }) {
|
|
2482
2114
|
return /* @__PURE__ */ a(
|
|
2483
2115
|
"button",
|
|
2484
2116
|
{
|
|
2485
|
-
style: t ?
|
|
2117
|
+
style: t ? J.segmentActive : J.segment,
|
|
2486
2118
|
onClick: n,
|
|
2487
|
-
children:
|
|
2119
|
+
children: r
|
|
2488
2120
|
}
|
|
2489
2121
|
);
|
|
2490
2122
|
}
|
|
2491
|
-
const
|
|
2123
|
+
const Tr = V(
|
|
2492
2124
|
{
|
|
2493
2125
|
model: u.const()
|
|
2494
2126
|
},
|
|
2495
|
-
(
|
|
2496
|
-
const t = e.model, n = t.leftSidebarVisible.read(
|
|
2497
|
-
return /* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */ a("div", { style:
|
|
2499
|
-
|
|
2127
|
+
(r, e) => {
|
|
2128
|
+
const t = e.model, n = t.leftSidebarVisible.read(r), s = t.rightSidebarVisible.read(r), o = t.isDarkTheme.read(r), i = t.selectedNode.read(r);
|
|
2129
|
+
return /* @__PURE__ */ p("div", { style: f.titleBar, children: [
|
|
2130
|
+
/* @__PURE__ */ a("div", { style: f.titleBarSection, children: /* @__PURE__ */ a(
|
|
2131
|
+
oe,
|
|
2500
2132
|
{
|
|
2501
2133
|
active: n,
|
|
2502
2134
|
onClick: t.toggleLeftSidebar,
|
|
2503
2135
|
title: "Toggle left sidebar",
|
|
2504
|
-
children: /* @__PURE__ */ a(
|
|
2136
|
+
children: /* @__PURE__ */ a(xr, {})
|
|
2505
2137
|
}
|
|
2506
2138
|
) }),
|
|
2507
|
-
/* @__PURE__ */
|
|
2508
|
-
t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(
|
|
2509
|
-
|
|
2139
|
+
/* @__PURE__ */ p("div", { style: f.titleBarCenter, children: [
|
|
2140
|
+
t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Rr, { model: t }) : null,
|
|
2141
|
+
i ? /* @__PURE__ */ p(ge, { children: [
|
|
2510
2142
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "<" }),
|
|
2511
|
-
/* @__PURE__ */ a("span", { children:
|
|
2143
|
+
/* @__PURE__ */ a("span", { children: i.name }),
|
|
2512
2144
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "/>" })
|
|
2513
2145
|
] }) : /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: "No component selected" })
|
|
2514
2146
|
] }),
|
|
2515
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ p("div", { style: f.titleBarSection, children: [
|
|
2516
2148
|
/* @__PURE__ */ a(
|
|
2517
|
-
|
|
2149
|
+
oe,
|
|
2518
2150
|
{
|
|
2519
2151
|
active: !1,
|
|
2520
2152
|
onClick: t.toggleTheme,
|
|
2521
|
-
title:
|
|
2522
|
-
children:
|
|
2153
|
+
title: o ? "Switch to light theme" : "Switch to dark theme",
|
|
2154
|
+
children: o ? /* @__PURE__ */ a(Sr, {}) : /* @__PURE__ */ a(wr, {})
|
|
2523
2155
|
}
|
|
2524
2156
|
),
|
|
2525
2157
|
/* @__PURE__ */ a(
|
|
2526
|
-
|
|
2158
|
+
oe,
|
|
2527
2159
|
{
|
|
2528
|
-
active:
|
|
2160
|
+
active: s,
|
|
2529
2161
|
onClick: t.toggleRightSidebar,
|
|
2530
2162
|
title: "Toggle right sidebar",
|
|
2531
|
-
children: /* @__PURE__ */ a(
|
|
2163
|
+
children: /* @__PURE__ */ a(Cr, {})
|
|
2532
2164
|
}
|
|
2533
2165
|
)
|
|
2534
2166
|
] })
|
|
2535
2167
|
] });
|
|
2536
2168
|
}
|
|
2537
|
-
),
|
|
2169
|
+
), J = {
|
|
2538
2170
|
container: {
|
|
2539
2171
|
display: "flex",
|
|
2540
2172
|
alignItems: "center",
|
|
@@ -2578,22 +2210,22 @@ const Fn = k(
|
|
|
2578
2210
|
color: "var(--vscode-textLink-foreground)",
|
|
2579
2211
|
cursor: "pointer"
|
|
2580
2212
|
}
|
|
2581
|
-
},
|
|
2213
|
+
}, it = V(
|
|
2582
2214
|
{
|
|
2583
2215
|
model: u.const(),
|
|
2584
2216
|
nodes: u.const(),
|
|
2585
2217
|
depth: u.const()
|
|
2586
2218
|
},
|
|
2587
|
-
(
|
|
2219
|
+
(r, e) => /* @__PURE__ */ a(ge, { children: e.nodes.map((t) => /* @__PURE__ */ a(Or, { model: e.model, node: t, depth: e.depth }, t.id)) })
|
|
2588
2220
|
);
|
|
2589
|
-
class
|
|
2221
|
+
class Ir extends B({
|
|
2590
2222
|
model: u.const(),
|
|
2591
2223
|
node: u.const(),
|
|
2592
2224
|
depth: u.const()
|
|
2593
2225
|
}) {
|
|
2594
2226
|
constructor() {
|
|
2595
2227
|
super(...arguments);
|
|
2596
|
-
l(this, "isHovered",
|
|
2228
|
+
l(this, "isHovered", w(this, !1));
|
|
2597
2229
|
l(this, "setHovered", (t) => {
|
|
2598
2230
|
this.isHovered.set(t, void 0);
|
|
2599
2231
|
});
|
|
@@ -2621,15 +2253,15 @@ class En extends z({
|
|
|
2621
2253
|
return !!(this.props.node.children && this.props.node.children.length > 0);
|
|
2622
2254
|
}
|
|
2623
2255
|
}
|
|
2624
|
-
const
|
|
2625
|
-
const t = e.explorerModel, n = e.treeNode,
|
|
2626
|
-
|
|
2627
|
-
{ paddingLeft: `${8 +
|
|
2628
|
-
c &&
|
|
2629
|
-
!c && h &&
|
|
2256
|
+
const Or = A(Ir, {}, (r, e) => {
|
|
2257
|
+
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), m = Se(
|
|
2258
|
+
f.treeItem,
|
|
2259
|
+
{ paddingLeft: `${8 + s * 12}px` },
|
|
2260
|
+
c && f.treeItemSelected,
|
|
2261
|
+
!c && h && f.treeItemHover
|
|
2630
2262
|
);
|
|
2631
|
-
return /* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ p(ge, { children: [
|
|
2264
|
+
/* @__PURE__ */ p(
|
|
2633
2265
|
"div",
|
|
2634
2266
|
{
|
|
2635
2267
|
style: m,
|
|
@@ -2638,38 +2270,38 @@ const An = $(En, {}, (s, e) => {
|
|
|
2638
2270
|
onMouseEnter: () => e.setHovered(!0),
|
|
2639
2271
|
onMouseLeave: () => e.setHovered(!1),
|
|
2640
2272
|
children: [
|
|
2641
|
-
|
|
2642
|
-
/* @__PURE__ */ a("div", { style:
|
|
2643
|
-
/* @__PURE__ */ a("span", { style:
|
|
2644
|
-
|
|
2273
|
+
o ? /* @__PURE__ */ a("div", { style: f.treeItemChevron, onClick: e.handleChevronClick, children: i ? /* @__PURE__ */ a(_r, {}) : /* @__PURE__ */ a(vr, {}) }) : /* @__PURE__ */ a("div", { style: f.treeItemChevronPlaceholder }),
|
|
2274
|
+
/* @__PURE__ */ a("div", { style: f.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(yr, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(br, { style: { color: "#deb45b" } }) }),
|
|
2275
|
+
/* @__PURE__ */ a("span", { style: f.treeItemLabel, children: n.name }),
|
|
2276
|
+
o && /* @__PURE__ */ a("span", { style: f.treeItemCount, children: n.children.length })
|
|
2645
2277
|
]
|
|
2646
2278
|
}
|
|
2647
2279
|
),
|
|
2648
|
-
|
|
2280
|
+
o && i && /* @__PURE__ */ a(it, { model: t, nodes: n.children, depth: s + 1 })
|
|
2649
2281
|
] });
|
|
2650
|
-
}),
|
|
2282
|
+
}), kr = V(
|
|
2651
2283
|
{
|
|
2652
2284
|
model: u.const()
|
|
2653
2285
|
},
|
|
2654
|
-
(
|
|
2655
|
-
const t = e.model.tree.read(
|
|
2656
|
-
return /* @__PURE__ */
|
|
2657
|
-
/* @__PURE__ */ a("div", { style:
|
|
2658
|
-
/* @__PURE__ */ a("div", { style:
|
|
2286
|
+
(r, e) => {
|
|
2287
|
+
const t = e.model.tree.read(r);
|
|
2288
|
+
return /* @__PURE__ */ p("div", { style: f.sidebar, children: [
|
|
2289
|
+
/* @__PURE__ */ a("div", { style: f.sidebarHeader, children: "Explorer" }),
|
|
2290
|
+
/* @__PURE__ */ a("div", { style: f.sidebarContent, children: /* @__PURE__ */ a(it, { model: e.model, nodes: [t], depth: 0 }) })
|
|
2659
2291
|
] });
|
|
2660
2292
|
}
|
|
2661
2293
|
);
|
|
2662
|
-
class
|
|
2294
|
+
class Vr extends B({}) {
|
|
2663
2295
|
constructor() {
|
|
2664
2296
|
super(...arguments);
|
|
2665
|
-
l(this, "checked",
|
|
2297
|
+
l(this, "checked", w(this, !1));
|
|
2666
2298
|
l(this, "toggle", () => {
|
|
2667
2299
|
this.checked.set(!this.checked.get(), void 0);
|
|
2668
2300
|
});
|
|
2669
2301
|
}
|
|
2670
2302
|
}
|
|
2671
|
-
const
|
|
2672
|
-
const t = e.checked.read(
|
|
2303
|
+
const Nr = A(Vr, {}, (r, e) => {
|
|
2304
|
+
const t = e.checked.read(r), n = {
|
|
2673
2305
|
position: "relative",
|
|
2674
2306
|
width: "36px",
|
|
2675
2307
|
height: "18px",
|
|
@@ -2678,7 +2310,7 @@ const $n = $(zn, {}, (s, e) => {
|
|
|
2678
2310
|
cursor: "pointer",
|
|
2679
2311
|
transition: "background-color 0.2s",
|
|
2680
2312
|
border: "1px solid var(--vscode-input-border, transparent)"
|
|
2681
|
-
},
|
|
2313
|
+
}, s = {
|
|
2682
2314
|
position: "absolute",
|
|
2683
2315
|
top: "2px",
|
|
2684
2316
|
left: t ? "18px" : "2px",
|
|
@@ -2688,14 +2320,14 @@ const $n = $(zn, {}, (s, e) => {
|
|
|
2688
2320
|
borderRadius: "50%",
|
|
2689
2321
|
transition: "left 0.2s"
|
|
2690
2322
|
};
|
|
2691
|
-
return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style:
|
|
2692
|
-
}),
|
|
2323
|
+
return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: s }) });
|
|
2324
|
+
}), Mr = V(
|
|
2693
2325
|
{
|
|
2694
2326
|
node: u.const()
|
|
2695
2327
|
},
|
|
2696
|
-
(
|
|
2697
|
-
/* @__PURE__ */
|
|
2698
|
-
/* @__PURE__ */
|
|
2328
|
+
(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__ */ p("div", { style: f.propertiesPanel, children: [
|
|
2329
|
+
/* @__PURE__ */ p("div", { style: f.propertyRow, children: [
|
|
2330
|
+
/* @__PURE__ */ p("div", { style: f.propertyLabel, children: [
|
|
2699
2331
|
"children",
|
|
2700
2332
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : string" })
|
|
2701
2333
|
] }),
|
|
@@ -2703,60 +2335,60 @@ const $n = $(zn, {}, (s, e) => {
|
|
|
2703
2335
|
"input",
|
|
2704
2336
|
{
|
|
2705
2337
|
type: "text",
|
|
2706
|
-
style:
|
|
2338
|
+
style: f.propertyInput,
|
|
2707
2339
|
defaultValue: "Click me",
|
|
2708
2340
|
placeholder: "Enter text..."
|
|
2709
2341
|
}
|
|
2710
2342
|
),
|
|
2711
|
-
/* @__PURE__ */ a("div", { style:
|
|
2343
|
+
/* @__PURE__ */ a("div", { style: f.propertyDescription, children: "Button text content" })
|
|
2712
2344
|
] }),
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ p("div", { style: f.propertyRow, children: [
|
|
2346
|
+
/* @__PURE__ */ p("div", { style: f.propertyLabel, children: [
|
|
2715
2347
|
"variant",
|
|
2716
2348
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
|
|
2717
2349
|
] }),
|
|
2718
|
-
/* @__PURE__ */
|
|
2350
|
+
/* @__PURE__ */ p("select", { style: f.propertySelect, defaultValue: "default", children: [
|
|
2719
2351
|
/* @__PURE__ */ a("option", { value: "default", children: "default" }),
|
|
2720
2352
|
/* @__PURE__ */ a("option", { value: "primary", children: "primary" }),
|
|
2721
2353
|
/* @__PURE__ */ a("option", { value: "secondary", children: "secondary" }),
|
|
2722
2354
|
/* @__PURE__ */ a("option", { value: "destructive", children: "destructive" })
|
|
2723
2355
|
] }),
|
|
2724
|
-
/* @__PURE__ */ a("div", { style:
|
|
2356
|
+
/* @__PURE__ */ a("div", { style: f.propertyDescription, children: "Visual style variant" })
|
|
2725
2357
|
] }),
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ p("div", { style: f.propertyRow, children: [
|
|
2359
|
+
/* @__PURE__ */ p("div", { style: f.propertyLabel, children: [
|
|
2728
2360
|
"size",
|
|
2729
2361
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
|
|
2730
2362
|
] }),
|
|
2731
|
-
/* @__PURE__ */
|
|
2363
|
+
/* @__PURE__ */ p("select", { style: f.propertySelect, defaultValue: "default", children: [
|
|
2732
2364
|
/* @__PURE__ */ a("option", { value: "sm", children: "sm" }),
|
|
2733
2365
|
/* @__PURE__ */ a("option", { value: "default", children: "default" }),
|
|
2734
2366
|
/* @__PURE__ */ a("option", { value: "lg", children: "lg" })
|
|
2735
2367
|
] }),
|
|
2736
|
-
/* @__PURE__ */ a("div", { style:
|
|
2368
|
+
/* @__PURE__ */ a("div", { style: f.propertyDescription, children: "Button size" })
|
|
2737
2369
|
] }),
|
|
2738
|
-
/* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ p("div", { style: f.propertyRow, children: [
|
|
2371
|
+
/* @__PURE__ */ p("div", { style: f.propertyLabel, children: [
|
|
2740
2372
|
"disabled",
|
|
2741
2373
|
/* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : boolean" })
|
|
2742
2374
|
] }),
|
|
2743
|
-
/* @__PURE__ */ a(
|
|
2744
|
-
/* @__PURE__ */ a("div", { style:
|
|
2375
|
+
/* @__PURE__ */ a(Nr, {}),
|
|
2376
|
+
/* @__PURE__ */ a("div", { style: f.propertyDescription, children: "Disable the button" })
|
|
2745
2377
|
] })
|
|
2746
2378
|
] })
|
|
2747
|
-
),
|
|
2379
|
+
), Dr = V(
|
|
2748
2380
|
{
|
|
2749
2381
|
selectedNode: u.const()
|
|
2750
2382
|
},
|
|
2751
|
-
(
|
|
2752
|
-
/* @__PURE__ */
|
|
2383
|
+
(r, e) => /* @__PURE__ */ p("div", { style: Se(f.sidebar, f.sidebarRight), children: [
|
|
2384
|
+
/* @__PURE__ */ p("div", { style: f.sidebarHeader, children: [
|
|
2753
2385
|
/* @__PURE__ */ a("span", { style: { marginRight: "6px", color: "var(--vscode-textLink-foreground)" }, children: "</>" }),
|
|
2754
2386
|
"Props"
|
|
2755
2387
|
] }),
|
|
2756
|
-
/* @__PURE__ */ a("div", { style:
|
|
2388
|
+
/* @__PURE__ */ a("div", { style: f.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(Mr, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
|
|
2757
2389
|
] })
|
|
2758
2390
|
);
|
|
2759
|
-
class
|
|
2391
|
+
class Fr extends B({
|
|
2760
2392
|
fixture: u.const(),
|
|
2761
2393
|
compact: u.const()
|
|
2762
2394
|
}) {
|
|
@@ -2765,21 +2397,22 @@ class Un extends z({
|
|
|
2765
2397
|
l(this, "_containerRef", null);
|
|
2766
2398
|
l(this, "_shadowRoot", null);
|
|
2767
2399
|
l(this, "_renderContainer", null);
|
|
2768
|
-
l(this, "
|
|
2400
|
+
l(this, "_renderResult", null);
|
|
2401
|
+
l(this, "_abortController", null);
|
|
2769
2402
|
l(this, "_resizeObserver", null);
|
|
2770
|
-
l(this, "measuredWidth",
|
|
2771
|
-
l(this, "measuredHeight",
|
|
2403
|
+
l(this, "measuredWidth", w(this, void 0));
|
|
2404
|
+
l(this, "measuredHeight", w(this, void 0));
|
|
2772
2405
|
l(this, "setContainerRef", (t) => {
|
|
2773
2406
|
if (t === this._containerRef || (this._cleanup(), this._containerRef = t, !t)) return;
|
|
2774
2407
|
const n = this.fixture.component;
|
|
2775
2408
|
n.isolation === "shadow-dom" ? this._renderInShadowDom(t, n) : this._renderDirect(t, n);
|
|
2776
|
-
const
|
|
2777
|
-
this._resizeObserver = new ResizeObserver((
|
|
2778
|
-
for (const
|
|
2779
|
-
const { width: d, height: c } =
|
|
2409
|
+
const s = this._renderContainer ?? t;
|
|
2410
|
+
this._resizeObserver = new ResizeObserver((o) => {
|
|
2411
|
+
for (const i of o) {
|
|
2412
|
+
const { width: d, height: c } = i.contentRect;
|
|
2780
2413
|
c > 0 && (this.measuredWidth.set(Math.round(d), void 0), this.measuredHeight.set(Math.round(c), void 0));
|
|
2781
2414
|
}
|
|
2782
|
-
}), this._resizeObserver.observe(
|
|
2415
|
+
}), this._resizeObserver.observe(s);
|
|
2783
2416
|
});
|
|
2784
2417
|
}
|
|
2785
2418
|
get fixture() {
|
|
@@ -2796,69 +2429,81 @@ class Un extends z({
|
|
|
2796
2429
|
} else
|
|
2797
2430
|
this._shadowRoot = t.attachShadow({ mode: "open" });
|
|
2798
2431
|
if (n.styles)
|
|
2799
|
-
for (const
|
|
2800
|
-
if (
|
|
2432
|
+
for (const i of n.styles)
|
|
2433
|
+
if (i.type === "css") {
|
|
2801
2434
|
const d = document.createElement("style");
|
|
2802
|
-
d.textContent =
|
|
2803
|
-
} else if (
|
|
2435
|
+
d.textContent = i.content, this._shadowRoot.appendChild(d);
|
|
2436
|
+
} else if (i.type === "url") {
|
|
2804
2437
|
const d = document.createElement("link");
|
|
2805
|
-
d.rel = "stylesheet", d.href =
|
|
2806
|
-
} else
|
|
2438
|
+
d.rel = "stylesheet", d.href = i.href, this._shadowRoot.appendChild(d);
|
|
2439
|
+
} else i.type === "adopted" && (this._shadowRoot.adoptedStyleSheets = [
|
|
2807
2440
|
...this._shadowRoot.adoptedStyleSheets,
|
|
2808
|
-
|
|
2441
|
+
i.sheet
|
|
2809
2442
|
]);
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2812
|
-
const
|
|
2813
|
-
this.
|
|
2443
|
+
const s = document.createElement("div");
|
|
2444
|
+
s.style.display = "inline-block", this._renderContainer = s, this._shadowRoot.appendChild(s);
|
|
2445
|
+
const o = this._getDefaultProps(n);
|
|
2446
|
+
this._abortController = new AbortController(), this._handleRenderReturn(n.render(s, {
|
|
2447
|
+
props: o,
|
|
2448
|
+
signal: this._abortController.signal
|
|
2449
|
+
}));
|
|
2814
2450
|
}
|
|
2815
2451
|
_renderDirect(t, n) {
|
|
2816
2452
|
this._renderContainer = t;
|
|
2817
|
-
const
|
|
2818
|
-
this.
|
|
2453
|
+
const s = this._getDefaultProps(n);
|
|
2454
|
+
this._abortController = new AbortController(), this._handleRenderReturn(n.render(t, {
|
|
2455
|
+
props: s,
|
|
2456
|
+
signal: this._abortController.signal
|
|
2457
|
+
}));
|
|
2458
|
+
}
|
|
2459
|
+
_handleRenderReturn(t) {
|
|
2460
|
+
t instanceof Promise ? t.then((n) => {
|
|
2461
|
+
this._abortController && !this._abortController.signal.aborted && (this._renderResult = n ?? void 0);
|
|
2462
|
+
}).catch(() => {
|
|
2463
|
+
}) : this._renderResult = t ?? void 0;
|
|
2819
2464
|
}
|
|
2820
2465
|
_getDefaultProps(t) {
|
|
2821
2466
|
const n = {};
|
|
2822
|
-
for (const
|
|
2823
|
-
n[
|
|
2467
|
+
for (const s of t.properties)
|
|
2468
|
+
n[s.name] = s.defaultValue;
|
|
2824
2469
|
return n;
|
|
2825
2470
|
}
|
|
2826
2471
|
_cleanup() {
|
|
2827
|
-
var t;
|
|
2828
|
-
this.
|
|
2472
|
+
var t, n;
|
|
2473
|
+
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;
|
|
2829
2474
|
}
|
|
2830
2475
|
dispose() {
|
|
2831
2476
|
this._cleanup();
|
|
2832
2477
|
}
|
|
2833
2478
|
}
|
|
2834
|
-
const
|
|
2835
|
-
|
|
2479
|
+
const at = A(
|
|
2480
|
+
Fr,
|
|
2836
2481
|
{},
|
|
2837
|
-
(
|
|
2838
|
-
const t = e.fixture, n = t.component,
|
|
2482
|
+
(r, e) => {
|
|
2483
|
+
const t = e.fixture, n = t.component, s = n.displayMode, o = e.measuredWidth.read(r), i = e.measuredHeight.read(r), d = e.compact;
|
|
2839
2484
|
let c;
|
|
2840
|
-
if (
|
|
2841
|
-
const
|
|
2485
|
+
if (s.type === "page") {
|
|
2486
|
+
const R = s.viewports[0], g = wt(R);
|
|
2842
2487
|
c = {
|
|
2843
|
-
width:
|
|
2844
|
-
height:
|
|
2488
|
+
width: g.width,
|
|
2489
|
+
height: g.height,
|
|
2845
2490
|
overflow: "auto"
|
|
2846
2491
|
};
|
|
2847
2492
|
} else
|
|
2848
2493
|
c = {
|
|
2849
2494
|
display: "inline-block"
|
|
2850
2495
|
};
|
|
2851
|
-
const h =
|
|
2852
|
-
return /* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */ a("span", { style:
|
|
2855
|
-
!d && h && /* @__PURE__ */ a("span", { style:
|
|
2496
|
+
const h = o && i ? `${o} × ${i}` : "", m = d ? G.wrapperCompact : G.wrapper, v = d ? G.nameCompact : G.name;
|
|
2497
|
+
return /* @__PURE__ */ p("div", { style: m, children: [
|
|
2498
|
+
/* @__PURE__ */ p("div", { style: G.labelRow, children: [
|
|
2499
|
+
/* @__PURE__ */ a("span", { style: v, children: t.name }),
|
|
2500
|
+
!d && h && /* @__PURE__ */ a("span", { style: G.dimensions, children: h })
|
|
2856
2501
|
] }),
|
|
2857
|
-
/* @__PURE__ */ a("div", { style:
|
|
2502
|
+
/* @__PURE__ */ a("div", { style: zr(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: c }) })
|
|
2858
2503
|
] });
|
|
2859
2504
|
}
|
|
2860
|
-
),
|
|
2861
|
-
function
|
|
2505
|
+
), W = 8;
|
|
2506
|
+
function dt(r, e) {
|
|
2862
2507
|
return `
|
|
2863
2508
|
linear-gradient(45deg, ${e} 25%, transparent 25%),
|
|
2864
2509
|
linear-gradient(-45deg, ${e} 25%, transparent 25%),
|
|
@@ -2866,29 +2511,31 @@ function pt(s, e) {
|
|
|
2866
2511
|
linear-gradient(-45deg, transparent 75%, ${e} 75%)
|
|
2867
2512
|
`;
|
|
2868
2513
|
}
|
|
2869
|
-
const
|
|
2514
|
+
const Er = {
|
|
2870
2515
|
backgroundColor: "#ffffff",
|
|
2871
|
-
backgroundImage:
|
|
2872
|
-
},
|
|
2516
|
+
backgroundImage: dt("#ffffff", "#e5e5e5")
|
|
2517
|
+
}, Br = {
|
|
2873
2518
|
backgroundColor: "#1e1e1e",
|
|
2874
|
-
backgroundImage:
|
|
2875
|
-
},
|
|
2519
|
+
backgroundImage: dt("#1e1e1e", "#2d2d2d")
|
|
2520
|
+
}, Ar = {
|
|
2876
2521
|
display: "inline-block",
|
|
2877
2522
|
padding: "12px",
|
|
2878
2523
|
borderRadius: "4px",
|
|
2879
|
-
backgroundSize: `${
|
|
2880
|
-
backgroundPosition: `0 0, 0 ${
|
|
2881
|
-
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
|
|
2524
|
+
backgroundSize: `${W * 2}px ${W * 2}px`,
|
|
2525
|
+
backgroundPosition: `0 0, 0 ${W}px, ${W}px -${W}px, -${W}px 0`,
|
|
2526
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)",
|
|
2527
|
+
overflow: "hidden",
|
|
2528
|
+
position: "relative"
|
|
2882
2529
|
};
|
|
2883
|
-
function
|
|
2884
|
-
const e =
|
|
2530
|
+
function zr(r) {
|
|
2531
|
+
const e = r === "dark" ? Br : Er;
|
|
2885
2532
|
return {
|
|
2886
|
-
...
|
|
2533
|
+
...Ar,
|
|
2887
2534
|
backgroundColor: e.backgroundColor,
|
|
2888
2535
|
backgroundImage: e.backgroundImage
|
|
2889
2536
|
};
|
|
2890
2537
|
}
|
|
2891
|
-
const
|
|
2538
|
+
const G = {
|
|
2892
2539
|
wrapper: {
|
|
2893
2540
|
marginBottom: "32px"
|
|
2894
2541
|
},
|
|
@@ -2917,16 +2564,16 @@ const K = {
|
|
|
2917
2564
|
fontFamily: "var(--vscode-editor-font-family, monospace)"
|
|
2918
2565
|
}
|
|
2919
2566
|
};
|
|
2920
|
-
class
|
|
2567
|
+
class $r extends B({
|
|
2921
2568
|
fixtureId: u.const(),
|
|
2922
2569
|
sessionName: u.const(),
|
|
2923
2570
|
daemon: u.const()
|
|
2924
2571
|
}) {
|
|
2925
2572
|
constructor(t) {
|
|
2926
2573
|
super(t);
|
|
2927
|
-
l(this, "screenshot",
|
|
2574
|
+
l(this, "screenshot", w(this, { status: "idle" }));
|
|
2928
2575
|
l(this, "_fetchVersion", 0);
|
|
2929
|
-
this._store.add(
|
|
2576
|
+
this._store.add(Qe((n) => {
|
|
2930
2577
|
this.props.daemon.sourceTreeIds.read(n).get(this.props.sessionName) && this._fetchScreenshot();
|
|
2931
2578
|
}));
|
|
2932
2579
|
}
|
|
@@ -2944,26 +2591,26 @@ class qn extends z({
|
|
|
2944
2591
|
}
|
|
2945
2592
|
}
|
|
2946
2593
|
}
|
|
2947
|
-
const
|
|
2948
|
-
|
|
2594
|
+
const Ae = A(
|
|
2595
|
+
$r,
|
|
2949
2596
|
{},
|
|
2950
|
-
(
|
|
2951
|
-
const t = e.screenshot.read(
|
|
2597
|
+
(r, e) => {
|
|
2598
|
+
const t = e.screenshot.read(r);
|
|
2952
2599
|
if (t.status === "idle" || t.status === "loading")
|
|
2953
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2600
|
+
return /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("div", { style: z.shimmer }) });
|
|
2954
2601
|
if (t.status === "error")
|
|
2955
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2602
|
+
return /* @__PURE__ */ a("div", { style: z.error, children: /* @__PURE__ */ a("span", { style: z.errorText, children: "Screenshot failed" }) });
|
|
2956
2603
|
const { data: n } = t;
|
|
2957
2604
|
return n.image ? /* @__PURE__ */ a(
|
|
2958
2605
|
"img",
|
|
2959
2606
|
{
|
|
2960
2607
|
src: `data:image/png;base64,${n.image}`,
|
|
2961
|
-
style:
|
|
2608
|
+
style: z.image,
|
|
2962
2609
|
alt: `Screenshot of ${e.fixtureId}`
|
|
2963
2610
|
}
|
|
2964
|
-
) : /* @__PURE__ */ a("div", { style:
|
|
2611
|
+
) : /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("span", { style: z.hashText, children: n.hash.slice(0, 12) }) });
|
|
2965
2612
|
}
|
|
2966
|
-
),
|
|
2613
|
+
), z = {
|
|
2967
2614
|
placeholder: {
|
|
2968
2615
|
minHeight: 80,
|
|
2969
2616
|
display: "flex",
|
|
@@ -3006,7 +2653,7 @@ const Ue = $(
|
|
|
3006
2653
|
border: "1px solid var(--vscode-panel-border)"
|
|
3007
2654
|
}
|
|
3008
2655
|
};
|
|
3009
|
-
class
|
|
2656
|
+
class Lr extends B({
|
|
3010
2657
|
fixtureId: u.const(),
|
|
3011
2658
|
daemon: u.const(),
|
|
3012
2659
|
baselineSession: u.const(),
|
|
@@ -3014,10 +2661,10 @@ class Kn extends z({
|
|
|
3014
2661
|
}) {
|
|
3015
2662
|
constructor(t) {
|
|
3016
2663
|
super(t);
|
|
3017
|
-
l(this, "comparisonStatus",
|
|
3018
|
-
this._store.add(
|
|
3019
|
-
const
|
|
3020
|
-
|
|
2664
|
+
l(this, "comparisonStatus", w(this, { status: "loading" }));
|
|
2665
|
+
this._store.add(Qe((n) => {
|
|
2666
|
+
const s = this.props.daemon.sourceTreeIds.read(n), o = s.get(this.props.baselineSession), i = s.get(this.props.currentSession);
|
|
2667
|
+
o && i && this._fetchComparison();
|
|
3021
2668
|
}));
|
|
3022
2669
|
}
|
|
3023
2670
|
get fixtureId() {
|
|
@@ -3046,21 +2693,21 @@ class Kn extends z({
|
|
|
3046
2693
|
}
|
|
3047
2694
|
}
|
|
3048
2695
|
}
|
|
3049
|
-
const
|
|
3050
|
-
|
|
2696
|
+
const Hr = A(
|
|
2697
|
+
Lr,
|
|
3051
2698
|
{},
|
|
3052
|
-
(
|
|
3053
|
-
const t = e.comparisonStatus.read(
|
|
3054
|
-
return /* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
3056
|
-
/* @__PURE__ */ a("span", { style:
|
|
2699
|
+
(r, e) => {
|
|
2700
|
+
const t = e.comparisonStatus.read(r), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: T.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: T.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: T.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: T.badgeChanged, children: "● changed" });
|
|
2701
|
+
return /* @__PURE__ */ p("div", { style: T.fixtureRow, children: [
|
|
2702
|
+
/* @__PURE__ */ p("div", { style: T.fixtureLabel, children: [
|
|
2703
|
+
/* @__PURE__ */ a("span", { style: T.fixtureName, children: e.fixtureId }),
|
|
3057
2704
|
n
|
|
3058
2705
|
] }),
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */ a("span", { style:
|
|
2706
|
+
/* @__PURE__ */ p("div", { style: T.sideBySide, children: [
|
|
2707
|
+
/* @__PURE__ */ p("div", { style: T.screenshotColumn, children: [
|
|
2708
|
+
/* @__PURE__ */ a("span", { style: T.columnLabel, children: "Current" }),
|
|
3062
2709
|
/* @__PURE__ */ a(
|
|
3063
|
-
|
|
2710
|
+
Ae,
|
|
3064
2711
|
{
|
|
3065
2712
|
fixtureId: e.fixtureId,
|
|
3066
2713
|
sessionName: e.currentSession,
|
|
@@ -3068,10 +2715,10 @@ const Jn = $(
|
|
|
3068
2715
|
}
|
|
3069
2716
|
)
|
|
3070
2717
|
] }),
|
|
3071
|
-
/* @__PURE__ */
|
|
3072
|
-
/* @__PURE__ */ a("span", { style:
|
|
2718
|
+
/* @__PURE__ */ p("div", { style: T.screenshotColumn, children: [
|
|
2719
|
+
/* @__PURE__ */ a("span", { style: T.columnLabel, children: "Baseline" }),
|
|
3073
2720
|
/* @__PURE__ */ a(
|
|
3074
|
-
|
|
2721
|
+
Ae,
|
|
3075
2722
|
{
|
|
3076
2723
|
fixtureId: e.fixtureId,
|
|
3077
2724
|
sessionName: e.baselineSession,
|
|
@@ -3082,7 +2729,7 @@ const Jn = $(
|
|
|
3082
2729
|
] })
|
|
3083
2730
|
] });
|
|
3084
2731
|
}
|
|
3085
|
-
),
|
|
2732
|
+
), jr = V(
|
|
3086
2733
|
{
|
|
3087
2734
|
name: u.const(),
|
|
3088
2735
|
path: u.const(),
|
|
@@ -3091,10 +2738,10 @@ const Jn = $(
|
|
|
3091
2738
|
baselineSession: u.const(),
|
|
3092
2739
|
currentSession: u.const()
|
|
3093
2740
|
},
|
|
3094
|
-
(
|
|
3095
|
-
/* @__PURE__ */ a("div", { style:
|
|
3096
|
-
/* @__PURE__ */ a("div", { style:
|
|
3097
|
-
|
|
2741
|
+
(r, e) => /* @__PURE__ */ p("div", { children: [
|
|
2742
|
+
/* @__PURE__ */ a("div", { style: T.groupHeader, children: /* @__PURE__ */ a("span", { style: T.groupTitle, children: e.path }) }),
|
|
2743
|
+
/* @__PURE__ */ a("div", { style: T.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
|
|
2744
|
+
Hr,
|
|
3098
2745
|
{
|
|
3099
2746
|
fixtureId: t.fixtureId,
|
|
3100
2747
|
daemon: e.daemon,
|
|
@@ -3104,7 +2751,7 @@ const Jn = $(
|
|
|
3104
2751
|
t.fixtureId
|
|
3105
2752
|
)) })
|
|
3106
2753
|
] })
|
|
3107
|
-
),
|
|
2754
|
+
), T = {
|
|
3108
2755
|
groupHeader: {
|
|
3109
2756
|
marginBottom: 12
|
|
3110
2757
|
},
|
|
@@ -3172,8 +2819,8 @@ const Jn = $(
|
|
|
3172
2819
|
color: "var(--vscode-errorForeground)",
|
|
3173
2820
|
fontWeight: 500
|
|
3174
2821
|
}
|
|
3175
|
-
},
|
|
3176
|
-
function
|
|
2822
|
+
}, q = 8;
|
|
2823
|
+
function ct(r, e) {
|
|
3177
2824
|
return `
|
|
3178
2825
|
linear-gradient(45deg, ${e} 25%, transparent 25%),
|
|
3179
2826
|
linear-gradient(-45deg, ${e} 25%, transparent 25%),
|
|
@@ -3181,84 +2828,84 @@ function gt(s, e) {
|
|
|
3181
2828
|
linear-gradient(-45deg, transparent 75%, ${e} 75%)
|
|
3182
2829
|
`;
|
|
3183
2830
|
}
|
|
3184
|
-
const
|
|
2831
|
+
const Ur = {
|
|
3185
2832
|
backgroundColor: "#ffffff",
|
|
3186
|
-
backgroundImage:
|
|
3187
|
-
},
|
|
2833
|
+
backgroundImage: ct("#ffffff", "#e5e5e5")
|
|
2834
|
+
}, Pr = {
|
|
3188
2835
|
backgroundColor: "#1e1e1e",
|
|
3189
|
-
backgroundImage:
|
|
3190
|
-
},
|
|
2836
|
+
backgroundImage: ct("#1e1e1e", "#2d2d2d")
|
|
2837
|
+
}, Wr = {
|
|
3191
2838
|
display: "inline-block",
|
|
3192
2839
|
padding: "12px",
|
|
3193
2840
|
borderRadius: "4px",
|
|
3194
|
-
backgroundSize: `${
|
|
3195
|
-
backgroundPosition: `0 0, 0 ${
|
|
2841
|
+
backgroundSize: `${q * 2}px ${q * 2}px`,
|
|
2842
|
+
backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
|
|
3196
2843
|
boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
|
|
3197
2844
|
};
|
|
3198
|
-
function
|
|
3199
|
-
const e =
|
|
2845
|
+
function Gr(r) {
|
|
2846
|
+
const e = r === "dark" ? Pr : Ur;
|
|
3200
2847
|
return {
|
|
3201
|
-
...
|
|
2848
|
+
...Wr,
|
|
3202
2849
|
backgroundColor: e.backgroundColor,
|
|
3203
2850
|
backgroundImage: e.backgroundImage
|
|
3204
2851
|
};
|
|
3205
2852
|
}
|
|
3206
|
-
function
|
|
3207
|
-
return /* @__PURE__ */ a("div", { style:
|
|
2853
|
+
function ze({ src: r, alt: e, background: t }) {
|
|
2854
|
+
return /* @__PURE__ */ a("div", { style: Gr(t), children: /* @__PURE__ */ a("img", { src: r, alt: e, style: S.image }) });
|
|
3208
2855
|
}
|
|
3209
|
-
const
|
|
2856
|
+
const qr = V(
|
|
3210
2857
|
{
|
|
3211
2858
|
item: u.const(),
|
|
3212
2859
|
reportModel: u.const()
|
|
3213
2860
|
},
|
|
3214
|
-
(
|
|
3215
|
-
const { item: t, reportModel: n } = e, { entry:
|
|
3216
|
-
return /* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */ a("span", { style:
|
|
3219
|
-
|
|
2861
|
+
(r, e) => {
|
|
2862
|
+
const { item: t, reportModel: n } = e, { entry: s } = t, o = s.background ?? "light", i = s.status === "unchanged" ? /* @__PURE__ */ a("span", { style: S.badgeMatch, children: "✓ match" }) : s.status === "changed" ? /* @__PURE__ */ a("span", { style: S.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: S.badgeAdded, children: "+ added" }), d = s.baselineScreenshot || s.currentScreenshot;
|
|
2863
|
+
return /* @__PURE__ */ p("div", { style: S.fixtureRow, children: [
|
|
2864
|
+
/* @__PURE__ */ p("div", { style: S.fixtureLabel, children: [
|
|
2865
|
+
/* @__PURE__ */ a("span", { style: S.fixtureName, children: t.fixtureId }),
|
|
2866
|
+
i
|
|
3220
2867
|
] }),
|
|
3221
|
-
d && /* @__PURE__ */
|
|
3222
|
-
|
|
3223
|
-
/* @__PURE__ */ a("span", { style:
|
|
2868
|
+
d && /* @__PURE__ */ p("div", { style: S.sideBySide, children: [
|
|
2869
|
+
s.baselineScreenshot && /* @__PURE__ */ p("div", { style: S.screenshotColumn, children: [
|
|
2870
|
+
/* @__PURE__ */ a("span", { style: S.columnLabel, children: "Baseline" }),
|
|
3224
2871
|
/* @__PURE__ */ a(
|
|
3225
|
-
|
|
2872
|
+
ze,
|
|
3226
2873
|
{
|
|
3227
|
-
src: n.resolveScreenshotUrl(
|
|
2874
|
+
src: n.resolveScreenshotUrl(s.baselineScreenshot),
|
|
3228
2875
|
alt: `Baseline screenshot of ${t.fixtureId}`,
|
|
3229
|
-
background:
|
|
2876
|
+
background: o
|
|
3230
2877
|
}
|
|
3231
2878
|
)
|
|
3232
2879
|
] }),
|
|
3233
|
-
|
|
3234
|
-
/* @__PURE__ */ a("span", { style:
|
|
2880
|
+
s.currentScreenshot && /* @__PURE__ */ p("div", { style: S.screenshotColumn, children: [
|
|
2881
|
+
/* @__PURE__ */ a("span", { style: S.columnLabel, children: "Current" }),
|
|
3235
2882
|
/* @__PURE__ */ a(
|
|
3236
|
-
|
|
2883
|
+
ze,
|
|
3237
2884
|
{
|
|
3238
|
-
src: n.resolveScreenshotUrl(
|
|
2885
|
+
src: n.resolveScreenshotUrl(s.currentScreenshot),
|
|
3239
2886
|
alt: `Current screenshot of ${t.fixtureId}`,
|
|
3240
|
-
background:
|
|
2887
|
+
background: o
|
|
3241
2888
|
}
|
|
3242
2889
|
)
|
|
3243
2890
|
] })
|
|
3244
2891
|
] }),
|
|
3245
|
-
!d &&
|
|
2892
|
+
!d && s.status === "unchanged" && /* @__PURE__ */ a("div", { style: S.hashRow, children: /* @__PURE__ */ p("span", { style: S.hashText, children: [
|
|
3246
2893
|
"hash: ",
|
|
3247
|
-
|
|
2894
|
+
s.targetHash
|
|
3248
2895
|
] }) })
|
|
3249
2896
|
] });
|
|
3250
2897
|
}
|
|
3251
|
-
),
|
|
2898
|
+
), Kr = V(
|
|
3252
2899
|
{
|
|
3253
2900
|
name: u.const(),
|
|
3254
2901
|
path: u.const(),
|
|
3255
2902
|
items: u.const(),
|
|
3256
2903
|
reportModel: u.const()
|
|
3257
2904
|
},
|
|
3258
|
-
(
|
|
3259
|
-
/* @__PURE__ */ a("div", { style:
|
|
3260
|
-
/* @__PURE__ */ a("div", { style:
|
|
3261
|
-
|
|
2905
|
+
(r, e) => /* @__PURE__ */ p("div", { children: [
|
|
2906
|
+
/* @__PURE__ */ a("div", { style: S.groupHeader, children: /* @__PURE__ */ a("span", { style: S.groupTitle, children: e.path }) }),
|
|
2907
|
+
/* @__PURE__ */ a("div", { style: S.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
|
|
2908
|
+
qr,
|
|
3262
2909
|
{
|
|
3263
2910
|
item: t,
|
|
3264
2911
|
reportModel: e.reportModel
|
|
@@ -3266,7 +2913,7 @@ const ts = k(
|
|
|
3266
2913
|
t.fixtureId
|
|
3267
2914
|
)) })
|
|
3268
2915
|
] })
|
|
3269
|
-
),
|
|
2916
|
+
), S = {
|
|
3270
2917
|
groupHeader: {
|
|
3271
2918
|
marginBottom: 12
|
|
3272
2919
|
},
|
|
@@ -3338,148 +2985,148 @@ const ts = k(
|
|
|
3338
2985
|
color: "var(--vscode-testing-iconQueued)",
|
|
3339
2986
|
fontWeight: 500
|
|
3340
2987
|
}
|
|
3341
|
-
},
|
|
3342
|
-
let
|
|
3343
|
-
function
|
|
3344
|
-
if (
|
|
2988
|
+
}, lt = "component-explorer:fixtureHeights", $e = 500;
|
|
2989
|
+
let M = null;
|
|
2990
|
+
function ht() {
|
|
2991
|
+
if (M !== null) return M;
|
|
3345
2992
|
try {
|
|
3346
|
-
const
|
|
3347
|
-
if (
|
|
3348
|
-
return
|
|
2993
|
+
const r = localStorage.getItem(lt);
|
|
2994
|
+
if (r)
|
|
2995
|
+
return M = JSON.parse(r), M;
|
|
3349
2996
|
} catch {
|
|
3350
2997
|
}
|
|
3351
|
-
return
|
|
2998
|
+
return M = {}, M;
|
|
3352
2999
|
}
|
|
3353
|
-
function
|
|
3354
|
-
if (
|
|
3000
|
+
function Jr() {
|
|
3001
|
+
if (M !== null)
|
|
3355
3002
|
try {
|
|
3356
|
-
const
|
|
3357
|
-
|
|
3003
|
+
const r = Object.entries(M);
|
|
3004
|
+
r.length > $e && (M = Object.fromEntries(r.slice(-$e))), localStorage.setItem(lt, JSON.stringify(M));
|
|
3358
3005
|
} catch {
|
|
3359
3006
|
}
|
|
3360
3007
|
}
|
|
3361
|
-
function
|
|
3362
|
-
const t =
|
|
3363
|
-
t[
|
|
3008
|
+
function Zr(r, e) {
|
|
3009
|
+
const t = ht();
|
|
3010
|
+
t[r] = e, Jr();
|
|
3364
3011
|
}
|
|
3365
|
-
function
|
|
3366
|
-
return new Map(Object.entries(
|
|
3012
|
+
function Xr() {
|
|
3013
|
+
return new Map(Object.entries(ht()));
|
|
3367
3014
|
}
|
|
3368
|
-
const
|
|
3369
|
-
function
|
|
3015
|
+
const Yr = 280, Qr = 32, ne = 32, Le = 400, ut = "component-explorer:scrollAnchors", He = 100;
|
|
3016
|
+
function pt() {
|
|
3370
3017
|
try {
|
|
3371
|
-
const
|
|
3372
|
-
if (
|
|
3018
|
+
const r = localStorage.getItem(ut);
|
|
3019
|
+
if (r) return JSON.parse(r);
|
|
3373
3020
|
} catch {
|
|
3374
3021
|
}
|
|
3375
3022
|
return {};
|
|
3376
3023
|
}
|
|
3377
|
-
function
|
|
3024
|
+
function en(r, e) {
|
|
3378
3025
|
try {
|
|
3379
|
-
const t =
|
|
3380
|
-
t[
|
|
3381
|
-
const n = Object.entries(t),
|
|
3382
|
-
localStorage.setItem(
|
|
3026
|
+
const t = pt();
|
|
3027
|
+
t[r] = e;
|
|
3028
|
+
const n = Object.entries(t), s = n.length > He ? Object.fromEntries(n.slice(-He)) : t;
|
|
3029
|
+
localStorage.setItem(ut, JSON.stringify(s));
|
|
3383
3030
|
} catch {
|
|
3384
3031
|
}
|
|
3385
3032
|
}
|
|
3386
|
-
function
|
|
3387
|
-
return
|
|
3033
|
+
function tn(r) {
|
|
3034
|
+
return pt()[r];
|
|
3388
3035
|
}
|
|
3389
|
-
function
|
|
3390
|
-
return
|
|
3036
|
+
function ft(r) {
|
|
3037
|
+
return r.type === "single" ? r.fixture.id : r.id;
|
|
3391
3038
|
}
|
|
3392
|
-
function
|
|
3393
|
-
const t = new Array(
|
|
3394
|
-
let n =
|
|
3395
|
-
for (let
|
|
3396
|
-
const
|
|
3397
|
-
t[
|
|
3039
|
+
function rn(r, e) {
|
|
3040
|
+
const t = new Array(r.length);
|
|
3041
|
+
let n = ne;
|
|
3042
|
+
for (let s = 0; s < r.length; s++) {
|
|
3043
|
+
const o = e.get(ft(r[s])) ?? Yr;
|
|
3044
|
+
t[s] = { top: n, height: o }, n += o + Qr;
|
|
3398
3045
|
}
|
|
3399
3046
|
return t;
|
|
3400
3047
|
}
|
|
3401
|
-
function
|
|
3402
|
-
if (
|
|
3403
|
-
const e =
|
|
3404
|
-
return e.top + e.height +
|
|
3048
|
+
function nn(r) {
|
|
3049
|
+
if (r.length === 0) return 0;
|
|
3050
|
+
const e = r[r.length - 1];
|
|
3051
|
+
return e.top + e.height + ne;
|
|
3405
3052
|
}
|
|
3406
|
-
function
|
|
3407
|
-
let t = 0, n =
|
|
3053
|
+
function gt(r, e) {
|
|
3054
|
+
let t = 0, n = r.length;
|
|
3408
3055
|
for (; t < n; ) {
|
|
3409
|
-
const
|
|
3410
|
-
s
|
|
3056
|
+
const s = t + n >> 1;
|
|
3057
|
+
r[s].top + r[s].height < e ? t = s + 1 : n = s;
|
|
3411
3058
|
}
|
|
3412
3059
|
return t;
|
|
3413
3060
|
}
|
|
3414
|
-
function
|
|
3415
|
-
if (
|
|
3416
|
-
const n =
|
|
3417
|
-
let
|
|
3418
|
-
const
|
|
3419
|
-
for (;
|
|
3420
|
-
|
|
3421
|
-
return { start: n, end:
|
|
3422
|
-
}
|
|
3423
|
-
function
|
|
3424
|
-
if (
|
|
3425
|
-
const t =
|
|
3061
|
+
function sn(r, e, t) {
|
|
3062
|
+
if (r.length === 0) return { start: 0, end: 0 };
|
|
3063
|
+
const n = gt(r, e - Le);
|
|
3064
|
+
let s = n;
|
|
3065
|
+
const o = e + t + Le;
|
|
3066
|
+
for (; s < r.length && r[s].top < o; )
|
|
3067
|
+
s++;
|
|
3068
|
+
return { start: n, end: s };
|
|
3069
|
+
}
|
|
3070
|
+
function je(r, e) {
|
|
3071
|
+
if (r.length === 0) return;
|
|
3072
|
+
const t = gt(r, e), n = Math.min(t, r.length - 1);
|
|
3426
3073
|
return {
|
|
3427
3074
|
rowIndex: n,
|
|
3428
|
-
offsetFromViewport:
|
|
3075
|
+
offsetFromViewport: r[n].top - e
|
|
3429
3076
|
};
|
|
3430
3077
|
}
|
|
3431
|
-
function
|
|
3432
|
-
return e.rowIndex >=
|
|
3078
|
+
function Ue(r, e) {
|
|
3079
|
+
return e.rowIndex >= r.length ? 0 : r[e.rowIndex].top - e.offsetFromViewport;
|
|
3433
3080
|
}
|
|
3434
|
-
class
|
|
3081
|
+
class on extends B({
|
|
3435
3082
|
model: u.const()
|
|
3436
3083
|
}) {
|
|
3437
3084
|
constructor() {
|
|
3438
3085
|
super(...arguments);
|
|
3439
|
-
l(this, "_rowHeights",
|
|
3440
|
-
l(this, "_scrollTop",
|
|
3441
|
-
l(this, "_viewportHeight",
|
|
3086
|
+
l(this, "_rowHeights", w(this, Xr()));
|
|
3087
|
+
l(this, "_scrollTop", w(this, 0));
|
|
3088
|
+
l(this, "_viewportHeight", w(this, 0));
|
|
3442
3089
|
l(this, "_scrollContainerRef", null);
|
|
3443
3090
|
l(this, "_resizeObserver", null);
|
|
3444
3091
|
l(this, "_viewportResizeObserver", null);
|
|
3445
3092
|
l(this, "_currentNodeId");
|
|
3446
3093
|
l(this, "_scrollSaveTimeout", null);
|
|
3447
3094
|
l(this, "_suppressScrollHandler", !1);
|
|
3448
|
-
l(this, "layout",
|
|
3449
|
-
const n = this.explorerModel.selectedFixtures.read(t),
|
|
3450
|
-
return
|
|
3095
|
+
l(this, "layout", D(this, (t) => {
|
|
3096
|
+
const n = this.explorerModel.selectedFixtures.read(t), s = this._rowHeights.read(t);
|
|
3097
|
+
return rn(n, s);
|
|
3451
3098
|
}));
|
|
3452
|
-
l(this, "visibleRowRange",
|
|
3453
|
-
const n = this.layout.read(t),
|
|
3454
|
-
return
|
|
3099
|
+
l(this, "visibleRowRange", D(this, (t) => {
|
|
3100
|
+
const n = this.layout.read(t), s = this._scrollTop.read(t), o = this._viewportHeight.read(t);
|
|
3101
|
+
return sn(n, s, o);
|
|
3455
3102
|
}));
|
|
3456
3103
|
l(this, "setScrollContainerRef", (t) => {
|
|
3457
3104
|
var n;
|
|
3458
|
-
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(([
|
|
3459
|
-
this._viewportHeight.set(Math.round(
|
|
3105
|
+
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]) => {
|
|
3106
|
+
this._viewportHeight.set(Math.round(s.contentRect.height), void 0);
|
|
3460
3107
|
}), this._viewportResizeObserver.observe(t), this._restoreScrollPosition());
|
|
3461
3108
|
});
|
|
3462
3109
|
l(this, "_handleScroll", () => {
|
|
3463
3110
|
this._scrollContainerRef && (this._scrollTop.set(this._scrollContainerRef.scrollTop, void 0), !(this._suppressScrollHandler || !this._currentNodeId) && (this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
|
|
3464
3111
|
if (!this._currentNodeId) return;
|
|
3465
|
-
const t = this.layout.get(), n =
|
|
3466
|
-
n &&
|
|
3112
|
+
const t = this.layout.get(), n = je(t, this._scrollTop.get());
|
|
3113
|
+
n && en(this._currentNodeId, n);
|
|
3467
3114
|
}, 150)));
|
|
3468
3115
|
});
|
|
3469
3116
|
l(this, "observeRowElement", (t, n) => {
|
|
3470
|
-
t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((
|
|
3471
|
-
const
|
|
3472
|
-
let
|
|
3473
|
-
for (const d of
|
|
3117
|
+
t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((s) => {
|
|
3118
|
+
const o = this._rowHeights.get();
|
|
3119
|
+
let i;
|
|
3120
|
+
for (const d of s) {
|
|
3474
3121
|
const c = d.target.getAttribute("data-row-id");
|
|
3475
3122
|
if (!c) continue;
|
|
3476
3123
|
const h = Math.round(d.contentRect.height);
|
|
3477
|
-
h > 0 &&
|
|
3124
|
+
h > 0 && o.get(c) !== h && (i || (i = new Map(o)), i.set(c, h), Zr(c, h));
|
|
3478
3125
|
}
|
|
3479
|
-
if (
|
|
3480
|
-
const d = this.layout.get(), c =
|
|
3481
|
-
if (this._rowHeights.set(
|
|
3482
|
-
const h = this.layout.get(), m =
|
|
3126
|
+
if (i) {
|
|
3127
|
+
const d = this.layout.get(), c = je(d, this._scrollTop.get());
|
|
3128
|
+
if (this._rowHeights.set(i, void 0), c && this._scrollContainerRef) {
|
|
3129
|
+
const h = this.layout.get(), m = Ue(h, c);
|
|
3483
3130
|
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = m, this._scrollTop.set(m, void 0), requestAnimationFrame(() => {
|
|
3484
3131
|
this._suppressScrollHandler = !1;
|
|
3485
3132
|
});
|
|
@@ -3496,10 +3143,10 @@ class fs extends z({
|
|
|
3496
3143
|
}
|
|
3497
3144
|
_restoreScrollPosition() {
|
|
3498
3145
|
if (!this._scrollContainerRef || !this._currentNodeId) return;
|
|
3499
|
-
const t =
|
|
3146
|
+
const t = tn(this._currentNodeId);
|
|
3500
3147
|
if (!t) return;
|
|
3501
|
-
const n = this.layout.get(),
|
|
3502
|
-
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop =
|
|
3148
|
+
const n = this.layout.get(), s = Ue(n, t);
|
|
3149
|
+
this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = s, this._scrollTop.set(s, void 0), requestAnimationFrame(() => {
|
|
3503
3150
|
this._suppressScrollHandler = !1;
|
|
3504
3151
|
});
|
|
3505
3152
|
}
|
|
@@ -3508,35 +3155,35 @@ class fs extends z({
|
|
|
3508
3155
|
(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);
|
|
3509
3156
|
}
|
|
3510
3157
|
}
|
|
3511
|
-
const
|
|
3512
|
-
|
|
3158
|
+
const an = A(
|
|
3159
|
+
on,
|
|
3513
3160
|
{},
|
|
3514
|
-
(
|
|
3515
|
-
const t = e.explorerModel.selectedFixtures.read(
|
|
3161
|
+
(r, e) => {
|
|
3162
|
+
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);
|
|
3516
3163
|
if (e.updateForSelection(n), t.length === 0) {
|
|
3517
3164
|
const c = e.explorerModel.reportModel;
|
|
3518
3165
|
if (c) {
|
|
3519
|
-
const h = c.state.read(
|
|
3166
|
+
const h = c.state.read(r);
|
|
3520
3167
|
if (h.status === "loading")
|
|
3521
3168
|
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Loading report..." }) });
|
|
3522
3169
|
if (h.status === "error")
|
|
3523
|
-
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ p("span", { style: { ...N.emptyText, color: "var(--vscode-errorForeground)" }, children: [
|
|
3524
3171
|
"Failed to load report: ",
|
|
3525
3172
|
h.message
|
|
3526
3173
|
] }) });
|
|
3527
3174
|
}
|
|
3528
3175
|
return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Select a component or folder to preview" }) });
|
|
3529
3176
|
}
|
|
3530
|
-
const d =
|
|
3531
|
-
return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: N.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(
|
|
3532
|
-
const m =
|
|
3177
|
+
const d = nn(s);
|
|
3178
|
+
return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: N.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(o, i).map((c, h) => {
|
|
3179
|
+
const m = o + h, { top: v } = s[m], R = ft(c);
|
|
3533
3180
|
return /* @__PURE__ */ a(
|
|
3534
3181
|
"div",
|
|
3535
3182
|
{
|
|
3536
|
-
ref: (
|
|
3537
|
-
style: { position: "absolute", top:
|
|
3538
|
-
children: c.type === "single" ? /* @__PURE__ */ a(
|
|
3539
|
-
|
|
3183
|
+
ref: (g) => e.observeRowElement(g, R),
|
|
3184
|
+
style: { position: "absolute", top: v, left: ne, right: ne },
|
|
3185
|
+
children: c.type === "single" ? /* @__PURE__ */ a(at, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(dn, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
|
|
3186
|
+
jr,
|
|
3540
3187
|
{
|
|
3541
3188
|
name: c.name,
|
|
3542
3189
|
path: c.path,
|
|
@@ -3546,7 +3193,7 @@ const ps = $(
|
|
|
3546
3193
|
currentSession: "current"
|
|
3547
3194
|
}
|
|
3548
3195
|
) : c.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
|
|
3549
|
-
|
|
3196
|
+
Kr,
|
|
3550
3197
|
{
|
|
3551
3198
|
name: c.name,
|
|
3552
3199
|
path: c.path,
|
|
@@ -3555,17 +3202,17 @@ const ps = $(
|
|
|
3555
3202
|
}
|
|
3556
3203
|
) : null
|
|
3557
3204
|
},
|
|
3558
|
-
|
|
3205
|
+
R
|
|
3559
3206
|
);
|
|
3560
3207
|
}) }) });
|
|
3561
3208
|
}
|
|
3562
|
-
),
|
|
3209
|
+
), dn = V(
|
|
3563
3210
|
{ row: u.const() },
|
|
3564
|
-
(
|
|
3211
|
+
(r, e) => {
|
|
3565
3212
|
const t = e.row;
|
|
3566
|
-
return /* @__PURE__ */
|
|
3213
|
+
return /* @__PURE__ */ p("div", { children: [
|
|
3567
3214
|
/* @__PURE__ */ a("div", { style: N.variantsHeader, children: /* @__PURE__ */ a("span", { style: N.variantsTitle, children: t.path }) }),
|
|
3568
|
-
/* @__PURE__ */ a("div", { style: N.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(
|
|
3215
|
+
/* @__PURE__ */ a("div", { style: N.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(at, { fixture: n, compact: !0 }, n.id)) })
|
|
3569
3216
|
] });
|
|
3570
3217
|
}
|
|
3571
3218
|
), N = {
|
|
@@ -3599,55 +3246,58 @@ const ps = $(
|
|
|
3599
3246
|
flexWrap: "wrap",
|
|
3600
3247
|
gap: "16px"
|
|
3601
3248
|
}
|
|
3602
|
-
},
|
|
3603
|
-
|
|
3249
|
+
}, cn = A(
|
|
3250
|
+
gr,
|
|
3604
3251
|
{ daemonModel: u.const(), reportModel: u.const() },
|
|
3605
|
-
(
|
|
3606
|
-
const t = e.leftSidebarVisible.read(
|
|
3607
|
-
return /* @__PURE__ */
|
|
3608
|
-
t && /* @__PURE__ */ a(
|
|
3609
|
-
/* @__PURE__ */
|
|
3610
|
-
/* @__PURE__ */ a(
|
|
3611
|
-
/* @__PURE__ */ a(
|
|
3252
|
+
(r, e) => {
|
|
3253
|
+
const t = e.leftSidebarVisible.read(r), n = e.rightSidebarVisible.read(r), s = e.isDarkTheme.read(r), o = e.selectedNode.read(r);
|
|
3254
|
+
return /* @__PURE__ */ p("div", { className: s ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: f.container, children: [
|
|
3255
|
+
t && /* @__PURE__ */ a(kr, { model: e }),
|
|
3256
|
+
/* @__PURE__ */ p("div", { style: f.centerArea, children: [
|
|
3257
|
+
/* @__PURE__ */ a(Tr, { model: e }),
|
|
3258
|
+
/* @__PURE__ */ a(an, { model: e })
|
|
3612
3259
|
] }),
|
|
3613
|
-
n && /* @__PURE__ */ a(
|
|
3260
|
+
n && /* @__PURE__ */ a(Dr, { selectedNode: o })
|
|
3614
3261
|
] });
|
|
3615
3262
|
}
|
|
3616
3263
|
);
|
|
3617
|
-
var
|
|
3264
|
+
var ln = class fe {
|
|
3618
3265
|
constructor(e) {
|
|
3619
3266
|
this.iterator = e;
|
|
3620
3267
|
}
|
|
3621
3268
|
static fromIterable(e) {
|
|
3622
|
-
return new
|
|
3269
|
+
return new fe(e[Symbol.asyncIterator]());
|
|
3623
3270
|
}
|
|
3624
3271
|
static fromFn(e) {
|
|
3625
|
-
return new
|
|
3272
|
+
return new fe(e());
|
|
3626
3273
|
}
|
|
3627
3274
|
[Symbol.asyncIterator]() {
|
|
3628
3275
|
return this.iterator;
|
|
3629
3276
|
}
|
|
3630
|
-
},
|
|
3631
|
-
constructor(
|
|
3632
|
-
super(t), this.statusCode =
|
|
3277
|
+
}, hn = class extends Error {
|
|
3278
|
+
constructor(r, e, t) {
|
|
3279
|
+
super(t), this.statusCode = r, this.method = e, this.name = "ApiError";
|
|
3633
3280
|
}
|
|
3634
|
-
},
|
|
3635
|
-
constructor(
|
|
3281
|
+
}, un = class {
|
|
3282
|
+
constructor(r) {
|
|
3636
3283
|
l(this, "methods", this._createProxy(""));
|
|
3637
|
-
this._request =
|
|
3284
|
+
this._request = r;
|
|
3638
3285
|
}
|
|
3639
|
-
_createProxy(
|
|
3286
|
+
_createProxy(r) {
|
|
3640
3287
|
return new Proxy(() => {
|
|
3641
3288
|
}, {
|
|
3642
|
-
apply: async (e, t, n) => await this._request(
|
|
3643
|
-
get: (e, t) =>
|
|
3289
|
+
apply: async (e, t, n) => await this._request(r, n[0]),
|
|
3290
|
+
get: (e, t) => {
|
|
3291
|
+
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"))
|
|
3292
|
+
return this._createProxy(`${r}${r ? "/" : ""}${t}`);
|
|
3293
|
+
}
|
|
3644
3294
|
});
|
|
3645
3295
|
}
|
|
3646
3296
|
};
|
|
3647
|
-
function
|
|
3648
|
-
return new
|
|
3297
|
+
function pn(r, e) {
|
|
3298
|
+
return new un(async (t, n) => {
|
|
3649
3299
|
var d;
|
|
3650
|
-
const
|
|
3300
|
+
const s = await fetch(`${r}/${t}`, {
|
|
3651
3301
|
method: "POST",
|
|
3652
3302
|
headers: {
|
|
3653
3303
|
"Content-Type": "application/json",
|
|
@@ -3655,40 +3305,40 @@ function ys(s, e) {
|
|
|
3655
3305
|
},
|
|
3656
3306
|
body: JSON.stringify(n)
|
|
3657
3307
|
});
|
|
3658
|
-
if (
|
|
3659
|
-
const c = await
|
|
3308
|
+
if (s.status !== 200) {
|
|
3309
|
+
const c = await s.json().catch(() => null);
|
|
3660
3310
|
let h;
|
|
3661
|
-
throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${
|
|
3311
|
+
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);
|
|
3662
3312
|
}
|
|
3663
|
-
const
|
|
3664
|
-
return
|
|
3665
|
-
var
|
|
3666
|
-
const c = (
|
|
3313
|
+
const o = s.headers.get("Content-Type");
|
|
3314
|
+
return o != null && o.startsWith("application/jsonl") ? ln.fromFn(async function* () {
|
|
3315
|
+
var R;
|
|
3316
|
+
const c = (R = s.body) == null ? void 0 : R.getReader();
|
|
3667
3317
|
if (!c)
|
|
3668
3318
|
return;
|
|
3669
3319
|
let h = "";
|
|
3670
3320
|
const m = new TextDecoder("utf-8");
|
|
3671
3321
|
for (; ; ) {
|
|
3672
|
-
const { done:
|
|
3673
|
-
if (
|
|
3322
|
+
const { done: g, value: _ } = await c.read();
|
|
3323
|
+
if (g)
|
|
3674
3324
|
break;
|
|
3675
|
-
h += m.decode(
|
|
3676
|
-
let
|
|
3677
|
-
for (; (
|
|
3325
|
+
h += m.decode(_, { stream: !0 });
|
|
3326
|
+
let b;
|
|
3327
|
+
for (; (b = h.indexOf(`
|
|
3678
3328
|
`)) >= 0; ) {
|
|
3679
|
-
const
|
|
3680
|
-
h = h.slice(
|
|
3329
|
+
const y = h.slice(0, b).trim();
|
|
3330
|
+
h = h.slice(b + 1), y.length > 0 && (yield JSON.parse(y));
|
|
3681
3331
|
}
|
|
3682
3332
|
}
|
|
3683
|
-
const
|
|
3684
|
-
|
|
3685
|
-
}) : await
|
|
3333
|
+
const v = h.trim();
|
|
3334
|
+
v.length > 0 && (yield JSON.parse(v));
|
|
3335
|
+
}) : await s.json();
|
|
3686
3336
|
});
|
|
3687
3337
|
}
|
|
3688
|
-
class
|
|
3338
|
+
class fn {
|
|
3689
3339
|
constructor(e) {
|
|
3690
|
-
l(this, "_sourceTreeIds",
|
|
3691
|
-
l(this, "_sessions",
|
|
3340
|
+
l(this, "_sourceTreeIds", w(this, /* @__PURE__ */ new Map()));
|
|
3341
|
+
l(this, "_sessions", w(this, []));
|
|
3692
3342
|
l(this, "_screenshotCache", /* @__PURE__ */ new Map());
|
|
3693
3343
|
l(this, "_client");
|
|
3694
3344
|
l(this, "_eventStreamAbort", null);
|
|
@@ -3697,7 +3347,7 @@ class xs {
|
|
|
3697
3347
|
l(this, "sourceTreeIds", this._sourceTreeIds);
|
|
3698
3348
|
/** Observable list of sessions from the daemon */
|
|
3699
3349
|
l(this, "sessions", this._sessions);
|
|
3700
|
-
this.config = e, this.sessionName = e.sessionName, this._client =
|
|
3350
|
+
this.config = e, this.sessionName = e.sessionName, this._client = pn("/__explorer/daemon-api");
|
|
3701
3351
|
}
|
|
3702
3352
|
/**
|
|
3703
3353
|
* Initializes the model: fetches initial session info and starts listening to events.
|
|
@@ -3714,30 +3364,30 @@ class xs {
|
|
|
3714
3364
|
const n = this._sourceTreeIds.get().get(e);
|
|
3715
3365
|
if (!n)
|
|
3716
3366
|
throw new Error(`No sourceTreeId known for session '${e}'`);
|
|
3717
|
-
const
|
|
3718
|
-
if (
|
|
3719
|
-
return
|
|
3720
|
-
const
|
|
3367
|
+
const s = `${e}:${t}`, o = this._screenshotCache.get(s);
|
|
3368
|
+
if (o && o.sourceTreeId === n)
|
|
3369
|
+
return o.data;
|
|
3370
|
+
const i = await this._client.methods.screenshots.take({
|
|
3721
3371
|
fixtureId: t,
|
|
3722
3372
|
sessionName: e,
|
|
3723
3373
|
sourceTreeId: n,
|
|
3724
3374
|
includeImage: !0
|
|
3725
3375
|
});
|
|
3726
|
-
return this._screenshotCache.set(
|
|
3376
|
+
return this._screenshotCache.set(s, { sourceTreeId: n, data: i }), i;
|
|
3727
3377
|
}
|
|
3728
3378
|
/**
|
|
3729
3379
|
* Compare a fixture across two sessions. Returns match status and hashes (no images).
|
|
3730
3380
|
*/
|
|
3731
3381
|
async compare(e, t, n) {
|
|
3732
|
-
const
|
|
3733
|
-
if (!
|
|
3382
|
+
const s = this._sourceTreeIds.get().get(t), o = this._sourceTreeIds.get().get(n);
|
|
3383
|
+
if (!s || !o)
|
|
3734
3384
|
throw new Error("Missing sourceTreeId for sessions");
|
|
3735
3385
|
return this._client.methods.screenshots.compare({
|
|
3736
3386
|
fixtureId: e,
|
|
3737
3387
|
baselineSessionName: t,
|
|
3738
|
-
baselineSourceTreeId:
|
|
3388
|
+
baselineSourceTreeId: s,
|
|
3739
3389
|
currentSessionName: n,
|
|
3740
|
-
currentSourceTreeId:
|
|
3390
|
+
currentSourceTreeId: o,
|
|
3741
3391
|
includeImages: !1
|
|
3742
3392
|
});
|
|
3743
3393
|
}
|
|
@@ -3767,8 +3417,8 @@ class xs {
|
|
|
3767
3417
|
// ---------------------------------------------------------------------------
|
|
3768
3418
|
async _fetchSessionInfos() {
|
|
3769
3419
|
const e = await this._client.methods.sessions(), t = /* @__PURE__ */ new Map(), n = [];
|
|
3770
|
-
for (const
|
|
3771
|
-
t.set(
|
|
3420
|
+
for (const s of e)
|
|
3421
|
+
t.set(s.name, s.sourceTreeId), n.push({ name: s.name, serverUrl: s.serverUrl });
|
|
3772
3422
|
this._sourceTreeIds.set(t, void 0), this._sessions.set(n, void 0);
|
|
3773
3423
|
}
|
|
3774
3424
|
async _startEventStream() {
|
|
@@ -3795,12 +3445,12 @@ class xs {
|
|
|
3795
3445
|
}
|
|
3796
3446
|
}
|
|
3797
3447
|
}
|
|
3798
|
-
function
|
|
3448
|
+
function gn() {
|
|
3799
3449
|
return window.__EXPLORER_DAEMON__;
|
|
3800
3450
|
}
|
|
3801
|
-
class
|
|
3451
|
+
class mn {
|
|
3802
3452
|
constructor(e) {
|
|
3803
|
-
l(this, "state",
|
|
3453
|
+
l(this, "state", w(this, { status: "loading" }));
|
|
3804
3454
|
l(this, "_baseUrl");
|
|
3805
3455
|
this.reportUrl = e;
|
|
3806
3456
|
const t = e.lastIndexOf("/");
|
|
@@ -3811,7 +3461,7 @@ class Ss {
|
|
|
3811
3461
|
}
|
|
3812
3462
|
buildTree(e) {
|
|
3813
3463
|
const t = this.state.read(e);
|
|
3814
|
-
return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } :
|
|
3464
|
+
return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : vn(t.report.fixtures);
|
|
3815
3465
|
}
|
|
3816
3466
|
async _fetch() {
|
|
3817
3467
|
this.state.set({ status: "loading" }, void 0);
|
|
@@ -3826,35 +3476,35 @@ class Ss {
|
|
|
3826
3476
|
}
|
|
3827
3477
|
}
|
|
3828
3478
|
}
|
|
3829
|
-
function
|
|
3479
|
+
function vn(r) {
|
|
3830
3480
|
const e = { id: "", name: "Components", type: "folder", children: [] };
|
|
3831
|
-
for (const [t, n] of Object.entries(
|
|
3832
|
-
const
|
|
3833
|
-
let
|
|
3834
|
-
for (let
|
|
3835
|
-
const d =
|
|
3481
|
+
for (const [t, n] of Object.entries(r)) {
|
|
3482
|
+
const s = t.split("/");
|
|
3483
|
+
let o = e;
|
|
3484
|
+
for (let i = 0; i < s.length; i++) {
|
|
3485
|
+
const d = s[i], c = i === s.length - 1, h = s.slice(0, i + 1).join("/");
|
|
3836
3486
|
if (c)
|
|
3837
|
-
|
|
3487
|
+
o.children.push({
|
|
3838
3488
|
id: h,
|
|
3839
3489
|
name: d,
|
|
3840
3490
|
type: "component",
|
|
3841
3491
|
reportEntry: n
|
|
3842
3492
|
});
|
|
3843
3493
|
else {
|
|
3844
|
-
let m =
|
|
3845
|
-
m || (m = { id: h, name: d, type: "folder", children: [] },
|
|
3494
|
+
let m = o.children.find((v) => v.type === "folder" && v.name === d);
|
|
3495
|
+
m || (m = { id: h, name: d, type: "folder", children: [] }, o.children.push(m)), o = m;
|
|
3846
3496
|
}
|
|
3847
3497
|
}
|
|
3848
3498
|
}
|
|
3849
3499
|
return e;
|
|
3850
3500
|
}
|
|
3851
|
-
class
|
|
3501
|
+
class Vn {
|
|
3852
3502
|
constructor(e, t) {
|
|
3853
3503
|
l(this, "_root");
|
|
3854
|
-
l(this, "_registry", new
|
|
3504
|
+
l(this, "_registry", new sr());
|
|
3855
3505
|
l(this, "_daemonModel");
|
|
3856
3506
|
l(this, "_reportModel");
|
|
3857
|
-
this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root =
|
|
3507
|
+
this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = _t(e), this._root.render(Ct(cn, {
|
|
3858
3508
|
registry: this._registry,
|
|
3859
3509
|
daemonModel: this._daemonModel,
|
|
3860
3510
|
reportModel: this._reportModel
|
|
@@ -3863,13 +3513,13 @@ class Bs {
|
|
|
3863
3513
|
_initializeReportModel() {
|
|
3864
3514
|
const t = new URLSearchParams(location.search).get("report");
|
|
3865
3515
|
if (t)
|
|
3866
|
-
return new
|
|
3516
|
+
return new mn(t);
|
|
3867
3517
|
}
|
|
3868
3518
|
_initializeDaemonModel() {
|
|
3869
|
-
const e =
|
|
3519
|
+
const e = gn();
|
|
3870
3520
|
if (!e)
|
|
3871
3521
|
return;
|
|
3872
|
-
const t = new
|
|
3522
|
+
const t = new fn(e);
|
|
3873
3523
|
return t.initialize().catch((n) => {
|
|
3874
3524
|
console.error("[ExplorerApp] Failed to initialize DaemonModel:", n);
|
|
3875
3525
|
}), t;
|
|
@@ -3877,8 +3527,8 @@ class Bs {
|
|
|
3877
3527
|
_populateRegistry(e) {
|
|
3878
3528
|
this._registry.clear();
|
|
3879
3529
|
for (const [t, n] of Object.entries(e)) {
|
|
3880
|
-
const
|
|
3881
|
-
|
|
3530
|
+
const s = n.default;
|
|
3531
|
+
s && typeof s == "object" && this._registry.register(t, s);
|
|
3882
3532
|
}
|
|
3883
3533
|
}
|
|
3884
3534
|
/**
|
|
@@ -3902,50 +3552,52 @@ class Bs {
|
|
|
3902
3552
|
}
|
|
3903
3553
|
}
|
|
3904
3554
|
export {
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
ke as
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3555
|
+
_r as ChevronDownIcon,
|
|
3556
|
+
vr as ChevronRightIcon,
|
|
3557
|
+
kn as CliRuntime,
|
|
3558
|
+
br as ComponentIcon,
|
|
3559
|
+
fn as DaemonModel,
|
|
3560
|
+
cn as Explorer,
|
|
3561
|
+
Vn as ExplorerApp,
|
|
3562
|
+
gr as ExplorerModel,
|
|
3563
|
+
sr as FixtureRegistry,
|
|
3564
|
+
yr as FolderIcon,
|
|
3565
|
+
kr as LeftSidebar,
|
|
3566
|
+
wr as MoonIcon,
|
|
3567
|
+
xr as PanelLeftIcon,
|
|
3568
|
+
Cr as PanelRightIcon,
|
|
3569
|
+
mn as ReportModel,
|
|
3570
|
+
Dr as RightSidebar,
|
|
3571
|
+
Sr as SunIcon,
|
|
3572
|
+
Tr as TitleBar,
|
|
3573
|
+
oe as TitleBarButton,
|
|
3574
|
+
Or as TreeItem,
|
|
3575
|
+
it as TreeView,
|
|
3576
|
+
St as VIEWPORT_SIZES,
|
|
3577
|
+
Dn as asyncRender,
|
|
3578
|
+
It as collectComponents,
|
|
3579
|
+
Oe as createComponentDefinition,
|
|
3580
|
+
ie as createFixtureTree,
|
|
3581
|
+
Fn as defineFixture,
|
|
3582
|
+
En as defineFixtureGroup,
|
|
3583
|
+
Bn as defineFixtureVariants,
|
|
3584
|
+
ke as findNodeByPath,
|
|
3585
|
+
we as fixtureGroupBrand,
|
|
3586
|
+
Re as fixtureVariantsBrand,
|
|
3587
|
+
Rt as getDefaultPropertyValues,
|
|
3588
|
+
On as isComponentDefinition,
|
|
3589
|
+
ve as isFixtureGroup,
|
|
3590
|
+
_e as isFixtureVariants,
|
|
3591
|
+
me as isSingleFixture,
|
|
3592
|
+
Se as mergeStyles,
|
|
3593
|
+
wn as parseFixtureExport,
|
|
3594
|
+
Tn as parseFixtureGroup,
|
|
3595
|
+
In as parseFixtureVariants,
|
|
3596
|
+
Rn as parseSingleFixture,
|
|
3597
|
+
wt as resolveViewport,
|
|
3598
|
+
Te as singleFixtureBrand,
|
|
3599
|
+
f as styles,
|
|
3600
|
+
An as syncRender,
|
|
3601
|
+
ot as toExplorerTree
|
|
3950
3602
|
};
|
|
3951
3603
|
//# sourceMappingURL=viewer.js.map
|