@pygmalionjs/pygmalion 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{App-B0w9z2Br.js → App-BpS2IDVb.js} +1329 -1315
- package/dist-lib/pygmalion.js +37 -36
- package/dist-lib/testing.js +1 -1
- package/node/preview-artifact-plugin.mjs +1 -1
- package/package.json +1 -1
package/dist-lib/pygmalion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as O, jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import { b as V, m as He, v as Ke, c as qe, i as Ge, g as Le, e as K, d as Ve, a as Je, f as We, h as Qe, j as Xe, k as Ye, l as Ze, n as et, o as tt, p as nt, q as rt, r as ot, t as Y, S as st, A as it, u as ve, w as at, x as ct, y as lt, z as dt, B as ft, C as ut, D as pt, E as Ie } from "./App-
|
|
3
|
-
import { G as $n, H as Mn, I as Tn, J as Dn, K as kn, L as zn, M as _n, O as Fn, P as
|
|
2
|
+
import { b as V, m as He, v as Ke, c as qe, i as Ge, g as Le, e as K, d as Ve, a as Je, f as We, h as Qe, j as Xe, k as Ye, l as Ze, n as et, o as tt, p as nt, q as rt, r as ot, t as Y, S as st, A as it, u as ve, w as at, x as ct, y as lt, z as dt, B as ft, C as ut, D as pt, E as Ie } from "./App-BpS2IDVb.js";
|
|
3
|
+
import { G as $n, H as Mn, I as Tn, J as Dn, K as kn, L as zn, M as _n, O as Fn, P as Bn, Q as jn, R as Un, T as Hn, U as Kn, V as qn, W as Gn, X as Ln, Y as Vn } from "./App-BpS2IDVb.js";
|
|
4
4
|
import { createElement as xe, useMemo as Pe, useState as te, useRef as Ee, useCallback as Z, useEffect as ee } from "react";
|
|
5
5
|
function pe(e, t = /* @__PURE__ */ new Set()) {
|
|
6
6
|
if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
|
|
@@ -244,18 +244,18 @@ function yt(e) {
|
|
|
244
244
|
screenId: l,
|
|
245
245
|
nodeId: i.id
|
|
246
246
|
});
|
|
247
|
-
const
|
|
247
|
+
const j = /* @__PURE__ */ new Map();
|
|
248
248
|
for (const i of u)
|
|
249
249
|
for (const l of i.sourceKeys) {
|
|
250
|
-
const f =
|
|
250
|
+
const f = j.get(l) ?? {
|
|
251
251
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
252
252
|
screenIds: /* @__PURE__ */ new Set()
|
|
253
253
|
};
|
|
254
254
|
f.nodeIds.add(i.id);
|
|
255
255
|
for (const y of i.screenIds) f.screenIds.add(y);
|
|
256
|
-
|
|
256
|
+
j.set(l, f);
|
|
257
257
|
}
|
|
258
|
-
const W = [...
|
|
258
|
+
const W = [...j.entries()].map(([i, l]) => ({
|
|
259
259
|
sourceKey: i,
|
|
260
260
|
nodeIds: [...l.nodeIds].sort((f, y) => f.localeCompare(y)),
|
|
261
261
|
screenIds: [...l.screenIds].sort((f, y) => f.localeCompare(y)),
|
|
@@ -273,9 +273,9 @@ function yt(e) {
|
|
|
273
273
|
u.flatMap((i) => i.scenarioIds)
|
|
274
274
|
), x = new Set(
|
|
275
275
|
(e.nonVisualScenarioIds ?? []).map((i) => i.trim())
|
|
276
|
-
),
|
|
276
|
+
), B = z(
|
|
277
277
|
(e.scenarios ?? []).map((i) => i.id)
|
|
278
|
-
), k =
|
|
278
|
+
), k = B.filter(
|
|
279
279
|
(i) => !G.has(i) && !x.has(i)
|
|
280
280
|
);
|
|
281
281
|
for (const i of k)
|
|
@@ -297,8 +297,8 @@ function yt(e) {
|
|
|
297
297
|
edges: E.length,
|
|
298
298
|
connectedNodes: u.length - F.length,
|
|
299
299
|
disconnectedScreens: Q,
|
|
300
|
-
codeScenarios:
|
|
301
|
-
representedScenarios:
|
|
300
|
+
codeScenarios: B.length,
|
|
301
|
+
representedScenarios: B.filter(
|
|
302
302
|
(i) => G.has(i)
|
|
303
303
|
).length,
|
|
304
304
|
missingScenarios: k,
|
|
@@ -670,8 +670,8 @@ function $t(e, t) {
|
|
|
670
670
|
const F = C.shift();
|
|
671
671
|
if (!M.has(F)) {
|
|
672
672
|
M.add(F);
|
|
673
|
-
for (const
|
|
674
|
-
M.has(
|
|
673
|
+
for (const j of s.get(F) ?? [])
|
|
674
|
+
M.has(j) || C.push(j);
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
};
|
|
@@ -749,7 +749,7 @@ async function mn(e) {
|
|
|
749
749
|
throw V(null), t;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
const Tt = "pygmalion-preview", Dt = "unknown", kt = 512, zt = 2048, _t = 8 * 1024 * 1024, Ft = 128 * 1024 * 1024,
|
|
752
|
+
const Tt = "pygmalion-preview", Dt = "unknown", kt = 512, zt = 2048, _t = 8 * 1024 * 1024, Ft = 128 * 1024 * 1024, Bt = /* @__PURE__ */ new Set([
|
|
753
753
|
"__proto__",
|
|
754
754
|
"constructor",
|
|
755
755
|
"prototype"
|
|
@@ -760,7 +760,7 @@ function J(e, t) {
|
|
|
760
760
|
if (re(r)) return r;
|
|
761
761
|
throw new TypeError("Preview identity must be a non-empty bounded string.");
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function jt(e) {
|
|
764
764
|
const t = e ?? 1;
|
|
765
765
|
if (!Number.isSafeInteger(t) || t < 1)
|
|
766
766
|
throw new TypeError(
|
|
@@ -818,7 +818,7 @@ function gn({
|
|
|
818
818
|
const o = J(n), s = J(
|
|
819
819
|
e,
|
|
820
820
|
Dt
|
|
821
|
-
), a =
|
|
821
|
+
), a = jt(r), c = Ht(t);
|
|
822
822
|
return `${o}:${encodeURIComponent(s)}:recipe-v${a}:${c}`;
|
|
823
823
|
}
|
|
824
824
|
function yn(e) {
|
|
@@ -886,7 +886,7 @@ function Fe(e) {
|
|
|
886
886
|
return new TextEncoder().encode(e).byteLength;
|
|
887
887
|
}
|
|
888
888
|
function re(e) {
|
|
889
|
-
return typeof e == "string" && e.length > 0 && e.length <= kt && e === e.trim() && !
|
|
889
|
+
return typeof e == "string" && e.length > 0 && e.length <= kt && e === e.trim() && !Bt.has(e);
|
|
890
890
|
}
|
|
891
891
|
function qt(e) {
|
|
892
892
|
const t = /(?:expression\s*\(|-moz-binding\s*:|(?:^|[;{])\s*behavior\s*:)/i;
|
|
@@ -1268,11 +1268,11 @@ function Sn({
|
|
|
1268
1268
|
function Xt(e) {
|
|
1269
1269
|
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1271
|
+
function Be(e, t, r = "PygmalionCatalog") {
|
|
1272
1272
|
const n = (o) => Xt(o).replace(/-/g, "_");
|
|
1273
1273
|
return `${r}_${n(e)}_${n(t)}`;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function je(e, t) {
|
|
1276
1276
|
return {
|
|
1277
1277
|
id: e.id,
|
|
1278
1278
|
name: e.name,
|
|
@@ -1412,7 +1412,7 @@ function vn(e) {
|
|
|
1412
1412
|
t.set(s.id, {
|
|
1413
1413
|
page: s,
|
|
1414
1414
|
items: [o],
|
|
1415
|
-
registryName:
|
|
1415
|
+
registryName: Be(
|
|
1416
1416
|
e.kind,
|
|
1417
1417
|
s.id,
|
|
1418
1418
|
e.registryPrefix
|
|
@@ -1448,7 +1448,7 @@ function vn(e) {
|
|
|
1448
1448
|
registry: r,
|
|
1449
1449
|
collection: {
|
|
1450
1450
|
expectedCount: e.expectedCount ?? e.items.length,
|
|
1451
|
-
assets: e.items.map((o) =>
|
|
1451
|
+
assets: e.items.map((o) => je(o, e.pageFor(o).id)),
|
|
1452
1452
|
pages: n
|
|
1453
1453
|
}
|
|
1454
1454
|
};
|
|
@@ -1586,7 +1586,7 @@ function In(e) {
|
|
|
1586
1586
|
Ue(e.items);
|
|
1587
1587
|
const t = {}, r = [], n = [], o = e.maxVariantCells ?? 60;
|
|
1588
1588
|
for (const s of e.items) {
|
|
1589
|
-
const a =
|
|
1589
|
+
const a = Be(
|
|
1590
1590
|
e.kind,
|
|
1591
1591
|
s.id,
|
|
1592
1592
|
e.registryPrefix
|
|
@@ -1608,7 +1608,7 @@ function In(e) {
|
|
|
1608
1608
|
width: 1,
|
|
1609
1609
|
height: 1,
|
|
1610
1610
|
frameSizeMode: "content"
|
|
1611
|
-
}), n.push(
|
|
1611
|
+
}), n.push(je(s, s.id));
|
|
1612
1612
|
}
|
|
1613
1613
|
return {
|
|
1614
1614
|
registry: t,
|
|
@@ -1749,14 +1749,14 @@ async function L(e) {
|
|
|
1749
1749
|
return t;
|
|
1750
1750
|
}
|
|
1751
1751
|
function xn(e = {}) {
|
|
1752
|
-
var G, x,
|
|
1752
|
+
var G, x, B, k, Q;
|
|
1753
1753
|
const {
|
|
1754
1754
|
sessionId: t,
|
|
1755
1755
|
sessionStorageKey: r = ln,
|
|
1756
1756
|
autoStart: n = !0,
|
|
1757
1757
|
fetcher: o = fetch,
|
|
1758
1758
|
formatApplyMessage: s
|
|
1759
|
-
} = e, a = ((G = e.endpoints) == null ? void 0 : G.mirror) ?? ue.mirror, c = ((x = e.endpoints) == null ? void 0 : x.sessions) ?? ue.sessions, d = ((
|
|
1759
|
+
} = e, a = ((G = e.endpoints) == null ? void 0 : G.mirror) ?? ue.mirror, c = ((x = e.endpoints) == null ? void 0 : x.sessions) ?? ue.sessions, d = ((B = e.endpoints) == null ? void 0 : B.inspect) ?? ue.inspect, h = e.visualQa != null, u = ((k = e.visualQa) == null ? void 0 : k.endpoint) ?? dn, b = JSON.stringify(((Q = e.visualQa) == null ? void 0 : Q.eligibleFrameIds) ?? []), P = Pe(
|
|
1760
1760
|
() => JSON.parse(b),
|
|
1761
1761
|
[b]
|
|
1762
1762
|
), E = Pe(
|
|
@@ -1932,7 +1932,7 @@ function xn(e = {}) {
|
|
|
1932
1932
|
c,
|
|
1933
1933
|
h
|
|
1934
1934
|
]
|
|
1935
|
-
),
|
|
1935
|
+
), j = Z(
|
|
1936
1936
|
async (v) => {
|
|
1937
1937
|
if (v.length === 0) return { files: [] };
|
|
1938
1938
|
const g = await L(
|
|
@@ -1982,7 +1982,7 @@ function xn(e = {}) {
|
|
|
1982
1982
|
previewRevision: `${(p == null ? void 0 : p.headSha) ?? (p == null ? void 0 : p.baseDevSha) ?? m.commit ?? "pending"}:${(p == null ? void 0 : p.revision) ?? 0}`,
|
|
1983
1983
|
refresh: S,
|
|
1984
1984
|
previewVisual: F,
|
|
1985
|
-
inspectImpact:
|
|
1985
|
+
inspectImpact: j,
|
|
1986
1986
|
applyVisual: C,
|
|
1987
1987
|
revertLastVisual: W
|
|
1988
1988
|
};
|
|
@@ -2027,14 +2027,15 @@ function Rn({
|
|
|
2027
2027
|
}) {
|
|
2028
2028
|
const [A, S] = te(!T), [C, F] = te();
|
|
2029
2029
|
n && (n.assertComplete(), Ve(n));
|
|
2030
|
-
const
|
|
2031
|
-
|
|
2030
|
+
const j = e ?? (n == null ? void 0 : n.getRegistry()), W = t ?? (n == null ? void 0 : n.getTokens()), q = r ?? (n == null ? void 0 : n.getInitialPages());
|
|
2031
|
+
j && Je(j), W && We(W), at(o ?? null), s != null && Qe(s), a != null && Xe(a), Ye(c);
|
|
2032
2032
|
const G = C ?? d;
|
|
2033
2033
|
return G && q && A && Ze(G, {
|
|
2034
2034
|
namespace: c ?? "",
|
|
2035
2035
|
previewRevision: lt(),
|
|
2036
2036
|
appOrigin: ct(),
|
|
2037
2037
|
baselineEnvironment: et(),
|
|
2038
|
+
allowStaleIdentity: C == null && !!h,
|
|
2038
2039
|
pages: q.flatMap(
|
|
2039
2040
|
(x) => x.route && x.importPageId ? [
|
|
2040
2041
|
{
|
|
@@ -2067,8 +2068,8 @@ function Rn({
|
|
|
2067
2068
|
captureBaseUrl: s
|
|
2068
2069
|
}),
|
|
2069
2070
|
signal: x.signal
|
|
2070
|
-
}).then((
|
|
2071
|
-
!x.signal.aborted &&
|
|
2071
|
+
}).then((B) => {
|
|
2072
|
+
!x.signal.aborted && B.status === "accepted" && F(B.artifact);
|
|
2072
2073
|
}), () => x.abort();
|
|
2073
2074
|
}, [
|
|
2074
2075
|
h,
|
|
@@ -2082,10 +2083,10 @@ function Rn({
|
|
|
2082
2083
|
return Y(void 0), S(!0), () => {
|
|
2083
2084
|
x = !1;
|
|
2084
2085
|
};
|
|
2085
|
-
const
|
|
2086
|
+
const B = new AbortController();
|
|
2086
2087
|
return S(!1), Y(void 0), V(null), _e({
|
|
2087
2088
|
endpoint: M,
|
|
2088
|
-
signal:
|
|
2089
|
+
signal: B.signal,
|
|
2089
2090
|
pages: K.pages.map((k) => ({
|
|
2090
2091
|
...k,
|
|
2091
2092
|
id: k.importPageId ?? k.id,
|
|
@@ -2099,7 +2100,7 @@ function Rn({
|
|
|
2099
2100
|
}).finally(() => {
|
|
2100
2101
|
x && S(!0);
|
|
2101
2102
|
}), () => {
|
|
2102
|
-
x = !1,
|
|
2103
|
+
x = !1, B.abort(), Y(void 0), V(null);
|
|
2103
2104
|
};
|
|
2104
2105
|
}, [
|
|
2105
2106
|
n,
|
|
@@ -2152,9 +2153,9 @@ export {
|
|
|
2152
2153
|
_n as createStoryboardGraphViewModel,
|
|
2153
2154
|
Fn as createStoryboardRouteUrl,
|
|
2154
2155
|
Xt as designCatalogKey,
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2156
|
+
Be as designCatalogRegistryName,
|
|
2157
|
+
Bn as expandDesignScreenCasesViewports,
|
|
2158
|
+
jn as expandDesignScreenCollectionViewports,
|
|
2158
2159
|
Un as getRecommendedPygmalionPreviewConcurrency,
|
|
2159
2160
|
et as getStoryboardBaselineEnvironment,
|
|
2160
2161
|
ze as getStoryboardDiscoveryBaselineEnvironment,
|
package/dist-lib/testing.js
CHANGED
|
@@ -46,8 +46,8 @@ function requestedCaptureBaseUrl(url, requestHost) {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const target = new URL(value);
|
|
50
49
|
const requestOrigin = new URL(`http://${requestHost}`);
|
|
50
|
+
const target = new URL(value, requestOrigin);
|
|
51
51
|
if (
|
|
52
52
|
!['http:', 'https:'].includes(target.protocol) ||
|
|
53
53
|
target.host.toLowerCase() !== requestOrigin.host.toLowerCase() ||
|