@pygmalionjs/pygmalion 0.2.40 → 0.2.42
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/README.md +32 -0
- package/dist-lib/{App-CiVUoaTo.js → App-B8XMaaQT.js} +6048 -5935
- package/dist-lib/pygmalion.js +1070 -1043
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +1 -1
- package/node/source-operations.mjs +17 -1
- package/node/storyboard-environment.mjs +29 -2
- package/package.json +1 -1
- package/types.d.ts +43 -15
package/dist-lib/pygmalion.js
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { b as
|
|
3
|
-
import { X as
|
|
4
|
-
import { createElement as
|
|
5
|
-
function
|
|
1
|
+
import { jsxs as A, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { b as se, m as tt, i as lt, g as dt, e as X, S as ut, c as ft, a as mt, d as pt, f as ht, h as gt, j as yt, k as wt, l as St, n as ve, o as bt, p as vt, q as It, r as xt, t as Pt, u as Et, v as Ct, w as je, x as Rt, y as Nt, z as $t, A as _e, B as Be, C as oe, D as At, E as Mt, G as Ue, H as Ot, I as ye, J as we, K as Dt, L as He, M as kt, O as qe, P as Ft, Q as Tt, R as zt, T as jt, U as _t, V as Bt, W as Ke } from "./App-B8XMaaQT.js";
|
|
3
|
+
import { X as qn, Y as Kn, Z as Gn, _ as Ln, $ as Wn, a0 as Vn, a1 as Jn, a2 as Qn, a3 as Xn, a4 as Yn, a5 as Zn, a6 as er, a7 as tr, a8 as nr, a9 as rr, aa as or, ab as sr, ac as ir, ad as ar, ae as cr, af as lr, ag as dr, ah as ur, ai as fr, aj as mr, ak as pr, al as hr, am as gr, an as yr, ao as wr, ap as Sr, aq as br, ar as vr, as as Ir, at as xr, au as Pr, av as Er, aw as Cr, ax as Rr, ay as Nr, az as $r, aA as Ar, aB as Mr } from "./App-B8XMaaQT.js";
|
|
4
|
+
import { createElement as Ge, useMemo as ie, useState as fe, useRef as xe, useCallback as de, useEffect as me, useLayoutEffect as Le } from "react";
|
|
5
|
+
function Ut(e) {
|
|
6
|
+
return e.flatMap((t, o) => {
|
|
7
|
+
const r = t.id.trim() || `path:${o + 1}`, n = t.screenIds.map((s) => s.trim()).filter(Boolean);
|
|
8
|
+
return n.slice(1).map((s, l) => {
|
|
9
|
+
var a, u;
|
|
10
|
+
return {
|
|
11
|
+
id: `${r}:${l + 1}`,
|
|
12
|
+
from: n[l],
|
|
13
|
+
to: s,
|
|
14
|
+
kind: ((a = t.kind) == null ? void 0 : a.trim()) || "authored-path",
|
|
15
|
+
label: ((u = t.label) == null ? void 0 : u.trim()) || void 0
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function De(e, t = /* @__PURE__ */ new Set()) {
|
|
6
21
|
if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
|
|
7
22
|
return e;
|
|
8
23
|
if (Array.isArray(e))
|
|
9
|
-
return e.map((r) =>
|
|
24
|
+
return e.map((r) => De(r, t));
|
|
10
25
|
if (typeof e != "object") return null;
|
|
11
26
|
if (t.has(e))
|
|
12
27
|
throw new Error("A storyboard recipe cannot contain circular references.");
|
|
@@ -14,13 +29,13 @@ function Ae(e, t = /* @__PURE__ */ new Set()) {
|
|
|
14
29
|
const o = {};
|
|
15
30
|
for (const r of Object.keys(e).sort()) {
|
|
16
31
|
const n = e[r];
|
|
17
|
-
n !== void 0 && (o[r] =
|
|
32
|
+
n !== void 0 && (o[r] = De(n, t));
|
|
18
33
|
}
|
|
19
34
|
return t.delete(e), o;
|
|
20
35
|
}
|
|
21
|
-
function
|
|
36
|
+
function Ht(e) {
|
|
22
37
|
return JSON.stringify(
|
|
23
|
-
|
|
38
|
+
De({
|
|
24
39
|
version: 1,
|
|
25
40
|
route: e.route ?? null,
|
|
26
41
|
componentName: e.componentName ?? null,
|
|
@@ -42,11 +57,11 @@ function jt(e) {
|
|
|
42
57
|
function B(e) {
|
|
43
58
|
return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, o) => t.localeCompare(o));
|
|
44
59
|
}
|
|
45
|
-
function
|
|
60
|
+
function qt(e, t) {
|
|
46
61
|
var r;
|
|
47
62
|
return ((r = e.id) == null ? void 0 : r.trim()) || `edge:${t + 1}`;
|
|
48
63
|
}
|
|
49
|
-
function
|
|
64
|
+
function Kt(e) {
|
|
50
65
|
const t = [...e.screens].sort((r, n) => r.id.localeCompare(n.id)), o = t[0].id;
|
|
51
66
|
return {
|
|
52
67
|
id: `story:${o}`,
|
|
@@ -66,7 +81,7 @@ function Bt(e) {
|
|
|
66
81
|
states: B(t.map((r) => r.state))
|
|
67
82
|
};
|
|
68
83
|
}
|
|
69
|
-
function
|
|
84
|
+
function We(e) {
|
|
70
85
|
return [
|
|
71
86
|
e.code,
|
|
72
87
|
e.edgeId,
|
|
@@ -75,286 +90,286 @@ function Ke(e) {
|
|
|
75
90
|
e.scenarioId
|
|
76
91
|
].join(":");
|
|
77
92
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
93
|
+
function Gt(e) {
|
|
94
|
+
var Z, W;
|
|
80
95
|
const t = [], o = [], r = /* @__PURE__ */ new Map();
|
|
81
|
-
for (const
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
96
|
+
for (const c of e.screens) {
|
|
97
|
+
const i = c.id.trim();
|
|
98
|
+
if (!i || r.has(i)) {
|
|
84
99
|
t.push({
|
|
85
100
|
code: "duplicate-screen-id",
|
|
86
101
|
severity: "error",
|
|
87
|
-
message:
|
|
88
|
-
screenId:
|
|
102
|
+
message: i ? `Multiple storyboard screens use the id "${i}".` : "A storyboard screen has an empty id.",
|
|
103
|
+
screenId: i || void 0
|
|
89
104
|
});
|
|
90
105
|
continue;
|
|
91
106
|
}
|
|
92
|
-
const
|
|
93
|
-
r.set(
|
|
107
|
+
const d = i === c.id ? c : { ...c, id: i };
|
|
108
|
+
r.set(i, d), o.push(d);
|
|
94
109
|
}
|
|
95
110
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
96
|
-
for (const
|
|
97
|
-
let
|
|
111
|
+
for (const c of o) {
|
|
112
|
+
let i;
|
|
98
113
|
try {
|
|
99
|
-
if (
|
|
100
|
-
} catch (
|
|
101
|
-
s.add(
|
|
114
|
+
if (i = (e.recipeKey ?? Ht)(c), !i.trim()) throw new Error("Recipe keys cannot be empty.");
|
|
115
|
+
} catch (y) {
|
|
116
|
+
s.add(c.id), t.push({
|
|
102
117
|
code: "invalid-recipe",
|
|
103
118
|
severity: "error",
|
|
104
|
-
message:
|
|
105
|
-
screenId:
|
|
106
|
-
}),
|
|
119
|
+
message: y instanceof Error ? y.message : "Storyboard recipe identity could not be created.",
|
|
120
|
+
screenId: c.id
|
|
121
|
+
}), i = `invalid:${c.id}`;
|
|
107
122
|
}
|
|
108
|
-
const
|
|
109
|
-
|
|
123
|
+
const d = n.get(i);
|
|
124
|
+
d ? d.screens.push(c) : n.set(i, { recipeKey: i, screens: [c] });
|
|
110
125
|
}
|
|
111
|
-
const
|
|
112
|
-
for (const
|
|
113
|
-
for (const
|
|
114
|
-
const u = new Map(
|
|
115
|
-
|
|
116
|
-
...(
|
|
117
|
-
const
|
|
118
|
-
return
|
|
126
|
+
const l = [...n.values()].map(Kt).sort((c, i) => c.id.localeCompare(i.id)), a = {};
|
|
127
|
+
for (const c of l)
|
|
128
|
+
for (const i of c.screenIds) a[i] = c.id;
|
|
129
|
+
const u = new Map(l.map((c) => [c.id, c])), w = (c, i) => B([
|
|
130
|
+
i,
|
|
131
|
+
...(c ?? []).flatMap((d) => {
|
|
132
|
+
const y = d.trim(), I = a[y] ?? (u.has(y) ? y : null);
|
|
133
|
+
return I ? [I] : [];
|
|
119
134
|
})
|
|
120
135
|
]), p = /* @__PURE__ */ new Map();
|
|
121
|
-
for (const
|
|
122
|
-
const
|
|
123
|
-
|
|
136
|
+
for (const c of e.assets ?? []) {
|
|
137
|
+
const i = p.get(c.pageId);
|
|
138
|
+
i ? i.push(c) : p.set(c.pageId, [c]);
|
|
124
139
|
}
|
|
125
|
-
const h =
|
|
126
|
-
const
|
|
127
|
-
(
|
|
140
|
+
const h = l.map((c) => {
|
|
141
|
+
const i = c.screenIds.flatMap(
|
|
142
|
+
(d) => p.get(d) ?? []
|
|
128
143
|
);
|
|
129
144
|
return {
|
|
130
|
-
...
|
|
145
|
+
...c,
|
|
131
146
|
scenarioIds: B([
|
|
132
|
-
...
|
|
133
|
-
...
|
|
147
|
+
...c.scenarioIds,
|
|
148
|
+
...i.map((d) => d.scenarioId)
|
|
134
149
|
]),
|
|
135
150
|
sourceKeys: B([
|
|
136
|
-
...
|
|
137
|
-
...
|
|
151
|
+
...c.sourceKeys,
|
|
152
|
+
...i.map((d) => d.sourcePath)
|
|
138
153
|
])
|
|
139
154
|
};
|
|
140
|
-
}),
|
|
141
|
-
for (const
|
|
142
|
-
for (const
|
|
143
|
-
const
|
|
144
|
-
|
|
155
|
+
}), x = /* @__PURE__ */ new Map();
|
|
156
|
+
for (const c of h)
|
|
157
|
+
for (const i of c.routes) {
|
|
158
|
+
const d = x.get(i);
|
|
159
|
+
d ? d.push(c.id) : x.set(i, [c.id]);
|
|
145
160
|
}
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
return
|
|
151
|
-
code:
|
|
161
|
+
const S = (c, i, d) => {
|
|
162
|
+
const y = c.trim(), I = a[y] ?? (u.has(y) ? y : null);
|
|
163
|
+
if (I) return I;
|
|
164
|
+
const m = B(x.get(y) ?? []);
|
|
165
|
+
return m.length === 1 ? m[0] : m.length > 1 ? (t.push({
|
|
166
|
+
code: d === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
|
|
152
167
|
severity: "error",
|
|
153
|
-
message: `Storyboard edge "${
|
|
154
|
-
edgeId:
|
|
155
|
-
screenId:
|
|
168
|
+
message: `Storyboard edge "${i}" references an ambiguous ${d} route.`,
|
|
169
|
+
edgeId: i,
|
|
170
|
+
screenId: y || void 0
|
|
156
171
|
}), null) : (t.push({
|
|
157
|
-
code:
|
|
172
|
+
code: d === "source" ? "unknown-edge-source" : "unknown-edge-target",
|
|
158
173
|
severity: "error",
|
|
159
|
-
message: `Storyboard edge "${
|
|
160
|
-
edgeId:
|
|
161
|
-
screenId:
|
|
174
|
+
message: `Storyboard edge "${i}" references an unknown ${d}.`,
|
|
175
|
+
edgeId: i,
|
|
176
|
+
screenId: y || void 0
|
|
162
177
|
}), null);
|
|
163
|
-
}, g = [],
|
|
178
|
+
}, g = [], E = /* @__PURE__ */ new Map(), f = [
|
|
164
179
|
["explicit", e.explicitEdges ?? []],
|
|
165
180
|
["inferred", e.inferredEdges ?? []]
|
|
166
181
|
];
|
|
167
|
-
let
|
|
168
|
-
for (const [
|
|
169
|
-
for (const
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
if (!
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
...
|
|
182
|
+
let R = 0;
|
|
183
|
+
for (const [c, i] of f)
|
|
184
|
+
for (const d of i) {
|
|
185
|
+
const y = qt(d, R);
|
|
186
|
+
R += 1;
|
|
187
|
+
const I = S(d.from, y, "source"), m = S(d.to, y, "target");
|
|
188
|
+
if (!I || !m || I === m) continue;
|
|
189
|
+
const N = w(d.fromScope, I), O = w(d.toScope, m), K = `${I}\0${m}`, F = E.get(K);
|
|
190
|
+
if (F) {
|
|
191
|
+
const ce = {
|
|
192
|
+
...F,
|
|
178
193
|
fromNodeIds: B([
|
|
179
|
-
...
|
|
180
|
-
...
|
|
194
|
+
...F.fromNodeIds ?? [F.from],
|
|
195
|
+
...N
|
|
181
196
|
]),
|
|
182
197
|
toNodeIds: B([
|
|
183
|
-
...
|
|
184
|
-
...
|
|
198
|
+
...F.toNodeIds ?? [F.to],
|
|
199
|
+
...O
|
|
185
200
|
]),
|
|
186
201
|
sourceEdgeIds: B([
|
|
187
|
-
...
|
|
188
|
-
|
|
202
|
+
...F.sourceEdgeIds,
|
|
203
|
+
y
|
|
189
204
|
])
|
|
190
205
|
};
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
206
|
+
E.set(K, ce);
|
|
207
|
+
const he = g.indexOf(F);
|
|
208
|
+
he >= 0 && (g[he] = ce);
|
|
194
209
|
continue;
|
|
195
210
|
}
|
|
196
|
-
const
|
|
197
|
-
id:
|
|
198
|
-
from:
|
|
199
|
-
to:
|
|
200
|
-
fromNodeIds:
|
|
201
|
-
toNodeIds:
|
|
202
|
-
kind: ((
|
|
203
|
-
label: ((
|
|
204
|
-
origin:
|
|
205
|
-
sourceEdgeIds: [
|
|
211
|
+
const q = {
|
|
212
|
+
id: y,
|
|
213
|
+
from: I,
|
|
214
|
+
to: m,
|
|
215
|
+
fromNodeIds: N,
|
|
216
|
+
toNodeIds: O,
|
|
217
|
+
kind: ((Z = d.kind) == null ? void 0 : Z.trim()) || void 0,
|
|
218
|
+
label: ((W = d.label) == null ? void 0 : W.trim()) || void 0,
|
|
219
|
+
origin: c,
|
|
220
|
+
sourceEdgeIds: [y]
|
|
206
221
|
};
|
|
207
|
-
|
|
222
|
+
E.set(K, q), g.push(q);
|
|
208
223
|
}
|
|
209
224
|
g.sort(
|
|
210
|
-
(
|
|
225
|
+
(c, i) => `${c.from}:${c.to}:${c.id}`.localeCompare(`${i.from}:${i.to}:${i.id}`)
|
|
211
226
|
);
|
|
212
|
-
const D = /* @__PURE__ */ new Map(),
|
|
213
|
-
for (const
|
|
214
|
-
for (const
|
|
215
|
-
const
|
|
216
|
-
|
|
227
|
+
const D = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
|
|
228
|
+
for (const c of g) {
|
|
229
|
+
for (const i of c.fromNodeIds ?? [c.from]) {
|
|
230
|
+
const d = b.get(i);
|
|
231
|
+
d ? d.push(c) : b.set(i, [c]);
|
|
217
232
|
}
|
|
218
|
-
for (const
|
|
219
|
-
const
|
|
220
|
-
|
|
233
|
+
for (const i of c.toNodeIds ?? [c.to]) {
|
|
234
|
+
const d = D.get(i);
|
|
235
|
+
d ? d.push(c) : D.set(i, [c]);
|
|
221
236
|
}
|
|
222
237
|
}
|
|
223
|
-
const
|
|
224
|
-
for (const
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
238
|
+
const M = [];
|
|
239
|
+
for (const c of e.startScreenIds ?? []) {
|
|
240
|
+
const i = c.trim(), d = a[i] ?? (u.has(i) ? i : null);
|
|
241
|
+
if (!d) {
|
|
227
242
|
t.push({
|
|
228
243
|
code: "unknown-start-screen",
|
|
229
244
|
severity: "error",
|
|
230
|
-
message: `Storyboard start references an unknown screen "${
|
|
231
|
-
screenId:
|
|
245
|
+
message: `Storyboard start references an unknown screen "${i}".`,
|
|
246
|
+
screenId: i || void 0
|
|
232
247
|
});
|
|
233
248
|
continue;
|
|
234
249
|
}
|
|
235
|
-
|
|
250
|
+
M.push(d);
|
|
236
251
|
}
|
|
237
|
-
const
|
|
238
|
-
let
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
return (((
|
|
242
|
-
}).map((
|
|
243
|
-
const
|
|
244
|
-
for (;
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
-
|
|
248
|
-
for (const
|
|
249
|
-
|
|
252
|
+
const te = new Set(M);
|
|
253
|
+
let P = B(M);
|
|
254
|
+
P.length || (P = h.filter((c) => {
|
|
255
|
+
var i;
|
|
256
|
+
return (((i = D.get(c.id)) == null ? void 0 : i.length) ?? 0) === 0;
|
|
257
|
+
}).map((c) => c.id).sort((c, i) => c.localeCompare(i))), !P.length && h.length && (P = [h[0].id]);
|
|
258
|
+
const C = /* @__PURE__ */ new Set(), j = [...P];
|
|
259
|
+
for (; j.length; ) {
|
|
260
|
+
const c = j.shift();
|
|
261
|
+
if (!C.has(c)) {
|
|
262
|
+
C.add(c);
|
|
263
|
+
for (const i of b.get(c) ?? [])
|
|
264
|
+
j.push(i.to), c === i.from && j.push(...i.toNodeIds ?? [i.to]);
|
|
250
265
|
}
|
|
251
266
|
}
|
|
252
|
-
const
|
|
253
|
-
var
|
|
254
|
-
const
|
|
255
|
-
return !
|
|
267
|
+
const H = h.filter((c) => {
|
|
268
|
+
var d, y;
|
|
269
|
+
const i = (((d = D.get(c.id)) == null ? void 0 : d.length) ?? 0) === 0 && (((y = b.get(c.id)) == null ? void 0 : y.length) ?? 0) === 0 && !te.has(c.id);
|
|
270
|
+
return !C.has(c.id) || i && h.length > 1;
|
|
256
271
|
});
|
|
257
|
-
for (const
|
|
258
|
-
for (const
|
|
272
|
+
for (const c of H)
|
|
273
|
+
for (const i of c.screenIds)
|
|
259
274
|
t.push({
|
|
260
275
|
code: "disconnected-screen",
|
|
261
276
|
severity: "warning",
|
|
262
|
-
message: `Storyboard screen "${
|
|
263
|
-
screenId:
|
|
264
|
-
nodeId:
|
|
277
|
+
message: `Storyboard screen "${i}" is not connected to a graph branch.`,
|
|
278
|
+
screenId: i,
|
|
279
|
+
nodeId: c.id
|
|
265
280
|
});
|
|
266
|
-
const
|
|
267
|
-
for (const
|
|
268
|
-
for (const
|
|
269
|
-
const
|
|
281
|
+
const Q = /* @__PURE__ */ new Map();
|
|
282
|
+
for (const c of h)
|
|
283
|
+
for (const i of c.sourceKeys) {
|
|
284
|
+
const d = Q.get(i) ?? {
|
|
270
285
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
271
286
|
screenIds: /* @__PURE__ */ new Set()
|
|
272
287
|
};
|
|
273
|
-
|
|
274
|
-
for (const
|
|
275
|
-
|
|
288
|
+
d.nodeIds.add(c.id);
|
|
289
|
+
for (const y of c.screenIds) d.screenIds.add(y);
|
|
290
|
+
Q.set(i, d);
|
|
276
291
|
}
|
|
277
|
-
const
|
|
278
|
-
sourceKey:
|
|
279
|
-
nodeIds: [...
|
|
280
|
-
screenIds: [...
|
|
281
|
-
shared:
|
|
282
|
-
})).sort((
|
|
283
|
-
const
|
|
284
|
-
(
|
|
292
|
+
const pe = [...Q.entries()].map(([c, i]) => ({
|
|
293
|
+
sourceKey: c,
|
|
294
|
+
nodeIds: [...i.nodeIds].sort((d, y) => d.localeCompare(y)),
|
|
295
|
+
screenIds: [...i.screenIds].sort((d, y) => d.localeCompare(y)),
|
|
296
|
+
shared: i.nodeIds.size > 1
|
|
297
|
+
})).sort((c, i) => c.sourceKey.localeCompare(i.sourceKey)), ue = h.map((c) => {
|
|
298
|
+
const i = [...b.get(c.id) ?? []].sort(
|
|
299
|
+
(d, y) => d.id.localeCompare(y.id)
|
|
285
300
|
);
|
|
286
301
|
return {
|
|
287
|
-
nodeId:
|
|
288
|
-
edgeIds:
|
|
289
|
-
targetNodeIds: B(
|
|
302
|
+
nodeId: c.id,
|
|
303
|
+
edgeIds: i.map((d) => d.id),
|
|
304
|
+
targetNodeIds: B(i.map((d) => d.to))
|
|
290
305
|
};
|
|
291
|
-
}).filter((
|
|
292
|
-
h.flatMap((
|
|
293
|
-
),
|
|
294
|
-
(e.nonVisualScenarioIds ?? []).map((
|
|
295
|
-
),
|
|
296
|
-
(e.scenarios ?? []).map((
|
|
297
|
-
),
|
|
298
|
-
(
|
|
306
|
+
}).filter((c) => c.targetNodeIds.length > 1).sort((c, i) => c.nodeId.localeCompare(i.nodeId)), V = new Set(
|
|
307
|
+
h.flatMap((c) => c.scenarioIds)
|
|
308
|
+
), ae = new Set(
|
|
309
|
+
(e.nonVisualScenarioIds ?? []).map((c) => c.trim())
|
|
310
|
+
), ne = B(
|
|
311
|
+
(e.scenarios ?? []).map((c) => c.id)
|
|
312
|
+
), Y = ne.filter(
|
|
313
|
+
(c) => !V.has(c) && !ae.has(c)
|
|
299
314
|
);
|
|
300
|
-
for (const
|
|
315
|
+
for (const c of Y)
|
|
301
316
|
t.push({
|
|
302
317
|
code: "missing-code-scenario",
|
|
303
318
|
severity: "warning",
|
|
304
|
-
message: `Code scenario "${
|
|
305
|
-
scenarioId:
|
|
319
|
+
message: `Code scenario "${c}" is not represented in the storyboard.`,
|
|
320
|
+
scenarioId: c
|
|
306
321
|
});
|
|
307
322
|
t.sort(
|
|
308
|
-
(
|
|
323
|
+
(c, i) => We(c).localeCompare(We(i))
|
|
309
324
|
);
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
),
|
|
325
|
+
const re = B(
|
|
326
|
+
H.flatMap((c) => c.screenIds)
|
|
327
|
+
), J = {
|
|
313
328
|
screens: o.length,
|
|
314
329
|
canonicalNodes: h.length,
|
|
315
330
|
mergedScreens: Math.max(0, o.length - h.length),
|
|
316
331
|
edges: g.length,
|
|
317
|
-
connectedNodes: h.length -
|
|
318
|
-
disconnectedScreens:
|
|
319
|
-
codeScenarios:
|
|
320
|
-
representedScenarios:
|
|
321
|
-
(
|
|
332
|
+
connectedNodes: h.length - H.length,
|
|
333
|
+
disconnectedScreens: re,
|
|
334
|
+
codeScenarios: ne.length,
|
|
335
|
+
representedScenarios: ne.filter(
|
|
336
|
+
(c) => V.has(c)
|
|
322
337
|
).length,
|
|
323
|
-
missingScenarios:
|
|
324
|
-
complete:
|
|
338
|
+
missingScenarios: Y,
|
|
339
|
+
complete: re.length === 0 && Y.length === 0 && !t.some((c) => c.severity === "error") && s.size === 0
|
|
325
340
|
};
|
|
326
341
|
return {
|
|
327
342
|
version: 1,
|
|
328
343
|
nodes: h,
|
|
329
344
|
edges: g,
|
|
330
345
|
aliases: Object.fromEntries(
|
|
331
|
-
Object.entries(
|
|
346
|
+
Object.entries(a).sort(([c], [i]) => c.localeCompare(i))
|
|
332
347
|
),
|
|
333
|
-
sourceGroups:
|
|
334
|
-
startNodeIds:
|
|
335
|
-
branches:
|
|
348
|
+
sourceGroups: pe,
|
|
349
|
+
startNodeIds: P,
|
|
350
|
+
branches: ue,
|
|
336
351
|
warnings: t,
|
|
337
|
-
coverage:
|
|
352
|
+
coverage: J
|
|
338
353
|
};
|
|
339
354
|
}
|
|
340
|
-
function
|
|
355
|
+
function Lt(e) {
|
|
341
356
|
return e ? JSON.parse(JSON.stringify(e)) : void 0;
|
|
342
357
|
}
|
|
343
|
-
function
|
|
344
|
-
if (Array.isArray(e)) return e.map(
|
|
358
|
+
function Pe(e) {
|
|
359
|
+
if (Array.isArray(e)) return e.map(Pe);
|
|
345
360
|
if (e && typeof e == "object") {
|
|
346
|
-
const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [r]) => o.localeCompare(r)).map(([o, r]) => [o,
|
|
361
|
+
const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [r]) => o.localeCompare(r)).map(([o, r]) => [o, Pe(r)]).filter(([, o]) => o !== void 0);
|
|
347
362
|
return t.length ? Object.fromEntries(t) : void 0;
|
|
348
363
|
}
|
|
349
364
|
return e;
|
|
350
365
|
}
|
|
351
|
-
function
|
|
352
|
-
return JSON.stringify(
|
|
366
|
+
function Ve(e) {
|
|
367
|
+
return JSON.stringify(Pe(e ?? null));
|
|
353
368
|
}
|
|
354
|
-
function
|
|
369
|
+
function Wt(e) {
|
|
355
370
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
356
371
|
}
|
|
357
|
-
function
|
|
372
|
+
function L(e) {
|
|
358
373
|
const t = e == null ? void 0 : e.trim();
|
|
359
374
|
if (!t) return null;
|
|
360
375
|
let o = t;
|
|
@@ -365,25 +380,28 @@ function W(e) {
|
|
|
365
380
|
}
|
|
366
381
|
return o = o.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), o.startsWith("/") || (o = `/${o}`), o.length > 1 && (o = o.replace(/\/+$/, "")), o || "/";
|
|
367
382
|
}
|
|
368
|
-
function
|
|
369
|
-
|
|
383
|
+
function nt(e) {
|
|
384
|
+
const t = L(e);
|
|
385
|
+
if (!t)
|
|
386
|
+
throw new Error("A storyboard source route must be a non-empty path.");
|
|
387
|
+
return `source-route:${encodeURIComponent(t)}`;
|
|
370
388
|
}
|
|
371
|
-
function
|
|
389
|
+
function Te(e, t) {
|
|
372
390
|
const o = e.split("/").filter(Boolean), r = t.split("/").filter(Boolean);
|
|
373
391
|
let n = 0;
|
|
374
392
|
for (let s = 0; s < o.length; s += 1) {
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
377
|
-
const
|
|
378
|
-
if (!(
|
|
379
|
-
if (
|
|
393
|
+
const l = o[s];
|
|
394
|
+
if (l === "*" || l.startsWith("*")) return !0;
|
|
395
|
+
const a = r[n];
|
|
396
|
+
if (!(l.endsWith("?") && a == null)) {
|
|
397
|
+
if (a == null || !l.startsWith(":") && l !== a) return !1;
|
|
380
398
|
n += 1;
|
|
381
399
|
}
|
|
382
400
|
}
|
|
383
401
|
return n === r.length;
|
|
384
402
|
}
|
|
385
|
-
function
|
|
386
|
-
const r =
|
|
403
|
+
function Je(e, t, o) {
|
|
404
|
+
const r = L(e);
|
|
387
405
|
if (!r) return [];
|
|
388
406
|
const n = t.get(r);
|
|
389
407
|
return n && !/[:*]/.test(r) ? [
|
|
@@ -391,18 +409,18 @@ function Le(e, t, o) {
|
|
|
391
409
|
representativeId: n,
|
|
392
410
|
screenIds: o.get(r) ?? [n]
|
|
393
411
|
}
|
|
394
|
-
] : [...t.entries()].filter(([s]) =>
|
|
395
|
-
representativeId:
|
|
396
|
-
screenIds: o.get(s) ?? [
|
|
397
|
-
})).sort((s,
|
|
412
|
+
] : [...t.entries()].filter(([s]) => Te(r, s)).map(([s, l]) => ({
|
|
413
|
+
representativeId: l,
|
|
414
|
+
screenIds: o.get(s) ?? [l]
|
|
415
|
+
})).sort((s, l) => s.representativeId.localeCompare(l.representativeId));
|
|
398
416
|
}
|
|
399
|
-
function
|
|
417
|
+
function Vt(e) {
|
|
400
418
|
var o;
|
|
401
419
|
const t = /* @__PURE__ */ new Map();
|
|
402
420
|
for (const r of e ?? []) {
|
|
403
|
-
const n =
|
|
421
|
+
const n = L(r.path);
|
|
404
422
|
!n || t.has(n) || t.set(n, {
|
|
405
|
-
id:
|
|
423
|
+
id: nt(n),
|
|
406
424
|
name: n,
|
|
407
425
|
section: "Source routes",
|
|
408
426
|
codeName: ((o = r.id) == null ? void 0 : o.trim()) || void 0
|
|
@@ -410,56 +428,56 @@ function Kt(e) {
|
|
|
410
428
|
}
|
|
411
429
|
return [...t.values()].sort((r, n) => r.id.localeCompare(n.id));
|
|
412
430
|
}
|
|
413
|
-
function
|
|
431
|
+
function Jt(e, t, o, r) {
|
|
414
432
|
return (e ?? []).flatMap((n, s) => {
|
|
415
|
-
var h,
|
|
416
|
-
const
|
|
417
|
-
if (!
|
|
418
|
-
const u = r.has(
|
|
433
|
+
var h, x, S;
|
|
434
|
+
const l = (h = n.from) == null ? void 0 : h.trim(), a = (x = n.to) == null ? void 0 : x.trim();
|
|
435
|
+
if (!l || !a || n.unresolvedTarget) return [];
|
|
436
|
+
const u = r.has(l) ? [{ representativeId: l, screenIds: [l] }] : Je(l, t, o), w = r.has(a) ? [{ representativeId: a, screenIds: [a] }] : Je(a, t, o);
|
|
419
437
|
if (!u.length || !w.length) return [];
|
|
420
|
-
const p = ((
|
|
438
|
+
const p = ((S = n.id) == null ? void 0 : S.trim()) || `discovery-edge:${s + 1}`;
|
|
421
439
|
return u.flatMap(
|
|
422
|
-
(g,
|
|
423
|
-
var D,
|
|
440
|
+
(g, E) => w.map((f, R) => {
|
|
441
|
+
var D, b;
|
|
424
442
|
return {
|
|
425
|
-
id: u.length === 1 && w.length === 1 ? p : `${p}:${
|
|
443
|
+
id: u.length === 1 && w.length === 1 ? p : `${p}:${E + 1}:${R + 1}`,
|
|
426
444
|
from: g.representativeId,
|
|
427
445
|
to: f.representativeId,
|
|
428
446
|
fromScope: g.screenIds,
|
|
429
447
|
toScope: f.screenIds,
|
|
430
448
|
kind: ((D = n.kind) == null ? void 0 : D.trim()) || void 0,
|
|
431
|
-
label: ((
|
|
449
|
+
label: ((b = n.label) == null ? void 0 : b.trim()) || void 0
|
|
432
450
|
};
|
|
433
451
|
})
|
|
434
452
|
);
|
|
435
453
|
});
|
|
436
454
|
}
|
|
437
|
-
function
|
|
438
|
-
const r =
|
|
455
|
+
function Qt(e, t, o) {
|
|
456
|
+
const r = L(e.route);
|
|
439
457
|
if (!r) return [];
|
|
440
458
|
const n = t.filter(
|
|
441
|
-
(
|
|
442
|
-
const u =
|
|
443
|
-
return u ?
|
|
459
|
+
(a) => {
|
|
460
|
+
const u = L(a.route);
|
|
461
|
+
return u ? Te(u, r) : !1;
|
|
444
462
|
}
|
|
445
463
|
);
|
|
446
464
|
if (!n.length) return [];
|
|
447
|
-
const s =
|
|
448
|
-
|
|
449
|
-
),
|
|
450
|
-
(
|
|
465
|
+
const s = Ve(
|
|
466
|
+
tt(o, e.environment)
|
|
467
|
+
), l = n.filter(
|
|
468
|
+
(a) => Ve(a.environment) === s
|
|
451
469
|
);
|
|
452
470
|
return [
|
|
453
471
|
...new Set(
|
|
454
|
-
|
|
472
|
+
l.map((a) => {
|
|
455
473
|
var u;
|
|
456
|
-
return (u =
|
|
457
|
-
}).filter((
|
|
474
|
+
return (u = a.scenarioId) == null ? void 0 : u.trim();
|
|
475
|
+
}).filter((a) => !!a)
|
|
458
476
|
)
|
|
459
|
-
].sort((
|
|
477
|
+
].sort((a, u) => a.localeCompare(u));
|
|
460
478
|
}
|
|
461
|
-
function
|
|
462
|
-
const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n =
|
|
479
|
+
function Xt(e, t) {
|
|
480
|
+
const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n = ot(t);
|
|
463
481
|
return e.filter(
|
|
464
482
|
(s) => o ? s.importKind === "screens" : !!s.route
|
|
465
483
|
).map((s) => ({
|
|
@@ -480,42 +498,42 @@ function Wt(e, t) {
|
|
|
480
498
|
scenario: s.scenario,
|
|
481
499
|
state: s.state,
|
|
482
500
|
scenarioId: s.scenarioId,
|
|
483
|
-
scenarioIds:
|
|
501
|
+
scenarioIds: Qt(s, r, n),
|
|
484
502
|
interactions: s.interactions,
|
|
485
503
|
environment: s.environment,
|
|
486
504
|
preset: s.preset,
|
|
487
505
|
assertions: s.assertions,
|
|
488
|
-
sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((
|
|
506
|
+
sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((l, a) => l.localeCompare(a))[0]
|
|
489
507
|
}));
|
|
490
508
|
}
|
|
491
|
-
function
|
|
492
|
-
var
|
|
493
|
-
const o = (((
|
|
509
|
+
function Ne(e, t) {
|
|
510
|
+
var a, u, w, p;
|
|
511
|
+
const o = (((a = e.interactions) == null ? void 0 : a.length) ?? 0) - (((u = t.interactions) == null ? void 0 : u.length) ?? 0);
|
|
494
512
|
if (o !== 0) return o;
|
|
495
513
|
const r = (w = e.scenarioIds) != null && w.includes("environment:baseline") ? 0 : 1, n = (p = t.scenarioIds) != null && p.includes("environment:baseline") ? 0 : 1;
|
|
496
514
|
if (r !== n) return r - n;
|
|
497
|
-
const s = !e.environment && !e.preset ? 0 : 1,
|
|
498
|
-
return s !==
|
|
515
|
+
const s = !e.environment && !e.preset ? 0 : 1, l = !t.environment && !t.preset ? 0 : 1;
|
|
516
|
+
return s !== l ? s - l : e.id.localeCompare(t.id);
|
|
499
517
|
}
|
|
500
|
-
function
|
|
518
|
+
function Yt(e) {
|
|
501
519
|
const t = /* @__PURE__ */ new Map();
|
|
502
520
|
for (const o of e) {
|
|
503
|
-
const r =
|
|
521
|
+
const r = L(o.route);
|
|
504
522
|
if (!r) continue;
|
|
505
523
|
const n = t.get(r);
|
|
506
524
|
n ? n.push(o) : t.set(r, [o]);
|
|
507
525
|
}
|
|
508
526
|
return new Map(
|
|
509
527
|
[...t.entries()].map(([o, r]) => {
|
|
510
|
-
const n = [...r].sort(
|
|
528
|
+
const n = [...r].sort(Ne);
|
|
511
529
|
return [o, n[0].id];
|
|
512
530
|
})
|
|
513
531
|
);
|
|
514
532
|
}
|
|
515
|
-
function
|
|
533
|
+
function Zt(e) {
|
|
516
534
|
const t = /* @__PURE__ */ new Map();
|
|
517
535
|
for (const o of e) {
|
|
518
|
-
const r =
|
|
536
|
+
const r = L(o.route);
|
|
519
537
|
if (!r) continue;
|
|
520
538
|
const n = t.get(r);
|
|
521
539
|
n ? n.push(o.id) : t.set(r, [o.id]);
|
|
@@ -527,9 +545,9 @@ function Jt(e) {
|
|
|
527
545
|
])
|
|
528
546
|
);
|
|
529
547
|
}
|
|
530
|
-
function
|
|
548
|
+
function en(e) {
|
|
531
549
|
return e.action === "wait" ? null : JSON.stringify(
|
|
532
|
-
|
|
550
|
+
Pe({
|
|
533
551
|
action: e.action,
|
|
534
552
|
selector: e.selector,
|
|
535
553
|
text: e.text,
|
|
@@ -543,62 +561,62 @@ function Qt(e) {
|
|
|
543
561
|
})
|
|
544
562
|
);
|
|
545
563
|
}
|
|
546
|
-
function
|
|
547
|
-
return (e.interactions ?? []).map(
|
|
564
|
+
function rt(e) {
|
|
565
|
+
return (e.interactions ?? []).map(en).filter((t) => t != null);
|
|
548
566
|
}
|
|
549
|
-
function
|
|
567
|
+
function tn(e, t) {
|
|
550
568
|
return e.length < t.length && e.every((o, r) => o === t[r]);
|
|
551
569
|
}
|
|
552
|
-
function
|
|
570
|
+
function nn(e, t) {
|
|
553
571
|
const o = /* @__PURE__ */ new Map();
|
|
554
572
|
for (const r of e) {
|
|
555
|
-
const n =
|
|
573
|
+
const n = L(r.route);
|
|
556
574
|
if (!n) continue;
|
|
557
|
-
const s = `${n}\0${
|
|
558
|
-
|
|
575
|
+
const s = `${n}\0${rt(r).join("")}`, l = o.get(s);
|
|
576
|
+
l ? l.push(r) : o.set(s, [r]);
|
|
559
577
|
}
|
|
560
578
|
return [...o.values()].flatMap((r) => {
|
|
561
579
|
if (r.length < 2) return [];
|
|
562
|
-
const n =
|
|
563
|
-
return r.filter((
|
|
564
|
-
id: `discovery-variant:${encodeURIComponent(
|
|
565
|
-
from:
|
|
566
|
-
to:
|
|
580
|
+
const n = L(r[0].route), s = t.get(n), l = r.find((a) => a.id === s) ?? [...r].sort(Ne)[0];
|
|
581
|
+
return r.filter((a) => a.id !== l.id).sort((a, u) => a.id.localeCompare(u.id)).map((a) => ({
|
|
582
|
+
id: `discovery-variant:${encodeURIComponent(l.id)}:${encodeURIComponent(a.id)}`,
|
|
583
|
+
from: l.id,
|
|
584
|
+
to: a.id,
|
|
567
585
|
kind: "variant"
|
|
568
586
|
}));
|
|
569
587
|
});
|
|
570
588
|
}
|
|
571
|
-
function
|
|
589
|
+
function rn(e, t) {
|
|
572
590
|
const o = /* @__PURE__ */ new Map();
|
|
573
591
|
for (const r of e) {
|
|
574
|
-
const n =
|
|
592
|
+
const n = L(r.route);
|
|
575
593
|
if (!n) continue;
|
|
576
594
|
const s = o.get(n);
|
|
577
595
|
s ? s.push(r) : o.set(n, [r]);
|
|
578
596
|
}
|
|
579
597
|
return [...o.entries()].flatMap(([r, n]) => {
|
|
580
598
|
const s = new Map(
|
|
581
|
-
n.map((u) => [u.id,
|
|
582
|
-
),
|
|
583
|
-
(u) => u.id ===
|
|
599
|
+
n.map((u) => [u.id, rt(u)])
|
|
600
|
+
), l = t.get(r), a = n.find(
|
|
601
|
+
(u) => u.id === l
|
|
584
602
|
);
|
|
585
603
|
return n.flatMap((u) => {
|
|
586
604
|
const w = s.get(u.id);
|
|
587
605
|
if (!w.length) return [];
|
|
588
606
|
const h = n.filter(
|
|
589
|
-
(
|
|
590
|
-
s.get(
|
|
607
|
+
(x) => tn(
|
|
608
|
+
s.get(x.id),
|
|
591
609
|
w
|
|
592
610
|
)
|
|
593
|
-
).sort((
|
|
594
|
-
const g = s.get(
|
|
611
|
+
).sort((x, S) => {
|
|
612
|
+
const g = s.get(S.id).length - s.get(x.id).length;
|
|
595
613
|
if (g !== 0) return g;
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const
|
|
601
|
-
return
|
|
614
|
+
const E = x.flow && x.flow === u.flow ? 0 : 1, f = S.flow && S.flow === u.flow ? 0 : 1;
|
|
615
|
+
if (E !== f) return E - f;
|
|
616
|
+
const R = x.section && x.section === u.section ? 0 : 1, D = S.section && S.section === u.section ? 0 : 1;
|
|
617
|
+
if (R !== D) return R - D;
|
|
618
|
+
const b = x.id === l ? 0 : 1, M = S.id === l ? 0 : 1;
|
|
619
|
+
return b !== M ? b - M : Ne(x, S);
|
|
602
620
|
})[0];
|
|
603
621
|
return h ? [
|
|
604
622
|
{
|
|
@@ -607,10 +625,10 @@ function Zt(e, t) {
|
|
|
607
625
|
to: u.id,
|
|
608
626
|
kind: "recipe-step"
|
|
609
627
|
}
|
|
610
|
-
] :
|
|
628
|
+
] : a && a.id !== u.id && s.get(a.id).join("") !== w.join("") ? [
|
|
611
629
|
{
|
|
612
|
-
id: `discovery-route-case:${encodeURIComponent(
|
|
613
|
-
from:
|
|
630
|
+
id: `discovery-route-case:${encodeURIComponent(a.id)}:${encodeURIComponent(u.id)}`,
|
|
631
|
+
from: a.id,
|
|
614
632
|
to: u.id,
|
|
615
633
|
kind: "route-case"
|
|
616
634
|
}
|
|
@@ -618,7 +636,7 @@ function Zt(e, t) {
|
|
|
618
636
|
});
|
|
619
637
|
});
|
|
620
638
|
}
|
|
621
|
-
function
|
|
639
|
+
function on(e) {
|
|
622
640
|
var o;
|
|
623
641
|
const t = /* @__PURE__ */ new Map();
|
|
624
642
|
for (const r of e) {
|
|
@@ -629,58 +647,58 @@ function en(e) {
|
|
|
629
647
|
}
|
|
630
648
|
return [...t.values()].flatMap((r) => {
|
|
631
649
|
const n = r[0], s = /* @__PURE__ */ new Map();
|
|
632
|
-
for (const
|
|
633
|
-
const
|
|
634
|
-
if (!
|
|
635
|
-
const u = s.get(
|
|
636
|
-
u ? u.push(
|
|
650
|
+
for (const l of r) {
|
|
651
|
+
const a = L(l.route);
|
|
652
|
+
if (!a) continue;
|
|
653
|
+
const u = s.get(a);
|
|
654
|
+
u ? u.push(l) : s.set(a, [l]);
|
|
637
655
|
}
|
|
638
|
-
return s.size < 2 ? [] : [...s.values()].flatMap((
|
|
639
|
-
const
|
|
640
|
-
|
|
656
|
+
return s.size < 2 ? [] : [...s.values()].flatMap((l) => {
|
|
657
|
+
const a = [...l].sort(
|
|
658
|
+
Ne
|
|
641
659
|
)[0];
|
|
642
|
-
return
|
|
660
|
+
return a.id === n.id ? [] : [
|
|
643
661
|
{
|
|
644
|
-
id: `discovery-flow-route:${encodeURIComponent(n.id)}:${encodeURIComponent(
|
|
662
|
+
id: `discovery-flow-route:${encodeURIComponent(n.id)}:${encodeURIComponent(a.id)}`,
|
|
645
663
|
from: n.id,
|
|
646
|
-
to:
|
|
664
|
+
to: a.id,
|
|
647
665
|
kind: "flow-route"
|
|
648
666
|
}
|
|
649
667
|
];
|
|
650
668
|
});
|
|
651
669
|
});
|
|
652
670
|
}
|
|
653
|
-
function
|
|
671
|
+
function sn(e, t, o) {
|
|
654
672
|
const r = new Set(
|
|
655
|
-
(t.routes ?? []).map((n) =>
|
|
673
|
+
(t.routes ?? []).map((n) => L(n.path)).filter((n) => !!n)
|
|
656
674
|
);
|
|
657
675
|
return e.map((n) => {
|
|
658
|
-
const s =
|
|
676
|
+
const s = L(n.route);
|
|
659
677
|
if (!s || o.get(s) !== n.id)
|
|
660
678
|
return n;
|
|
661
|
-
const
|
|
662
|
-
(
|
|
679
|
+
const l = [...r].filter(
|
|
680
|
+
(a) => Te(a, s)
|
|
663
681
|
);
|
|
664
|
-
return
|
|
682
|
+
return l.length ? {
|
|
665
683
|
...n,
|
|
666
684
|
scenarioIds: [
|
|
667
685
|
.../* @__PURE__ */ new Set([
|
|
668
686
|
...n.scenarioIds ?? [],
|
|
669
|
-
...
|
|
687
|
+
...l.map(nt)
|
|
670
688
|
])
|
|
671
|
-
].sort((
|
|
689
|
+
].sort((a, u) => a.localeCompare(u))
|
|
672
690
|
} : n;
|
|
673
691
|
});
|
|
674
692
|
}
|
|
675
|
-
function
|
|
676
|
-
var w, p, h,
|
|
693
|
+
function an(e, t) {
|
|
694
|
+
var w, p, h, x, S;
|
|
677
695
|
const o = new Set(e.map((g) => g.id)), r = new Map(
|
|
678
|
-
e.map((g,
|
|
679
|
-
), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(),
|
|
696
|
+
e.map((g, E) => [g.id, E])
|
|
697
|
+
), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
680
698
|
for (const g of o)
|
|
681
|
-
n.set(g, /* @__PURE__ */ new Set()), s.set(g, /* @__PURE__ */ new Set()),
|
|
699
|
+
n.set(g, /* @__PURE__ */ new Set()), s.set(g, /* @__PURE__ */ new Set()), l.set(g, /* @__PURE__ */ new Set());
|
|
682
700
|
for (const g of t) {
|
|
683
|
-
const
|
|
701
|
+
const E = [
|
|
684
702
|
...(g.fromScope ?? [g.from]).map(
|
|
685
703
|
(f) => [f, g.to]
|
|
686
704
|
),
|
|
@@ -688,89 +706,95 @@ function nn(e, t) {
|
|
|
688
706
|
(f) => [g.from, f]
|
|
689
707
|
)
|
|
690
708
|
];
|
|
691
|
-
for (const [f,
|
|
692
|
-
!o.has(f) || !o.has(
|
|
709
|
+
for (const [f, R] of E)
|
|
710
|
+
!o.has(f) || !o.has(R) || ((w = n.get(R)) == null || w.add(f), (p = s.get(f)) == null || p.add(R), (h = l.get(f)) == null || h.add(R), (x = l.get(R)) == null || x.add(f));
|
|
693
711
|
}
|
|
694
|
-
const
|
|
712
|
+
const a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
695
713
|
for (const g of o) {
|
|
696
714
|
if (u.has(g)) continue;
|
|
697
|
-
const
|
|
715
|
+
const E = [], f = [g];
|
|
698
716
|
for (; f.length; ) {
|
|
699
|
-
const
|
|
700
|
-
if (!u.has(
|
|
701
|
-
u.add(
|
|
702
|
-
for (const
|
|
703
|
-
u.has(
|
|
717
|
+
const P = f.shift();
|
|
718
|
+
if (!u.has(P)) {
|
|
719
|
+
u.add(P), E.push(P);
|
|
720
|
+
for (const C of l.get(P) ?? [])
|
|
721
|
+
u.has(C) || f.push(C);
|
|
704
722
|
}
|
|
705
723
|
}
|
|
706
|
-
if (
|
|
724
|
+
if (E.length === 1 && (((S = l.get(E[0])) == null ? void 0 : S.size) ?? 0) === 0)
|
|
707
725
|
continue;
|
|
708
|
-
const
|
|
709
|
-
var
|
|
710
|
-
return (((
|
|
726
|
+
const R = E.filter((P) => {
|
|
727
|
+
var C;
|
|
728
|
+
return (((C = n.get(P)) == null ? void 0 : C.size) ?? 0) === 0;
|
|
711
729
|
}).sort(
|
|
712
|
-
(
|
|
713
|
-
), D = [...
|
|
714
|
-
(
|
|
730
|
+
(P, C) => (r.get(P) ?? Number.MAX_SAFE_INTEGER) - (r.get(C) ?? Number.MAX_SAFE_INTEGER) || P.localeCompare(C)
|
|
731
|
+
), D = [...E].sort(
|
|
732
|
+
(P, C) => (r.get(P) ?? Number.MAX_SAFE_INTEGER) - (r.get(C) ?? Number.MAX_SAFE_INTEGER) || P.localeCompare(C)
|
|
715
733
|
)[0];
|
|
716
734
|
if (!D) continue;
|
|
717
|
-
const
|
|
718
|
-
const
|
|
719
|
-
for (;
|
|
720
|
-
const
|
|
721
|
-
if (
|
|
722
|
-
|
|
723
|
-
for (const
|
|
724
|
-
|
|
735
|
+
const b = [D], M = /* @__PURE__ */ new Set(), te = (P) => {
|
|
736
|
+
const C = [P];
|
|
737
|
+
for (; C.length; ) {
|
|
738
|
+
const j = C.shift();
|
|
739
|
+
if (!M.has(j)) {
|
|
740
|
+
M.add(j);
|
|
741
|
+
for (const H of s.get(j) ?? [])
|
|
742
|
+
M.has(H) || C.push(H);
|
|
725
743
|
}
|
|
726
744
|
}
|
|
727
745
|
};
|
|
728
|
-
|
|
729
|
-
for (const
|
|
730
|
-
|
|
731
|
-
for (const
|
|
732
|
-
|
|
746
|
+
te(D);
|
|
747
|
+
for (const P of R)
|
|
748
|
+
M.has(P) || (b.push(P), te(P));
|
|
749
|
+
for (const P of b)
|
|
750
|
+
a.add(P);
|
|
733
751
|
}
|
|
734
|
-
return [...
|
|
735
|
-
(g,
|
|
752
|
+
return [...a].sort(
|
|
753
|
+
(g, E) => (r.get(g) ?? Number.MAX_SAFE_INTEGER) - (r.get(E) ?? Number.MAX_SAFE_INTEGER) || g.localeCompare(E)
|
|
736
754
|
);
|
|
737
755
|
}
|
|
738
|
-
function
|
|
756
|
+
function ot(e) {
|
|
739
757
|
var t, o;
|
|
740
|
-
return
|
|
758
|
+
return Lt(
|
|
741
759
|
(o = (t = e.scenarios) == null ? void 0 : t.find(
|
|
742
760
|
(r) => r.id === "environment:baseline"
|
|
743
761
|
)) == null ? void 0 : o.environment
|
|
744
762
|
);
|
|
745
763
|
}
|
|
746
|
-
function
|
|
747
|
-
|
|
764
|
+
function cn(e) {
|
|
765
|
+
var u, w, p, h, x;
|
|
766
|
+
const t = Xt(
|
|
748
767
|
e.pages,
|
|
749
768
|
e.manifest
|
|
750
|
-
), o =
|
|
769
|
+
), o = Yt(t), r = Zt(t), n = sn(
|
|
751
770
|
t,
|
|
752
771
|
e.manifest,
|
|
753
772
|
o
|
|
754
|
-
),
|
|
755
|
-
...
|
|
773
|
+
), l = [
|
|
774
|
+
...Jt(
|
|
756
775
|
e.manifest.edges,
|
|
757
776
|
o,
|
|
758
777
|
r,
|
|
759
|
-
new Set(n.map((
|
|
778
|
+
new Set(n.map((S) => S.id))
|
|
760
779
|
),
|
|
761
|
-
...
|
|
762
|
-
...
|
|
763
|
-
...
|
|
780
|
+
...nn(n, o),
|
|
781
|
+
...rn(n, o),
|
|
782
|
+
...on(n)
|
|
783
|
+
], a = [
|
|
784
|
+
...((u = e.storyboard) == null ? void 0 : u.edges) ?? [],
|
|
785
|
+
...Ut(((w = e.storyboard) == null ? void 0 : w.paths) ?? [])
|
|
764
786
|
];
|
|
765
|
-
return
|
|
787
|
+
return Gt({
|
|
766
788
|
screens: n,
|
|
767
789
|
assets: e.assets,
|
|
768
|
-
scenarios:
|
|
769
|
-
|
|
770
|
-
|
|
790
|
+
scenarios: Vt(e.manifest.routes),
|
|
791
|
+
explicitEdges: a,
|
|
792
|
+
inferredEdges: l,
|
|
793
|
+
startScreenIds: (h = (p = e.storyboard) == null ? void 0 : p.startScreenIds) != null && h.length ? e.storyboard.startScreenIds : an(n, [...a, ...l]),
|
|
794
|
+
nonVisualScenarioIds: (x = e.storyboard) == null ? void 0 : x.nonVisualScenarioIds
|
|
771
795
|
});
|
|
772
796
|
}
|
|
773
|
-
async function
|
|
797
|
+
async function st(e) {
|
|
774
798
|
const o = await (e.fetcher ?? ((n, s) => fetch(n, s)))(e.endpoint, {
|
|
775
799
|
headers: { accept: "application/json" },
|
|
776
800
|
cache: "no-store",
|
|
@@ -779,41 +803,42 @@ async function nt(e) {
|
|
|
779
803
|
if (!o.ok)
|
|
780
804
|
throw new Error(`Storyboard discovery failed (${o.status})`);
|
|
781
805
|
const r = await o.json();
|
|
782
|
-
if (!
|
|
806
|
+
if (!Wt(r))
|
|
783
807
|
throw new Error("Storyboard discovery returned an invalid manifest.");
|
|
784
808
|
return {
|
|
785
809
|
manifest: r,
|
|
786
|
-
baselineEnvironment:
|
|
787
|
-
graph:
|
|
810
|
+
baselineEnvironment: ot(r),
|
|
811
|
+
graph: cn({
|
|
788
812
|
manifest: r,
|
|
789
813
|
pages: e.pages,
|
|
790
|
-
assets: e.assets
|
|
814
|
+
assets: e.assets,
|
|
815
|
+
storyboard: e.storyboard
|
|
791
816
|
})
|
|
792
817
|
};
|
|
793
818
|
}
|
|
794
|
-
async function
|
|
795
|
-
|
|
819
|
+
async function Nn(e) {
|
|
820
|
+
se(null);
|
|
796
821
|
try {
|
|
797
|
-
const t = await
|
|
798
|
-
return
|
|
822
|
+
const t = await st(e);
|
|
823
|
+
return se(t.graph), t;
|
|
799
824
|
} catch (t) {
|
|
800
|
-
throw
|
|
825
|
+
throw se(null), t;
|
|
801
826
|
}
|
|
802
827
|
}
|
|
803
|
-
const
|
|
804
|
-
function
|
|
828
|
+
const Ee = "var(--pygmalion-catalog-surface, #ffffff)", Ce = "var(--pygmalion-catalog-canvas, #f5f5f5)", ke = "var(--pygmalion-catalog-border, #e5e7eb)", Re = "var(--pygmalion-catalog-text, #202124)", G = "var(--pygmalion-catalog-muted, #6b7280)", ln = "var(--pygmalion-catalog-header, #11182f)", dn = "var(--pygmalion-catalog-accent, #7c6cf2)";
|
|
829
|
+
function $n({
|
|
805
830
|
title: e,
|
|
806
831
|
eyebrow: t,
|
|
807
832
|
description: o,
|
|
808
833
|
version: r,
|
|
809
834
|
meta: n,
|
|
810
835
|
children: s,
|
|
811
|
-
headerBackground:
|
|
812
|
-
headerColor:
|
|
813
|
-
bodyBackground: u =
|
|
836
|
+
headerBackground: l = ln,
|
|
837
|
+
headerColor: a = "#ffffff",
|
|
838
|
+
bodyBackground: u = Ee,
|
|
814
839
|
bodyGap: w = 40
|
|
815
840
|
}) {
|
|
816
|
-
return /* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ A(
|
|
817
842
|
"section",
|
|
818
843
|
{
|
|
819
844
|
"data-pygmalion-catalog-document": "",
|
|
@@ -825,12 +850,12 @@ function En({
|
|
|
825
850
|
maxWidth: "none",
|
|
826
851
|
flexDirection: "column",
|
|
827
852
|
overflow: "visible",
|
|
828
|
-
color:
|
|
853
|
+
color: Re,
|
|
829
854
|
background: u,
|
|
830
855
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
831
856
|
},
|
|
832
857
|
children: [
|
|
833
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ A(
|
|
834
859
|
"header",
|
|
835
860
|
{
|
|
836
861
|
style: {
|
|
@@ -840,12 +865,12 @@ function En({
|
|
|
840
865
|
justifyContent: "space-between",
|
|
841
866
|
gap: 48,
|
|
842
867
|
padding: "44px 48px 48px",
|
|
843
|
-
color:
|
|
844
|
-
background:
|
|
868
|
+
color: a,
|
|
869
|
+
background: l
|
|
845
870
|
},
|
|
846
871
|
children: [
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
t ? /* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ A("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
873
|
+
t ? /* @__PURE__ */ v(
|
|
849
874
|
"div",
|
|
850
875
|
{
|
|
851
876
|
style: {
|
|
@@ -858,7 +883,7 @@ function En({
|
|
|
858
883
|
children: t
|
|
859
884
|
}
|
|
860
885
|
) : null,
|
|
861
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ v(
|
|
862
887
|
"h1",
|
|
863
888
|
{
|
|
864
889
|
style: {
|
|
@@ -872,7 +897,7 @@ function En({
|
|
|
872
897
|
children: e
|
|
873
898
|
}
|
|
874
899
|
),
|
|
875
|
-
o ? /* @__PURE__ */
|
|
900
|
+
o ? /* @__PURE__ */ v(
|
|
876
901
|
"div",
|
|
877
902
|
{
|
|
878
903
|
style: {
|
|
@@ -885,7 +910,7 @@ function En({
|
|
|
885
910
|
}
|
|
886
911
|
) : null
|
|
887
912
|
] }),
|
|
888
|
-
r || n ? /* @__PURE__ */
|
|
913
|
+
r || n ? /* @__PURE__ */ A(
|
|
889
914
|
"div",
|
|
890
915
|
{
|
|
891
916
|
style: {
|
|
@@ -897,15 +922,15 @@ function En({
|
|
|
897
922
|
whiteSpace: "nowrap"
|
|
898
923
|
},
|
|
899
924
|
children: [
|
|
900
|
-
r ? /* @__PURE__ */
|
|
901
|
-
n ? /* @__PURE__ */
|
|
925
|
+
r ? /* @__PURE__ */ v("span", { children: r }) : null,
|
|
926
|
+
n ? /* @__PURE__ */ v("span", { children: n }) : null
|
|
902
927
|
]
|
|
903
928
|
}
|
|
904
929
|
) : null
|
|
905
930
|
]
|
|
906
931
|
}
|
|
907
932
|
),
|
|
908
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ v(
|
|
909
934
|
"div",
|
|
910
935
|
{
|
|
911
936
|
"data-pygmalion-catalog-document-body": "",
|
|
@@ -925,7 +950,7 @@ function En({
|
|
|
925
950
|
}
|
|
926
951
|
);
|
|
927
952
|
}
|
|
928
|
-
function
|
|
953
|
+
function An({
|
|
929
954
|
title: e,
|
|
930
955
|
itemId: t,
|
|
931
956
|
count: o,
|
|
@@ -933,7 +958,7 @@ function Cn({
|
|
|
933
958
|
children: n,
|
|
934
959
|
tone: s = "tinted"
|
|
935
960
|
}) {
|
|
936
|
-
return /* @__PURE__ */
|
|
961
|
+
return /* @__PURE__ */ A(
|
|
937
962
|
"section",
|
|
938
963
|
{
|
|
939
964
|
"data-pygmalion-catalog-section": "",
|
|
@@ -946,11 +971,11 @@ function Cn({
|
|
|
946
971
|
alignItems: "flex-start",
|
|
947
972
|
gap: 18,
|
|
948
973
|
padding: s === "tinted" ? 24 : 0,
|
|
949
|
-
background: s === "tinted" ?
|
|
974
|
+
background: s === "tinted" ? Ce : "transparent"
|
|
950
975
|
},
|
|
951
976
|
children: [
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ A("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
|
|
978
|
+
/* @__PURE__ */ v(
|
|
954
979
|
"h2",
|
|
955
980
|
{
|
|
956
981
|
style: {
|
|
@@ -962,25 +987,25 @@ function Cn({
|
|
|
962
987
|
children: e
|
|
963
988
|
}
|
|
964
989
|
),
|
|
965
|
-
typeof o == "number" ? /* @__PURE__ */
|
|
990
|
+
typeof o == "number" ? /* @__PURE__ */ v("span", { style: { color: G, fontSize: 11 }, children: o }) : null
|
|
966
991
|
] }),
|
|
967
|
-
r ? /* @__PURE__ */
|
|
992
|
+
r ? /* @__PURE__ */ v("div", { style: { marginTop: -10, color: G, fontSize: 11 }, children: r }) : null,
|
|
968
993
|
n
|
|
969
994
|
]
|
|
970
995
|
}
|
|
971
996
|
);
|
|
972
997
|
}
|
|
973
|
-
function
|
|
998
|
+
function Mn({
|
|
974
999
|
rows: e,
|
|
975
1000
|
columns: t,
|
|
976
1001
|
cornerLabel: o,
|
|
977
1002
|
renderCell: r,
|
|
978
|
-
renderRowLabel: n = (u) => u,
|
|
979
|
-
renderColumnLabel: s = (u) => u,
|
|
980
|
-
boundary:
|
|
981
|
-
cellStyle:
|
|
1003
|
+
renderRowLabel: n = (u) => String(u),
|
|
1004
|
+
renderColumnLabel: s = (u) => String(u),
|
|
1005
|
+
boundary: l = !0,
|
|
1006
|
+
cellStyle: a
|
|
982
1007
|
}) {
|
|
983
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ v(
|
|
984
1009
|
"div",
|
|
985
1010
|
{
|
|
986
1011
|
"data-pygmalion-catalog-matrix": "",
|
|
@@ -988,11 +1013,11 @@ function Rn({
|
|
|
988
1013
|
boxSizing: "border-box",
|
|
989
1014
|
display: "inline-block",
|
|
990
1015
|
width: "max-content",
|
|
991
|
-
padding:
|
|
992
|
-
border:
|
|
993
|
-
borderRadius:
|
|
1016
|
+
padding: l ? 16 : 0,
|
|
1017
|
+
border: l ? `1px dashed ${dn}` : void 0,
|
|
1018
|
+
borderRadius: l ? 4 : void 0
|
|
994
1019
|
},
|
|
995
|
-
children: /* @__PURE__ */
|
|
1020
|
+
children: /* @__PURE__ */ A(
|
|
996
1021
|
"table",
|
|
997
1022
|
{
|
|
998
1023
|
style: {
|
|
@@ -1001,13 +1026,13 @@ function Rn({
|
|
|
1001
1026
|
borderSpacing: 0
|
|
1002
1027
|
},
|
|
1003
1028
|
children: [
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ A("tr", { children: [
|
|
1030
|
+
/* @__PURE__ */ v(
|
|
1006
1031
|
"th",
|
|
1007
1032
|
{
|
|
1008
1033
|
style: {
|
|
1009
1034
|
padding: "0 16px 12px 0",
|
|
1010
|
-
color:
|
|
1035
|
+
color: G,
|
|
1011
1036
|
fontSize: 10,
|
|
1012
1037
|
fontWeight: 600,
|
|
1013
1038
|
textAlign: "left",
|
|
@@ -1016,12 +1041,12 @@ function Rn({
|
|
|
1016
1041
|
children: o
|
|
1017
1042
|
}
|
|
1018
1043
|
),
|
|
1019
|
-
t.map((u) => /* @__PURE__ */
|
|
1044
|
+
t.map((u) => /* @__PURE__ */ v(
|
|
1020
1045
|
"th",
|
|
1021
1046
|
{
|
|
1022
1047
|
style: {
|
|
1023
1048
|
padding: "0 16px 12px",
|
|
1024
|
-
color:
|
|
1049
|
+
color: G,
|
|
1025
1050
|
fontSize: 10,
|
|
1026
1051
|
fontWeight: 600,
|
|
1027
1052
|
textAlign: "center",
|
|
@@ -1029,16 +1054,16 @@ function Rn({
|
|
|
1029
1054
|
},
|
|
1030
1055
|
children: s(u)
|
|
1031
1056
|
},
|
|
1032
|
-
u
|
|
1057
|
+
`${typeof u}:${String(u)}`
|
|
1033
1058
|
))
|
|
1034
1059
|
] }) }),
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1060
|
+
/* @__PURE__ */ v("tbody", { children: e.map((u) => /* @__PURE__ */ A("tr", { children: [
|
|
1061
|
+
/* @__PURE__ */ v(
|
|
1037
1062
|
"th",
|
|
1038
1063
|
{
|
|
1039
1064
|
style: {
|
|
1040
1065
|
padding: "12px 16px 12px 0",
|
|
1041
|
-
color:
|
|
1066
|
+
color: G,
|
|
1042
1067
|
fontSize: 10,
|
|
1043
1068
|
fontWeight: 600,
|
|
1044
1069
|
textAlign: "left",
|
|
@@ -1047,34 +1072,34 @@ function Rn({
|
|
|
1047
1072
|
children: n(u)
|
|
1048
1073
|
}
|
|
1049
1074
|
),
|
|
1050
|
-
t.map((w) => /* @__PURE__ */
|
|
1075
|
+
t.map((w) => /* @__PURE__ */ v(
|
|
1051
1076
|
"td",
|
|
1052
1077
|
{
|
|
1053
1078
|
style: {
|
|
1054
1079
|
padding: "12px 16px",
|
|
1055
1080
|
textAlign: "center",
|
|
1056
1081
|
verticalAlign: "middle",
|
|
1057
|
-
...
|
|
1082
|
+
...a
|
|
1058
1083
|
},
|
|
1059
1084
|
children: r(u, w)
|
|
1060
1085
|
},
|
|
1061
|
-
w
|
|
1086
|
+
`${typeof w}:${String(w)}`
|
|
1062
1087
|
))
|
|
1063
|
-
] }, u)) })
|
|
1088
|
+
] }, `${typeof u}:${String(u)}`)) })
|
|
1064
1089
|
]
|
|
1065
1090
|
}
|
|
1066
1091
|
)
|
|
1067
1092
|
}
|
|
1068
1093
|
);
|
|
1069
1094
|
}
|
|
1070
|
-
function
|
|
1095
|
+
function un(e) {
|
|
1071
1096
|
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
|
|
1072
1097
|
}
|
|
1073
|
-
function
|
|
1074
|
-
const r = (n) =>
|
|
1098
|
+
function it(e, t, o = "PygmalionCatalog") {
|
|
1099
|
+
const r = (n) => un(n).replace(/-/g, "_");
|
|
1075
1100
|
return `${o}_${r(e)}_${r(t)}`;
|
|
1076
1101
|
}
|
|
1077
|
-
function
|
|
1102
|
+
function at(e, t) {
|
|
1078
1103
|
return {
|
|
1079
1104
|
id: e.id,
|
|
1080
1105
|
name: e.name,
|
|
@@ -1085,7 +1110,7 @@ function ot(e, t) {
|
|
|
1085
1110
|
description: e.description
|
|
1086
1111
|
};
|
|
1087
1112
|
}
|
|
1088
|
-
function
|
|
1113
|
+
function ct(e) {
|
|
1089
1114
|
const t = /* @__PURE__ */ new Set();
|
|
1090
1115
|
for (const o of e) {
|
|
1091
1116
|
if (t.has(o.id))
|
|
@@ -1093,17 +1118,17 @@ function st(e) {
|
|
|
1093
1118
|
t.add(o.id);
|
|
1094
1119
|
}
|
|
1095
1120
|
}
|
|
1096
|
-
function
|
|
1121
|
+
function fn(e, t, o) {
|
|
1097
1122
|
return typeof e == "function" ? e(t, o) : e;
|
|
1098
1123
|
}
|
|
1099
|
-
function
|
|
1124
|
+
function mn({
|
|
1100
1125
|
page: e,
|
|
1101
1126
|
items: t,
|
|
1102
1127
|
renderPreview: o,
|
|
1103
1128
|
secondaryLabel: r,
|
|
1104
1129
|
minimumColumnWidth: n
|
|
1105
1130
|
}) {
|
|
1106
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ A(
|
|
1107
1132
|
"section",
|
|
1108
1133
|
{
|
|
1109
1134
|
"data-pygmalion-catalog-page": e.id,
|
|
@@ -1113,19 +1138,19 @@ function ln({
|
|
|
1113
1138
|
display: "inline-block",
|
|
1114
1139
|
width: "max-content",
|
|
1115
1140
|
padding: 32,
|
|
1116
|
-
color:
|
|
1117
|
-
background:
|
|
1141
|
+
color: Re,
|
|
1142
|
+
background: Ce,
|
|
1118
1143
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1119
1144
|
},
|
|
1120
1145
|
children: [
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ A("header", { style: { marginBottom: 24 }, children: [
|
|
1147
|
+
/* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
|
|
1148
|
+
/* @__PURE__ */ A("p", { style: { margin: "6px 0 0", color: G, fontSize: 13 }, children: [
|
|
1124
1149
|
t.length,
|
|
1125
1150
|
" assets"
|
|
1126
1151
|
] })
|
|
1127
1152
|
] }),
|
|
1128
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ v(
|
|
1129
1154
|
"div",
|
|
1130
1155
|
{
|
|
1131
1156
|
style: {
|
|
@@ -1133,7 +1158,7 @@ function ln({
|
|
|
1133
1158
|
gridTemplateColumns: "repeat(6, max-content)",
|
|
1134
1159
|
gap: 16
|
|
1135
1160
|
},
|
|
1136
|
-
children: t.map((s) => /* @__PURE__ */
|
|
1161
|
+
children: t.map((s) => /* @__PURE__ */ A(
|
|
1137
1162
|
"article",
|
|
1138
1163
|
{
|
|
1139
1164
|
"data-pygmalion-catalog-item": s.id,
|
|
@@ -1141,12 +1166,12 @@ function ln({
|
|
|
1141
1166
|
minWidth: n,
|
|
1142
1167
|
width: n,
|
|
1143
1168
|
padding: 16,
|
|
1144
|
-
border: `1px solid ${
|
|
1169
|
+
border: `1px solid ${ke}`,
|
|
1145
1170
|
borderRadius: 12,
|
|
1146
|
-
background:
|
|
1171
|
+
background: Ee
|
|
1147
1172
|
},
|
|
1148
1173
|
children: [
|
|
1149
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ v(
|
|
1150
1175
|
"div",
|
|
1151
1176
|
{
|
|
1152
1177
|
style: {
|
|
@@ -1159,7 +1184,7 @@ function ln({
|
|
|
1159
1184
|
children: o(s)
|
|
1160
1185
|
}
|
|
1161
1186
|
),
|
|
1162
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ v(
|
|
1163
1188
|
"div",
|
|
1164
1189
|
{
|
|
1165
1190
|
style: {
|
|
@@ -1174,13 +1199,13 @@ function ln({
|
|
|
1174
1199
|
children: s.name
|
|
1175
1200
|
}
|
|
1176
1201
|
),
|
|
1177
|
-
r ? /* @__PURE__ */
|
|
1202
|
+
r ? /* @__PURE__ */ v("div", { style: { marginTop: 4, color: G, fontSize: 11, lineHeight: 1.45 }, children: r(s) }) : s.codeName ? /* @__PURE__ */ v(
|
|
1178
1203
|
"div",
|
|
1179
1204
|
{
|
|
1180
1205
|
style: {
|
|
1181
1206
|
marginTop: 4,
|
|
1182
1207
|
overflow: "hidden",
|
|
1183
|
-
color:
|
|
1208
|
+
color: G,
|
|
1184
1209
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
1185
1210
|
fontSize: 11,
|
|
1186
1211
|
textOverflow: "ellipsis",
|
|
@@ -1200,21 +1225,21 @@ function ln({
|
|
|
1200
1225
|
}
|
|
1201
1226
|
);
|
|
1202
1227
|
}
|
|
1203
|
-
function
|
|
1204
|
-
|
|
1228
|
+
function On(e) {
|
|
1229
|
+
ct(e.items);
|
|
1205
1230
|
const t = /* @__PURE__ */ new Map();
|
|
1206
1231
|
for (const n of e.items) {
|
|
1207
|
-
const s = e.pageFor(n),
|
|
1208
|
-
if (
|
|
1209
|
-
if (
|
|
1232
|
+
const s = e.pageFor(n), l = t.get(s.id);
|
|
1233
|
+
if (l) {
|
|
1234
|
+
if (l.page.name !== s.name || l.page.section !== s.section)
|
|
1210
1235
|
throw new Error(`Conflicting design catalog page descriptor: ${s.id}`);
|
|
1211
|
-
|
|
1236
|
+
l.items.push(n);
|
|
1212
1237
|
continue;
|
|
1213
1238
|
}
|
|
1214
1239
|
t.set(s.id, {
|
|
1215
1240
|
page: s,
|
|
1216
1241
|
items: [n],
|
|
1217
|
-
registryName:
|
|
1242
|
+
registryName: it(
|
|
1218
1243
|
e.kind,
|
|
1219
1244
|
s.id,
|
|
1220
1245
|
e.registryPrefix
|
|
@@ -1223,8 +1248,8 @@ function Nn(e) {
|
|
|
1223
1248
|
}
|
|
1224
1249
|
const o = {}, r = [];
|
|
1225
1250
|
for (const n of t.values()) {
|
|
1226
|
-
const s = () => /* @__PURE__ */
|
|
1227
|
-
|
|
1251
|
+
const s = () => /* @__PURE__ */ v(
|
|
1252
|
+
mn,
|
|
1228
1253
|
{
|
|
1229
1254
|
page: n.page,
|
|
1230
1255
|
items: n.items,
|
|
@@ -1237,49 +1262,49 @@ function Nn(e) {
|
|
|
1237
1262
|
component: s,
|
|
1238
1263
|
children: "none"
|
|
1239
1264
|
};
|
|
1240
|
-
const
|
|
1265
|
+
const l = fn(e.frame, n.page, n.items);
|
|
1241
1266
|
r.push({
|
|
1242
1267
|
...n.page,
|
|
1243
1268
|
componentName: n.registryName,
|
|
1244
|
-
width: (
|
|
1245
|
-
height: (
|
|
1246
|
-
frameSizeMode:
|
|
1269
|
+
width: (l == null ? void 0 : l.width) ?? 1,
|
|
1270
|
+
height: (l == null ? void 0 : l.height) ?? 1,
|
|
1271
|
+
frameSizeMode: l ? "fixed" : "content"
|
|
1247
1272
|
});
|
|
1248
1273
|
}
|
|
1249
1274
|
return {
|
|
1250
1275
|
registry: o,
|
|
1251
1276
|
collection: {
|
|
1252
1277
|
expectedCount: e.expectedCount ?? e.items.length,
|
|
1253
|
-
assets: e.items.map((n) =>
|
|
1278
|
+
assets: e.items.map((n) => at(n, e.pageFor(n).id)),
|
|
1254
1279
|
pages: r
|
|
1255
1280
|
}
|
|
1256
1281
|
};
|
|
1257
1282
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([,
|
|
1283
|
+
function pn(e, t = 60) {
|
|
1284
|
+
const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, a]) => a.length > 0).sort(([a, u], [w, p]) => p.length - u.length || a.localeCompare(w)), r = o[0], n = o[1], s = Math.max(1, (r == null ? void 0 : r[1].length) ?? 1), l = n == null ? void 0 : n[1].slice(0, Math.max(1, Math.floor(t / s)));
|
|
1260
1285
|
return {
|
|
1261
1286
|
row: r,
|
|
1262
|
-
column: n ? [n[0],
|
|
1263
|
-
fixed: o.slice(2).map(([
|
|
1287
|
+
column: n ? [n[0], l ?? []] : void 0,
|
|
1288
|
+
fixed: o.slice(2).map(([a, u]) => [a, u[0]]),
|
|
1264
1289
|
additional: o.slice(2)
|
|
1265
1290
|
};
|
|
1266
1291
|
}
|
|
1267
|
-
function
|
|
1292
|
+
function hn(e, t, o, r) {
|
|
1268
1293
|
return {
|
|
1269
1294
|
...e.defaultProps,
|
|
1270
1295
|
...Object.fromEntries(t.fixed),
|
|
1271
|
-
...t.row && o ? { [t.row[0]]: o } : {},
|
|
1272
|
-
...t.column && r ? { [t.column[0]]: r } : {}
|
|
1296
|
+
...t.row && o !== void 0 ? { [t.row[0]]: o } : {},
|
|
1297
|
+
...t.column && r !== void 0 ? { [t.column[0]]: r } : {}
|
|
1273
1298
|
};
|
|
1274
1299
|
}
|
|
1275
|
-
function
|
|
1300
|
+
function gn({
|
|
1276
1301
|
item: e,
|
|
1277
1302
|
entry: t,
|
|
1278
1303
|
maxVariantCells: o
|
|
1279
1304
|
}) {
|
|
1280
|
-
var
|
|
1305
|
+
var a, u;
|
|
1281
1306
|
if (!t)
|
|
1282
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ A(
|
|
1283
1308
|
"section",
|
|
1284
1309
|
{
|
|
1285
1310
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1289,17 +1314,17 @@ function fn({
|
|
|
1289
1314
|
display: "inline-block",
|
|
1290
1315
|
width: "max-content",
|
|
1291
1316
|
padding: 32,
|
|
1292
|
-
color:
|
|
1293
|
-
background:
|
|
1317
|
+
color: Re,
|
|
1318
|
+
background: Ce
|
|
1294
1319
|
},
|
|
1295
1320
|
children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ v("strong", { children: e.name }),
|
|
1322
|
+
/* @__PURE__ */ v("p", { style: { color: G }, children: "The component is not registered." })
|
|
1298
1323
|
]
|
|
1299
1324
|
}
|
|
1300
1325
|
);
|
|
1301
|
-
const r =
|
|
1302
|
-
return /* @__PURE__ */
|
|
1326
|
+
const r = pn(t, o), n = ((a = r.row) == null ? void 0 : a[1]) ?? [void 0], s = ((u = r.column) == null ? void 0 : u[1]) ?? [void 0], l = t.component;
|
|
1327
|
+
return /* @__PURE__ */ A(
|
|
1303
1328
|
"section",
|
|
1304
1329
|
{
|
|
1305
1330
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1309,16 +1334,16 @@ function fn({
|
|
|
1309
1334
|
display: "inline-block",
|
|
1310
1335
|
width: "max-content",
|
|
1311
1336
|
padding: 32,
|
|
1312
|
-
color:
|
|
1313
|
-
background:
|
|
1337
|
+
color: Re,
|
|
1338
|
+
background: Ce,
|
|
1314
1339
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1315
1340
|
},
|
|
1316
1341
|
children: [
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
e.sourcePath ? /* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ A("header", { style: { marginBottom: 24 }, children: [
|
|
1343
|
+
/* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
|
|
1344
|
+
e.sourcePath ? /* @__PURE__ */ v("p", { style: { margin: "6px 0 0", color: G, fontSize: 12 }, children: e.sourcePath }) : null
|
|
1320
1345
|
] }),
|
|
1321
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ v(
|
|
1322
1347
|
"div",
|
|
1323
1348
|
{
|
|
1324
1349
|
style: {
|
|
@@ -1328,89 +1353,93 @@ function fn({
|
|
|
1328
1353
|
},
|
|
1329
1354
|
children: n.flatMap(
|
|
1330
1355
|
(w) => s.map((p) => {
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
r.
|
|
1356
|
+
var S, g;
|
|
1357
|
+
const h = hn(t, r, w, p), x = [
|
|
1358
|
+
r.row && w !== void 0 ? `${((S = t.propLabels) == null ? void 0 : S[r.row[0]]) ?? r.row[0]}=${String(w)}` : "",
|
|
1359
|
+
r.column && p !== void 0 ? `${((g = t.propLabels) == null ? void 0 : g[r.column[0]]) ?? r.column[0]}=${String(p)}` : ""
|
|
1334
1360
|
].filter(Boolean).join(" · ");
|
|
1335
|
-
return /* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ A(
|
|
1336
1362
|
"article",
|
|
1337
1363
|
{
|
|
1338
1364
|
style: {
|
|
1339
1365
|
width: "max-content",
|
|
1340
1366
|
padding: 16,
|
|
1341
|
-
border: `1px solid ${
|
|
1367
|
+
border: `1px solid ${ke}`,
|
|
1342
1368
|
borderRadius: 10,
|
|
1343
|
-
background:
|
|
1369
|
+
background: Ee
|
|
1344
1370
|
},
|
|
1345
1371
|
children: [
|
|
1346
|
-
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1372
|
+
x ? /* @__PURE__ */ v("div", { style: { marginBottom: 12, color: G, fontSize: 11 }, children: x }) : null,
|
|
1373
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Ge(
|
|
1374
|
+
l,
|
|
1349
1375
|
h,
|
|
1350
1376
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1351
1377
|
) })
|
|
1352
1378
|
]
|
|
1353
1379
|
},
|
|
1354
|
-
`${w ?? "default"}:${p ?? "default"}`
|
|
1380
|
+
`${typeof w}:${String(w ?? "default")}:${typeof p}:${String(p ?? "default")}`
|
|
1355
1381
|
);
|
|
1356
1382
|
})
|
|
1357
1383
|
)
|
|
1358
1384
|
}
|
|
1359
1385
|
),
|
|
1360
|
-
r.additional.map(([w, p]) =>
|
|
1361
|
-
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
"
|
|
1364
|
-
{
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1386
|
+
r.additional.map(([w, p]) => {
|
|
1387
|
+
var h;
|
|
1388
|
+
return /* @__PURE__ */ A("section", { style: { marginTop: 20 }, children: [
|
|
1389
|
+
/* @__PURE__ */ v("h2", { style: { margin: "0 0 10px", color: G, fontSize: 12 }, children: ((h = t.propLabels) == null ? void 0 : h[w]) ?? w }),
|
|
1390
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: p.map((x) => /* @__PURE__ */ A(
|
|
1391
|
+
"article",
|
|
1392
|
+
{
|
|
1393
|
+
style: {
|
|
1394
|
+
padding: 16,
|
|
1395
|
+
border: `1px solid ${ke}`,
|
|
1396
|
+
borderRadius: 10,
|
|
1397
|
+
background: Ee
|
|
1398
|
+
},
|
|
1399
|
+
children: [
|
|
1400
|
+
/* @__PURE__ */ v("div", { style: { marginBottom: 12, color: G, fontSize: 11 }, children: String(x) }),
|
|
1401
|
+
Ge(
|
|
1402
|
+
l,
|
|
1403
|
+
{ ...t.defaultProps, [w]: x },
|
|
1404
|
+
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1405
|
+
)
|
|
1406
|
+
]
|
|
1370
1407
|
},
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
{ ...t.defaultProps, [w]: h },
|
|
1376
|
-
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1377
|
-
)
|
|
1378
|
-
]
|
|
1379
|
-
},
|
|
1380
|
-
h
|
|
1381
|
-
)) })
|
|
1382
|
-
] }, w))
|
|
1408
|
+
`${typeof x}:${String(x)}`
|
|
1409
|
+
)) })
|
|
1410
|
+
] }, w);
|
|
1411
|
+
})
|
|
1383
1412
|
]
|
|
1384
1413
|
}
|
|
1385
1414
|
);
|
|
1386
1415
|
}
|
|
1387
|
-
function
|
|
1388
|
-
|
|
1416
|
+
function Dn(e) {
|
|
1417
|
+
ct(e.items);
|
|
1389
1418
|
const t = {}, o = [], r = [], n = e.maxVariantCells ?? 60;
|
|
1390
1419
|
for (const s of e.items) {
|
|
1391
|
-
const
|
|
1420
|
+
const l = it(
|
|
1392
1421
|
e.kind,
|
|
1393
1422
|
s.id,
|
|
1394
1423
|
e.registryPrefix
|
|
1395
|
-
),
|
|
1396
|
-
|
|
1424
|
+
), a = e.registry[s.name], u = () => /* @__PURE__ */ v(
|
|
1425
|
+
gn,
|
|
1397
1426
|
{
|
|
1398
1427
|
item: s,
|
|
1399
|
-
entry:
|
|
1428
|
+
entry: a,
|
|
1400
1429
|
maxVariantCells: n
|
|
1401
1430
|
}
|
|
1402
1431
|
);
|
|
1403
|
-
t[
|
|
1432
|
+
t[l] = { component: u, children: "none" }, o.push({
|
|
1404
1433
|
id: s.id,
|
|
1405
1434
|
name: s.name,
|
|
1406
1435
|
section: s.section,
|
|
1407
|
-
componentName:
|
|
1436
|
+
componentName: l,
|
|
1408
1437
|
// The seed exists only long enough to mount the intrinsic max-content
|
|
1409
1438
|
// catalog root. The editor replaces it with actual rendered DOM bounds.
|
|
1410
1439
|
width: 1,
|
|
1411
1440
|
height: 1,
|
|
1412
1441
|
frameSizeMode: "content"
|
|
1413
|
-
}), r.push(
|
|
1442
|
+
}), r.push(at(s, s.id));
|
|
1414
1443
|
}
|
|
1415
1444
|
return {
|
|
1416
1445
|
registry: t,
|
|
@@ -1421,34 +1450,34 @@ function An(e) {
|
|
|
1421
1450
|
}
|
|
1422
1451
|
};
|
|
1423
1452
|
}
|
|
1424
|
-
const
|
|
1425
|
-
function
|
|
1426
|
-
return typeof e == "string" &&
|
|
1453
|
+
const Qe = /^[a-f0-9]{64}$/, yn = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, wn = /^p\d+$/;
|
|
1454
|
+
function Fe(e) {
|
|
1455
|
+
return typeof e == "string" && yn.test(e) ? e : void 0;
|
|
1427
1456
|
}
|
|
1428
|
-
function
|
|
1457
|
+
function Xe(e, t) {
|
|
1429
1458
|
const o = new URL(e, t);
|
|
1430
1459
|
return o.search = "", o.hash = "", o.pathname.endsWith("/") || (o.pathname = `${o.pathname}/`), o.href;
|
|
1431
1460
|
}
|
|
1432
|
-
function
|
|
1461
|
+
function Me(e) {
|
|
1433
1462
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1434
1463
|
const t = e;
|
|
1435
|
-
return typeof t.domStructureHash != "string" || !
|
|
1464
|
+
return typeof t.domStructureHash != "string" || !Qe.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !Qe.test(t.screenshotHash) ? null : {
|
|
1436
1465
|
domStructureHash: t.domStructureHash,
|
|
1437
1466
|
screenshotHash: t.screenshotHash,
|
|
1438
|
-
|
|
1467
|
+
...Fe(t.screenshotUrl) ? { screenshotUrl: Fe(t.screenshotUrl) } : {}
|
|
1439
1468
|
};
|
|
1440
1469
|
}
|
|
1441
|
-
function
|
|
1470
|
+
function Ye(e) {
|
|
1442
1471
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1443
1472
|
const t = e;
|
|
1444
1473
|
return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
|
|
1445
1474
|
}
|
|
1446
|
-
function
|
|
1475
|
+
function Sn(e) {
|
|
1447
1476
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1448
|
-
const t = e, o =
|
|
1477
|
+
const t = e, o = Ye(t.before), r = Ye(t.after);
|
|
1449
1478
|
if (!o || !r || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
|
|
1450
1479
|
return null;
|
|
1451
|
-
const n = t.heatmapUrl == null ? null :
|
|
1480
|
+
const n = t.heatmapUrl == null ? null : Fe(t.heatmapUrl) ?? null;
|
|
1452
1481
|
return {
|
|
1453
1482
|
before: o,
|
|
1454
1483
|
after: r,
|
|
@@ -1460,15 +1489,15 @@ function hn(e) {
|
|
|
1460
1489
|
heatmapUrl: n
|
|
1461
1490
|
};
|
|
1462
1491
|
}
|
|
1463
|
-
function
|
|
1492
|
+
function bn(e, t) {
|
|
1464
1493
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1465
1494
|
const o = e;
|
|
1466
1495
|
if (typeof o.id != "string" || !o.id) return null;
|
|
1467
|
-
const r =
|
|
1496
|
+
const r = Me(o), n = Me(o.before) ?? r;
|
|
1468
1497
|
if (!n) return null;
|
|
1469
|
-
const s =
|
|
1498
|
+
const s = Me(o.after);
|
|
1470
1499
|
if (t === "changed" && !s) return null;
|
|
1471
|
-
const
|
|
1500
|
+
const l = s ? Sn(o.pixelDiff) : null;
|
|
1472
1501
|
return {
|
|
1473
1502
|
id: o.id,
|
|
1474
1503
|
before: n,
|
|
@@ -1477,26 +1506,26 @@ function gn(e, t) {
|
|
|
1477
1506
|
domChanged: n.domStructureHash !== s.domStructureHash,
|
|
1478
1507
|
screenshotChanged: n.screenshotHash !== s.screenshotHash
|
|
1479
1508
|
} : {},
|
|
1480
|
-
...
|
|
1509
|
+
...l ? { pixelDiff: l } : {}
|
|
1481
1510
|
};
|
|
1482
1511
|
}
|
|
1483
|
-
function
|
|
1512
|
+
function vn(e, t = []) {
|
|
1484
1513
|
const o = new Set(t), r = o.size > 0, n = /* @__PURE__ */ new Set(), s = [
|
|
1485
|
-
...e.styles.map((
|
|
1486
|
-
...e.texts.map((
|
|
1487
|
-
...e.operations.map((
|
|
1514
|
+
...e.styles.map((l) => l.affectedFrames ?? []),
|
|
1515
|
+
...e.texts.map((l) => l.affectedFrames ?? []),
|
|
1516
|
+
...e.operations.map((l) => l.affectedFrames ?? [])
|
|
1488
1517
|
];
|
|
1489
|
-
for (const
|
|
1490
|
-
for (const
|
|
1491
|
-
if (r &&
|
|
1518
|
+
for (const l of s)
|
|
1519
|
+
for (const a of l) {
|
|
1520
|
+
if (r && wn.test(a.id) && !o.has(a.id))
|
|
1492
1521
|
throw new Error(
|
|
1493
|
-
`"Impact Screen"${
|
|
1522
|
+
`"Impact Screen"${a.name}"This internal editor ID (${a.id}) is used. A canonical screen ID is required.`
|
|
1494
1523
|
);
|
|
1495
|
-
!
|
|
1524
|
+
!a.id || r && !o.has(a.id) || n.add(a.id);
|
|
1496
1525
|
}
|
|
1497
1526
|
return [...n].sort();
|
|
1498
1527
|
}
|
|
1499
|
-
async function
|
|
1528
|
+
async function Ze(e, t, o) {
|
|
1500
1529
|
const r = await e(`${t.replace(/\/$/, "")}/capture`, {
|
|
1501
1530
|
method: "POST",
|
|
1502
1531
|
headers: { "content-type": "application/json" },
|
|
@@ -1508,63 +1537,63 @@ async function Qe(e, t, o) {
|
|
|
1508
1537
|
);
|
|
1509
1538
|
if (typeof n.baselineId != "string" || !n.baselineId)
|
|
1510
1539
|
throw new Error("Pygmalion visual QA response has no baselineId");
|
|
1511
|
-
const s = Array.isArray(n.frames) ? n.frames.map((p) =>
|
|
1540
|
+
const s = Array.isArray(n.frames) ? n.frames.map((p) => bn(p, o.phase)).filter((p) => p != null) : [], l = Array.isArray(n.failures) ? n.failures.map((p) => {
|
|
1512
1541
|
if (!p || typeof p != "object" || Array.isArray(p)) return null;
|
|
1513
1542
|
const h = p;
|
|
1514
1543
|
return typeof h.id == "string" && typeof h.error == "string" ? { id: h.id, error: h.error } : null;
|
|
1515
|
-
}).filter((p) => p != null) : [],
|
|
1544
|
+
}).filter((p) => p != null) : [], a = new Set(o.frameIds), w = new Set(s.map((p) => p.id)).size === s.length && s.every((p) => a.has(p.id)) && l.every((p) => a.has(p.id));
|
|
1516
1545
|
return {
|
|
1517
1546
|
phase: o.phase,
|
|
1518
1547
|
baselineId: n.baselineId,
|
|
1519
|
-
complete: n.complete !== !1 && w &&
|
|
1548
|
+
complete: n.complete !== !1 && w && l.length === 0 && s.length === o.frameIds.length,
|
|
1520
1549
|
frames: s,
|
|
1521
|
-
failures:
|
|
1550
|
+
failures: l
|
|
1522
1551
|
};
|
|
1523
1552
|
}
|
|
1524
|
-
const
|
|
1553
|
+
const Oe = {
|
|
1525
1554
|
mirror: "/__pygmalion-dev-control",
|
|
1526
1555
|
sessions: "/__pygmalion-design-session",
|
|
1527
1556
|
inspect: "/__pygmalion-inspect"
|
|
1528
|
-
},
|
|
1529
|
-
function
|
|
1557
|
+
}, In = "pygmalion.designSessionId", xn = "/__pygmalion-qa", Ie = /* @__PURE__ */ new Map();
|
|
1558
|
+
function et() {
|
|
1530
1559
|
var e;
|
|
1531
1560
|
return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1532
1561
|
}
|
|
1533
|
-
function
|
|
1562
|
+
function Pn(e, t) {
|
|
1534
1563
|
if (e) return e;
|
|
1535
|
-
const o =
|
|
1564
|
+
const o = Ie.get(t);
|
|
1536
1565
|
if (o) return o;
|
|
1537
1566
|
try {
|
|
1538
1567
|
const r = window.localStorage.getItem(t);
|
|
1539
1568
|
if (r)
|
|
1540
|
-
return
|
|
1541
|
-
const n =
|
|
1542
|
-
return window.localStorage.setItem(t, n),
|
|
1569
|
+
return Ie.set(t, r), r;
|
|
1570
|
+
const n = et();
|
|
1571
|
+
return window.localStorage.setItem(t, n), Ie.set(t, n), n;
|
|
1543
1572
|
} catch {
|
|
1544
|
-
const r =
|
|
1545
|
-
return
|
|
1573
|
+
const r = et();
|
|
1574
|
+
return Ie.set(t, r), r;
|
|
1546
1575
|
}
|
|
1547
1576
|
}
|
|
1548
|
-
async function
|
|
1577
|
+
async function ee(e) {
|
|
1549
1578
|
const t = await e.json();
|
|
1550
1579
|
if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
|
|
1551
1580
|
return t;
|
|
1552
1581
|
}
|
|
1553
|
-
function
|
|
1554
|
-
var
|
|
1582
|
+
function kn(e = {}) {
|
|
1583
|
+
var re, J, Z, W, c;
|
|
1555
1584
|
const {
|
|
1556
1585
|
sessionId: t,
|
|
1557
|
-
sessionStorageKey: o =
|
|
1586
|
+
sessionStorageKey: o = In,
|
|
1558
1587
|
autoStart: r = !0,
|
|
1559
1588
|
fetcher: n = fetch,
|
|
1560
1589
|
formatApplyMessage: s
|
|
1561
|
-
} = e,
|
|
1590
|
+
} = e, l = ((re = e.endpoints) == null ? void 0 : re.mirror) ?? Oe.mirror, a = ((J = e.endpoints) == null ? void 0 : J.sessions) ?? Oe.sessions, u = ((Z = e.endpoints) == null ? void 0 : Z.inspect) ?? Oe.inspect, w = e.visualQa != null, p = ((W = e.visualQa) == null ? void 0 : W.endpoint) ?? xn, h = JSON.stringify(((c = e.visualQa) == null ? void 0 : c.eligibleFrameIds) ?? []), x = ie(
|
|
1562
1591
|
() => JSON.parse(h),
|
|
1563
1592
|
[h]
|
|
1564
|
-
),
|
|
1565
|
-
() =>
|
|
1593
|
+
), S = ie(
|
|
1594
|
+
() => Pn(t, o),
|
|
1566
1595
|
[t, o]
|
|
1567
|
-
), [g,
|
|
1596
|
+
), [g, E] = fe({
|
|
1568
1597
|
state: "idle",
|
|
1569
1598
|
commit: null,
|
|
1570
1599
|
shortCommit: null,
|
|
@@ -1574,219 +1603,219 @@ function Mn(e = {}) {
|
|
|
1574
1603
|
warning: null,
|
|
1575
1604
|
error: null,
|
|
1576
1605
|
appOrigin: null
|
|
1577
|
-
}), [f,
|
|
1606
|
+
}), [f, R] = fe(null), [D, b] = fe(null), [M, te] = fe({
|
|
1578
1607
|
refs: [],
|
|
1579
1608
|
defaultRef: null,
|
|
1580
1609
|
worktreeRef: null
|
|
1581
|
-
}),
|
|
1582
|
-
async (
|
|
1583
|
-
if (
|
|
1584
|
-
}),
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1610
|
+
}), P = xe(null), C = xe(null), j = de(
|
|
1611
|
+
async (i = !0, d) => {
|
|
1612
|
+
if (d != null && P.current && await P.current.catch(() => {
|
|
1613
|
+
}), P.current) return P.current;
|
|
1614
|
+
const y = (async () => {
|
|
1615
|
+
E((I) => ({ ...I, state: "syncing", error: null }));
|
|
1587
1616
|
try {
|
|
1588
|
-
const
|
|
1589
|
-
let
|
|
1590
|
-
method:
|
|
1591
|
-
...
|
|
1617
|
+
const I = d != null;
|
|
1618
|
+
let m = await n(`${l}/${i || I ? "refresh" : "status"}`, {
|
|
1619
|
+
method: i || I ? "POST" : "GET",
|
|
1620
|
+
...I ? {
|
|
1592
1621
|
headers: { "content-type": "application/json" },
|
|
1593
|
-
body: JSON.stringify({ ref:
|
|
1622
|
+
body: JSON.stringify({ ref: d })
|
|
1594
1623
|
} : {}
|
|
1595
|
-
}),
|
|
1596
|
-
const
|
|
1597
|
-
for (; !
|
|
1598
|
-
await new Promise((
|
|
1599
|
-
if (
|
|
1600
|
-
throw new Error(
|
|
1601
|
-
const
|
|
1602
|
-
await n(`${
|
|
1624
|
+
}), N = await ee(m);
|
|
1625
|
+
const O = Date.now();
|
|
1626
|
+
for (; !i && N.state === "syncing" && Date.now() - O < 12e4; )
|
|
1627
|
+
await new Promise((q) => window.setTimeout(q, 500)), m = await n(`${l}/status`), N = await ee(m);
|
|
1628
|
+
if (N.state !== "ready" || !N.appOrigin || !N.commit)
|
|
1629
|
+
throw new Error(N.error ?? "Pygmalion could not prepare the source preview");
|
|
1630
|
+
const K = await ee(
|
|
1631
|
+
await n(`${a}/open`, {
|
|
1603
1632
|
method: "POST",
|
|
1604
1633
|
headers: { "content-type": "application/json" },
|
|
1605
|
-
body: JSON.stringify({ sessionId:
|
|
1634
|
+
body: JSON.stringify({ sessionId: S, baseDevSha: N.commit })
|
|
1606
1635
|
})
|
|
1607
1636
|
);
|
|
1608
|
-
if (!
|
|
1609
|
-
throw new Error(
|
|
1610
|
-
let
|
|
1611
|
-
if (
|
|
1612
|
-
const
|
|
1613
|
-
await n(`${
|
|
1637
|
+
if (!K.ok || !K.session)
|
|
1638
|
+
throw new Error(K.error ?? "Pygmalion could not open the design session");
|
|
1639
|
+
let F = K.session;
|
|
1640
|
+
if (F.branchName) {
|
|
1641
|
+
const q = await ee(
|
|
1642
|
+
await n(`${a}/check`, {
|
|
1614
1643
|
method: "POST",
|
|
1615
1644
|
headers: { "content-type": "application/json" },
|
|
1616
|
-
body: JSON.stringify({ sessionId:
|
|
1645
|
+
body: JSON.stringify({ sessionId: F.id })
|
|
1617
1646
|
})
|
|
1618
1647
|
);
|
|
1619
|
-
if (!
|
|
1620
|
-
throw new Error(
|
|
1621
|
-
|
|
1648
|
+
if (!q.ok || !q.session)
|
|
1649
|
+
throw new Error(q.error ?? "Pygmalion could not check the design session");
|
|
1650
|
+
F = q.session;
|
|
1622
1651
|
}
|
|
1623
|
-
|
|
1624
|
-
} catch (
|
|
1625
|
-
|
|
1626
|
-
...
|
|
1652
|
+
E(N), R(F), b(F.appOrigin ?? N.appOrigin);
|
|
1653
|
+
} catch (I) {
|
|
1654
|
+
E((m) => ({
|
|
1655
|
+
...m,
|
|
1627
1656
|
state: "error",
|
|
1628
|
-
error:
|
|
1657
|
+
error: I instanceof Error ? I.message : String(I)
|
|
1629
1658
|
}));
|
|
1630
1659
|
}
|
|
1631
1660
|
})();
|
|
1632
|
-
|
|
1661
|
+
P.current = y;
|
|
1633
1662
|
try {
|
|
1634
|
-
await
|
|
1663
|
+
await y;
|
|
1635
1664
|
} finally {
|
|
1636
|
-
|
|
1665
|
+
P.current === y && (P.current = null);
|
|
1637
1666
|
}
|
|
1638
1667
|
},
|
|
1639
|
-
[n,
|
|
1640
|
-
),
|
|
1668
|
+
[n, l, a, S]
|
|
1669
|
+
), H = de(async () => {
|
|
1641
1670
|
try {
|
|
1642
|
-
const
|
|
1643
|
-
await n(`${
|
|
1644
|
-
),
|
|
1645
|
-
refs:
|
|
1646
|
-
defaultRef:
|
|
1647
|
-
worktreeRef:
|
|
1671
|
+
const i = await ee(
|
|
1672
|
+
await n(`${l}/refs`)
|
|
1673
|
+
), d = {
|
|
1674
|
+
refs: i.refs ?? [],
|
|
1675
|
+
defaultRef: i.defaultRef ?? null,
|
|
1676
|
+
worktreeRef: i.worktreeRef ?? null
|
|
1648
1677
|
};
|
|
1649
|
-
return
|
|
1678
|
+
return te(d), d;
|
|
1650
1679
|
} catch {
|
|
1651
|
-
return
|
|
1680
|
+
return M;
|
|
1652
1681
|
}
|
|
1653
|
-
}, [n,
|
|
1654
|
-
async (
|
|
1655
|
-
if (f != null && f.branchName && !(
|
|
1682
|
+
}, [n, l, M]), Q = de(
|
|
1683
|
+
async (i, d) => {
|
|
1684
|
+
if (f != null && f.branchName && !(d != null && d.discardEdits))
|
|
1656
1685
|
throw new Error(
|
|
1657
1686
|
"This design session has unapplied edits against the current source. Apply or revert them, or pass discardEdits to switch anyway."
|
|
1658
1687
|
);
|
|
1659
|
-
await
|
|
1688
|
+
await j(!0, i), await H();
|
|
1660
1689
|
},
|
|
1661
|
-
[
|
|
1662
|
-
),
|
|
1663
|
-
async (
|
|
1664
|
-
var
|
|
1690
|
+
[H, j, f == null ? void 0 : f.branchName]
|
|
1691
|
+
), pe = de(
|
|
1692
|
+
async (i) => {
|
|
1693
|
+
var N;
|
|
1665
1694
|
if (!f) throw new Error("Pygmalion design session is not ready");
|
|
1666
|
-
const
|
|
1667
|
-
if (
|
|
1695
|
+
const d = C.current;
|
|
1696
|
+
if (d && (d.sessionId !== f.id || d.baseDevSha !== f.baseDevSha || d.revision !== f.revision || d.fingerprint !== JSON.stringify(i)))
|
|
1668
1697
|
throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
|
|
1669
|
-
const
|
|
1670
|
-
await n(`${
|
|
1698
|
+
const y = await ee(
|
|
1699
|
+
await n(`${a}/apply-visual`, {
|
|
1671
1700
|
method: "POST",
|
|
1672
1701
|
headers: { "content-type": "application/json" },
|
|
1673
1702
|
body: JSON.stringify({
|
|
1674
1703
|
sessionId: f.id,
|
|
1675
1704
|
baseDevSha: f.baseDevSha,
|
|
1676
1705
|
expectedRevision: f.revision,
|
|
1677
|
-
...
|
|
1678
|
-
changes:
|
|
1706
|
+
...d ? { previewRevision: d.revision } : {},
|
|
1707
|
+
changes: i
|
|
1679
1708
|
})
|
|
1680
1709
|
})
|
|
1681
1710
|
);
|
|
1682
|
-
if (!
|
|
1683
|
-
throw new Error(
|
|
1684
|
-
|
|
1685
|
-
const
|
|
1686
|
-
let
|
|
1687
|
-
if (
|
|
1711
|
+
if (!y.ok || !y.session)
|
|
1712
|
+
throw new Error(y.error ?? "Pygmalion could not apply the visual changes");
|
|
1713
|
+
R(y.session), y.session.appOrigin && b(y.session.appOrigin);
|
|
1714
|
+
const I = y.applied ?? i.styles.length + i.texts.length + i.operations.length;
|
|
1715
|
+
let m;
|
|
1716
|
+
if (d != null && d.qaBaselineId && ((N = d.qaFrameIds) != null && N.length) && y.session.appOrigin)
|
|
1688
1717
|
try {
|
|
1689
|
-
|
|
1718
|
+
m = await Ze(n, p, {
|
|
1690
1719
|
phase: "changed",
|
|
1691
|
-
baselineId:
|
|
1692
|
-
basePath:
|
|
1693
|
-
frameIds:
|
|
1720
|
+
baselineId: d.qaBaselineId,
|
|
1721
|
+
basePath: Xe(y.session.appOrigin, window.location.origin),
|
|
1722
|
+
frameIds: d.qaFrameIds
|
|
1694
1723
|
});
|
|
1695
|
-
} catch (
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1724
|
+
} catch (O) {
|
|
1725
|
+
const K = O instanceof Error ? O.message : String(O);
|
|
1726
|
+
m = {
|
|
1698
1727
|
phase: "changed",
|
|
1699
|
-
baselineId:
|
|
1728
|
+
baselineId: d.qaBaselineId,
|
|
1700
1729
|
complete: !1,
|
|
1701
1730
|
frames: [],
|
|
1702
|
-
failures:
|
|
1731
|
+
failures: d.qaFrameIds.map((F) => ({ id: F, error: K }))
|
|
1703
1732
|
};
|
|
1704
1733
|
}
|
|
1705
|
-
return
|
|
1706
|
-
applied:
|
|
1707
|
-
branch:
|
|
1708
|
-
integration:
|
|
1709
|
-
message: s == null ? void 0 : s(
|
|
1710
|
-
...
|
|
1734
|
+
return C.current = null, {
|
|
1735
|
+
applied: I,
|
|
1736
|
+
branch: y.session.branchName ?? void 0,
|
|
1737
|
+
integration: y.session.integration.state,
|
|
1738
|
+
message: s == null ? void 0 : s(y.session, I),
|
|
1739
|
+
...m ? { qa: m } : {}
|
|
1711
1740
|
};
|
|
1712
1741
|
},
|
|
1713
|
-
[n, s, p, f,
|
|
1714
|
-
),
|
|
1715
|
-
async (
|
|
1716
|
-
var
|
|
1742
|
+
[n, s, p, f, a]
|
|
1743
|
+
), ue = de(
|
|
1744
|
+
async (i) => {
|
|
1745
|
+
var N;
|
|
1717
1746
|
if (!f) throw new Error("Pygmalion design session is not ready");
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1720
|
-
await n(`${
|
|
1747
|
+
C.current = null;
|
|
1748
|
+
const d = await ee(
|
|
1749
|
+
await n(`${a}/preview-visual`, {
|
|
1721
1750
|
method: "POST",
|
|
1722
1751
|
headers: { "content-type": "application/json" },
|
|
1723
1752
|
body: JSON.stringify({
|
|
1724
1753
|
sessionId: f.id,
|
|
1725
1754
|
baseDevSha: f.baseDevSha,
|
|
1726
1755
|
expectedRevision: f.revision,
|
|
1727
|
-
changes:
|
|
1756
|
+
changes: i
|
|
1728
1757
|
})
|
|
1729
1758
|
})
|
|
1730
1759
|
);
|
|
1731
|
-
if (!
|
|
1732
|
-
throw new Error(
|
|
1733
|
-
const
|
|
1734
|
-
let
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
if (!
|
|
1760
|
+
if (!d.ok || !Number.isSafeInteger(d.revision))
|
|
1761
|
+
throw new Error(d.error ?? "Pygmalion could not preview the visual changes");
|
|
1762
|
+
const y = w ? vn(i, x) : [];
|
|
1763
|
+
let I;
|
|
1764
|
+
const m = f.appOrigin ?? g.appOrigin;
|
|
1765
|
+
if (y.length > 0) {
|
|
1766
|
+
if (!m)
|
|
1738
1767
|
throw new Error("Impact screen QA baseline preview not ready");
|
|
1739
|
-
if (
|
|
1768
|
+
if (I = await Ze(n, p, {
|
|
1740
1769
|
phase: "baseline",
|
|
1741
|
-
basePath:
|
|
1742
|
-
frameIds:
|
|
1743
|
-
}), !
|
|
1770
|
+
basePath: Xe(m, window.location.origin),
|
|
1771
|
+
frameIds: y
|
|
1772
|
+
}), !I.complete)
|
|
1744
1773
|
throw new Error(
|
|
1745
|
-
((
|
|
1774
|
+
((N = I.failures[0]) == null ? void 0 : N.error) ?? `Failed to capture ${y.length - I.frames.length} affected frames`
|
|
1746
1775
|
);
|
|
1747
1776
|
}
|
|
1748
|
-
return
|
|
1777
|
+
return C.current = {
|
|
1749
1778
|
sessionId: f.id,
|
|
1750
1779
|
baseDevSha: f.baseDevSha,
|
|
1751
|
-
revision:
|
|
1752
|
-
fingerprint: JSON.stringify(
|
|
1753
|
-
...
|
|
1780
|
+
revision: d.revision,
|
|
1781
|
+
fingerprint: JSON.stringify(i),
|
|
1782
|
+
...I ? { qaBaselineId: I.baselineId, qaFrameIds: y } : {}
|
|
1754
1783
|
}, {
|
|
1755
|
-
revision:
|
|
1756
|
-
files: Array.isArray(
|
|
1757
|
-
affectedFiles: Array.isArray(
|
|
1758
|
-
...
|
|
1784
|
+
revision: d.revision,
|
|
1785
|
+
files: Array.isArray(d.files) ? d.files : [],
|
|
1786
|
+
affectedFiles: Array.isArray(d.affectedFiles) ? d.affectedFiles : [],
|
|
1787
|
+
...I ? { qa: I } : {}
|
|
1759
1788
|
};
|
|
1760
1789
|
},
|
|
1761
1790
|
[
|
|
1762
1791
|
n,
|
|
1763
1792
|
g.appOrigin,
|
|
1764
|
-
|
|
1793
|
+
x,
|
|
1765
1794
|
p,
|
|
1766
1795
|
f,
|
|
1767
|
-
|
|
1796
|
+
a,
|
|
1768
1797
|
w
|
|
1769
1798
|
]
|
|
1770
|
-
),
|
|
1771
|
-
async (
|
|
1772
|
-
if (
|
|
1773
|
-
const
|
|
1799
|
+
), V = de(
|
|
1800
|
+
async (i) => {
|
|
1801
|
+
if (i.length === 0) return { files: [] };
|
|
1802
|
+
const d = await ee(
|
|
1774
1803
|
await n(`${u}/impact`, {
|
|
1775
1804
|
method: "POST",
|
|
1776
1805
|
headers: { "content-type": "application/json" },
|
|
1777
|
-
body: JSON.stringify({ componentFiles:
|
|
1806
|
+
body: JSON.stringify({ componentFiles: i })
|
|
1778
1807
|
})
|
|
1779
1808
|
);
|
|
1780
|
-
if (
|
|
1781
|
-
throw new Error(
|
|
1782
|
-
return { files: Array.isArray(
|
|
1809
|
+
if (d.error || d.ok === !1)
|
|
1810
|
+
throw new Error(d.error ?? "Pygmalion could not calculate source impact");
|
|
1811
|
+
return { files: Array.isArray(d.files) ? d.files : [] };
|
|
1783
1812
|
},
|
|
1784
1813
|
[n, u]
|
|
1785
|
-
),
|
|
1814
|
+
), ae = de(async () => {
|
|
1786
1815
|
if (!(f != null && f.canRevert) || !f.headSha)
|
|
1787
1816
|
throw new Error("There are no reversible changes applied");
|
|
1788
|
-
const
|
|
1789
|
-
await n(`${
|
|
1817
|
+
const i = await ee(
|
|
1818
|
+
await n(`${a}/revert-visual`, {
|
|
1790
1819
|
method: "POST",
|
|
1791
1820
|
headers: { "content-type": "application/json" },
|
|
1792
1821
|
body: JSON.stringify({
|
|
@@ -1797,88 +1826,88 @@ function Mn(e = {}) {
|
|
|
1797
1826
|
})
|
|
1798
1827
|
})
|
|
1799
1828
|
);
|
|
1800
|
-
if (!
|
|
1801
|
-
throw new Error(
|
|
1802
|
-
return
|
|
1829
|
+
if (!i.ok || i.reverted !== !0 || !i.operation || i.operation.kind !== "visual-revert" || !i.session)
|
|
1830
|
+
throw new Error(i.error ?? "Pygmalion could not revert the last visual change");
|
|
1831
|
+
return C.current = null, R(i.session), i.session.appOrigin && b(i.session.appOrigin), {
|
|
1803
1832
|
reverted: !0,
|
|
1804
|
-
operation:
|
|
1805
|
-
session:
|
|
1833
|
+
operation: i.operation,
|
|
1834
|
+
session: i.session
|
|
1806
1835
|
};
|
|
1807
|
-
}, [n, f,
|
|
1808
|
-
|
|
1809
|
-
r &&
|
|
1810
|
-
}, [r,
|
|
1811
|
-
r &&
|
|
1836
|
+
}, [n, f, a]);
|
|
1837
|
+
me(() => {
|
|
1838
|
+
r && j(!1);
|
|
1839
|
+
}, [r, j]), me(() => {
|
|
1840
|
+
r && H();
|
|
1812
1841
|
}, [r]);
|
|
1813
|
-
const
|
|
1842
|
+
const ne = (f == null ? void 0 : f.appOrigin) ?? g.appOrigin ?? D, Y = (f == null ? void 0 : f.headSha) ?? (f == null ? void 0 : f.baseDevSha) ?? g.commit ?? "pending";
|
|
1814
1843
|
return {
|
|
1815
1844
|
mirror: g,
|
|
1816
1845
|
session: f,
|
|
1817
1846
|
ready: D != null,
|
|
1818
|
-
appOrigin:
|
|
1819
|
-
previewRevision: `${
|
|
1820
|
-
previewSourceRevision:
|
|
1821
|
-
refresh:
|
|
1822
|
-
switchSource:
|
|
1823
|
-
sourceRefs:
|
|
1824
|
-
loadSourceRefs:
|
|
1825
|
-
previewVisual:
|
|
1826
|
-
inspectImpact:
|
|
1827
|
-
applyVisual:
|
|
1828
|
-
revertLastVisual:
|
|
1847
|
+
appOrigin: ne,
|
|
1848
|
+
previewRevision: `${Y}:${(f == null ? void 0 : f.revision) ?? 0}`,
|
|
1849
|
+
previewSourceRevision: Y,
|
|
1850
|
+
refresh: j,
|
|
1851
|
+
switchSource: Q,
|
|
1852
|
+
sourceRefs: M,
|
|
1853
|
+
loadSourceRefs: H,
|
|
1854
|
+
previewVisual: ue,
|
|
1855
|
+
inspectImpact: V,
|
|
1856
|
+
applyVisual: pe,
|
|
1857
|
+
revertLastVisual: ae
|
|
1829
1858
|
};
|
|
1830
1859
|
}
|
|
1831
|
-
function
|
|
1860
|
+
function Fn({
|
|
1832
1861
|
value: e,
|
|
1833
1862
|
currentCommit: t = null,
|
|
1834
1863
|
refs: o,
|
|
1835
1864
|
onChange: r,
|
|
1836
1865
|
busy: n = !1,
|
|
1837
1866
|
defaultRef: s = null,
|
|
1838
|
-
worktreeRef:
|
|
1839
|
-
label:
|
|
1867
|
+
worktreeRef: l = null,
|
|
1868
|
+
label: a = "Source revision",
|
|
1840
1869
|
refreshLabel: u = "Refresh current revision",
|
|
1841
1870
|
children: w,
|
|
1842
1871
|
className: p
|
|
1843
1872
|
}) {
|
|
1844
|
-
const h =
|
|
1873
|
+
const h = ie(
|
|
1845
1874
|
() => ({
|
|
1846
|
-
local: o.filter((
|
|
1847
|
-
remote: o.filter((
|
|
1875
|
+
local: o.filter((b) => b.kind === "local"),
|
|
1876
|
+
remote: o.filter((b) => b.kind === "remote")
|
|
1848
1877
|
}),
|
|
1849
1878
|
[o]
|
|
1850
|
-
),
|
|
1851
|
-
const
|
|
1852
|
-
return s &&
|
|
1853
|
-
}, [s, o,
|
|
1854
|
-
() => o.find((
|
|
1855
|
-
[o,
|
|
1856
|
-
),
|
|
1857
|
-
return /* @__PURE__ */
|
|
1879
|
+
), x = ie(() => {
|
|
1880
|
+
const b = new Set(o.map((M) => M.name));
|
|
1881
|
+
return s && b.add(s), l && b.add(l), b;
|
|
1882
|
+
}, [s, o, l]), S = e ?? s ?? "", g = ie(
|
|
1883
|
+
() => o.find((b) => b.name === S) ?? null,
|
|
1884
|
+
[o, S]
|
|
1885
|
+
), E = (t == null ? void 0 : t.toLowerCase()) ?? null, f = (g == null ? void 0 : g.commit.toLowerCase()) ?? null, R = !!(E && f && E !== f && !E.startsWith(f) && !f.startsWith(E)), D = (t == null ? void 0 : t.slice(0, 8)) ?? null;
|
|
1886
|
+
return /* @__PURE__ */ A(
|
|
1858
1887
|
"span",
|
|
1859
1888
|
{
|
|
1860
1889
|
className: p,
|
|
1861
1890
|
"data-pygmalion-source-ref": "",
|
|
1862
1891
|
"data-busy": n ? "" : void 0,
|
|
1863
|
-
"data-update-available":
|
|
1864
|
-
"data-latest-commit":
|
|
1892
|
+
"data-update-available": R ? "" : void 0,
|
|
1893
|
+
"data-latest-commit": R ? g == null ? void 0 : g.commit : void 0,
|
|
1865
1894
|
style: { position: "relative", display: "inline-flex", alignItems: "center" },
|
|
1866
1895
|
children: [
|
|
1867
|
-
w ?? /* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
1896
|
+
w ?? /* @__PURE__ */ v("span", { "data-pygmalion-source-ref-value": "", children: S || a }),
|
|
1897
|
+
/* @__PURE__ */ A(
|
|
1869
1898
|
"select",
|
|
1870
1899
|
{
|
|
1871
|
-
value:
|
|
1900
|
+
value: S,
|
|
1872
1901
|
disabled: n,
|
|
1873
|
-
"aria-label":
|
|
1902
|
+
"aria-label": a,
|
|
1874
1903
|
"data-pygmalion-source-ref-select": "",
|
|
1875
|
-
onChange: (
|
|
1876
|
-
const
|
|
1877
|
-
if (
|
|
1878
|
-
|
|
1904
|
+
onChange: (b) => {
|
|
1905
|
+
const M = b.target.value;
|
|
1906
|
+
if (!M) {
|
|
1907
|
+
S && r(S);
|
|
1879
1908
|
return;
|
|
1880
1909
|
}
|
|
1881
|
-
|
|
1910
|
+
M && M !== S && r(M);
|
|
1882
1911
|
},
|
|
1883
1912
|
style: {
|
|
1884
1913
|
position: "absolute",
|
|
@@ -1894,27 +1923,27 @@ function $n({
|
|
|
1894
1923
|
margin: 0
|
|
1895
1924
|
},
|
|
1896
1925
|
children: [
|
|
1897
|
-
|
|
1926
|
+
S ? /* @__PURE__ */ A("option", { value: "", children: [
|
|
1898
1927
|
u,
|
|
1899
1928
|
" · ",
|
|
1900
|
-
|
|
1901
|
-
|
|
1929
|
+
S,
|
|
1930
|
+
R ? ` · ${D ?? "unknown"} → ${(g == null ? void 0 : g.commit) ?? "latest"}` : ""
|
|
1902
1931
|
] }) : null,
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1932
|
+
S && !x.has(S) ? /* @__PURE__ */ v("option", { value: S, children: S }) : null,
|
|
1933
|
+
l ? /* @__PURE__ */ A("option", { value: l, children: [
|
|
1934
|
+
l,
|
|
1906
1935
|
" · uncommitted work"
|
|
1907
1936
|
] }) : null,
|
|
1908
|
-
h.local.length > 0 ? /* @__PURE__ */
|
|
1909
|
-
|
|
1937
|
+
h.local.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "local", children: h.local.map((b) => /* @__PURE__ */ A("option", { value: b.name, children: [
|
|
1938
|
+
b.name,
|
|
1910
1939
|
" · ",
|
|
1911
|
-
|
|
1912
|
-
] },
|
|
1913
|
-
h.remote.length > 0 ? /* @__PURE__ */
|
|
1914
|
-
|
|
1940
|
+
b.commit
|
|
1941
|
+
] }, b.fullName)) }) : null,
|
|
1942
|
+
h.remote.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "remote", children: h.remote.map((b) => /* @__PURE__ */ A("option", { value: b.name, children: [
|
|
1943
|
+
b.name,
|
|
1915
1944
|
" · ",
|
|
1916
|
-
|
|
1917
|
-
] },
|
|
1945
|
+
b.commit
|
|
1946
|
+
] }, b.fullName)) }) : null
|
|
1918
1947
|
]
|
|
1919
1948
|
}
|
|
1920
1949
|
)
|
|
@@ -1922,448 +1951,446 @@ function $n({
|
|
|
1922
1951
|
}
|
|
1923
1952
|
);
|
|
1924
1953
|
}
|
|
1925
|
-
const
|
|
1954
|
+
const Tn = {
|
|
1926
1955
|
editor: X,
|
|
1927
|
-
getObserverTree:
|
|
1928
|
-
isObservableProp:
|
|
1956
|
+
getObserverTree: dt,
|
|
1957
|
+
isObservableProp: lt
|
|
1929
1958
|
};
|
|
1930
|
-
function
|
|
1959
|
+
function zn(e) {
|
|
1931
1960
|
X.navigateToPageByName(e);
|
|
1932
1961
|
}
|
|
1933
|
-
function
|
|
1962
|
+
function jn() {
|
|
1934
1963
|
X.openPreview();
|
|
1935
1964
|
}
|
|
1936
|
-
function
|
|
1937
|
-
const e =
|
|
1938
|
-
return e &&
|
|
1965
|
+
function _n() {
|
|
1966
|
+
const e = He.entries.length > 0;
|
|
1967
|
+
return e && He.discardPending(), X.resetCurrentEdits() || e;
|
|
1939
1968
|
}
|
|
1940
|
-
function
|
|
1969
|
+
function Bn({
|
|
1941
1970
|
registry: e,
|
|
1942
1971
|
tokens: t,
|
|
1943
1972
|
initialPages: o,
|
|
1944
1973
|
initialCanvas: r,
|
|
1945
1974
|
componentConnections: n,
|
|
1946
1975
|
viewportPresets: s,
|
|
1947
|
-
previewEnvironmentControls:
|
|
1948
|
-
designImport:
|
|
1976
|
+
previewEnvironmentControls: l,
|
|
1977
|
+
designImport: a,
|
|
1949
1978
|
onTokensChange: u,
|
|
1950
1979
|
appOrigin: w,
|
|
1951
1980
|
previewRevision: p,
|
|
1952
1981
|
previewCacheNamespace: h,
|
|
1953
|
-
previewArtifacts:
|
|
1954
|
-
previewArtifactEndpoint:
|
|
1982
|
+
previewArtifacts: x,
|
|
1983
|
+
previewArtifactEndpoint: S,
|
|
1955
1984
|
previewConcurrency: g,
|
|
1956
|
-
previewOpen:
|
|
1985
|
+
previewOpen: E,
|
|
1957
1986
|
onPreviewOpenChange: f,
|
|
1958
|
-
flowCanvas:
|
|
1987
|
+
flowCanvas: R,
|
|
1959
1988
|
onApply: D,
|
|
1960
|
-
onDesignChange:
|
|
1961
|
-
onInspectApply:
|
|
1962
|
-
onInspectPreview:
|
|
1963
|
-
onInspectImpact:
|
|
1964
|
-
|
|
1965
|
-
|
|
1989
|
+
onDesignChange: b,
|
|
1990
|
+
onInspectApply: M,
|
|
1991
|
+
onInspectPreview: te,
|
|
1992
|
+
onInspectImpact: P,
|
|
1993
|
+
storyboard: C,
|
|
1994
|
+
storyboardDiscovery: j = !0,
|
|
1995
|
+
storyboardDiscoveryEndpoint: H = ut
|
|
1966
1996
|
}) {
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1997
|
+
const Q = ie(
|
|
1998
|
+
() => ({}),
|
|
1999
|
+
[
|
|
2000
|
+
a,
|
|
2001
|
+
o,
|
|
2002
|
+
j,
|
|
2003
|
+
H,
|
|
2004
|
+
C
|
|
2005
|
+
]
|
|
2006
|
+
), [pe, ue] = fe(null), V = pe === Q, [ae, ne] = fe();
|
|
2007
|
+
a && (a.assertComplete(), ft(a));
|
|
2008
|
+
const Y = e ?? (a == null ? void 0 : a.getRegistry()), re = t ?? (a == null ? void 0 : a.getTokens()), J = o ?? (a == null ? void 0 : a.getInitialPages());
|
|
2009
|
+
Y && mt(Y), pt(n ?? []), re && ht(re), s && gt(s), Tt(u ?? null), yt(h), wt(
|
|
2010
|
+
!!(S != null && S.trim())
|
|
1972
2011
|
);
|
|
1973
|
-
const
|
|
1974
|
-
() => (
|
|
1975
|
-
(
|
|
2012
|
+
const Z = ae ?? x, W = ie(
|
|
2013
|
+
() => (J ?? []).flatMap(
|
|
2014
|
+
(m) => m.route && m.importPageId ? [
|
|
1976
2015
|
{
|
|
1977
|
-
canonicalId:
|
|
1978
|
-
route:
|
|
1979
|
-
width:
|
|
1980
|
-
height:
|
|
1981
|
-
environment:
|
|
1982
|
-
preset:
|
|
1983
|
-
interactions:
|
|
1984
|
-
assertions:
|
|
2016
|
+
canonicalId: m.importPageId,
|
|
2017
|
+
route: m.route,
|
|
2018
|
+
width: m.width,
|
|
2019
|
+
height: m.height,
|
|
2020
|
+
environment: m.environment,
|
|
2021
|
+
preset: m.preset,
|
|
2022
|
+
interactions: m.interactions,
|
|
2023
|
+
assertions: m.assertions
|
|
1985
2024
|
}
|
|
1986
2025
|
] : []
|
|
1987
2026
|
),
|
|
1988
|
-
[
|
|
1989
|
-
),
|
|
1990
|
-
() =>
|
|
1991
|
-
id:
|
|
1992
|
-
fingerprint:
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2027
|
+
[J]
|
|
2028
|
+
), c = p ?? kt(), i = w ?? qe(), d = xe([]), y = xe([]), I = ie(
|
|
2029
|
+
() => W.map((m) => ({
|
|
2030
|
+
id: m.canonicalId,
|
|
2031
|
+
fingerprint: St(
|
|
2032
|
+
m,
|
|
2033
|
+
c,
|
|
2034
|
+
ve()
|
|
1996
2035
|
)
|
|
1997
2036
|
})),
|
|
1998
|
-
[
|
|
2037
|
+
[W, c, V]
|
|
1999
2038
|
);
|
|
2000
|
-
return
|
|
2001
|
-
(
|
|
2039
|
+
return d.current = I, y.current = W.map(
|
|
2040
|
+
(m) => bt({
|
|
2002
2041
|
namespace: h ?? "",
|
|
2003
|
-
previewRevision:
|
|
2004
|
-
route:
|
|
2005
|
-
width:
|
|
2006
|
-
height:
|
|
2007
|
-
environment:
|
|
2008
|
-
|
|
2009
|
-
|
|
2042
|
+
previewRevision: c,
|
|
2043
|
+
route: m.route,
|
|
2044
|
+
width: m.width ?? 390,
|
|
2045
|
+
height: m.height ?? 600,
|
|
2046
|
+
environment: tt(
|
|
2047
|
+
ve(),
|
|
2048
|
+
m.environment
|
|
2010
2049
|
),
|
|
2011
|
-
preset:
|
|
2012
|
-
interactions:
|
|
2013
|
-
assertions:
|
|
2050
|
+
preset: m.preset,
|
|
2051
|
+
interactions: m.interactions,
|
|
2052
|
+
assertions: m.assertions
|
|
2014
2053
|
})
|
|
2015
|
-
), g != null &&
|
|
2016
|
-
w != null &&
|
|
2017
|
-
}, [w,
|
|
2018
|
-
!
|
|
2054
|
+
), g != null && vt(g), zt(f ?? null), R != null && It(R), jt(D ?? null), _t(M ?? null), xt(te ?? null), Bt(P ?? null), J && X.initPagesFromComponents(J, { initialCanvas: r }), Le(() => {
|
|
2055
|
+
w != null && Pt(w), p != null && Et(p), Ct(l ?? []);
|
|
2056
|
+
}, [w, l, p]), Le(() => {
|
|
2057
|
+
!Z || !J || !V || je(Z, {
|
|
2019
2058
|
namespace: h ?? "",
|
|
2020
|
-
previewRevision:
|
|
2021
|
-
appOrigin:
|
|
2022
|
-
baselineEnvironment:
|
|
2023
|
-
allowStaleIdentity: !!
|
|
2024
|
-
allowMatchingFrameIdentity:
|
|
2025
|
-
pages:
|
|
2026
|
-
var
|
|
2059
|
+
previewRevision: c,
|
|
2060
|
+
appOrigin: i,
|
|
2061
|
+
baselineEnvironment: ve(),
|
|
2062
|
+
allowStaleIdentity: !!S,
|
|
2063
|
+
allowMatchingFrameIdentity: ae != null,
|
|
2064
|
+
pages: W.map((m, N) => {
|
|
2065
|
+
var O;
|
|
2027
2066
|
return {
|
|
2028
|
-
...
|
|
2029
|
-
fingerprint: (
|
|
2067
|
+
...m,
|
|
2068
|
+
fingerprint: (O = I[N]) == null ? void 0 : O.fingerprint
|
|
2030
2069
|
};
|
|
2031
2070
|
})
|
|
2032
2071
|
});
|
|
2033
2072
|
}, [
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2073
|
+
Z,
|
|
2074
|
+
I,
|
|
2075
|
+
W,
|
|
2076
|
+
S,
|
|
2038
2077
|
h,
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
]),
|
|
2045
|
-
|
|
2046
|
-
const
|
|
2078
|
+
ae,
|
|
2079
|
+
i,
|
|
2080
|
+
J,
|
|
2081
|
+
c,
|
|
2082
|
+
V
|
|
2083
|
+
]), me(() => {
|
|
2084
|
+
Ke(b ?? null);
|
|
2085
|
+
const m = Rt(X);
|
|
2047
2086
|
return () => {
|
|
2048
|
-
|
|
2087
|
+
m(), Ke(null);
|
|
2049
2088
|
};
|
|
2050
|
-
}, [
|
|
2051
|
-
if (
|
|
2089
|
+
}, [b]), me(() => {
|
|
2090
|
+
if (ne(void 0), !V || !S || !(h != null && h.trim()) || !(p != null && p.trim()))
|
|
2052
2091
|
return;
|
|
2053
|
-
const
|
|
2054
|
-
endpoint:
|
|
2092
|
+
const m = new AbortController(), N = Nt({
|
|
2093
|
+
endpoint: S,
|
|
2055
2094
|
captureBaseUrl: w
|
|
2056
|
-
}),
|
|
2057
|
-
|
|
2095
|
+
}), O = $t(p), K = (T) => {
|
|
2096
|
+
je(T, {
|
|
2058
2097
|
namespace: h,
|
|
2059
2098
|
previewRevision: p,
|
|
2060
|
-
appOrigin:
|
|
2061
|
-
baselineEnvironment:
|
|
2099
|
+
appOrigin: qe(),
|
|
2100
|
+
baselineEnvironment: ve(),
|
|
2062
2101
|
allowStaleIdentity: !0,
|
|
2063
2102
|
allowMatchingFrameIdentity: !0,
|
|
2064
|
-
pages:
|
|
2065
|
-
var
|
|
2103
|
+
pages: W.map(($, z) => {
|
|
2104
|
+
var _;
|
|
2066
2105
|
return {
|
|
2067
|
-
|
|
2068
|
-
fingerprint: (
|
|
2106
|
+
...$,
|
|
2107
|
+
fingerprint: (_ = I[z]) == null ? void 0 : _.fingerprint
|
|
2069
2108
|
};
|
|
2070
2109
|
})
|
|
2071
|
-
}),
|
|
2072
|
-
}, F = (
|
|
2110
|
+
}), ne(T);
|
|
2111
|
+
}, F = (T, $, z) => Ft({
|
|
2073
2112
|
namespace: h,
|
|
2074
|
-
sourceRevision:
|
|
2075
|
-
transport:
|
|
2076
|
-
signal:
|
|
2077
|
-
...
|
|
2078
|
-
|
|
2079
|
-
}), q = (
|
|
2080
|
-
const
|
|
2081
|
-
return
|
|
2082
|
-
},
|
|
2083
|
-
if (
|
|
2084
|
-
var
|
|
2085
|
-
const
|
|
2086
|
-
if (
|
|
2087
|
-
|
|
2088
|
-
const
|
|
2089
|
-
if (
|
|
2113
|
+
sourceRevision: O,
|
|
2114
|
+
transport: N,
|
|
2115
|
+
signal: z,
|
|
2116
|
+
...T.length ? { frames: T } : {},
|
|
2117
|
+
...$ ? {} : { generate: !1 }
|
|
2118
|
+
}), q = (T, $) => {
|
|
2119
|
+
const z = new Set($);
|
|
2120
|
+
return T.filter((_) => z.has(_.id));
|
|
2121
|
+
}, ce = (T, $) => T instanceof Error && T.message ? T.message : $, he = new AbortController();
|
|
2122
|
+
if (_e(async (T) => {
|
|
2123
|
+
var z, _, le;
|
|
2124
|
+
const $ = await F(T, !0, he.signal);
|
|
2125
|
+
if ($.status === "accepted") {
|
|
2126
|
+
K($.artifact);
|
|
2127
|
+
const Se = new Set(((z = $.frameResolution) == null ? void 0 : z.exact) ?? []);
|
|
2128
|
+
if (T.every((be) => Se.has(be.id)))
|
|
2090
2129
|
return { status: "accepted" };
|
|
2091
|
-
const
|
|
2092
|
-
...((
|
|
2093
|
-
...((
|
|
2130
|
+
const ge = [
|
|
2131
|
+
...((_ = $.frameResolution) == null ? void 0 : _.missing) ?? [],
|
|
2132
|
+
...((le = $.frameResolution) == null ? void 0 : le.stale) ?? []
|
|
2094
2133
|
];
|
|
2095
2134
|
return {
|
|
2096
2135
|
status: "unavailable",
|
|
2097
|
-
message:
|
|
2136
|
+
message: ge.length ? `The exact preview endpoint did not return a current capture for ${ge.join(", ")}.` : "The exact preview endpoint returned no current capture."
|
|
2098
2137
|
};
|
|
2099
2138
|
}
|
|
2100
|
-
return
|
|
2139
|
+
return $.status === "rejected" ? {
|
|
2101
2140
|
status: "rejected",
|
|
2102
|
-
message:
|
|
2141
|
+
message: $.errors.join(" ") || "The preview artifact was rejected."
|
|
2103
2142
|
} : {
|
|
2104
2143
|
status: "unavailable",
|
|
2105
|
-
message:
|
|
2106
|
-
|
|
2144
|
+
message: ce(
|
|
2145
|
+
$.error,
|
|
2107
2146
|
"The exact preview endpoint is unavailable."
|
|
2108
2147
|
)
|
|
2109
2148
|
};
|
|
2110
|
-
}),
|
|
2111
|
-
const
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
|
|
2149
|
+
}), d.current.length) {
|
|
2150
|
+
const T = d.current.filter((z) => {
|
|
2151
|
+
const _ = Be(
|
|
2152
|
+
z.id,
|
|
2153
|
+
z.fingerprint
|
|
2115
2154
|
).status;
|
|
2116
|
-
return
|
|
2155
|
+
return _ !== "exact" && _ !== "generating";
|
|
2117
2156
|
});
|
|
2118
|
-
|
|
2119
|
-
const
|
|
2120
|
-
const
|
|
2121
|
-
|
|
2122
|
-
|
|
2157
|
+
oe(T, { status: "checking" });
|
|
2158
|
+
const $ = (z) => z.filter((_) => {
|
|
2159
|
+
const le = Be(
|
|
2160
|
+
_.id,
|
|
2161
|
+
_.fingerprint
|
|
2123
2162
|
).status;
|
|
2124
|
-
return
|
|
2163
|
+
return le !== "generating" && le !== "exact";
|
|
2125
2164
|
});
|
|
2126
2165
|
(async () => {
|
|
2127
|
-
var
|
|
2128
|
-
const
|
|
2166
|
+
var ge, be, ze;
|
|
2167
|
+
const z = y.current.slice(
|
|
2129
2168
|
0,
|
|
2130
|
-
|
|
2169
|
+
d.current.length
|
|
2131
2170
|
);
|
|
2132
|
-
if (await
|
|
2133
|
-
const
|
|
2134
|
-
|
|
2135
|
-
(U, k) =>
|
|
2171
|
+
if (await At(z), m.signal.aborted) return;
|
|
2172
|
+
const _ = new Set(
|
|
2173
|
+
d.current.filter(
|
|
2174
|
+
(U, k) => z[k] ? Mt(z[k]) : !1
|
|
2136
2175
|
).map((U) => U.id)
|
|
2137
2176
|
);
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2177
|
+
oe(
|
|
2178
|
+
$(
|
|
2179
|
+
T.filter((U) => _.has(U.id))
|
|
2141
2180
|
),
|
|
2142
2181
|
{ status: "exact" }
|
|
2143
2182
|
);
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2146
|
-
),
|
|
2147
|
-
for (const U of
|
|
2148
|
-
|
|
2183
|
+
const le = $(
|
|
2184
|
+
T.filter((U) => !_.has(U.id))
|
|
2185
|
+
), Se = [];
|
|
2186
|
+
for (const U of Ue(
|
|
2187
|
+
le
|
|
2149
2188
|
)) {
|
|
2150
|
-
const k = await
|
|
2189
|
+
const k = await Ot({
|
|
2151
2190
|
namespace: h,
|
|
2152
|
-
sourceRevision:
|
|
2153
|
-
transport:
|
|
2191
|
+
sourceRevision: O,
|
|
2192
|
+
transport: N,
|
|
2154
2193
|
frames: U,
|
|
2155
|
-
signal:
|
|
2194
|
+
signal: m.signal
|
|
2156
2195
|
});
|
|
2157
|
-
if (
|
|
2196
|
+
if (m.signal.aborted) return;
|
|
2158
2197
|
if (k.status === "accepted") {
|
|
2159
|
-
|
|
2198
|
+
Se.push(
|
|
2160
2199
|
...q(U, k.resolution.exact)
|
|
2161
2200
|
);
|
|
2162
|
-
const
|
|
2201
|
+
const Ae = q(U, [
|
|
2163
2202
|
...k.resolution.missing,
|
|
2164
2203
|
...k.resolution.stale
|
|
2165
2204
|
]);
|
|
2166
|
-
|
|
2205
|
+
oe($(Ae), {
|
|
2167
2206
|
status: "outdated",
|
|
2168
2207
|
message: "Select this frame to generate the exact preview."
|
|
2169
2208
|
});
|
|
2170
2209
|
continue;
|
|
2171
2210
|
}
|
|
2172
|
-
const
|
|
2211
|
+
const $e = k.status === "rejected" ? k.errors.join(" ") || "The preview artifact probe was rejected." : ce(
|
|
2173
2212
|
k.error,
|
|
2174
2213
|
"The exact preview endpoint is unavailable."
|
|
2175
2214
|
);
|
|
2176
|
-
|
|
2215
|
+
oe($(U), {
|
|
2177
2216
|
status: "error",
|
|
2178
2217
|
reason: k.status === "rejected" ? "rejected" : "unavailable",
|
|
2179
|
-
message:
|
|
2218
|
+
message: $e
|
|
2180
2219
|
});
|
|
2181
2220
|
}
|
|
2182
|
-
for (const U of
|
|
2183
|
-
|
|
2221
|
+
for (const U of Ue(
|
|
2222
|
+
$(Se)
|
|
2184
2223
|
)) {
|
|
2185
2224
|
const k = await F(
|
|
2186
2225
|
U,
|
|
2187
2226
|
!1,
|
|
2188
|
-
|
|
2227
|
+
m.signal
|
|
2189
2228
|
);
|
|
2190
|
-
if (
|
|
2229
|
+
if (m.signal.aborted) return;
|
|
2191
2230
|
if (k.status === "accepted") {
|
|
2192
|
-
|
|
2193
|
-
q(U, ((
|
|
2231
|
+
K(k.artifact), oe(
|
|
2232
|
+
q(U, ((ge = k.frameResolution) == null ? void 0 : ge.exact) ?? []),
|
|
2194
2233
|
{ status: "exact" }
|
|
2195
2234
|
);
|
|
2196
|
-
const
|
|
2197
|
-
...((
|
|
2198
|
-
...((
|
|
2235
|
+
const Ae = q(U, [
|
|
2236
|
+
...((be = k.frameResolution) == null ? void 0 : be.missing) ?? [],
|
|
2237
|
+
...((ze = k.frameResolution) == null ? void 0 : ze.stale) ?? []
|
|
2199
2238
|
]);
|
|
2200
|
-
|
|
2239
|
+
oe($(Ae), {
|
|
2201
2240
|
status: "outdated",
|
|
2202
2241
|
message: "Select this frame to generate the exact preview."
|
|
2203
2242
|
});
|
|
2204
2243
|
continue;
|
|
2205
2244
|
}
|
|
2206
|
-
const
|
|
2245
|
+
const $e = k.status === "rejected" ? k.errors.join(" ") || "The preview artifact was rejected." : ce(
|
|
2207
2246
|
k.error,
|
|
2208
2247
|
"The exact preview endpoint is unavailable."
|
|
2209
2248
|
);
|
|
2210
|
-
|
|
2249
|
+
oe($(U), {
|
|
2211
2250
|
status: "error",
|
|
2212
2251
|
reason: k.status === "rejected" ? "rejected" : "unavailable",
|
|
2213
|
-
message:
|
|
2252
|
+
message: $e
|
|
2214
2253
|
});
|
|
2215
2254
|
}
|
|
2216
|
-
})().catch((
|
|
2217
|
-
if (
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2255
|
+
})().catch((z) => {
|
|
2256
|
+
if (m.signal.aborted) return;
|
|
2257
|
+
const _ = $(T);
|
|
2258
|
+
oe(_, {
|
|
2220
2259
|
status: "error",
|
|
2221
2260
|
reason: "unavailable",
|
|
2222
|
-
message:
|
|
2223
|
-
|
|
2261
|
+
message: ce(
|
|
2262
|
+
z,
|
|
2224
2263
|
"The exact preview endpoint is unavailable."
|
|
2225
2264
|
)
|
|
2226
2265
|
});
|
|
2227
2266
|
});
|
|
2228
2267
|
}
|
|
2229
2268
|
return () => {
|
|
2230
|
-
|
|
2269
|
+
_e(null), he.abort(), m.abort();
|
|
2231
2270
|
};
|
|
2232
2271
|
}, [
|
|
2233
|
-
|
|
2272
|
+
S,
|
|
2234
2273
|
h,
|
|
2235
2274
|
p,
|
|
2236
2275
|
w,
|
|
2237
|
-
|
|
2238
|
-
]),
|
|
2239
|
-
let
|
|
2240
|
-
if (!
|
|
2241
|
-
return
|
|
2242
|
-
|
|
2276
|
+
V
|
|
2277
|
+
]), me(() => {
|
|
2278
|
+
let m = !0;
|
|
2279
|
+
if (!j)
|
|
2280
|
+
return ye(void 0), we(null), se(null), ue(Q), () => {
|
|
2281
|
+
m = !1;
|
|
2243
2282
|
};
|
|
2244
|
-
const
|
|
2245
|
-
return
|
|
2246
|
-
endpoint:
|
|
2247
|
-
signal:
|
|
2248
|
-
pages: X.pages.map((
|
|
2249
|
-
...
|
|
2250
|
-
id:
|
|
2251
|
-
importKind:
|
|
2283
|
+
const N = new AbortController();
|
|
2284
|
+
return ye(void 0), we(null), se(null), st({
|
|
2285
|
+
endpoint: H,
|
|
2286
|
+
signal: N.signal,
|
|
2287
|
+
pages: X.pages.map((O) => ({
|
|
2288
|
+
...O,
|
|
2289
|
+
id: O.importPageId ?? O.id,
|
|
2290
|
+
importKind: O.importKind
|
|
2252
2291
|
})),
|
|
2253
|
-
assets: (
|
|
2254
|
-
|
|
2255
|
-
|
|
2292
|
+
assets: (a == null ? void 0 : a.getAssets("screens")) ?? [],
|
|
2293
|
+
storyboard: C
|
|
2294
|
+
}).then((O) => {
|
|
2295
|
+
m && (ye(O.baselineEnvironment), we(O.manifest.routes ?? null), se(O.graph));
|
|
2256
2296
|
}).catch(() => {
|
|
2257
|
-
|
|
2297
|
+
m && (ye(void 0), we(null), se(null));
|
|
2258
2298
|
}).finally(() => {
|
|
2259
|
-
|
|
2299
|
+
m && ue(Q);
|
|
2260
2300
|
}), () => {
|
|
2261
|
-
|
|
2301
|
+
m = !1, N.abort(), ye(void 0), we(null), se(null);
|
|
2262
2302
|
};
|
|
2263
2303
|
}, [
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
{
|
|
2273
|
-
"data-pygmalion-storyboard-loading": "",
|
|
2274
|
-
role: "status",
|
|
2275
|
-
style: {
|
|
2276
|
-
display: "grid",
|
|
2277
|
-
width: "100%",
|
|
2278
|
-
height: "100%",
|
|
2279
|
-
placeItems: "center",
|
|
2280
|
-
color: "#777777",
|
|
2281
|
-
background: "#f5f5f5",
|
|
2282
|
-
font: "12px system-ui, sans-serif"
|
|
2283
|
-
},
|
|
2284
|
-
children: "Discovering storyboard branches"
|
|
2285
|
-
}
|
|
2286
|
-
);
|
|
2304
|
+
a,
|
|
2305
|
+
C,
|
|
2306
|
+
j,
|
|
2307
|
+
H,
|
|
2308
|
+
Q
|
|
2309
|
+
]), me(() => {
|
|
2310
|
+
E == null || E === X.previewOpen || (E ? X.openPreview({ notifyHost: !1 }) : X.closePreview({ notifyHost: !1 }));
|
|
2311
|
+
}, [E]), /* @__PURE__ */ v(Dt, { previewIdentityReady: V });
|
|
2287
2312
|
}
|
|
2288
2313
|
export {
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
vr as
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2314
|
+
qn as DEFAULT_DESIGN_COMPILE_LIMITS,
|
|
2315
|
+
Kn as DESIGN_IMPORT_KINDS,
|
|
2316
|
+
Gn as DESIGN_IR_SCHEMA,
|
|
2317
|
+
Ln as DESIGN_IR_VERSION,
|
|
2318
|
+
$n as PygmalionCatalogDocument,
|
|
2319
|
+
Mn as PygmalionCatalogMatrix,
|
|
2320
|
+
An as PygmalionCatalogSection,
|
|
2321
|
+
Bn as PygmalionEditor,
|
|
2322
|
+
ut as STORYBOARD_ENVIRONMENT_CONTROL,
|
|
2323
|
+
Wn as STORYBOARD_ENVIRONMENT_QUERY,
|
|
2324
|
+
Fn as SourceRefControl,
|
|
2325
|
+
Tn as __debug,
|
|
2326
|
+
Vn as applyTokenOverride,
|
|
2327
|
+
Ft as bootstrapPreviewArtifact,
|
|
2328
|
+
Jn as clearPreviewEnvironmentControlValues,
|
|
2329
|
+
Qn as clearPygmalionPreviewCache,
|
|
2330
|
+
Xn as compileDesignDocument,
|
|
2331
|
+
Dn as createDesignComponentCatalog,
|
|
2332
|
+
pn as createDesignComponentVariantMatrix,
|
|
2333
|
+
On as createDesignGalleryCatalog,
|
|
2334
|
+
Yn as createDesignImportController,
|
|
2335
|
+
Zn as createDesignIntermediateDocument,
|
|
2336
|
+
er as createDesignScreenCollection,
|
|
2337
|
+
Nt as createPreviewArtifactHttpTransport,
|
|
2338
|
+
tr as createPreviewCacheNamespace,
|
|
2339
|
+
nr as createPreviewFrameFingerprint,
|
|
2340
|
+
rr as createPreviewRecipeFingerprint,
|
|
2341
|
+
or as createStoryboardCaptureRecipeIdentity,
|
|
2342
|
+
Gt as createStoryboardGraph,
|
|
2343
|
+
cn as createStoryboardGraphFromDiscovery,
|
|
2344
|
+
sr as createStoryboardGraphViewModel,
|
|
2345
|
+
Ut as createStoryboardPathEdges,
|
|
2346
|
+
nt as createStoryboardRouteScenarioId,
|
|
2347
|
+
ir as createStoryboardRouteUrl,
|
|
2348
|
+
un as designCatalogKey,
|
|
2349
|
+
it as designCatalogRegistryName,
|
|
2350
|
+
ar as enumerateDesignComponentConnectionCases,
|
|
2351
|
+
cr as expandDesignScreenCasesViewports,
|
|
2352
|
+
lr as expandDesignScreenCollectionViewports,
|
|
2353
|
+
dr as getDesignCodegenAdapters,
|
|
2354
|
+
ur as getDesignComponentConnection,
|
|
2355
|
+
fr as getDesignComponentConnectionForComponent,
|
|
2356
|
+
mr as getDesignComponentConnections,
|
|
2357
|
+
pr as getPreviewEnvironmentControlValue,
|
|
2358
|
+
hr as getPreviewEnvironmentControls,
|
|
2359
|
+
gr as getPreviewEnvironmentOverride,
|
|
2360
|
+
yr as getRecommendedPygmalionPreviewConcurrency,
|
|
2361
|
+
ve as getStoryboardBaselineEnvironment,
|
|
2362
|
+
ot as getStoryboardDiscoveryBaselineEnvironment,
|
|
2363
|
+
wr as getStoryboardGraph,
|
|
2364
|
+
Sr as getViewportPresets,
|
|
2365
|
+
st as loadStoryboardDiscovery,
|
|
2366
|
+
br as mergeScreenPresets,
|
|
2367
|
+
tt as mergeStoryboardEnvironment,
|
|
2368
|
+
Nn as publishStoryboardDiscovery,
|
|
2369
|
+
zn as pygmalionNavigate,
|
|
2370
|
+
jn as pygmalionOpenPreview,
|
|
2371
|
+
_n as pygmalionResetCurrentEdits,
|
|
2372
|
+
vr as reconstructRoutePreviewArtifactScreenshotV3,
|
|
2373
|
+
Ir as reconstructRoutePreviewArtifactSnapshotV3,
|
|
2374
|
+
xr as registerDesignCodegenAdapter,
|
|
2375
|
+
Pr as resetTokenOverrides,
|
|
2376
|
+
Er as resolvePreviewArtifactFrames,
|
|
2377
|
+
Xt as resolveStoryboardScreenCases,
|
|
2378
|
+
mt as setComponentRegistry,
|
|
2379
|
+
pt as setDesignComponentConnections,
|
|
2380
|
+
Cr as setPreviewEnvironmentControlValue,
|
|
2381
|
+
Ct as setPreviewEnvironmentControls,
|
|
2382
|
+
Pt as setPygmalionAppOrigin,
|
|
2383
|
+
vt as setPygmalionPreviewConcurrency,
|
|
2384
|
+
Et as setPygmalionPreviewRevision,
|
|
2385
|
+
ye as setStoryboardBaselineEnvironment,
|
|
2386
|
+
se as setStoryboardGraph,
|
|
2387
|
+
ht as setTokens,
|
|
2388
|
+
gt as setViewportPresets,
|
|
2389
|
+
Ht as storyboardScreenRecipeKey,
|
|
2390
|
+
Rr as subscribePreviewEnvironmentControls,
|
|
2391
|
+
Nr as subscribeStoryboardGraph,
|
|
2392
|
+
kn as usePygmalionProject,
|
|
2393
|
+
$r as validateDesignComponentConnections,
|
|
2394
|
+
Ar as validatePreviewArtifactBundle,
|
|
2395
|
+
Mr as validateRoutePreviewArtifactV3Browser
|
|
2369
2396
|
};
|