@pygmalionjs/pygmalion 0.2.22 → 0.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{App-wIyYhdCu.js → App-DaaT22K5.js} +1717 -1691
- package/dist-lib/pygmalion.js +233 -233
- package/dist-lib/testing.js +1 -1
- package/node/preview-artifact-plugin.mjs +0 -0
- package/node/storyboard-environment.mjs +27 -2
- package/package.json +1 -1
package/dist-lib/pygmalion.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as C, jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import { b as Y, m as
|
|
3
|
-
import {
|
|
4
|
-
import { createElement as
|
|
2
|
+
import { b as Y, m as He, i as qe, g as Ke, e as q, c as Ge, a as Je, d as We, f as Ve, h as Qe, j as Le, k as Xe, l as Ye, n as be, o as ve, p as Ze, q as et, r as tt, t as nt, u as rt, v as ot, w as Ie, x as se, y as xe, S as st, A as it, z as Pe, B as at, C as ct, D as lt, E as dt, G as ut, H as ft, I as ht, J as pt, K as Ee } from "./App-DaaT22K5.js";
|
|
3
|
+
import { L as mn, M as gn, O as yn, P as wn, Q as Sn, R as bn, T as vn, U as In, V as xn, W as Pn, X as En, Y as Cn, Z as Nn, _ as Rn, $ as An, a0 as $n, a1 as On, a2 as Mn, a3 as kn, a4 as Dn, a5 as Fn, a6 as Tn, a7 as zn, a8 as _n } from "./App-DaaT22K5.js";
|
|
4
|
+
import { createElement as Ce, useMemo as ae, useState as re, useRef as me, useCallback as X, useEffect as oe } from "react";
|
|
5
5
|
function ge(e, t = /* @__PURE__ */ new Set()) {
|
|
6
6
|
if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
|
|
7
7
|
return e;
|
|
@@ -18,7 +18,7 @@ function ge(e, t = /* @__PURE__ */ new Set()) {
|
|
|
18
18
|
}
|
|
19
19
|
return t.delete(e), o;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function mt(e) {
|
|
22
22
|
return JSON.stringify(
|
|
23
23
|
ge({
|
|
24
24
|
version: 1,
|
|
@@ -42,11 +42,11 @@ function pt(e) {
|
|
|
42
42
|
function z(e) {
|
|
43
43
|
return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, o) => t.localeCompare(o));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function gt(e, t) {
|
|
46
46
|
var r;
|
|
47
47
|
return ((r = e.id) == null ? void 0 : r.trim()) || `edge:${t + 1}`;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function yt(e) {
|
|
50
50
|
const t = [...e.screens].sort((r, n) => r.id.localeCompare(n.id)), o = t[0].id;
|
|
51
51
|
return {
|
|
52
52
|
id: `story:${o}`,
|
|
@@ -66,7 +66,7 @@ function gt(e) {
|
|
|
66
66
|
states: z(t.map((r) => r.state))
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Ne(e) {
|
|
70
70
|
return [
|
|
71
71
|
e.code,
|
|
72
72
|
e.edgeId,
|
|
@@ -75,7 +75,7 @@ function Ce(e) {
|
|
|
75
75
|
e.scenarioId
|
|
76
76
|
].join(":");
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function wt(e) {
|
|
79
79
|
var j, $;
|
|
80
80
|
const t = [], o = [], r = /* @__PURE__ */ new Map();
|
|
81
81
|
for (const i of e.screens) {
|
|
@@ -96,7 +96,7 @@ function yt(e) {
|
|
|
96
96
|
for (const i of o) {
|
|
97
97
|
let l;
|
|
98
98
|
try {
|
|
99
|
-
if (l = (e.recipeKey ??
|
|
99
|
+
if (l = (e.recipeKey ?? mt)(i), !l.trim()) throw new Error("Recipe keys cannot be empty.");
|
|
100
100
|
} catch (f) {
|
|
101
101
|
s.add(i.id), t.push({
|
|
102
102
|
code: "invalid-recipe",
|
|
@@ -108,7 +108,7 @@ function yt(e) {
|
|
|
108
108
|
const d = n.get(l);
|
|
109
109
|
d ? d.screens.push(i) : n.set(l, { recipeKey: l, screens: [i] });
|
|
110
110
|
}
|
|
111
|
-
const a = [...n.values()].map(
|
|
111
|
+
const a = [...n.values()].map(yt).sort((i, l) => i.id.localeCompare(l.id)), c = {};
|
|
112
112
|
for (const i of a)
|
|
113
113
|
for (const l of i.screenIds) c[l] = i.id;
|
|
114
114
|
const u = new Map(a.map((i) => [i.id, i])), g = /* @__PURE__ */ new Map();
|
|
@@ -161,23 +161,23 @@ function yt(e) {
|
|
|
161
161
|
let p = 0;
|
|
162
162
|
for (const [i, l] of N)
|
|
163
163
|
for (const d of l) {
|
|
164
|
-
const f =
|
|
164
|
+
const f = gt(d, p);
|
|
165
165
|
p += 1;
|
|
166
166
|
const v = m(d.from, f, "source"), P = m(d.to, f, "target");
|
|
167
167
|
if (!v || !P || v === P) continue;
|
|
168
168
|
const k = `${v}\0${P}`, R = y.get(k);
|
|
169
169
|
if (R) {
|
|
170
170
|
if (!R.sourceEdgeIds.includes(f)) {
|
|
171
|
-
const
|
|
171
|
+
const J = {
|
|
172
172
|
...R,
|
|
173
173
|
sourceEdgeIds: z([
|
|
174
174
|
...R.sourceEdgeIds,
|
|
175
175
|
f
|
|
176
176
|
])
|
|
177
177
|
};
|
|
178
|
-
y.set(k,
|
|
178
|
+
y.set(k, J);
|
|
179
179
|
const H = I.indexOf(R);
|
|
180
|
-
H >= 0 && (I[H] =
|
|
180
|
+
H >= 0 && (I[H] = J);
|
|
181
181
|
}
|
|
182
182
|
continue;
|
|
183
183
|
}
|
|
@@ -273,12 +273,12 @@ function yt(e) {
|
|
|
273
273
|
h.flatMap((i) => i.scenarioIds)
|
|
274
274
|
), te = new Set(
|
|
275
275
|
(e.nonVisualScenarioIds ?? []).map((i) => i.trim())
|
|
276
|
-
),
|
|
276
|
+
), V = z(
|
|
277
277
|
(e.scenarios ?? []).map((i) => i.id)
|
|
278
|
-
),
|
|
278
|
+
), G = V.filter(
|
|
279
279
|
(i) => !K.has(i) && !te.has(i)
|
|
280
280
|
);
|
|
281
|
-
for (const i of
|
|
281
|
+
for (const i of G)
|
|
282
282
|
t.push({
|
|
283
283
|
code: "missing-code-scenario",
|
|
284
284
|
severity: "warning",
|
|
@@ -286,7 +286,7 @@ function yt(e) {
|
|
|
286
286
|
scenarioId: i
|
|
287
287
|
});
|
|
288
288
|
t.sort(
|
|
289
|
-
(i, l) =>
|
|
289
|
+
(i, l) => Ne(i).localeCompare(Ne(l))
|
|
290
290
|
);
|
|
291
291
|
const Q = z(
|
|
292
292
|
D.flatMap((i) => i.screenIds)
|
|
@@ -297,12 +297,12 @@ function yt(e) {
|
|
|
297
297
|
edges: I.length,
|
|
298
298
|
connectedNodes: h.length - D.length,
|
|
299
299
|
disconnectedScreens: Q,
|
|
300
|
-
codeScenarios:
|
|
301
|
-
representedScenarios:
|
|
300
|
+
codeScenarios: V.length,
|
|
301
|
+
representedScenarios: V.filter(
|
|
302
302
|
(i) => K.has(i)
|
|
303
303
|
).length,
|
|
304
|
-
missingScenarios:
|
|
305
|
-
complete: Q.length === 0 &&
|
|
304
|
+
missingScenarios: G,
|
|
305
|
+
complete: Q.length === 0 && G.length === 0 && !t.some((i) => i.severity === "error") && s.size === 0
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
version: 1,
|
|
@@ -318,7 +318,7 @@ function yt(e) {
|
|
|
318
318
|
coverage: x
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function St(e) {
|
|
322
322
|
return e ? JSON.parse(JSON.stringify(e)) : void 0;
|
|
323
323
|
}
|
|
324
324
|
function ce(e) {
|
|
@@ -329,10 +329,10 @@ function ce(e) {
|
|
|
329
329
|
}
|
|
330
330
|
return e;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Re(e) {
|
|
333
333
|
return JSON.stringify(ce(e ?? null));
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function bt(e) {
|
|
336
336
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
337
337
|
}
|
|
338
338
|
function U(e) {
|
|
@@ -346,7 +346,7 @@ function U(e) {
|
|
|
346
346
|
}
|
|
347
347
|
return o = o.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), o.startsWith("/") || (o = `/${o}`), o.length > 1 && (o = o.replace(/\/+$/, "")), o || "/";
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function Fe(e) {
|
|
350
350
|
return `source-route:${encodeURIComponent(e)}`;
|
|
351
351
|
}
|
|
352
352
|
function Se(e, t) {
|
|
@@ -363,7 +363,7 @@ function Se(e, t) {
|
|
|
363
363
|
}
|
|
364
364
|
return n === r.length;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Ae(e, t) {
|
|
367
367
|
const o = U(e);
|
|
368
368
|
if (!o) return [];
|
|
369
369
|
const r = t.get(o);
|
|
@@ -373,13 +373,13 @@ function Re(e, t) {
|
|
|
373
373
|
)
|
|
374
374
|
].sort((n, s) => n.localeCompare(s));
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function vt(e) {
|
|
377
377
|
var o;
|
|
378
378
|
const t = /* @__PURE__ */ new Map();
|
|
379
379
|
for (const r of e ?? []) {
|
|
380
380
|
const n = U(r.path);
|
|
381
381
|
!n || t.has(n) || t.set(n, {
|
|
382
|
-
id:
|
|
382
|
+
id: Fe(n),
|
|
383
383
|
name: n,
|
|
384
384
|
section: "Source routes",
|
|
385
385
|
codeName: ((o = r.id) == null ? void 0 : o.trim()) || void 0
|
|
@@ -387,12 +387,12 @@ function bt(e) {
|
|
|
387
387
|
}
|
|
388
388
|
return [...t.values()].sort((r, n) => r.id.localeCompare(n.id));
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function It(e, t, o) {
|
|
391
391
|
return (e ?? []).flatMap((r, n) => {
|
|
392
392
|
var h, S, m;
|
|
393
393
|
const s = (h = r.from) == null ? void 0 : h.trim(), a = (S = r.to) == null ? void 0 : S.trim();
|
|
394
394
|
if (!s || !a || r.unresolvedTarget) return [];
|
|
395
|
-
const c = o.has(s) ? [s] :
|
|
395
|
+
const c = o.has(s) ? [s] : Ae(s, t), u = o.has(a) ? [a] : Ae(a, t);
|
|
396
396
|
if (!c.length || !u.length) return [];
|
|
397
397
|
const g = ((m = r.id) == null ? void 0 : m.trim()) || `discovery-edge:${n + 1}`;
|
|
398
398
|
return c.flatMap(
|
|
@@ -409,7 +409,7 @@ function vt(e, t, o) {
|
|
|
409
409
|
);
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function xt(e, t, o) {
|
|
413
413
|
const r = U(e.route);
|
|
414
414
|
if (!r) return [];
|
|
415
415
|
const n = t.filter(
|
|
@@ -419,10 +419,10 @@ function It(e, t, o) {
|
|
|
419
419
|
}
|
|
420
420
|
);
|
|
421
421
|
if (!n.length) return [];
|
|
422
|
-
const s =
|
|
423
|
-
|
|
422
|
+
const s = Re(
|
|
423
|
+
He(o, e.environment)
|
|
424
424
|
), a = n.filter(
|
|
425
|
-
(c) =>
|
|
425
|
+
(c) => Re(c.environment) === s
|
|
426
426
|
);
|
|
427
427
|
return [
|
|
428
428
|
...new Set(
|
|
@@ -433,8 +433,8 @@ function It(e, t, o) {
|
|
|
433
433
|
)
|
|
434
434
|
].sort((c, u) => c.localeCompare(u));
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n =
|
|
436
|
+
function Pt(e, t) {
|
|
437
|
+
const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n = ze(t);
|
|
438
438
|
return e.filter(
|
|
439
439
|
(s) => o ? s.importKind === "screens" : !!s.route
|
|
440
440
|
).map((s) => ({
|
|
@@ -455,7 +455,7 @@ function xt(e, t) {
|
|
|
455
455
|
scenario: s.scenario,
|
|
456
456
|
state: s.state,
|
|
457
457
|
scenarioId: s.scenarioId,
|
|
458
|
-
scenarioIds:
|
|
458
|
+
scenarioIds: xt(s, r, n),
|
|
459
459
|
interactions: s.interactions,
|
|
460
460
|
environment: s.environment,
|
|
461
461
|
preset: s.preset,
|
|
@@ -472,7 +472,7 @@ function fe(e, t) {
|
|
|
472
472
|
const s = !e.environment && !e.preset ? 0 : 1, a = !t.environment && !t.preset ? 0 : 1;
|
|
473
473
|
return s !== a ? s - a : e.id.localeCompare(t.id);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Et(e) {
|
|
476
476
|
const t = /* @__PURE__ */ new Map();
|
|
477
477
|
for (const o of e) {
|
|
478
478
|
const r = U(o.route);
|
|
@@ -487,7 +487,7 @@ function Pt(e) {
|
|
|
487
487
|
})
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Ct(e) {
|
|
491
491
|
return e.action === "wait" ? null : JSON.stringify(
|
|
492
492
|
ce({
|
|
493
493
|
action: e.action,
|
|
@@ -503,18 +503,18 @@ function Et(e) {
|
|
|
503
503
|
})
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
return (e.interactions ?? []).map(
|
|
506
|
+
function Te(e) {
|
|
507
|
+
return (e.interactions ?? []).map(Ct).filter((t) => t != null);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Nt(e, t) {
|
|
510
510
|
return e.length < t.length && e.every((o, r) => o === t[r]);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Rt(e, t) {
|
|
513
513
|
const o = /* @__PURE__ */ new Map();
|
|
514
514
|
for (const r of e) {
|
|
515
515
|
const n = U(r.route);
|
|
516
516
|
if (!n) continue;
|
|
517
|
-
const s = `${n}\0${
|
|
517
|
+
const s = `${n}\0${Te(r).join("")}`, a = o.get(s);
|
|
518
518
|
a ? a.push(r) : o.set(s, [r]);
|
|
519
519
|
}
|
|
520
520
|
return [...o.values()].flatMap((r) => {
|
|
@@ -528,7 +528,7 @@ function Nt(e, t) {
|
|
|
528
528
|
}));
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function At(e, t) {
|
|
532
532
|
const o = /* @__PURE__ */ new Map();
|
|
533
533
|
for (const r of e) {
|
|
534
534
|
const n = U(r.route);
|
|
@@ -538,7 +538,7 @@ function Rt(e, t) {
|
|
|
538
538
|
}
|
|
539
539
|
return [...o.entries()].flatMap(([r, n]) => {
|
|
540
540
|
const s = new Map(
|
|
541
|
-
n.map((u) => [u.id,
|
|
541
|
+
n.map((u) => [u.id, Te(u)])
|
|
542
542
|
), a = t.get(r), c = n.find(
|
|
543
543
|
(u) => u.id === a
|
|
544
544
|
);
|
|
@@ -546,7 +546,7 @@ function Rt(e, t) {
|
|
|
546
546
|
const g = s.get(u.id);
|
|
547
547
|
if (!g.length) return [];
|
|
548
548
|
const S = n.filter(
|
|
549
|
-
(m) =>
|
|
549
|
+
(m) => Nt(
|
|
550
550
|
s.get(m.id),
|
|
551
551
|
g
|
|
552
552
|
)
|
|
@@ -578,7 +578,7 @@ function Rt(e, t) {
|
|
|
578
578
|
});
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function $t(e) {
|
|
582
582
|
var o;
|
|
583
583
|
const t = /* @__PURE__ */ new Map();
|
|
584
584
|
for (const r of e) {
|
|
@@ -610,7 +610,7 @@ function At(e) {
|
|
|
610
610
|
});
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Ot(e, t, o) {
|
|
614
614
|
const r = new Set(
|
|
615
615
|
(t.routes ?? []).map((n) => U(n.path)).filter((n) => !!n)
|
|
616
616
|
);
|
|
@@ -626,13 +626,13 @@ function $t(e, t, o) {
|
|
|
626
626
|
scenarioIds: [
|
|
627
627
|
.../* @__PURE__ */ new Set([
|
|
628
628
|
...n.scenarioIds ?? [],
|
|
629
|
-
...a.map(
|
|
629
|
+
...a.map(Fe)
|
|
630
630
|
])
|
|
631
631
|
].sort((c, u) => c.localeCompare(u))
|
|
632
632
|
} : n;
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function Mt(e, t) {
|
|
636
636
|
var g, h, S, m, I;
|
|
637
637
|
const o = new Set(e.map((y) => y.id)), r = new Map(
|
|
638
638
|
e.map((y, N) => [y.id, N])
|
|
@@ -685,41 +685,41 @@ function Ot(e, t) {
|
|
|
685
685
|
(y, N) => (r.get(y) ?? Number.MAX_SAFE_INTEGER) - (r.get(N) ?? Number.MAX_SAFE_INTEGER) || y.localeCompare(N)
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function ze(e) {
|
|
689
689
|
var t, o;
|
|
690
|
-
return
|
|
690
|
+
return St(
|
|
691
691
|
(o = (t = e.scenarios) == null ? void 0 : t.find(
|
|
692
692
|
(r) => r.id === "environment:baseline"
|
|
693
693
|
)) == null ? void 0 : o.environment
|
|
694
694
|
);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
const t =
|
|
696
|
+
function kt(e) {
|
|
697
|
+
const t = Pt(
|
|
698
698
|
e.pages,
|
|
699
699
|
e.manifest
|
|
700
|
-
), o =
|
|
700
|
+
), o = Et(t), r = Ot(
|
|
701
701
|
t,
|
|
702
702
|
e.manifest,
|
|
703
703
|
o
|
|
704
704
|
), s = [
|
|
705
|
-
...
|
|
705
|
+
...It(
|
|
706
706
|
e.manifest.edges,
|
|
707
707
|
o,
|
|
708
708
|
new Set(r.map((a) => a.id))
|
|
709
709
|
),
|
|
710
|
-
...Nt(r, o),
|
|
711
710
|
...Rt(r, o),
|
|
712
|
-
...At(r)
|
|
711
|
+
...At(r, o),
|
|
712
|
+
...$t(r)
|
|
713
713
|
];
|
|
714
|
-
return
|
|
714
|
+
return wt({
|
|
715
715
|
screens: r,
|
|
716
716
|
assets: e.assets,
|
|
717
|
-
scenarios:
|
|
717
|
+
scenarios: vt(e.manifest.routes),
|
|
718
718
|
inferredEdges: s,
|
|
719
|
-
startScreenIds:
|
|
719
|
+
startScreenIds: Mt(r, s)
|
|
720
720
|
});
|
|
721
721
|
}
|
|
722
|
-
async function
|
|
722
|
+
async function _e(e) {
|
|
723
723
|
const o = await (e.fetcher ?? ((n, s) => fetch(n, s)))(e.endpoint, {
|
|
724
724
|
headers: { accept: "application/json" },
|
|
725
725
|
cache: "no-store",
|
|
@@ -728,36 +728,36 @@ async function ze(e) {
|
|
|
728
728
|
if (!o.ok)
|
|
729
729
|
throw new Error(`Storyboard discovery failed (${o.status})`);
|
|
730
730
|
const r = await o.json();
|
|
731
|
-
if (!
|
|
731
|
+
if (!bt(r))
|
|
732
732
|
throw new Error("Storyboard discovery returned an invalid manifest.");
|
|
733
733
|
return {
|
|
734
734
|
manifest: r,
|
|
735
|
-
baselineEnvironment:
|
|
736
|
-
graph:
|
|
735
|
+
baselineEnvironment: ze(r),
|
|
736
|
+
graph: kt({
|
|
737
737
|
manifest: r,
|
|
738
738
|
pages: e.pages,
|
|
739
739
|
assets: e.assets
|
|
740
740
|
})
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
async function
|
|
743
|
+
async function Zt(e) {
|
|
744
744
|
Y(null);
|
|
745
745
|
try {
|
|
746
|
-
const t = await
|
|
746
|
+
const t = await _e(e);
|
|
747
747
|
return Y(t.graph), t;
|
|
748
748
|
} catch (t) {
|
|
749
749
|
throw Y(null), t;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
const le = "var(--pygmalion-catalog-surface, #ffffff)", de = "var(--pygmalion-catalog-canvas, #f5f5f5)", ye = "var(--pygmalion-catalog-border, #e5e7eb)", ue = "var(--pygmalion-catalog-text, #202124)", _ = "var(--pygmalion-catalog-muted, #6b7280)",
|
|
753
|
-
function
|
|
752
|
+
const le = "var(--pygmalion-catalog-surface, #ffffff)", de = "var(--pygmalion-catalog-canvas, #f5f5f5)", ye = "var(--pygmalion-catalog-border, #e5e7eb)", ue = "var(--pygmalion-catalog-text, #202124)", _ = "var(--pygmalion-catalog-muted, #6b7280)", Dt = "var(--pygmalion-catalog-header, #11182f)", Ft = "var(--pygmalion-catalog-accent, #7c6cf2)";
|
|
753
|
+
function en({
|
|
754
754
|
title: e,
|
|
755
755
|
eyebrow: t,
|
|
756
756
|
description: o,
|
|
757
757
|
version: r,
|
|
758
758
|
meta: n,
|
|
759
759
|
children: s,
|
|
760
|
-
headerBackground: a =
|
|
760
|
+
headerBackground: a = Dt,
|
|
761
761
|
headerColor: c = "#ffffff",
|
|
762
762
|
bodyBackground: u = le,
|
|
763
763
|
bodyGap: g = 40
|
|
@@ -874,7 +874,7 @@ function Zt({
|
|
|
874
874
|
}
|
|
875
875
|
);
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function tn({
|
|
878
878
|
title: e,
|
|
879
879
|
count: t,
|
|
880
880
|
description: o,
|
|
@@ -917,7 +917,7 @@ function en({
|
|
|
917
917
|
}
|
|
918
918
|
);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function nn({
|
|
921
921
|
rows: e,
|
|
922
922
|
columns: t,
|
|
923
923
|
cornerLabel: o,
|
|
@@ -936,7 +936,7 @@ function tn({
|
|
|
936
936
|
display: "inline-block",
|
|
937
937
|
width: "max-content",
|
|
938
938
|
padding: a ? 16 : 0,
|
|
939
|
-
border: a ? `1px dashed ${
|
|
939
|
+
border: a ? `1px dashed ${Ft}` : void 0,
|
|
940
940
|
borderRadius: a ? 4 : void 0
|
|
941
941
|
},
|
|
942
942
|
children: /* @__PURE__ */ C(
|
|
@@ -1014,14 +1014,14 @@ function tn({
|
|
|
1014
1014
|
}
|
|
1015
1015
|
);
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function Tt(e) {
|
|
1018
1018
|
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const r = (n) =>
|
|
1020
|
+
function Be(e, t, o = "PygmalionCatalog") {
|
|
1021
|
+
const r = (n) => Tt(n).replace(/-/g, "_");
|
|
1022
1022
|
return `${o}_${r(e)}_${r(t)}`;
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function je(e, t) {
|
|
1025
1025
|
return {
|
|
1026
1026
|
id: e.id,
|
|
1027
1027
|
name: e.name,
|
|
@@ -1032,7 +1032,7 @@ function Be(e, t) {
|
|
|
1032
1032
|
description: e.description
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function Ue(e) {
|
|
1036
1036
|
const t = /* @__PURE__ */ new Set();
|
|
1037
1037
|
for (const o of e) {
|
|
1038
1038
|
if (t.has(o.id))
|
|
@@ -1040,10 +1040,10 @@ function je(e) {
|
|
|
1040
1040
|
t.add(o.id);
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function zt(e, t, o) {
|
|
1044
1044
|
return typeof e == "function" ? e(t, o) : e;
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function _t({
|
|
1047
1047
|
page: e,
|
|
1048
1048
|
items: t,
|
|
1049
1049
|
renderPreview: o,
|
|
@@ -1147,8 +1147,8 @@ function zt({
|
|
|
1147
1147
|
}
|
|
1148
1148
|
);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1151
|
-
|
|
1150
|
+
function rn(e) {
|
|
1151
|
+
Ue(e.items);
|
|
1152
1152
|
const t = /* @__PURE__ */ new Map();
|
|
1153
1153
|
for (const n of e.items) {
|
|
1154
1154
|
const s = e.pageFor(n), a = t.get(s.id);
|
|
@@ -1161,7 +1161,7 @@ function nn(e) {
|
|
|
1161
1161
|
t.set(s.id, {
|
|
1162
1162
|
page: s,
|
|
1163
1163
|
items: [n],
|
|
1164
|
-
registryName:
|
|
1164
|
+
registryName: Be(
|
|
1165
1165
|
e.kind,
|
|
1166
1166
|
s.id,
|
|
1167
1167
|
e.registryPrefix
|
|
@@ -1171,7 +1171,7 @@ function nn(e) {
|
|
|
1171
1171
|
const o = {}, r = [];
|
|
1172
1172
|
for (const n of t.values()) {
|
|
1173
1173
|
const s = () => /* @__PURE__ */ w(
|
|
1174
|
-
|
|
1174
|
+
_t,
|
|
1175
1175
|
{
|
|
1176
1176
|
page: n.page,
|
|
1177
1177
|
items: n.items,
|
|
@@ -1184,7 +1184,7 @@ function nn(e) {
|
|
|
1184
1184
|
component: s,
|
|
1185
1185
|
children: "none"
|
|
1186
1186
|
};
|
|
1187
|
-
const a =
|
|
1187
|
+
const a = zt(e.frame, n.page, n.items);
|
|
1188
1188
|
r.push({
|
|
1189
1189
|
...n.page,
|
|
1190
1190
|
componentName: n.registryName,
|
|
@@ -1197,12 +1197,12 @@ function nn(e) {
|
|
|
1197
1197
|
registry: o,
|
|
1198
1198
|
collection: {
|
|
1199
1199
|
expectedCount: e.expectedCount ?? e.items.length,
|
|
1200
|
-
assets: e.items.map((n) =>
|
|
1200
|
+
assets: e.items.map((n) => je(n, e.pageFor(n).id)),
|
|
1201
1201
|
pages: r
|
|
1202
1202
|
}
|
|
1203
1203
|
};
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Bt(e, t = 60) {
|
|
1206
1206
|
const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, u], [g, h]) => h.length - u.length || c.localeCompare(g)), r = o[0], n = o[1], s = Math.max(1, (r == null ? void 0 : r[1].length) ?? 1), a = n == null ? void 0 : n[1].slice(0, Math.max(1, Math.floor(t / s)));
|
|
1207
1207
|
return {
|
|
1208
1208
|
row: r,
|
|
@@ -1211,7 +1211,7 @@ function _t(e, t = 60) {
|
|
|
1211
1211
|
additional: o.slice(2)
|
|
1212
1212
|
};
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function jt(e, t, o, r) {
|
|
1215
1215
|
return {
|
|
1216
1216
|
...e.defaultProps,
|
|
1217
1217
|
...Object.fromEntries(t.fixed),
|
|
@@ -1219,7 +1219,7 @@ function Bt(e, t, o, r) {
|
|
|
1219
1219
|
...t.column && r ? { [t.column[0]]: r } : {}
|
|
1220
1220
|
};
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function Ut({
|
|
1223
1223
|
item: e,
|
|
1224
1224
|
entry: t,
|
|
1225
1225
|
maxVariantCells: o
|
|
@@ -1245,7 +1245,7 @@ function jt({
|
|
|
1245
1245
|
]
|
|
1246
1246
|
}
|
|
1247
1247
|
);
|
|
1248
|
-
const r =
|
|
1248
|
+
const r = Bt(t, o), n = ((c = r.row) == null ? void 0 : c[1]) ?? [void 0], s = ((u = r.column) == null ? void 0 : u[1]) ?? [void 0], a = t.component;
|
|
1249
1249
|
return /* @__PURE__ */ C(
|
|
1250
1250
|
"section",
|
|
1251
1251
|
{
|
|
@@ -1275,7 +1275,7 @@ function jt({
|
|
|
1275
1275
|
},
|
|
1276
1276
|
children: n.flatMap(
|
|
1277
1277
|
(g) => s.map((h) => {
|
|
1278
|
-
const S =
|
|
1278
|
+
const S = jt(t, r, g, h), m = [
|
|
1279
1279
|
r.row && g ? `${r.row[0]}=${g}` : "",
|
|
1280
1280
|
r.column && h ? `${r.column[0]}=${h}` : ""
|
|
1281
1281
|
].filter(Boolean).join(" · ");
|
|
@@ -1291,7 +1291,7 @@ function jt({
|
|
|
1291
1291
|
},
|
|
1292
1292
|
children: [
|
|
1293
1293
|
m ? /* @__PURE__ */ w("div", { style: { marginBottom: 12, color: _, fontSize: 11 }, children: m }) : null,
|
|
1294
|
-
/* @__PURE__ */ w("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children:
|
|
1294
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Ce(
|
|
1295
1295
|
a,
|
|
1296
1296
|
S,
|
|
1297
1297
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
@@ -1317,7 +1317,7 @@ function jt({
|
|
|
1317
1317
|
},
|
|
1318
1318
|
children: [
|
|
1319
1319
|
/* @__PURE__ */ w("div", { style: { marginBottom: 12, color: _, fontSize: 11 }, children: S }),
|
|
1320
|
-
|
|
1320
|
+
Ce(
|
|
1321
1321
|
a,
|
|
1322
1322
|
{ ...t.defaultProps, [g]: S },
|
|
1323
1323
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
@@ -1331,16 +1331,16 @@ function jt({
|
|
|
1331
1331
|
}
|
|
1332
1332
|
);
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1335
|
-
|
|
1334
|
+
function on(e) {
|
|
1335
|
+
Ue(e.items);
|
|
1336
1336
|
const t = {}, o = [], r = [], n = e.maxVariantCells ?? 60;
|
|
1337
1337
|
for (const s of e.items) {
|
|
1338
|
-
const a =
|
|
1338
|
+
const a = Be(
|
|
1339
1339
|
e.kind,
|
|
1340
1340
|
s.id,
|
|
1341
1341
|
e.registryPrefix
|
|
1342
1342
|
), c = e.registry[s.name], u = () => /* @__PURE__ */ w(
|
|
1343
|
-
|
|
1343
|
+
Ut,
|
|
1344
1344
|
{
|
|
1345
1345
|
item: s,
|
|
1346
1346
|
entry: c,
|
|
@@ -1357,7 +1357,7 @@ function rn(e) {
|
|
|
1357
1357
|
width: 1,
|
|
1358
1358
|
height: 1,
|
|
1359
1359
|
frameSizeMode: "content"
|
|
1360
|
-
}), r.push(
|
|
1360
|
+
}), r.push(je(s, s.id));
|
|
1361
1361
|
}
|
|
1362
1362
|
return {
|
|
1363
1363
|
registry: t,
|
|
@@ -1368,31 +1368,31 @@ function rn(e) {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
1370
1370
|
}
|
|
1371
|
-
const
|
|
1371
|
+
const $e = /^[a-f0-9]{64}$/, Ht = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, qt = /^p\d+$/;
|
|
1372
1372
|
function we(e) {
|
|
1373
|
-
return typeof e == "string" &&
|
|
1373
|
+
return typeof e == "string" && Ht.test(e) ? e : void 0;
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function Oe(e, t) {
|
|
1376
1376
|
const o = new URL(e, t);
|
|
1377
1377
|
return o.search = "", o.hash = "", o.pathname.endsWith("/") || (o.pathname = `${o.pathname}/`), o.href;
|
|
1378
1378
|
}
|
|
1379
1379
|
function he(e) {
|
|
1380
1380
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1381
1381
|
const t = e;
|
|
1382
|
-
return typeof t.domStructureHash != "string" ||
|
|
1382
|
+
return typeof t.domStructureHash != "string" || !$e.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !$e.test(t.screenshotHash) ? null : {
|
|
1383
1383
|
domStructureHash: t.domStructureHash,
|
|
1384
1384
|
screenshotHash: t.screenshotHash,
|
|
1385
1385
|
...we(t.screenshotUrl) ? { screenshotUrl: we(t.screenshotUrl) } : {}
|
|
1386
1386
|
};
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1388
|
+
function Me(e) {
|
|
1389
1389
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1390
1390
|
const t = e;
|
|
1391
1391
|
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) };
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function Kt(e) {
|
|
1394
1394
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1395
|
-
const t = e, o =
|
|
1395
|
+
const t = e, o = Me(t.before), r = Me(t.after);
|
|
1396
1396
|
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)
|
|
1397
1397
|
return null;
|
|
1398
1398
|
const n = t.heatmapUrl == null ? null : we(t.heatmapUrl) ?? null;
|
|
@@ -1407,7 +1407,7 @@ function qt(e) {
|
|
|
1407
1407
|
heatmapUrl: n
|
|
1408
1408
|
};
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1410
|
+
function Gt(e, t) {
|
|
1411
1411
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1412
1412
|
const o = e;
|
|
1413
1413
|
if (typeof o.id != "string" || !o.id) return null;
|
|
@@ -1415,7 +1415,7 @@ function Kt(e, t) {
|
|
|
1415
1415
|
if (!n) return null;
|
|
1416
1416
|
const s = he(o.after);
|
|
1417
1417
|
if (t === "changed" && !s) return null;
|
|
1418
|
-
const a = s ?
|
|
1418
|
+
const a = s ? Kt(o.pixelDiff) : null;
|
|
1419
1419
|
return {
|
|
1420
1420
|
id: o.id,
|
|
1421
1421
|
before: n,
|
|
@@ -1427,7 +1427,7 @@ function Kt(e, t) {
|
|
|
1427
1427
|
...a ? { pixelDiff: a } : {}
|
|
1428
1428
|
};
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function Jt(e, t = []) {
|
|
1431
1431
|
const o = new Set(t), r = o.size > 0, n = /* @__PURE__ */ new Set(), s = [
|
|
1432
1432
|
...e.styles.map((a) => a.affectedFrames ?? []),
|
|
1433
1433
|
...e.texts.map((a) => a.affectedFrames ?? []),
|
|
@@ -1435,7 +1435,7 @@ function Gt(e, t = []) {
|
|
|
1435
1435
|
];
|
|
1436
1436
|
for (const a of s)
|
|
1437
1437
|
for (const c of a) {
|
|
1438
|
-
if (r &&
|
|
1438
|
+
if (r && qt.test(c.id) && !o.has(c.id))
|
|
1439
1439
|
throw new Error(
|
|
1440
1440
|
`"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
|
|
1441
1441
|
);
|
|
@@ -1443,7 +1443,7 @@ function Gt(e, t = []) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
return [...n].sort();
|
|
1445
1445
|
}
|
|
1446
|
-
async function
|
|
1446
|
+
async function ke(e, t, o) {
|
|
1447
1447
|
const r = await e(`${t.replace(/\/$/, "")}/capture`, {
|
|
1448
1448
|
method: "POST",
|
|
1449
1449
|
headers: { "content-type": "application/json" },
|
|
@@ -1455,7 +1455,7 @@ async function Me(e, t, o) {
|
|
|
1455
1455
|
);
|
|
1456
1456
|
if (typeof n.baselineId != "string" || !n.baselineId)
|
|
1457
1457
|
throw new Error("Pygmalion visual QA response has no baselineId");
|
|
1458
|
-
const s = Array.isArray(n.frames) ? n.frames.map((h) =>
|
|
1458
|
+
const s = Array.isArray(n.frames) ? n.frames.map((h) => Gt(h, o.phase)).filter((h) => h != null) : [], a = Array.isArray(n.failures) ? n.failures.map((h) => {
|
|
1459
1459
|
if (!h || typeof h != "object" || Array.isArray(h)) return null;
|
|
1460
1460
|
const S = h;
|
|
1461
1461
|
return typeof S.id == "string" && typeof S.error == "string" ? { id: S.id, error: S.error } : null;
|
|
@@ -1472,12 +1472,12 @@ const pe = {
|
|
|
1472
1472
|
mirror: "/__pygmalion-dev-control",
|
|
1473
1473
|
sessions: "/__pygmalion-design-session",
|
|
1474
1474
|
inspect: "/__pygmalion-inspect"
|
|
1475
|
-
},
|
|
1476
|
-
function
|
|
1475
|
+
}, Wt = "pygmalion.designSessionId", Vt = "/__pygmalion-qa", ie = /* @__PURE__ */ new Map();
|
|
1476
|
+
function De() {
|
|
1477
1477
|
var e;
|
|
1478
1478
|
return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function Qt(e, t) {
|
|
1481
1481
|
if (e) return e;
|
|
1482
1482
|
const o = ie.get(t);
|
|
1483
1483
|
if (o) return o;
|
|
@@ -1485,31 +1485,31 @@ function Vt(e, t) {
|
|
|
1485
1485
|
const r = window.localStorage.getItem(t);
|
|
1486
1486
|
if (r)
|
|
1487
1487
|
return ie.set(t, r), r;
|
|
1488
|
-
const n =
|
|
1488
|
+
const n = De();
|
|
1489
1489
|
return window.localStorage.setItem(t, n), ie.set(t, n), n;
|
|
1490
1490
|
} catch {
|
|
1491
|
-
const r =
|
|
1491
|
+
const r = De();
|
|
1492
1492
|
return ie.set(t, r), r;
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
|
-
async function
|
|
1495
|
+
async function W(e) {
|
|
1496
1496
|
const t = await e.json();
|
|
1497
1497
|
if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
|
|
1498
1498
|
return t;
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function sn(e = {}) {
|
|
1501
1501
|
var x, j, $, i, l;
|
|
1502
1502
|
const {
|
|
1503
1503
|
sessionId: t,
|
|
1504
|
-
sessionStorageKey: o =
|
|
1504
|
+
sessionStorageKey: o = Wt,
|
|
1505
1505
|
autoStart: r = !0,
|
|
1506
1506
|
fetcher: n = fetch,
|
|
1507
1507
|
formatApplyMessage: s
|
|
1508
|
-
} = e, a = ((x = e.endpoints) == null ? void 0 : x.mirror) ?? pe.mirror, c = ((j = e.endpoints) == null ? void 0 : j.sessions) ?? pe.sessions, u = (($ = e.endpoints) == null ? void 0 : $.inspect) ?? pe.inspect, g = e.visualQa != null, h = ((i = e.visualQa) == null ? void 0 : i.endpoint) ??
|
|
1508
|
+
} = e, a = ((x = e.endpoints) == null ? void 0 : x.mirror) ?? pe.mirror, c = ((j = e.endpoints) == null ? void 0 : j.sessions) ?? pe.sessions, u = (($ = e.endpoints) == null ? void 0 : $.inspect) ?? pe.inspect, g = e.visualQa != null, h = ((i = e.visualQa) == null ? void 0 : i.endpoint) ?? Vt, S = JSON.stringify(((l = e.visualQa) == null ? void 0 : l.eligibleFrameIds) ?? []), m = ae(
|
|
1509
1509
|
() => JSON.parse(S),
|
|
1510
1510
|
[S]
|
|
1511
1511
|
), I = ae(
|
|
1512
|
-
() =>
|
|
1512
|
+
() => Qt(t, o),
|
|
1513
1513
|
[t, o]
|
|
1514
1514
|
), [y, N] = re({
|
|
1515
1515
|
state: "idle",
|
|
@@ -1539,24 +1539,24 @@ function on(e = {}) {
|
|
|
1539
1539
|
headers: { "content-type": "application/json" },
|
|
1540
1540
|
body: JSON.stringify({ ref: f })
|
|
1541
1541
|
} : {}
|
|
1542
|
-
}), R = await
|
|
1542
|
+
}), R = await W(k);
|
|
1543
1543
|
const L = Date.now();
|
|
1544
1544
|
for (; !d && R.state === "syncing" && Date.now() - L < 12e4; )
|
|
1545
|
-
await new Promise((ne) => window.setTimeout(ne, 500)), k = await n(`${a}/status`), R = await
|
|
1545
|
+
await new Promise((ne) => window.setTimeout(ne, 500)), k = await n(`${a}/status`), R = await W(k);
|
|
1546
1546
|
if (R.state !== "ready" || !R.appOrigin || !R.commit)
|
|
1547
1547
|
throw new Error(R.error ?? "Pygmalion could not prepare the source preview");
|
|
1548
|
-
const
|
|
1548
|
+
const J = await W(
|
|
1549
1549
|
await n(`${c}/open`, {
|
|
1550
1550
|
method: "POST",
|
|
1551
1551
|
headers: { "content-type": "application/json" },
|
|
1552
1552
|
body: JSON.stringify({ sessionId: I, baseDevSha: R.commit })
|
|
1553
1553
|
})
|
|
1554
1554
|
);
|
|
1555
|
-
if (!
|
|
1556
|
-
throw new Error(
|
|
1557
|
-
let H =
|
|
1555
|
+
if (!J.ok || !J.session)
|
|
1556
|
+
throw new Error(J.error ?? "Pygmalion could not open the design session");
|
|
1557
|
+
let H = J.session;
|
|
1558
1558
|
if (H.branchName) {
|
|
1559
|
-
const ne = await
|
|
1559
|
+
const ne = await W(
|
|
1560
1560
|
await n(`${c}/check`, {
|
|
1561
1561
|
method: "POST",
|
|
1562
1562
|
headers: { "content-type": "application/json" },
|
|
@@ -1586,7 +1586,7 @@ function on(e = {}) {
|
|
|
1586
1586
|
[n, a, c, I]
|
|
1587
1587
|
), B = X(async () => {
|
|
1588
1588
|
try {
|
|
1589
|
-
const d = await
|
|
1589
|
+
const d = await W(
|
|
1590
1590
|
await n(`${a}/refs`)
|
|
1591
1591
|
), f = {
|
|
1592
1592
|
refs: d.refs ?? [],
|
|
@@ -1613,7 +1613,7 @@ function on(e = {}) {
|
|
|
1613
1613
|
const f = E.current;
|
|
1614
1614
|
if (f && (f.sessionId !== p.id || f.baseDevSha !== p.baseDevSha || f.revision !== p.revision || f.fingerprint !== JSON.stringify(d)))
|
|
1615
1615
|
throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
|
|
1616
|
-
const v = await
|
|
1616
|
+
const v = await W(
|
|
1617
1617
|
await n(`${c}/apply-visual`, {
|
|
1618
1618
|
method: "POST",
|
|
1619
1619
|
headers: { "content-type": "application/json" },
|
|
@@ -1633,20 +1633,20 @@ function on(e = {}) {
|
|
|
1633
1633
|
let k;
|
|
1634
1634
|
if (f != null && f.qaBaselineId && ((R = f.qaFrameIds) != null && R.length) && v.session.appOrigin)
|
|
1635
1635
|
try {
|
|
1636
|
-
k = await
|
|
1636
|
+
k = await ke(n, h, {
|
|
1637
1637
|
phase: "changed",
|
|
1638
1638
|
baselineId: f.qaBaselineId,
|
|
1639
|
-
basePath:
|
|
1639
|
+
basePath: Oe(v.session.appOrigin, window.location.origin),
|
|
1640
1640
|
frameIds: f.qaFrameIds
|
|
1641
1641
|
});
|
|
1642
1642
|
} catch (L) {
|
|
1643
|
-
const
|
|
1643
|
+
const J = L instanceof Error ? L.message : String(L);
|
|
1644
1644
|
k = {
|
|
1645
1645
|
phase: "changed",
|
|
1646
1646
|
baselineId: f.qaBaselineId,
|
|
1647
1647
|
complete: !1,
|
|
1648
1648
|
frames: [],
|
|
1649
|
-
failures: f.qaFrameIds.map((H) => ({ id: H, error:
|
|
1649
|
+
failures: f.qaFrameIds.map((H) => ({ id: H, error: J }))
|
|
1650
1650
|
};
|
|
1651
1651
|
}
|
|
1652
1652
|
return E.current = null, {
|
|
@@ -1663,7 +1663,7 @@ function on(e = {}) {
|
|
|
1663
1663
|
var R;
|
|
1664
1664
|
if (!p) throw new Error("Pygmalion design session is not ready");
|
|
1665
1665
|
E.current = null;
|
|
1666
|
-
const f = await
|
|
1666
|
+
const f = await W(
|
|
1667
1667
|
await n(`${c}/preview-visual`, {
|
|
1668
1668
|
method: "POST",
|
|
1669
1669
|
headers: { "content-type": "application/json" },
|
|
@@ -1677,15 +1677,15 @@ function on(e = {}) {
|
|
|
1677
1677
|
);
|
|
1678
1678
|
if (!f.ok || !Number.isSafeInteger(f.revision))
|
|
1679
1679
|
throw new Error(f.error ?? "Pygmalion could not preview the visual changes");
|
|
1680
|
-
const v = g ?
|
|
1680
|
+
const v = g ? Jt(d, m) : [];
|
|
1681
1681
|
let P;
|
|
1682
1682
|
const k = p.appOrigin ?? y.appOrigin;
|
|
1683
1683
|
if (v.length > 0) {
|
|
1684
1684
|
if (!k)
|
|
1685
1685
|
throw new Error("Impact screen QA baseline preview not ready");
|
|
1686
|
-
if (P = await
|
|
1686
|
+
if (P = await ke(n, h, {
|
|
1687
1687
|
phase: "baseline",
|
|
1688
|
-
basePath:
|
|
1688
|
+
basePath: Oe(k, window.location.origin),
|
|
1689
1689
|
frameIds: v
|
|
1690
1690
|
}), !P.complete)
|
|
1691
1691
|
throw new Error(
|
|
@@ -1717,7 +1717,7 @@ function on(e = {}) {
|
|
|
1717
1717
|
), te = X(
|
|
1718
1718
|
async (d) => {
|
|
1719
1719
|
if (d.length === 0) return { files: [] };
|
|
1720
|
-
const f = await
|
|
1720
|
+
const f = await W(
|
|
1721
1721
|
await n(`${u}/impact`, {
|
|
1722
1722
|
method: "POST",
|
|
1723
1723
|
headers: { "content-type": "application/json" },
|
|
@@ -1729,10 +1729,10 @@ function on(e = {}) {
|
|
|
1729
1729
|
return { files: Array.isArray(f.files) ? f.files : [] };
|
|
1730
1730
|
},
|
|
1731
1731
|
[n, u]
|
|
1732
|
-
),
|
|
1732
|
+
), V = X(async () => {
|
|
1733
1733
|
if (!(p != null && p.canRevert) || !p.headSha)
|
|
1734
1734
|
throw new Error("There are no reversible changes applied");
|
|
1735
|
-
const d = await
|
|
1735
|
+
const d = await W(
|
|
1736
1736
|
await n(`${c}/revert-visual`, {
|
|
1737
1737
|
method: "POST",
|
|
1738
1738
|
headers: { "content-type": "application/json" },
|
|
@@ -1757,12 +1757,12 @@ function on(e = {}) {
|
|
|
1757
1757
|
}, [r, D]), oe(() => {
|
|
1758
1758
|
r && B();
|
|
1759
1759
|
}, [r]);
|
|
1760
|
-
const
|
|
1760
|
+
const G = (p == null ? void 0 : p.appOrigin) ?? y.appOrigin ?? A, Q = (p == null ? void 0 : p.headSha) ?? (p == null ? void 0 : p.baseDevSha) ?? y.commit ?? "pending";
|
|
1761
1761
|
return {
|
|
1762
1762
|
mirror: y,
|
|
1763
1763
|
session: p,
|
|
1764
1764
|
ready: A != null,
|
|
1765
|
-
appOrigin:
|
|
1765
|
+
appOrigin: G,
|
|
1766
1766
|
previewRevision: `${Q}:${(p == null ? void 0 : p.revision) ?? 0}`,
|
|
1767
1767
|
previewSourceRevision: Q,
|
|
1768
1768
|
refresh: D,
|
|
@@ -1772,10 +1772,10 @@ function on(e = {}) {
|
|
|
1772
1772
|
previewVisual: K,
|
|
1773
1773
|
inspectImpact: te,
|
|
1774
1774
|
applyVisual: ee,
|
|
1775
|
-
revertLastVisual:
|
|
1775
|
+
revertLastVisual: V
|
|
1776
1776
|
};
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function an({
|
|
1779
1779
|
value: e,
|
|
1780
1780
|
refs: t,
|
|
1781
1781
|
onChange: o,
|
|
@@ -1852,22 +1852,22 @@ function sn({
|
|
|
1852
1852
|
}
|
|
1853
1853
|
);
|
|
1854
1854
|
}
|
|
1855
|
-
const
|
|
1855
|
+
const cn = {
|
|
1856
1856
|
editor: q,
|
|
1857
|
-
getObserverTree:
|
|
1858
|
-
isObservableProp:
|
|
1857
|
+
getObserverTree: Ke,
|
|
1858
|
+
isObservableProp: qe
|
|
1859
1859
|
};
|
|
1860
|
-
function
|
|
1860
|
+
function ln(e) {
|
|
1861
1861
|
q.navigateToPageByName(e);
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function dn() {
|
|
1864
1864
|
q.openPreview();
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1867
|
-
const e =
|
|
1868
|
-
return e &&
|
|
1866
|
+
function un() {
|
|
1867
|
+
const e = Pe.entries.length > 0;
|
|
1868
|
+
return e && Pe.discardPending(), q.resetCurrentEdits() || e;
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1870
|
+
function fn({
|
|
1871
1871
|
registry: e,
|
|
1872
1872
|
tokens: t,
|
|
1873
1873
|
initialPages: o,
|
|
@@ -1889,13 +1889,13 @@ function un({
|
|
|
1889
1889
|
onInspectPreview: A,
|
|
1890
1890
|
onInspectImpact: F,
|
|
1891
1891
|
storyboardDiscovery: M = !0,
|
|
1892
|
-
storyboardDiscoveryEndpoint: T =
|
|
1892
|
+
storyboardDiscoveryEndpoint: T = st
|
|
1893
1893
|
}) {
|
|
1894
1894
|
const [b, E] = re(!M), [D, B] = re();
|
|
1895
|
-
n && (n.assertComplete(),
|
|
1895
|
+
n && (n.assertComplete(), Ge(n));
|
|
1896
1896
|
const Z = e ?? (n == null ? void 0 : n.getRegistry()), ee = t ?? (n == null ? void 0 : n.getTokens()), K = o ?? (n == null ? void 0 : n.getInitialPages());
|
|
1897
|
-
Z &&
|
|
1898
|
-
const te = D ?? g,
|
|
1897
|
+
Z && Je(Z), ee && We(ee), r && Ve(r), lt(s ?? null), a != null && Qe(a), c != null && Le(c), Xe(u);
|
|
1898
|
+
const te = D ?? g, V = (K ?? []).flatMap(
|
|
1899
1899
|
(x) => x.route && x.importPageId ? [
|
|
1900
1900
|
{
|
|
1901
1901
|
canonicalId: x.importPageId,
|
|
@@ -1908,42 +1908,42 @@ function un({
|
|
|
1908
1908
|
assertions: x.assertions
|
|
1909
1909
|
}
|
|
1910
1910
|
] : []
|
|
1911
|
-
),
|
|
1911
|
+
), G = me([]), Q = V.map((x) => ({
|
|
1912
1912
|
id: x.canonicalId,
|
|
1913
|
-
fingerprint:
|
|
1913
|
+
fingerprint: Ye(
|
|
1914
1914
|
x,
|
|
1915
1915
|
ve(),
|
|
1916
1916
|
be()
|
|
1917
1917
|
)
|
|
1918
1918
|
}));
|
|
1919
|
-
return
|
|
1919
|
+
return G.current = Q, te && K && b && Ze(te, {
|
|
1920
1920
|
namespace: u ?? "",
|
|
1921
1921
|
previewRevision: ve(),
|
|
1922
|
-
appOrigin:
|
|
1922
|
+
appOrigin: dt(),
|
|
1923
1923
|
baselineEnvironment: be(),
|
|
1924
1924
|
allowStaleIdentity: D == null && !!h,
|
|
1925
|
-
pages:
|
|
1925
|
+
pages: V.map((x, j) => {
|
|
1926
1926
|
var $;
|
|
1927
1927
|
return {
|
|
1928
1928
|
...x,
|
|
1929
1929
|
fingerprint: ($ = Q[j]) == null ? void 0 : $.fingerprint
|
|
1930
1930
|
};
|
|
1931
1931
|
})
|
|
1932
|
-
}), S != null &&
|
|
1933
|
-
|
|
1934
|
-
const x =
|
|
1932
|
+
}), S != null && et(S), ut(I ?? null), y != null && tt(y), ft(N ?? null), ht(O ?? null), nt(A ?? null), pt(F ?? null), K && q.initPagesFromComponents(K), oe(() => {
|
|
1933
|
+
Ee(p ?? null);
|
|
1934
|
+
const x = rt(q);
|
|
1935
1935
|
return () => {
|
|
1936
|
-
x(),
|
|
1936
|
+
x(), Ee(null);
|
|
1937
1937
|
};
|
|
1938
1938
|
}, [p]), oe(() => {
|
|
1939
1939
|
if (B(void 0), !b || !h || !(u != null && u.trim()) || !(c != null && c.trim()))
|
|
1940
1940
|
return;
|
|
1941
|
-
const x = new AbortController(), j =
|
|
1941
|
+
const x = new AbortController(), j = ot({
|
|
1942
1942
|
endpoint: h,
|
|
1943
1943
|
captureBaseUrl: a
|
|
1944
|
-
}), $ = (l, d, f) =>
|
|
1944
|
+
}), $ = (l, d, f) => at({
|
|
1945
1945
|
namespace: u,
|
|
1946
|
-
sourceRevision:
|
|
1946
|
+
sourceRevision: ct(c),
|
|
1947
1947
|
transport: j,
|
|
1948
1948
|
signal: f,
|
|
1949
1949
|
...l.length ? { frames: l } : {},
|
|
@@ -1951,7 +1951,7 @@ function un({
|
|
|
1951
1951
|
}).then((v) => {
|
|
1952
1952
|
!f.aborted && v.status === "accepted" && B(v.artifact);
|
|
1953
1953
|
});
|
|
1954
|
-
$(
|
|
1954
|
+
G.current.length && $(G.current, !1, x.signal);
|
|
1955
1955
|
const i = new AbortController();
|
|
1956
1956
|
return Ie((l) => {
|
|
1957
1957
|
$(l, !0, i.signal).catch(() => {
|
|
@@ -1972,7 +1972,7 @@ function un({
|
|
|
1972
1972
|
x = !1;
|
|
1973
1973
|
};
|
|
1974
1974
|
const j = new AbortController();
|
|
1975
|
-
return E(!1), se(void 0), Y(null),
|
|
1975
|
+
return E(!1), se(void 0), Y(null), _e({
|
|
1976
1976
|
endpoint: T,
|
|
1977
1977
|
signal: j.signal,
|
|
1978
1978
|
pages: q.pages.map(($) => ({
|
|
@@ -1982,9 +1982,9 @@ function un({
|
|
|
1982
1982
|
})),
|
|
1983
1983
|
assets: (n == null ? void 0 : n.getAssets("screens")) ?? []
|
|
1984
1984
|
}).then(($) => {
|
|
1985
|
-
x && (se($.baselineEnvironment), Y($.graph));
|
|
1985
|
+
x && (se($.baselineEnvironment), xe($.manifest.routes ?? null), Y($.graph));
|
|
1986
1986
|
}).catch(() => {
|
|
1987
|
-
x && (se(void 0), Y(null));
|
|
1987
|
+
x && (se(void 0), xe(null), Y(null));
|
|
1988
1988
|
}).finally(() => {
|
|
1989
1989
|
x && E(!0);
|
|
1990
1990
|
}), () => {
|
|
@@ -1997,7 +1997,7 @@ function un({
|
|
|
1997
1997
|
T
|
|
1998
1998
|
]), oe(() => {
|
|
1999
1999
|
m == null || m === q.previewOpen || (m ? q.openPreview({ notifyHost: !1 }) : q.closePreview({ notifyHost: !1 }));
|
|
2000
|
-
}, [m]), b ? /* @__PURE__ */ w(
|
|
2000
|
+
}, [m]), b ? /* @__PURE__ */ w(it, {}) : /* @__PURE__ */ w(
|
|
2001
2001
|
"div",
|
|
2002
2002
|
{
|
|
2003
2003
|
"data-pygmalion-storyboard-loading": "",
|
|
@@ -2016,63 +2016,63 @@ function un({
|
|
|
2016
2016
|
);
|
|
2017
2017
|
}
|
|
2018
2018
|
export {
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2019
|
+
mn as DESIGN_IMPORT_KINDS,
|
|
2020
|
+
en as PygmalionCatalogDocument,
|
|
2021
|
+
nn as PygmalionCatalogMatrix,
|
|
2022
|
+
tn as PygmalionCatalogSection,
|
|
2023
|
+
fn as PygmalionEditor,
|
|
2024
|
+
st as STORYBOARD_ENVIRONMENT_CONTROL,
|
|
2025
|
+
gn as STORYBOARD_ENVIRONMENT_QUERY,
|
|
2026
|
+
an as SourceRefControl,
|
|
2027
|
+
cn as __debug,
|
|
2028
|
+
yn as applyTokenOverride,
|
|
2029
|
+
at as bootstrapPreviewArtifact,
|
|
2030
|
+
wn as clearPygmalionPreviewCache,
|
|
2031
|
+
on as createDesignComponentCatalog,
|
|
2032
|
+
Bt as createDesignComponentVariantMatrix,
|
|
2033
|
+
rn as createDesignGalleryCatalog,
|
|
2034
|
+
Sn as createDesignImportController,
|
|
2035
|
+
bn as createDesignScreenCollection,
|
|
2036
|
+
ot as createPreviewArtifactHttpTransport,
|
|
2037
|
+
vn as createPreviewCacheNamespace,
|
|
2038
|
+
In as createPreviewFrameFingerprint,
|
|
2039
|
+
xn as createPreviewRecipeFingerprint,
|
|
2040
|
+
Pn as createStoryboardCaptureRecipeIdentity,
|
|
2041
|
+
wt as createStoryboardGraph,
|
|
2042
|
+
kt as createStoryboardGraphFromDiscovery,
|
|
2043
|
+
En as createStoryboardGraphViewModel,
|
|
2044
|
+
Cn as createStoryboardRouteUrl,
|
|
2045
|
+
Tt as designCatalogKey,
|
|
2046
|
+
Be as designCatalogRegistryName,
|
|
2047
|
+
Nn as expandDesignScreenCasesViewports,
|
|
2048
|
+
Rn as expandDesignScreenCollectionViewports,
|
|
2049
|
+
An as getRecommendedPygmalionPreviewConcurrency,
|
|
2050
2050
|
be as getStoryboardBaselineEnvironment,
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2051
|
+
ze as getStoryboardDiscoveryBaselineEnvironment,
|
|
2052
|
+
$n as getStoryboardGraph,
|
|
2053
|
+
On as getViewportPresets,
|
|
2054
|
+
_e as loadStoryboardDiscovery,
|
|
2055
|
+
Mn as mergeScreenPresets,
|
|
2056
|
+
He as mergeStoryboardEnvironment,
|
|
2057
|
+
Zt as publishStoryboardDiscovery,
|
|
2058
|
+
ln as pygmalionNavigate,
|
|
2059
|
+
dn as pygmalionOpenPreview,
|
|
2060
|
+
un as pygmalionResetCurrentEdits,
|
|
2061
|
+
kn as reconstructRoutePreviewArtifactScreenshotV3,
|
|
2062
|
+
Dn as reconstructRoutePreviewArtifactSnapshotV3,
|
|
2063
|
+
Fn as resetTokenOverrides,
|
|
2064
|
+
Pt as resolveStoryboardScreenCases,
|
|
2065
|
+
Je as setComponentRegistry,
|
|
2066
|
+
Qe as setPygmalionAppOrigin,
|
|
2067
|
+
et as setPygmalionPreviewConcurrency,
|
|
2068
|
+
Le as setPygmalionPreviewRevision,
|
|
2069
2069
|
se as setStoryboardBaselineEnvironment,
|
|
2070
2070
|
Y as setStoryboardGraph,
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2071
|
+
We as setTokens,
|
|
2072
|
+
Ve as setViewportPresets,
|
|
2073
|
+
mt as storyboardScreenRecipeKey,
|
|
2074
|
+
Tn as subscribeStoryboardGraph,
|
|
2075
|
+
sn as usePygmalionProject,
|
|
2076
|
+
zn as validatePreviewArtifactBundle,
|
|
2077
|
+
_n as validateRoutePreviewArtifactV3Browser
|
|
2078
2078
|
};
|