@pygmalionjs/pygmalion 0.5.16 → 0.5.17
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/pygmalion.js
CHANGED
|
@@ -2,7 +2,7 @@ var Kf = Object.defineProperty;
|
|
|
2
2
|
var Uf = (e, t, n) => t in e ? Kf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var cn = (e, t, n) => Uf(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as s, jsxs as g, Fragment as Ue } from "react/jsx-runtime";
|
|
5
|
-
import { R as ti, u as qf, c as fa, b as Kc, g as Ze, d as Yf, m as Lt, e as f, f as Xt, r as fn, h as ys, i as
|
|
5
|
+
import { R as ti, u as qf, c as fa, b as Kc, g as Ze, d as Yf, m as Lt, e as f, f as Xt, r as fn, h as ys, i as Xn, j as ha, k as bn, l as Uc, n as mr, p as Gf, o as Kn, q as We, t as Xf, v as Jf, w as Qf, x as Zf, y as eh, z as th, A as nh, B as vs, C as rh, D as oh, E as ih, G as sh, H as ah, I as lh, S as ch, J as dh, K as uh, L as fh, M as hh, O as ph, P as mh, Q as gh, T as bh, U as qc, V as xh, W as wl, X as yh, Y as Yc, Z as vh, _ as wh, $ as Sh, a0 as Nh, a1 as Ih, a2 as Ch, a3 as Gc, a4 as $h, a5 as Ph, a6 as X, a7 as Sl, a8 as Nl, a9 as Mh, aa as Qi, ab as Eh, ac as Vo, ad as ws, ae as kh, af as Xc, ag as Ah, ah as Rh, ai as Th, aj as Fh, s as Lh, ak as Jc, al as Qc, am as Ss, an as Zc, ao as Dh, ap as zh, aq as Il, ar as _h, as as Oh, at as Cl, au as Bh, av as jh, aw as Wh, ax as Hh, ay as Vh, az as Kh, aA as Uh, aB as qh, aC as Yh, aD as Gh, aE as Xh, aF as Jh, a as Qh, aG as Zh, aH as ep, aI as tp, aJ as np, aK as rp, aL as op, aM as ip, aN as sp, aO as ap, aP as lp, aQ as cp, aR as dp, aS as Lr, aT as $l, aU as up, aV as fp, aW as hp, aX as pp, aY as Pl } from "./FrozenRoutePreview-CZOpvN6z.js";
|
|
6
6
|
import { aZ as m0, a_ as g0, a$ as b0, b0 as x0, b1 as y0, b2 as v0, b3 as w0, b4 as S0, b5 as N0, b6 as I0, b7 as C0, b8 as $0, b9 as P0, ba as M0, bb as E0 } from "./FrozenRoutePreview-CZOpvN6z.js";
|
|
7
7
|
import { useRef as Ie, useLayoutEffect as ni, useSyncExternalStore as Qe, useCallback as wt, useReducer as ed, useEffect as se, memo as td, createElement as to, useState as Y, useMemo as Ft } from "react";
|
|
8
8
|
import { createPortal as mp } from "react-dom";
|
|
@@ -277,7 +277,7 @@ const Ap = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
277
277
|
function $i(e) {
|
|
278
278
|
return new TextEncoder().encode(e).byteLength;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function _n(e) {
|
|
281
281
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
282
282
|
const t = Object.getPrototypeOf(e);
|
|
283
283
|
return t === Object.prototype || t === null;
|
|
@@ -308,7 +308,7 @@ function Lp(e) {
|
|
|
308
308
|
) ? "snapshot contains an active URL" : Fp(e) ? "snapshot contains an active style expression" : null;
|
|
309
309
|
}
|
|
310
310
|
function Al(e, t, n) {
|
|
311
|
-
if (!
|
|
311
|
+
if (!_n(e))
|
|
312
312
|
return n.push(`${t} assets must be a record.`), /* @__PURE__ */ new Set();
|
|
313
313
|
const r = /* @__PURE__ */ new Set(), o = t === "head" ? un.headAssetBytes : un.stylesheetAssetBytes;
|
|
314
314
|
for (const [i, a] of Object.entries(e)) {
|
|
@@ -328,21 +328,21 @@ function dd(e, t) {
|
|
|
328
328
|
}
|
|
329
329
|
function Pi(e) {
|
|
330
330
|
const t = [], n = Tp(e);
|
|
331
|
-
if (!
|
|
331
|
+
if (!_n(e) || e.version !== 2)
|
|
332
332
|
return {
|
|
333
333
|
valid: !1,
|
|
334
334
|
errors: ["Route preview artifact must be a version 2 record."],
|
|
335
335
|
bytes: n
|
|
336
336
|
};
|
|
337
337
|
Zi(e.namespace) || t.push("Artifact namespace is invalid."), e.sourceRevision != null && !Zi(e.sourceRevision) && t.push("Artifact source revision is invalid."), n > un.bundleBytes && t.push("Artifact exceeds the bundle byte limit.");
|
|
338
|
-
const r =
|
|
338
|
+
const r = _n(e.assets) ? e.assets : null;
|
|
339
339
|
r || t.push("Artifact assets must be a record.");
|
|
340
340
|
const o = Al(r == null ? void 0 : r.head, "head", t), i = Al(
|
|
341
341
|
r == null ? void 0 : r.stylesheets,
|
|
342
342
|
"stylesheet",
|
|
343
343
|
t
|
|
344
344
|
);
|
|
345
|
-
if (o.size + i.size > un.assetCount && t.push("Artifact has too many shared assets."), !
|
|
345
|
+
if (o.size + i.size > un.assetCount && t.push("Artifact has too many shared assets."), !_n(e.frames))
|
|
346
346
|
return t.push("Artifact frames must be a record."), { valid: !1, errors: t, bytes: n };
|
|
347
347
|
const a = Object.entries(e.frames);
|
|
348
348
|
a.length > un.frameCount && t.push("Artifact has too many frames.");
|
|
@@ -352,7 +352,7 @@ function Pi(e) {
|
|
|
352
352
|
t.push(`Frame identifier "${d}" is invalid.`);
|
|
353
353
|
continue;
|
|
354
354
|
}
|
|
355
|
-
if (!
|
|
355
|
+
if (!_n(u) || !_n(u.document)) {
|
|
356
356
|
t.push(`Frame "${d}" is invalid.`);
|
|
357
357
|
continue;
|
|
358
358
|
}
|
|
@@ -377,7 +377,7 @@ function Pi(e) {
|
|
|
377
377
|
}
|
|
378
378
|
let m = !0;
|
|
379
379
|
for (const w of u.head) {
|
|
380
|
-
if (!
|
|
380
|
+
if (!_n(w) || !["head", "stylesheet"].includes(String(w.kind)) || typeof w.hash != "string" || !cd.test(w.hash)) {
|
|
381
381
|
t.push(`Frame "${d}" contains an invalid head reference.`), m = !1;
|
|
382
382
|
continue;
|
|
383
383
|
}
|
|
@@ -622,7 +622,7 @@ function ba(e = {}) {
|
|
|
622
622
|
);
|
|
623
623
|
}
|
|
624
624
|
let vd = ba(), Kr = 0, Fl = 0, Uo = 0, ns = !1;
|
|
625
|
-
const Ot = [], mt = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new Map(), br = /* @__PURE__ */ new Set(), Ht = /* @__PURE__ */ new Map(), xr = /* @__PURE__ */ new Map(), bt = /* @__PURE__ */ new Map(), wd = /* @__PURE__ */ new Map(), xa = /* @__PURE__ */ new Map(), Ll = /* @__PURE__ */ new WeakMap(),
|
|
625
|
+
const Ot = [], mt = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new Map(), br = /* @__PURE__ */ new Set(), Ht = /* @__PURE__ */ new Map(), xr = /* @__PURE__ */ new Map(), bt = /* @__PURE__ */ new Map(), wd = /* @__PURE__ */ new Map(), xa = /* @__PURE__ */ new Map(), Ll = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new Map(), ko = /* @__PURE__ */ new Map();
|
|
626
626
|
let Ao = 0, nm = 0, rs = !1;
|
|
627
627
|
const qo = [], oi = /* @__PURE__ */ new Map();
|
|
628
628
|
let Vt = 0, rn = 0, dr = bd, Is, Ur = null;
|
|
@@ -743,12 +743,12 @@ function Md(e) {
|
|
|
743
743
|
function Ls() {
|
|
744
744
|
return Kr;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Jn(e) {
|
|
747
747
|
return mt.has(e) || bt.has(e) || Kt.has(e);
|
|
748
748
|
}
|
|
749
749
|
function Ei(e) {
|
|
750
750
|
var t;
|
|
751
|
-
return
|
|
751
|
+
return Jn(e) && ((t = Ht.get(e)) == null ? void 0 : t.stale) !== !0;
|
|
752
752
|
}
|
|
753
753
|
function $a(e) {
|
|
754
754
|
return Ht.get(e) ?? null;
|
|
@@ -830,9 +830,9 @@ function Os(e, t = /* @__PURE__ */ new Set()) {
|
|
|
830
830
|
}
|
|
831
831
|
let Pa = null, kd = !1;
|
|
832
832
|
const hn = /* @__PURE__ */ new Map();
|
|
833
|
-
let
|
|
833
|
+
let Un = 0;
|
|
834
834
|
function Bs(e) {
|
|
835
|
-
|
|
835
|
+
Un += 1, Pa = e, hn.clear(), !e && xr.size > 0 && (xr.clear(), nn());
|
|
836
836
|
}
|
|
837
837
|
function Ad(e) {
|
|
838
838
|
kd = e;
|
|
@@ -866,7 +866,7 @@ function js(e, t, n = {}) {
|
|
|
866
866
|
if (c.status === "exact" || c.status === "error" && !n.retry)
|
|
867
867
|
return Promise.resolve(c);
|
|
868
868
|
yt([i], { status: "generating" });
|
|
869
|
-
const d =
|
|
869
|
+
const d = Un;
|
|
870
870
|
let u;
|
|
871
871
|
try {
|
|
872
872
|
u = o([i]);
|
|
@@ -875,7 +875,7 @@ function js(e, t, n = {}) {
|
|
|
875
875
|
}
|
|
876
876
|
const p = Promise.resolve(u).then(
|
|
877
877
|
(m) => {
|
|
878
|
-
if (d !==
|
|
878
|
+
if (d !== Un)
|
|
879
879
|
return mn(r, t);
|
|
880
880
|
const b = (m == null ? void 0 : m.status) === "accepted" ? { status: "exact" } : (m == null ? void 0 : m.status) === "rejected" ? {
|
|
881
881
|
status: "error",
|
|
@@ -889,14 +889,14 @@ function js(e, t, n = {}) {
|
|
|
889
889
|
return yt([i], b), b;
|
|
890
890
|
},
|
|
891
891
|
(m) => {
|
|
892
|
-
if (d !==
|
|
892
|
+
if (d !== Un)
|
|
893
893
|
return mn(r, t);
|
|
894
|
-
const
|
|
894
|
+
const x = {
|
|
895
895
|
status: "error",
|
|
896
|
-
reason: "unavailable",
|
|
896
|
+
reason: (m == null ? void 0 : m.pygmalionNotPrepared) === !0 ? "not-prepared" : "unavailable",
|
|
897
897
|
message: m instanceof Error && m.message ? m.message : "The exact preview request failed."
|
|
898
898
|
};
|
|
899
|
-
return yt([i],
|
|
899
|
+
return yt([i], x), x;
|
|
900
900
|
}
|
|
901
901
|
);
|
|
902
902
|
return hn.set(a, p), p.finally(() => {
|
|
@@ -923,7 +923,7 @@ function Fd(e, t = {}) {
|
|
|
923
923
|
}
|
|
924
924
|
if (r.length === 0) return null;
|
|
925
925
|
yt(r, { status: "generating" });
|
|
926
|
-
const a =
|
|
926
|
+
const a = Un;
|
|
927
927
|
let l;
|
|
928
928
|
try {
|
|
929
929
|
l = n(r);
|
|
@@ -932,7 +932,7 @@ function Fd(e, t = {}) {
|
|
|
932
932
|
}
|
|
933
933
|
const c = Promise.resolve(l).then(
|
|
934
934
|
(d) => {
|
|
935
|
-
if (a !==
|
|
935
|
+
if (a !== Un)
|
|
936
936
|
return { status: "idle" };
|
|
937
937
|
const u = (d == null ? void 0 : d.status) === "accepted" ? { status: "exact" } : (d == null ? void 0 : d.status) === "rejected" ? {
|
|
938
938
|
status: "error",
|
|
@@ -946,7 +946,7 @@ function Fd(e, t = {}) {
|
|
|
946
946
|
return yt(r, u), u;
|
|
947
947
|
},
|
|
948
948
|
(d) => {
|
|
949
|
-
if (a !==
|
|
949
|
+
if (a !== Un)
|
|
950
950
|
return { status: "idle" };
|
|
951
951
|
const u = {
|
|
952
952
|
status: "error",
|
|
@@ -1192,7 +1192,7 @@ function um(e) {
|
|
|
1192
1192
|
stylesheetLinksHtml: r.join("")
|
|
1193
1193
|
}, e.shadow;
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function jn(e) {
|
|
1196
1196
|
const t = Kt.get(e);
|
|
1197
1197
|
if (t) return um(t);
|
|
1198
1198
|
const n = bt.get(e);
|
|
@@ -1294,7 +1294,7 @@ function Ws(e, t) {
|
|
|
1294
1294
|
nn({ key: v }), pn(v), d(x, A), u += 1;
|
|
1295
1295
|
continue;
|
|
1296
1296
|
}
|
|
1297
|
-
if (
|
|
1297
|
+
if (Jn(v) && ((b = Ht.get(v)) == null ? void 0 : b.stale) !== !0) {
|
|
1298
1298
|
d(x, !1);
|
|
1299
1299
|
continue;
|
|
1300
1300
|
}
|
|
@@ -1363,7 +1363,7 @@ function is(e) {
|
|
|
1363
1363
|
e.onsuccess = () => t(e.result), e.onerror = () => n(e.error ?? new Error("IndexedDB request failed"));
|
|
1364
1364
|
});
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function Fn(e) {
|
|
1367
1367
|
return new Promise((t, n) => {
|
|
1368
1368
|
e.oncomplete = () => t(), e.onabort = () => n(e.error ?? new Error("IndexedDB transaction aborted")), e.onerror = () => n(e.error ?? new Error("IndexedDB transaction failed"));
|
|
1369
1369
|
});
|
|
@@ -1401,20 +1401,20 @@ class hm {
|
|
|
1401
1401
|
this.database = t;
|
|
1402
1402
|
}
|
|
1403
1403
|
async read(t) {
|
|
1404
|
-
const n = this.database.transaction(pt, "readonly"), r =
|
|
1404
|
+
const n = this.database.transaction(pt, "readonly"), r = Fn(n), o = await is(
|
|
1405
1405
|
n.objectStore(pt).get(t)
|
|
1406
1406
|
);
|
|
1407
1407
|
return await r, o;
|
|
1408
1408
|
}
|
|
1409
1409
|
async readMany(t) {
|
|
1410
|
-
const n = this.database.transaction(pt, "readonly"), r =
|
|
1410
|
+
const n = this.database.transaction(pt, "readonly"), r = Fn(n), o = n.objectStore(pt), i = t.map((l) => is(o.get(l))), a = await Promise.all(i);
|
|
1411
1411
|
return await r, new Map(t.map((l, c) => [l, a[c]]));
|
|
1412
1412
|
}
|
|
1413
1413
|
async write(t) {
|
|
1414
1414
|
const n = this.database.transaction(
|
|
1415
1415
|
pt,
|
|
1416
1416
|
"readwrite"
|
|
1417
|
-
), r =
|
|
1417
|
+
), r = Fn(n);
|
|
1418
1418
|
n.objectStore(pt).put(t), await r, this.schedulePrune();
|
|
1419
1419
|
}
|
|
1420
1420
|
schedulePrune() {
|
|
@@ -1433,7 +1433,7 @@ class hm {
|
|
|
1433
1433
|
const t = this.database.transaction(
|
|
1434
1434
|
pt,
|
|
1435
1435
|
"readonly"
|
|
1436
|
-
), n =
|
|
1436
|
+
), n = Fn(t), r = await is(
|
|
1437
1437
|
t.objectStore(pt).getAll()
|
|
1438
1438
|
);
|
|
1439
1439
|
await n;
|
|
@@ -1442,15 +1442,15 @@ class hm {
|
|
|
1442
1442
|
const i = this.database.transaction(
|
|
1443
1443
|
pt,
|
|
1444
1444
|
"readwrite"
|
|
1445
|
-
), a =
|
|
1445
|
+
), a = Fn(i), l = i.objectStore(pt);
|
|
1446
1446
|
o.forEach((c) => l.delete(c)), await a;
|
|
1447
1447
|
}
|
|
1448
1448
|
async remove(t) {
|
|
1449
|
-
const n = this.database.transaction(pt, "readwrite"), r =
|
|
1449
|
+
const n = this.database.transaction(pt, "readwrite"), r = Fn(n);
|
|
1450
1450
|
n.objectStore(pt).delete(t), await r;
|
|
1451
1451
|
}
|
|
1452
1452
|
async clear(t) {
|
|
1453
|
-
const n = this.database.transaction(pt, "readwrite"), r =
|
|
1453
|
+
const n = this.database.transaction(pt, "readwrite"), r = Fn(n), o = n.objectStore(pt);
|
|
1454
1454
|
if (!t)
|
|
1455
1455
|
o.clear();
|
|
1456
1456
|
else {
|
|
@@ -1801,7 +1801,7 @@ function xm(e) {
|
|
|
1801
1801
|
}
|
|
1802
1802
|
function Fa(e, t, n) {
|
|
1803
1803
|
if (!e) throw new Error("A route preview task key is required.");
|
|
1804
|
-
const r =
|
|
1804
|
+
const r = On.get(e);
|
|
1805
1805
|
if (r)
|
|
1806
1806
|
return r.ticket.updatePriority(t), r.promise;
|
|
1807
1807
|
const o = Od(t), i = (async () => {
|
|
@@ -1812,14 +1812,14 @@ function Fa(e, t, n) {
|
|
|
1812
1812
|
a();
|
|
1813
1813
|
}
|
|
1814
1814
|
})();
|
|
1815
|
-
return
|
|
1815
|
+
return On.set(e, { promise: i, ticket: o }), i.then(
|
|
1816
1816
|
() => {
|
|
1817
1817
|
var a;
|
|
1818
|
-
((a =
|
|
1818
|
+
((a = On.get(e)) == null ? void 0 : a.promise) === i && On.delete(e);
|
|
1819
1819
|
},
|
|
1820
1820
|
() => {
|
|
1821
1821
|
var a;
|
|
1822
|
-
((a =
|
|
1822
|
+
((a = On.get(e)) == null ? void 0 : a.promise) === i && On.delete(e);
|
|
1823
1823
|
}
|
|
1824
1824
|
), i;
|
|
1825
1825
|
}
|
|
@@ -1829,7 +1829,7 @@ function ui(e, t, n, r = e) {
|
|
|
1829
1829
|
const i = ko.get(r);
|
|
1830
1830
|
if (i) {
|
|
1831
1831
|
i.priority = Math.min(i.priority, t);
|
|
1832
|
-
const d =
|
|
1832
|
+
const d = On.get(i.taskKey);
|
|
1833
1833
|
return d == null || d.ticket.updatePriority(t), i.promise;
|
|
1834
1834
|
}
|
|
1835
1835
|
const a = rn, l = `snapshot:${a}:${r}`, c = {
|
|
@@ -1968,12 +1968,12 @@ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1968
1968
|
getRoutePreviewArtifactResolution: mn,
|
|
1969
1969
|
getRoutePreviewArtifactRevision: Ds,
|
|
1970
1970
|
getRoutePreviewCacheNamespace: ka,
|
|
1971
|
-
getRoutePreviewShadowArtifact:
|
|
1971
|
+
getRoutePreviewShadowArtifact: jn,
|
|
1972
1972
|
getRoutePreviewSnapshot: Jt,
|
|
1973
1973
|
getRoutePreviewSnapshotKeyVersion: Fs,
|
|
1974
1974
|
getRoutePreviewSnapshotRevision: Rs,
|
|
1975
1975
|
hasExactRoutePreviewSnapshot: Ei,
|
|
1976
|
-
hasRoutePreviewSnapshot:
|
|
1976
|
+
hasRoutePreviewSnapshot: Jn,
|
|
1977
1977
|
hydrateRoutePreviewSnapshot: Wd,
|
|
1978
1978
|
isRoutePreviewSnapshotHydrated: _s,
|
|
1979
1979
|
prehydrateRoutePreviewSnapshots: Ta,
|
|
@@ -2007,7 +2007,7 @@ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2007
2007
|
waitForRoutePreviewSettle: Cm
|
|
2008
2008
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2009
2009
|
let co = [], zl = "[]";
|
|
2010
|
-
const
|
|
2010
|
+
const Qn = /* @__PURE__ */ new Map(), Ks = /* @__PURE__ */ new Set();
|
|
2011
2011
|
let Hd = 0;
|
|
2012
2012
|
function $m(e) {
|
|
2013
2013
|
return e ? JSON.parse(JSON.stringify(e)) : void 0;
|
|
@@ -2060,7 +2060,7 @@ function Da() {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
function Mm(e) {
|
|
2062
2062
|
const t = Pm(e), n = JSON.stringify(t);
|
|
2063
|
-
n !== zl && (co = t, zl = n,
|
|
2063
|
+
n !== zl && (co = t, zl = n, Qn.clear(), Da());
|
|
2064
2064
|
}
|
|
2065
2065
|
function Em() {
|
|
2066
2066
|
return co;
|
|
@@ -2068,7 +2068,7 @@ function Em() {
|
|
|
2068
2068
|
function km(e) {
|
|
2069
2069
|
const t = co.find((n) => n.id === e);
|
|
2070
2070
|
if (t)
|
|
2071
|
-
return
|
|
2071
|
+
return Qn.get(t.id) ?? t.defaultValue;
|
|
2072
2072
|
}
|
|
2073
2073
|
function Am(e, t) {
|
|
2074
2074
|
const n = co.find((r) => r.id === e);
|
|
@@ -2077,15 +2077,15 @@ function Am(e, t) {
|
|
|
2077
2077
|
throw new Error(
|
|
2078
2078
|
`Preview environment control "${e}" has no option "${t}".`
|
|
2079
2079
|
);
|
|
2080
|
-
|
|
2080
|
+
Qn.get(e) !== t && (Qn.set(e, t), Da());
|
|
2081
2081
|
}
|
|
2082
2082
|
function Vw() {
|
|
2083
|
-
|
|
2083
|
+
Qn.size && (Qn.clear(), Da());
|
|
2084
2084
|
}
|
|
2085
2085
|
function Rm() {
|
|
2086
2086
|
let e;
|
|
2087
2087
|
for (const t of co) {
|
|
2088
|
-
const n =
|
|
2088
|
+
const n = Qn.get(t.id);
|
|
2089
2089
|
if (n == null) continue;
|
|
2090
2090
|
const r = t.options.find((o) => o.value === n);
|
|
2091
2091
|
e = Lt(e, r == null ? void 0 : r.environment);
|
|
@@ -2191,7 +2191,7 @@ function zm(e, t) {
|
|
|
2191
2191
|
}, fi.set(e, i));
|
|
2192
2192
|
const a = Jt(i.key);
|
|
2193
2193
|
if (a != null) return a.length * 2;
|
|
2194
|
-
const l =
|
|
2194
|
+
const l = jn(i.key);
|
|
2195
2195
|
return l ? l.bodyHtml.length * 2 : 0;
|
|
2196
2196
|
}
|
|
2197
2197
|
function _m(e, t) {
|
|
@@ -2213,7 +2213,7 @@ function Om() {
|
|
|
2213
2213
|
});
|
|
2214
2214
|
}
|
|
2215
2215
|
function qd() {
|
|
2216
|
-
const e =
|
|
2216
|
+
const e = Xn(), t = f.selectedCanvasObject;
|
|
2217
2217
|
return f.pages.filter(
|
|
2218
2218
|
(n) => (n.canvas ?? "default") === f.activeCanvas && f.isScreenStateShown(n)
|
|
2219
2219
|
).map((n) => ({
|
|
@@ -2428,8 +2428,8 @@ function qm() {
|
|
|
2428
2428
|
function Ym() {
|
|
2429
2429
|
const e = Qe(ha, bn, bn), t = Qe(
|
|
2430
2430
|
Uc,
|
|
2431
|
-
|
|
2432
|
-
|
|
2431
|
+
Xn,
|
|
2432
|
+
Xn
|
|
2433
2433
|
), n = Qe(
|
|
2434
2434
|
za,
|
|
2435
2435
|
wr,
|
|
@@ -2527,7 +2527,7 @@ function Jd() {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
const Zm = 2, eg = 18e4;
|
|
2529
2529
|
let tg = eg;
|
|
2530
|
-
const Wt = [],
|
|
2530
|
+
const Wt = [], qn = {
|
|
2531
2531
|
boots: 0,
|
|
2532
2532
|
reuses: 0,
|
|
2533
2533
|
parks: 0,
|
|
@@ -2548,7 +2548,7 @@ function Zd(e) {
|
|
|
2548
2548
|
return JSON.stringify(e.preset ?? null);
|
|
2549
2549
|
}
|
|
2550
2550
|
function qs(e) {
|
|
2551
|
-
e.timer != null && clearTimeout(e.timer), e.iframe.remove(),
|
|
2551
|
+
e.timer != null && clearTimeout(e.timer), e.iframe.remove(), qn.evictions += 1;
|
|
2552
2552
|
}
|
|
2553
2553
|
function Ba() {
|
|
2554
2554
|
const e = Wt.splice(0, Wt.length);
|
|
@@ -2579,7 +2579,7 @@ function rg(e) {
|
|
|
2579
2579
|
}
|
|
2580
2580
|
if (t < 0) return null;
|
|
2581
2581
|
const [r] = Wt.splice(t, 1);
|
|
2582
|
-
return r.timer != null && clearTimeout(r.timer),
|
|
2582
|
+
return r.timer != null && clearTimeout(r.timer), qn.reuses += 1, { iframe: r.iframe, skip: r.executed.length };
|
|
2583
2583
|
}
|
|
2584
2584
|
function og(e, t, n) {
|
|
2585
2585
|
var i, a;
|
|
@@ -2595,7 +2595,7 @@ function og(e, t, n) {
|
|
|
2595
2595
|
for (o.timer = setTimeout(() => {
|
|
2596
2596
|
const l = Wt.indexOf(o);
|
|
2597
2597
|
l < 0 || (Wt.splice(l, 1), qs(o));
|
|
2598
|
-
}, tg), (a = (i = o.timer) == null ? void 0 : i.unref) == null || a.call(i), Wt.push(o),
|
|
2598
|
+
}, tg), (a = (i = o.timer) == null ? void 0 : i.unref) == null || a.call(i), Wt.push(o), qn.parks += 1; Wt.length > Zm; ) {
|
|
2599
2599
|
const l = Wt.shift();
|
|
2600
2600
|
l && qs(l);
|
|
2601
2601
|
}
|
|
@@ -2663,7 +2663,7 @@ function Fi(e = {}) {
|
|
|
2663
2663
|
const W = A.waypoints[0];
|
|
2664
2664
|
z.style.width = `${Math.round(W.width)}px`, z.style.height = `${Math.round(W.height)}px`, k || T.appendChild(z);
|
|
2665
2665
|
try {
|
|
2666
|
-
k || (await i(z, A.url),
|
|
2666
|
+
k || (await i(z, A.url), qn.boots += 1, qn.bootsByRunner[n] = (qn.bootsByRunner[n] ?? 0) + 1);
|
|
2667
2667
|
for (let oe = 0; oe < A.waypoints.length; oe += 1) {
|
|
2668
2668
|
if (N !== p) {
|
|
2669
2669
|
for (let I = oe; I < A.waypoints.length; I += 1)
|
|
@@ -2783,7 +2783,7 @@ function uo() {
|
|
|
2783
2783
|
}
|
|
2784
2784
|
const sg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2785
2785
|
__proto__: null,
|
|
2786
|
-
__flowSessionWarmDebug:
|
|
2786
|
+
__flowSessionWarmDebug: qn,
|
|
2787
2787
|
createFlowSessionIframe: Jd,
|
|
2788
2788
|
createFlowSessionRunner: Fi,
|
|
2789
2789
|
evictFlowSessionWarmInstances: Ba,
|
|
@@ -2918,7 +2918,7 @@ function su(e) {
|
|
|
2918
2918
|
u.waypoints.some(
|
|
2919
2919
|
(m) => {
|
|
2920
2920
|
var b;
|
|
2921
|
-
return !
|
|
2921
|
+
return !Jn(m.cacheKey) && r.screenState(m.screenId) == null && ((b = n.get(m.screenId)) == null ? void 0 : b.layersImported) !== !0;
|
|
2922
2922
|
}
|
|
2923
2923
|
) && o.push(u);
|
|
2924
2924
|
}
|
|
@@ -2986,7 +2986,7 @@ function lu(e, t, n) {
|
|
|
2986
2986
|
);
|
|
2987
2987
|
if (l < 0) return !1;
|
|
2988
2988
|
const c = jt(e, n, t, !1), d = async (p) => {
|
|
2989
|
-
const m =
|
|
2989
|
+
const m = Kn();
|
|
2990
2990
|
if (!m) {
|
|
2991
2991
|
$n.controllerMissing += 1;
|
|
2992
2992
|
return;
|
|
@@ -3654,17 +3654,17 @@ function Bg({
|
|
|
3654
3654
|
}
|
|
3655
3655
|
);
|
|
3656
3656
|
if (!d.ok) {
|
|
3657
|
-
const p = await d.json().catch(() => null), m =
|
|
3658
|
-
throw new Error(
|
|
3657
|
+
const p = await d.json().catch(() => null), m = Mn(p) && typeof p.error == "string" ? p.error : null, b = typeof d.status == "number" && d.status > 0 ? ` (${d.status}${d.statusText ? ` ${d.statusText}` : ""})` : "", x = new Error(
|
|
3659
3658
|
`Preview artifact request failed${b}${m ? `: ${m}` : "."}`
|
|
3660
3659
|
);
|
|
3660
|
+
throw Mn(p) && p.retryable === !0 && (x.pygmalionNotPrepared = !0), x;
|
|
3661
3661
|
}
|
|
3662
3662
|
const u = await d.json().catch(() => null);
|
|
3663
|
-
return
|
|
3663
|
+
return Mn(u) && u.artifact !== void 0 ? u.artifact : u;
|
|
3664
3664
|
};
|
|
3665
3665
|
}
|
|
3666
3666
|
function jg(e, t) {
|
|
3667
|
-
if (!
|
|
3667
|
+
if (!Mn(e) || e.ok !== !0)
|
|
3668
3668
|
return { valid: !1, errors: ["Preview artifact resolution is invalid."] };
|
|
3669
3669
|
const n = new Set(t.map((d) => d.id)), r = /* @__PURE__ */ new Set(), o = [], i = (d) => {
|
|
3670
3670
|
const u = e[d];
|
|
@@ -3721,7 +3721,7 @@ async function Wg({
|
|
|
3721
3721
|
errors: l.errors
|
|
3722
3722
|
};
|
|
3723
3723
|
}
|
|
3724
|
-
function
|
|
3724
|
+
function Mn(e) {
|
|
3725
3725
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
3726
3726
|
const t = Object.getPrototypeOf(e);
|
|
3727
3727
|
return t === Object.prototype || t === null;
|
|
@@ -3749,7 +3749,7 @@ function Vg(e) {
|
|
|
3749
3749
|
}
|
|
3750
3750
|
function Kg(e) {
|
|
3751
3751
|
const t = [];
|
|
3752
|
-
if (!
|
|
3752
|
+
if (!Mn(e) || e.version !== 1)
|
|
3753
3753
|
return {
|
|
3754
3754
|
valid: !1,
|
|
3755
3755
|
artifact: null,
|
|
@@ -3757,7 +3757,7 @@ function Kg(e) {
|
|
|
3757
3757
|
"Preview artifact must be a version 1, version 2, or version 3 bundle."
|
|
3758
3758
|
]
|
|
3759
3759
|
};
|
|
3760
|
-
if (Go(e.namespace) || t.push("Preview artifact namespace is invalid."), e.sourceRevision != null && !Go(e.sourceRevision) && t.push("Preview artifact source revision is invalid."), !
|
|
3760
|
+
if (Go(e.namespace) || t.push("Preview artifact namespace is invalid."), e.sourceRevision != null && !Go(e.sourceRevision) && t.push("Preview artifact source revision is invalid."), !Mn(e.snapshots))
|
|
3761
3761
|
t.push("Preview artifact snapshots must be a record.");
|
|
3762
3762
|
else {
|
|
3763
3763
|
const n = Object.entries(e.snapshots);
|
|
@@ -3777,14 +3777,14 @@ function Kg(e) {
|
|
|
3777
3777
|
};
|
|
3778
3778
|
}
|
|
3779
3779
|
function Ug(e, t, n = {}) {
|
|
3780
|
-
const r =
|
|
3780
|
+
const r = Mn(e) && e.version === 3 ? (() => {
|
|
3781
3781
|
const o = Mi(e);
|
|
3782
3782
|
return {
|
|
3783
3783
|
valid: o.valid,
|
|
3784
3784
|
artifact: o.valid ? e : null,
|
|
3785
3785
|
errors: o.errors
|
|
3786
3786
|
};
|
|
3787
|
-
})() :
|
|
3787
|
+
})() : Mn(e) && e.version === 2 ? (() => {
|
|
3788
3788
|
const o = Pi(e);
|
|
3789
3789
|
return {
|
|
3790
3790
|
valid: o.valid,
|
|
@@ -4113,7 +4113,13 @@ function Iu({
|
|
|
4113
4113
|
captureStatus: n,
|
|
4114
4114
|
diagnostic: r
|
|
4115
4115
|
}) {
|
|
4116
|
-
return t.status === "error" ? {
|
|
4116
|
+
return t.status === "error" ? t.reason === "not-prepared" ? {
|
|
4117
|
+
title: "Preview not prepared",
|
|
4118
|
+
detail: "Refresh the source to draw this frame from the running app",
|
|
4119
|
+
tone: "info",
|
|
4120
|
+
role: "status",
|
|
4121
|
+
retryable: !0
|
|
4122
|
+
} : {
|
|
4117
4123
|
title: "Preview refresh failed",
|
|
4118
4124
|
detail: t.message,
|
|
4119
4125
|
tone: "error",
|
|
@@ -5304,7 +5310,7 @@ function Lb(e) {
|
|
|
5304
5310
|
stylesheetLinksHtml: e.snapshot ? Fb(e.snapshot) : ""
|
|
5305
5311
|
};
|
|
5306
5312
|
}
|
|
5307
|
-
function
|
|
5313
|
+
function Wn(e, t) {
|
|
5308
5314
|
Sr(e);
|
|
5309
5315
|
const n = kb(e), r = io(t);
|
|
5310
5316
|
if (!r) return ec(n);
|
|
@@ -5354,7 +5360,7 @@ function Qo(e, t, n) {
|
|
|
5354
5360
|
if (c === "style") {
|
|
5355
5361
|
Sr(l.value), o && a.setAttribute(
|
|
5356
5362
|
l.name,
|
|
5357
|
-
|
|
5363
|
+
Wn(l.value, o)
|
|
5358
5364
|
);
|
|
5359
5365
|
continue;
|
|
5360
5366
|
}
|
|
@@ -5391,7 +5397,7 @@ function Za(e, t, n, r) {
|
|
|
5391
5397
|
return;
|
|
5392
5398
|
}
|
|
5393
5399
|
if (o === "style") {
|
|
5394
|
-
e.setAttribute(t,
|
|
5400
|
+
e.setAttribute(t, Wn(n, r));
|
|
5395
5401
|
return;
|
|
5396
5402
|
}
|
|
5397
5403
|
if (o === "srcset") {
|
|
@@ -5698,8 +5704,8 @@ function jb(e, t, n = Bb) {
|
|
|
5698
5704
|
const p = Xr(r.sharedCssText);
|
|
5699
5705
|
if (t.sharedCssHash && t.sharedCssHash !== p)
|
|
5700
5706
|
throw new Error("The provided shared CSS hash does not match its content.");
|
|
5701
|
-
const m =
|
|
5702
|
-
const Z =
|
|
5707
|
+
const m = Wn(r.sharedCssText, a), b = Xr(m), x = (t.sharedStylesheets ?? []).map((z) => {
|
|
5708
|
+
const Z = Wn(z.cssText, a);
|
|
5703
5709
|
return {
|
|
5704
5710
|
cssText: Z,
|
|
5705
5711
|
key: `${z.key}:${Xr(Z)}`
|
|
@@ -5716,7 +5722,7 @@ function jb(e, t, n = Bb) {
|
|
|
5716
5722
|
), H = n.acquireOverride(
|
|
5717
5723
|
o,
|
|
5718
5724
|
v,
|
|
5719
|
-
|
|
5725
|
+
Wn(t.overrideCssText ?? "", a)
|
|
5720
5726
|
);
|
|
5721
5727
|
let A = !1;
|
|
5722
5728
|
const N = {
|
|
@@ -5732,13 +5738,13 @@ function jb(e, t, n = Bb) {
|
|
|
5732
5738
|
updateOverrideCss: (z) => {
|
|
5733
5739
|
A || n.updateOverrideCss(
|
|
5734
5740
|
v,
|
|
5735
|
-
|
|
5741
|
+
Wn(z, a)
|
|
5736
5742
|
);
|
|
5737
5743
|
},
|
|
5738
5744
|
updateSharedCss: (z) => {
|
|
5739
5745
|
A || n.updateSharedCss(
|
|
5740
5746
|
b,
|
|
5741
|
-
|
|
5747
|
+
Wn(z, a)
|
|
5742
5748
|
);
|
|
5743
5749
|
},
|
|
5744
5750
|
teardown: () => {
|
|
@@ -6114,7 +6120,7 @@ const ex = We(function({
|
|
|
6114
6120
|
canonicalId: t.importPageId ?? t.id,
|
|
6115
6121
|
fingerprint: fe,
|
|
6116
6122
|
batchHydrated: i
|
|
6117
|
-
}), { previewIntended: ie } = ne, P = a && ne.cacheHydrated, E = a ?
|
|
6123
|
+
}), { previewIntended: ie } = ne, P = a && ne.cacheHydrated, E = a ? jn(q) : null, I = a ? $a(q) : null, V = t.width ?? 390, ae = (I == null ? void 0 : I.screenshot) ?? null, xe = Jb(
|
|
6118
6124
|
q,
|
|
6119
6125
|
ae,
|
|
6120
6126
|
V,
|
|
@@ -6127,14 +6133,14 @@ const ex = We(function({
|
|
|
6127
6133
|
), Re = a ? mn(
|
|
6128
6134
|
t.importPageId ?? t.id,
|
|
6129
6135
|
fe ?? void 0
|
|
6130
|
-
) : { status: "idle" },
|
|
6136
|
+
) : { status: "idle" }, le = Iu({
|
|
6131
6137
|
stale: (I == null ? void 0 : I.stale) === !0,
|
|
6132
6138
|
resolution: Re,
|
|
6133
6139
|
captureStatus: I == null ? void 0 : I.status,
|
|
6134
6140
|
diagnostic: (mo = I == null ? void 0 : I.diagnostics[0]) == null ? void 0 : mo.message
|
|
6135
6141
|
}), [Le, De] = Y(
|
|
6136
6142
|
() => a && !E ? Jt(q) : null
|
|
6137
|
-
), [Ye, ot] = Y(!1), [F,
|
|
6143
|
+
), [Ye, ot] = Y(!1), [F, de] = Y(!1), re = Ie(null), Ee = () => {
|
|
6138
6144
|
!a || t.route == null || t.layersImported || $e || re.current == null && (re.current = setTimeout(() => {
|
|
6139
6145
|
re.current = null, _a(t.id);
|
|
6140
6146
|
}, 220));
|
|
@@ -6212,7 +6218,7 @@ const ex = We(function({
|
|
|
6212
6218
|
return pe.observe(U), () => pe.disconnect();
|
|
6213
6219
|
}, []), se(() => {
|
|
6214
6220
|
if (!n || !t.importLayers || t.layersImported || t.route != null) return;
|
|
6215
|
-
const U =
|
|
6221
|
+
const U = Kn();
|
|
6216
6222
|
if (!U) return;
|
|
6217
6223
|
let pe = !1, be = 0;
|
|
6218
6224
|
const Te = requestAnimationFrame(() => {
|
|
@@ -6234,7 +6240,7 @@ const ex = We(function({
|
|
|
6234
6240
|
}, [n, t.id, t.importLayers, t.layersImported, t.route]), se(() => {
|
|
6235
6241
|
var U, pe;
|
|
6236
6242
|
(U = m.current) == null || U.resolve(null), m.current = null, (pe = b.current) == null || pe.resolve(), b.current = null, ot(!1), we(!1), K(null), J(0), Ne([]), De(
|
|
6237
|
-
|
|
6243
|
+
jn(q) ? null : Jt(q)
|
|
6238
6244
|
), H.current += 1, $.current = !1, R.current = null, S.current = null, v.current(), v.current = () => {
|
|
6239
6245
|
}, f.resetPageDocumentHeight(t.id);
|
|
6240
6246
|
}, [q]), se(
|
|
@@ -6251,7 +6257,7 @@ const ex = We(function({
|
|
|
6251
6257
|
return;
|
|
6252
6258
|
}
|
|
6253
6259
|
De(
|
|
6254
|
-
|
|
6260
|
+
jn(q) ? null : Jt(q)
|
|
6255
6261
|
);
|
|
6256
6262
|
}, [P, a, q]), se(() => {
|
|
6257
6263
|
var Ae, me;
|
|
@@ -6296,7 +6302,7 @@ const ex = We(function({
|
|
|
6296
6302
|
if (U) {
|
|
6297
6303
|
if (ye) {
|
|
6298
6304
|
De(
|
|
6299
|
-
|
|
6305
|
+
jn(q) ? null : ye
|
|
6300
6306
|
), K(null);
|
|
6301
6307
|
return;
|
|
6302
6308
|
}
|
|
@@ -6354,7 +6360,7 @@ const ex = We(function({
|
|
|
6354
6360
|
[ze, E, I == null ? void 0 : I.stale]
|
|
6355
6361
|
), Et = a && !P, Be = gg(
|
|
6356
6362
|
t.importPageId ?? t.id
|
|
6357
|
-
), He = yg(t.id),
|
|
6363
|
+
), He = yg(t.id), En = f.frozenPromotionRefused(t.id), _t = (qt || Et || Be || Ut) && !En && !t.layersImported && t.importLayers === !0 && t.route != null && // A replay that reported issues registers stale and cannot promote —
|
|
6358
6364
|
// fall back to the boot path instead of holding the frame on it.
|
|
6359
6365
|
je.length === 0;
|
|
6360
6366
|
se(() => {
|
|
@@ -6455,13 +6461,13 @@ const ex = We(function({
|
|
|
6455
6461
|
}, p.current = me.iframe, Pr(), !0) : !1;
|
|
6456
6462
|
};
|
|
6457
6463
|
se(() => {
|
|
6458
|
-
|
|
6464
|
+
de(!1);
|
|
6459
6465
|
}, [oe]);
|
|
6460
6466
|
const on = async () => {
|
|
6461
6467
|
if (!p.current) return null;
|
|
6462
6468
|
if ($.current) return R.current;
|
|
6463
6469
|
if (S.current) return S.current;
|
|
6464
|
-
const U =
|
|
6470
|
+
const U = Kn();
|
|
6465
6471
|
if (!U) return null;
|
|
6466
6472
|
const pe = p.current, be = H.current, Te = (async () => {
|
|
6467
6473
|
const Ae = await U.prepareScreenCapture(pe, {
|
|
@@ -6490,7 +6496,7 @@ const ex = We(function({
|
|
|
6490
6496
|
}), be;
|
|
6491
6497
|
}, lt = () => t.layersImported && f.provisionalLayerImportRevision(t.id) == null, te = async () => {
|
|
6492
6498
|
if (!t.importLayers || lt() || !p.current || x.current) return t.layersImported;
|
|
6493
|
-
const U =
|
|
6499
|
+
const U = Kn();
|
|
6494
6500
|
if (!U) return !1;
|
|
6495
6501
|
const pe = p.current;
|
|
6496
6502
|
x.current = !0;
|
|
@@ -6542,11 +6548,11 @@ const ex = We(function({
|
|
|
6542
6548
|
}
|
|
6543
6549
|
}, qe = () => {
|
|
6544
6550
|
if (window.removeEventListener("mousemove", ye), window.removeEventListener("mouseup", qe), !me) return;
|
|
6545
|
-
const ft = t.x ?? 0, St = t.y ?? 0, kt = ft + (t.width ?? 390),
|
|
6546
|
-
for (const [
|
|
6551
|
+
const ft = t.x ?? 0, St = t.y ?? 0, kt = ft + (t.width ?? 390), kn = St + Z;
|
|
6552
|
+
for (const [An, nt] of _u()) {
|
|
6547
6553
|
const wn = nt.explicit ? 0 : zu, go = nt.x0 - wn, bo = nt.y0 - wn, sn = nt.x1 + wn, Gt = nt.y1 + wn;
|
|
6548
|
-
if (
|
|
6549
|
-
f.setPageSection(t.id,
|
|
6554
|
+
if (An !== t.section && ft < sn && kt > go && St < Gt && kn > bo) {
|
|
6555
|
+
f.setPageSection(t.id, An);
|
|
6550
6556
|
break;
|
|
6551
6557
|
}
|
|
6552
6558
|
}
|
|
@@ -6558,7 +6564,7 @@ const ex = We(function({
|
|
|
6558
6564
|
const be = pe.clientX, Te = pe.clientY, Ae = { x: t.x ?? 0, y: t.y ?? 0, width: z, height: Z }, me = U.includes("e") || U.includes("w"), ye = U.includes("n") || U.includes("s");
|
|
6559
6565
|
let qe = !1;
|
|
6560
6566
|
const ft = (kt) => {
|
|
6561
|
-
const
|
|
6567
|
+
const kn = (kt.clientX - be) / f.zoom, An = (kt.clientY - Te) / f.zoom, nt = Lu(Ae, U, kn, An, 1, 1);
|
|
6562
6568
|
if (!(Math.round(nt.x) === Math.round(Ae.x) && Math.round(nt.y) === Math.round(Ae.y) && Math.round(nt.width) === Math.round(Ae.width) && Math.round(nt.height) === Math.round(Ae.height))) {
|
|
6563
6569
|
if (!qe) {
|
|
6564
6570
|
if (!f.beginFrameTransform(t.id, "resize")) return;
|
|
@@ -6645,11 +6651,11 @@ const ex = We(function({
|
|
|
6645
6651
|
ee
|
|
6646
6652
|
), Pr = () => {
|
|
6647
6653
|
const U = H.current + 1;
|
|
6648
|
-
H.current = U,
|
|
6654
|
+
H.current = U, de(!1), $.current = !1, R.current = null, S.current = null, (async () => {
|
|
6649
6655
|
var pe;
|
|
6650
6656
|
try {
|
|
6651
6657
|
const be = await on();
|
|
6652
|
-
Yc(be),
|
|
6658
|
+
Yc(be), de(!0);
|
|
6653
6659
|
const Te = p.current;
|
|
6654
6660
|
if ((Te ? he(Te) : !1) && await new Promise((ye) => {
|
|
6655
6661
|
requestAnimationFrame(
|
|
@@ -6672,7 +6678,7 @@ const ex = We(function({
|
|
|
6672
6678
|
) : null;
|
|
6673
6679
|
if (me) {
|
|
6674
6680
|
Ti(q, me), De(
|
|
6675
|
-
|
|
6681
|
+
jn(q) ? null : me
|
|
6676
6682
|
);
|
|
6677
6683
|
const ye = m.current;
|
|
6678
6684
|
(ye == null ? void 0 : ye.key) === oe && (m.current = null, ye.resolve(me));
|
|
@@ -6688,7 +6694,7 @@ const ex = We(function({
|
|
|
6688
6694
|
}
|
|
6689
6695
|
f.activePageId === t.id && await te();
|
|
6690
6696
|
} catch (be) {
|
|
6691
|
-
|
|
6697
|
+
de(!0);
|
|
6692
6698
|
const Te = be instanceof Error ? be.message : "Failed to reproduce the live screen preview.", Ae = m.current;
|
|
6693
6699
|
(Ae == null ? void 0 : Ae.key) === oe ? (m.current = null, Ae.reject(be)) : K(Te);
|
|
6694
6700
|
} finally {
|
|
@@ -7016,14 +7022,14 @@ const ex = We(function({
|
|
|
7016
7022
|
)
|
|
7017
7023
|
}
|
|
7018
7024
|
),
|
|
7019
|
-
|
|
7025
|
+
le && /* @__PURE__ */ g(
|
|
7020
7026
|
"div",
|
|
7021
7027
|
{
|
|
7022
7028
|
"data-pygmalion-artifact-diagnostic": "",
|
|
7023
7029
|
"data-artifact-resolution": Re.status,
|
|
7024
|
-
"data-artifact-tone":
|
|
7025
|
-
role:
|
|
7026
|
-
title:
|
|
7030
|
+
"data-artifact-tone": le.tone,
|
|
7031
|
+
role: le.role,
|
|
7032
|
+
title: le.detail,
|
|
7027
7033
|
style: {
|
|
7028
7034
|
position: "absolute",
|
|
7029
7035
|
top: 8,
|
|
@@ -7033,18 +7039,18 @@ const ex = We(function({
|
|
|
7033
7039
|
maxWidth: "min(320px, calc(100% - 16px))",
|
|
7034
7040
|
alignItems: "center",
|
|
7035
7041
|
gap: 6,
|
|
7036
|
-
border:
|
|
7042
|
+
border: le.tone === "info" ? "1px solid #b6d4fe" : le.tone === "error" ? "1px solid #f1aeb5" : "1px solid #ffe69c",
|
|
7037
7043
|
borderRadius: 6,
|
|
7038
7044
|
padding: "5px 8px",
|
|
7039
|
-
color:
|
|
7040
|
-
background:
|
|
7045
|
+
color: le.tone === "info" ? "#084298" : le.tone === "error" ? "#842029" : "#664d03",
|
|
7046
|
+
background: le.tone === "info" ? "rgba(207, 226, 255, 0.96)" : le.tone === "error" ? "rgba(248, 215, 218, 0.96)" : "rgba(255, 243, 205, 0.96)",
|
|
7041
7047
|
boxShadow: "0 1px 4px rgba(0,0,0,.12)",
|
|
7042
7048
|
fontSize: 11,
|
|
7043
7049
|
lineHeight: 1.3,
|
|
7044
|
-
pointerEvents:
|
|
7050
|
+
pointerEvents: le.retryable ? "auto" : "none"
|
|
7045
7051
|
},
|
|
7046
7052
|
children: [
|
|
7047
|
-
/* @__PURE__ */ s("strong", { style: { whiteSpace: "nowrap" }, children:
|
|
7053
|
+
/* @__PURE__ */ s("strong", { style: { whiteSpace: "nowrap" }, children: le.title }),
|
|
7048
7054
|
/* @__PURE__ */ s(
|
|
7049
7055
|
"span",
|
|
7050
7056
|
{
|
|
@@ -7053,10 +7059,10 @@ const ex = We(function({
|
|
|
7053
7059
|
textOverflow: "ellipsis",
|
|
7054
7060
|
whiteSpace: "nowrap"
|
|
7055
7061
|
},
|
|
7056
|
-
children:
|
|
7062
|
+
children: le.detail
|
|
7057
7063
|
}
|
|
7058
7064
|
),
|
|
7059
|
-
|
|
7065
|
+
le.retryable && fe && /* @__PURE__ */ s(
|
|
7060
7066
|
"button",
|
|
7061
7067
|
{
|
|
7062
7068
|
type: "button",
|
|
@@ -7484,14 +7490,14 @@ function yi(e) {
|
|
|
7484
7490
|
function lc(e) {
|
|
7485
7491
|
return JSON.stringify(e);
|
|
7486
7492
|
}
|
|
7487
|
-
let In = null, Do = /* @__PURE__ */ new Map(), cs = /* @__PURE__ */ new Map(),
|
|
7493
|
+
let In = null, Do = /* @__PURE__ */ new Map(), cs = /* @__PURE__ */ new Map(), Yn = /* @__PURE__ */ new Map(), Vn = null, Br = null, mx = 0;
|
|
7488
7494
|
function tl() {
|
|
7489
|
-
Rt.setPending(
|
|
7495
|
+
Rt.setPending(Yn.size);
|
|
7490
7496
|
}
|
|
7491
7497
|
function Ku(e) {
|
|
7492
|
-
for (const t of e)
|
|
7493
|
-
tl(),
|
|
7494
|
-
|
|
7498
|
+
for (const t of e) Yn.set(yi(t.element), t);
|
|
7499
|
+
tl(), Vn && clearTimeout(Vn), Vn = setTimeout(() => {
|
|
7500
|
+
Vn = null, Uu().catch(() => {
|
|
7495
7501
|
});
|
|
7496
7502
|
}, 240);
|
|
7497
7503
|
}
|
|
@@ -7499,14 +7505,14 @@ function cc(e) {
|
|
|
7499
7505
|
const t = new Map(
|
|
7500
7506
|
e.map((n) => [yi(n.element), n])
|
|
7501
7507
|
);
|
|
7502
|
-
for (const [n, r] of
|
|
7503
|
-
|
|
7508
|
+
for (const [n, r] of Yn) t.set(n, r);
|
|
7509
|
+
Yn = t, tl();
|
|
7504
7510
|
}
|
|
7505
7511
|
async function Uu() {
|
|
7506
7512
|
return Br || (Br = (async () => {
|
|
7507
|
-
for (;
|
|
7508
|
-
const e = [...
|
|
7509
|
-
|
|
7513
|
+
for (; Yn.size > 0; ) {
|
|
7514
|
+
const e = [...Yn.values()];
|
|
7515
|
+
Yn = /* @__PURE__ */ new Map(), tl();
|
|
7510
7516
|
const t = Ph();
|
|
7511
7517
|
if (!t) {
|
|
7512
7518
|
cc(e), Rt.setStatus("idle", "");
|
|
@@ -7564,9 +7570,9 @@ function qu(e) {
|
|
|
7564
7570
|
cs = t, n.length && Ku(n);
|
|
7565
7571
|
}
|
|
7566
7572
|
async function bx() {
|
|
7567
|
-
|
|
7573
|
+
Vn && (clearTimeout(Vn), Vn = null), await Uu();
|
|
7568
7574
|
}
|
|
7569
|
-
let nl = [],
|
|
7575
|
+
let nl = [], Gn = null;
|
|
7570
7576
|
const ao = /* @__PURE__ */ new Map();
|
|
7571
7577
|
function xx(e) {
|
|
7572
7578
|
nl = e;
|
|
@@ -7575,7 +7581,7 @@ function vi() {
|
|
|
7575
7581
|
return nl;
|
|
7576
7582
|
}
|
|
7577
7583
|
function yx(e) {
|
|
7578
|
-
|
|
7584
|
+
Gn = e;
|
|
7579
7585
|
}
|
|
7580
7586
|
function vx(e) {
|
|
7581
7587
|
var t;
|
|
@@ -7587,11 +7593,11 @@ function Yu() {
|
|
|
7587
7593
|
function wx(e, t) {
|
|
7588
7594
|
ao.set(e, t), document.documentElement.style.setProperty(e, t);
|
|
7589
7595
|
const n = Yu();
|
|
7590
|
-
|
|
7596
|
+
Gn == null || Gn(n), qu(n);
|
|
7591
7597
|
}
|
|
7592
7598
|
function Xw() {
|
|
7593
7599
|
for (const e of ao.keys()) document.documentElement.style.removeProperty(e);
|
|
7594
|
-
ao.clear(),
|
|
7600
|
+
ao.clear(), Gn == null || Gn([]), qu([]);
|
|
7595
7601
|
}
|
|
7596
7602
|
const Sx = [
|
|
7597
7603
|
{ label: "W", prop: "width" },
|
|
@@ -7924,7 +7930,7 @@ function zo(e, t) {
|
|
|
7924
7930
|
function pc(e) {
|
|
7925
7931
|
return e.includes("center") ? "center" : e.includes("end") ? "end" : "start";
|
|
7926
7932
|
}
|
|
7927
|
-
function
|
|
7933
|
+
function Ln(e) {
|
|
7928
7934
|
return e ? e.minWidth != null && e.maxWidth != null ? `${e.minWidth}–${e.maxWidth}px` : e.minWidth != null ? `${e.minWidth}px or more` : `${e.maxWidth}px or less` : "entire";
|
|
7929
7935
|
}
|
|
7930
7936
|
function jx(e, t) {
|
|
@@ -8052,7 +8058,7 @@ function mc({
|
|
|
8052
8058
|
affectedFrames: n = []
|
|
8053
8059
|
}) {
|
|
8054
8060
|
var gl, bl, xl, yl, vl;
|
|
8055
|
-
const r = Ie(null), [o, i] = Y(null), [a, l] = Y(null), [c, d] = Y(null), [u, p] = Y("cases"), [m, b] = Y(!1), [x, w] = Y(Rx), [v, S] = Y(null), [$, R] = Y("original"), [H, A] = Y("default"), [N, T] = Y("item"), [j, k] = Y("base"), [z, Z] = Y({ minWidth: 768 }), [M, W] = Y(null), [ee, q] = Y(!0), [Me, oe] = Y(!1), [fe, ne] = Y(!1), [ie, P] = Y(null), [E, I] = Y(""), [V, ae] = Y(!1), [xe, Re] = Y(""), [
|
|
8061
|
+
const r = Ie(null), [o, i] = Y(null), [a, l] = Y(null), [c, d] = Y(null), [u, p] = Y("cases"), [m, b] = Y(!1), [x, w] = Y(Rx), [v, S] = Y(null), [$, R] = Y("original"), [H, A] = Y("default"), [N, T] = Y("item"), [j, k] = Y("base"), [z, Z] = Y({ minWidth: 768 }), [M, W] = Y(null), [ee, q] = Y(!0), [Me, oe] = Y(!1), [fe, ne] = Y(!1), [ie, P] = Y(null), [E, I] = Y(""), [V, ae] = Y(!1), [xe, Re] = Y(""), [le, Le] = Y(!1), [De, Ye] = Y(""), [ot, F] = Y(null), [de, re] = Y(""), [Ee, O] = Y(""), [ve, we] = Y(0), [Q, ge] = ed((h) => h + 1, 0), Oe = Ie(""), B = Ie(null), K = Ie(null);
|
|
8056
8062
|
K.current = a;
|
|
8057
8063
|
const ke = Ie(null);
|
|
8058
8064
|
ke.current = c;
|
|
@@ -8103,13 +8109,13 @@ function mc({
|
|
|
8103
8109
|
(ue) => (ue.sourcePaths ?? []).some(
|
|
8104
8110
|
(_e) => _.some((ht) => kx(_e, ht))
|
|
8105
8111
|
)
|
|
8106
|
-
).map((ue) => ({ id: ws(ue), name: ue.name })),
|
|
8112
|
+
).map((ue) => ({ id: ws(ue), name: ue.name })), ce = [
|
|
8107
8113
|
...J.current,
|
|
8108
8114
|
...L.filter(
|
|
8109
8115
|
(ue) => !J.current.some((_e) => _e.id === ue.id)
|
|
8110
8116
|
)
|
|
8111
8117
|
];
|
|
8112
|
-
X.updateAffectedFrames(
|
|
8118
|
+
X.updateAffectedFrames(ce);
|
|
8113
8119
|
}).catch((C) => {
|
|
8114
8120
|
y || Ye(String(C));
|
|
8115
8121
|
}).finally(() => {
|
|
@@ -8158,13 +8164,13 @@ function mc({
|
|
|
8158
8164
|
const h = c;
|
|
8159
8165
|
if (!h) return;
|
|
8160
8166
|
let y = !1;
|
|
8161
|
-
const C = (
|
|
8167
|
+
const C = (ce) => {
|
|
8162
8168
|
if (y) return;
|
|
8163
8169
|
y = !0, h.removeAttribute("contenteditable");
|
|
8164
8170
|
const ue = h.textContent ?? "";
|
|
8165
|
-
h.textContent = Oe.current,
|
|
8166
|
-
}, _ = (
|
|
8167
|
-
|
|
8171
|
+
h.textContent = Oe.current, ce && ue !== Oe.current && (X.recordText(h, ue, Be(h), J.current), X.toast("change text")), d(null);
|
|
8172
|
+
}, _ = (ce) => {
|
|
8173
|
+
ce.stopPropagation(), ce.key === "Enter" ? (ce.preventDefault(), C(!0)) : ce.key === "Escape" && C(!1);
|
|
8168
8174
|
}, L = () => C(!0);
|
|
8169
8175
|
return h.addEventListener("keydown", _), h.addEventListener("blur", L), () => {
|
|
8170
8176
|
h.removeEventListener("keydown", _), h.removeEventListener("blur", L);
|
|
@@ -8182,8 +8188,8 @@ function mc({
|
|
|
8182
8188
|
if (!C) return null;
|
|
8183
8189
|
const _ = C.contentDocument;
|
|
8184
8190
|
if (!_) return null;
|
|
8185
|
-
const L = C.getBoundingClientRect(),
|
|
8186
|
-
return !
|
|
8191
|
+
const L = C.getBoundingClientRect(), ce = _.elementFromPoint(h.clientX - L.left, h.clientY - L.top);
|
|
8192
|
+
return !ce || ce.nodeType !== 1 || ce === _.body || ce === _.documentElement ? null : ce;
|
|
8187
8193
|
}
|
|
8188
8194
|
const y = t == null ? void 0 : t.current;
|
|
8189
8195
|
if (!y) return null;
|
|
@@ -8205,7 +8211,7 @@ function mc({
|
|
|
8205
8211
|
for (let C = h; C && C !== Ut && y.length < 8; C = C.parentElement)
|
|
8206
8212
|
y.unshift(C);
|
|
8207
8213
|
return y;
|
|
8208
|
-
},
|
|
8214
|
+
}, En = (h) => {
|
|
8209
8215
|
if (X.hasPendingStructuralEdit(h)) {
|
|
8210
8216
|
X.toast("Please undo the structural changes and then edit the text.");
|
|
8211
8217
|
return;
|
|
@@ -8231,7 +8237,7 @@ function mc({
|
|
|
8231
8237
|
X.toast("Works with existing application method without code diff connection");
|
|
8232
8238
|
return;
|
|
8233
8239
|
}
|
|
8234
|
-
if (
|
|
8240
|
+
if (le) {
|
|
8235
8241
|
X.toast("Please check the diff after the impact screen calculation is complete.");
|
|
8236
8242
|
return;
|
|
8237
8243
|
}
|
|
@@ -8261,14 +8267,14 @@ function mc({
|
|
|
8261
8267
|
try {
|
|
8262
8268
|
const L = await h(C);
|
|
8263
8269
|
X.clearApplied(), F((L == null ? void 0 : L.qa) ?? null), P(null), I(""), Re("");
|
|
8264
|
-
const
|
|
8265
|
-
X.toast(`${(L == null ? void 0 : L.message) ?? `Applied ${(L == null ? void 0 : L.applied) ?? _} changes`}${
|
|
8270
|
+
const ce = L != null && L.qa ? L.qa.complete ? ` · ${L.qa.frames.length} affected frames checked` : ` · ${L.qa.failures.length} QA failures` : "";
|
|
8271
|
+
X.toast(`${(L == null ? void 0 : L.message) ?? `Applied ${(L == null ? void 0 : L.applied) ?? _} changes`}${ce}`);
|
|
8266
8272
|
} catch (L) {
|
|
8267
8273
|
X.toast(`Apply failed:${String(L).slice(0, 80)}`);
|
|
8268
8274
|
}
|
|
8269
|
-
}, D = a != null && a.isConnected ? a : null, on = o != null && o.isConnected ? o : null, he = D != null && D.parentElement && D.parentElement !== Ut ? D.parentElement : null, lt = N === "container" && he ? he : D, te = D ? Et(D.getBoundingClientRect()) : null, G = he ? Et(he.getBoundingClientRect()) : null, er = N === "container" && lt && lt !== D ? Et(lt.getBoundingClientRect()) : null, yn = on && on !== D ? Et(on.getBoundingClientRect()) : null, st = D ? Ce.getComputedStyle(D) : null, Ve = he ? Ce.getComputedStyle(he) : null, $r = lt ? Ce.getComputedStyle(lt) : null, ut = D ? Be(D) : "", at = D ? Ke(D) : null, Yt = D ? Mh(D) : null, Zt = D ? X.structuralEditKind(D) : null, ji = D ? X.hasPendingValueEdit(D) : !1, ho = D ? X.structuralBlockReason(D, "insert") : "No elements are selected.", po = D ? X.structuralBlockReason(D, "remove") : "No elements are selected.", Pr = D ? X.structuralBlockReason(D, "move") : "No elements are selected.", vn = D && D.parentElement ? Array.from(D.parentElement.children).indexOf(D) : -1, mo = ((xl = D == null ? void 0 : D.parentElement) == null ? void 0 : xl.children.length) ?? 0, U = at ? Ze()[at.name] ?? null : null, pe = Yt && /^[A-Z]/.test(Yt.elementName) ? (at == null ? void 0 : at.name) ?? null : null, be = D ? X.componentInsertBlockReason(D, pe) : "No elements are selected.", Te =
|
|
8275
|
+
}, D = a != null && a.isConnected ? a : null, on = o != null && o.isConnected ? o : null, he = D != null && D.parentElement && D.parentElement !== Ut ? D.parentElement : null, lt = N === "container" && he ? he : D, te = D ? Et(D.getBoundingClientRect()) : null, G = he ? Et(he.getBoundingClientRect()) : null, er = N === "container" && lt && lt !== D ? Et(lt.getBoundingClientRect()) : null, yn = on && on !== D ? Et(on.getBoundingClientRect()) : null, st = D ? Ce.getComputedStyle(D) : null, Ve = he ? Ce.getComputedStyle(he) : null, $r = lt ? Ce.getComputedStyle(lt) : null, ut = D ? Be(D) : "", at = D ? Ke(D) : null, Yt = D ? Mh(D) : null, Zt = D ? X.structuralEditKind(D) : null, ji = D ? X.hasPendingValueEdit(D) : !1, ho = D ? X.structuralBlockReason(D, "insert") : "No elements are selected.", po = D ? X.structuralBlockReason(D, "remove") : "No elements are selected.", Pr = D ? X.structuralBlockReason(D, "move") : "No elements are selected.", vn = D && D.parentElement ? Array.from(D.parentElement.children).indexOf(D) : -1, mo = ((xl = D == null ? void 0 : D.parentElement) == null ? void 0 : xl.children.length) ?? 0, U = at ? Ze()[at.name] ?? null : null, pe = Yt && /^[A-Z]/.test(Yt.elementName) ? (at == null ? void 0 : at.name) ?? null : null, be = D ? X.componentInsertBlockReason(D, pe) : "No elements are selected.", Te = de.trim().toLocaleLowerCase(), Ae = zt.filter(
|
|
8270
8276
|
([h, y]) => !Te || h.toLocaleLowerCase().includes(Te) || y.importPath.toLocaleLowerCase().includes(Te)
|
|
8271
|
-
), me = Ae.find(([h]) => h === Ee) ?? Ae[0] ?? null, ye = (me == null ? void 0 : me[1]) ?? null, qe = me ? Sl(me[0]) : null, St = (D ? Nl(D) : null) ?? 0, kt = D ? Lx(D, (at == null ? void 0 : at.props) ?? null, U) : !1,
|
|
8277
|
+
), me = Ae.find(([h]) => h === Ee) ?? Ae[0] ?? null, ye = (me == null ? void 0 : me[1]) ?? null, qe = me ? Sl(me[0]) : null, St = (D ? Nl(D) : null) ?? 0, kt = D ? Lx(D, (at == null ? void 0 : at.props) ?? null, U) : !1, kn = D ? Dx(D, (at == null ? void 0 : at.props) ?? null, U) : [], An = D ? Ju(D) : [], nt = { count: An.length }, wn = Me && D && on && on !== D ? [D, on] : null, go = X.entries, bo = Object.entries((at == null ? void 0 : at.primitiveProps) ?? {}), sn = je, Gt = go.reduce((h, y) => {
|
|
8272
8278
|
const C = h.find((_) => _.el === y.el);
|
|
8273
8279
|
return C ? (C.label = y.label, C.items.push(y)) : h.push({ id: y.id, el: y.el, label: y.label, items: [y] }), h;
|
|
8274
8280
|
}, []), xo = sn.styles.length + sn.texts.length + sn.operations.length, yo = Vo() != null, Wi = yo && E !== Ne, wf = Gt.filter(
|
|
@@ -8276,7 +8282,7 @@ function mc({
|
|
|
8276
8282
|
).length, Hi = v != null || $ !== "original" || H !== "default", Mr = Hi && D ? jx(D, Ce) : null, Ge = Ox(Ve), tr = Ge != null, Nt = Bx(he), an = j === "custom" ? z.minWidth != null || z.maxWidth != null ? {
|
|
8277
8283
|
...z.minWidth != null ? { minWidth: Math.max(0, Math.round(z.minWidth)) } : {},
|
|
8278
8284
|
...z.maxWidth != null ? { maxWidth: Math.max(0, Math.round(z.maxWidth)) } : {}
|
|
8279
|
-
} : null : ((yl = uc.find((h) => h.id === j)) == null ? void 0 : yl.media) ?? null, Vi =
|
|
8285
|
+
} : null : ((yl = uc.find((h) => h.id === j)) == null ? void 0 : yl.media) ?? null, Vi = An.filter((h) => h.isConnected && Ce.getComputedStyle(h).getPropertyValue("display") !== "none").map((h, y) => ({ el: h, index: y, rect: Et(h.getBoundingClientRect()) })).filter(({ rect: h }) => h.width > 0 && h.height > 0), Ki = Vi.slice().sort((h, y) => h.rect.top - y.rect.top || h.rect.left - y.rect.left).reduce((h, y) => {
|
|
8280
8286
|
const C = h.find((_) => Math.abs(_.top - y.rect.top) < 6);
|
|
8281
8287
|
return C ? (C.top = Math.min(C.top, y.rect.top), C.bottom = Math.max(C.bottom, y.rect.top + y.rect.height), C.left = Math.min(C.left, y.rect.left), C.right = Math.max(C.right, y.rect.left + y.rect.width), C.items.push(y), C.items.sort((_, L) => _.rect.left - L.rect.left)) : h.push({
|
|
8282
8288
|
top: y.rect.top,
|
|
@@ -8287,8 +8293,8 @@ function mc({
|
|
|
8287
8293
|
}), h;
|
|
8288
8294
|
}, []).sort((h, y) => h.top - y.top), Sf = Ki.flatMap(
|
|
8289
8295
|
(h, y) => h.items.slice(0, -1).map((C, _) => {
|
|
8290
|
-
const L = h.items[_ + 1],
|
|
8291
|
-
return { key: `${y}-${_}`, left:
|
|
8296
|
+
const L = h.items[_ + 1], ce = C.rect.left + C.rect.width, ue = L.rect.left, _e = Math.max(C.rect.top, L.rect.top), ht = Math.min(C.rect.top + C.rect.height, L.rect.top + L.rect.height);
|
|
8297
|
+
return { key: `${y}-${_}`, left: ce, top: _e, width: Math.max(0, ue - ce), height: Math.max(16, ht - _e) };
|
|
8292
8298
|
})
|
|
8293
8299
|
), Nf = Ki.slice(0, -1).map((h, y) => {
|
|
8294
8300
|
const C = Ki[y + 1];
|
|
@@ -8325,19 +8331,19 @@ function mc({
|
|
|
8325
8331
|
), Yi = Math.max(
|
|
8326
8332
|
0,
|
|
8327
8333
|
(vo - ln * Math.max(0, xt - 1)) / xt
|
|
8328
|
-
), cl = Math.max(80, Math.floor(Yi)), Lf = Yi < 160, dl = Ge === "grid" && Nt === xt, Df = Ge === "scroll" ? `${xt} items · horizontal scroll · ${Math.round(ll)}px cards` : `${xt} items · ${Ff} rows × ${wo} columns · about ${Math.round(ll)}px each`, zf = u === "cases" && !m && !!he && !!G && !!te,
|
|
8334
|
+
), cl = Math.max(80, Math.floor(Yi)), Lf = Yi < 160, dl = Ge === "grid" && Nt === xt, Df = Ge === "scroll" ? `${xt} items · horizontal scroll · ${Math.round(ll)}px cards` : `${xt} items · ${Ff} rows × ${wo} columns · about ${Math.round(ll)}px each`, zf = u === "cases" && !m && !!he && !!G && !!te, Rn = !!he && he.scrollWidth > he.clientWidth + 1 && !["auto", "scroll"].includes((Ve == null ? void 0 : Ve.getPropertyValue("overflow-x")) ?? ""), ul = [
|
|
8329
8335
|
v != null ? `${v} items` : null,
|
|
8330
8336
|
$ === "long" ? "long text" : $ === "extreme" ? "extreme text" : null,
|
|
8331
8337
|
H === "selected" ? "selection status" : H === "disabled" ? "inactive" : H === "loading" ? "loading status" : null
|
|
8332
|
-
].filter(Boolean), So = (h) => S(h == null ? null : _x(h)),
|
|
8338
|
+
].filter(Boolean), So = (h) => S(h == null ? null : _x(h)), Tn = (h, y, C) => {
|
|
8333
8339
|
C ? h.style.setProperty(y, C) : h.style.removeProperty(y);
|
|
8334
8340
|
}, No = (h, y, C, _) => {
|
|
8335
8341
|
if (h.button !== 0) return;
|
|
8336
8342
|
h.preventDefault(), h.stopPropagation();
|
|
8337
|
-
const L = h.clientX,
|
|
8343
|
+
const L = h.clientX, ce = h.clientY, ue = document.body.style.cursor, _e = document.body.style.userSelect;
|
|
8338
8344
|
document.body.style.cursor = y, document.body.style.userSelect = "none";
|
|
8339
8345
|
const ht = (Nn) => {
|
|
8340
|
-
C(Nn.clientX - L, Nn.clientY -
|
|
8346
|
+
C(Nn.clientX - L, Nn.clientY - ce), ge();
|
|
8341
8347
|
}, Sn = () => {
|
|
8342
8348
|
window.removeEventListener("pointermove", ht), window.removeEventListener("pointerup", Sn), document.body.style.cursor = ue, document.body.style.userSelect = _e, _(), ge();
|
|
8343
8349
|
};
|
|
@@ -8372,7 +8378,7 @@ function mc({
|
|
|
8372
8378
|
T("container"), X.toast(`${y.label}change to batch`);
|
|
8373
8379
|
}
|
|
8374
8380
|
}, Rr = (h) => {
|
|
8375
|
-
!he || !D || (Xe("display", "grid"), Xe("grid-template-columns", `repeat(${h}, minmax(0, 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Maximum ${h} per row · ${
|
|
8381
|
+
!he || !D || (Xe("display", "grid"), Xe("grid-template-columns", `repeat(${h}, minmax(0, 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Maximum ${h} per row · ${Ln(an)}`));
|
|
8376
8382
|
}, Io = (h) => {
|
|
8377
8383
|
if (!he || !D) return;
|
|
8378
8384
|
const y = Math.max(
|
|
@@ -8384,20 +8390,20 @@ function mc({
|
|
|
8384
8390
|
)
|
|
8385
8391
|
)
|
|
8386
8392
|
);
|
|
8387
|
-
Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${y}px, 100%), 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Automatic columns · minimum ${y}px · ${
|
|
8393
|
+
Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${y}px, 100%), 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Automatic columns · minimum ${y}px · ${Ln(an)}`);
|
|
8388
8394
|
}, Xi = (h, y) => {
|
|
8389
8395
|
if (!he) return;
|
|
8390
8396
|
const C = he.style.getPropertyValue(h), _ = h === "column-gap" ? ln : h === "row-gap" ? Er : It[h.replace("padding-", "")];
|
|
8391
8397
|
let L = _;
|
|
8392
|
-
const
|
|
8398
|
+
const ce = h === "column-gap" || h === "padding-left" || h === "padding-right", ue = h === "padding-right" || h === "padding-bottom" ? -1 : 1;
|
|
8393
8399
|
W(h), h.startsWith("padding-") && q(!1), No(
|
|
8394
8400
|
y,
|
|
8395
|
-
|
|
8401
|
+
ce ? "ew-resize" : "ns-resize",
|
|
8396
8402
|
(_e, ht) => {
|
|
8397
|
-
L = Math.max(0, Math.min(256, Math.round(_ + (
|
|
8403
|
+
L = Math.max(0, Math.min(256, Math.round(_ + (ce ? _e : ht) * ue))), he.style.setProperty(h, `${L}px`);
|
|
8398
8404
|
},
|
|
8399
8405
|
() => {
|
|
8400
|
-
|
|
8406
|
+
Tn(he, h, C), Xe(h, `${L}px`), W(null), X.toast(
|
|
8401
8407
|
`${h === "column-gap" ? "column spacing" : h === "row-gap" ? "row spacing" : h.replace("padding-", "padding")} ${L}px`
|
|
8402
8408
|
);
|
|
8403
8409
|
}
|
|
@@ -8405,33 +8411,33 @@ function mc({
|
|
|
8405
8411
|
}, Co = (h, y) => {
|
|
8406
8412
|
if (!he || !G) return;
|
|
8407
8413
|
const C = he.style.getPropertyValue("width"), _ = he.style.getPropertyValue("height");
|
|
8408
|
-
let L = Math.round(G.width),
|
|
8414
|
+
let L = Math.round(G.width), ce = Math.round(G.height);
|
|
8409
8415
|
No(
|
|
8410
8416
|
y,
|
|
8411
8417
|
h === "width" ? "ew-resize" : h === "height" ? "ns-resize" : "nwse-resize",
|
|
8412
8418
|
(ue, _e) => {
|
|
8413
|
-
h !== "height" && (L = Math.max(200, Math.min(1920, Math.round(G.width + ue))), he.style.setProperty("width", `${L}px`)), h !== "width" && (
|
|
8419
|
+
h !== "height" && (L = Math.max(200, Math.min(1920, Math.round(G.width + ue))), he.style.setProperty("width", `${L}px`)), h !== "width" && (ce = Math.max(80, Math.min(1600, Math.round(G.height + _e))), he.style.setProperty("height", `${ce}px`));
|
|
8414
8420
|
},
|
|
8415
8421
|
() => {
|
|
8416
|
-
|
|
8422
|
+
Tn(he, "width", C), Tn(he, "height", _), h !== "height" && Xe("width", `${L}px`), h !== "width" && Xe("height", `${ce}px`), X.toast(`container${L} × ${ce}px`);
|
|
8417
8423
|
}
|
|
8418
8424
|
);
|
|
8419
8425
|
}, _f = (h) => {
|
|
8420
8426
|
if (!he || !D) return;
|
|
8421
8427
|
const y = he.style.getPropertyValue("display"), C = he.style.getPropertyValue("grid-template-columns"), _ = D.style.getPropertyValue("min-width"), L = us(he, (te == null ? void 0 : te.width) ?? 240);
|
|
8422
|
-
let
|
|
8428
|
+
let ce = L;
|
|
8423
8429
|
No(
|
|
8424
8430
|
h,
|
|
8425
8431
|
"ew-resize",
|
|
8426
8432
|
(ue) => {
|
|
8427
8433
|
var _e;
|
|
8428
|
-
|
|
8434
|
+
ce = Math.max(80, Math.min(600, Math.round(L + ue))), he.style.setProperty("display", "grid"), he.style.setProperty(
|
|
8429
8435
|
"grid-template-columns",
|
|
8430
|
-
`repeat(auto-fit, minmax(min(${
|
|
8436
|
+
`repeat(auto-fit, minmax(min(${ce}px, 100%), 1fr))`
|
|
8431
8437
|
), D.style.setProperty("min-width", "0"), (_e = B.current) == null || _e.mirrorStyle(D, "min-width", "0");
|
|
8432
8438
|
},
|
|
8433
8439
|
() => {
|
|
8434
|
-
|
|
8440
|
+
Tn(he, "display", y), Tn(he, "grid-template-columns", C), Tn(D, "min-width", _), Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${ce}px, 100%), 1fr))`), rt("min-width", "0"), X.toast(`item minimum width${ce}px`);
|
|
8435
8441
|
}
|
|
8436
8442
|
);
|
|
8437
8443
|
}, Of = (h) => {
|
|
@@ -8441,12 +8447,12 @@ function mc({
|
|
|
8441
8447
|
No(
|
|
8442
8448
|
h,
|
|
8443
8449
|
"ns-resize",
|
|
8444
|
-
(L,
|
|
8450
|
+
(L, ce) => {
|
|
8445
8451
|
var ue;
|
|
8446
|
-
_ = Math.max(40, Math.min(1200, Math.round(C +
|
|
8452
|
+
_ = Math.max(40, Math.min(1200, Math.round(C + ce))), D.style.setProperty("height", `${_}px`), (ue = B.current) == null || ue.mirrorStyle(D, "height", `${_}px`);
|
|
8447
8453
|
},
|
|
8448
8454
|
() => {
|
|
8449
|
-
|
|
8455
|
+
Tn(D, "height", y), rt("height", `${_}px`), X.toast(`item height${_}px`);
|
|
8450
8456
|
}
|
|
8451
8457
|
);
|
|
8452
8458
|
}, $o = (h, y, C) => {
|
|
@@ -8478,25 +8484,25 @@ function mc({
|
|
|
8478
8484
|
"text-overflow": "ellipsis",
|
|
8479
8485
|
"overflow-wrap": "normal"
|
|
8480
8486
|
};
|
|
8481
|
-
for (const [L,
|
|
8487
|
+
for (const [L, ce] of Object.entries(C))
|
|
8482
8488
|
X.recordStyle(
|
|
8483
8489
|
y,
|
|
8484
8490
|
L,
|
|
8485
|
-
|
|
8491
|
+
ce,
|
|
8486
8492
|
Be(y),
|
|
8487
8493
|
an,
|
|
8488
8494
|
J.current
|
|
8489
|
-
), (_ = B.current) == null || _.mirrorStyle(y, L,
|
|
8495
|
+
), (_ = B.current) == null || _.mirrorStyle(y, L, ce);
|
|
8490
8496
|
X.toast(h === "wrap" ? "Change to multi-line content" : "Change to one line abbreviation");
|
|
8491
8497
|
}, Tr = m ? Px : $x, jf = u === "cases" && G && G.left + G.width > window.innerWidth - Tr - 32 || te && te.left + te.width / 2 > window.innerWidth / 2 ? 16 : Math.max(16, window.innerWidth - Tr - 16), Wf = Se ? 54 : 64, pl = Math.max(8, Math.min((x == null ? void 0 : x.x) ?? jf, window.innerWidth - Tr - 8)), ml = Math.max(8, Math.min((x == null ? void 0 : x.y) ?? Wf, window.innerHeight - 80)), Hf = (h) => {
|
|
8492
8498
|
if (h.button !== 0) return;
|
|
8493
8499
|
h.preventDefault();
|
|
8494
8500
|
const y = { x: h.clientX, y: h.clientY, left: pl, top: ml };
|
|
8495
8501
|
let C = { x: y.left, y: y.top };
|
|
8496
|
-
const _ = (
|
|
8502
|
+
const _ = (ce) => {
|
|
8497
8503
|
C = {
|
|
8498
|
-
x: Math.max(8, Math.min(y.left +
|
|
8499
|
-
y: Math.max(8, Math.min(y.top +
|
|
8504
|
+
x: Math.max(8, Math.min(y.left + ce.clientX - y.x, window.innerWidth - Tr - 8)),
|
|
8505
|
+
y: Math.max(8, Math.min(y.top + ce.clientY - y.y, window.innerHeight - 80))
|
|
8500
8506
|
}, w(C);
|
|
8501
8507
|
}, L = () => {
|
|
8502
8508
|
fc(C), window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", L);
|
|
@@ -8513,9 +8519,9 @@ function mc({
|
|
|
8513
8519
|
pointerEvents: "none"
|
|
8514
8520
|
}), rr = { lines: [], labels: [] };
|
|
8515
8521
|
if (wn) {
|
|
8516
|
-
const h = Et(wn[0].getBoundingClientRect()), y = Et(wn[1].getBoundingClientRect()), C = h.left + h.width, _ = h.top + h.height, L = y.left + y.width,
|
|
8522
|
+
const h = Et(wn[0].getBoundingClientRect()), y = Et(wn[1].getBoundingClientRect()), C = h.left + h.width, _ = h.top + h.height, L = y.left + y.width, ce = y.top + y.height, ue = C <= y.left ? { from: C, to: y.left } : L <= h.left ? { from: L, to: h.left } : null, _e = _ <= y.top ? { from: _, to: y.top } : ce <= h.top ? { from: ce, to: h.top } : null;
|
|
8517
8523
|
if (ue && ue.to - ue.from > 0.5) {
|
|
8518
|
-
const ht = ue.to - ue.from, Sn = Math.max(h.top, y.top), Nn = Math.min(_,
|
|
8524
|
+
const ht = ue.to - ue.from, Sn = Math.max(h.top, y.top), Nn = Math.min(_, ce), Fr = Nn > Sn ? (Sn + Nn) / 2 : (h.top + _ + y.top + ce) / 4;
|
|
8519
8525
|
rr.lines.push({ left: ue.from, top: Fr - 0.5, width: ht, height: 1 }), rr.labels.push({ x: ue.from + ht / 2, y: Fr, text: `${Math.round(ht)}px` });
|
|
8520
8526
|
}
|
|
8521
8527
|
if (_e && _e.to - _e.from > 0.5) {
|
|
@@ -8548,7 +8554,7 @@ function mc({
|
|
|
8548
8554
|
},
|
|
8549
8555
|
onDoubleClick: (h) => {
|
|
8550
8556
|
const y = qt(h);
|
|
8551
|
-
y && ds(y) &&
|
|
8557
|
+
y && ds(y) && En(y);
|
|
8552
8558
|
}
|
|
8553
8559
|
}
|
|
8554
8560
|
),
|
|
@@ -8608,7 +8614,7 @@ function mc({
|
|
|
8608
8614
|
))
|
|
8609
8615
|
] }),
|
|
8610
8616
|
zf && G && /* @__PURE__ */ g(Ue, { children: [
|
|
8611
|
-
/* @__PURE__ */ s("div", { style: Po(G,
|
|
8617
|
+
/* @__PURE__ */ s("div", { style: Po(G, Rn ? "#f24822" : "#9747ff", !0) }),
|
|
8612
8618
|
/* @__PURE__ */ g(
|
|
8613
8619
|
"div",
|
|
8614
8620
|
{
|
|
@@ -8619,10 +8625,10 @@ function mc({
|
|
|
8619
8625
|
pointerEvents: "none",
|
|
8620
8626
|
zIndex: 11
|
|
8621
8627
|
},
|
|
8622
|
-
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold text-white ${
|
|
8628
|
+
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold text-white ${Rn ? "bg-[#f24822]" : "bg-[#9747ff]"}`,
|
|
8623
8629
|
children: [
|
|
8624
8630
|
Nt ? `maximum${Nt}row/row` : `Automatic Placement Minimum${nr}px`,
|
|
8625
|
-
an && ` · ${
|
|
8631
|
+
an && ` · ${Ln(an)}`
|
|
8626
8632
|
]
|
|
8627
8633
|
}
|
|
8628
8634
|
),
|
|
@@ -9016,22 +9022,22 @@ function mc({
|
|
|
9016
9022
|
/* @__PURE__ */ s(Je, { title: "Case result", children: /* @__PURE__ */ g(
|
|
9017
9023
|
"div",
|
|
9018
9024
|
{
|
|
9019
|
-
className: `rounded-lg border px-3 py-2.5 ${
|
|
9025
|
+
className: `rounded-lg border px-3 py-2.5 ${Rn ? "border-[#fed7aa] bg-[#fff7ed]" : "border-[#bfdbfe] bg-[#eff6ff]"}`,
|
|
9020
9026
|
children: [
|
|
9021
9027
|
/* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
|
|
9022
|
-
/* @__PURE__ */ s("span", { className: `min-w-0 flex-1 text-[11px] font-semibold ${
|
|
9028
|
+
/* @__PURE__ */ s("span", { className: `min-w-0 flex-1 text-[11px] font-semibold ${Rn ? "text-[#c2410c]" : "text-[#1d4ed8]"}`, children: Df }),
|
|
9023
9029
|
/* @__PURE__ */ s(
|
|
9024
9030
|
"span",
|
|
9025
9031
|
{
|
|
9026
|
-
className: `shrink-0 rounded px-1.5 py-0.5 text-[9px] font-semibold ${
|
|
9027
|
-
children:
|
|
9032
|
+
className: `shrink-0 rounded px-1.5 py-0.5 text-[9px] font-semibold ${Rn ? "bg-[#ffedd5] text-[#c2410c]" : "bg-[#dcfce7] text-[#166534]"}`,
|
|
9033
|
+
children: Rn ? "Overflow" : "Layout valid"
|
|
9028
9034
|
}
|
|
9029
9035
|
)
|
|
9030
9036
|
] }),
|
|
9031
|
-
/* @__PURE__ */ g("div", { className: `mt-1 text-[9px] ${
|
|
9037
|
+
/* @__PURE__ */ g("div", { className: `mt-1 text-[9px] ${Rn ? "text-[#9a3412]" : "text-[#64748b]"}`, children: [
|
|
9032
9038
|
ul.length > 0 ? ul.join(" · ") : "Current data",
|
|
9033
9039
|
" · ",
|
|
9034
|
-
|
|
9040
|
+
Ln(an)
|
|
9035
9041
|
] })
|
|
9036
9042
|
]
|
|
9037
9043
|
}
|
|
@@ -9160,12 +9166,12 @@ function mc({
|
|
|
9160
9166
|
] })
|
|
9161
9167
|
}
|
|
9162
9168
|
),
|
|
9163
|
-
|
|
9169
|
+
kn.length > 0 && /* @__PURE__ */ s(Je, { title: "State preview", children: /* @__PURE__ */ s("div", { className: `grid gap-1 ${kn.length >= 3 ? "grid-cols-4" : "grid-cols-3"}`, children: [
|
|
9164
9170
|
["default", "Default"],
|
|
9165
9171
|
["selected", "Selected"],
|
|
9166
9172
|
["disabled", "Disabled"],
|
|
9167
9173
|
["loading", "Loading"]
|
|
9168
|
-
].filter(([h]) => h === "default" ||
|
|
9174
|
+
].filter(([h]) => h === "default" || kn.includes(h)).map(([h, y]) => /* @__PURE__ */ s(
|
|
9169
9175
|
"button",
|
|
9170
9176
|
{
|
|
9171
9177
|
type: "button",
|
|
@@ -9180,7 +9186,7 @@ function mc({
|
|
|
9180
9186
|
Je,
|
|
9181
9187
|
{
|
|
9182
9188
|
title: "Screen scope · Breakpoint",
|
|
9183
|
-
action: /* @__PURE__ */ s("span", { className: "text-[10px] tabular-nums text-[#71717a]", children:
|
|
9189
|
+
action: /* @__PURE__ */ s("span", { className: "text-[10px] tabular-nums text-[#71717a]", children: Ln(an) }),
|
|
9184
9190
|
children: [
|
|
9185
9191
|
/* @__PURE__ */ g("div", { className: "grid grid-cols-5 gap-1", children: [
|
|
9186
9192
|
uc.map((h) => /* @__PURE__ */ s(
|
|
@@ -9801,7 +9807,7 @@ function mc({
|
|
|
9801
9807
|
"input",
|
|
9802
9808
|
{
|
|
9803
9809
|
type: "search",
|
|
9804
|
-
value:
|
|
9810
|
+
value: de,
|
|
9805
9811
|
placeholder: "Search for component name or import path",
|
|
9806
9812
|
"aria-label": "Search for component to insert",
|
|
9807
9813
|
className: "h-8 w-full rounded-md bg-[#f4f4f5] px-2 text-[10px] text-[#18181b] outline-none placeholder:text-[#a1a1aa] focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
|
|
@@ -9952,7 +9958,7 @@ function mc({
|
|
|
9952
9958
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: bo.map(([h, y]) => {
|
|
9953
9959
|
const C = go.find(
|
|
9954
9960
|
(ue) => ue.kind === "prop" && ue.el === D && ue.prop === h
|
|
9955
|
-
), _ = C ? typeof y == "boolean" ? C.to === "true" : typeof y == "number" ? Number(C.to) : C.to : y, L = Eh(D, h),
|
|
9961
|
+
), _ = C ? typeof y == "boolean" ? C.to === "true" : typeof y == "number" ? Number(C.to) : C.to : y, L = Eh(D, h), ce = (ue) => {
|
|
9956
9962
|
const _e = typeof y == "number" ? Number(ue) : ue;
|
|
9957
9963
|
typeof _e == "number" && !Number.isFinite(_e) || _e !== _ && X.recordProp(
|
|
9958
9964
|
D,
|
|
@@ -10000,9 +10006,9 @@ function mc({
|
|
|
10000
10006
|
defaultValue: String(_),
|
|
10001
10007
|
className: "h-7 min-w-0 rounded-md bg-[#f4f4f5] px-2 text-[11px] text-[#18181b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff] disabled:text-[#a1a1aa]",
|
|
10002
10008
|
onKeyDown: (ue) => {
|
|
10003
|
-
ue.key === "Enter" && (
|
|
10009
|
+
ue.key === "Enter" && (ce(ue.currentTarget.value), ue.currentTarget.blur());
|
|
10004
10010
|
},
|
|
10005
|
-
onBlur: (ue) =>
|
|
10011
|
+
onBlur: (ue) => ce(ue.currentTarget.value)
|
|
10006
10012
|
},
|
|
10007
10013
|
`${Q}-prop-${h}`
|
|
10008
10014
|
),
|
|
@@ -10104,10 +10110,10 @@ function mc({
|
|
|
10104
10110
|
"button",
|
|
10105
10111
|
{
|
|
10106
10112
|
type: "button",
|
|
10107
|
-
disabled: xo === 0 || V ||
|
|
10113
|
+
disabled: xo === 0 || V || le,
|
|
10108
10114
|
className: "mt-1.5 h-8 w-full rounded-md border border-[#c4b5fd] bg-[#faf5ff] text-[10px] font-semibold text-[#6d28d9] hover:bg-[#f3e8ff] disabled:border-[#e4e4e7] disabled:bg-[#f4f4f5] disabled:text-[#a1a1aa]",
|
|
10109
10115
|
onClick: () => void Zn(),
|
|
10110
|
-
children: V ? "Generating code diff…" :
|
|
10116
|
+
children: V ? "Generating code diff…" : le ? "Calculating impact screen…" : Wi ? "Check code diff" : `Code diff confirmed · r${(ie == null ? void 0 : ie.revision) ?? "—"}`
|
|
10111
10117
|
}
|
|
10112
10118
|
) : /* @__PURE__ */ s("p", { className: "mt-1.5 rounded bg-[#f4f4f5] px-2 py-1 text-[9px] text-[#71717a]", children: "There is no diff callback, so it works in the traditional apply manner." }),
|
|
10113
10119
|
/* @__PURE__ */ s("p", { className: "mt-1.5 text-[9px] leading-relaxed text-[#71717a]", children: yo ? "You must check the code diff of the current payload to apply it. As changes are added, existing diffs become outdated." : "Only one final change remains per element, attribute, or breakpoint, and intermediate operations are stored only in Undo/Redo memory." }),
|
|
@@ -10155,11 +10161,11 @@ function mc({
|
|
|
10155
10161
|
),
|
|
10156
10162
|
children: /* @__PURE__ */ g("div", { className: "flex flex-col gap-1.5", children: [
|
|
10157
10163
|
ot.frames.map((h) => {
|
|
10158
|
-
var L,
|
|
10164
|
+
var L, ce;
|
|
10159
10165
|
const y = h.domChanged === !0, C = h.screenshotChanged === !0, _ = [
|
|
10160
10166
|
["Before change", h.before.screenshotUrl],
|
|
10161
10167
|
["After change", (L = h.after) == null ? void 0 : L.screenshotUrl],
|
|
10162
|
-
["Diff", ((
|
|
10168
|
+
["Diff", ((ce = h.pixelDiff) == null ? void 0 : ce.heatmapUrl) ?? void 0]
|
|
10163
10169
|
].filter((ue) => typeof ue[1] == "string");
|
|
10164
10170
|
return /* @__PURE__ */ g(
|
|
10165
10171
|
"div",
|
|
@@ -10264,7 +10270,7 @@ function mc({
|
|
|
10264
10270
|
] }),
|
|
10265
10271
|
h.media && /* @__PURE__ */ g("div", { className: "mt-0.5 text-[9px] font-semibold text-[#7c3aed]", children: [
|
|
10266
10272
|
"@media ",
|
|
10267
|
-
|
|
10273
|
+
Ln(h.media)
|
|
10268
10274
|
] }),
|
|
10269
10275
|
/* @__PURE__ */ s("div", { className: "mt-1 flex flex-col gap-0.5 font-mono text-[10px] text-[#52525b]", children: Object.entries(h.declarations).map(([_, L]) => /* @__PURE__ */ g("div", { className: "truncate", children: [
|
|
10270
10276
|
_,
|
|
@@ -10327,7 +10333,7 @@ function mc({
|
|
|
10327
10333
|
`${h.kind}-${h.identity.componentFile}-${h.identity.sourceStart}-${y.prop}`
|
|
10328
10334
|
);
|
|
10329
10335
|
}),
|
|
10330
|
-
sn.operations.some((h) => h.scope === "shared-source") && /* @__PURE__ */ s("p", { className: "text-[9px] leading-relaxed text-[#71717a]", children:
|
|
10336
|
+
sn.operations.some((h) => h.scope === "shared-source") && /* @__PURE__ */ s("p", { className: "text-[9px] leading-relaxed text-[#71717a]", children: le ? "Calculating every screen affected by the shared source." : "Affected screens are derived from the source dependency graph." })
|
|
10331
10337
|
] }) : /* @__PURE__ */ s("div", { className: "text-[11px] leading-relaxed text-[#a1a1aa]", children: "No changes can be saved yet. Items that only changed the screen are identified in the final changes below." }) }),
|
|
10332
10338
|
/* @__PURE__ */ s(Je, { title: "Recent changes", children: Gt.length > 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [...Gt].reverse().map((h) => {
|
|
10333
10339
|
const y = h.items.some(Qi), C = h.items.some((_) => !Qi(_));
|
|
@@ -10348,7 +10354,7 @@ function mc({
|
|
|
10348
10354
|
/* @__PURE__ */ s("b", { children: _.to })
|
|
10349
10355
|
] }),
|
|
10350
10356
|
_.token && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#ede9fe] px-1 text-[8px] font-semibold text-[#6d28d9]", children: "token" }),
|
|
10351
|
-
_.media && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#f3e8ff] px-1 text-[8px] font-semibold text-[#7c3aed]", children:
|
|
10357
|
+
_.media && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#f3e8ff] px-1 text-[8px] font-semibold text-[#7c3aed]", children: Ln(_.media) }),
|
|
10352
10358
|
_.sourceScope && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#ede9fe] px-1 text-[8px] font-semibold text-[#6d28d9]", children: _.sourceScope === "instance" ? "This screen" : "Shared source" })
|
|
10353
10359
|
] }, _.id)) })
|
|
10354
10360
|
] }, h.id);
|
|
@@ -10448,7 +10454,7 @@ const Wx = We(function({ onClose: t }) {
|
|
|
10448
10454
|
if (se(() => X.reset(), []), r.route != null) {
|
|
10449
10455
|
const c = () => {
|
|
10450
10456
|
if (!o.current) return;
|
|
10451
|
-
const d =
|
|
10457
|
+
const d = Kn(), u = d ? d.captureIframe(o.current) : Ah(o.current, {
|
|
10452
10458
|
resolveInstance: fa(Ze()),
|
|
10453
10459
|
instanceMode: "expand",
|
|
10454
10460
|
mediaMode: "layers",
|
|
@@ -10693,7 +10699,7 @@ function Vx({
|
|
|
10693
10699
|
}
|
|
10694
10700
|
);
|
|
10695
10701
|
}
|
|
10696
|
-
const
|
|
10702
|
+
const Bn = "View only — switch to Editing to change this.", xc = /* @__PURE__ */ new Set([
|
|
10697
10703
|
"Delete",
|
|
10698
10704
|
"Backspace",
|
|
10699
10705
|
"Enter",
|
|
@@ -11394,7 +11400,7 @@ function dy({
|
|
|
11394
11400
|
onFrameFocus: e = (t) => f.selectFrame(t)
|
|
11395
11401
|
}) {
|
|
11396
11402
|
var x;
|
|
11397
|
-
const t =
|
|
11403
|
+
const t = Kn(), [n, r] = Y(t ? "atoms" : "components"), [o, i] = Y(""), a = o.trim().toLowerCase(), l = (t == null ? void 0 : t.getAssets(n).filter(
|
|
11398
11404
|
(w) => {
|
|
11399
11405
|
var v, S, $, R;
|
|
11400
11406
|
return !a || w.name.toLowerCase().includes(a) || ((v = w.codeName) == null ? void 0 : v.toLowerCase().includes(a)) || ((S = w.sourcePath) == null ? void 0 : S.toLowerCase().includes(a)) || (($ = w.scenarioId) == null ? void 0 : $.toLowerCase().includes(a)) || ((R = w.description) == null ? void 0 : R.toLowerCase().includes(a));
|
|
@@ -11464,7 +11470,7 @@ function uy({
|
|
|
11464
11470
|
Md,
|
|
11465
11471
|
Ls,
|
|
11466
11472
|
Ls
|
|
11467
|
-
), o = e ? n.filter((l) =>
|
|
11473
|
+
), o = e ? n.filter((l) => Jn(l)).length : 0, i = e ? n.filter((l) => Ei(l)).length : 0, a = t && i === n.length;
|
|
11468
11474
|
return /* @__PURE__ */ s(
|
|
11469
11475
|
"div",
|
|
11470
11476
|
{
|
|
@@ -11482,7 +11488,7 @@ const fy = "pygmalion.design-ir", hy = 1, py = {
|
|
|
11482
11488
|
maxNodes: 1e4,
|
|
11483
11489
|
maxDepth: 64,
|
|
11484
11490
|
maxOutputBytes: 2 * 1024 * 1024
|
|
11485
|
-
},
|
|
11491
|
+
}, Hn = /* @__PURE__ */ new Map();
|
|
11486
11492
|
function nf(e) {
|
|
11487
11493
|
if (!e || typeof e != "object" || Object.isFrozen(e))
|
|
11488
11494
|
return e;
|
|
@@ -11669,13 +11675,13 @@ function vy(e) {
|
|
|
11669
11675
|
throw new Error("Design codegen adapters require an id, label, and language.");
|
|
11670
11676
|
if (!/^[-a-z0-9]+$/i.test(t))
|
|
11671
11677
|
throw new Error(`Design codegen adapter id "${t}" is invalid.`);
|
|
11672
|
-
const n =
|
|
11673
|
-
return
|
|
11674
|
-
|
|
11678
|
+
const n = Hn.get(t), r = { ...e, id: t };
|
|
11679
|
+
return Hn.set(t, r), () => {
|
|
11680
|
+
Hn.get(t) === r && (n ? Hn.set(t, n) : Hn.delete(t));
|
|
11675
11681
|
};
|
|
11676
11682
|
}
|
|
11677
11683
|
function wy() {
|
|
11678
|
-
return [...
|
|
11684
|
+
return [...Hn.values()].sort(
|
|
11679
11685
|
(e, t) => e.label.localeCompare(t.label)
|
|
11680
11686
|
);
|
|
11681
11687
|
}
|
|
@@ -11683,7 +11689,7 @@ function Sy(e, t = {}) {
|
|
|
11683
11689
|
const n = t.target ?? "jsx-tailwind", r = t.purpose ?? "export", o = yy(t.limits), i = rf(
|
|
11684
11690
|
e,
|
|
11685
11691
|
t.frame
|
|
11686
|
-
), { document: a } = i, l = [...i.diagnostics], c =
|
|
11692
|
+
), { document: a } = i, l = [...i.diagnostics], c = Hn.get(n);
|
|
11687
11693
|
if (c || l.push({
|
|
11688
11694
|
severity: "error",
|
|
11689
11695
|
stage: "generate",
|
|
@@ -12114,7 +12120,7 @@ function Ly(e) {
|
|
|
12114
12120
|
n.warnings.length > 0 && t.add(n.frameId);
|
|
12115
12121
|
return t;
|
|
12116
12122
|
}
|
|
12117
|
-
function
|
|
12123
|
+
function Dn(e) {
|
|
12118
12124
|
return [...new Set([...e].filter(Boolean))].sort(
|
|
12119
12125
|
(t, n) => t.localeCompare(n)
|
|
12120
12126
|
);
|
|
@@ -12149,7 +12155,7 @@ function af(e, t) {
|
|
|
12149
12155
|
const u = /* @__PURE__ */ new Map();
|
|
12150
12156
|
for (const M of e.sourceGroups) {
|
|
12151
12157
|
if (!M.shared) continue;
|
|
12152
|
-
const W =
|
|
12158
|
+
const W = Dn(
|
|
12153
12159
|
M.nodeIds.flatMap(
|
|
12154
12160
|
(ee) => (a.get(ee) ?? []).map((q) => q.frameId)
|
|
12155
12161
|
)
|
|
@@ -12232,10 +12238,10 @@ function af(e, t) {
|
|
|
12232
12238
|
aliasScreenIds: ee.screenIds.filter(
|
|
12233
12239
|
(ne) => ne !== ee.canonicalScreenId
|
|
12234
12240
|
),
|
|
12235
|
-
relatedFrameIds:
|
|
12241
|
+
relatedFrameIds: Dn(
|
|
12236
12242
|
u.get(W) ?? []
|
|
12237
12243
|
).filter((ne) => ne !== M.frameId),
|
|
12238
|
-
branchTargetFrameIds:
|
|
12244
|
+
branchTargetFrameIds: Dn(
|
|
12239
12245
|
[...b.get(W) ?? []].map(
|
|
12240
12246
|
(ne) => {
|
|
12241
12247
|
var ie;
|
|
@@ -12261,7 +12267,7 @@ function af(e, t) {
|
|
|
12261
12267
|
aliasScreenIds: M.screenIds.filter(
|
|
12262
12268
|
(ee) => ee !== M.canonicalScreenId
|
|
12263
12269
|
),
|
|
12264
|
-
aliasFrameIds:
|
|
12270
|
+
aliasFrameIds: Dn(
|
|
12265
12271
|
M.screenIds.filter((ee) => ee !== M.canonicalScreenId).map((ee) => {
|
|
12266
12272
|
var q;
|
|
12267
12273
|
return (q = i.get(ee)) == null ? void 0 : q.frameId;
|
|
@@ -12271,21 +12277,21 @@ function af(e, t) {
|
|
|
12271
12277
|
}).sort((M, W) => M.nodeId.localeCompare(W.nodeId)), N = e.sourceGroups.filter((M) => M.shared).map((M) => ({
|
|
12272
12278
|
sourceKey: M.sourceKey,
|
|
12273
12279
|
nodeIds: M.nodeIds,
|
|
12274
|
-
frameIds:
|
|
12280
|
+
frameIds: Dn(
|
|
12275
12281
|
M.nodeIds.flatMap(
|
|
12276
12282
|
(W) => (a.get(W) ?? []).map((ee) => ee.frameId)
|
|
12277
12283
|
)
|
|
12278
12284
|
)
|
|
12279
12285
|
})).sort((M, W) => M.sourceKey.localeCompare(W.sourceKey)), T = new Set(
|
|
12280
12286
|
H.flatMap((M) => M.warnings)
|
|
12281
|
-
), j =
|
|
12287
|
+
), j = Dn(
|
|
12282
12288
|
e.startNodeIds.map(
|
|
12283
12289
|
(M) => {
|
|
12284
12290
|
var W;
|
|
12285
12291
|
return (W = c.get(M)) == null ? void 0 : W.frameId;
|
|
12286
12292
|
}
|
|
12287
12293
|
)
|
|
12288
|
-
), k =
|
|
12294
|
+
), k = Dn(
|
|
12289
12295
|
e.branches.map(
|
|
12290
12296
|
(M) => {
|
|
12291
12297
|
var W;
|
|
@@ -13624,7 +13630,7 @@ const ov = We(function({
|
|
|
13624
13630
|
"data-coverage-claim": r.scenarioId,
|
|
13625
13631
|
"data-coverage-kind": r.kind,
|
|
13626
13632
|
disabled: o,
|
|
13627
|
-
title: o ?
|
|
13633
|
+
title: o ? Bn : r.reason ?? Mc(r),
|
|
13628
13634
|
className: "flex h-7 items-center justify-between gap-2 rounded-md bg-[#fafafa] px-2 text-left ring-1 ring-inset ring-[#ececec] hover:bg-[#f0f7ff] disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:bg-[#fafafa]",
|
|
13629
13635
|
onClick: () => {
|
|
13630
13636
|
Gy(r);
|
|
@@ -15064,7 +15070,7 @@ function Lv(e, t = {}) {
|
|
|
15064
15070
|
return { run: w, cancel: v };
|
|
15065
15071
|
}
|
|
15066
15072
|
const Lc = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", Dv = 600, dn = 200, en = 280, zv = 480, ps = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", Vr = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
|
|
15067
|
-
function
|
|
15073
|
+
function zn({
|
|
15068
15074
|
icon: e,
|
|
15069
15075
|
label: t,
|
|
15070
15076
|
shortcut: n,
|
|
@@ -15101,8 +15107,8 @@ const _v = We(function({
|
|
|
15101
15107
|
se(() => i, []);
|
|
15102
15108
|
const a = Qe(
|
|
15103
15109
|
Uc,
|
|
15104
|
-
|
|
15105
|
-
|
|
15110
|
+
Xn,
|
|
15111
|
+
Xn
|
|
15106
15112
|
), l = Qe(
|
|
15107
15113
|
ha,
|
|
15108
15114
|
bn,
|
|
@@ -15132,10 +15138,10 @@ const _v = We(function({
|
|
|
15132
15138
|
y: F.y ?? 0,
|
|
15133
15139
|
width: F.width ?? 390,
|
|
15134
15140
|
height: fn(F)
|
|
15135
|
-
})) : [], m = f.pages.filter((F) => F.route != null).sort((F,
|
|
15141
|
+
})) : [], m = f.pages.filter((F) => F.route != null).sort((F, de) => {
|
|
15136
15142
|
if (F.id === f.activePageId) return -1;
|
|
15137
|
-
if (
|
|
15138
|
-
const re = (F.canvas ?? "default") === f.activeCanvas, Ee = (
|
|
15143
|
+
if (de.id === f.activePageId) return 1;
|
|
15144
|
+
const re = (F.canvas ?? "default") === f.activeCanvas, Ee = (de.canvas ?? "default") === f.activeCanvas;
|
|
15139
15145
|
return re !== Ee ? re ? -1 : 1 : 0;
|
|
15140
15146
|
}), b = m.map((F) => jt(F, a)), x = [
|
|
15141
15147
|
...new Set(
|
|
@@ -15166,9 +15172,9 @@ const _v = We(function({
|
|
|
15166
15172
|
se(() => {
|
|
15167
15173
|
var Oe;
|
|
15168
15174
|
if (!t || !$ || typeof document > "u") return;
|
|
15169
|
-
const F =
|
|
15175
|
+
const F = Kn();
|
|
15170
15176
|
if (!F) return;
|
|
15171
|
-
const
|
|
15177
|
+
const de = Xt(), re = n.current, Ee = re ? {
|
|
15172
15178
|
panX: f.panX,
|
|
15173
15179
|
panY: f.panY,
|
|
15174
15180
|
zoom: f.zoom,
|
|
@@ -15189,7 +15195,7 @@ const _v = We(function({
|
|
|
15189
15195
|
assertions: B.assertions
|
|
15190
15196
|
},
|
|
15191
15197
|
a,
|
|
15192
|
-
|
|
15198
|
+
de
|
|
15193
15199
|
);
|
|
15194
15200
|
ve.push({
|
|
15195
15201
|
pageId: B.id,
|
|
@@ -15214,7 +15220,7 @@ const _v = We(function({
|
|
|
15214
15220
|
});
|
|
15215
15221
|
}
|
|
15216
15222
|
const we = Ev(ve, {
|
|
15217
|
-
hasSnapshot:
|
|
15223
|
+
hasSnapshot: Jn
|
|
15218
15224
|
}), Q = Ha(), ge = Lv({
|
|
15219
15225
|
leaseInstance: async (B) => {
|
|
15220
15226
|
const K = O.get(B.pageId);
|
|
@@ -15223,7 +15229,7 @@ const _v = We(function({
|
|
|
15223
15229
|
l,
|
|
15224
15230
|
K.route,
|
|
15225
15231
|
Lt(
|
|
15226
|
-
|
|
15232
|
+
de,
|
|
15227
15233
|
gn(K)
|
|
15228
15234
|
)
|
|
15229
15235
|
);
|
|
@@ -15301,7 +15307,7 @@ const _v = We(function({
|
|
|
15301
15307
|
const B = f.pages.find(
|
|
15302
15308
|
(K) => K.id === f.activePageId
|
|
15303
15309
|
);
|
|
15304
|
-
return !B || B.route == null ? !1 : B.importLayers && !B.layersImported ? !0 : !B.layersImported && !
|
|
15310
|
+
return !B || B.route == null ? !1 : B.importLayers && !B.layersImported ? !0 : !B.layersImported && !Jn(
|
|
15305
15311
|
jt(B, a)
|
|
15306
15312
|
);
|
|
15307
15313
|
}
|
|
@@ -15332,10 +15338,10 @@ const _v = We(function({
|
|
|
15332
15338
|
se(() => {
|
|
15333
15339
|
if (!t || !$) return;
|
|
15334
15340
|
const F = setTimeout(() => {
|
|
15335
|
-
const
|
|
15341
|
+
const de = f.pages.find(
|
|
15336
15342
|
(re) => re.id === N
|
|
15337
15343
|
);
|
|
15338
|
-
|
|
15344
|
+
de && au(de, a);
|
|
15339
15345
|
}, Dv);
|
|
15340
15346
|
return () => clearTimeout(F);
|
|
15341
15347
|
}, [
|
|
@@ -15346,9 +15352,9 @@ const _v = We(function({
|
|
|
15346
15352
|
]);
|
|
15347
15353
|
const [T, j] = Y(!1), [k, z] = Y(null), [Z, M] = Y("layers"), [W, ee] = Y("story"), [q, Me] = Y(null), oe = Object.keys(Ze()), fe = f.canAddFrame, ne = f.editMode, ie = (F) => {
|
|
15348
15354
|
f.setTool(F), Me(null);
|
|
15349
|
-
}, [P, E] = Y(!0), [I, V] = Y(!0), [ae, xe] = Y(en), [Re,
|
|
15350
|
-
const
|
|
15351
|
-
if (!
|
|
15355
|
+
}, [P, E] = Y(!0), [I, V] = Y(!0), [ae, xe] = Y(en), [Re, le] = Y(en), Le = Ie(!1), De = (F) => {
|
|
15356
|
+
const de = f.pages.find((we) => we.id === F), re = n.current;
|
|
15357
|
+
if (!de || !re) {
|
|
15352
15358
|
f.selectFrame(F);
|
|
15353
15359
|
return;
|
|
15354
15360
|
}
|
|
@@ -15360,11 +15366,11 @@ const _v = We(function({
|
|
|
15360
15366
|
insetTop: 12,
|
|
15361
15367
|
insetBottom: 64
|
|
15362
15368
|
}, O = {
|
|
15363
|
-
x:
|
|
15364
|
-
y:
|
|
15365
|
-
width:
|
|
15366
|
-
height: fn(
|
|
15367
|
-
}, ve = (
|
|
15369
|
+
x: de.x ?? 0,
|
|
15370
|
+
y: de.y ?? 0,
|
|
15371
|
+
width: de.width ?? 390,
|
|
15372
|
+
height: fn(de)
|
|
15373
|
+
}, ve = (de.canvas ?? "default") === f.activeCanvas ? Uh(O, Ee, {
|
|
15368
15374
|
panX: f.panX,
|
|
15369
15375
|
panY: f.panY,
|
|
15370
15376
|
zoom: f.zoom
|
|
@@ -15377,7 +15383,7 @@ const _v = We(function({
|
|
|
15377
15383
|
se(() => {
|
|
15378
15384
|
const F = n.current;
|
|
15379
15385
|
if (!F) return;
|
|
15380
|
-
const
|
|
15386
|
+
const de = (re) => {
|
|
15381
15387
|
const Ee = ey(re);
|
|
15382
15388
|
if (Ee !== "native-preview") {
|
|
15383
15389
|
if (Ee === "programmatic-preview") {
|
|
@@ -15391,7 +15397,7 @@ const _v = We(function({
|
|
|
15391
15397
|
f.panBy(-re.deltaX, -re.deltaY);
|
|
15392
15398
|
}
|
|
15393
15399
|
};
|
|
15394
|
-
return F.addEventListener("wheel",
|
|
15400
|
+
return F.addEventListener("wheel", de, { passive: !1 }), () => F.removeEventListener("wheel", de);
|
|
15395
15401
|
}, []), se(() => {
|
|
15396
15402
|
const F = () => {
|
|
15397
15403
|
const O = n.current;
|
|
@@ -15402,7 +15408,7 @@ const _v = We(function({
|
|
|
15402
15408
|
if (!ve.length) return;
|
|
15403
15409
|
const we = Math.min(...ve.map((J) => J.x ?? 0)), Q = Math.min(...ve.map((J) => J.y ?? 0)), ge = Math.max(...ve.map((J) => (J.x ?? 0) + (J.width ?? 390))), Oe = Math.max(...ve.map((J) => (J.y ?? 0) + (J.height ?? 600))), B = ge - we, K = Oe - Q, ke = Math.max(0.25, Math.min((O.clientWidth - 120) / B, (O.clientHeight - 200) / K, 1.5));
|
|
15404
15410
|
f.setZoom(ke), f.setPan((O.clientWidth - B * ke) / 2 - we * ke, (O.clientHeight - K * ke) / 2 - Q * ke);
|
|
15405
|
-
},
|
|
15411
|
+
}, de = () => {
|
|
15406
15412
|
const O = n.current;
|
|
15407
15413
|
if (!O) return;
|
|
15408
15414
|
const ve = f.activePage, we = ve.width ?? 390, Q = ve.height ?? 600, ge = Math.max(0.25, Math.min((O.clientWidth - 560) / we, (O.clientHeight - 140) / Q));
|
|
@@ -15498,7 +15504,7 @@ const _v = We(function({
|
|
|
15498
15504
|
return;
|
|
15499
15505
|
}
|
|
15500
15506
|
if (O.code === "Digit2") {
|
|
15501
|
-
|
|
15507
|
+
de();
|
|
15502
15508
|
return;
|
|
15503
15509
|
}
|
|
15504
15510
|
if (O.key === "Tab") {
|
|
@@ -15586,14 +15592,14 @@ const _v = We(function({
|
|
|
15586
15592
|
window.removeEventListener("keydown", re), window.removeEventListener("keyup", Ee);
|
|
15587
15593
|
};
|
|
15588
15594
|
}, [I]);
|
|
15589
|
-
const Ye = (F) => (
|
|
15590
|
-
|
|
15591
|
-
const re =
|
|
15595
|
+
const Ye = (F) => (de) => {
|
|
15596
|
+
de.preventDefault();
|
|
15597
|
+
const re = de.clientX, Ee = F === "left" ? ae : Re, O = (we) => {
|
|
15592
15598
|
const Q = F === "left" ? we.clientX - re : re - we.clientX, ge = Math.max(
|
|
15593
15599
|
dn,
|
|
15594
15600
|
Math.min(zv, Ee + Q)
|
|
15595
15601
|
);
|
|
15596
|
-
F === "left" ? xe(ge) :
|
|
15602
|
+
F === "left" ? xe(ge) : le(ge);
|
|
15597
15603
|
}, ve = () => {
|
|
15598
15604
|
window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", ve);
|
|
15599
15605
|
};
|
|
@@ -15628,11 +15634,11 @@ const _v = We(function({
|
|
|
15628
15634
|
onPointerMove: (F) => {
|
|
15629
15635
|
var ve;
|
|
15630
15636
|
if (!Yx(f.editMode, f.tool)) return;
|
|
15631
|
-
const
|
|
15632
|
-
if (!
|
|
15637
|
+
const de = (ve = n.current) == null ? void 0 : ve.getBoundingClientRect();
|
|
15638
|
+
if (!de) return;
|
|
15633
15639
|
const re = vc(
|
|
15634
15640
|
p,
|
|
15635
|
-
yc(F,
|
|
15641
|
+
yc(F, de, {
|
|
15636
15642
|
panX: f.panX,
|
|
15637
15643
|
panY: f.panY,
|
|
15638
15644
|
zoom: f.zoom
|
|
@@ -15669,8 +15675,8 @@ const _v = We(function({
|
|
|
15669
15675
|
onMouseDown: (F) => {
|
|
15670
15676
|
var we;
|
|
15671
15677
|
if (T || F.button !== 0) return;
|
|
15672
|
-
const
|
|
15673
|
-
if ((F.metaKey || F.ctrlKey) &&
|
|
15678
|
+
const de = n.current;
|
|
15679
|
+
if ((F.metaKey || F.ctrlKey) && de) {
|
|
15674
15680
|
const Q = { x: F.clientX, y: F.clientY, px: f.panX, py: f.panY }, ge = (B) => {
|
|
15675
15681
|
Le.current = !0, f.setPan(Q.px + (B.clientX - Q.x), Q.py + (B.clientY - Q.y));
|
|
15676
15682
|
}, Oe = () => {
|
|
@@ -15728,13 +15734,13 @@ const _v = We(function({
|
|
|
15728
15734
|
window.addEventListener("mousemove", O), window.addEventListener("mouseup", ve);
|
|
15729
15735
|
},
|
|
15730
15736
|
onClick: (F) => {
|
|
15731
|
-
var
|
|
15737
|
+
var de;
|
|
15732
15738
|
if (Le.current) {
|
|
15733
15739
|
Le.current = !1;
|
|
15734
15740
|
return;
|
|
15735
15741
|
}
|
|
15736
15742
|
if (!f.editMode) {
|
|
15737
|
-
const re = (
|
|
15743
|
+
const re = (de = n.current) == null ? void 0 : de.getBoundingClientRect(), Ee = re ? vc(
|
|
15738
15744
|
p,
|
|
15739
15745
|
yc(F, re, {
|
|
15740
15746
|
panX: f.panX,
|
|
@@ -15764,13 +15770,13 @@ const _v = We(function({
|
|
|
15764
15770
|
f.pages.filter(
|
|
15765
15771
|
(F) => (F.route != null || (F.canvas ?? "default") === f.activeCanvas) && f.isScreenStateShown(F)
|
|
15766
15772
|
).map((F) => {
|
|
15767
|
-
var
|
|
15773
|
+
var de;
|
|
15768
15774
|
return /* @__PURE__ */ s(
|
|
15769
15775
|
ex,
|
|
15770
15776
|
{
|
|
15771
15777
|
page: F,
|
|
15772
15778
|
active: F.id === f.activePageId,
|
|
15773
|
-
selected: ((
|
|
15779
|
+
selected: ((de = f.selectedCanvasObject) == null ? void 0 : de.kind) === "frame" && f.selectedCanvasObject.id === F.id,
|
|
15774
15780
|
cacheHydrated: $,
|
|
15775
15781
|
previewIdentityReady: t,
|
|
15776
15782
|
backgroundOnly: (F.canvas ?? "default") !== f.activeCanvas
|
|
@@ -15846,13 +15852,13 @@ const _v = We(function({
|
|
|
15846
15852
|
/* @__PURE__ */ s("div", { className: "mt-2 flex gap-3", children: [
|
|
15847
15853
|
["layers", "Layers"],
|
|
15848
15854
|
["assets", "Assets"]
|
|
15849
|
-
].map(([F,
|
|
15855
|
+
].map(([F, de]) => /* @__PURE__ */ s(
|
|
15850
15856
|
"button",
|
|
15851
15857
|
{
|
|
15852
15858
|
type: "button",
|
|
15853
15859
|
className: `border-b-2 pb-1.5 text-[11px] ${Z === F ? "border-[#0d99ff] font-semibold text-[#333]" : "border-transparent text-[#999] hover:text-[#333]"}`,
|
|
15854
15860
|
onClick: () => M(F),
|
|
15855
|
-
children:
|
|
15861
|
+
children: de
|
|
15856
15862
|
},
|
|
15857
15863
|
F
|
|
15858
15864
|
)) })
|
|
@@ -15906,7 +15912,7 @@ const _v = We(function({
|
|
|
15906
15912
|
{
|
|
15907
15913
|
type: "button",
|
|
15908
15914
|
"aria-pressed": !f.editMode,
|
|
15909
|
-
title: f.editMode ? "Editing — click to switch to view only" : `${
|
|
15915
|
+
title: f.editMode ? "Editing — click to switch to view only" : `${Bn} Click to start editing.`,
|
|
15910
15916
|
className: `flex h-7 items-center gap-1 rounded-lg px-3 text-[11px] ${f.editMode ? "bg-[#f5f5f5] text-[#333] hover:bg-[#ececec]" : "bg-amber-500 font-semibold text-white hover:bg-amber-600"}`,
|
|
15911
15917
|
onClick: () => f.toggleEditMode(),
|
|
15912
15918
|
children: [
|
|
@@ -15928,7 +15934,7 @@ const _v = We(function({
|
|
|
15928
15934
|
{
|
|
15929
15935
|
type: "button",
|
|
15930
15936
|
disabled: !f.editMode,
|
|
15931
|
-
title: f.editMode ? "Apply changes" :
|
|
15937
|
+
title: f.editMode ? "Apply changes" : Bn,
|
|
15932
15938
|
className: "h-7 rounded-lg bg-[#0d99ff] px-3 text-[11px] font-semibold text-white hover:bg-[#0b87e0] disabled:cursor-not-allowed disabled:bg-[#e6e6e6] disabled:text-[#999]",
|
|
15933
15939
|
onClick: () => f.setApplyOpen(!0),
|
|
15934
15940
|
children: "Apply"
|
|
@@ -15955,7 +15961,7 @@ const _v = We(function({
|
|
|
15955
15961
|
{
|
|
15956
15962
|
type: "button",
|
|
15957
15963
|
"aria-pressed": !f.editMode,
|
|
15958
|
-
title: f.editMode ? "Editing — click to switch to view only" : `${
|
|
15964
|
+
title: f.editMode ? "Editing — click to switch to view only" : `${Bn} Click to start editing.`,
|
|
15959
15965
|
className: `flex h-7 items-center gap-1 rounded-lg px-2.5 text-[11px] ${f.editMode ? "bg-[#f5f5f5] text-[#333] hover:bg-[#ececec]" : "bg-amber-500 font-semibold text-white hover:bg-amber-600"}`,
|
|
15960
15966
|
onClick: () => f.toggleEditMode(),
|
|
15961
15967
|
children: [
|
|
@@ -16000,7 +16006,7 @@ const _v = We(function({
|
|
|
16000
16006
|
{
|
|
16001
16007
|
type: "button",
|
|
16002
16008
|
disabled: !f.editMode,
|
|
16003
|
-
title: f.editMode ? "Apply changes" :
|
|
16009
|
+
title: f.editMode ? "Apply changes" : Bn,
|
|
16004
16010
|
className: "h-7 rounded-lg bg-[#0d99ff] px-3 text-[11px] font-semibold text-white hover:bg-[#0b87e0] disabled:cursor-not-allowed disabled:bg-[#e6e6e6] disabled:text-[#999]",
|
|
16005
16011
|
onClick: () => f.setApplyOpen(!0),
|
|
16006
16012
|
children: "Apply"
|
|
@@ -16019,7 +16025,7 @@ const _v = We(function({
|
|
|
16019
16025
|
"aria-pressed": Re === dn,
|
|
16020
16026
|
title: `Minimum panel width · ${dn}px`,
|
|
16021
16027
|
className: `flex h-5 w-5 items-center justify-center rounded text-[10px] ${Re === dn ? "bg-[#f2f2f2] text-[#333]" : "text-[#999] hover:bg-[#f5f5f5]"}`,
|
|
16022
|
-
onClick: () =>
|
|
16028
|
+
onClick: () => le(dn),
|
|
16023
16029
|
children: "−"
|
|
16024
16030
|
}
|
|
16025
16031
|
),
|
|
@@ -16031,7 +16037,7 @@ const _v = We(function({
|
|
|
16031
16037
|
"aria-pressed": Re === en,
|
|
16032
16038
|
title: `Default panel width · ${en}px`,
|
|
16033
16039
|
className: `flex h-5 w-5 items-center justify-center rounded text-[10px] ${Re === en ? "bg-[#f2f2f2] text-[#333]" : "text-[#999] hover:bg-[#f5f5f5]"}`,
|
|
16034
|
-
onClick: () =>
|
|
16040
|
+
onClick: () => le(en),
|
|
16035
16041
|
children: "↔"
|
|
16036
16042
|
}
|
|
16037
16043
|
),
|
|
@@ -16127,9 +16133,9 @@ const _v = We(function({
|
|
|
16127
16133
|
}
|
|
16128
16134
|
),
|
|
16129
16135
|
q === "cursor" && /* @__PURE__ */ g("div", { className: ps, children: [
|
|
16130
|
-
/* @__PURE__ */ s(
|
|
16131
|
-
/* @__PURE__ */ s(
|
|
16132
|
-
/* @__PURE__ */ s(
|
|
16136
|
+
/* @__PURE__ */ s(zn, { checked: f.tool === "select", icon: /* @__PURE__ */ s(Xl, { size: 14 }), label: "Move", shortcut: "V", onClick: () => ie("select") }),
|
|
16137
|
+
/* @__PURE__ */ s(zn, { checked: f.tool === "hand", icon: /* @__PURE__ */ s(Jl, { size: 14 }), label: "Hand", shortcut: "H", onClick: () => ie("hand") }),
|
|
16138
|
+
/* @__PURE__ */ s(zn, { checked: f.tool === "zoom", icon: /* @__PURE__ */ s(Ql, { size: 14 }), label: "Zoom in/out", shortcut: "K", onClick: () => ie("zoom") })
|
|
16133
16139
|
] })
|
|
16134
16140
|
] }),
|
|
16135
16141
|
/* @__PURE__ */ g("div", { className: "relative flex items-center", children: [
|
|
@@ -16156,7 +16162,7 @@ const _v = We(function({
|
|
|
16156
16162
|
),
|
|
16157
16163
|
q === "frame" && /* @__PURE__ */ g("div", { className: ps, children: [
|
|
16158
16164
|
/* @__PURE__ */ s(
|
|
16159
|
-
|
|
16165
|
+
zn,
|
|
16160
16166
|
{
|
|
16161
16167
|
icon: /* @__PURE__ */ s(Zs, { size: 14 }),
|
|
16162
16168
|
label: fe ? "Frame" : "Frame — screen canvas only",
|
|
@@ -16166,7 +16172,7 @@ const _v = We(function({
|
|
|
16166
16172
|
}
|
|
16167
16173
|
}
|
|
16168
16174
|
),
|
|
16169
|
-
/* @__PURE__ */ s(
|
|
16175
|
+
/* @__PURE__ */ s(zn, { checked: f.tool === "section", icon: /* @__PURE__ */ s(mi, { size: 14 }), label: "Section", shortcut: "⇧S", onClick: () => ie("section") })
|
|
16170
16176
|
] })
|
|
16171
16177
|
] }),
|
|
16172
16178
|
/* @__PURE__ */ s("span", { className: "mx-1 h-5 w-px bg-[#e6e6e6]" }),
|
|
@@ -16175,7 +16181,7 @@ const _v = We(function({
|
|
|
16175
16181
|
"button",
|
|
16176
16182
|
{
|
|
16177
16183
|
type: "button",
|
|
16178
|
-
title: ne ? "Add Rows (F)" :
|
|
16184
|
+
title: ne ? "Add Rows (F)" : Bn,
|
|
16179
16185
|
"aria-label": "Add Rows",
|
|
16180
16186
|
disabled: !ne,
|
|
16181
16187
|
className: `${Vr(!1)} disabled:cursor-not-allowed disabled:text-[#c9c9c9] disabled:hover:bg-transparent`,
|
|
@@ -16195,7 +16201,7 @@ const _v = We(function({
|
|
|
16195
16201
|
),
|
|
16196
16202
|
q === "layout" && /* @__PURE__ */ g("div", { className: ps, children: [
|
|
16197
16203
|
/* @__PURE__ */ s(
|
|
16198
|
-
|
|
16204
|
+
zn,
|
|
16199
16205
|
{
|
|
16200
16206
|
icon: /* @__PURE__ */ s(gi, { size: 14 }),
|
|
16201
16207
|
label: "Rows",
|
|
@@ -16207,7 +16213,7 @@ const _v = We(function({
|
|
|
16207
16213
|
}
|
|
16208
16214
|
),
|
|
16209
16215
|
/* @__PURE__ */ s(
|
|
16210
|
-
|
|
16216
|
+
zn,
|
|
16211
16217
|
{
|
|
16212
16218
|
icon: /* @__PURE__ */ s(Ya, { size: 14 }),
|
|
16213
16219
|
label: "Columns",
|
|
@@ -16223,7 +16229,7 @@ const _v = We(function({
|
|
|
16223
16229
|
"button",
|
|
16224
16230
|
{
|
|
16225
16231
|
type: "button",
|
|
16226
|
-
title: ne ? "Add Text (T)" :
|
|
16232
|
+
title: ne ? "Add Text (T)" : Bn,
|
|
16227
16233
|
"aria-label": "Add text",
|
|
16228
16234
|
disabled: !ne,
|
|
16229
16235
|
className: `${Vr(!1)} disabled:cursor-not-allowed disabled:text-[#c9c9c9] disabled:hover:bg-transparent`,
|
|
@@ -16570,7 +16576,7 @@ function Gv(e) {
|
|
|
16570
16576
|
S += 1;
|
|
16571
16577
|
const ae = b(I.from, V, "source"), xe = b(I.to, V, "target");
|
|
16572
16578
|
if (!ae || !xe || ae === xe) continue;
|
|
16573
|
-
const Re = d(I.fromScope, ae),
|
|
16579
|
+
const Re = d(I.fromScope, ae), le = d(I.toScope, xe), Le = `${ae}\0${xe}`, De = w.get(Le);
|
|
16574
16580
|
if (De) {
|
|
16575
16581
|
const ot = {
|
|
16576
16582
|
...De,
|
|
@@ -16580,7 +16586,7 @@ function Gv(e) {
|
|
|
16580
16586
|
]),
|
|
16581
16587
|
toNodeIds: ct([
|
|
16582
16588
|
...De.toNodeIds ?? [De.to],
|
|
16583
|
-
...
|
|
16589
|
+
...le
|
|
16584
16590
|
]),
|
|
16585
16591
|
sourceEdgeIds: ct([
|
|
16586
16592
|
...De.sourceEdgeIds,
|
|
@@ -16597,7 +16603,7 @@ function Gv(e) {
|
|
|
16597
16603
|
from: ae,
|
|
16598
16604
|
to: xe,
|
|
16599
16605
|
fromNodeIds: Re,
|
|
16600
|
-
toNodeIds:
|
|
16606
|
+
toNodeIds: le,
|
|
16601
16607
|
kind: ((ne = I.kind) == null ? void 0 : ne.trim()) || void 0,
|
|
16602
16608
|
label: ((ie = I.label) == null ? void 0 : ie.trim()) || void 0,
|
|
16603
16609
|
origin: P,
|
|
@@ -18098,9 +18104,9 @@ function s0(e = {}) {
|
|
|
18098
18104
|
} : {},
|
|
18099
18105
|
...I || xe ? {} : xs()
|
|
18100
18106
|
});
|
|
18101
|
-
let
|
|
18102
|
-
if (I || (
|
|
18103
|
-
initial:
|
|
18107
|
+
let le = await tn(Re);
|
|
18108
|
+
if (I || (le = await Pw({
|
|
18109
|
+
initial: le,
|
|
18104
18110
|
fetchStatus: async () => tn(
|
|
18105
18111
|
await o(`${a}/status`, xs())
|
|
18106
18112
|
),
|
|
@@ -18110,13 +18116,17 @@ function s0(e = {}) {
|
|
|
18110
18116
|
...xs(xf)
|
|
18111
18117
|
})
|
|
18112
18118
|
)
|
|
18113
|
-
})),
|
|
18114
|
-
|
|
18119
|
+
})), le.state === "idle" && !le.error) {
|
|
18120
|
+
w(le);
|
|
18121
|
+
return;
|
|
18122
|
+
}
|
|
18123
|
+
if (le.state !== "ready" || !le.appOrigin || !le.commit)
|
|
18124
|
+
throw new Error(le.error ?? "Pygmalion could not prepare the source preview");
|
|
18115
18125
|
const Le = await tn(
|
|
18116
18126
|
await o(`${l}/open`, {
|
|
18117
18127
|
method: "POST",
|
|
18118
18128
|
headers: { "content-type": "application/json" },
|
|
18119
|
-
body: JSON.stringify({ sessionId: b, baseDevSha:
|
|
18129
|
+
body: JSON.stringify({ sessionId: b, baseDevSha: le.commit })
|
|
18120
18130
|
})
|
|
18121
18131
|
);
|
|
18122
18132
|
if (!Le.ok || !Le.session)
|
|
@@ -18134,7 +18144,7 @@ function s0(e = {}) {
|
|
|
18134
18144
|
throw new Error(Ye.error ?? "Pygmalion could not check the design session");
|
|
18135
18145
|
De = Ye.session;
|
|
18136
18146
|
}
|
|
18137
|
-
w(
|
|
18147
|
+
w(le), S(De), R(De.appOrigin ?? le.appOrigin);
|
|
18138
18148
|
} catch (xe) {
|
|
18139
18149
|
w((Re) => ({
|
|
18140
18150
|
...Re,
|
|
@@ -18175,7 +18185,7 @@ function s0(e = {}) {
|
|
|
18175
18185
|
[k, j, v == null ? void 0 : v.branchName]
|
|
18176
18186
|
), Z = wt(
|
|
18177
18187
|
async (I) => {
|
|
18178
|
-
var
|
|
18188
|
+
var le;
|
|
18179
18189
|
if (!v) throw new Error("Pygmalion design session is not ready");
|
|
18180
18190
|
const V = T.current;
|
|
18181
18191
|
if (V && (V.sessionId !== v.id || V.baseDevSha !== v.baseDevSha || V.revision !== v.revision || V.fingerprint !== JSON.stringify(I)))
|
|
@@ -18198,7 +18208,7 @@ function s0(e = {}) {
|
|
|
18198
18208
|
S(ae.session), ae.session.appOrigin && R(ae.session.appOrigin);
|
|
18199
18209
|
const xe = ae.applied ?? I.styles.length + I.texts.length + I.operations.length;
|
|
18200
18210
|
let Re;
|
|
18201
|
-
if (V != null && V.qaBaselineId && ((
|
|
18211
|
+
if (V != null && V.qaBaselineId && ((le = V.qaFrameIds) != null && le.length) && ae.session.appOrigin)
|
|
18202
18212
|
try {
|
|
18203
18213
|
Re = await Hc(o, u, {
|
|
18204
18214
|
phase: "changed",
|
|
@@ -18227,7 +18237,7 @@ function s0(e = {}) {
|
|
|
18227
18237
|
[o, i, u, v, l]
|
|
18228
18238
|
), M = wt(
|
|
18229
18239
|
async (I) => {
|
|
18230
|
-
var
|
|
18240
|
+
var le;
|
|
18231
18241
|
if (!v) throw new Error("Pygmalion design session is not ready");
|
|
18232
18242
|
T.current = null;
|
|
18233
18243
|
const V = await tn(
|
|
@@ -18256,7 +18266,7 @@ function s0(e = {}) {
|
|
|
18256
18266
|
frameIds: ae
|
|
18257
18267
|
}), !xe.complete)
|
|
18258
18268
|
throw new Error(
|
|
18259
|
-
((
|
|
18269
|
+
((le = xe.failures[0]) == null ? void 0 : le.error) ?? `Failed to capture ${ae.length - xe.frames.length} affected frames`
|
|
18260
18270
|
);
|
|
18261
18271
|
}
|
|
18262
18272
|
return T.current = {
|
|
@@ -18623,15 +18633,15 @@ function f0({
|
|
|
18623
18633
|
V,
|
|
18624
18634
|
E
|
|
18625
18635
|
]
|
|
18626
|
-
), [xe, Re] = Y(null),
|
|
18627
|
-
yf =
|
|
18636
|
+
), [xe, Re] = Y(null), le = xe === ae;
|
|
18637
|
+
yf = le;
|
|
18628
18638
|
const [Le, De] = Y();
|
|
18629
18639
|
c && (c.assertComplete(), Jh(c));
|
|
18630
18640
|
const Ye = e ?? (c == null ? void 0 : c.getRegistry()), ot = t ?? (c == null ? void 0 : c.getTokens()), F = n ?? (c == null ? void 0 : c.getInitialPages());
|
|
18631
18641
|
Ye && Qh(Ye), nx(i ?? []), ot && xx(ot), Vy(a ?? []), yx(d ?? null), Dd(m), Ad(
|
|
18632
18642
|
!!(x != null && x.trim())
|
|
18633
18643
|
);
|
|
18634
|
-
const
|
|
18644
|
+
const de = Le ?? b, re = Ft(
|
|
18635
18645
|
() => (F ?? []).flatMap(
|
|
18636
18646
|
(K) => K.route && K.importPageId ? [
|
|
18637
18647
|
{
|
|
@@ -18647,7 +18657,7 @@ function f0({
|
|
|
18647
18657
|
] : []
|
|
18648
18658
|
),
|
|
18649
18659
|
[F]
|
|
18650
|
-
), Ee = p ??
|
|
18660
|
+
), Ee = p ?? Xn(), O = typeof (de == null ? void 0 : de.sourceRevision) == "string" ? de.sourceRevision : null, ve = O && Ee.startsWith("pending") ? Ee.replace(/^pending/, O) : Ee;
|
|
18651
18661
|
vf = ve;
|
|
18652
18662
|
const we = u ?? bn(), Q = Ie([]), ge = Ie([]), Oe = Ft(
|
|
18653
18663
|
() => re.map((K) => ({
|
|
@@ -18658,7 +18668,7 @@ function f0({
|
|
|
18658
18668
|
Xt()
|
|
18659
18669
|
)
|
|
18660
18670
|
})),
|
|
18661
|
-
[re, ve,
|
|
18671
|
+
[re, ve, le]
|
|
18662
18672
|
);
|
|
18663
18673
|
Q.current = Oe, ge.current = re.map(
|
|
18664
18674
|
(K) => ki({
|
|
@@ -18678,7 +18688,7 @@ function f0({
|
|
|
18678
18688
|
), w != null && Bd(w), up(S ?? null), $ != null && Zh($), R != null && ep(R), f.initEditMode(o !== "view-only"), ou(H ?? []), Xy(A ?? []), tp(N ?? []), np(T ?? []), rp(j ?? [], k), op(z ?? []), ip(Z ?? [], M), sp(W ?? []), hg(ee ?? 0), ap(q ?? []), sb(Me ?? []), fp(oe ?? null), hp(ne ?? null), lp(ie ?? null), pp(P ?? null), F && f.initPagesFromComponents(F, { initialCanvas: r }), ni(() => {
|
|
18679
18689
|
u != null && cp(u), p != null && dp(p), Mm(l ?? []);
|
|
18680
18690
|
}, [u, l, p]), ni(() => {
|
|
18681
|
-
!
|
|
18691
|
+
!de || !F || !le || Ws(de, {
|
|
18682
18692
|
namespace: m ?? "",
|
|
18683
18693
|
previewRevision: ve,
|
|
18684
18694
|
// A capture only needs somewhere to fetch its assets — not the checkout.
|
|
@@ -18695,7 +18705,7 @@ function f0({
|
|
|
18695
18705
|
})
|
|
18696
18706
|
});
|
|
18697
18707
|
}, [
|
|
18698
|
-
|
|
18708
|
+
de,
|
|
18699
18709
|
Oe,
|
|
18700
18710
|
re,
|
|
18701
18711
|
x,
|
|
@@ -18704,7 +18714,7 @@ function f0({
|
|
|
18704
18714
|
we,
|
|
18705
18715
|
F,
|
|
18706
18716
|
ve,
|
|
18707
|
-
|
|
18717
|
+
le
|
|
18708
18718
|
]), se(() => {
|
|
18709
18719
|
Pl(fe ?? null);
|
|
18710
18720
|
const K = gx(f);
|
|
@@ -18712,7 +18722,7 @@ function f0({
|
|
|
18712
18722
|
K(), Pl(null);
|
|
18713
18723
|
};
|
|
18714
18724
|
}, [fe]), se(() => {
|
|
18715
|
-
if (De(void 0), !
|
|
18725
|
+
if (De(void 0), !le || !x || !(m != null && m.trim()) || !(p != null && p.trim()))
|
|
18716
18726
|
return;
|
|
18717
18727
|
const K = new AbortController(), ke = Bg({
|
|
18718
18728
|
endpoint: x,
|
|
@@ -18833,14 +18843,14 @@ function f0({
|
|
|
18833
18843
|
});
|
|
18834
18844
|
continue;
|
|
18835
18845
|
}
|
|
18836
|
-
const
|
|
18846
|
+
const En = He.status === "rejected" ? He.errors.join(" ") || "The preview artifact probe was rejected." : tt(
|
|
18837
18847
|
He.error,
|
|
18838
18848
|
"The exact preview endpoint is unavailable."
|
|
18839
18849
|
);
|
|
18840
18850
|
yt(Pe(Be), {
|
|
18841
18851
|
status: "error",
|
|
18842
18852
|
reason: He.status === "rejected" ? "rejected" : "unavailable",
|
|
18843
|
-
message:
|
|
18853
|
+
message: En
|
|
18844
18854
|
});
|
|
18845
18855
|
}
|
|
18846
18856
|
for (const Be of Wl(
|
|
@@ -18867,14 +18877,14 @@ function f0({
|
|
|
18867
18877
|
});
|
|
18868
18878
|
continue;
|
|
18869
18879
|
}
|
|
18870
|
-
const
|
|
18880
|
+
const En = He.status === "rejected" ? He.errors.join(" ") || "The preview artifact was rejected." : tt(
|
|
18871
18881
|
He.error,
|
|
18872
18882
|
"The exact preview endpoint is unavailable."
|
|
18873
18883
|
);
|
|
18874
18884
|
yt(Pe(Be), {
|
|
18875
18885
|
status: "error",
|
|
18876
18886
|
reason: He.status === "rejected" ? "rejected" : "unavailable",
|
|
18877
|
-
message:
|
|
18887
|
+
message: En
|
|
18878
18888
|
});
|
|
18879
18889
|
}
|
|
18880
18890
|
})().catch((Ce) => {
|
|
@@ -18898,7 +18908,7 @@ function f0({
|
|
|
18898
18908
|
m,
|
|
18899
18909
|
p,
|
|
18900
18910
|
u,
|
|
18901
|
-
|
|
18911
|
+
le
|
|
18902
18912
|
]), se(() => {
|
|
18903
18913
|
let K = !0;
|
|
18904
18914
|
if (!I)
|
|
@@ -18936,17 +18946,17 @@ function f0({
|
|
|
18936
18946
|
}, [v]);
|
|
18937
18947
|
const B = Ie(null);
|
|
18938
18948
|
return se(() => {
|
|
18939
|
-
if (typeof document > "u" || !
|
|
18949
|
+
if (typeof document > "u" || !le) return;
|
|
18940
18950
|
const K = u ?? bn();
|
|
18941
18951
|
if (!K) return;
|
|
18942
|
-
const ke = `${K}|${p ??
|
|
18952
|
+
const ke = `${K}|${p ?? Xn()}`;
|
|
18943
18953
|
return B.current != null && B.current !== ke && Ig(), B.current = ke, Vv({
|
|
18944
18954
|
editor: f,
|
|
18945
18955
|
getPages: () => f.pages,
|
|
18946
18956
|
appOrigin: K,
|
|
18947
18957
|
baselineEnvironment: Xt()
|
|
18948
18958
|
});
|
|
18949
|
-
}, [u,
|
|
18959
|
+
}, [u, le, p]), /* @__PURE__ */ s(_v, { previewIdentityReady: le });
|
|
18950
18960
|
}
|
|
18951
18961
|
export {
|
|
18952
18962
|
py as DEFAULT_DESIGN_COMPILE_LIMITS,
|