@pygmalionjs/pygmalion 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist-lib/pygmalion.js +720 -703
- package/node/dev-mirror.mjs +4 -1
- package/package.json +1 -1
- package/types.d.ts +4 -0
package/dist-lib/pygmalion.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { b as ne, m as Ze, i as et, g as tt, e as
|
|
3
|
-
import { Q as Rn, R as An, T as Mn, U as
|
|
4
|
-
import { createElement as Te, useMemo as
|
|
1
|
+
import { jsxs as $, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { b as ne, m as Ze, i as et, g as tt, e as V, c as nt, a as rt, d as ot, f as st, h as it, j as at, k as ct, l as be, n as lt, o as dt, p as ut, q as ft, r as pt, t as mt, u as Me, v as gt, w as ht, x as yt, y as $e, z as ve, A as de, B as ue, C as Oe, S as wt, D as bt, E as De, G as vt, H as ke, I as St, J as It, K as xt, L as Pt, M as Et, O as Ct, P as Fe } from "./App-BE2sN74X.js";
|
|
3
|
+
import { Q as Rn, R as An, T as Mn, U as $n, V as On, W as Dn, X as kn, Y as Fn, Z as Tn, _ as zn, $ as _n, a0 as jn, a1 as Bn, a2 as Un, a3 as Hn, a4 as qn, a5 as Gn, a6 as Kn, a7 as Ln, a8 as Wn, a9 as Vn, aa as Jn, ab as Qn, ac as Xn, ad as Yn, ae as Zn, af as er, ag as tr, ah as nr, ai as rr, aj as or, ak as sr, al as ir, am as ar, an as cr, ao as lr, ap as dr, aq as ur, ar as fr, as as pr, at as mr, au as gr, av as hr } from "./App-BE2sN74X.js";
|
|
4
|
+
import { createElement as Te, useMemo as re, useState as ie, useRef as xe, useCallback as te, useEffect as ae, useLayoutEffect as ze } from "react";
|
|
5
5
|
function Pe(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;
|
|
@@ -76,220 +76,220 @@ function _e(e) {
|
|
|
76
76
|
].join(":");
|
|
77
77
|
}
|
|
78
78
|
function Mt(e) {
|
|
79
|
-
var
|
|
79
|
+
var j, W;
|
|
80
80
|
const t = [], o = [], r = /* @__PURE__ */ new Map();
|
|
81
81
|
for (const i of e.screens) {
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
82
|
+
const c = i.id.trim();
|
|
83
|
+
if (!c || r.has(c)) {
|
|
84
84
|
t.push({
|
|
85
85
|
code: "duplicate-screen-id",
|
|
86
86
|
severity: "error",
|
|
87
|
-
message:
|
|
88
|
-
screenId:
|
|
87
|
+
message: c ? `Multiple storyboard screens use the id "${c}".` : "A storyboard screen has an empty id.",
|
|
88
|
+
screenId: c || void 0
|
|
89
89
|
});
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
const l =
|
|
93
|
-
r.set(
|
|
92
|
+
const l = c === i.id ? i : { ...i, id: c };
|
|
93
|
+
r.set(c, l), o.push(l);
|
|
94
94
|
}
|
|
95
95
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
96
96
|
for (const i of o) {
|
|
97
|
-
let
|
|
97
|
+
let c;
|
|
98
98
|
try {
|
|
99
|
-
if (
|
|
100
|
-
} catch (
|
|
99
|
+
if (c = (e.recipeKey ?? Nt)(i), !c.trim()) throw new Error("Recipe keys cannot be empty.");
|
|
100
|
+
} catch (g) {
|
|
101
101
|
s.add(i.id), t.push({
|
|
102
102
|
code: "invalid-recipe",
|
|
103
103
|
severity: "error",
|
|
104
|
-
message:
|
|
104
|
+
message: g instanceof Error ? g.message : "Storyboard recipe identity could not be created.",
|
|
105
105
|
screenId: i.id
|
|
106
|
-
}),
|
|
106
|
+
}), c = `invalid:${i.id}`;
|
|
107
107
|
}
|
|
108
|
-
const l = n.get(
|
|
109
|
-
l ? l.screens.push(i) : n.set(
|
|
108
|
+
const l = n.get(c);
|
|
109
|
+
l ? l.screens.push(i) : n.set(c, { recipeKey: c, screens: [i] });
|
|
110
110
|
}
|
|
111
|
-
const
|
|
112
|
-
for (const i of
|
|
113
|
-
for (const
|
|
114
|
-
const u = new Map(
|
|
115
|
-
|
|
111
|
+
const a = [...n.values()].map(At).sort((i, c) => i.id.localeCompare(c.id)), d = {};
|
|
112
|
+
for (const i of a)
|
|
113
|
+
for (const c of i.screenIds) d[c] = i.id;
|
|
114
|
+
const u = new Map(a.map((i) => [i.id, i])), h = (i, c) => T([
|
|
115
|
+
c,
|
|
116
116
|
...(i ?? []).flatMap((l) => {
|
|
117
|
-
const
|
|
118
|
-
return
|
|
117
|
+
const g = l.trim(), x = d[g] ?? (u.has(g) ? g : null);
|
|
118
|
+
return x ? [x] : [];
|
|
119
119
|
})
|
|
120
|
-
]),
|
|
120
|
+
]), p = /* @__PURE__ */ new Map();
|
|
121
121
|
for (const i of e.assets ?? []) {
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
const c = p.get(i.pageId);
|
|
123
|
+
c ? c.push(i) : p.set(i.pageId, [i]);
|
|
124
124
|
}
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
(l) =>
|
|
125
|
+
const w = a.map((i) => {
|
|
126
|
+
const c = i.screenIds.flatMap(
|
|
127
|
+
(l) => p.get(l) ?? []
|
|
128
128
|
);
|
|
129
129
|
return {
|
|
130
130
|
...i,
|
|
131
131
|
scenarioIds: T([
|
|
132
132
|
...i.scenarioIds,
|
|
133
|
-
...
|
|
133
|
+
...c.map((l) => l.scenarioId)
|
|
134
134
|
]),
|
|
135
135
|
sourceKeys: T([
|
|
136
136
|
...i.sourceKeys,
|
|
137
|
-
...
|
|
137
|
+
...c.map((l) => l.sourcePath)
|
|
138
138
|
])
|
|
139
139
|
};
|
|
140
|
-
}),
|
|
141
|
-
for (const i of
|
|
142
|
-
for (const
|
|
143
|
-
const l =
|
|
144
|
-
l ? l.push(i.id) :
|
|
140
|
+
}), P = /* @__PURE__ */ new Map();
|
|
141
|
+
for (const i of w)
|
|
142
|
+
for (const c of i.routes) {
|
|
143
|
+
const l = P.get(c);
|
|
144
|
+
l ? l.push(i.id) : P.set(c, [i.id]);
|
|
145
145
|
}
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
return
|
|
146
|
+
const I = (i, c, l) => {
|
|
147
|
+
const g = i.trim(), x = d[g] ?? (u.has(g) ? g : null);
|
|
148
|
+
if (x) return x;
|
|
149
|
+
const R = T(P.get(g) ?? []);
|
|
150
|
+
return R.length === 1 ? R[0] : R.length > 1 ? (t.push({
|
|
151
151
|
code: l === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
|
|
152
152
|
severity: "error",
|
|
153
|
-
message: `Storyboard edge "${
|
|
154
|
-
edgeId:
|
|
155
|
-
screenId:
|
|
153
|
+
message: `Storyboard edge "${c}" references an ambiguous ${l} route.`,
|
|
154
|
+
edgeId: c,
|
|
155
|
+
screenId: g || void 0
|
|
156
156
|
}), null) : (t.push({
|
|
157
157
|
code: l === "source" ? "unknown-edge-source" : "unknown-edge-target",
|
|
158
158
|
severity: "error",
|
|
159
|
-
message: `Storyboard edge "${
|
|
160
|
-
edgeId:
|
|
161
|
-
screenId:
|
|
159
|
+
message: `Storyboard edge "${c}" references an unknown ${l}.`,
|
|
160
|
+
edgeId: c,
|
|
161
|
+
screenId: g || void 0
|
|
162
162
|
}), null);
|
|
163
|
-
},
|
|
163
|
+
}, m = [], E = /* @__PURE__ */ new Map(), f = [
|
|
164
164
|
["explicit", e.explicitEdges ?? []],
|
|
165
165
|
["inferred", e.inferredEdges ?? []]
|
|
166
166
|
];
|
|
167
|
-
let
|
|
168
|
-
for (const [i,
|
|
169
|
-
for (const l of
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
if (!
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
...
|
|
167
|
+
let M = 0;
|
|
168
|
+
for (const [i, c] of f)
|
|
169
|
+
for (const l of c) {
|
|
170
|
+
const g = Rt(l, M);
|
|
171
|
+
M += 1;
|
|
172
|
+
const x = I(l.from, g, "source"), R = I(l.to, g, "target");
|
|
173
|
+
if (!x || !R || x === R) continue;
|
|
174
|
+
const k = h(l.fromScope, x), q = h(l.toScope, R), N = `${x}\0${R}`, y = E.get(N);
|
|
175
|
+
if (y) {
|
|
176
|
+
const _ = {
|
|
177
|
+
...y,
|
|
178
178
|
fromNodeIds: T([
|
|
179
|
-
...
|
|
180
|
-
...
|
|
179
|
+
...y.fromNodeIds ?? [y.from],
|
|
180
|
+
...k
|
|
181
181
|
]),
|
|
182
182
|
toNodeIds: T([
|
|
183
|
-
...
|
|
183
|
+
...y.toNodeIds ?? [y.to],
|
|
184
184
|
...q
|
|
185
185
|
]),
|
|
186
186
|
sourceEdgeIds: T([
|
|
187
|
-
...
|
|
188
|
-
|
|
187
|
+
...y.sourceEdgeIds,
|
|
188
|
+
g
|
|
189
189
|
])
|
|
190
190
|
};
|
|
191
|
-
E.set(
|
|
192
|
-
const G =
|
|
193
|
-
G >= 0 && (
|
|
191
|
+
E.set(N, _);
|
|
192
|
+
const G = m.indexOf(y);
|
|
193
|
+
G >= 0 && (m[G] = _);
|
|
194
194
|
continue;
|
|
195
195
|
}
|
|
196
|
-
const
|
|
197
|
-
id:
|
|
198
|
-
from:
|
|
199
|
-
to:
|
|
200
|
-
fromNodeIds:
|
|
196
|
+
const A = {
|
|
197
|
+
id: g,
|
|
198
|
+
from: x,
|
|
199
|
+
to: R,
|
|
200
|
+
fromNodeIds: k,
|
|
201
201
|
toNodeIds: q,
|
|
202
|
-
kind: ((
|
|
203
|
-
label: ((
|
|
202
|
+
kind: ((j = l.kind) == null ? void 0 : j.trim()) || void 0,
|
|
203
|
+
label: ((W = l.label) == null ? void 0 : W.trim()) || void 0,
|
|
204
204
|
origin: i,
|
|
205
|
-
sourceEdgeIds: [
|
|
205
|
+
sourceEdgeIds: [g]
|
|
206
206
|
};
|
|
207
|
-
E.set(
|
|
207
|
+
E.set(N, A), m.push(A);
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
(i,
|
|
209
|
+
m.sort(
|
|
210
|
+
(i, c) => `${i.from}:${i.to}:${i.id}`.localeCompare(`${c.from}:${c.to}:${c.id}`)
|
|
211
211
|
);
|
|
212
|
-
const D = /* @__PURE__ */ new Map(),
|
|
213
|
-
for (const i of
|
|
214
|
-
for (const
|
|
215
|
-
const l =
|
|
216
|
-
l ? l.push(i) :
|
|
212
|
+
const D = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
|
|
213
|
+
for (const i of m) {
|
|
214
|
+
for (const c of i.fromNodeIds ?? [i.from]) {
|
|
215
|
+
const l = b.get(c);
|
|
216
|
+
l ? l.push(i) : b.set(c, [i]);
|
|
217
217
|
}
|
|
218
|
-
for (const
|
|
219
|
-
const l = D.get(
|
|
220
|
-
l ? l.push(i) : D.set(
|
|
218
|
+
for (const c of i.toNodeIds ?? [i.to]) {
|
|
219
|
+
const l = D.get(c);
|
|
220
|
+
l ? l.push(i) : D.set(c, [i]);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const
|
|
223
|
+
const O = [];
|
|
224
224
|
for (const i of e.startScreenIds ?? []) {
|
|
225
|
-
const
|
|
225
|
+
const c = i.trim(), l = d[c] ?? (u.has(c) ? c : null);
|
|
226
226
|
if (!l) {
|
|
227
227
|
t.push({
|
|
228
228
|
code: "unknown-start-screen",
|
|
229
229
|
severity: "error",
|
|
230
|
-
message: `Storyboard start references an unknown screen "${
|
|
231
|
-
screenId:
|
|
230
|
+
message: `Storyboard start references an unknown screen "${c}".`,
|
|
231
|
+
screenId: c || void 0
|
|
232
232
|
});
|
|
233
233
|
continue;
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
O.push(l);
|
|
236
236
|
}
|
|
237
|
-
const Y = new Set(
|
|
238
|
-
let
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
return (((
|
|
242
|
-
}).map((i) => i.id).sort((i,
|
|
243
|
-
const
|
|
244
|
-
for (;
|
|
245
|
-
const i =
|
|
246
|
-
if (!
|
|
247
|
-
|
|
248
|
-
for (const
|
|
249
|
-
|
|
237
|
+
const Y = new Set(O);
|
|
238
|
+
let S = T(O);
|
|
239
|
+
S.length || (S = w.filter((i) => {
|
|
240
|
+
var c;
|
|
241
|
+
return (((c = D.get(i.id)) == null ? void 0 : c.length) ?? 0) === 0;
|
|
242
|
+
}).map((i) => i.id).sort((i, c) => i.localeCompare(c))), !S.length && w.length && (S = [w[0].id]);
|
|
243
|
+
const C = /* @__PURE__ */ new Set(), F = [...S];
|
|
244
|
+
for (; F.length; ) {
|
|
245
|
+
const i = F.shift();
|
|
246
|
+
if (!C.has(i)) {
|
|
247
|
+
C.add(i);
|
|
248
|
+
for (const c of b.get(i) ?? [])
|
|
249
|
+
F.push(c.to), i === c.from && F.push(...c.toNodeIds ?? [c.to]);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
const
|
|
253
|
-
var l,
|
|
254
|
-
const
|
|
255
|
-
return !
|
|
252
|
+
const z = w.filter((i) => {
|
|
253
|
+
var l, g;
|
|
254
|
+
const c = (((l = D.get(i.id)) == null ? void 0 : l.length) ?? 0) === 0 && (((g = b.get(i.id)) == null ? void 0 : g.length) ?? 0) === 0 && !Y.has(i.id);
|
|
255
|
+
return !C.has(i.id) || c && w.length > 1;
|
|
256
256
|
});
|
|
257
|
-
for (const i of
|
|
258
|
-
for (const
|
|
257
|
+
for (const i of z)
|
|
258
|
+
for (const c of i.screenIds)
|
|
259
259
|
t.push({
|
|
260
260
|
code: "disconnected-screen",
|
|
261
261
|
severity: "warning",
|
|
262
|
-
message: `Storyboard screen "${
|
|
263
|
-
screenId:
|
|
262
|
+
message: `Storyboard screen "${c}" is not connected to a graph branch.`,
|
|
263
|
+
screenId: c,
|
|
264
264
|
nodeId: i.id
|
|
265
265
|
});
|
|
266
|
-
const
|
|
267
|
-
for (const i of
|
|
268
|
-
for (const
|
|
269
|
-
const l =
|
|
266
|
+
const J = /* @__PURE__ */ new Map();
|
|
267
|
+
for (const i of w)
|
|
268
|
+
for (const c of i.sourceKeys) {
|
|
269
|
+
const l = J.get(c) ?? {
|
|
270
270
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
271
271
|
screenIds: /* @__PURE__ */ new Set()
|
|
272
272
|
};
|
|
273
273
|
l.nodeIds.add(i.id);
|
|
274
|
-
for (const
|
|
275
|
-
|
|
274
|
+
for (const g of i.screenIds) l.screenIds.add(g);
|
|
275
|
+
J.set(c, l);
|
|
276
276
|
}
|
|
277
|
-
const
|
|
277
|
+
const oe = [...J.entries()].map(([i, c]) => ({
|
|
278
278
|
sourceKey: i,
|
|
279
|
-
nodeIds: [...
|
|
280
|
-
screenIds: [...
|
|
281
|
-
shared:
|
|
282
|
-
})).sort((i,
|
|
283
|
-
const
|
|
284
|
-
(l,
|
|
279
|
+
nodeIds: [...c.nodeIds].sort((l, g) => l.localeCompare(g)),
|
|
280
|
+
screenIds: [...c.screenIds].sort((l, g) => l.localeCompare(g)),
|
|
281
|
+
shared: c.nodeIds.size > 1
|
|
282
|
+
})).sort((i, c) => i.sourceKey.localeCompare(c.sourceKey)), se = w.map((i) => {
|
|
283
|
+
const c = [...b.get(i.id) ?? []].sort(
|
|
284
|
+
(l, g) => l.id.localeCompare(g.id)
|
|
285
285
|
);
|
|
286
286
|
return {
|
|
287
287
|
nodeId: i.id,
|
|
288
|
-
edgeIds:
|
|
289
|
-
targetNodeIds: T(
|
|
288
|
+
edgeIds: c.map((l) => l.id),
|
|
289
|
+
targetNodeIds: T(c.map((l) => l.to))
|
|
290
290
|
};
|
|
291
|
-
}).filter((i) => i.targetNodeIds.length > 1).sort((i,
|
|
292
|
-
|
|
291
|
+
}).filter((i) => i.targetNodeIds.length > 1).sort((i, c) => i.nodeId.localeCompare(c.nodeId)), Z = new Set(
|
|
292
|
+
w.flatMap((i) => i.scenarioIds)
|
|
293
293
|
), K = new Set(
|
|
294
294
|
(e.nonVisualScenarioIds ?? []).map((i) => i.trim())
|
|
295
295
|
), Q = T(
|
|
@@ -305,53 +305,53 @@ function Mt(e) {
|
|
|
305
305
|
scenarioId: i
|
|
306
306
|
});
|
|
307
307
|
t.sort(
|
|
308
|
-
(i,
|
|
308
|
+
(i, c) => _e(i).localeCompare(_e(c))
|
|
309
309
|
);
|
|
310
|
-
const
|
|
311
|
-
|
|
310
|
+
const L = T(
|
|
311
|
+
z.flatMap((i) => i.screenIds)
|
|
312
312
|
), ee = {
|
|
313
313
|
screens: o.length,
|
|
314
|
-
canonicalNodes:
|
|
315
|
-
mergedScreens: Math.max(0, o.length -
|
|
316
|
-
edges:
|
|
317
|
-
connectedNodes:
|
|
318
|
-
disconnectedScreens:
|
|
314
|
+
canonicalNodes: w.length,
|
|
315
|
+
mergedScreens: Math.max(0, o.length - w.length),
|
|
316
|
+
edges: m.length,
|
|
317
|
+
connectedNodes: w.length - z.length,
|
|
318
|
+
disconnectedScreens: L,
|
|
319
319
|
codeScenarios: Q.length,
|
|
320
320
|
representedScenarios: Q.filter(
|
|
321
321
|
(i) => Z.has(i)
|
|
322
322
|
).length,
|
|
323
323
|
missingScenarios: U,
|
|
324
|
-
complete:
|
|
324
|
+
complete: L.length === 0 && U.length === 0 && !t.some((i) => i.severity === "error") && s.size === 0
|
|
325
325
|
};
|
|
326
326
|
return {
|
|
327
327
|
version: 1,
|
|
328
|
-
nodes:
|
|
329
|
-
edges:
|
|
328
|
+
nodes: w,
|
|
329
|
+
edges: m,
|
|
330
330
|
aliases: Object.fromEntries(
|
|
331
|
-
Object.entries(d).sort(([i], [
|
|
331
|
+
Object.entries(d).sort(([i], [c]) => i.localeCompare(c))
|
|
332
332
|
),
|
|
333
|
-
sourceGroups:
|
|
334
|
-
startNodeIds:
|
|
335
|
-
branches:
|
|
333
|
+
sourceGroups: oe,
|
|
334
|
+
startNodeIds: S,
|
|
335
|
+
branches: se,
|
|
336
336
|
warnings: t,
|
|
337
337
|
coverage: ee
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function $t(e) {
|
|
341
341
|
return e ? JSON.parse(JSON.stringify(e)) : void 0;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
if (Array.isArray(e)) return e.map(
|
|
343
|
+
function me(e) {
|
|
344
|
+
if (Array.isArray(e)) return e.map(me);
|
|
345
345
|
if (e && typeof e == "object") {
|
|
346
|
-
const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [r]) => o.localeCompare(r)).map(([o, r]) => [o,
|
|
346
|
+
const t = Object.entries(e).filter(([, o]) => o !== void 0).sort(([o], [r]) => o.localeCompare(r)).map(([o, r]) => [o, me(r)]).filter(([, o]) => o !== void 0);
|
|
347
347
|
return t.length ? Object.fromEntries(t) : void 0;
|
|
348
348
|
}
|
|
349
349
|
return e;
|
|
350
350
|
}
|
|
351
351
|
function je(e) {
|
|
352
|
-
return JSON.stringify(
|
|
352
|
+
return JSON.stringify(me(e ?? null));
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Ot(e) {
|
|
355
355
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
356
356
|
}
|
|
357
357
|
function H(e) {
|
|
@@ -365,18 +365,18 @@ function H(e) {
|
|
|
365
365
|
}
|
|
366
366
|
return o = o.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), o.startsWith("/") || (o = `/${o}`), o.length > 1 && (o = o.replace(/\/+$/, "")), o || "/";
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Le(e) {
|
|
369
369
|
return `source-route:${encodeURIComponent(e)}`;
|
|
370
370
|
}
|
|
371
371
|
function Ne(e, t) {
|
|
372
372
|
const o = e.split("/").filter(Boolean), r = t.split("/").filter(Boolean);
|
|
373
373
|
let n = 0;
|
|
374
374
|
for (let s = 0; s < o.length; s += 1) {
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
375
|
+
const a = o[s];
|
|
376
|
+
if (a === "*" || a.startsWith("*")) return !0;
|
|
377
377
|
const d = r[n];
|
|
378
|
-
if (!(
|
|
379
|
-
if (d == null || !
|
|
378
|
+
if (!(a.endsWith("?") && d == null)) {
|
|
379
|
+
if (d == null || !a.startsWith(":") && a !== d) return !1;
|
|
380
380
|
n += 1;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
@@ -391,10 +391,10 @@ function Be(e, t, o) {
|
|
|
391
391
|
representativeId: n,
|
|
392
392
|
screenIds: o.get(r) ?? [n]
|
|
393
393
|
}
|
|
394
|
-
] : [...t.entries()].filter(([s]) => Ne(r, s)).map(([s,
|
|
395
|
-
representativeId:
|
|
396
|
-
screenIds: o.get(s) ?? [
|
|
397
|
-
})).sort((s,
|
|
394
|
+
] : [...t.entries()].filter(([s]) => Ne(r, s)).map(([s, a]) => ({
|
|
395
|
+
representativeId: a,
|
|
396
|
+
screenIds: o.get(s) ?? [a]
|
|
397
|
+
})).sort((s, a) => s.representativeId.localeCompare(a.representativeId));
|
|
398
398
|
}
|
|
399
399
|
function Dt(e) {
|
|
400
400
|
var o;
|
|
@@ -402,7 +402,7 @@ function Dt(e) {
|
|
|
402
402
|
for (const r of e ?? []) {
|
|
403
403
|
const n = H(r.path);
|
|
404
404
|
!n || t.has(n) || t.set(n, {
|
|
405
|
-
id:
|
|
405
|
+
id: Le(n),
|
|
406
406
|
name: n,
|
|
407
407
|
section: "Source routes",
|
|
408
408
|
codeName: ((o = r.id) == null ? void 0 : o.trim()) || void 0
|
|
@@ -412,23 +412,23 @@ function Dt(e) {
|
|
|
412
412
|
}
|
|
413
413
|
function kt(e, t, o, r) {
|
|
414
414
|
return (e ?? []).flatMap((n, s) => {
|
|
415
|
-
var
|
|
416
|
-
const
|
|
417
|
-
if (!
|
|
418
|
-
const u = r.has(
|
|
419
|
-
if (!u.length || !
|
|
420
|
-
const
|
|
415
|
+
var w, P, I;
|
|
416
|
+
const a = (w = n.from) == null ? void 0 : w.trim(), d = (P = n.to) == null ? void 0 : P.trim();
|
|
417
|
+
if (!a || !d || n.unresolvedTarget) return [];
|
|
418
|
+
const u = r.has(a) ? [{ representativeId: a, screenIds: [a] }] : Be(a, t, o), h = r.has(d) ? [{ representativeId: d, screenIds: [d] }] : Be(d, t, o);
|
|
419
|
+
if (!u.length || !h.length) return [];
|
|
420
|
+
const p = ((I = n.id) == null ? void 0 : I.trim()) || `discovery-edge:${s + 1}`;
|
|
421
421
|
return u.flatMap(
|
|
422
|
-
(
|
|
423
|
-
var D,
|
|
422
|
+
(m, E) => h.map((f, M) => {
|
|
423
|
+
var D, b;
|
|
424
424
|
return {
|
|
425
|
-
id: u.length === 1 &&
|
|
426
|
-
from:
|
|
425
|
+
id: u.length === 1 && h.length === 1 ? p : `${p}:${E + 1}:${M + 1}`,
|
|
426
|
+
from: m.representativeId,
|
|
427
427
|
to: f.representativeId,
|
|
428
|
-
fromScope:
|
|
428
|
+
fromScope: m.screenIds,
|
|
429
429
|
toScope: f.screenIds,
|
|
430
430
|
kind: ((D = n.kind) == null ? void 0 : D.trim()) || void 0,
|
|
431
|
-
label: ((
|
|
431
|
+
label: ((b = n.label) == null ? void 0 : b.trim()) || void 0
|
|
432
432
|
};
|
|
433
433
|
})
|
|
434
434
|
);
|
|
@@ -446,12 +446,12 @@ function Ft(e, t, o) {
|
|
|
446
446
|
if (!n.length) return [];
|
|
447
447
|
const s = je(
|
|
448
448
|
Ze(o, e.environment)
|
|
449
|
-
),
|
|
449
|
+
), a = n.filter(
|
|
450
450
|
(d) => je(d.environment) === s
|
|
451
451
|
);
|
|
452
452
|
return [
|
|
453
453
|
...new Set(
|
|
454
|
-
|
|
454
|
+
a.map((d) => {
|
|
455
455
|
var u;
|
|
456
456
|
return (u = d.scenarioId) == null ? void 0 : u.trim();
|
|
457
457
|
}).filter((d) => !!d)
|
|
@@ -459,7 +459,7 @@ function Ft(e, t, o) {
|
|
|
459
459
|
].sort((d, u) => d.localeCompare(u));
|
|
460
460
|
}
|
|
461
461
|
function Tt(e, t) {
|
|
462
|
-
const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n =
|
|
462
|
+
const o = e.some((s) => s.importKind != null), r = t.candidates ?? [], n = Ve(t);
|
|
463
463
|
return e.filter(
|
|
464
464
|
(s) => o ? s.importKind === "screens" : !!s.route
|
|
465
465
|
).map((s) => ({
|
|
@@ -485,17 +485,17 @@ function Tt(e, t) {
|
|
|
485
485
|
environment: s.environment,
|
|
486
486
|
preset: s.preset,
|
|
487
487
|
assertions: s.assertions,
|
|
488
|
-
sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((
|
|
488
|
+
sourcePath: [...s.sourcePaths ?? []].filter(Boolean).sort((a, d) => a.localeCompare(d))[0]
|
|
489
489
|
}));
|
|
490
490
|
}
|
|
491
491
|
function we(e, t) {
|
|
492
|
-
var d, u,
|
|
492
|
+
var d, u, h, p;
|
|
493
493
|
const o = (((d = e.interactions) == null ? void 0 : d.length) ?? 0) - (((u = t.interactions) == null ? void 0 : u.length) ?? 0);
|
|
494
494
|
if (o !== 0) return o;
|
|
495
|
-
const r = (
|
|
495
|
+
const r = (h = e.scenarioIds) != null && h.includes("environment:baseline") ? 0 : 1, n = (p = t.scenarioIds) != null && p.includes("environment:baseline") ? 0 : 1;
|
|
496
496
|
if (r !== n) return r - n;
|
|
497
|
-
const s = !e.environment && !e.preset ? 0 : 1,
|
|
498
|
-
return s !==
|
|
497
|
+
const s = !e.environment && !e.preset ? 0 : 1, a = !t.environment && !t.preset ? 0 : 1;
|
|
498
|
+
return s !== a ? s - a : e.id.localeCompare(t.id);
|
|
499
499
|
}
|
|
500
500
|
function zt(e) {
|
|
501
501
|
const t = /* @__PURE__ */ new Map();
|
|
@@ -529,7 +529,7 @@ function _t(e) {
|
|
|
529
529
|
}
|
|
530
530
|
function jt(e) {
|
|
531
531
|
return e.action === "wait" ? null : JSON.stringify(
|
|
532
|
-
|
|
532
|
+
me({
|
|
533
533
|
action: e.action,
|
|
534
534
|
selector: e.selector,
|
|
535
535
|
text: e.text,
|
|
@@ -543,7 +543,7 @@ function jt(e) {
|
|
|
543
543
|
})
|
|
544
544
|
);
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function We(e) {
|
|
547
547
|
return (e.interactions ?? []).map(jt).filter((t) => t != null);
|
|
548
548
|
}
|
|
549
549
|
function Bt(e, t) {
|
|
@@ -554,15 +554,15 @@ function Ut(e, t) {
|
|
|
554
554
|
for (const r of e) {
|
|
555
555
|
const n = H(r.route);
|
|
556
556
|
if (!n) continue;
|
|
557
|
-
const s = `${n}\0${
|
|
558
|
-
|
|
557
|
+
const s = `${n}\0${We(r).join("")}`, a = o.get(s);
|
|
558
|
+
a ? a.push(r) : o.set(s, [r]);
|
|
559
559
|
}
|
|
560
560
|
return [...o.values()].flatMap((r) => {
|
|
561
561
|
if (r.length < 2) return [];
|
|
562
|
-
const n = H(r[0].route), s = t.get(n),
|
|
563
|
-
return r.filter((d) => d.id !==
|
|
564
|
-
id: `discovery-variant:${encodeURIComponent(
|
|
565
|
-
from:
|
|
562
|
+
const n = H(r[0].route), s = t.get(n), a = r.find((d) => d.id === s) ?? [...r].sort(we)[0];
|
|
563
|
+
return r.filter((d) => d.id !== a.id).sort((d, u) => d.id.localeCompare(u.id)).map((d) => ({
|
|
564
|
+
id: `discovery-variant:${encodeURIComponent(a.id)}:${encodeURIComponent(d.id)}`,
|
|
565
|
+
from: a.id,
|
|
566
566
|
to: d.id,
|
|
567
567
|
kind: "variant"
|
|
568
568
|
}));
|
|
@@ -578,36 +578,36 @@ function Ht(e, t) {
|
|
|
578
578
|
}
|
|
579
579
|
return [...o.entries()].flatMap(([r, n]) => {
|
|
580
580
|
const s = new Map(
|
|
581
|
-
n.map((u) => [u.id,
|
|
582
|
-
),
|
|
583
|
-
(u) => u.id ===
|
|
581
|
+
n.map((u) => [u.id, We(u)])
|
|
582
|
+
), a = t.get(r), d = n.find(
|
|
583
|
+
(u) => u.id === a
|
|
584
584
|
);
|
|
585
585
|
return n.flatMap((u) => {
|
|
586
|
-
const
|
|
587
|
-
if (!
|
|
588
|
-
const
|
|
589
|
-
(
|
|
590
|
-
s.get(
|
|
591
|
-
|
|
586
|
+
const h = s.get(u.id);
|
|
587
|
+
if (!h.length) return [];
|
|
588
|
+
const w = n.filter(
|
|
589
|
+
(P) => Bt(
|
|
590
|
+
s.get(P.id),
|
|
591
|
+
h
|
|
592
592
|
)
|
|
593
|
-
).sort((
|
|
594
|
-
const
|
|
595
|
-
if (
|
|
596
|
-
const E =
|
|
593
|
+
).sort((P, I) => {
|
|
594
|
+
const m = s.get(I.id).length - s.get(P.id).length;
|
|
595
|
+
if (m !== 0) return m;
|
|
596
|
+
const E = P.flow && P.flow === u.flow ? 0 : 1, f = I.flow && I.flow === u.flow ? 0 : 1;
|
|
597
597
|
if (E !== f) return E - f;
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const
|
|
601
|
-
return
|
|
598
|
+
const M = P.section && P.section === u.section ? 0 : 1, D = I.section && I.section === u.section ? 0 : 1;
|
|
599
|
+
if (M !== D) return M - D;
|
|
600
|
+
const b = P.id === a ? 0 : 1, O = I.id === a ? 0 : 1;
|
|
601
|
+
return b !== O ? b - O : we(P, I);
|
|
602
602
|
})[0];
|
|
603
|
-
return
|
|
603
|
+
return w ? [
|
|
604
604
|
{
|
|
605
|
-
id: `discovery-recipe:${encodeURIComponent(
|
|
606
|
-
from:
|
|
605
|
+
id: `discovery-recipe:${encodeURIComponent(w.id)}:${encodeURIComponent(u.id)}`,
|
|
606
|
+
from: w.id,
|
|
607
607
|
to: u.id,
|
|
608
608
|
kind: "recipe-step"
|
|
609
609
|
}
|
|
610
|
-
] : d && d.id !== u.id && s.get(d.id).join("") !==
|
|
610
|
+
] : d && d.id !== u.id && s.get(d.id).join("") !== h.join("") ? [
|
|
611
611
|
{
|
|
612
612
|
id: `discovery-route-case:${encodeURIComponent(d.id)}:${encodeURIComponent(u.id)}`,
|
|
613
613
|
from: d.id,
|
|
@@ -629,14 +629,14 @@ function qt(e) {
|
|
|
629
629
|
}
|
|
630
630
|
return [...t.values()].flatMap((r) => {
|
|
631
631
|
const n = r[0], s = /* @__PURE__ */ new Map();
|
|
632
|
-
for (const
|
|
633
|
-
const d = H(
|
|
632
|
+
for (const a of r) {
|
|
633
|
+
const d = H(a.route);
|
|
634
634
|
if (!d) continue;
|
|
635
635
|
const u = s.get(d);
|
|
636
|
-
u ? u.push(
|
|
636
|
+
u ? u.push(a) : s.set(d, [a]);
|
|
637
637
|
}
|
|
638
|
-
return s.size < 2 ? [] : [...s.values()].flatMap((
|
|
639
|
-
const d = [...
|
|
638
|
+
return s.size < 2 ? [] : [...s.values()].flatMap((a) => {
|
|
639
|
+
const d = [...a].sort(
|
|
640
640
|
we
|
|
641
641
|
)[0];
|
|
642
642
|
return d.id === n.id ? [] : [
|
|
@@ -658,92 +658,92 @@ function Gt(e, t, o) {
|
|
|
658
658
|
const s = H(n.route);
|
|
659
659
|
if (!s || o.get(s) !== n.id)
|
|
660
660
|
return n;
|
|
661
|
-
const
|
|
661
|
+
const a = [...r].filter(
|
|
662
662
|
(d) => Ne(d, s)
|
|
663
663
|
);
|
|
664
|
-
return
|
|
664
|
+
return a.length ? {
|
|
665
665
|
...n,
|
|
666
666
|
scenarioIds: [
|
|
667
667
|
.../* @__PURE__ */ new Set([
|
|
668
668
|
...n.scenarioIds ?? [],
|
|
669
|
-
...
|
|
669
|
+
...a.map(Le)
|
|
670
670
|
])
|
|
671
671
|
].sort((d, u) => d.localeCompare(u))
|
|
672
672
|
} : n;
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
function Kt(e, t) {
|
|
676
|
-
var
|
|
677
|
-
const o = new Set(e.map((
|
|
678
|
-
e.map((
|
|
679
|
-
), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(),
|
|
680
|
-
for (const
|
|
681
|
-
n.set(
|
|
682
|
-
for (const
|
|
676
|
+
var h, p, w, P, I;
|
|
677
|
+
const o = new Set(e.map((m) => m.id)), r = new Map(
|
|
678
|
+
e.map((m, E) => [m.id, E])
|
|
679
|
+
), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
680
|
+
for (const m of o)
|
|
681
|
+
n.set(m, /* @__PURE__ */ new Set()), s.set(m, /* @__PURE__ */ new Set()), a.set(m, /* @__PURE__ */ new Set());
|
|
682
|
+
for (const m of t) {
|
|
683
683
|
const E = [
|
|
684
|
-
...(
|
|
685
|
-
(f) => [f,
|
|
684
|
+
...(m.fromScope ?? [m.from]).map(
|
|
685
|
+
(f) => [f, m.to]
|
|
686
686
|
),
|
|
687
|
-
...(
|
|
688
|
-
(f) => [
|
|
687
|
+
...(m.toScope ?? [m.to]).map(
|
|
688
|
+
(f) => [m.from, f]
|
|
689
689
|
)
|
|
690
690
|
];
|
|
691
|
-
for (const [f,
|
|
692
|
-
!o.has(f) || !o.has(
|
|
691
|
+
for (const [f, M] of E)
|
|
692
|
+
!o.has(f) || !o.has(M) || ((h = n.get(M)) == null || h.add(f), (p = s.get(f)) == null || p.add(M), (w = a.get(f)) == null || w.add(M), (P = a.get(M)) == null || P.add(f));
|
|
693
693
|
}
|
|
694
694
|
const d = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
695
|
-
for (const
|
|
696
|
-
if (u.has(
|
|
697
|
-
const E = [], f = [
|
|
695
|
+
for (const m of o) {
|
|
696
|
+
if (u.has(m)) continue;
|
|
697
|
+
const E = [], f = [m];
|
|
698
698
|
for (; f.length; ) {
|
|
699
|
-
const
|
|
700
|
-
if (!u.has(
|
|
701
|
-
u.add(
|
|
702
|
-
for (const
|
|
703
|
-
u.has(
|
|
699
|
+
const S = f.shift();
|
|
700
|
+
if (!u.has(S)) {
|
|
701
|
+
u.add(S), E.push(S);
|
|
702
|
+
for (const C of a.get(S) ?? [])
|
|
703
|
+
u.has(C) || f.push(C);
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
if (E.length === 1 && (((
|
|
706
|
+
if (E.length === 1 && (((I = a.get(E[0])) == null ? void 0 : I.size) ?? 0) === 0)
|
|
707
707
|
continue;
|
|
708
|
-
const
|
|
709
|
-
var
|
|
710
|
-
return (((
|
|
708
|
+
const M = E.filter((S) => {
|
|
709
|
+
var C;
|
|
710
|
+
return (((C = n.get(S)) == null ? void 0 : C.size) ?? 0) === 0;
|
|
711
711
|
}).sort(
|
|
712
|
-
(
|
|
712
|
+
(S, C) => (r.get(S) ?? Number.MAX_SAFE_INTEGER) - (r.get(C) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(C)
|
|
713
713
|
), D = [...E].sort(
|
|
714
|
-
(
|
|
714
|
+
(S, C) => (r.get(S) ?? Number.MAX_SAFE_INTEGER) - (r.get(C) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(C)
|
|
715
715
|
)[0];
|
|
716
716
|
if (!D) continue;
|
|
717
|
-
const
|
|
718
|
-
const
|
|
719
|
-
for (;
|
|
720
|
-
const
|
|
721
|
-
if (!
|
|
722
|
-
|
|
723
|
-
for (const
|
|
724
|
-
|
|
717
|
+
const b = [D], O = /* @__PURE__ */ new Set(), Y = (S) => {
|
|
718
|
+
const C = [S];
|
|
719
|
+
for (; C.length; ) {
|
|
720
|
+
const F = C.shift();
|
|
721
|
+
if (!O.has(F)) {
|
|
722
|
+
O.add(F);
|
|
723
|
+
for (const z of s.get(F) ?? [])
|
|
724
|
+
O.has(z) || C.push(z);
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
};
|
|
728
728
|
Y(D);
|
|
729
|
-
for (const
|
|
730
|
-
|
|
731
|
-
for (const
|
|
732
|
-
d.add(
|
|
729
|
+
for (const S of M)
|
|
730
|
+
O.has(S) || (b.push(S), Y(S));
|
|
731
|
+
for (const S of b)
|
|
732
|
+
d.add(S);
|
|
733
733
|
}
|
|
734
734
|
return [...d].sort(
|
|
735
|
-
(
|
|
735
|
+
(m, E) => (r.get(m) ?? Number.MAX_SAFE_INTEGER) - (r.get(E) ?? Number.MAX_SAFE_INTEGER) || m.localeCompare(E)
|
|
736
736
|
);
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function Ve(e) {
|
|
739
739
|
var t, o;
|
|
740
|
-
return
|
|
740
|
+
return $t(
|
|
741
741
|
(o = (t = e.scenarios) == null ? void 0 : t.find(
|
|
742
742
|
(r) => r.id === "environment:baseline"
|
|
743
743
|
)) == null ? void 0 : o.environment
|
|
744
744
|
);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Lt(e) {
|
|
747
747
|
const t = Tt(
|
|
748
748
|
e.pages,
|
|
749
749
|
e.manifest
|
|
@@ -751,7 +751,7 @@ function Vt(e) {
|
|
|
751
751
|
t,
|
|
752
752
|
e.manifest,
|
|
753
753
|
o
|
|
754
|
-
),
|
|
754
|
+
), a = [
|
|
755
755
|
...kt(
|
|
756
756
|
e.manifest.edges,
|
|
757
757
|
o,
|
|
@@ -766,11 +766,11 @@ function Vt(e) {
|
|
|
766
766
|
screens: n,
|
|
767
767
|
assets: e.assets,
|
|
768
768
|
scenarios: Dt(e.manifest.routes),
|
|
769
|
-
inferredEdges:
|
|
770
|
-
startScreenIds: Kt(n,
|
|
769
|
+
inferredEdges: a,
|
|
770
|
+
startScreenIds: Kt(n, a)
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
|
-
async function
|
|
773
|
+
async function Je(e) {
|
|
774
774
|
const o = await (e.fetcher ?? ((n, s) => fetch(n, s)))(e.endpoint, {
|
|
775
775
|
headers: { accept: "application/json" },
|
|
776
776
|
cache: "no-store",
|
|
@@ -779,41 +779,41 @@ async function Le(e) {
|
|
|
779
779
|
if (!o.ok)
|
|
780
780
|
throw new Error(`Storyboard discovery failed (${o.status})`);
|
|
781
781
|
const r = await o.json();
|
|
782
|
-
if (
|
|
782
|
+
if (!Ot(r))
|
|
783
783
|
throw new Error("Storyboard discovery returned an invalid manifest.");
|
|
784
784
|
return {
|
|
785
785
|
manifest: r,
|
|
786
|
-
baselineEnvironment:
|
|
787
|
-
graph:
|
|
786
|
+
baselineEnvironment: Ve(r),
|
|
787
|
+
graph: Lt({
|
|
788
788
|
manifest: r,
|
|
789
789
|
pages: e.pages,
|
|
790
790
|
assets: e.assets
|
|
791
791
|
})
|
|
792
792
|
};
|
|
793
793
|
}
|
|
794
|
-
async function
|
|
794
|
+
async function pn(e) {
|
|
795
795
|
ne(null);
|
|
796
796
|
try {
|
|
797
|
-
const t = await
|
|
797
|
+
const t = await Je(e);
|
|
798
798
|
return ne(t.graph), t;
|
|
799
799
|
} catch (t) {
|
|
800
800
|
throw ne(null), t;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
-
const ge = "var(--pygmalion-catalog-surface, #ffffff)", he = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ee = "var(--pygmalion-catalog-border, #e5e7eb)", ye = "var(--pygmalion-catalog-text, #202124)", B = "var(--pygmalion-catalog-muted, #6b7280)",
|
|
804
|
-
function
|
|
803
|
+
const ge = "var(--pygmalion-catalog-surface, #ffffff)", he = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ee = "var(--pygmalion-catalog-border, #e5e7eb)", ye = "var(--pygmalion-catalog-text, #202124)", B = "var(--pygmalion-catalog-muted, #6b7280)", Wt = "var(--pygmalion-catalog-header, #11182f)", Vt = "var(--pygmalion-catalog-accent, #7c6cf2)";
|
|
804
|
+
function mn({
|
|
805
805
|
title: e,
|
|
806
806
|
eyebrow: t,
|
|
807
807
|
description: o,
|
|
808
808
|
version: r,
|
|
809
809
|
meta: n,
|
|
810
810
|
children: s,
|
|
811
|
-
headerBackground:
|
|
811
|
+
headerBackground: a = Wt,
|
|
812
812
|
headerColor: d = "#ffffff",
|
|
813
813
|
bodyBackground: u = ge,
|
|
814
|
-
bodyGap:
|
|
814
|
+
bodyGap: h = 40
|
|
815
815
|
}) {
|
|
816
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ $(
|
|
817
817
|
"section",
|
|
818
818
|
{
|
|
819
819
|
"data-pygmalion-catalog-document": "",
|
|
@@ -830,7 +830,7 @@ function pn({
|
|
|
830
830
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
831
831
|
},
|
|
832
832
|
children: [
|
|
833
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ $(
|
|
834
834
|
"header",
|
|
835
835
|
{
|
|
836
836
|
style: {
|
|
@@ -841,11 +841,11 @@ function pn({
|
|
|
841
841
|
gap: 48,
|
|
842
842
|
padding: "44px 48px 48px",
|
|
843
843
|
color: d,
|
|
844
|
-
background:
|
|
844
|
+
background: a
|
|
845
845
|
},
|
|
846
846
|
children: [
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
t ? /* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ $("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
848
|
+
t ? /* @__PURE__ */ v(
|
|
849
849
|
"div",
|
|
850
850
|
{
|
|
851
851
|
style: {
|
|
@@ -858,7 +858,7 @@ function pn({
|
|
|
858
858
|
children: t
|
|
859
859
|
}
|
|
860
860
|
) : null,
|
|
861
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ v(
|
|
862
862
|
"h1",
|
|
863
863
|
{
|
|
864
864
|
style: {
|
|
@@ -872,7 +872,7 @@ function pn({
|
|
|
872
872
|
children: e
|
|
873
873
|
}
|
|
874
874
|
),
|
|
875
|
-
o ? /* @__PURE__ */
|
|
875
|
+
o ? /* @__PURE__ */ v(
|
|
876
876
|
"div",
|
|
877
877
|
{
|
|
878
878
|
style: {
|
|
@@ -885,7 +885,7 @@ function pn({
|
|
|
885
885
|
}
|
|
886
886
|
) : null
|
|
887
887
|
] }),
|
|
888
|
-
r || n ? /* @__PURE__ */
|
|
888
|
+
r || n ? /* @__PURE__ */ $(
|
|
889
889
|
"div",
|
|
890
890
|
{
|
|
891
891
|
style: {
|
|
@@ -897,15 +897,15 @@ function pn({
|
|
|
897
897
|
whiteSpace: "nowrap"
|
|
898
898
|
},
|
|
899
899
|
children: [
|
|
900
|
-
r ? /* @__PURE__ */
|
|
901
|
-
n ? /* @__PURE__ */
|
|
900
|
+
r ? /* @__PURE__ */ v("span", { children: r }) : null,
|
|
901
|
+
n ? /* @__PURE__ */ v("span", { children: n }) : null
|
|
902
902
|
]
|
|
903
903
|
}
|
|
904
904
|
) : null
|
|
905
905
|
]
|
|
906
906
|
}
|
|
907
907
|
),
|
|
908
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ v(
|
|
909
909
|
"div",
|
|
910
910
|
{
|
|
911
911
|
"data-pygmalion-catalog-document-body": "",
|
|
@@ -914,7 +914,7 @@ function pn({
|
|
|
914
914
|
display: "inline-flex",
|
|
915
915
|
flexDirection: "column",
|
|
916
916
|
alignItems: "flex-start",
|
|
917
|
-
gap:
|
|
917
|
+
gap: h,
|
|
918
918
|
padding: 48,
|
|
919
919
|
background: u
|
|
920
920
|
},
|
|
@@ -933,7 +933,7 @@ function gn({
|
|
|
933
933
|
children: n,
|
|
934
934
|
tone: s = "tinted"
|
|
935
935
|
}) {
|
|
936
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ $(
|
|
937
937
|
"section",
|
|
938
938
|
{
|
|
939
939
|
"data-pygmalion-catalog-section": "",
|
|
@@ -949,8 +949,8 @@ function gn({
|
|
|
949
949
|
background: s === "tinted" ? he : "transparent"
|
|
950
950
|
},
|
|
951
951
|
children: [
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ $("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
|
|
953
|
+
/* @__PURE__ */ v(
|
|
954
954
|
"h2",
|
|
955
955
|
{
|
|
956
956
|
style: {
|
|
@@ -962,9 +962,9 @@ function gn({
|
|
|
962
962
|
children: e
|
|
963
963
|
}
|
|
964
964
|
),
|
|
965
|
-
typeof o == "number" ? /* @__PURE__ */
|
|
965
|
+
typeof o == "number" ? /* @__PURE__ */ v("span", { style: { color: B, fontSize: 11 }, children: o }) : null
|
|
966
966
|
] }),
|
|
967
|
-
r ? /* @__PURE__ */
|
|
967
|
+
r ? /* @__PURE__ */ v("div", { style: { marginTop: -10, color: B, fontSize: 11 }, children: r }) : null,
|
|
968
968
|
n
|
|
969
969
|
]
|
|
970
970
|
}
|
|
@@ -977,10 +977,10 @@ function hn({
|
|
|
977
977
|
renderCell: r,
|
|
978
978
|
renderRowLabel: n = (u) => u,
|
|
979
979
|
renderColumnLabel: s = (u) => u,
|
|
980
|
-
boundary:
|
|
980
|
+
boundary: a = !0,
|
|
981
981
|
cellStyle: d
|
|
982
982
|
}) {
|
|
983
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ v(
|
|
984
984
|
"div",
|
|
985
985
|
{
|
|
986
986
|
"data-pygmalion-catalog-matrix": "",
|
|
@@ -988,11 +988,11 @@ function hn({
|
|
|
988
988
|
boxSizing: "border-box",
|
|
989
989
|
display: "inline-block",
|
|
990
990
|
width: "max-content",
|
|
991
|
-
padding:
|
|
992
|
-
border:
|
|
993
|
-
borderRadius:
|
|
991
|
+
padding: a ? 16 : 0,
|
|
992
|
+
border: a ? `1px dashed ${Vt}` : void 0,
|
|
993
|
+
borderRadius: a ? 4 : void 0
|
|
994
994
|
},
|
|
995
|
-
children: /* @__PURE__ */
|
|
995
|
+
children: /* @__PURE__ */ $(
|
|
996
996
|
"table",
|
|
997
997
|
{
|
|
998
998
|
style: {
|
|
@@ -1001,8 +1001,8 @@ function hn({
|
|
|
1001
1001
|
borderSpacing: 0
|
|
1002
1002
|
},
|
|
1003
1003
|
children: [
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ $("tr", { children: [
|
|
1005
|
+
/* @__PURE__ */ v(
|
|
1006
1006
|
"th",
|
|
1007
1007
|
{
|
|
1008
1008
|
style: {
|
|
@@ -1016,7 +1016,7 @@ function hn({
|
|
|
1016
1016
|
children: o
|
|
1017
1017
|
}
|
|
1018
1018
|
),
|
|
1019
|
-
t.map((u) => /* @__PURE__ */
|
|
1019
|
+
t.map((u) => /* @__PURE__ */ v(
|
|
1020
1020
|
"th",
|
|
1021
1021
|
{
|
|
1022
1022
|
style: {
|
|
@@ -1032,8 +1032,8 @@ function hn({
|
|
|
1032
1032
|
u
|
|
1033
1033
|
))
|
|
1034
1034
|
] }) }),
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ v("tbody", { children: e.map((u) => /* @__PURE__ */ $("tr", { children: [
|
|
1036
|
+
/* @__PURE__ */ v(
|
|
1037
1037
|
"th",
|
|
1038
1038
|
{
|
|
1039
1039
|
style: {
|
|
@@ -1047,7 +1047,7 @@ function hn({
|
|
|
1047
1047
|
children: n(u)
|
|
1048
1048
|
}
|
|
1049
1049
|
),
|
|
1050
|
-
t.map((
|
|
1050
|
+
t.map((h) => /* @__PURE__ */ v(
|
|
1051
1051
|
"td",
|
|
1052
1052
|
{
|
|
1053
1053
|
style: {
|
|
@@ -1056,9 +1056,9 @@ function hn({
|
|
|
1056
1056
|
verticalAlign: "middle",
|
|
1057
1057
|
...d
|
|
1058
1058
|
},
|
|
1059
|
-
children: r(u,
|
|
1059
|
+
children: r(u, h)
|
|
1060
1060
|
},
|
|
1061
|
-
|
|
1061
|
+
h
|
|
1062
1062
|
))
|
|
1063
1063
|
] }, u)) })
|
|
1064
1064
|
]
|
|
@@ -1067,11 +1067,11 @@ function hn({
|
|
|
1067
1067
|
}
|
|
1068
1068
|
);
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Jt(e) {
|
|
1071
1071
|
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
|
|
1072
1072
|
}
|
|
1073
1073
|
function Qe(e, t, o = "PygmalionCatalog") {
|
|
1074
|
-
const r = (n) =>
|
|
1074
|
+
const r = (n) => Jt(n).replace(/-/g, "_");
|
|
1075
1075
|
return `${o}_${r(e)}_${r(t)}`;
|
|
1076
1076
|
}
|
|
1077
1077
|
function Xe(e, t) {
|
|
@@ -1103,7 +1103,7 @@ function Xt({
|
|
|
1103
1103
|
secondaryLabel: r,
|
|
1104
1104
|
minimumColumnWidth: n
|
|
1105
1105
|
}) {
|
|
1106
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ $(
|
|
1107
1107
|
"section",
|
|
1108
1108
|
{
|
|
1109
1109
|
"data-pygmalion-catalog-page": e.id,
|
|
@@ -1118,14 +1118,14 @@ function Xt({
|
|
|
1118
1118
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1119
1119
|
},
|
|
1120
1120
|
children: [
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
|
|
1122
|
+
/* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
|
|
1123
|
+
/* @__PURE__ */ $("p", { style: { margin: "6px 0 0", color: B, fontSize: 13 }, children: [
|
|
1124
1124
|
t.length,
|
|
1125
1125
|
" assets"
|
|
1126
1126
|
] })
|
|
1127
1127
|
] }),
|
|
1128
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ v(
|
|
1129
1129
|
"div",
|
|
1130
1130
|
{
|
|
1131
1131
|
style: {
|
|
@@ -1133,7 +1133,7 @@ function Xt({
|
|
|
1133
1133
|
gridTemplateColumns: "repeat(6, max-content)",
|
|
1134
1134
|
gap: 16
|
|
1135
1135
|
},
|
|
1136
|
-
children: t.map((s) => /* @__PURE__ */
|
|
1136
|
+
children: t.map((s) => /* @__PURE__ */ $(
|
|
1137
1137
|
"article",
|
|
1138
1138
|
{
|
|
1139
1139
|
"data-pygmalion-catalog-item": s.id,
|
|
@@ -1146,7 +1146,7 @@ function Xt({
|
|
|
1146
1146
|
background: ge
|
|
1147
1147
|
},
|
|
1148
1148
|
children: [
|
|
1149
|
-
/* @__PURE__ */
|
|
1149
|
+
/* @__PURE__ */ v(
|
|
1150
1150
|
"div",
|
|
1151
1151
|
{
|
|
1152
1152
|
style: {
|
|
@@ -1159,7 +1159,7 @@ function Xt({
|
|
|
1159
1159
|
children: o(s)
|
|
1160
1160
|
}
|
|
1161
1161
|
),
|
|
1162
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ v(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
1165
1165
|
style: {
|
|
@@ -1174,7 +1174,7 @@ function Xt({
|
|
|
1174
1174
|
children: s.name
|
|
1175
1175
|
}
|
|
1176
1176
|
),
|
|
1177
|
-
r ? /* @__PURE__ */
|
|
1177
|
+
r ? /* @__PURE__ */ v("div", { style: { marginTop: 4, color: B, fontSize: 11, lineHeight: 1.45 }, children: r(s) }) : s.codeName ? /* @__PURE__ */ v(
|
|
1178
1178
|
"div",
|
|
1179
1179
|
{
|
|
1180
1180
|
style: {
|
|
@@ -1204,11 +1204,11 @@ function yn(e) {
|
|
|
1204
1204
|
Ye(e.items);
|
|
1205
1205
|
const t = /* @__PURE__ */ new Map();
|
|
1206
1206
|
for (const n of e.items) {
|
|
1207
|
-
const s = e.pageFor(n),
|
|
1208
|
-
if (
|
|
1209
|
-
if (
|
|
1207
|
+
const s = e.pageFor(n), a = t.get(s.id);
|
|
1208
|
+
if (a) {
|
|
1209
|
+
if (a.page.name !== s.name || a.page.section !== s.section)
|
|
1210
1210
|
throw new Error(`Conflicting design catalog page descriptor: ${s.id}`);
|
|
1211
|
-
|
|
1211
|
+
a.items.push(n);
|
|
1212
1212
|
continue;
|
|
1213
1213
|
}
|
|
1214
1214
|
t.set(s.id, {
|
|
@@ -1223,7 +1223,7 @@ function yn(e) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
const o = {}, r = [];
|
|
1225
1225
|
for (const n of t.values()) {
|
|
1226
|
-
const s = () => /* @__PURE__ */
|
|
1226
|
+
const s = () => /* @__PURE__ */ v(
|
|
1227
1227
|
Xt,
|
|
1228
1228
|
{
|
|
1229
1229
|
page: n.page,
|
|
@@ -1237,13 +1237,13 @@ function yn(e) {
|
|
|
1237
1237
|
component: s,
|
|
1238
1238
|
children: "none"
|
|
1239
1239
|
};
|
|
1240
|
-
const
|
|
1240
|
+
const a = Qt(e.frame, n.page, n.items);
|
|
1241
1241
|
r.push({
|
|
1242
1242
|
...n.page,
|
|
1243
1243
|
componentName: n.registryName,
|
|
1244
|
-
width: (
|
|
1245
|
-
height: (
|
|
1246
|
-
frameSizeMode:
|
|
1244
|
+
width: (a == null ? void 0 : a.width) ?? 1,
|
|
1245
|
+
height: (a == null ? void 0 : a.height) ?? 1,
|
|
1246
|
+
frameSizeMode: a ? "fixed" : "content"
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
1249
1249
|
return {
|
|
@@ -1256,10 +1256,10 @@ function yn(e) {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
1258
1258
|
function Yt(e, t = 60) {
|
|
1259
|
-
const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, d]) => d.length > 0).sort(([d, u], [
|
|
1259
|
+
const o = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, d]) => d.length > 0).sort(([d, u], [h, p]) => p.length - u.length || d.localeCompare(h)), 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)));
|
|
1260
1260
|
return {
|
|
1261
1261
|
row: r,
|
|
1262
|
-
column: n ? [n[0],
|
|
1262
|
+
column: n ? [n[0], a ?? []] : void 0,
|
|
1263
1263
|
fixed: o.slice(2).map(([d, u]) => [d, u[0]]),
|
|
1264
1264
|
additional: o.slice(2)
|
|
1265
1265
|
};
|
|
@@ -1279,7 +1279,7 @@ function en({
|
|
|
1279
1279
|
}) {
|
|
1280
1280
|
var d, u;
|
|
1281
1281
|
if (!t)
|
|
1282
|
-
return /* @__PURE__ */
|
|
1282
|
+
return /* @__PURE__ */ $(
|
|
1283
1283
|
"section",
|
|
1284
1284
|
{
|
|
1285
1285
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1293,13 +1293,13 @@ function en({
|
|
|
1293
1293
|
background: he
|
|
1294
1294
|
},
|
|
1295
1295
|
children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ v("strong", { children: e.name }),
|
|
1297
|
+
/* @__PURE__ */ v("p", { style: { color: B }, children: "The component is not registered." })
|
|
1298
1298
|
]
|
|
1299
1299
|
}
|
|
1300
1300
|
);
|
|
1301
|
-
const r = Yt(t, o), n = ((d = r.row) == null ? void 0 : d[1]) ?? [void 0], s = ((u = r.column) == null ? void 0 : u[1]) ?? [void 0],
|
|
1302
|
-
return /* @__PURE__ */
|
|
1301
|
+
const r = Yt(t, o), n = ((d = r.row) == null ? void 0 : d[1]) ?? [void 0], s = ((u = r.column) == null ? void 0 : u[1]) ?? [void 0], a = t.component;
|
|
1302
|
+
return /* @__PURE__ */ $(
|
|
1303
1303
|
"section",
|
|
1304
1304
|
{
|
|
1305
1305
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1314,11 +1314,11 @@ function en({
|
|
|
1314
1314
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1315
1315
|
},
|
|
1316
1316
|
children: [
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
e.sourcePath ? /* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
|
|
1318
|
+
/* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
|
|
1319
|
+
e.sourcePath ? /* @__PURE__ */ v("p", { style: { margin: "6px 0 0", color: B, fontSize: 12 }, children: e.sourcePath }) : null
|
|
1320
1320
|
] }),
|
|
1321
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ v(
|
|
1322
1322
|
"div",
|
|
1323
1323
|
{
|
|
1324
1324
|
style: {
|
|
@@ -1327,12 +1327,12 @@ function en({
|
|
|
1327
1327
|
gap: 12
|
|
1328
1328
|
},
|
|
1329
1329
|
children: n.flatMap(
|
|
1330
|
-
(
|
|
1331
|
-
const
|
|
1332
|
-
r.row &&
|
|
1333
|
-
r.column &&
|
|
1330
|
+
(h) => s.map((p) => {
|
|
1331
|
+
const w = Zt(t, r, h, p), P = [
|
|
1332
|
+
r.row && h ? `${r.row[0]}=${h}` : "",
|
|
1333
|
+
r.column && p ? `${r.column[0]}=${p}` : ""
|
|
1334
1334
|
].filter(Boolean).join(" · ");
|
|
1335
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ $(
|
|
1336
1336
|
"article",
|
|
1337
1337
|
{
|
|
1338
1338
|
style: {
|
|
@@ -1343,23 +1343,23 @@ function en({
|
|
|
1343
1343
|
background: ge
|
|
1344
1344
|
},
|
|
1345
1345
|
children: [
|
|
1346
|
-
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1349
|
-
|
|
1346
|
+
P ? /* @__PURE__ */ v("div", { style: { marginBottom: 12, color: B, fontSize: 11 }, children: P }) : null,
|
|
1347
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Te(
|
|
1348
|
+
a,
|
|
1349
|
+
w,
|
|
1350
1350
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1351
1351
|
) })
|
|
1352
1352
|
]
|
|
1353
1353
|
},
|
|
1354
|
-
`${
|
|
1354
|
+
`${h ?? "default"}:${p ?? "default"}`
|
|
1355
1355
|
);
|
|
1356
1356
|
})
|
|
1357
1357
|
)
|
|
1358
1358
|
}
|
|
1359
1359
|
),
|
|
1360
|
-
r.additional.map(([
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1360
|
+
r.additional.map(([h, p]) => /* @__PURE__ */ $("section", { style: { marginTop: 20 }, children: [
|
|
1361
|
+
/* @__PURE__ */ v("h2", { style: { margin: "0 0 10px", color: B, fontSize: 12 }, children: h }),
|
|
1362
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: p.map((w) => /* @__PURE__ */ $(
|
|
1363
1363
|
"article",
|
|
1364
1364
|
{
|
|
1365
1365
|
style: {
|
|
@@ -1369,17 +1369,17 @@ function en({
|
|
|
1369
1369
|
background: ge
|
|
1370
1370
|
},
|
|
1371
1371
|
children: [
|
|
1372
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ v("div", { style: { marginBottom: 12, color: B, fontSize: 11 }, children: w }),
|
|
1373
1373
|
Te(
|
|
1374
|
-
|
|
1375
|
-
{ ...t.defaultProps, [
|
|
1374
|
+
a,
|
|
1375
|
+
{ ...t.defaultProps, [h]: w },
|
|
1376
1376
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1377
1377
|
)
|
|
1378
1378
|
]
|
|
1379
1379
|
},
|
|
1380
|
-
|
|
1380
|
+
w
|
|
1381
1381
|
)) })
|
|
1382
|
-
] },
|
|
1382
|
+
] }, h))
|
|
1383
1383
|
]
|
|
1384
1384
|
}
|
|
1385
1385
|
);
|
|
@@ -1388,11 +1388,11 @@ function wn(e) {
|
|
|
1388
1388
|
Ye(e.items);
|
|
1389
1389
|
const t = {}, o = [], r = [], n = e.maxVariantCells ?? 60;
|
|
1390
1390
|
for (const s of e.items) {
|
|
1391
|
-
const
|
|
1391
|
+
const a = Qe(
|
|
1392
1392
|
e.kind,
|
|
1393
1393
|
s.id,
|
|
1394
1394
|
e.registryPrefix
|
|
1395
|
-
), d = e.registry[s.name], u = () => /* @__PURE__ */
|
|
1395
|
+
), d = e.registry[s.name], u = () => /* @__PURE__ */ v(
|
|
1396
1396
|
en,
|
|
1397
1397
|
{
|
|
1398
1398
|
item: s,
|
|
@@ -1400,11 +1400,11 @@ function wn(e) {
|
|
|
1400
1400
|
maxVariantCells: n
|
|
1401
1401
|
}
|
|
1402
1402
|
);
|
|
1403
|
-
t[
|
|
1403
|
+
t[a] = { component: u, children: "none" }, o.push({
|
|
1404
1404
|
id: s.id,
|
|
1405
1405
|
name: s.name,
|
|
1406
1406
|
section: s.section,
|
|
1407
|
-
componentName:
|
|
1407
|
+
componentName: a,
|
|
1408
1408
|
// The seed exists only long enough to mount the intrinsic max-content
|
|
1409
1409
|
// catalog root. The editor replaces it with actual rendered DOM bounds.
|
|
1410
1410
|
width: 1,
|
|
@@ -1429,7 +1429,7 @@ function He(e, t) {
|
|
|
1429
1429
|
const o = new URL(e, t);
|
|
1430
1430
|
return o.search = "", o.hash = "", o.pathname.endsWith("/") || (o.pathname = `${o.pathname}/`), o.href;
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1432
|
+
function Se(e) {
|
|
1433
1433
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1434
1434
|
const t = e;
|
|
1435
1435
|
return typeof t.domStructureHash != "string" || !Ue.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !Ue.test(t.screenshotHash) ? null : {
|
|
@@ -1464,11 +1464,11 @@ function on(e, t) {
|
|
|
1464
1464
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1465
1465
|
const o = e;
|
|
1466
1466
|
if (typeof o.id != "string" || !o.id) return null;
|
|
1467
|
-
const r =
|
|
1467
|
+
const r = Se(o), n = Se(o.before) ?? r;
|
|
1468
1468
|
if (!n) return null;
|
|
1469
|
-
const s =
|
|
1469
|
+
const s = Se(o.after);
|
|
1470
1470
|
if (t === "changed" && !s) return null;
|
|
1471
|
-
const
|
|
1471
|
+
const a = s ? rn(o.pixelDiff) : null;
|
|
1472
1472
|
return {
|
|
1473
1473
|
id: o.id,
|
|
1474
1474
|
before: n,
|
|
@@ -1477,17 +1477,17 @@ function on(e, t) {
|
|
|
1477
1477
|
domChanged: n.domStructureHash !== s.domStructureHash,
|
|
1478
1478
|
screenshotChanged: n.screenshotHash !== s.screenshotHash
|
|
1479
1479
|
} : {},
|
|
1480
|
-
...
|
|
1480
|
+
...a ? { pixelDiff: a } : {}
|
|
1481
1481
|
};
|
|
1482
1482
|
}
|
|
1483
1483
|
function sn(e, t = []) {
|
|
1484
1484
|
const o = new Set(t), r = o.size > 0, n = /* @__PURE__ */ new Set(), s = [
|
|
1485
|
-
...e.styles.map((
|
|
1486
|
-
...e.texts.map((
|
|
1487
|
-
...e.operations.map((
|
|
1485
|
+
...e.styles.map((a) => a.affectedFrames ?? []),
|
|
1486
|
+
...e.texts.map((a) => a.affectedFrames ?? []),
|
|
1487
|
+
...e.operations.map((a) => a.affectedFrames ?? [])
|
|
1488
1488
|
];
|
|
1489
|
-
for (const
|
|
1490
|
-
for (const d of
|
|
1489
|
+
for (const a of s)
|
|
1490
|
+
for (const d of a) {
|
|
1491
1491
|
if (r && nn.test(d.id) && !o.has(d.id))
|
|
1492
1492
|
throw new Error(
|
|
1493
1493
|
`"Impact Screen"${d.name}"This internal editor ID (${d.id}) is used. A canonical screen ID is required.`
|
|
@@ -1508,41 +1508,41 @@ async function Ge(e, t, o) {
|
|
|
1508
1508
|
);
|
|
1509
1509
|
if (typeof n.baselineId != "string" || !n.baselineId)
|
|
1510
1510
|
throw new Error("Pygmalion visual QA response has no baselineId");
|
|
1511
|
-
const s = Array.isArray(n.frames) ? n.frames.map((
|
|
1512
|
-
if (!
|
|
1513
|
-
const
|
|
1514
|
-
return typeof
|
|
1515
|
-
}).filter((
|
|
1511
|
+
const s = Array.isArray(n.frames) ? n.frames.map((p) => on(p, o.phase)).filter((p) => p != null) : [], a = Array.isArray(n.failures) ? n.failures.map((p) => {
|
|
1512
|
+
if (!p || typeof p != "object" || Array.isArray(p)) return null;
|
|
1513
|
+
const w = p;
|
|
1514
|
+
return typeof w.id == "string" && typeof w.error == "string" ? { id: w.id, error: w.error } : null;
|
|
1515
|
+
}).filter((p) => p != null) : [], d = new Set(o.frameIds), h = new Set(s.map((p) => p.id)).size === s.length && s.every((p) => d.has(p.id)) && a.every((p) => d.has(p.id));
|
|
1516
1516
|
return {
|
|
1517
1517
|
phase: o.phase,
|
|
1518
1518
|
baselineId: n.baselineId,
|
|
1519
|
-
complete: n.complete !== !1 &&
|
|
1519
|
+
complete: n.complete !== !1 && h && a.length === 0 && s.length === o.frameIds.length,
|
|
1520
1520
|
frames: s,
|
|
1521
|
-
failures:
|
|
1521
|
+
failures: a
|
|
1522
1522
|
};
|
|
1523
1523
|
}
|
|
1524
1524
|
const Ie = {
|
|
1525
1525
|
mirror: "/__pygmalion-dev-control",
|
|
1526
1526
|
sessions: "/__pygmalion-design-session",
|
|
1527
1527
|
inspect: "/__pygmalion-inspect"
|
|
1528
|
-
}, an = "pygmalion.designSessionId", cn = "/__pygmalion-qa",
|
|
1528
|
+
}, an = "pygmalion.designSessionId", cn = "/__pygmalion-qa", pe = /* @__PURE__ */ new Map();
|
|
1529
1529
|
function Ke() {
|
|
1530
1530
|
var e;
|
|
1531
1531
|
return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1532
1532
|
}
|
|
1533
1533
|
function ln(e, t) {
|
|
1534
1534
|
if (e) return e;
|
|
1535
|
-
const o =
|
|
1535
|
+
const o = pe.get(t);
|
|
1536
1536
|
if (o) return o;
|
|
1537
1537
|
try {
|
|
1538
1538
|
const r = window.localStorage.getItem(t);
|
|
1539
1539
|
if (r)
|
|
1540
|
-
return
|
|
1540
|
+
return pe.set(t, r), r;
|
|
1541
1541
|
const n = Ke();
|
|
1542
|
-
return window.localStorage.setItem(t, n),
|
|
1542
|
+
return window.localStorage.setItem(t, n), pe.set(t, n), n;
|
|
1543
1543
|
} catch {
|
|
1544
1544
|
const r = Ke();
|
|
1545
|
-
return
|
|
1545
|
+
return pe.set(t, r), r;
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
1548
|
async function X(e) {
|
|
@@ -1550,21 +1550,21 @@ async function X(e) {
|
|
|
1550
1550
|
if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
|
|
1551
1551
|
return t;
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1554
|
-
var
|
|
1553
|
+
function bn(e = {}) {
|
|
1554
|
+
var L, ee, j, W, i;
|
|
1555
1555
|
const {
|
|
1556
1556
|
sessionId: t,
|
|
1557
1557
|
sessionStorageKey: o = an,
|
|
1558
1558
|
autoStart: r = !0,
|
|
1559
1559
|
fetcher: n = fetch,
|
|
1560
1560
|
formatApplyMessage: s
|
|
1561
|
-
} = e,
|
|
1562
|
-
() => JSON.parse(
|
|
1563
|
-
[
|
|
1564
|
-
),
|
|
1561
|
+
} = e, a = ((L = e.endpoints) == null ? void 0 : L.mirror) ?? Ie.mirror, d = ((ee = e.endpoints) == null ? void 0 : ee.sessions) ?? Ie.sessions, u = ((j = e.endpoints) == null ? void 0 : j.inspect) ?? Ie.inspect, h = e.visualQa != null, p = ((W = e.visualQa) == null ? void 0 : W.endpoint) ?? cn, w = JSON.stringify(((i = e.visualQa) == null ? void 0 : i.eligibleFrameIds) ?? []), P = re(
|
|
1562
|
+
() => JSON.parse(w),
|
|
1563
|
+
[w]
|
|
1564
|
+
), I = re(
|
|
1565
1565
|
() => ln(t, o),
|
|
1566
1566
|
[t, o]
|
|
1567
|
-
), [
|
|
1567
|
+
), [m, E] = ie({
|
|
1568
1568
|
state: "idle",
|
|
1569
1569
|
commit: null,
|
|
1570
1570
|
shortCommit: null,
|
|
@@ -1574,99 +1574,99 @@ function Sn(e = {}) {
|
|
|
1574
1574
|
warning: null,
|
|
1575
1575
|
error: null,
|
|
1576
1576
|
appOrigin: null
|
|
1577
|
-
}), [f,
|
|
1577
|
+
}), [f, M] = ie(null), [D, b] = ie(null), [O, Y] = ie({
|
|
1578
1578
|
refs: [],
|
|
1579
1579
|
defaultRef: null,
|
|
1580
1580
|
worktreeRef: null
|
|
1581
|
-
}),
|
|
1582
|
-
async (
|
|
1583
|
-
if (l != null &&
|
|
1584
|
-
}),
|
|
1585
|
-
const
|
|
1586
|
-
E((
|
|
1581
|
+
}), S = xe(null), C = xe(null), F = te(
|
|
1582
|
+
async (c = !0, l) => {
|
|
1583
|
+
if (l != null && S.current && await S.current.catch(() => {
|
|
1584
|
+
}), S.current) return S.current;
|
|
1585
|
+
const g = (async () => {
|
|
1586
|
+
E((x) => ({ ...x, state: "syncing", error: null }));
|
|
1587
1587
|
try {
|
|
1588
|
-
const
|
|
1589
|
-
let
|
|
1590
|
-
method:
|
|
1591
|
-
...
|
|
1588
|
+
const x = l != null;
|
|
1589
|
+
let R = await n(`${a}/${c || x ? "refresh" : "status"}`, {
|
|
1590
|
+
method: c || x ? "POST" : "GET",
|
|
1591
|
+
...x ? {
|
|
1592
1592
|
headers: { "content-type": "application/json" },
|
|
1593
1593
|
body: JSON.stringify({ ref: l })
|
|
1594
1594
|
} : {}
|
|
1595
|
-
}),
|
|
1595
|
+
}), k = await X(R);
|
|
1596
1596
|
const q = Date.now();
|
|
1597
|
-
for (; !
|
|
1598
|
-
await new Promise((
|
|
1599
|
-
if (
|
|
1600
|
-
throw new Error(
|
|
1601
|
-
const
|
|
1597
|
+
for (; !c && k.state === "syncing" && Date.now() - q < 12e4; )
|
|
1598
|
+
await new Promise((A) => window.setTimeout(A, 500)), R = await n(`${a}/status`), k = await X(R);
|
|
1599
|
+
if (k.state !== "ready" || !k.appOrigin || !k.commit)
|
|
1600
|
+
throw new Error(k.error ?? "Pygmalion could not prepare the source preview");
|
|
1601
|
+
const N = await X(
|
|
1602
1602
|
await n(`${d}/open`, {
|
|
1603
1603
|
method: "POST",
|
|
1604
1604
|
headers: { "content-type": "application/json" },
|
|
1605
|
-
body: JSON.stringify({ sessionId:
|
|
1605
|
+
body: JSON.stringify({ sessionId: I, baseDevSha: k.commit })
|
|
1606
1606
|
})
|
|
1607
1607
|
);
|
|
1608
|
-
if (!
|
|
1609
|
-
throw new Error(
|
|
1610
|
-
let
|
|
1611
|
-
if (
|
|
1612
|
-
const
|
|
1608
|
+
if (!N.ok || !N.session)
|
|
1609
|
+
throw new Error(N.error ?? "Pygmalion could not open the design session");
|
|
1610
|
+
let y = N.session;
|
|
1611
|
+
if (y.branchName) {
|
|
1612
|
+
const A = await X(
|
|
1613
1613
|
await n(`${d}/check`, {
|
|
1614
1614
|
method: "POST",
|
|
1615
1615
|
headers: { "content-type": "application/json" },
|
|
1616
|
-
body: JSON.stringify({ sessionId:
|
|
1616
|
+
body: JSON.stringify({ sessionId: y.id })
|
|
1617
1617
|
})
|
|
1618
1618
|
);
|
|
1619
|
-
if (!
|
|
1620
|
-
throw new Error(
|
|
1621
|
-
|
|
1619
|
+
if (!A.ok || !A.session)
|
|
1620
|
+
throw new Error(A.error ?? "Pygmalion could not check the design session");
|
|
1621
|
+
y = A.session;
|
|
1622
1622
|
}
|
|
1623
|
-
E(
|
|
1624
|
-
} catch (
|
|
1625
|
-
E((
|
|
1626
|
-
...
|
|
1623
|
+
E(k), M(y), b(y.appOrigin ?? k.appOrigin);
|
|
1624
|
+
} catch (x) {
|
|
1625
|
+
E((R) => ({
|
|
1626
|
+
...R,
|
|
1627
1627
|
state: "error",
|
|
1628
|
-
error:
|
|
1628
|
+
error: x instanceof Error ? x.message : String(x)
|
|
1629
1629
|
}));
|
|
1630
1630
|
}
|
|
1631
1631
|
})();
|
|
1632
|
-
|
|
1632
|
+
S.current = g;
|
|
1633
1633
|
try {
|
|
1634
|
-
await
|
|
1634
|
+
await g;
|
|
1635
1635
|
} finally {
|
|
1636
|
-
|
|
1636
|
+
S.current === g && (S.current = null);
|
|
1637
1637
|
}
|
|
1638
1638
|
},
|
|
1639
|
-
[n,
|
|
1640
|
-
),
|
|
1639
|
+
[n, a, d, I]
|
|
1640
|
+
), z = te(async () => {
|
|
1641
1641
|
try {
|
|
1642
|
-
const
|
|
1643
|
-
await n(`${
|
|
1642
|
+
const c = await X(
|
|
1643
|
+
await n(`${a}/refs`)
|
|
1644
1644
|
), l = {
|
|
1645
|
-
refs:
|
|
1646
|
-
defaultRef:
|
|
1647
|
-
worktreeRef:
|
|
1645
|
+
refs: c.refs ?? [],
|
|
1646
|
+
defaultRef: c.defaultRef ?? null,
|
|
1647
|
+
worktreeRef: c.worktreeRef ?? null
|
|
1648
1648
|
};
|
|
1649
1649
|
return Y(l), l;
|
|
1650
1650
|
} catch {
|
|
1651
|
-
return
|
|
1651
|
+
return O;
|
|
1652
1652
|
}
|
|
1653
|
-
}, [n,
|
|
1654
|
-
async (
|
|
1653
|
+
}, [n, a, O]), J = te(
|
|
1654
|
+
async (c, l) => {
|
|
1655
1655
|
if (f != null && f.branchName && !(l != null && l.discardEdits))
|
|
1656
1656
|
throw new Error(
|
|
1657
1657
|
"This design session has unapplied edits against the current source. Apply or revert them, or pass discardEdits to switch anyway."
|
|
1658
1658
|
);
|
|
1659
|
-
await
|
|
1659
|
+
await F(!0, c), await z();
|
|
1660
1660
|
},
|
|
1661
|
-
[
|
|
1662
|
-
),
|
|
1663
|
-
async (
|
|
1664
|
-
var
|
|
1661
|
+
[z, F, f == null ? void 0 : f.branchName]
|
|
1662
|
+
), oe = te(
|
|
1663
|
+
async (c) => {
|
|
1664
|
+
var k;
|
|
1665
1665
|
if (!f) throw new Error("Pygmalion design session is not ready");
|
|
1666
|
-
const l =
|
|
1667
|
-
if (l && (l.sessionId !== f.id || l.baseDevSha !== f.baseDevSha || l.revision !== f.revision || l.fingerprint !== JSON.stringify(
|
|
1666
|
+
const l = C.current;
|
|
1667
|
+
if (l && (l.sessionId !== f.id || l.baseDevSha !== f.baseDevSha || l.revision !== f.revision || l.fingerprint !== JSON.stringify(c)))
|
|
1668
1668
|
throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
|
|
1669
|
-
const
|
|
1669
|
+
const g = await X(
|
|
1670
1670
|
await n(`${d}/apply-visual`, {
|
|
1671
1671
|
method: "POST",
|
|
1672
1672
|
headers: { "content-type": "application/json" },
|
|
@@ -1675,47 +1675,47 @@ function Sn(e = {}) {
|
|
|
1675
1675
|
baseDevSha: f.baseDevSha,
|
|
1676
1676
|
expectedRevision: f.revision,
|
|
1677
1677
|
...l ? { previewRevision: l.revision } : {},
|
|
1678
|
-
changes:
|
|
1678
|
+
changes: c
|
|
1679
1679
|
})
|
|
1680
1680
|
})
|
|
1681
1681
|
);
|
|
1682
|
-
if (!
|
|
1683
|
-
throw new Error(
|
|
1684
|
-
|
|
1685
|
-
const
|
|
1686
|
-
let
|
|
1687
|
-
if (l != null && l.qaBaselineId && ((
|
|
1682
|
+
if (!g.ok || !g.session)
|
|
1683
|
+
throw new Error(g.error ?? "Pygmalion could not apply the visual changes");
|
|
1684
|
+
M(g.session), g.session.appOrigin && b(g.session.appOrigin);
|
|
1685
|
+
const x = g.applied ?? c.styles.length + c.texts.length + c.operations.length;
|
|
1686
|
+
let R;
|
|
1687
|
+
if (l != null && l.qaBaselineId && ((k = l.qaFrameIds) != null && k.length) && g.session.appOrigin)
|
|
1688
1688
|
try {
|
|
1689
|
-
|
|
1689
|
+
R = await Ge(n, p, {
|
|
1690
1690
|
phase: "changed",
|
|
1691
1691
|
baselineId: l.qaBaselineId,
|
|
1692
|
-
basePath: He(
|
|
1692
|
+
basePath: He(g.session.appOrigin, window.location.origin),
|
|
1693
1693
|
frameIds: l.qaFrameIds
|
|
1694
1694
|
});
|
|
1695
1695
|
} catch (q) {
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1696
|
+
const N = q instanceof Error ? q.message : String(q);
|
|
1697
|
+
R = {
|
|
1698
1698
|
phase: "changed",
|
|
1699
1699
|
baselineId: l.qaBaselineId,
|
|
1700
1700
|
complete: !1,
|
|
1701
1701
|
frames: [],
|
|
1702
|
-
failures: l.qaFrameIds.map((
|
|
1702
|
+
failures: l.qaFrameIds.map((y) => ({ id: y, error: N }))
|
|
1703
1703
|
};
|
|
1704
1704
|
}
|
|
1705
|
-
return
|
|
1706
|
-
applied:
|
|
1707
|
-
branch:
|
|
1708
|
-
integration:
|
|
1709
|
-
message: s == null ? void 0 : s(
|
|
1710
|
-
...
|
|
1705
|
+
return C.current = null, {
|
|
1706
|
+
applied: x,
|
|
1707
|
+
branch: g.session.branchName ?? void 0,
|
|
1708
|
+
integration: g.session.integration.state,
|
|
1709
|
+
message: s == null ? void 0 : s(g.session, x),
|
|
1710
|
+
...R ? { qa: R } : {}
|
|
1711
1711
|
};
|
|
1712
1712
|
},
|
|
1713
|
-
[n, s,
|
|
1714
|
-
),
|
|
1715
|
-
async (
|
|
1716
|
-
var
|
|
1713
|
+
[n, s, p, f, d]
|
|
1714
|
+
), se = te(
|
|
1715
|
+
async (c) => {
|
|
1716
|
+
var k;
|
|
1717
1717
|
if (!f) throw new Error("Pygmalion design session is not ready");
|
|
1718
|
-
|
|
1718
|
+
C.current = null;
|
|
1719
1719
|
const l = await X(
|
|
1720
1720
|
await n(`${d}/preview-visual`, {
|
|
1721
1721
|
method: "POST",
|
|
@@ -1724,57 +1724,57 @@ function Sn(e = {}) {
|
|
|
1724
1724
|
sessionId: f.id,
|
|
1725
1725
|
baseDevSha: f.baseDevSha,
|
|
1726
1726
|
expectedRevision: f.revision,
|
|
1727
|
-
changes:
|
|
1727
|
+
changes: c
|
|
1728
1728
|
})
|
|
1729
1729
|
})
|
|
1730
1730
|
);
|
|
1731
1731
|
if (!l.ok || !Number.isSafeInteger(l.revision))
|
|
1732
1732
|
throw new Error(l.error ?? "Pygmalion could not preview the visual changes");
|
|
1733
|
-
const
|
|
1734
|
-
let
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
if (!
|
|
1733
|
+
const g = h ? sn(c, P) : [];
|
|
1734
|
+
let x;
|
|
1735
|
+
const R = f.appOrigin ?? m.appOrigin;
|
|
1736
|
+
if (g.length > 0) {
|
|
1737
|
+
if (!R)
|
|
1738
1738
|
throw new Error("Impact screen QA baseline preview not ready");
|
|
1739
|
-
if (
|
|
1739
|
+
if (x = await Ge(n, p, {
|
|
1740
1740
|
phase: "baseline",
|
|
1741
|
-
basePath: He(
|
|
1742
|
-
frameIds:
|
|
1743
|
-
}), !
|
|
1741
|
+
basePath: He(R, window.location.origin),
|
|
1742
|
+
frameIds: g
|
|
1743
|
+
}), !x.complete)
|
|
1744
1744
|
throw new Error(
|
|
1745
|
-
((
|
|
1745
|
+
((k = x.failures[0]) == null ? void 0 : k.error) ?? `Failed to capture ${g.length - x.frames.length} affected frames`
|
|
1746
1746
|
);
|
|
1747
1747
|
}
|
|
1748
|
-
return
|
|
1748
|
+
return C.current = {
|
|
1749
1749
|
sessionId: f.id,
|
|
1750
1750
|
baseDevSha: f.baseDevSha,
|
|
1751
1751
|
revision: l.revision,
|
|
1752
|
-
fingerprint: JSON.stringify(
|
|
1753
|
-
...
|
|
1752
|
+
fingerprint: JSON.stringify(c),
|
|
1753
|
+
...x ? { qaBaselineId: x.baselineId, qaFrameIds: g } : {}
|
|
1754
1754
|
}, {
|
|
1755
1755
|
revision: l.revision,
|
|
1756
1756
|
files: Array.isArray(l.files) ? l.files : [],
|
|
1757
1757
|
affectedFiles: Array.isArray(l.affectedFiles) ? l.affectedFiles : [],
|
|
1758
|
-
...
|
|
1758
|
+
...x ? { qa: x } : {}
|
|
1759
1759
|
};
|
|
1760
1760
|
},
|
|
1761
1761
|
[
|
|
1762
1762
|
n,
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1763
|
+
m.appOrigin,
|
|
1764
|
+
P,
|
|
1765
|
+
p,
|
|
1766
1766
|
f,
|
|
1767
1767
|
d,
|
|
1768
|
-
|
|
1768
|
+
h
|
|
1769
1769
|
]
|
|
1770
1770
|
), Z = te(
|
|
1771
|
-
async (
|
|
1772
|
-
if (
|
|
1771
|
+
async (c) => {
|
|
1772
|
+
if (c.length === 0) return { files: [] };
|
|
1773
1773
|
const l = await X(
|
|
1774
1774
|
await n(`${u}/impact`, {
|
|
1775
1775
|
method: "POST",
|
|
1776
1776
|
headers: { "content-type": "application/json" },
|
|
1777
|
-
body: JSON.stringify({ componentFiles:
|
|
1777
|
+
body: JSON.stringify({ componentFiles: c })
|
|
1778
1778
|
})
|
|
1779
1779
|
);
|
|
1780
1780
|
if (l.error || l.ok === !1)
|
|
@@ -1785,7 +1785,7 @@ function Sn(e = {}) {
|
|
|
1785
1785
|
), K = te(async () => {
|
|
1786
1786
|
if (!(f != null && f.canRevert) || !f.headSha)
|
|
1787
1787
|
throw new Error("There are no reversible changes applied");
|
|
1788
|
-
const
|
|
1788
|
+
const c = await X(
|
|
1789
1789
|
await n(`${d}/revert-visual`, {
|
|
1790
1790
|
method: "POST",
|
|
1791
1791
|
headers: { "content-type": "application/json" },
|
|
@@ -1797,77 +1797,88 @@ function Sn(e = {}) {
|
|
|
1797
1797
|
})
|
|
1798
1798
|
})
|
|
1799
1799
|
);
|
|
1800
|
-
if (!
|
|
1801
|
-
throw new Error(
|
|
1802
|
-
return
|
|
1800
|
+
if (!c.ok || c.reverted !== !0 || !c.operation || c.operation.kind !== "visual-revert" || !c.session)
|
|
1801
|
+
throw new Error(c.error ?? "Pygmalion could not revert the last visual change");
|
|
1802
|
+
return C.current = null, M(c.session), c.session.appOrigin && b(c.session.appOrigin), {
|
|
1803
1803
|
reverted: !0,
|
|
1804
|
-
operation:
|
|
1805
|
-
session:
|
|
1804
|
+
operation: c.operation,
|
|
1805
|
+
session: c.session
|
|
1806
1806
|
};
|
|
1807
1807
|
}, [n, f, d]);
|
|
1808
|
-
|
|
1809
|
-
r &&
|
|
1810
|
-
}, [r,
|
|
1811
|
-
r &&
|
|
1808
|
+
ae(() => {
|
|
1809
|
+
r && F(!1);
|
|
1810
|
+
}, [r, F]), ae(() => {
|
|
1811
|
+
r && z();
|
|
1812
1812
|
}, [r]);
|
|
1813
|
-
const Q = (f == null ? void 0 : f.appOrigin) ??
|
|
1813
|
+
const Q = (f == null ? void 0 : f.appOrigin) ?? m.appOrigin ?? D, U = (f == null ? void 0 : f.headSha) ?? (f == null ? void 0 : f.baseDevSha) ?? m.commit ?? "pending";
|
|
1814
1814
|
return {
|
|
1815
|
-
mirror:
|
|
1815
|
+
mirror: m,
|
|
1816
1816
|
session: f,
|
|
1817
1817
|
ready: D != null,
|
|
1818
1818
|
appOrigin: Q,
|
|
1819
1819
|
previewRevision: `${U}:${(f == null ? void 0 : f.revision) ?? 0}`,
|
|
1820
1820
|
previewSourceRevision: U,
|
|
1821
|
-
refresh:
|
|
1822
|
-
switchSource:
|
|
1823
|
-
sourceRefs:
|
|
1824
|
-
loadSourceRefs:
|
|
1825
|
-
previewVisual:
|
|
1821
|
+
refresh: F,
|
|
1822
|
+
switchSource: J,
|
|
1823
|
+
sourceRefs: O,
|
|
1824
|
+
loadSourceRefs: z,
|
|
1825
|
+
previewVisual: se,
|
|
1826
1826
|
inspectImpact: Z,
|
|
1827
|
-
applyVisual:
|
|
1827
|
+
applyVisual: oe,
|
|
1828
1828
|
revertLastVisual: K
|
|
1829
1829
|
};
|
|
1830
1830
|
}
|
|
1831
|
-
function
|
|
1831
|
+
function vn({
|
|
1832
1832
|
value: e,
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1833
|
+
currentCommit: t = null,
|
|
1834
|
+
refs: o,
|
|
1835
|
+
onChange: r,
|
|
1836
|
+
busy: n = !1,
|
|
1837
|
+
defaultRef: s = null,
|
|
1838
|
+
worktreeRef: a = null,
|
|
1839
|
+
label: d = "Source revision",
|
|
1840
|
+
refreshLabel: u = "Refresh current revision",
|
|
1841
|
+
children: h,
|
|
1842
|
+
className: p
|
|
1841
1843
|
}) {
|
|
1842
|
-
const
|
|
1844
|
+
const w = re(
|
|
1843
1845
|
() => ({
|
|
1844
|
-
local:
|
|
1845
|
-
remote:
|
|
1846
|
+
local: o.filter((b) => b.kind === "local"),
|
|
1847
|
+
remote: o.filter((b) => b.kind === "remote")
|
|
1846
1848
|
}),
|
|
1847
|
-
[
|
|
1848
|
-
),
|
|
1849
|
-
const
|
|
1850
|
-
return
|
|
1851
|
-
}, [
|
|
1852
|
-
|
|
1849
|
+
[o]
|
|
1850
|
+
), P = re(() => {
|
|
1851
|
+
const b = new Set(o.map((O) => O.name));
|
|
1852
|
+
return s && b.add(s), a && b.add(a), b;
|
|
1853
|
+
}, [s, o, a]), I = e ?? s ?? "", m = re(
|
|
1854
|
+
() => o.find((b) => b.name === I) ?? null,
|
|
1855
|
+
[o, I]
|
|
1856
|
+
), E = (t == null ? void 0 : t.toLowerCase()) ?? null, f = (m == null ? void 0 : m.commit.toLowerCase()) ?? null, M = !!(E && f && E !== f && !E.startsWith(f) && !f.startsWith(E)), D = (t == null ? void 0 : t.slice(0, 8)) ?? null;
|
|
1857
|
+
return /* @__PURE__ */ $(
|
|
1853
1858
|
"span",
|
|
1854
1859
|
{
|
|
1855
|
-
className:
|
|
1860
|
+
className: p,
|
|
1856
1861
|
"data-pygmalion-source-ref": "",
|
|
1857
|
-
"data-busy":
|
|
1862
|
+
"data-busy": n ? "" : void 0,
|
|
1863
|
+
"data-update-available": M ? "" : void 0,
|
|
1864
|
+
"data-latest-commit": M ? m == null ? void 0 : m.commit : void 0,
|
|
1858
1865
|
style: { position: "relative", display: "inline-flex", alignItems: "center" },
|
|
1859
1866
|
children: [
|
|
1860
|
-
|
|
1861
|
-
/* @__PURE__ */
|
|
1867
|
+
h ?? /* @__PURE__ */ v("span", { "data-pygmalion-source-ref-value": "", children: I || d }),
|
|
1868
|
+
/* @__PURE__ */ $(
|
|
1862
1869
|
"select",
|
|
1863
1870
|
{
|
|
1864
|
-
value:
|
|
1865
|
-
disabled:
|
|
1866
|
-
"aria-label":
|
|
1871
|
+
value: I,
|
|
1872
|
+
disabled: n,
|
|
1873
|
+
"aria-label": d,
|
|
1867
1874
|
"data-pygmalion-source-ref-select": "",
|
|
1868
|
-
onChange: (
|
|
1869
|
-
const
|
|
1870
|
-
|
|
1875
|
+
onChange: (b) => {
|
|
1876
|
+
const O = b.target.value;
|
|
1877
|
+
if (!O) {
|
|
1878
|
+
I && r(I);
|
|
1879
|
+
return;
|
|
1880
|
+
}
|
|
1881
|
+
O && O !== I && r(O);
|
|
1871
1882
|
},
|
|
1872
1883
|
style: {
|
|
1873
1884
|
position: "absolute",
|
|
@@ -1875,7 +1886,7 @@ function bn({
|
|
|
1875
1886
|
width: "100%",
|
|
1876
1887
|
height: "100%",
|
|
1877
1888
|
opacity: 0,
|
|
1878
|
-
cursor:
|
|
1889
|
+
cursor: n ? "default" : "pointer",
|
|
1879
1890
|
// The native menu stays reachable; only the painted trigger is the host's.
|
|
1880
1891
|
appearance: "none",
|
|
1881
1892
|
border: 0,
|
|
@@ -1883,21 +1894,27 @@ function bn({
|
|
|
1883
1894
|
margin: 0
|
|
1884
1895
|
},
|
|
1885
1896
|
children: [
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1897
|
+
I ? /* @__PURE__ */ $("option", { value: "", children: [
|
|
1898
|
+
u,
|
|
1899
|
+
" · ",
|
|
1900
|
+
I,
|
|
1901
|
+
M ? ` · ${D ?? "unknown"} → ${(m == null ? void 0 : m.commit) ?? "latest"}` : ""
|
|
1902
|
+
] }) : null,
|
|
1903
|
+
I && !P.has(I) ? /* @__PURE__ */ v("option", { value: I, children: I }) : null,
|
|
1904
|
+
a ? /* @__PURE__ */ $("option", { value: a, children: [
|
|
1905
|
+
a,
|
|
1889
1906
|
" · uncommitted work"
|
|
1890
1907
|
] }) : null,
|
|
1891
|
-
|
|
1892
|
-
|
|
1908
|
+
w.local.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "local", children: w.local.map((b) => /* @__PURE__ */ $("option", { value: b.name, children: [
|
|
1909
|
+
b.name,
|
|
1893
1910
|
" · ",
|
|
1894
|
-
|
|
1895
|
-
] },
|
|
1896
|
-
|
|
1897
|
-
|
|
1911
|
+
b.commit
|
|
1912
|
+
] }, b.fullName)) }) : null,
|
|
1913
|
+
w.remote.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "remote", children: w.remote.map((b) => /* @__PURE__ */ $("option", { value: b.name, children: [
|
|
1914
|
+
b.name,
|
|
1898
1915
|
" · ",
|
|
1899
|
-
|
|
1900
|
-
] },
|
|
1916
|
+
b.commit
|
|
1917
|
+
] }, b.fullName)) }) : null
|
|
1901
1918
|
]
|
|
1902
1919
|
}
|
|
1903
1920
|
)
|
|
@@ -1905,20 +1922,20 @@ function bn({
|
|
|
1905
1922
|
}
|
|
1906
1923
|
);
|
|
1907
1924
|
}
|
|
1908
|
-
const
|
|
1909
|
-
editor:
|
|
1925
|
+
const Sn = {
|
|
1926
|
+
editor: V,
|
|
1910
1927
|
getObserverTree: tt,
|
|
1911
1928
|
isObservableProp: et
|
|
1912
1929
|
};
|
|
1913
1930
|
function In(e) {
|
|
1914
|
-
|
|
1931
|
+
V.navigateToPageByName(e);
|
|
1915
1932
|
}
|
|
1916
1933
|
function xn() {
|
|
1917
|
-
|
|
1934
|
+
V.openPreview();
|
|
1918
1935
|
}
|
|
1919
1936
|
function Pn() {
|
|
1920
1937
|
const e = De.entries.length > 0;
|
|
1921
|
-
return e && De.discardPending(),
|
|
1938
|
+
return e && De.discardPending(), V.resetCurrentEdits() || e;
|
|
1922
1939
|
}
|
|
1923
1940
|
function En({
|
|
1924
1941
|
registry: e,
|
|
@@ -1927,30 +1944,30 @@ function En({
|
|
|
1927
1944
|
componentConnections: r,
|
|
1928
1945
|
viewportPresets: n,
|
|
1929
1946
|
previewEnvironmentControls: s,
|
|
1930
|
-
designImport:
|
|
1947
|
+
designImport: a,
|
|
1931
1948
|
onTokensChange: d,
|
|
1932
1949
|
appOrigin: u,
|
|
1933
|
-
previewRevision:
|
|
1934
|
-
previewCacheNamespace:
|
|
1935
|
-
previewArtifacts:
|
|
1936
|
-
previewArtifactEndpoint:
|
|
1937
|
-
previewConcurrency:
|
|
1938
|
-
previewOpen:
|
|
1950
|
+
previewRevision: h,
|
|
1951
|
+
previewCacheNamespace: p,
|
|
1952
|
+
previewArtifacts: w,
|
|
1953
|
+
previewArtifactEndpoint: P,
|
|
1954
|
+
previewConcurrency: I,
|
|
1955
|
+
previewOpen: m,
|
|
1939
1956
|
onPreviewOpenChange: E,
|
|
1940
1957
|
flowCanvas: f,
|
|
1941
|
-
onApply:
|
|
1958
|
+
onApply: M,
|
|
1942
1959
|
onDesignChange: D,
|
|
1943
|
-
onInspectApply:
|
|
1944
|
-
onInspectPreview:
|
|
1960
|
+
onInspectApply: b,
|
|
1961
|
+
onInspectPreview: O,
|
|
1945
1962
|
onInspectImpact: Y,
|
|
1946
|
-
storyboardDiscovery:
|
|
1947
|
-
storyboardDiscoveryEndpoint:
|
|
1963
|
+
storyboardDiscovery: S = !0,
|
|
1964
|
+
storyboardDiscoveryEndpoint: C = wt
|
|
1948
1965
|
}) {
|
|
1949
|
-
const [
|
|
1950
|
-
|
|
1951
|
-
const
|
|
1952
|
-
|
|
1953
|
-
const Q =
|
|
1966
|
+
const [F, z] = ie(!S), [J, oe] = ie();
|
|
1967
|
+
a && (a.assertComplete(), nt(a));
|
|
1968
|
+
const se = e ?? (a == null ? void 0 : a.getRegistry()), Z = t ?? (a == null ? void 0 : a.getTokens()), K = o ?? (a == null ? void 0 : a.getInitialPages());
|
|
1969
|
+
se && rt(se), ot(r ?? []), Z && st(Z), n && it(n), It(d ?? null), at(p);
|
|
1970
|
+
const Q = J ?? w, U = re(
|
|
1954
1971
|
() => (K ?? []).flatMap(
|
|
1955
1972
|
(i) => i.route && i.importPageId ? [
|
|
1956
1973
|
{
|
|
@@ -1966,225 +1983,225 @@ function En({
|
|
|
1966
1983
|
] : []
|
|
1967
1984
|
),
|
|
1968
1985
|
[K]
|
|
1969
|
-
),
|
|
1986
|
+
), L = h ?? vt(), ee = u ?? ke(), j = xe([]), W = re(
|
|
1970
1987
|
() => U.map((i) => ({
|
|
1971
1988
|
id: i.canonicalId,
|
|
1972
1989
|
fingerprint: ct(
|
|
1973
1990
|
i,
|
|
1974
|
-
|
|
1975
|
-
|
|
1991
|
+
L,
|
|
1992
|
+
be()
|
|
1976
1993
|
)
|
|
1977
1994
|
})),
|
|
1978
|
-
[U,
|
|
1995
|
+
[U, L, F]
|
|
1979
1996
|
);
|
|
1980
|
-
return
|
|
1981
|
-
u != null && ft(u),
|
|
1982
|
-
}, [u, s,
|
|
1983
|
-
!Q || !K ||
|
|
1984
|
-
namespace:
|
|
1985
|
-
previewRevision:
|
|
1997
|
+
return j.current = W, I != null && lt(I), xt(E ?? null), f != null && dt(f), Pt(M ?? null), Et(b ?? null), ut(O ?? null), Ct(Y ?? null), K && V.initPagesFromComponents(K), ze(() => {
|
|
1998
|
+
u != null && ft(u), h != null && pt(h), mt(s ?? []);
|
|
1999
|
+
}, [u, s, h]), ze(() => {
|
|
2000
|
+
!Q || !K || !F || Me(Q, {
|
|
2001
|
+
namespace: p ?? "",
|
|
2002
|
+
previewRevision: L,
|
|
1986
2003
|
appOrigin: ee,
|
|
1987
|
-
baselineEnvironment:
|
|
1988
|
-
allowStaleIdentity: !!
|
|
1989
|
-
allowMatchingFrameIdentity:
|
|
1990
|
-
pages: U.map((i,
|
|
2004
|
+
baselineEnvironment: be(),
|
|
2005
|
+
allowStaleIdentity: !!P,
|
|
2006
|
+
allowMatchingFrameIdentity: J != null,
|
|
2007
|
+
pages: U.map((i, c) => {
|
|
1991
2008
|
var l;
|
|
1992
2009
|
return {
|
|
1993
2010
|
...i,
|
|
1994
|
-
fingerprint: (l =
|
|
2011
|
+
fingerprint: (l = W[c]) == null ? void 0 : l.fingerprint
|
|
1995
2012
|
};
|
|
1996
2013
|
})
|
|
1997
2014
|
});
|
|
1998
2015
|
}, [
|
|
1999
2016
|
Q,
|
|
2000
|
-
|
|
2017
|
+
W,
|
|
2001
2018
|
U,
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2019
|
+
P,
|
|
2020
|
+
p,
|
|
2021
|
+
J,
|
|
2005
2022
|
ee,
|
|
2006
2023
|
K,
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
]),
|
|
2024
|
+
L,
|
|
2025
|
+
F
|
|
2026
|
+
]), ae(() => {
|
|
2010
2027
|
Fe(D ?? null);
|
|
2011
|
-
const i = gt(
|
|
2028
|
+
const i = gt(V);
|
|
2012
2029
|
return () => {
|
|
2013
2030
|
i(), Fe(null);
|
|
2014
2031
|
};
|
|
2015
|
-
}, [D]),
|
|
2016
|
-
if (
|
|
2032
|
+
}, [D]), ae(() => {
|
|
2033
|
+
if (oe(void 0), !F || !P || !(p != null && p.trim()) || !(h != null && h.trim()))
|
|
2017
2034
|
return;
|
|
2018
|
-
const i = new AbortController(),
|
|
2019
|
-
endpoint:
|
|
2035
|
+
const i = new AbortController(), c = ht({
|
|
2036
|
+
endpoint: P,
|
|
2020
2037
|
captureBaseUrl: u
|
|
2021
|
-
}), l = yt(
|
|
2022
|
-
Me(
|
|
2023
|
-
namespace:
|
|
2024
|
-
previewRevision:
|
|
2038
|
+
}), l = yt(h), g = (N) => {
|
|
2039
|
+
Me(N, {
|
|
2040
|
+
namespace: p,
|
|
2041
|
+
previewRevision: h,
|
|
2025
2042
|
appOrigin: ke(),
|
|
2026
|
-
baselineEnvironment:
|
|
2043
|
+
baselineEnvironment: be(),
|
|
2027
2044
|
allowStaleIdentity: !0,
|
|
2028
2045
|
allowMatchingFrameIdentity: !0,
|
|
2029
|
-
pages: U.map((
|
|
2030
|
-
var
|
|
2046
|
+
pages: U.map((y, A) => {
|
|
2047
|
+
var _;
|
|
2031
2048
|
return {
|
|
2032
|
-
...
|
|
2033
|
-
fingerprint: (
|
|
2049
|
+
...y,
|
|
2050
|
+
fingerprint: (_ = W[A]) == null ? void 0 : _.fingerprint
|
|
2034
2051
|
};
|
|
2035
2052
|
})
|
|
2036
|
-
}),
|
|
2037
|
-
},
|
|
2038
|
-
namespace:
|
|
2053
|
+
}), oe(N);
|
|
2054
|
+
}, x = (N, y, A) => St({
|
|
2055
|
+
namespace: p,
|
|
2039
2056
|
sourceRevision: l,
|
|
2040
|
-
transport:
|
|
2041
|
-
signal:
|
|
2042
|
-
...
|
|
2043
|
-
...
|
|
2044
|
-
}),
|
|
2045
|
-
const
|
|
2046
|
-
return
|
|
2047
|
-
},
|
|
2048
|
-
if (
|
|
2049
|
-
var
|
|
2050
|
-
const
|
|
2051
|
-
if (
|
|
2052
|
-
|
|
2053
|
-
const fe = new Set(((
|
|
2054
|
-
if (
|
|
2057
|
+
transport: c,
|
|
2058
|
+
signal: A,
|
|
2059
|
+
...N.length ? { frames: N } : {},
|
|
2060
|
+
...y ? {} : { generate: !1 }
|
|
2061
|
+
}), R = (N, y) => {
|
|
2062
|
+
const A = new Set(y);
|
|
2063
|
+
return N.filter((_) => A.has(_.id));
|
|
2064
|
+
}, k = (N, y) => N instanceof Error && N.message ? N.message : y, q = new AbortController();
|
|
2065
|
+
if ($e(async (N) => {
|
|
2066
|
+
var A, _, G;
|
|
2067
|
+
const y = await x(N, !0, q.signal);
|
|
2068
|
+
if (y.status === "accepted") {
|
|
2069
|
+
g(y.artifact);
|
|
2070
|
+
const fe = new Set(((A = y.frameResolution) == null ? void 0 : A.exact) ?? []);
|
|
2071
|
+
if (N.every((le) => fe.has(le.id)))
|
|
2055
2072
|
return { status: "accepted" };
|
|
2056
2073
|
const ce = [
|
|
2057
|
-
...((
|
|
2058
|
-
...((G =
|
|
2074
|
+
...((_ = y.frameResolution) == null ? void 0 : _.missing) ?? [],
|
|
2075
|
+
...((G = y.frameResolution) == null ? void 0 : G.stale) ?? []
|
|
2059
2076
|
];
|
|
2060
2077
|
return {
|
|
2061
2078
|
status: "unavailable",
|
|
2062
2079
|
message: ce.length ? `The exact preview endpoint did not return a current capture for ${ce.join(", ")}.` : "The exact preview endpoint returned no current capture."
|
|
2063
2080
|
};
|
|
2064
2081
|
}
|
|
2065
|
-
return
|
|
2082
|
+
return y.status === "rejected" ? {
|
|
2066
2083
|
status: "rejected",
|
|
2067
|
-
message:
|
|
2084
|
+
message: y.errors.join(" ") || "The preview artifact was rejected."
|
|
2068
2085
|
} : {
|
|
2069
2086
|
status: "unavailable",
|
|
2070
|
-
message:
|
|
2071
|
-
|
|
2087
|
+
message: k(
|
|
2088
|
+
y.error,
|
|
2072
2089
|
"The exact preview endpoint is unavailable."
|
|
2073
2090
|
)
|
|
2074
2091
|
};
|
|
2075
|
-
}),
|
|
2076
|
-
const
|
|
2077
|
-
const
|
|
2078
|
-
|
|
2079
|
-
|
|
2092
|
+
}), j.current.length) {
|
|
2093
|
+
const N = j.current.filter((y) => {
|
|
2094
|
+
const A = ve(
|
|
2095
|
+
y.id,
|
|
2096
|
+
y.fingerprint
|
|
2080
2097
|
).status;
|
|
2081
|
-
return
|
|
2098
|
+
return A !== "exact" && A !== "generating";
|
|
2082
2099
|
});
|
|
2083
|
-
de(
|
|
2084
|
-
|
|
2100
|
+
de(N, { status: "checking" }), x(
|
|
2101
|
+
j.current,
|
|
2085
2102
|
!1,
|
|
2086
2103
|
i.signal
|
|
2087
|
-
).then((
|
|
2104
|
+
).then((y) => {
|
|
2088
2105
|
var G, fe, ce;
|
|
2089
2106
|
if (i.signal.aborted) return;
|
|
2090
|
-
const
|
|
2091
|
-
const Ae =
|
|
2107
|
+
const A = (le) => le.filter((Re) => {
|
|
2108
|
+
const Ae = ve(
|
|
2092
2109
|
Re.id,
|
|
2093
2110
|
Re.fingerprint
|
|
2094
2111
|
).status;
|
|
2095
2112
|
return Ae !== "generating" && Ae !== "exact";
|
|
2096
2113
|
});
|
|
2097
|
-
if (
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
((G =
|
|
2114
|
+
if (y.status === "accepted") {
|
|
2115
|
+
g(y.artifact), de(
|
|
2116
|
+
R(
|
|
2117
|
+
j.current,
|
|
2118
|
+
((G = y.frameResolution) == null ? void 0 : G.exact) ?? []
|
|
2102
2119
|
),
|
|
2103
2120
|
{ status: "exact" }
|
|
2104
2121
|
);
|
|
2105
|
-
const le =
|
|
2106
|
-
...((fe =
|
|
2107
|
-
...((ce =
|
|
2122
|
+
const le = R(j.current, [
|
|
2123
|
+
...((fe = y.frameResolution) == null ? void 0 : fe.missing) ?? [],
|
|
2124
|
+
...((ce = y.frameResolution) == null ? void 0 : ce.stale) ?? []
|
|
2108
2125
|
]);
|
|
2109
|
-
de(
|
|
2126
|
+
de(A(le), {
|
|
2110
2127
|
status: "outdated",
|
|
2111
2128
|
message: "Select this frame to generate the exact preview."
|
|
2112
2129
|
});
|
|
2113
2130
|
return;
|
|
2114
2131
|
}
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2132
|
+
const _ = y.status === "rejected" ? y.errors.join(" ") || "The preview artifact was rejected." : k(
|
|
2133
|
+
y.error,
|
|
2117
2134
|
"The exact preview endpoint is unavailable."
|
|
2118
2135
|
);
|
|
2119
2136
|
de(
|
|
2120
|
-
|
|
2137
|
+
A(j.current),
|
|
2121
2138
|
{
|
|
2122
2139
|
status: "error",
|
|
2123
|
-
reason:
|
|
2124
|
-
message:
|
|
2140
|
+
reason: y.status === "rejected" ? "rejected" : "unavailable",
|
|
2141
|
+
message: _
|
|
2125
2142
|
}
|
|
2126
2143
|
);
|
|
2127
|
-
}).catch((
|
|
2144
|
+
}).catch((y) => {
|
|
2128
2145
|
if (i.signal.aborted) return;
|
|
2129
|
-
const
|
|
2130
|
-
const G =
|
|
2131
|
-
|
|
2132
|
-
|
|
2146
|
+
const A = j.current.filter((_) => {
|
|
2147
|
+
const G = ve(
|
|
2148
|
+
_.id,
|
|
2149
|
+
_.fingerprint
|
|
2133
2150
|
).status;
|
|
2134
2151
|
return G !== "generating" && G !== "exact";
|
|
2135
2152
|
});
|
|
2136
|
-
de(
|
|
2153
|
+
de(A, {
|
|
2137
2154
|
status: "error",
|
|
2138
2155
|
reason: "unavailable",
|
|
2139
|
-
message:
|
|
2140
|
-
|
|
2156
|
+
message: k(
|
|
2157
|
+
y,
|
|
2141
2158
|
"The exact preview endpoint is unavailable."
|
|
2142
2159
|
)
|
|
2143
2160
|
});
|
|
2144
2161
|
});
|
|
2145
2162
|
}
|
|
2146
2163
|
return () => {
|
|
2147
|
-
|
|
2164
|
+
$e(null), q.abort(), i.abort();
|
|
2148
2165
|
};
|
|
2149
2166
|
}, [
|
|
2167
|
+
P,
|
|
2168
|
+
p,
|
|
2150
2169
|
h,
|
|
2151
|
-
m,
|
|
2152
|
-
g,
|
|
2153
2170
|
u,
|
|
2154
|
-
|
|
2155
|
-
]),
|
|
2171
|
+
F
|
|
2172
|
+
]), ae(() => {
|
|
2156
2173
|
let i = !0;
|
|
2157
|
-
if (!
|
|
2158
|
-
return ue(void 0),
|
|
2174
|
+
if (!S)
|
|
2175
|
+
return ue(void 0), z(!0), () => {
|
|
2159
2176
|
i = !1;
|
|
2160
2177
|
};
|
|
2161
|
-
const
|
|
2162
|
-
return
|
|
2163
|
-
endpoint:
|
|
2164
|
-
signal:
|
|
2165
|
-
pages:
|
|
2178
|
+
const c = new AbortController();
|
|
2179
|
+
return z(!1), ue(void 0), ne(null), Je({
|
|
2180
|
+
endpoint: C,
|
|
2181
|
+
signal: c.signal,
|
|
2182
|
+
pages: V.pages.map((l) => ({
|
|
2166
2183
|
...l,
|
|
2167
2184
|
id: l.importPageId ?? l.id,
|
|
2168
2185
|
importKind: l.importKind
|
|
2169
2186
|
})),
|
|
2170
|
-
assets: (
|
|
2187
|
+
assets: (a == null ? void 0 : a.getAssets("screens")) ?? []
|
|
2171
2188
|
}).then((l) => {
|
|
2172
|
-
i && (ue(l.baselineEnvironment),
|
|
2189
|
+
i && (ue(l.baselineEnvironment), Oe(l.manifest.routes ?? null), ne(l.graph));
|
|
2173
2190
|
}).catch(() => {
|
|
2174
|
-
i && (ue(void 0),
|
|
2191
|
+
i && (ue(void 0), Oe(null), ne(null));
|
|
2175
2192
|
}).finally(() => {
|
|
2176
|
-
i &&
|
|
2193
|
+
i && z(!0);
|
|
2177
2194
|
}), () => {
|
|
2178
|
-
i = !1,
|
|
2195
|
+
i = !1, c.abort(), ue(void 0), ne(null);
|
|
2179
2196
|
};
|
|
2180
2197
|
}, [
|
|
2181
|
-
|
|
2198
|
+
a,
|
|
2182
2199
|
o,
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
]),
|
|
2186
|
-
|
|
2187
|
-
}, [
|
|
2200
|
+
S,
|
|
2201
|
+
C
|
|
2202
|
+
]), ae(() => {
|
|
2203
|
+
m == null || m === V.previewOpen || (m ? V.openPreview({ notifyHost: !1 }) : V.closePreview({ notifyHost: !1 }));
|
|
2204
|
+
}, [m]), F ? /* @__PURE__ */ v(bt, {}) : /* @__PURE__ */ v(
|
|
2188
2205
|
"div",
|
|
2189
2206
|
{
|
|
2190
2207
|
"data-pygmalion-storyboard-loading": "",
|
|
@@ -2206,17 +2223,17 @@ export {
|
|
|
2206
2223
|
Rn as DEFAULT_DESIGN_COMPILE_LIMITS,
|
|
2207
2224
|
An as DESIGN_IMPORT_KINDS,
|
|
2208
2225
|
Mn as DESIGN_IR_SCHEMA,
|
|
2209
|
-
|
|
2210
|
-
|
|
2226
|
+
$n as DESIGN_IR_VERSION,
|
|
2227
|
+
mn as PygmalionCatalogDocument,
|
|
2211
2228
|
hn as PygmalionCatalogMatrix,
|
|
2212
2229
|
gn as PygmalionCatalogSection,
|
|
2213
2230
|
En as PygmalionEditor,
|
|
2214
2231
|
wt as STORYBOARD_ENVIRONMENT_CONTROL,
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2232
|
+
On as STORYBOARD_ENVIRONMENT_QUERY,
|
|
2233
|
+
vn as SourceRefControl,
|
|
2234
|
+
Sn as __debug,
|
|
2218
2235
|
Dn as applyTokenOverride,
|
|
2219
|
-
|
|
2236
|
+
St as bootstrapPreviewArtifact,
|
|
2220
2237
|
kn as clearPreviewEnvironmentControlValues,
|
|
2221
2238
|
Fn as clearPygmalionPreviewCache,
|
|
2222
2239
|
Tn as compileDesignDocument,
|
|
@@ -2232,15 +2249,15 @@ export {
|
|
|
2232
2249
|
Hn as createPreviewRecipeFingerprint,
|
|
2233
2250
|
qn as createStoryboardCaptureRecipeIdentity,
|
|
2234
2251
|
Mt as createStoryboardGraph,
|
|
2235
|
-
|
|
2252
|
+
Lt as createStoryboardGraphFromDiscovery,
|
|
2236
2253
|
Gn as createStoryboardGraphViewModel,
|
|
2237
2254
|
Kn as createStoryboardRouteUrl,
|
|
2238
|
-
|
|
2255
|
+
Jt as designCatalogKey,
|
|
2239
2256
|
Qe as designCatalogRegistryName,
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2257
|
+
Ln as enumerateDesignComponentConnectionCases,
|
|
2258
|
+
Wn as expandDesignScreenCasesViewports,
|
|
2259
|
+
Vn as expandDesignScreenCollectionViewports,
|
|
2260
|
+
Jn as getDesignCodegenAdapters,
|
|
2244
2261
|
Qn as getDesignComponentConnection,
|
|
2245
2262
|
Xn as getDesignComponentConnectionForComponent,
|
|
2246
2263
|
Yn as getDesignComponentConnections,
|
|
@@ -2248,14 +2265,14 @@ export {
|
|
|
2248
2265
|
er as getPreviewEnvironmentControls,
|
|
2249
2266
|
tr as getPreviewEnvironmentOverride,
|
|
2250
2267
|
nr as getRecommendedPygmalionPreviewConcurrency,
|
|
2251
|
-
|
|
2252
|
-
|
|
2268
|
+
be as getStoryboardBaselineEnvironment,
|
|
2269
|
+
Ve as getStoryboardDiscoveryBaselineEnvironment,
|
|
2253
2270
|
rr as getStoryboardGraph,
|
|
2254
2271
|
or as getViewportPresets,
|
|
2255
|
-
|
|
2272
|
+
Je as loadStoryboardDiscovery,
|
|
2256
2273
|
sr as mergeScreenPresets,
|
|
2257
2274
|
Ze as mergeStoryboardEnvironment,
|
|
2258
|
-
|
|
2275
|
+
pn as publishStoryboardDiscovery,
|
|
2259
2276
|
In as pygmalionNavigate,
|
|
2260
2277
|
xn as pygmalionOpenPreview,
|
|
2261
2278
|
Pn as pygmalionResetCurrentEdits,
|
|
@@ -2268,19 +2285,19 @@ export {
|
|
|
2268
2285
|
rt as setComponentRegistry,
|
|
2269
2286
|
ot as setDesignComponentConnections,
|
|
2270
2287
|
ur as setPreviewEnvironmentControlValue,
|
|
2271
|
-
|
|
2288
|
+
mt as setPreviewEnvironmentControls,
|
|
2272
2289
|
ft as setPygmalionAppOrigin,
|
|
2273
2290
|
lt as setPygmalionPreviewConcurrency,
|
|
2274
|
-
|
|
2291
|
+
pt as setPygmalionPreviewRevision,
|
|
2275
2292
|
ue as setStoryboardBaselineEnvironment,
|
|
2276
2293
|
ne as setStoryboardGraph,
|
|
2277
2294
|
st as setTokens,
|
|
2278
2295
|
it as setViewportPresets,
|
|
2279
2296
|
Nt as storyboardScreenRecipeKey,
|
|
2280
2297
|
fr as subscribePreviewEnvironmentControls,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2298
|
+
pr as subscribeStoryboardGraph,
|
|
2299
|
+
bn as usePygmalionProject,
|
|
2300
|
+
mr as validateDesignComponentConnections,
|
|
2284
2301
|
gr as validatePreviewArtifactBundle,
|
|
2285
2302
|
hr as validateRoutePreviewArtifactV3Browser
|
|
2286
2303
|
};
|