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